diff --git a/VencordDesktop/settings.json b/VencordDesktop/settings.json index c99d322..98b754d 100644 --- a/VencordDesktop/settings.json +++ b/VencordDesktop/settings.json @@ -6,9 +6,9 @@ "splashColor": "rgb(219, 222, 225)", "splashBackground": "rgb(0, 7, 32)", "windowBounds": { - "x": 2, + "x": 962, "y": 44, - "width": 1916, + "width": 956, "height": 1034 }, "maximized": true, diff --git a/VencordDesktop/vencordDist/vencordDesktopMain.js b/VencordDesktop/vencordDist/vencordDesktopMain.js index a4405b8..13b0abf 100644 --- a/VencordDesktop/vencordDist/vencordDesktopMain.js +++ b/VencordDesktop/vencordDist/vencordDesktopMain.js @@ -1,8 +1,8 @@ -// Vencord 81fb7c6 +// Vencord 96126fa // Standalone: true // Platform: Universal // Updater disabled: false -"use strict";var Yn=Object.create;var Te=Object.defineProperty;var Xn=Object.getOwnPropertyDescriptor;var Jn=Object.getOwnPropertyNames;var Qn=Object.getPrototypeOf,qn=Object.prototype.hasOwnProperty;var O=(e,n)=>()=>(e&&(n=e(e=0)),n);var Ye=(e,n)=>{for(var t in n)Te(e,t,{get:n[t],enumerable:!0})},$n=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Jn(n))!qn.call(e,i)&&i!==t&&Te(e,i,{get:()=>n[i],enumerable:!(r=Xn(n,i))||r.enumerable});return e};var et=(e,n,t)=>(t=e!=null?Yn(Qn(e)):{},$n(n||!e||!e.__esModule?Te(t,"default",{value:e,enumerable:!0}):t,e));var u=O(()=>{"use strict"});var te,xe=O(()=>{u();te="81fb7c6"});var B,Ee=O(()=>{u();B="Vendicated/Vencord"});var Xe,Je=O(()=>{"use strict";u();xe();Ee();Xe=`Vencord/${te}${B?` (https://github.com/${B})`:""}`});var le=O(()=>{"use strict";u()});function H(e,n={}){return new Promise((t,r)=>{Qe.default.get(e,n,i=>{let{statusCode:o,statusMessage:a,headers:s}=i;if(o>=400)return void r(`${o}: ${a} - ${e}`);if(o>=300)return void t(H(s.location,n));let c=[];i.on("error",r),i.on("data",f=>c.push(f)),i.once("end",()=>t(Buffer.concat(c)))})})}var Qe,De=O(()=>{"use strict";u();Qe=et(require("https"))});function re(e){return async function(){try{return{ok:!0,value:await e(...arguments)}}catch(n){return{ok:!1,error:n instanceof Error?{...n}:n}}}}var qe,$e=O(()=>{"use strict";u();qe=["vencordDesktopMain.js","vencordDesktopPreload.js","vencordDesktopRenderer.js","vencordDesktopRenderer.css"]});var it={};async function rn(e){return H(nt+e,{headers:{Accept:"application/vnd.github+json","User-Agent":Xe}})}async function tt(){if(!await an())return[];let n=await rn(`/compare/${te}...HEAD`);return JSON.parse(n.toString("utf-8")).commits.map(r=>({hash:r.sha.slice(0,7),author:r.author.login,message:r.commit.message}))}async function an(){let e=await rn("/releases/latest"),n=JSON.parse(e.toString());return n.name.slice(n.name.lastIndexOf(" ")+1)===te?!1:(n.assets.forEach(({name:r,browser_download_url:i})=>{qe.some(o=>r.startsWith(o))&&Re.push([r,i])}),!0)}async function rt(){return await Promise.all(Re.map(async([e,n])=>(0,nn.writeFile)((0,tn.join)(__dirname,e),await H(n)))),Re=[],!0}var ie,nn,tn,nt,Re,on=O(()=>{"use strict";u();Je();le();ie=require("electron"),nn=require("fs/promises"),tn=require("path");xe();Ee();De();$e();nt=`https://api.github.com/repos/${B}`,Re=[];ie.ipcMain.handle("VencordGetRepo",re(()=>`https://github.com/${B}`));ie.ipcMain.handle("VencordGetUpdates",re(tt));ie.ipcMain.handle("VencordUpdate",re(an));ie.ipcMain.handle("VencordBuild",re(rt))});u();var Z=require("electron"),Bn=require("path");u();u();Promise.resolve().then(()=>on());u();le();var ke=require("electron");u();var cn={};u();var sn=require("electron");sn.app.on("browser-window-created",(e,n)=>{n.webContents.on("frame-created",(t,{frame:r})=>{r.once("dom-ready",()=>{if(r.url.startsWith("https://open.spotify.com/embed/")){let i=he().plugins?.FixSpotifyEmbeds;if(!i?.enabled)return;r.executeJavaScript(` +"use strict";var Yn=Object.create;var Te=Object.defineProperty;var Xn=Object.getOwnPropertyDescriptor;var Jn=Object.getOwnPropertyNames;var Qn=Object.getPrototypeOf,qn=Object.prototype.hasOwnProperty;var O=(e,n)=>()=>(e&&(n=e(e=0)),n);var Ye=(e,n)=>{for(var t in n)Te(e,t,{get:n[t],enumerable:!0})},$n=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Jn(n))!qn.call(e,i)&&i!==t&&Te(e,i,{get:()=>n[i],enumerable:!(r=Xn(n,i))||r.enumerable});return e};var et=(e,n,t)=>(t=e!=null?Yn(Qn(e)):{},$n(n||!e||!e.__esModule?Te(t,"default",{value:e,enumerable:!0}):t,e));var u=O(()=>{"use strict"});var te,xe=O(()=>{u();te="96126fa"});var B,Ee=O(()=>{u();B="Vendicated/Vencord"});var Xe,Je=O(()=>{"use strict";u();xe();Ee();Xe=`Vencord/${te}${B?` (https://github.com/${B})`:""}`});var le=O(()=>{"use strict";u()});function H(e,n={}){return new Promise((t,r)=>{Qe.default.get(e,n,i=>{let{statusCode:o,statusMessage:a,headers:s}=i;if(o>=400)return void r(`${o}: ${a} - ${e}`);if(o>=300)return void t(H(s.location,n));let c=[];i.on("error",r),i.on("data",f=>c.push(f)),i.once("end",()=>t(Buffer.concat(c)))})})}var Qe,De=O(()=>{"use strict";u();Qe=et(require("https"))});function re(e){return async function(){try{return{ok:!0,value:await e(...arguments)}}catch(n){return{ok:!1,error:n instanceof Error?{...n}:n}}}}var qe,$e=O(()=>{"use strict";u();qe=["vencordDesktopMain.js","vencordDesktopPreload.js","vencordDesktopRenderer.js","vencordDesktopRenderer.css"]});var it={};async function rn(e){return H(nt+e,{headers:{Accept:"application/vnd.github+json","User-Agent":Xe}})}async function tt(){if(!await an())return[];let n=await rn(`/compare/${te}...HEAD`);return JSON.parse(n.toString("utf-8")).commits.map(r=>({hash:r.sha.slice(0,7),author:r.author.login,message:r.commit.message}))}async function an(){let e=await rn("/releases/latest"),n=JSON.parse(e.toString());return n.name.slice(n.name.lastIndexOf(" ")+1)===te?!1:(n.assets.forEach(({name:r,browser_download_url:i})=>{qe.some(o=>r.startsWith(o))&&Re.push([r,i])}),!0)}async function rt(){return await Promise.all(Re.map(async([e,n])=>(0,nn.writeFile)((0,tn.join)(__dirname,e),await H(n)))),Re=[],!0}var ie,nn,tn,nt,Re,on=O(()=>{"use strict";u();Je();le();ie=require("electron"),nn=require("fs/promises"),tn=require("path");xe();Ee();De();$e();nt=`https://api.github.com/repos/${B}`,Re=[];ie.ipcMain.handle("VencordGetRepo",re(()=>`https://github.com/${B}`));ie.ipcMain.handle("VencordGetUpdates",re(tt));ie.ipcMain.handle("VencordUpdate",re(an));ie.ipcMain.handle("VencordBuild",re(rt))});u();var Z=require("electron"),Bn=require("path");u();u();Promise.resolve().then(()=>on());u();le();var ke=require("electron");u();var cn={};u();var sn=require("electron");sn.app.on("browser-window-created",(e,n)=>{n.webContents.on("frame-created",(t,{frame:r})=>{r.once("dom-ready",()=>{if(r.url.startsWith("https://open.spotify.com/embed/")){let i=he().plugins?.FixSpotifyEmbeds;if(!i?.enabled)return;r.executeJavaScript(` const original = Audio.prototype.play; Audio.prototype.play = function() { this.volume = ${i.volume/100||.1}; diff --git a/VencordDesktop/vencordDist/vencordDesktopMain.js.map b/VencordDesktop/vencordDist/vencordDesktopMain.js.map index e3e70a3..a7bc570 100644 --- a/VencordDesktop/vencordDist/vencordDesktopMain.js.map +++ b/VencordDesktop/vencordDist/vencordDesktopMain.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../scripts/build/inject/react.mjs", "git-hash:~git-hash", "git-remote:~git-remote", "../src/utils/constants.ts", "../src/utils/IpcEvents.ts", "../src/main/utils/simpleGet.ts", "../src/main/updater/common.ts", "../src/main/updater/http.ts", "../src/main/index.ts", "../src/main/ipcMain.ts", "../src/main/updater/index.ts", "../src/main/ipcPlugins.ts", "import-natives:~pluginNatives", "../src/plugins/fixSpotifyEmbeds.desktop/native.ts", "../src/plugins/openInApp/native.ts", "../src/plugins/voiceMessages/native.ts", "../src/utils/debounce.ts", "../src/utils/Queue.ts", "include-file:~fileContent/monacoWin.html;base64", "../src/main/themes/index.ts", "../src/main/utils/constants.ts", "../src/main/utils/externalLinks.ts", "../src/main/utils/extensions.ts", "../node_modules/.pnpm/fflate@0.7.4/node_modules/fflate/esm/index.mjs", "../src/main/utils/crxToZip.ts"], - "sourcesContent": ["/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const VencordFragment = /* #__PURE__*/ Symbol.for(\"react.fragment\");\nexport let VencordCreateElement =\n (...args) => (VencordCreateElement = Vencord.Webpack.Common.React.createElement)(...args);\n", "export default \"81fb7c6\"", "export default \"Vendicated/Vencord\"", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport gitHash from \"~git-hash\";\nimport gitRemote from \"~git-remote\";\n\nexport {\n gitHash,\n gitRemote\n};\n\nexport const WEBPACK_CHUNK = \"webpackChunkdiscord_app\";\nexport const REACT_GLOBAL = \"Vencord.Webpack.Common.React\";\nexport const VENCORD_USER_AGENT = `Vencord/${gitHash}${gitRemote ? ` (https://github.com/${gitRemote})` : \"\"}`;\nexport const SUPPORT_CHANNEL_ID = \"1026515880080842772\";\n\nexport interface Dev {\n name: string;\n id: bigint;\n badge?: boolean;\n}\n\n/**\n * If you made a plugin or substantial contribution, add yourself here.\n * This object is used for the plugin author list, as well as to add a contributor badge to your profile.\n * If you wish to stay fully anonymous, feel free to set ID to 0n.\n * If you are fine with attribution but don't want the badge, add badge: false\n */\nexport const Devs = /* #__PURE__*/ Object.freeze({\n Ven: {\n name: \"Vendicated\",\n id: 343383572805058560n\n },\n Arjix: {\n name: \"ArjixWasTaken\",\n id: 674710789138939916n\n },\n Cyn: {\n name: \"Cynosphere\",\n id: 150745989836308480n\n },\n Megu: {\n name: \"Megumin\",\n id: 545581357812678656n\n },\n botato: {\n name: \"botato\",\n id: 440990343899643943n\n },\n obscurity: {\n name: \"obscurity\",\n id: 336678828233588736n,\n },\n rushii: {\n name: \"rushii\",\n id: 295190422244950017n\n },\n Glitch: {\n name: \"Glitchy\",\n id: 269567451199569920n\n },\n Samu: {\n name: \"Samu\",\n id: 702973430449832038n,\n },\n Animal: {\n name: \"Animal\",\n id: 118437263754395652n\n },\n MaiKokain: {\n name: \"Mai\",\n id: 722647978577363026n\n },\n echo: {\n name: \"ECHO\",\n id: 712639419785412668n\n },\n katlyn: {\n name: \"katlyn\",\n id: 250322741406859265n\n },\n nea: {\n name: \"nea\",\n id: 310702108997320705n,\n },\n Nuckyz: {\n name: \"Nuckyz\",\n id: 235834946571337729n\n },\n D3SOX: {\n name: \"D3SOX\",\n id: 201052085641281538n\n },\n Nickyux: {\n name: \"Nickyux\",\n id: 427146305651998721n\n },\n mantikafasi: {\n name: \"mantikafasi\",\n id: 287555395151593473n\n },\n Xinto: {\n name: \"Xinto\",\n id: 423915768191647755n\n },\n JacobTm: {\n name: \"Jacob.Tm\",\n id: 302872992097107991n\n },\n DustyAngel47: {\n name: \"DustyAngel47\",\n id: 714583473804935238n\n },\n BanTheNons: {\n name: \"BanTheNons\",\n id: 460478012794863637n\n },\n BigDuck: {\n name: \"BigDuck\",\n id: 1024588272623681609n\n },\n AverageReactEnjoyer: {\n name: \"Average React Enjoyer\",\n id: 1004904120056029256n\n },\n adryd: {\n name: \"adryd\",\n id: 0n\n },\n Tyman: {\n name: \"Tyman\",\n id: 487443883127472129n\n },\n afn: {\n name: \"afn\",\n id: 420043923822608384n\n },\n KraXen72: {\n name: \"KraXen72\",\n id: 379304073515499530n\n },\n kemo: {\n name: \"kemo\",\n id: 299693897859465228n\n },\n dzshn: {\n name: \"dzshn\",\n id: 310449948011528192n\n },\n Ducko: {\n name: \"Ducko\",\n id: 506482395269169153n\n },\n jewdev: {\n name: \"jewdev\",\n id: 222369866529636353n\n },\n Luna: {\n name: \"Luny\",\n id: 821472922140803112n\n },\n Vap: {\n name: \"Vap0r1ze\",\n id: 454072114492866560n\n },\n KingFish: {\n name: \"King Fish\",\n id: 499400512559382538n\n },\n Commandtechno: {\n name: \"Commandtechno\",\n id: 296776625432035328n,\n },\n TheSun: {\n name: \"ActuallyTheSun\",\n id: 406028027768733696n\n },\n axyie: {\n name: \"'ax\",\n id: 273562710745284628n,\n },\n pointy: {\n name: \"pointy\",\n id: 99914384989519872n\n },\n SammCheese: {\n name: \"Samm-Cheese\",\n id: 372148345894076416n\n },\n zt: {\n name: \"zt\",\n id: 289556910426816513n\n },\n captain: {\n name: \"Captain\",\n id: 347366054806159360n\n },\n nick: {\n name: \"nick\",\n id: 347884694408265729n,\n badge: false\n },\n whqwert: {\n name: \"whqwert\",\n id: 586239091520176128n\n },\n lewisakura: {\n name: \"lewisakura\",\n id: 96269247411400704n\n },\n RuiNtD: {\n name: \"RuiNtD\",\n id: 157917665162297344n\n },\n hunt: {\n name: \"hunt-g\",\n id: 222800179697287168n\n },\n cloudburst: {\n name: \"cloudburst\",\n id: 892128204150685769n\n },\n Aria: {\n name: \"Syncxv\",\n id: 549244932213309442n,\n },\n TheKodeToad: {\n name: \"TheKodeToad\",\n id: 706152404072267788n\n },\n LordElias: {\n name: \"LordElias\",\n id: 319460781567639554n\n },\n juby: {\n name: \"Juby210\",\n id: 324622488644616195n\n },\n Alyxia: {\n name: \"Alyxia Sother\",\n id: 952185386350829688n\n },\n Remty: {\n name: \"Remty\",\n id: 335055032204656642n\n },\n skyevg: {\n name: \"skyevg\",\n id: 1090310844283363348n\n },\n Dziurwa: {\n name: \"Dziurwa\",\n id: 1001086404203389018n\n },\n F53: {\n name: \"F53\",\n id: 280411966126948353n\n },\n AutumnVN: {\n name: \"AutumnVN\",\n id: 393694671383166998n\n },\n pylix: {\n name: \"pylix\",\n id: 492949202121261067n\n },\n Tyler: {\n name: \"\\\\\\\\GGTyler\\\\\\\\\",\n id: 143117463788191746n\n },\n RyanCaoDev: {\n name: \"RyanCaoDev\",\n id: 952235800110694471n,\n },\n Strencher: {\n name: \"Strencher\",\n id: 415849376598982656n\n },\n FieryFlames: {\n name: \"Fiery\",\n id: 890228870559698955n\n },\n KannaDev: {\n name: \"Kanna\",\n id: 317728561106518019n\n },\n carince: {\n name: \"carince\",\n id: 818323528755314698n\n },\n PandaNinjas: {\n name: \"PandaNinjas\",\n id: 455128749071925248n\n },\n CatNoir: {\n name: \"CatNoir\",\n id: 260371016348336128n\n },\n outfoxxed: {\n name: \"outfoxxed\",\n id: 837425748435796060n\n },\n UwUDev: {\n name: \"UwU\",\n id: 691413039156690994n,\n },\n amia: {\n name: \"amia\",\n id: 142007603549962240n\n },\n phil: {\n name: \"phil\",\n id: 305288513941667851n\n },\n ImLvna: {\n name: \"Luna <3\",\n id: 799319081723232267n\n },\n rad: {\n name: \"rad\",\n id: 610945092504780823n\n },\n AndrewDLO: {\n name: \"Andrew-DLO\",\n id: 434135504792059917n\n },\n HypedDomi: {\n name: \"HypedDomi\",\n id: 354191516979429376n\n },\n Rini: {\n name: \"Rini\",\n id: 1079479184478441643n\n },\n castdrian: {\n name: \"castdrian\",\n id: 224617799434108928n\n },\n Arrow: {\n name: \"arrow\",\n id: 958158495302176778n\n },\n bb010g: {\n name: \"bb010g\",\n id: 72791153467990016n,\n },\n Lumap: {\n name: \"lumap\",\n id: 635383782576357407n\n },\n Dolfies: {\n name: \"Dolfies\",\n id: 852892297661906993n,\n },\n RuukuLada: {\n name: \"RuukuLada\",\n id: 119705748346241027n,\n },\n blahajZip: {\n name: \"blahaj.zip\",\n id: 683954422241427471n,\n },\n archeruwu: {\n name: \"archer_uwu\",\n id: 160068695383736320n\n },\n ProffDea: {\n name: \"ProffDea\",\n id: 609329952180928513n\n },\n ant0n: {\n name: \"ant0n\",\n id: 145224646868860928n\n },\n} satisfies Record);\n\n// iife so #__PURE__ works correctly\nexport const DevsById = /* #__PURE__*/ (() =>\n Object.freeze(Object.fromEntries(\n Object.entries(Devs)\n .filter(d => d[1].id !== 0n)\n .map(([_, v]) => [v.id, v] as const)\n ))\n)() as Record;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const enum IpcEvents {\n QUICK_CSS_UPDATE = \"VencordQuickCssUpdate\",\n THEME_UPDATE = \"VencordThemeUpdate\",\n GET_QUICK_CSS = \"VencordGetQuickCss\",\n SET_QUICK_CSS = \"VencordSetQuickCss\",\n UPLOAD_THEME = \"VencordUploadTheme\",\n DELETE_THEME = \"VencordDeleteTheme\",\n GET_THEMES_DIR = \"VencordGetThemesDir\",\n GET_THEMES_LIST = \"VencordGetThemesList\",\n GET_THEME_DATA = \"VencordGetThemeData\",\n GET_THEME_SYSTEM_VALUES = \"VencordGetThemeSystemValues\",\n GET_SETTINGS_DIR = \"VencordGetSettingsDir\",\n GET_SETTINGS = \"VencordGetSettings\",\n SET_SETTINGS = \"VencordSetSettings\",\n OPEN_EXTERNAL = \"VencordOpenExternal\",\n OPEN_QUICKCSS = \"VencordOpenQuickCss\",\n GET_UPDATES = \"VencordGetUpdates\",\n GET_REPO = \"VencordGetRepo\",\n UPDATE = \"VencordUpdate\",\n BUILD = \"VencordBuild\",\n OPEN_MONACO_EDITOR = \"VencordOpenMonacoEditor\",\n\n GET_PLUGIN_IPC_METHOD_MAP = \"VencordGetPluginIpcMethodMap\",\n\n OPEN_IN_APP__RESOLVE_REDIRECT = \"VencordOIAResolveRedirect\",\n VOICE_MESSAGES_READ_RECORDING = \"VencordVMReadRecording\",\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport https from \"https\";\n\nexport function get(url: string, options: https.RequestOptions = {}) {\n return new Promise((resolve, reject) => {\n https.get(url, options, res => {\n const { statusCode, statusMessage, headers } = res;\n if (statusCode! >= 400)\n return void reject(`${statusCode}: ${statusMessage} - ${url}`);\n if (statusCode! >= 300)\n return void resolve(get(headers.location!, options));\n\n const chunks = [] as Buffer[];\n res.on(\"error\", reject);\n\n res.on(\"data\", chunk => chunks.push(chunk));\n res.once(\"end\", () => resolve(Buffer.concat(chunks)));\n });\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const VENCORD_FILES = [\n IS_DISCORD_DESKTOP ? \"patcher.js\" : \"vencordDesktopMain.js\",\n IS_DISCORD_DESKTOP ? \"preload.js\" : \"vencordDesktopPreload.js\",\n IS_DISCORD_DESKTOP ? \"renderer.js\" : \"vencordDesktopRenderer.js\",\n IS_DISCORD_DESKTOP ? \"renderer.css\" : \"vencordDesktopRenderer.css\",\n];\n\nexport function serializeErrors(func: (...args: any[]) => any) {\n return async function () {\n try {\n return {\n ok: true,\n value: await func(...arguments)\n };\n } catch (e: any) {\n return {\n ok: false,\n error: e instanceof Error ? {\n // prototypes get lost, so turn error into plain object\n ...e\n } : e\n };\n }\n };\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { VENCORD_USER_AGENT } from \"@utils/constants\";\nimport { IpcEvents } from \"@utils/IpcEvents\";\nimport { ipcMain } from \"electron\";\nimport { writeFile } from \"fs/promises\";\nimport { join } from \"path\";\n\nimport gitHash from \"~git-hash\";\nimport gitRemote from \"~git-remote\";\n\nimport { get } from \"../utils/simpleGet\";\nimport { serializeErrors, VENCORD_FILES } from \"./common\";\n\nconst API_BASE = `https://api.github.com/repos/${gitRemote}`;\nlet PendingUpdates = [] as [string, string][];\n\nasync function githubGet(endpoint: string) {\n return get(API_BASE + endpoint, {\n headers: {\n Accept: \"application/vnd.github+json\",\n // \"All API requests MUST include a valid User-Agent header.\n // Requests with no User-Agent header will be rejected.\"\n \"User-Agent\": VENCORD_USER_AGENT\n }\n });\n}\n\nasync function calculateGitChanges() {\n const isOutdated = await fetchUpdates();\n if (!isOutdated) return [];\n\n const res = await githubGet(`/compare/${gitHash}...HEAD`);\n\n const data = JSON.parse(res.toString(\"utf-8\"));\n return data.commits.map((c: any) => ({\n // github api only sends the long sha\n hash: c.sha.slice(0, 7),\n author: c.author.login,\n message: c.commit.message\n }));\n}\n\nasync function fetchUpdates() {\n const release = await githubGet(\"/releases/latest\");\n\n const data = JSON.parse(release.toString());\n const hash = data.name.slice(data.name.lastIndexOf(\" \") + 1);\n if (hash === gitHash)\n return false;\n\n data.assets.forEach(({ name, browser_download_url }) => {\n if (VENCORD_FILES.some(s => name.startsWith(s))) {\n PendingUpdates.push([name, browser_download_url]);\n }\n });\n return true;\n}\n\nasync function applyUpdates() {\n await Promise.all(PendingUpdates.map(\n async ([name, data]) => writeFile(\n join(__dirname, name),\n await get(data)\n )\n ));\n PendingUpdates = [];\n return true;\n}\n\nipcMain.handle(IpcEvents.GET_REPO, serializeErrors(() => `https://github.com/${gitRemote}`));\nipcMain.handle(IpcEvents.GET_UPDATES, serializeErrors(calculateGitChanges));\nipcMain.handle(IpcEvents.UPDATE, serializeErrors(fetchUpdates));\nipcMain.handle(IpcEvents.BUILD, serializeErrors(applyUpdates));\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { app, protocol, session } from \"electron\";\nimport { join } from \"path\";\n\nimport { ensureSafePath, getSettings } from \"./ipcMain\";\nimport { IS_VANILLA, THEMES_DIR } from \"./utils/constants\";\nimport { installExt } from \"./utils/extensions\";\n\nif (IS_VESKTOP || !IS_VANILLA) {\n app.whenReady().then(() => {\n // Source Maps! Maybe there's a better way but since the renderer is executed\n // from a string I don't think any other form of sourcemaps would work\n protocol.registerFileProtocol(\"vencord\", ({ url: unsafeUrl }, cb) => {\n let url = unsafeUrl.slice(\"vencord://\".length);\n if (url.endsWith(\"/\")) url = url.slice(0, -1);\n if (url.startsWith(\"/themes/\")) {\n const theme = url.slice(\"/themes/\".length);\n const safeUrl = ensureSafePath(THEMES_DIR, theme);\n if (!safeUrl) {\n cb({ statusCode: 403 });\n return;\n }\n cb(safeUrl.replace(/\\?v=\\d+$/, \"\"));\n return;\n }\n switch (url) {\n case \"renderer.js.map\":\n case \"vencordDesktopRenderer.js.map\":\n case \"preload.js.map\":\n case \"vencordDesktopPreload.js.map\":\n case \"patcher.js.map\":\n case \"vencordDesktopMain.js.map\":\n cb(join(__dirname, url));\n break;\n default:\n cb({ statusCode: 403 });\n }\n });\n\n try {\n if (getSettings().enableReactDevtools)\n installExt(\"fmkadmapgofadopljbjfkapdkoienihi\")\n .then(() => console.info(\"[Vencord] Installed React Developer Tools\"))\n .catch(err => console.error(\"[Vencord] Failed to install React Developer Tools\", err));\n } catch { }\n\n\n const findHeader = (headers: Record, headerName: Lowercase) => {\n return Object.keys(headers).find(h => h.toLowerCase() === headerName);\n };\n\n // Remove CSP\n type PolicyResult = Record;\n\n const parsePolicy = (policy: string): PolicyResult => {\n const result: PolicyResult = {};\n policy.split(\";\").forEach(directive => {\n const [directiveKey, ...directiveValue] = directive.trim().split(/\\s+/g);\n if (directiveKey && !Object.prototype.hasOwnProperty.call(result, directiveKey)) {\n result[directiveKey] = directiveValue;\n }\n });\n\n return result;\n };\n const stringifyPolicy = (policy: PolicyResult): string =>\n Object.entries(policy)\n .filter(([, values]) => values?.length)\n .map(directive => directive.flat().join(\" \"))\n .join(\"; \");\n\n const patchCsp = (headers: Record) => {\n const header = findHeader(headers, \"content-security-policy\");\n\n if (header) {\n const csp = parsePolicy(headers[header][0]);\n\n for (const directive of [\"style-src\", \"connect-src\", \"img-src\", \"font-src\", \"media-src\", \"worker-src\"]) {\n csp[directive] ??= [];\n csp[directive].push(\"*\", \"blob:\", \"data:\", \"vencord:\", \"'unsafe-inline'\");\n }\n\n // TODO: Restrict this to only imported packages with fixed version.\n // Perhaps auto generate with esbuild\n csp[\"script-src\"] ??= [];\n csp[\"script-src\"].push(\"'unsafe-eval'\", \"https://unpkg.com\", \"https://cdnjs.cloudflare.com\");\n headers[header] = [stringifyPolicy(csp)];\n }\n };\n\n session.defaultSession.webRequest.onHeadersReceived(({ responseHeaders, resourceType }, cb) => {\n if (responseHeaders) {\n if (resourceType === \"mainFrame\")\n patchCsp(responseHeaders);\n\n // Fix hosts that don't properly set the css content type, such as\n // raw.githubusercontent.com\n if (resourceType === \"stylesheet\") {\n const header = findHeader(responseHeaders, \"content-type\");\n if (header)\n responseHeaders[header] = [\"text/css\"];\n }\n }\n\n cb({ cancel: false, responseHeaders });\n });\n\n // assign a noop to onHeadersReceived to prevent other mods from adding their own incompatible ones.\n // For instance, OpenAsar adds their own that doesn't fix content-type for stylesheets which makes it\n // impossible to load css from github raw despite our fix above\n session.defaultSession.webRequest.onHeadersReceived = () => { };\n });\n}\n\nif (IS_DISCORD_DESKTOP) {\n require(\"./patcher\");\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./updater\";\nimport \"./ipcPlugins\";\n\nimport { debounce } from \"@utils/debounce\";\nimport { IpcEvents } from \"@utils/IpcEvents\";\nimport { Queue } from \"@utils/Queue\";\nimport { BrowserWindow, ipcMain, shell, systemPreferences } from \"electron\";\nimport { mkdirSync, readFileSync, watch } from \"fs\";\nimport { open, readdir, readFile, writeFile } from \"fs/promises\";\nimport { join, normalize } from \"path\";\n\nimport monacoHtml from \"~fileContent/monacoWin.html;base64\";\n\nimport { getThemeInfo, stripBOM, UserThemeHeader } from \"./themes\";\nimport { ALLOWED_PROTOCOLS, QUICKCSS_PATH, SETTINGS_DIR, SETTINGS_FILE, THEMES_DIR } from \"./utils/constants\";\nimport { makeLinksOpenExternally } from \"./utils/externalLinks\";\n\nmkdirSync(SETTINGS_DIR, { recursive: true });\nmkdirSync(THEMES_DIR, { recursive: true });\n\nexport function ensureSafePath(basePath: string, path: string) {\n const normalizedBasePath = normalize(basePath);\n const newPath = join(basePath, path);\n const normalizedPath = normalize(newPath);\n return normalizedPath.startsWith(normalizedBasePath) ? normalizedPath : null;\n}\n\nfunction readCss() {\n return readFile(QUICKCSS_PATH, \"utf-8\").catch(() => \"\");\n}\n\nasync function listThemes(): Promise {\n const files = await readdir(THEMES_DIR).catch(() => []);\n\n const themeInfo: UserThemeHeader[] = [];\n\n for (const fileName of files) {\n if (!fileName.endsWith(\".css\")) continue;\n\n const data = await getThemeData(fileName).then(stripBOM).catch(() => null);\n if (data == null) continue;\n\n themeInfo.push(getThemeInfo(data, fileName));\n }\n\n return themeInfo;\n}\n\nfunction getThemeData(fileName: string) {\n fileName = fileName.replace(/\\?v=\\d+$/, \"\");\n const safePath = ensureSafePath(THEMES_DIR, fileName);\n if (!safePath) return Promise.reject(`Unsafe path ${fileName}`);\n return readFile(safePath, \"utf-8\");\n}\n\nexport function readSettings() {\n try {\n return readFileSync(SETTINGS_FILE, \"utf-8\");\n } catch {\n return \"{}\";\n }\n}\n\nexport function getSettings(): typeof import(\"@api/Settings\").Settings {\n try {\n return JSON.parse(readSettings());\n } catch {\n return {} as any;\n }\n}\n\nipcMain.handle(IpcEvents.OPEN_QUICKCSS, () => shell.openPath(QUICKCSS_PATH));\n\nipcMain.handle(IpcEvents.OPEN_EXTERNAL, (_, url) => {\n try {\n var { protocol } = new URL(url);\n } catch {\n throw \"Malformed URL\";\n }\n if (!ALLOWED_PROTOCOLS.includes(protocol))\n throw \"Disallowed protocol.\";\n\n shell.openExternal(url);\n});\n\nconst cssWriteQueue = new Queue();\nconst settingsWriteQueue = new Queue();\n\nipcMain.handle(IpcEvents.GET_QUICK_CSS, () => readCss());\nipcMain.handle(IpcEvents.SET_QUICK_CSS, (_, css) =>\n cssWriteQueue.push(() => writeFile(QUICKCSS_PATH, css))\n);\n\nipcMain.handle(IpcEvents.GET_THEMES_DIR, () => THEMES_DIR);\nipcMain.handle(IpcEvents.GET_THEMES_LIST, () => listThemes());\nipcMain.handle(IpcEvents.GET_THEME_DATA, (_, fileName) => getThemeData(fileName));\nipcMain.handle(IpcEvents.GET_THEME_SYSTEM_VALUES, () => ({\n // win & mac only\n \"os-accent-color\": `#${systemPreferences.getAccentColor?.() || \"\"}`\n}));\n\nipcMain.handle(IpcEvents.GET_SETTINGS_DIR, () => SETTINGS_DIR);\nipcMain.on(IpcEvents.GET_SETTINGS, e => e.returnValue = readSettings());\n\nipcMain.handle(IpcEvents.SET_SETTINGS, (_, s) => {\n settingsWriteQueue.push(() => writeFile(SETTINGS_FILE, s));\n});\n\n\nexport function initIpc(mainWindow: BrowserWindow) {\n open(QUICKCSS_PATH, \"a+\").then(fd => {\n fd.close();\n watch(QUICKCSS_PATH, { persistent: false }, debounce(async () => {\n mainWindow.webContents.postMessage(IpcEvents.QUICK_CSS_UPDATE, await readCss());\n }, 50));\n });\n\n watch(THEMES_DIR, { persistent: false }, debounce(() => {\n mainWindow.webContents.postMessage(IpcEvents.THEME_UPDATE, void 0);\n }));\n}\n\nipcMain.handle(IpcEvents.OPEN_MONACO_EDITOR, async () => {\n const win = new BrowserWindow({\n title: \"Vencord QuickCSS Editor\",\n autoHideMenuBar: true,\n darkTheme: true,\n webPreferences: {\n preload: join(__dirname, IS_DISCORD_DESKTOP ? \"preload.js\" : \"vencordDesktopPreload.js\"),\n contextIsolation: true,\n nodeIntegration: false,\n sandbox: false\n }\n });\n\n makeLinksOpenExternally(win);\n\n await win.loadURL(`data:text/html;base64,${monacoHtml}`);\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nif (!IS_UPDATER_DISABLED)\n import(IS_STANDALONE ? \"./http\" : \"./git\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { IpcEvents } from \"@utils/IpcEvents\";\nimport { ipcMain } from \"electron\";\n\nimport PluginNatives from \"~pluginNatives\";\n\nconst PluginIpcMappings = {} as Record>;\nexport type PluginIpcMappings = typeof PluginIpcMappings;\n\nfor (const [plugin, methods] of Object.entries(PluginNatives)) {\n const entries = Object.entries(methods);\n if (!entries.length) continue;\n\n const mappings = PluginIpcMappings[plugin] = {};\n\n for (const [methodName, method] of entries) {\n const key = `VencordPluginNative_${plugin}_${methodName}`;\n ipcMain.handle(key, method);\n mappings[methodName] = key;\n }\n}\n\nipcMain.on(IpcEvents.GET_PLUGIN_IPC_METHOD_MAP, e => {\n e.returnValue = PluginIpcMappings;\n});\n", "import * as p0 from \"./plugins/fixSpotifyEmbeds.desktop/native\";\nimport * as p1 from \"./plugins/openInApp/native\";\nimport * as p2 from \"./plugins/voiceMessages/native\";\nexport default {\n\"FixSpotifyEmbeds\":p0,\n\"OpenInApp\":p1,\n\"VoiceMessages\":p2,\n};", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { app } from \"electron\";\nimport { getSettings } from \"main/ipcMain\";\n\napp.on(\"browser-window-created\", (_, win) => {\n win.webContents.on(\"frame-created\", (_, { frame }) => {\n frame.once(\"dom-ready\", () => {\n if (frame.url.startsWith(\"https://open.spotify.com/embed/\")) {\n const settings = getSettings().plugins?.FixSpotifyEmbeds;\n if (!settings?.enabled) return;\n\n frame.executeJavaScript(`\n const original = Audio.prototype.play;\n Audio.prototype.play = function() {\n this.volume = ${(settings.volume / 100) || 0.1};\n return original.apply(this, arguments);\n }\n `);\n }\n });\n });\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { IpcMainInvokeEvent } from \"electron\";\nimport { request } from \"https\";\n\n// These links don't support CORS, so this has to be native\nconst validRedirectUrls = /^https:\\/\\/(spotify\\.link|s\\.team)\\/.+$/;\n\nfunction getRedirect(url: string) {\n return new Promise((resolve, reject) => {\n const req = request(new URL(url), { method: \"HEAD\" }, res => {\n resolve(\n res.headers.location\n ? getRedirect(res.headers.location)\n : url\n );\n });\n req.on(\"error\", reject);\n req.end();\n });\n}\n\nexport async function resolveRedirect(_: IpcMainInvokeEvent, url: string) {\n if (!validRedirectUrls.test(url)) return url;\n\n return getRedirect(url);\n}\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { app } from \"electron\";\nimport { readFile } from \"fs/promises\";\nimport { basename, normalize } from \"path\";\n\nexport async function readRecording(_, filePath: string) {\n filePath = normalize(filePath);\n const filename = basename(filePath);\n const discordBaseDirWithTrailingSlash = normalize(app.getPath(\"userData\") + \"/\");\n console.log(filename, discordBaseDirWithTrailingSlash, filePath);\n if (filename !== \"recording.ogg\" || !filePath.startsWith(discordBaseDirWithTrailingSlash)) return null;\n\n try {\n const buf = await readFile(filePath);\n return new Uint8Array(buf.buffer);\n } catch {\n return null;\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n/**\n * Returns a new function that will call the wrapped function\n * after the specified delay. If the function is called again\n * within the delay, the timer will be reset.\n * @param func The function to wrap\n * @param delay The delay in milliseconds\n */\nexport function debounce(func: T, delay = 300): T {\n let timeout: NodeJS.Timeout;\n return function (...args: any[]) {\n clearTimeout(timeout);\n timeout = setTimeout(() => { func(...args); }, delay);\n } as any;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Promisable } from \"type-fest\";\n\n/**\n * A queue that can be used to run tasks consecutively.\n * Highly recommended for things like fetching data from Discord\n */\nexport class Queue {\n /**\n * @param maxSize The maximum amount of functions that can be queued at once.\n * If the queue is full, the oldest function will be removed.\n */\n constructor(public readonly maxSize = Infinity) { }\n\n private queue = [] as Array<() => Promisable>;\n\n private promise?: Promise;\n\n private next() {\n const func = this.queue.shift();\n if (func)\n this.promise = Promise.resolve()\n .then(func)\n .finally(() => this.next());\n else\n this.promise = undefined;\n }\n\n private run() {\n if (!this.promise)\n this.next();\n }\n\n /**\n * Append a task at the end of the queue. This task will be executed after all other tasks\n * If the queue exceeds the specified maxSize, the first task in queue will be removed.\n * @param func Task\n */\n push(func: () => Promisable) {\n if (this.size >= this.maxSize)\n this.queue.shift();\n\n this.queue.push(func);\n this.run();\n }\n\n /**\n * Prepend a task at the beginning of the queue. This task will be executed next\n * If the queue exceeds the specified maxSize, the last task in queue will be removed.\n * @param func Task\n */\n unshift(func: () => Promisable) {\n if (this.size >= this.maxSize)\n this.queue.pop();\n\n this.queue.unshift(func);\n this.run();\n }\n\n /**\n * The amount of tasks in the queue\n */\n get size() {\n return this.queue.length;\n }\n}\n", "export default \"PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KICAgIDxoZWFkPgogICAgICAgIDxtZXRhIGNoYXJzZXQ9InV0Zi04IiAvPgogICAgICAgIDx0aXRsZT5WZW5jb3JkIFF1aWNrQ1NTIEVkaXRvcjwvdGl0bGU+CiAgICAgICAgPGxpbmsKICAgICAgICAgICAgcmVsPSJzdHlsZXNoZWV0IgogICAgICAgICAgICBocmVmPSJodHRwczovL2NkbmpzLmNsb3VkZmxhcmUuY29tL2FqYXgvbGlicy9tb25hY28tZWRpdG9yLzAuNDAuMC9taW4vdnMvZWRpdG9yL2VkaXRvci5tYWluLm1pbi5jc3MiCiAgICAgICAgICAgIGludGVncml0eT0ic2hhNTEyLU1Pb1EwMmg4MGhrbGNjZkxyWEZZa0N6RytXVmpPUmZsT3A5WnA4ZGx0aWFSUCszNUxZbk80TEtPa2xSNjRvTUdmR2dKRExPOFdKcGtNMW81Z1pYWVpRPT0iCiAgICAgICAgICAgIGNyb3Nzb3JpZ2luPSJhbm9ueW1vdXMiCiAgICAgICAgICAgIHJlZmVycmVycG9saWN5PSJuby1yZWZlcnJlciIKICAgICAgICAvPgogICAgICAgIDxzdHlsZT4KICAgICAgICAgICAgaHRtbCwKICAgICAgICAgICAgYm9keSwKICAgICAgICAgICAgI2NvbnRhaW5lciB7CiAgICAgICAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgICAgICAgICAgICAgICBsZWZ0OiAwOwogICAgICAgICAgICAgICAgdG9wOiAwOwogICAgICAgICAgICAgICAgd2lkdGg6IDEwMCU7CiAgICAgICAgICAgICAgICBoZWlnaHQ6IDEwMCU7CiAgICAgICAgICAgICAgICBtYXJnaW46IDA7CiAgICAgICAgICAgICAgICBwYWRkaW5nOiAwOwogICAgICAgICAgICAgICAgb3ZlcmZsb3c6IGhpZGRlbjsKICAgICAgICAgICAgfQogICAgICAgIDwvc3R5bGU+CiAgICA8L2hlYWQ+CgogICAgPGJvZHk+CiAgICAgICAgPGRpdiBpZD0iY29udGFpbmVyIj48L2Rpdj4KICAgICAgICA8c2NyaXB0CiAgICAgICAgICAgIHNyYz0iaHR0cHM6Ly9jZG5qcy5jbG91ZGZsYXJlLmNvbS9hamF4L2xpYnMvbW9uYWNvLWVkaXRvci8wLjQwLjAvbWluL3ZzL2xvYWRlci5taW4uanMiCiAgICAgICAgICAgIGludGVncml0eT0ic2hhNTEyLVF6TXBYZUNQY2lBSFA0d2JZbFYyUFlnclFjYUVrRFFVanprUFU0eG5qeVZTRDlUMzYvdWRhbXh0TkJxYjRxSzQvYk1RTVBaOGF5ckJlOWhyR2RCRmpRPT0iCiAgICAgICAgICAgIGNyb3Nzb3JpZ2luPSJhbm9ueW1vdXMiCiAgICAgICAgICAgIHJlZmVycmVycG9saWN5PSJuby1yZWZlcnJlciIKICAgICAgICA+PC9zY3JpcHQ+CgogICAgICAgIDxzY3JpcHQ+CiAgICAgICAgICAgIHJlcXVpcmUuY29uZmlnKHsKICAgICAgICAgICAgICAgIHBhdGhzOiB7CiAgICAgICAgICAgICAgICAgICAgdnM6ICJodHRwczovL2NkbmpzLmNsb3VkZmxhcmUuY29tL2FqYXgvbGlicy9tb25hY28tZWRpdG9yLzAuNDAuMC9taW4vdnMiLAogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgfSk7CgogICAgICAgICAgICByZXF1aXJlKFsidnMvZWRpdG9yL2VkaXRvci5tYWluIl0sICgpID0+IHsKICAgICAgICAgICAgICAgIGdldEN1cnJlbnRDc3MoKS50aGVuKChjc3MpID0+IHsKICAgICAgICAgICAgICAgICAgICB2YXIgZWRpdG9yID0gbW9uYWNvLmVkaXRvci5jcmVhdGUoCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJjb250YWluZXIiKSwKICAgICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IGNzcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhbmd1YWdlOiAiY3NzIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZW1lOiBnZXRUaGVtZSgpLAogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgKTsKICAgICAgICAgICAgICAgICAgICBlZGl0b3Iub25EaWRDaGFuZ2VNb2RlbENvbnRlbnQoKCkgPT4KICAgICAgICAgICAgICAgICAgICAgICAgc2V0Q3NzKGVkaXRvci5nZXRWYWx1ZSgpKQogICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgICAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoInJlc2l6ZSIsICgpID0+IHsKICAgICAgICAgICAgICAgICAgICAgICAgLy8gbWFrZSBtb25hY28gcmUtbGF5b3V0CiAgICAgICAgICAgICAgICAgICAgICAgIGVkaXRvci5sYXlvdXQoKTsKICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9KTsKICAgICAgICA8L3NjcmlwdD4KICAgIDwvYm9keT4KPC9odG1sPgo=\"", "/* eslint-disable simple-header/header */\n\n/*!\n * BetterDiscord addon meta parser\n * Copyright 2023 BetterDiscord contributors\n * Copyright 2023 Vendicated and Vencord contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst splitRegex = /[^\\S\\r\\n]*?\\r?(?:\\r\\n|\\n)[^\\S\\r\\n]*?\\*[^\\S\\r\\n]?/;\nconst escapedAtRegex = /^\\\\@/;\n\nexport interface UserThemeHeader {\n fileName: string;\n name: string;\n author: string;\n description: string;\n version?: string;\n license?: string;\n source?: string;\n website?: string;\n invite?: string;\n}\n\nfunction makeHeader(fileName: string, opts: Partial = {}): UserThemeHeader {\n return {\n fileName,\n name: opts.name ?? fileName.replace(/\\.css$/i, \"\"),\n author: opts.author ?? \"Unknown Author\",\n description: opts.description ?? \"A Discord Theme.\",\n version: opts.version,\n license: opts.license,\n source: opts.source,\n website: opts.website,\n invite: opts.invite\n };\n}\n\nexport function stripBOM(fileContent: string) {\n if (fileContent.charCodeAt(0) === 0xFEFF) {\n fileContent = fileContent.slice(1);\n }\n return fileContent;\n}\n\nexport function getThemeInfo(css: string, fileName: string): UserThemeHeader {\n if (!css) return makeHeader(fileName);\n\n const block = css.split(\"/**\", 2)?.[1]?.split(\"*/\", 1)?.[0];\n if (!block) return makeHeader(fileName);\n\n const header: Partial = {};\n let field = \"\";\n let accum = \"\";\n for (const line of block.split(splitRegex)) {\n if (line.length === 0) continue;\n if (line.charAt(0) === \"@\" && line.charAt(1) !== \" \") {\n header[field] = accum.trim();\n const l = line.indexOf(\" \");\n field = line.substring(1, l);\n accum = line.substring(l + 1);\n }\n else {\n accum += \" \" + line.replace(\"\\\\n\", \"\\n\").replace(escapedAtRegex, \"@\");\n }\n }\n header[field] = accum.trim();\n delete header[\"\"];\n return makeHeader(fileName, header);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { app } from \"electron\";\nimport { join } from \"path\";\n\nexport const DATA_DIR = process.env.VENCORD_USER_DATA_DIR ?? (\n process.env.DISCORD_USER_DATA_DIR\n ? join(process.env.DISCORD_USER_DATA_DIR, \"..\", \"VencordData\")\n : join(app.getPath(\"userData\"), \"..\", \"Vencord\")\n);\nexport const SETTINGS_DIR = join(DATA_DIR, \"settings\");\nexport const THEMES_DIR = join(DATA_DIR, \"themes\");\nexport const QUICKCSS_PATH = join(SETTINGS_DIR, \"quickCss.css\");\nexport const SETTINGS_FILE = join(SETTINGS_DIR, \"settings.json\");\nexport const ALLOWED_PROTOCOLS = [\n \"https:\",\n \"http:\",\n \"steam:\",\n \"spotify:\",\n \"com.epicgames.launcher:\",\n];\n\nexport const IS_VANILLA = /* @__PURE__ */ process.argv.includes(\"--vanilla\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { type BrowserWindow, shell } from \"electron\";\n\nexport function makeLinksOpenExternally(win: BrowserWindow) {\n win.webContents.setWindowOpenHandler(({ url }) => {\n switch (url) {\n case \"about:blank\":\n case \"https://discord.com/popout\":\n case \"https://ptb.discord.com/popout\":\n case \"https://canary.discord.com/popout\":\n return { action: \"allow\" };\n }\n\n try {\n var { protocol } = new URL(url);\n } catch {\n return { action: \"deny\" };\n }\n\n switch (protocol) {\n case \"http:\":\n case \"https:\":\n case \"mailto:\":\n case \"steam:\":\n case \"spotify:\":\n shell.openExternal(url);\n }\n\n return { action: \"deny\" };\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { session } from \"electron\";\nimport { unzip } from \"fflate\";\nimport { constants as fsConstants } from \"fs\";\nimport { access, mkdir, rm, writeFile } from \"fs/promises\";\nimport { join } from \"path\";\n\nimport { DATA_DIR } from \"./constants\";\nimport { crxToZip } from \"./crxToZip\";\nimport { get } from \"./simpleGet\";\n\nconst extensionCacheDir = join(DATA_DIR, \"ExtensionCache\");\n\nasync function extract(data: Buffer, outDir: string) {\n await mkdir(outDir, { recursive: true });\n return new Promise((resolve, reject) => {\n unzip(data, (err, files) => {\n if (err) return void reject(err);\n Promise.all(Object.keys(files).map(async f => {\n // Signature stuff\n // 'Cannot load extension with file or directory name\n // _metadata. Filenames starting with \"_\" are reserved for use by the system.';\n if (f.startsWith(\"_metadata/\")) return;\n\n if (f.endsWith(\"/\")) return void mkdir(join(outDir, f), { recursive: true });\n\n const pathElements = f.split(\"/\");\n const name = pathElements.pop()!;\n const directories = pathElements.join(\"/\");\n const dir = join(outDir, directories);\n\n if (directories) {\n await mkdir(dir, { recursive: true });\n }\n\n await writeFile(join(dir, name), files[f]);\n }))\n .then(() => resolve())\n .catch(err => {\n rm(outDir, { recursive: true, force: true });\n reject(err);\n });\n });\n });\n}\n\nexport async function installExt(id: string) {\n const extDir = join(extensionCacheDir, `${id}`);\n\n try {\n await access(extDir, fsConstants.F_OK);\n } catch (err) {\n const url = id === \"fmkadmapgofadopljbjfkapdkoienihi\"\n // React Devtools v4.25\n // v4.27 is broken in Electron, see https://github.com/facebook/react/issues/25843\n // Unfortunately, Google does not serve old versions, so this is the only way\n ? \"https://raw.githubusercontent.com/Vendicated/random-files/f6f550e4c58ac5f2012095a130406c2ab25b984d/fmkadmapgofadopljbjfkapdkoienihi.zip\"\n : `https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&x=id%3D${id}%26uc&prodversion=32`;\n const buf = await get(url, {\n headers: {\n \"User-Agent\": \"Vencord (https://github.com/Vendicated/Vencord)\"\n }\n });\n await extract(crxToZip(buf), extDir).catch(console.error);\n }\n\n session.defaultSession.loadExtension(extDir);\n}\n", "import { createRequire } from 'module';\nvar require = createRequire('/');\n// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\n// Mediocre shim\nvar Worker;\nvar workerAdd = \";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global\";\ntry {\n Worker = require('worker_threads').Worker;\n}\ncatch (e) {\n}\nvar wk = Worker ? function (c, _, msg, transfer, cb) {\n var done = false;\n var w = new Worker(c + workerAdd, { eval: true })\n .on('error', function (e) { return cb(e, null); })\n .on('message', function (m) { return cb(null, m); })\n .on('exit', function (c) {\n if (c && !done)\n cb(new Error('exited with code ' + c), null);\n });\n w.postMessage(msg, transfer);\n w.terminate = function () {\n done = true;\n return Worker.prototype.terminate.call(w);\n };\n return w;\n} : function (_, __, ___, ____, cb) {\n setImmediate(function () { return cb(new Error('async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)'), null); });\n var NOP = function () { };\n return {\n terminate: NOP,\n postMessage: NOP\n };\n};\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\n// see fleb note\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new u32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return [b, r];\n};\nvar _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i) {\n if (cd[i])\n ++l[cd[i] - 1];\n }\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v.BYTES_PER_ELEMENT == 2 ? u16 : v.BYTES_PER_ELEMENT == 4 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e >= s) {\n // write final block\n w[pos >> 3] = lst;\n }\n pos = wfblk(w, pos + 1, dat.subarray(i, e));\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\\s+/g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k].buffer) {\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k, op = o;\n if (Array.isArray(val))\n op = mrg(o, val[1]), val = val[0];\n if (val instanceof u8)\n t[n] = [val, op];\n else {\n t[n += '/'] = [new u8(0), op];\n fltn(val, n, t, o);\n }\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != -1) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c < 0 ? -c - 2 : c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u, -1);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = lft = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n", "/* eslint-disable simple-header/header */\n\n/*!\n * crxToZip\n * Copyright (c) 2013 Rob Wu \n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/.\n */\n\nexport function crxToZip(buf: Buffer) {\n function calcLength(a: number, b: number, c: number, d: number) {\n let length = 0;\n\n length += a << 0;\n length += b << 8;\n length += c << 16;\n length += d << 24 >>> 0;\n return length;\n }\n\n // 50 4b 03 04\n // This is actually a zip file\n if (buf[0] === 80 && buf[1] === 75 && buf[2] === 3 && buf[3] === 4) {\n return buf;\n }\n\n // 43 72 32 34 (Cr24)\n if (buf[0] !== 67 || buf[1] !== 114 || buf[2] !== 50 || buf[3] !== 52) {\n throw new Error(\"Invalid header: Does not start with Cr24\");\n }\n\n // 02 00 00 00\n // or\n // 03 00 00 00\n const isV3 = buf[4] === 3;\n const isV2 = buf[4] === 2;\n\n if ((!isV2 && !isV3) || buf[5] || buf[6] || buf[7]) {\n throw new Error(\"Unexpected crx format version number.\");\n }\n\n if (isV2) {\n const publicKeyLength = calcLength(buf[8], buf[9], buf[10], buf[11]);\n const signatureLength = calcLength(buf[12], buf[13], buf[14], buf[15]);\n\n // 16 = Magic number (4), CRX format version (4), lengths (2x4)\n const zipStartOffset = 16 + publicKeyLength + signatureLength;\n\n return buf.subarray(zipStartOffset, buf.length);\n }\n // v3 format has header size and then header\n const headerSize = calcLength(buf[8], buf[9], buf[10], buf[11]);\n const zipStartOffset = 12 + headerSize;\n\n return buf.subarray(zipStartOffset, buf.length);\n}\n"], + "sourcesContent": ["/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const VencordFragment = /* #__PURE__*/ Symbol.for(\"react.fragment\");\nexport let VencordCreateElement =\n (...args) => (VencordCreateElement = Vencord.Webpack.Common.React.createElement)(...args);\n", "export default \"96126fa\"", "export default \"Vendicated/Vencord\"", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport gitHash from \"~git-hash\";\nimport gitRemote from \"~git-remote\";\n\nexport {\n gitHash,\n gitRemote\n};\n\nexport const WEBPACK_CHUNK = \"webpackChunkdiscord_app\";\nexport const REACT_GLOBAL = \"Vencord.Webpack.Common.React\";\nexport const VENCORD_USER_AGENT = `Vencord/${gitHash}${gitRemote ? ` (https://github.com/${gitRemote})` : \"\"}`;\nexport const SUPPORT_CHANNEL_ID = \"1026515880080842772\";\n\nexport interface Dev {\n name: string;\n id: bigint;\n badge?: boolean;\n}\n\n/**\n * If you made a plugin or substantial contribution, add yourself here.\n * This object is used for the plugin author list, as well as to add a contributor badge to your profile.\n * If you wish to stay fully anonymous, feel free to set ID to 0n.\n * If you are fine with attribution but don't want the badge, add badge: false\n */\nexport const Devs = /* #__PURE__*/ Object.freeze({\n Ven: {\n name: \"Vendicated\",\n id: 343383572805058560n\n },\n Arjix: {\n name: \"ArjixWasTaken\",\n id: 674710789138939916n\n },\n Cyn: {\n name: \"Cynosphere\",\n id: 150745989836308480n\n },\n Megu: {\n name: \"Megumin\",\n id: 545581357812678656n\n },\n botato: {\n name: \"botato\",\n id: 440990343899643943n\n },\n obscurity: {\n name: \"obscurity\",\n id: 336678828233588736n,\n },\n rushii: {\n name: \"rushii\",\n id: 295190422244950017n\n },\n Glitch: {\n name: \"Glitchy\",\n id: 269567451199569920n\n },\n Samu: {\n name: \"Samu\",\n id: 702973430449832038n,\n },\n Animal: {\n name: \"Animal\",\n id: 118437263754395652n\n },\n MaiKokain: {\n name: \"Mai\",\n id: 722647978577363026n\n },\n echo: {\n name: \"ECHO\",\n id: 712639419785412668n\n },\n katlyn: {\n name: \"katlyn\",\n id: 250322741406859265n\n },\n nea: {\n name: \"nea\",\n id: 310702108997320705n,\n },\n Nuckyz: {\n name: \"Nuckyz\",\n id: 235834946571337729n\n },\n D3SOX: {\n name: \"D3SOX\",\n id: 201052085641281538n\n },\n Nickyux: {\n name: \"Nickyux\",\n id: 427146305651998721n\n },\n mantikafasi: {\n name: \"mantikafasi\",\n id: 287555395151593473n\n },\n Xinto: {\n name: \"Xinto\",\n id: 423915768191647755n\n },\n JacobTm: {\n name: \"Jacob.Tm\",\n id: 302872992097107991n\n },\n DustyAngel47: {\n name: \"DustyAngel47\",\n id: 714583473804935238n\n },\n BanTheNons: {\n name: \"BanTheNons\",\n id: 460478012794863637n\n },\n BigDuck: {\n name: \"BigDuck\",\n id: 1024588272623681609n\n },\n AverageReactEnjoyer: {\n name: \"Average React Enjoyer\",\n id: 1004904120056029256n\n },\n adryd: {\n name: \"adryd\",\n id: 0n\n },\n Tyman: {\n name: \"Tyman\",\n id: 487443883127472129n\n },\n afn: {\n name: \"afn\",\n id: 420043923822608384n\n },\n KraXen72: {\n name: \"KraXen72\",\n id: 379304073515499530n\n },\n kemo: {\n name: \"kemo\",\n id: 299693897859465228n\n },\n dzshn: {\n name: \"dzshn\",\n id: 310449948011528192n\n },\n Ducko: {\n name: \"Ducko\",\n id: 506482395269169153n\n },\n jewdev: {\n name: \"jewdev\",\n id: 222369866529636353n\n },\n Luna: {\n name: \"Luny\",\n id: 821472922140803112n\n },\n Vap: {\n name: \"Vap0r1ze\",\n id: 454072114492866560n\n },\n KingFish: {\n name: \"King Fish\",\n id: 499400512559382538n\n },\n Commandtechno: {\n name: \"Commandtechno\",\n id: 296776625432035328n,\n },\n TheSun: {\n name: \"ActuallyTheSun\",\n id: 406028027768733696n\n },\n axyie: {\n name: \"'ax\",\n id: 273562710745284628n,\n },\n pointy: {\n name: \"pointy\",\n id: 99914384989519872n\n },\n SammCheese: {\n name: \"Samm-Cheese\",\n id: 372148345894076416n\n },\n zt: {\n name: \"zt\",\n id: 289556910426816513n\n },\n captain: {\n name: \"Captain\",\n id: 347366054806159360n\n },\n nick: {\n name: \"nick\",\n id: 347884694408265729n,\n badge: false\n },\n whqwert: {\n name: \"whqwert\",\n id: 586239091520176128n\n },\n lewisakura: {\n name: \"lewisakura\",\n id: 96269247411400704n\n },\n RuiNtD: {\n name: \"RuiNtD\",\n id: 157917665162297344n\n },\n hunt: {\n name: \"hunt-g\",\n id: 222800179697287168n\n },\n cloudburst: {\n name: \"cloudburst\",\n id: 892128204150685769n\n },\n Aria: {\n name: \"Syncxv\",\n id: 549244932213309442n,\n },\n TheKodeToad: {\n name: \"TheKodeToad\",\n id: 706152404072267788n\n },\n LordElias: {\n name: \"LordElias\",\n id: 319460781567639554n\n },\n juby: {\n name: \"Juby210\",\n id: 324622488644616195n\n },\n Alyxia: {\n name: \"Alyxia Sother\",\n id: 952185386350829688n\n },\n Remty: {\n name: \"Remty\",\n id: 335055032204656642n\n },\n skyevg: {\n name: \"skyevg\",\n id: 1090310844283363348n\n },\n Dziurwa: {\n name: \"Dziurwa\",\n id: 1001086404203389018n\n },\n AutumnVN: {\n name: \"AutumnVN\",\n id: 393694671383166998n\n },\n pylix: {\n name: \"pylix\",\n id: 492949202121261067n\n },\n Tyler: {\n name: \"\\\\\\\\GGTyler\\\\\\\\\",\n id: 143117463788191746n\n },\n RyanCaoDev: {\n name: \"RyanCaoDev\",\n id: 952235800110694471n,\n },\n Strencher: {\n name: \"Strencher\",\n id: 415849376598982656n\n },\n FieryFlames: {\n name: \"Fiery\",\n id: 890228870559698955n\n },\n KannaDev: {\n name: \"Kanna\",\n id: 317728561106518019n\n },\n carince: {\n name: \"carince\",\n id: 818323528755314698n\n },\n PandaNinjas: {\n name: \"PandaNinjas\",\n id: 455128749071925248n\n },\n CatNoir: {\n name: \"CatNoir\",\n id: 260371016348336128n\n },\n outfoxxed: {\n name: \"outfoxxed\",\n id: 837425748435796060n\n },\n UwUDev: {\n name: \"UwU\",\n id: 691413039156690994n,\n },\n amia: {\n name: \"amia\",\n id: 142007603549962240n\n },\n phil: {\n name: \"phil\",\n id: 305288513941667851n\n },\n ImLvna: {\n name: \"Luna <3\",\n id: 799319081723232267n\n },\n rad: {\n name: \"rad\",\n id: 610945092504780823n\n },\n AndrewDLO: {\n name: \"Andrew-DLO\",\n id: 434135504792059917n\n },\n HypedDomi: {\n name: \"HypedDomi\",\n id: 354191516979429376n\n },\n Rini: {\n name: \"Rini\",\n id: 1079479184478441643n\n },\n castdrian: {\n name: \"castdrian\",\n id: 224617799434108928n\n },\n Arrow: {\n name: \"arrow\",\n id: 958158495302176778n\n },\n bb010g: {\n name: \"bb010g\",\n id: 72791153467990016n,\n },\n Lumap: {\n name: \"lumap\",\n id: 635383782576357407n\n },\n Dolfies: {\n name: \"Dolfies\",\n id: 852892297661906993n,\n },\n RuukuLada: {\n name: \"RuukuLada\",\n id: 119705748346241027n,\n },\n blahajZip: {\n name: \"blahaj.zip\",\n id: 683954422241427471n,\n },\n archeruwu: {\n name: \"archer_uwu\",\n id: 160068695383736320n\n },\n ProffDea: {\n name: \"ProffDea\",\n id: 609329952180928513n\n },\n ant0n: {\n name: \"ant0n\",\n id: 145224646868860928n\n },\n} satisfies Record);\n\n// iife so #__PURE__ works correctly\nexport const DevsById = /* #__PURE__*/ (() =>\n Object.freeze(Object.fromEntries(\n Object.entries(Devs)\n .filter(d => d[1].id !== 0n)\n .map(([_, v]) => [v.id, v] as const)\n ))\n)() as Record;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const enum IpcEvents {\n QUICK_CSS_UPDATE = \"VencordQuickCssUpdate\",\n THEME_UPDATE = \"VencordThemeUpdate\",\n GET_QUICK_CSS = \"VencordGetQuickCss\",\n SET_QUICK_CSS = \"VencordSetQuickCss\",\n UPLOAD_THEME = \"VencordUploadTheme\",\n DELETE_THEME = \"VencordDeleteTheme\",\n GET_THEMES_DIR = \"VencordGetThemesDir\",\n GET_THEMES_LIST = \"VencordGetThemesList\",\n GET_THEME_DATA = \"VencordGetThemeData\",\n GET_THEME_SYSTEM_VALUES = \"VencordGetThemeSystemValues\",\n GET_SETTINGS_DIR = \"VencordGetSettingsDir\",\n GET_SETTINGS = \"VencordGetSettings\",\n SET_SETTINGS = \"VencordSetSettings\",\n OPEN_EXTERNAL = \"VencordOpenExternal\",\n OPEN_QUICKCSS = \"VencordOpenQuickCss\",\n GET_UPDATES = \"VencordGetUpdates\",\n GET_REPO = \"VencordGetRepo\",\n UPDATE = \"VencordUpdate\",\n BUILD = \"VencordBuild\",\n OPEN_MONACO_EDITOR = \"VencordOpenMonacoEditor\",\n\n GET_PLUGIN_IPC_METHOD_MAP = \"VencordGetPluginIpcMethodMap\",\n\n OPEN_IN_APP__RESOLVE_REDIRECT = \"VencordOIAResolveRedirect\",\n VOICE_MESSAGES_READ_RECORDING = \"VencordVMReadRecording\",\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport https from \"https\";\n\nexport function get(url: string, options: https.RequestOptions = {}) {\n return new Promise((resolve, reject) => {\n https.get(url, options, res => {\n const { statusCode, statusMessage, headers } = res;\n if (statusCode! >= 400)\n return void reject(`${statusCode}: ${statusMessage} - ${url}`);\n if (statusCode! >= 300)\n return void resolve(get(headers.location!, options));\n\n const chunks = [] as Buffer[];\n res.on(\"error\", reject);\n\n res.on(\"data\", chunk => chunks.push(chunk));\n res.once(\"end\", () => resolve(Buffer.concat(chunks)));\n });\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const VENCORD_FILES = [\n IS_DISCORD_DESKTOP ? \"patcher.js\" : \"vencordDesktopMain.js\",\n IS_DISCORD_DESKTOP ? \"preload.js\" : \"vencordDesktopPreload.js\",\n IS_DISCORD_DESKTOP ? \"renderer.js\" : \"vencordDesktopRenderer.js\",\n IS_DISCORD_DESKTOP ? \"renderer.css\" : \"vencordDesktopRenderer.css\",\n];\n\nexport function serializeErrors(func: (...args: any[]) => any) {\n return async function () {\n try {\n return {\n ok: true,\n value: await func(...arguments)\n };\n } catch (e: any) {\n return {\n ok: false,\n error: e instanceof Error ? {\n // prototypes get lost, so turn error into plain object\n ...e\n } : e\n };\n }\n };\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { VENCORD_USER_AGENT } from \"@utils/constants\";\nimport { IpcEvents } from \"@utils/IpcEvents\";\nimport { ipcMain } from \"electron\";\nimport { writeFile } from \"fs/promises\";\nimport { join } from \"path\";\n\nimport gitHash from \"~git-hash\";\nimport gitRemote from \"~git-remote\";\n\nimport { get } from \"../utils/simpleGet\";\nimport { serializeErrors, VENCORD_FILES } from \"./common\";\n\nconst API_BASE = `https://api.github.com/repos/${gitRemote}`;\nlet PendingUpdates = [] as [string, string][];\n\nasync function githubGet(endpoint: string) {\n return get(API_BASE + endpoint, {\n headers: {\n Accept: \"application/vnd.github+json\",\n // \"All API requests MUST include a valid User-Agent header.\n // Requests with no User-Agent header will be rejected.\"\n \"User-Agent\": VENCORD_USER_AGENT\n }\n });\n}\n\nasync function calculateGitChanges() {\n const isOutdated = await fetchUpdates();\n if (!isOutdated) return [];\n\n const res = await githubGet(`/compare/${gitHash}...HEAD`);\n\n const data = JSON.parse(res.toString(\"utf-8\"));\n return data.commits.map((c: any) => ({\n // github api only sends the long sha\n hash: c.sha.slice(0, 7),\n author: c.author.login,\n message: c.commit.message\n }));\n}\n\nasync function fetchUpdates() {\n const release = await githubGet(\"/releases/latest\");\n\n const data = JSON.parse(release.toString());\n const hash = data.name.slice(data.name.lastIndexOf(\" \") + 1);\n if (hash === gitHash)\n return false;\n\n data.assets.forEach(({ name, browser_download_url }) => {\n if (VENCORD_FILES.some(s => name.startsWith(s))) {\n PendingUpdates.push([name, browser_download_url]);\n }\n });\n return true;\n}\n\nasync function applyUpdates() {\n await Promise.all(PendingUpdates.map(\n async ([name, data]) => writeFile(\n join(__dirname, name),\n await get(data)\n )\n ));\n PendingUpdates = [];\n return true;\n}\n\nipcMain.handle(IpcEvents.GET_REPO, serializeErrors(() => `https://github.com/${gitRemote}`));\nipcMain.handle(IpcEvents.GET_UPDATES, serializeErrors(calculateGitChanges));\nipcMain.handle(IpcEvents.UPDATE, serializeErrors(fetchUpdates));\nipcMain.handle(IpcEvents.BUILD, serializeErrors(applyUpdates));\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { app, protocol, session } from \"electron\";\nimport { join } from \"path\";\n\nimport { ensureSafePath, getSettings } from \"./ipcMain\";\nimport { IS_VANILLA, THEMES_DIR } from \"./utils/constants\";\nimport { installExt } from \"./utils/extensions\";\n\nif (IS_VESKTOP || !IS_VANILLA) {\n app.whenReady().then(() => {\n // Source Maps! Maybe there's a better way but since the renderer is executed\n // from a string I don't think any other form of sourcemaps would work\n protocol.registerFileProtocol(\"vencord\", ({ url: unsafeUrl }, cb) => {\n let url = unsafeUrl.slice(\"vencord://\".length);\n if (url.endsWith(\"/\")) url = url.slice(0, -1);\n if (url.startsWith(\"/themes/\")) {\n const theme = url.slice(\"/themes/\".length);\n const safeUrl = ensureSafePath(THEMES_DIR, theme);\n if (!safeUrl) {\n cb({ statusCode: 403 });\n return;\n }\n cb(safeUrl.replace(/\\?v=\\d+$/, \"\"));\n return;\n }\n switch (url) {\n case \"renderer.js.map\":\n case \"vencordDesktopRenderer.js.map\":\n case \"preload.js.map\":\n case \"vencordDesktopPreload.js.map\":\n case \"patcher.js.map\":\n case \"vencordDesktopMain.js.map\":\n cb(join(__dirname, url));\n break;\n default:\n cb({ statusCode: 403 });\n }\n });\n\n try {\n if (getSettings().enableReactDevtools)\n installExt(\"fmkadmapgofadopljbjfkapdkoienihi\")\n .then(() => console.info(\"[Vencord] Installed React Developer Tools\"))\n .catch(err => console.error(\"[Vencord] Failed to install React Developer Tools\", err));\n } catch { }\n\n\n const findHeader = (headers: Record, headerName: Lowercase) => {\n return Object.keys(headers).find(h => h.toLowerCase() === headerName);\n };\n\n // Remove CSP\n type PolicyResult = Record;\n\n const parsePolicy = (policy: string): PolicyResult => {\n const result: PolicyResult = {};\n policy.split(\";\").forEach(directive => {\n const [directiveKey, ...directiveValue] = directive.trim().split(/\\s+/g);\n if (directiveKey && !Object.prototype.hasOwnProperty.call(result, directiveKey)) {\n result[directiveKey] = directiveValue;\n }\n });\n\n return result;\n };\n const stringifyPolicy = (policy: PolicyResult): string =>\n Object.entries(policy)\n .filter(([, values]) => values?.length)\n .map(directive => directive.flat().join(\" \"))\n .join(\"; \");\n\n const patchCsp = (headers: Record) => {\n const header = findHeader(headers, \"content-security-policy\");\n\n if (header) {\n const csp = parsePolicy(headers[header][0]);\n\n for (const directive of [\"style-src\", \"connect-src\", \"img-src\", \"font-src\", \"media-src\", \"worker-src\"]) {\n csp[directive] ??= [];\n csp[directive].push(\"*\", \"blob:\", \"data:\", \"vencord:\", \"'unsafe-inline'\");\n }\n\n // TODO: Restrict this to only imported packages with fixed version.\n // Perhaps auto generate with esbuild\n csp[\"script-src\"] ??= [];\n csp[\"script-src\"].push(\"'unsafe-eval'\", \"https://unpkg.com\", \"https://cdnjs.cloudflare.com\");\n headers[header] = [stringifyPolicy(csp)];\n }\n };\n\n session.defaultSession.webRequest.onHeadersReceived(({ responseHeaders, resourceType }, cb) => {\n if (responseHeaders) {\n if (resourceType === \"mainFrame\")\n patchCsp(responseHeaders);\n\n // Fix hosts that don't properly set the css content type, such as\n // raw.githubusercontent.com\n if (resourceType === \"stylesheet\") {\n const header = findHeader(responseHeaders, \"content-type\");\n if (header)\n responseHeaders[header] = [\"text/css\"];\n }\n }\n\n cb({ cancel: false, responseHeaders });\n });\n\n // assign a noop to onHeadersReceived to prevent other mods from adding their own incompatible ones.\n // For instance, OpenAsar adds their own that doesn't fix content-type for stylesheets which makes it\n // impossible to load css from github raw despite our fix above\n session.defaultSession.webRequest.onHeadersReceived = () => { };\n });\n}\n\nif (IS_DISCORD_DESKTOP) {\n require(\"./patcher\");\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./updater\";\nimport \"./ipcPlugins\";\n\nimport { debounce } from \"@utils/debounce\";\nimport { IpcEvents } from \"@utils/IpcEvents\";\nimport { Queue } from \"@utils/Queue\";\nimport { BrowserWindow, ipcMain, shell, systemPreferences } from \"electron\";\nimport { mkdirSync, readFileSync, watch } from \"fs\";\nimport { open, readdir, readFile, writeFile } from \"fs/promises\";\nimport { join, normalize } from \"path\";\n\nimport monacoHtml from \"~fileContent/monacoWin.html;base64\";\n\nimport { getThemeInfo, stripBOM, UserThemeHeader } from \"./themes\";\nimport { ALLOWED_PROTOCOLS, QUICKCSS_PATH, SETTINGS_DIR, SETTINGS_FILE, THEMES_DIR } from \"./utils/constants\";\nimport { makeLinksOpenExternally } from \"./utils/externalLinks\";\n\nmkdirSync(SETTINGS_DIR, { recursive: true });\nmkdirSync(THEMES_DIR, { recursive: true });\n\nexport function ensureSafePath(basePath: string, path: string) {\n const normalizedBasePath = normalize(basePath);\n const newPath = join(basePath, path);\n const normalizedPath = normalize(newPath);\n return normalizedPath.startsWith(normalizedBasePath) ? normalizedPath : null;\n}\n\nfunction readCss() {\n return readFile(QUICKCSS_PATH, \"utf-8\").catch(() => \"\");\n}\n\nasync function listThemes(): Promise {\n const files = await readdir(THEMES_DIR).catch(() => []);\n\n const themeInfo: UserThemeHeader[] = [];\n\n for (const fileName of files) {\n if (!fileName.endsWith(\".css\")) continue;\n\n const data = await getThemeData(fileName).then(stripBOM).catch(() => null);\n if (data == null) continue;\n\n themeInfo.push(getThemeInfo(data, fileName));\n }\n\n return themeInfo;\n}\n\nfunction getThemeData(fileName: string) {\n fileName = fileName.replace(/\\?v=\\d+$/, \"\");\n const safePath = ensureSafePath(THEMES_DIR, fileName);\n if (!safePath) return Promise.reject(`Unsafe path ${fileName}`);\n return readFile(safePath, \"utf-8\");\n}\n\nexport function readSettings() {\n try {\n return readFileSync(SETTINGS_FILE, \"utf-8\");\n } catch {\n return \"{}\";\n }\n}\n\nexport function getSettings(): typeof import(\"@api/Settings\").Settings {\n try {\n return JSON.parse(readSettings());\n } catch {\n return {} as any;\n }\n}\n\nipcMain.handle(IpcEvents.OPEN_QUICKCSS, () => shell.openPath(QUICKCSS_PATH));\n\nipcMain.handle(IpcEvents.OPEN_EXTERNAL, (_, url) => {\n try {\n var { protocol } = new URL(url);\n } catch {\n throw \"Malformed URL\";\n }\n if (!ALLOWED_PROTOCOLS.includes(protocol))\n throw \"Disallowed protocol.\";\n\n shell.openExternal(url);\n});\n\nconst cssWriteQueue = new Queue();\nconst settingsWriteQueue = new Queue();\n\nipcMain.handle(IpcEvents.GET_QUICK_CSS, () => readCss());\nipcMain.handle(IpcEvents.SET_QUICK_CSS, (_, css) =>\n cssWriteQueue.push(() => writeFile(QUICKCSS_PATH, css))\n);\n\nipcMain.handle(IpcEvents.GET_THEMES_DIR, () => THEMES_DIR);\nipcMain.handle(IpcEvents.GET_THEMES_LIST, () => listThemes());\nipcMain.handle(IpcEvents.GET_THEME_DATA, (_, fileName) => getThemeData(fileName));\nipcMain.handle(IpcEvents.GET_THEME_SYSTEM_VALUES, () => ({\n // win & mac only\n \"os-accent-color\": `#${systemPreferences.getAccentColor?.() || \"\"}`\n}));\n\nipcMain.handle(IpcEvents.GET_SETTINGS_DIR, () => SETTINGS_DIR);\nipcMain.on(IpcEvents.GET_SETTINGS, e => e.returnValue = readSettings());\n\nipcMain.handle(IpcEvents.SET_SETTINGS, (_, s) => {\n settingsWriteQueue.push(() => writeFile(SETTINGS_FILE, s));\n});\n\n\nexport function initIpc(mainWindow: BrowserWindow) {\n open(QUICKCSS_PATH, \"a+\").then(fd => {\n fd.close();\n watch(QUICKCSS_PATH, { persistent: false }, debounce(async () => {\n mainWindow.webContents.postMessage(IpcEvents.QUICK_CSS_UPDATE, await readCss());\n }, 50));\n });\n\n watch(THEMES_DIR, { persistent: false }, debounce(() => {\n mainWindow.webContents.postMessage(IpcEvents.THEME_UPDATE, void 0);\n }));\n}\n\nipcMain.handle(IpcEvents.OPEN_MONACO_EDITOR, async () => {\n const win = new BrowserWindow({\n title: \"Vencord QuickCSS Editor\",\n autoHideMenuBar: true,\n darkTheme: true,\n webPreferences: {\n preload: join(__dirname, IS_DISCORD_DESKTOP ? \"preload.js\" : \"vencordDesktopPreload.js\"),\n contextIsolation: true,\n nodeIntegration: false,\n sandbox: false\n }\n });\n\n makeLinksOpenExternally(win);\n\n await win.loadURL(`data:text/html;base64,${monacoHtml}`);\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nif (!IS_UPDATER_DISABLED)\n import(IS_STANDALONE ? \"./http\" : \"./git\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { IpcEvents } from \"@utils/IpcEvents\";\nimport { ipcMain } from \"electron\";\n\nimport PluginNatives from \"~pluginNatives\";\n\nconst PluginIpcMappings = {} as Record>;\nexport type PluginIpcMappings = typeof PluginIpcMappings;\n\nfor (const [plugin, methods] of Object.entries(PluginNatives)) {\n const entries = Object.entries(methods);\n if (!entries.length) continue;\n\n const mappings = PluginIpcMappings[plugin] = {};\n\n for (const [methodName, method] of entries) {\n const key = `VencordPluginNative_${plugin}_${methodName}`;\n ipcMain.handle(key, method);\n mappings[methodName] = key;\n }\n}\n\nipcMain.on(IpcEvents.GET_PLUGIN_IPC_METHOD_MAP, e => {\n e.returnValue = PluginIpcMappings;\n});\n", "import * as p0 from \"./plugins/fixSpotifyEmbeds.desktop/native\";\nimport * as p1 from \"./plugins/openInApp/native\";\nimport * as p2 from \"./plugins/voiceMessages/native\";\nexport default {\n\"FixSpotifyEmbeds\":p0,\n\"OpenInApp\":p1,\n\"VoiceMessages\":p2,\n};", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { app } from \"electron\";\nimport { getSettings } from \"main/ipcMain\";\n\napp.on(\"browser-window-created\", (_, win) => {\n win.webContents.on(\"frame-created\", (_, { frame }) => {\n frame.once(\"dom-ready\", () => {\n if (frame.url.startsWith(\"https://open.spotify.com/embed/\")) {\n const settings = getSettings().plugins?.FixSpotifyEmbeds;\n if (!settings?.enabled) return;\n\n frame.executeJavaScript(`\n const original = Audio.prototype.play;\n Audio.prototype.play = function() {\n this.volume = ${(settings.volume / 100) || 0.1};\n return original.apply(this, arguments);\n }\n `);\n }\n });\n });\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { IpcMainInvokeEvent } from \"electron\";\nimport { request } from \"https\";\n\n// These links don't support CORS, so this has to be native\nconst validRedirectUrls = /^https:\\/\\/(spotify\\.link|s\\.team)\\/.+$/;\n\nfunction getRedirect(url: string) {\n return new Promise((resolve, reject) => {\n const req = request(new URL(url), { method: \"HEAD\" }, res => {\n resolve(\n res.headers.location\n ? getRedirect(res.headers.location)\n : url\n );\n });\n req.on(\"error\", reject);\n req.end();\n });\n}\n\nexport async function resolveRedirect(_: IpcMainInvokeEvent, url: string) {\n if (!validRedirectUrls.test(url)) return url;\n\n return getRedirect(url);\n}\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { app } from \"electron\";\nimport { readFile } from \"fs/promises\";\nimport { basename, normalize } from \"path\";\n\nexport async function readRecording(_, filePath: string) {\n filePath = normalize(filePath);\n const filename = basename(filePath);\n const discordBaseDirWithTrailingSlash = normalize(app.getPath(\"userData\") + \"/\");\n console.log(filename, discordBaseDirWithTrailingSlash, filePath);\n if (filename !== \"recording.ogg\" || !filePath.startsWith(discordBaseDirWithTrailingSlash)) return null;\n\n try {\n const buf = await readFile(filePath);\n return new Uint8Array(buf.buffer);\n } catch {\n return null;\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n/**\n * Returns a new function that will call the wrapped function\n * after the specified delay. If the function is called again\n * within the delay, the timer will be reset.\n * @param func The function to wrap\n * @param delay The delay in milliseconds\n */\nexport function debounce(func: T, delay = 300): T {\n let timeout: NodeJS.Timeout;\n return function (...args: any[]) {\n clearTimeout(timeout);\n timeout = setTimeout(() => { func(...args); }, delay);\n } as any;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Promisable } from \"type-fest\";\n\n/**\n * A queue that can be used to run tasks consecutively.\n * Highly recommended for things like fetching data from Discord\n */\nexport class Queue {\n /**\n * @param maxSize The maximum amount of functions that can be queued at once.\n * If the queue is full, the oldest function will be removed.\n */\n constructor(public readonly maxSize = Infinity) { }\n\n private queue = [] as Array<() => Promisable>;\n\n private promise?: Promise;\n\n private next() {\n const func = this.queue.shift();\n if (func)\n this.promise = Promise.resolve()\n .then(func)\n .finally(() => this.next());\n else\n this.promise = undefined;\n }\n\n private run() {\n if (!this.promise)\n this.next();\n }\n\n /**\n * Append a task at the end of the queue. This task will be executed after all other tasks\n * If the queue exceeds the specified maxSize, the first task in queue will be removed.\n * @param func Task\n */\n push(func: () => Promisable) {\n if (this.size >= this.maxSize)\n this.queue.shift();\n\n this.queue.push(func);\n this.run();\n }\n\n /**\n * Prepend a task at the beginning of the queue. This task will be executed next\n * If the queue exceeds the specified maxSize, the last task in queue will be removed.\n * @param func Task\n */\n unshift(func: () => Promisable) {\n if (this.size >= this.maxSize)\n this.queue.pop();\n\n this.queue.unshift(func);\n this.run();\n }\n\n /**\n * The amount of tasks in the queue\n */\n get size() {\n return this.queue.length;\n }\n}\n", "export default \"PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KICAgIDxoZWFkPgogICAgICAgIDxtZXRhIGNoYXJzZXQ9InV0Zi04IiAvPgogICAgICAgIDx0aXRsZT5WZW5jb3JkIFF1aWNrQ1NTIEVkaXRvcjwvdGl0bGU+CiAgICAgICAgPGxpbmsKICAgICAgICAgICAgcmVsPSJzdHlsZXNoZWV0IgogICAgICAgICAgICBocmVmPSJodHRwczovL2NkbmpzLmNsb3VkZmxhcmUuY29tL2FqYXgvbGlicy9tb25hY28tZWRpdG9yLzAuNDAuMC9taW4vdnMvZWRpdG9yL2VkaXRvci5tYWluLm1pbi5jc3MiCiAgICAgICAgICAgIGludGVncml0eT0ic2hhNTEyLU1Pb1EwMmg4MGhrbGNjZkxyWEZZa0N6RytXVmpPUmZsT3A5WnA4ZGx0aWFSUCszNUxZbk80TEtPa2xSNjRvTUdmR2dKRExPOFdKcGtNMW81Z1pYWVpRPT0iCiAgICAgICAgICAgIGNyb3Nzb3JpZ2luPSJhbm9ueW1vdXMiCiAgICAgICAgICAgIHJlZmVycmVycG9saWN5PSJuby1yZWZlcnJlciIKICAgICAgICAvPgogICAgICAgIDxzdHlsZT4KICAgICAgICAgICAgaHRtbCwKICAgICAgICAgICAgYm9keSwKICAgICAgICAgICAgI2NvbnRhaW5lciB7CiAgICAgICAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgICAgICAgICAgICAgICBsZWZ0OiAwOwogICAgICAgICAgICAgICAgdG9wOiAwOwogICAgICAgICAgICAgICAgd2lkdGg6IDEwMCU7CiAgICAgICAgICAgICAgICBoZWlnaHQ6IDEwMCU7CiAgICAgICAgICAgICAgICBtYXJnaW46IDA7CiAgICAgICAgICAgICAgICBwYWRkaW5nOiAwOwogICAgICAgICAgICAgICAgb3ZlcmZsb3c6IGhpZGRlbjsKICAgICAgICAgICAgfQogICAgICAgIDwvc3R5bGU+CiAgICA8L2hlYWQ+CgogICAgPGJvZHk+CiAgICAgICAgPGRpdiBpZD0iY29udGFpbmVyIj48L2Rpdj4KICAgICAgICA8c2NyaXB0CiAgICAgICAgICAgIHNyYz0iaHR0cHM6Ly9jZG5qcy5jbG91ZGZsYXJlLmNvbS9hamF4L2xpYnMvbW9uYWNvLWVkaXRvci8wLjQwLjAvbWluL3ZzL2xvYWRlci5taW4uanMiCiAgICAgICAgICAgIGludGVncml0eT0ic2hhNTEyLVF6TXBYZUNQY2lBSFA0d2JZbFYyUFlnclFjYUVrRFFVanprUFU0eG5qeVZTRDlUMzYvdWRhbXh0TkJxYjRxSzQvYk1RTVBaOGF5ckJlOWhyR2RCRmpRPT0iCiAgICAgICAgICAgIGNyb3Nzb3JpZ2luPSJhbm9ueW1vdXMiCiAgICAgICAgICAgIHJlZmVycmVycG9saWN5PSJuby1yZWZlcnJlciIKICAgICAgICA+PC9zY3JpcHQ+CgogICAgICAgIDxzY3JpcHQ+CiAgICAgICAgICAgIHJlcXVpcmUuY29uZmlnKHsKICAgICAgICAgICAgICAgIHBhdGhzOiB7CiAgICAgICAgICAgICAgICAgICAgdnM6ICJodHRwczovL2NkbmpzLmNsb3VkZmxhcmUuY29tL2FqYXgvbGlicy9tb25hY28tZWRpdG9yLzAuNDAuMC9taW4vdnMiLAogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgfSk7CgogICAgICAgICAgICByZXF1aXJlKFsidnMvZWRpdG9yL2VkaXRvci5tYWluIl0sICgpID0+IHsKICAgICAgICAgICAgICAgIGdldEN1cnJlbnRDc3MoKS50aGVuKChjc3MpID0+IHsKICAgICAgICAgICAgICAgICAgICB2YXIgZWRpdG9yID0gbW9uYWNvLmVkaXRvci5jcmVhdGUoCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJjb250YWluZXIiKSwKICAgICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IGNzcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhbmd1YWdlOiAiY3NzIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZW1lOiBnZXRUaGVtZSgpLAogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgKTsKICAgICAgICAgICAgICAgICAgICBlZGl0b3Iub25EaWRDaGFuZ2VNb2RlbENvbnRlbnQoKCkgPT4KICAgICAgICAgICAgICAgICAgICAgICAgc2V0Q3NzKGVkaXRvci5nZXRWYWx1ZSgpKQogICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgICAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoInJlc2l6ZSIsICgpID0+IHsKICAgICAgICAgICAgICAgICAgICAgICAgLy8gbWFrZSBtb25hY28gcmUtbGF5b3V0CiAgICAgICAgICAgICAgICAgICAgICAgIGVkaXRvci5sYXlvdXQoKTsKICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9KTsKICAgICAgICA8L3NjcmlwdD4KICAgIDwvYm9keT4KPC9odG1sPgo=\"", "/* eslint-disable simple-header/header */\n\n/*!\n * BetterDiscord addon meta parser\n * Copyright 2023 BetterDiscord contributors\n * Copyright 2023 Vendicated and Vencord contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst splitRegex = /[^\\S\\r\\n]*?\\r?(?:\\r\\n|\\n)[^\\S\\r\\n]*?\\*[^\\S\\r\\n]?/;\nconst escapedAtRegex = /^\\\\@/;\n\nexport interface UserThemeHeader {\n fileName: string;\n name: string;\n author: string;\n description: string;\n version?: string;\n license?: string;\n source?: string;\n website?: string;\n invite?: string;\n}\n\nfunction makeHeader(fileName: string, opts: Partial = {}): UserThemeHeader {\n return {\n fileName,\n name: opts.name ?? fileName.replace(/\\.css$/i, \"\"),\n author: opts.author ?? \"Unknown Author\",\n description: opts.description ?? \"A Discord Theme.\",\n version: opts.version,\n license: opts.license,\n source: opts.source,\n website: opts.website,\n invite: opts.invite\n };\n}\n\nexport function stripBOM(fileContent: string) {\n if (fileContent.charCodeAt(0) === 0xFEFF) {\n fileContent = fileContent.slice(1);\n }\n return fileContent;\n}\n\nexport function getThemeInfo(css: string, fileName: string): UserThemeHeader {\n if (!css) return makeHeader(fileName);\n\n const block = css.split(\"/**\", 2)?.[1]?.split(\"*/\", 1)?.[0];\n if (!block) return makeHeader(fileName);\n\n const header: Partial = {};\n let field = \"\";\n let accum = \"\";\n for (const line of block.split(splitRegex)) {\n if (line.length === 0) continue;\n if (line.charAt(0) === \"@\" && line.charAt(1) !== \" \") {\n header[field] = accum.trim();\n const l = line.indexOf(\" \");\n field = line.substring(1, l);\n accum = line.substring(l + 1);\n }\n else {\n accum += \" \" + line.replace(\"\\\\n\", \"\\n\").replace(escapedAtRegex, \"@\");\n }\n }\n header[field] = accum.trim();\n delete header[\"\"];\n return makeHeader(fileName, header);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { app } from \"electron\";\nimport { join } from \"path\";\n\nexport const DATA_DIR = process.env.VENCORD_USER_DATA_DIR ?? (\n process.env.DISCORD_USER_DATA_DIR\n ? join(process.env.DISCORD_USER_DATA_DIR, \"..\", \"VencordData\")\n : join(app.getPath(\"userData\"), \"..\", \"Vencord\")\n);\nexport const SETTINGS_DIR = join(DATA_DIR, \"settings\");\nexport const THEMES_DIR = join(DATA_DIR, \"themes\");\nexport const QUICKCSS_PATH = join(SETTINGS_DIR, \"quickCss.css\");\nexport const SETTINGS_FILE = join(SETTINGS_DIR, \"settings.json\");\nexport const ALLOWED_PROTOCOLS = [\n \"https:\",\n \"http:\",\n \"steam:\",\n \"spotify:\",\n \"com.epicgames.launcher:\",\n];\n\nexport const IS_VANILLA = /* @__PURE__ */ process.argv.includes(\"--vanilla\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { type BrowserWindow, shell } from \"electron\";\n\nexport function makeLinksOpenExternally(win: BrowserWindow) {\n win.webContents.setWindowOpenHandler(({ url }) => {\n switch (url) {\n case \"about:blank\":\n case \"https://discord.com/popout\":\n case \"https://ptb.discord.com/popout\":\n case \"https://canary.discord.com/popout\":\n return { action: \"allow\" };\n }\n\n try {\n var { protocol } = new URL(url);\n } catch {\n return { action: \"deny\" };\n }\n\n switch (protocol) {\n case \"http:\":\n case \"https:\":\n case \"mailto:\":\n case \"steam:\":\n case \"spotify:\":\n shell.openExternal(url);\n }\n\n return { action: \"deny\" };\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { session } from \"electron\";\nimport { unzip } from \"fflate\";\nimport { constants as fsConstants } from \"fs\";\nimport { access, mkdir, rm, writeFile } from \"fs/promises\";\nimport { join } from \"path\";\n\nimport { DATA_DIR } from \"./constants\";\nimport { crxToZip } from \"./crxToZip\";\nimport { get } from \"./simpleGet\";\n\nconst extensionCacheDir = join(DATA_DIR, \"ExtensionCache\");\n\nasync function extract(data: Buffer, outDir: string) {\n await mkdir(outDir, { recursive: true });\n return new Promise((resolve, reject) => {\n unzip(data, (err, files) => {\n if (err) return void reject(err);\n Promise.all(Object.keys(files).map(async f => {\n // Signature stuff\n // 'Cannot load extension with file or directory name\n // _metadata. Filenames starting with \"_\" are reserved for use by the system.';\n if (f.startsWith(\"_metadata/\")) return;\n\n if (f.endsWith(\"/\")) return void mkdir(join(outDir, f), { recursive: true });\n\n const pathElements = f.split(\"/\");\n const name = pathElements.pop()!;\n const directories = pathElements.join(\"/\");\n const dir = join(outDir, directories);\n\n if (directories) {\n await mkdir(dir, { recursive: true });\n }\n\n await writeFile(join(dir, name), files[f]);\n }))\n .then(() => resolve())\n .catch(err => {\n rm(outDir, { recursive: true, force: true });\n reject(err);\n });\n });\n });\n}\n\nexport async function installExt(id: string) {\n const extDir = join(extensionCacheDir, `${id}`);\n\n try {\n await access(extDir, fsConstants.F_OK);\n } catch (err) {\n const url = id === \"fmkadmapgofadopljbjfkapdkoienihi\"\n // React Devtools v4.25\n // v4.27 is broken in Electron, see https://github.com/facebook/react/issues/25843\n // Unfortunately, Google does not serve old versions, so this is the only way\n ? \"https://raw.githubusercontent.com/Vendicated/random-files/f6f550e4c58ac5f2012095a130406c2ab25b984d/fmkadmapgofadopljbjfkapdkoienihi.zip\"\n : `https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&x=id%3D${id}%26uc&prodversion=32`;\n const buf = await get(url, {\n headers: {\n \"User-Agent\": \"Vencord (https://github.com/Vendicated/Vencord)\"\n }\n });\n await extract(crxToZip(buf), extDir).catch(console.error);\n }\n\n session.defaultSession.loadExtension(extDir);\n}\n", "import { createRequire } from 'module';\nvar require = createRequire('/');\n// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\n// Mediocre shim\nvar Worker;\nvar workerAdd = \";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global\";\ntry {\n Worker = require('worker_threads').Worker;\n}\ncatch (e) {\n}\nvar wk = Worker ? function (c, _, msg, transfer, cb) {\n var done = false;\n var w = new Worker(c + workerAdd, { eval: true })\n .on('error', function (e) { return cb(e, null); })\n .on('message', function (m) { return cb(null, m); })\n .on('exit', function (c) {\n if (c && !done)\n cb(new Error('exited with code ' + c), null);\n });\n w.postMessage(msg, transfer);\n w.terminate = function () {\n done = true;\n return Worker.prototype.terminate.call(w);\n };\n return w;\n} : function (_, __, ___, ____, cb) {\n setImmediate(function () { return cb(new Error('async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)'), null); });\n var NOP = function () { };\n return {\n terminate: NOP,\n postMessage: NOP\n };\n};\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\n// see fleb note\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new u32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return [b, r];\n};\nvar _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i) {\n if (cd[i])\n ++l[cd[i] - 1];\n }\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v.BYTES_PER_ELEMENT == 2 ? u16 : v.BYTES_PER_ELEMENT == 4 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e >= s) {\n // write final block\n w[pos >> 3] = lst;\n }\n pos = wfblk(w, pos + 1, dat.subarray(i, e));\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\\s+/g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k].buffer) {\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k, op = o;\n if (Array.isArray(val))\n op = mrg(o, val[1]), val = val[0];\n if (val instanceof u8)\n t[n] = [val, op];\n else {\n t[n += '/'] = [new u8(0), op];\n fltn(val, n, t, o);\n }\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != -1) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c < 0 ? -c - 2 : c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u, -1);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = lft = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n", "/* eslint-disable simple-header/header */\n\n/*!\n * crxToZip\n * Copyright (c) 2013 Rob Wu \n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/.\n */\n\nexport function crxToZip(buf: Buffer) {\n function calcLength(a: number, b: number, c: number, d: number) {\n let length = 0;\n\n length += a << 0;\n length += b << 8;\n length += c << 16;\n length += d << 24 >>> 0;\n return length;\n }\n\n // 50 4b 03 04\n // This is actually a zip file\n if (buf[0] === 80 && buf[1] === 75 && buf[2] === 3 && buf[3] === 4) {\n return buf;\n }\n\n // 43 72 32 34 (Cr24)\n if (buf[0] !== 67 || buf[1] !== 114 || buf[2] !== 50 || buf[3] !== 52) {\n throw new Error(\"Invalid header: Does not start with Cr24\");\n }\n\n // 02 00 00 00\n // or\n // 03 00 00 00\n const isV3 = buf[4] === 3;\n const isV2 = buf[4] === 2;\n\n if ((!isV2 && !isV3) || buf[5] || buf[6] || buf[7]) {\n throw new Error(\"Unexpected crx format version number.\");\n }\n\n if (isV2) {\n const publicKeyLength = calcLength(buf[8], buf[9], buf[10], buf[11]);\n const signatureLength = calcLength(buf[12], buf[13], buf[14], buf[15]);\n\n // 16 = Magic number (4), CRX format version (4), lengths (2x4)\n const zipStartOffset = 16 + publicKeyLength + signatureLength;\n\n return buf.subarray(zipStartOffset, buf.length);\n }\n // v3 format has header size and then header\n const headerSize = calcLength(buf[8], buf[9], buf[10], buf[11]);\n const zipStartOffset = 12 + headerSize;\n\n return buf.subarray(zipStartOffset, buf.length);\n}\n"], "mappings": ";;;;ukBAAA,IAAAA,EAAAC,EAAA,oBCAA,IAAOC,GAAPC,GAAAC,EAAA,KAAAC,IAAOH,GAAQ,YCAf,IAAOI,EAAPC,GAAAC,EAAA,KAAAC,IAAOH,EAAQ,uBCAf,IA4BaI,GA5BbC,GAAAC,EAAA,kBAAAC,IAkBAC,KACAC,KASaL,GAAqB,WAAWM,KAAUC,EAAY,wBAAwBA,KAAe,OC5B1G,IAAAC,GAAAC,EAAA,kBAAAC,MCoBO,SAASC,EAAIC,EAAaC,EAAgC,CAAC,EAAG,CACjE,OAAO,IAAI,QAAgB,CAACC,EAASC,IAAW,CAC5C,GAAAC,QAAM,IAAIJ,EAAKC,EAASI,GAAO,CAC3B,GAAM,CAAE,WAAAC,EAAY,cAAAC,EAAe,QAAAC,CAAQ,EAAIH,EAC/C,GAAIC,GAAe,IACf,OAAO,KAAKH,EAAO,GAAGG,MAAeC,OAAmBP,GAAK,EACjE,GAAIM,GAAe,IACf,OAAO,KAAKJ,EAAQH,EAAIS,EAAQ,SAAWP,CAAO,CAAC,EAEvD,IAAMQ,EAAS,CAAC,EAChBJ,EAAI,GAAG,QAASF,CAAM,EAEtBE,EAAI,GAAG,OAAQK,GAASD,EAAO,KAAKC,CAAK,CAAC,EAC1CL,EAAI,KAAK,MAAO,IAAMH,EAAQ,OAAO,OAAOO,CAAM,CAAC,CAAC,CACxD,CA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CAAM,IAAMA,GAAQ,MAAM,EACrC,IAAIJ,GAAaA,EAAU,KAAK,EAAE,KAAK,GAAG,CAAC,EAC3C,KAAK,IAAI,EAEZK,EAAYX,GAAsC,CACpD,IAAMY,EAASb,EAAWC,EAAS,yBAAyB,EAE5D,GAAIY,EAAQ,CACR,IAAMC,EAAMV,EAAYH,EAAQY,GAAQ,EAAE,EAE1C,QAAWN,IAAa,CAAC,YAAa,cAAe,UAAW,WAAY,YAAa,YAAY,EACjGO,EAAIP,KAAe,CAAC,EACpBO,EAAIP,GAAW,KAAK,IAAK,QAAS,QAAS,WAAY,iBAAiB,EAK5EO,EAAI,gBAAkB,CAAC,EACvBA,EAAI,cAAc,KAAK,gBAAiB,oBAAqB,8BAA8B,EAC3Fb,EAAQY,GAAU,CAACH,EAAgBI,CAAG,CAAC,CAC3C,CACJ,EAEA,UAAQ,eAAe,WAAW,kBAAkB,CAAC,CAAE,gBAAAC,EAAiB,aAAAC,CAAa,EAAGzB,IAAO,CAC3F,GAAIwB,IACIC,IAAiB,aACjBJ,EAASG,CAAe,EAIxBC,IAAiB,cAAc,CAC/B,IAAMH,EAASb,EAAWe,EAAiB,cAAc,EACrDF,IACAE,EAAgBF,GAAU,CAAC,UAAU,EAC7C,CAGJtB,EAAG,CAAE,OAAQ,GAAO,gBAAAwB,CAAgB,CAAC,CACzC,CAAC,EAKD,UAAQ,eAAe,WAAW,kBAAoB,IAAM,CAAE,CAClE,CAAC", "names": ["init_react", "__esmMin", "git_hash_default", "init_git_hash", "__esmMin", "init_react", "git_remote_default", "init_git_remote", "__esmMin", "init_react", "VENCORD_USER_AGENT", "init_constants", "__esmMin", "init_react", "init_git_hash", "init_git_remote", "git_hash_default", "git_remote_default", "init_IpcEvents", "__esmMin", "init_react", "get", "url", "options", "resolve", "reject", "https", "res", "statusCode", "statusMessage", "headers", "chunks", "chunk", "import_https", "init_simpleGet", "__esmMin", "init_react", "serializeErrors", "func", "e", "VENCORD_FILES", "init_common", "__esmMin", "init_react", "http_exports", "githubGet", "endpoint", "get", "API_BASE", "VENCORD_USER_AGENT", "calculateGitChanges", "fetchUpdates", "res", "git_hash_default", "c", "release", "data", "name", "browser_download_url", "VENCORD_FILES", "s", "PendingUpdates", "applyUpdates", "import_electron", "import_promises", "import_path", "init_http", "__esmMin", "init_react", "init_constants", "init_IpcEvents", "init_git_hash", "init_git_remote", "init_simpleGet", "init_common", "git_remote_default", "serializeErrors", "init_react", "import_electron", "import_path", "init_react", "init_react", "init_react", "init_IpcEvents", "import_electron", "init_react", "native_exports", "init_react", "import_electron", "_", "win", "frame", "settings", "getSettings", "native_exports", "__export", "resolveRedirect", "init_react", "import_https", "validRedirectUrls", "getRedirect", "url", "resolve", "reject", "req", "res", "_", "native_exports", "__export", "readRecording", "init_react", "import_electron", "import_promises", "import_path", "_", "filePath", "filename", "discordBaseDirWithTrailingSlash", "buf", "pluginNatives_default", "native_exports", "PluginIpcMappings", "plugin", "methods", "pluginNatives_default", "entries", "mappings", "methodName", "method", "key", "init_react", "init_IpcEvents", "init_react", "Queue", "maxSize", "func", "import_electron", "import_fs", "import_promises", "import_path", "init_react", "monacoWin_default", "init_react", "splitRegex", "escapedAtRegex", "makeHeader", "fileName", "opts", "stripBOM", "fileContent", "getThemeInfo", "css", "block", "header", "field", "accum", "line", "l", "init_react", "import_electron", "import_path", "DATA_DIR", "SETTINGS_DIR", "THEMES_DIR", "QUICKCSS_PATH", "SETTINGS_FILE", "ALLOWED_PROTOCOLS", "init_react", "import_electron", "makeLinksOpenExternally", "win", "url", "protocol", "SETTINGS_DIR", "THEMES_DIR", "ensureSafePath", "basePath", "path", "normalizedBasePath", "newPath", "normalizedPath", "readCss", "QUICKCSS_PATH", "listThemes", "files", "themeInfo", "fileName", "data", "getThemeData", "stripBOM", "getThemeInfo", "safePath", "readSettings", "SETTINGS_FILE", "getSettings", "_", "url", "protocol", "ALLOWED_PROTOCOLS", "cssWriteQueue", "Queue", "settingsWriteQueue", "css", "s", "win", "makeLinksOpenExternally", "monacoWin_default", "init_react", "import_electron", "init_react", "import_module", "require", "Worker", "workerAdd", "wk", "c", "_", "msg", "transfer", "cb", "done", "w", "e", "m", "__", "___", "____", "NOP", "u8", "u16", "u32", "fleb", "fdeb", "clim", "freb", "eb", "start", "b", "i", "r", "j", "_a", "fl", "revfl", "_b", "fd", "revfd", "rev", "x", "hMap", "cd", "mb", "s", "l", "le", "co", "rvb", "sv", "r_1", "v", "flt", "fdt", "flrm", "hMap", "flt", "fdrm", "hMap", "fdt", "max", "a", "m", "i", "bits", "d", "p", "o", "bits16", "shft", "slc", "v", "s", "e", "n", "u16", "u32", "u8", "ec", "err", "ind", "msg", "nt", "e", "inflt", "dat", "buf", "st", "sl", "u8", "noBuf", "noSt", "cbuf", "l", "bl", "nbuf", "final", "pos", "bt", "lm", "dm", "lbt", "dbt", "tbts", "bits", "type", "flrm", "fdrm", "hLit", "hcLen", "tl", "ldt", "clt", "i", "clim", "clb", "max", "clbmsk", "clm", "hMap", "r", "s", "c", "n", "lt", "dt", "shft", "t", "lms", "dms", "lpos", "bits16", "sym", "add", "b", "fleb", "fl", "d", "dsym", "fd", "fdeb", "end", "slc", "et", "u8", "mrg", "a", "b", "o", "k", "wcln", "fn", "fnStr", "td", "dt", "st", "ks", "i", "v", "st_1", "spInd", "t", "ch", "cbfs", "tl", "wrkr", "fns", "init", "id", "cb", "_a", "td_1", "m", "wk", "bInflt", "u8", "u16", "u32", "fleb", "fdeb", "clim", "fl", "fd", "flrm", "fdrm", "rev", "ec", "hMap", "max", "bits", "bits16", "shft", "slc", "err", "inflt", "inflateSync", "pbf", "gu8", "pbf", "msg", "gu8", "o", "u8", "cbify", "dat", "opts", "fns", "init", "id", "cb", "w", "wrkr", "err", "b2", "d", "b", "b4", "b8", "inflate", "data", "opts", "cb", "err", "cbify", "bInflt", "ev", "pbf", "inflateSync", "gu8", "out", "inflt", "td", "tds", "et", "dutf8", "d", "r", "i", "c", "eb", "slc", "strFromU8", "dat", "latin1", "r", "i", "td", "_a", "dutf8", "out", "ext", "err", "slzh", "d", "b", "b2", "zh", "z", "fnl", "fn", "strFromU8", "es", "bs", "b4", "_a", "z64e", "sc", "su", "off", "b8", "mt", "fn", "unzip", "data", "opts", "cb", "err", "term", "tAll", "i", "files", "cbd", "a", "b", "e", "b4", "lft", "b2", "c", "o", "z", "ze", "fltr", "_loop_3", "_a", "zh", "c_1", "sc", "su", "no", "off", "slzh", "cbl", "d", "slc", "infl", "inflateSync", "u8", "inflate", "import_fs", "import_promises", "import_path", "init_react", "crxToZip", "buf", "calcLength", "b", "d", "length", "isV3", "isV2", "publicKeyLength", "signatureLength", "zipStartOffset", "init_simpleGet", "extensionCacheDir", "DATA_DIR", "extract", "data", "outDir", "resolve", "reject", "unzip", "err", "files", "f", "pathElements", "name", "directories", "dir", "installExt", "id", "extDir", "fsConstants", "url", "buf", "get", "crxToZip", "unsafeUrl", "cb", "url", "theme", "safeUrl", "ensureSafePath", "THEMES_DIR", "getSettings", "installExt", "err", "findHeader", "headers", "headerName", "h", "parsePolicy", "policy", "result", "directive", "directiveKey", "directiveValue", "stringifyPolicy", "values", "patchCsp", "header", "csp", "responseHeaders", "resourceType"] } diff --git a/VencordDesktop/vencordDist/vencordDesktopPreload.js b/VencordDesktop/vencordDist/vencordDesktopPreload.js index 209cd84..efefed1 100644 --- a/VencordDesktop/vencordDist/vencordDesktopPreload.js +++ b/VencordDesktop/vencordDist/vencordDesktopPreload.js @@ -1,4 +1,4 @@ -// Vencord 81fb7c6 +// Vencord 96126fa // Standalone: true // Platform: Universal // Updater disabled: false diff --git a/VencordDesktop/vencordDist/vencordDesktopRenderer.css b/VencordDesktop/vencordDist/vencordDesktopRenderer.css index 65278c9..8b33517 100644 --- a/VencordDesktop/vencordDist/vencordDesktopRenderer.css +++ b/VencordDesktop/vencordDist/vencordDesktopRenderer.css @@ -1 +1 @@ -.vc-error-card{padding:2em;background-color:#e7828430;border:1px solid #e78284;border-radius:5px;color:var(--text-normal, white)}.vc-notification-root{all:unset;display:flex;flex-direction:column;color:var(--text-normal);background-color:var(--background-secondary-alt);border-radius:6px;overflow:hidden;cursor:pointer;width:100%}.vc-notification-root:not(.vc-notification-log-wrapper > .vc-notification-root){position:absolute;z-index:2147483647;right:1rem;width:25vw;min-height:10vh}.vc-notification{display:flex;flex-direction:row;padding:1.25rem;gap:1.25rem}.vc-notification-content{width:100%}.vc-notification-header{display:flex;justify-content:space-between}.vc-notification-title{color:var(--header-primary);font-size:1rem;font-weight:600;line-height:1.25rem;text-transform:uppercase}.vc-notification-close-btn{all:unset;cursor:pointer;color:var(--interactive-normal);opacity:.5;transition:opacity .2s ease-in-out,color .2s ease-in-out}.vc-notification-close-btn:hover{color:var(--interactive-hover);opacity:1}.vc-notification-icon{height:4rem;width:4rem;border-radius:6px}.vc-notification-progressbar{height:.25rem;border-radius:5px;margin-top:auto}.vc-notification-p{margin:.5rem 0 0;line-height:140%}.vc-notification-img{width:100%}.vc-notification-log-empty{height:218px;background:url(/assets/b36de980b174d7b798c89f35c116e5c6.svg) center no-repeat;margin-bottom:40px}.vc-notification-log-container{display:flex;flex-direction:column;padding:1em;overflow:hidden}.vc-notification-log-wrapper{transition:.2s ease;transition-property:height,opacity}.vc-notification-log-wrapper:not(:last-child){margin-bottom:1em}.vc-notification-log-removing{height:0!important;opacity:0;margin-bottom:1em}.vc-notification-log-body{display:flex;flex-direction:column}.vc-notification-log-timestamp{margin-left:auto;font-size:.8em;font-weight:lighter}.vc-notification-log-danger-btn{color:var(--white-500);background-color:var(--button-danger-background)}.vc-settings-tab-bar{margin-top:20px;margin-bottom:10px;border-bottom:2px solid var(--background-modifier-accent)}.vc-settings-tab-bar-item{margin-right:32px;padding-bottom:16px;margin-bottom:-2px}.vc-settings-quick-actions-card{padding:1em;display:flex;gap:1em;align-items:center;justify-content:space-evenly;flex-grow:1;flex-flow:row wrap;margin-bottom:1em}.vc-settings-donate{display:flex;flex-direction:row}.vc-settings-card{padding:1em;margin-bottom:1em}.vc-backup-restore-card{background-color:var(--info-warning-background);border-color:var(--info-warning-foreground);color:var(--info-warning-text)}.vc-settings-theme-links{display:inline-block!important;color:var(--text-normal)!important;padding:.5em;border:1px solid var(--background-modifier-accent);max-height:unset}.vc-cloud-settings-sync-grid{display:grid;grid-template-columns:repeat(3,1fr);grid-gap:1em}.vc-cloud-erase-data-danger-btn{color:var(--white-500);background-color:var(--button-danger-background)}.vc-text-selectable,.vc-text-selectable :where([class*="text" i],[class*="title" i]){user-select:text;cursor:initial}.vc-settings-theme-grid{display:grid;grid-gap:16px;grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}.vc-settings-theme-card{display:flex;flex-direction:column;background-color:var(--background-secondary-alt);color:var(--interactive-active);border-radius:8px;padding:1em;width:100%;transition:.1s ease-out;transition-property:box-shadow,transform,background,opacity}.vc-settings-theme-card-text{text-overflow:ellipsis;height:1.2em;margin-bottom:2px;white-space:nowrap;overflow:hidden}.vc-settings-theme-author:before{content:"by "}.vc-plugins-grid{margin-top:16px;display:grid;grid-gap:16px;grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}.vc-plugins-info-button{height:24px;width:24px;padding:0;background:transparent;margin-right:8px}.vc-plugins-settings-button:hover{color:var(--interactive-hover)}.vc-plugins-filter-controls{display:grid;height:40px;gap:10px;grid-template-columns:1fr 150px}.vc-plugins-badge{padding:0 6px;font-family:var(--font-display);font-weight:500;border-radius:8px;height:16px;font-size:12px;line-height:16px;color:var(--white-500);text-align:center}.vc-plugins-dep-name{margin:0 auto}.vc-plugins-info-card{padding:1em;height:8em;display:flex;flex-direction:column}.vc-plugins-info-card div{line-height:32px}.vc-plugins-restart-card{padding:1em;background:var(--info-warning-background);border:1px solid var(--info-warning-foreground);color:var(--info-warning-text)}.vc-plugins-restart-card button{margin-top:.5em}.vc-plugins-info-button svg:not(:hover,:focus){color:var(--text-muted)}.vc-open-external-icon{transform:rotate(45deg)}.vc-owner-crown-icon{color:var(--text-warning)}.vc-author-modal-root{padding:1em}.vc-author-modal-header{display:flex;align-items:center;margin-bottom:1em}.vc-author-modal-name{text-transform:none;flex-grow:0;background:var(--background-tertiary);border-radius:0 9999px 9999px 0;padding:6px .8em 6px .5em;font-size:20px;height:20px;position:relative;text-wrap:nowrap}.vc-author-modal-name:before{content:"";display:block;position:absolute;height:100%;width:16px;background:var(--background-tertiary);z-index:-1;left:-16px;top:0}.vc-author-modal-avatar{height:32px;width:32px;border-radius:50%}.vc-author-modal-links{margin-left:auto;display:flex;gap:.2em}.vc-author-modal-links img{height:32px;width:32px;border-radius:50%;border:4px solid var(--background-tertiary);box-sizing:border-box}.vc-author-modal-plugins{display:grid;gap:.5em}.vc-addon-card{background-color:var(--background-secondary-alt);color:var(--interactive-active);border-radius:8px;display:block;height:100%;padding:12px;width:100%;transition:.1s ease-out;transition-property:box-shadow,transform,background,opacity;box-sizing:border-box}.vc-addon-card-disabled{opacity:.6}.vc-addon-card:hover{background-color:var(--background-tertiary);transform:translateY(-1px);box-shadow:var(--elevation-high)}.vc-addon-header{margin-top:auto;display:flex;width:100%;justify-content:flex-end;align-items:center;gap:8px;margin-bottom:.5em}.vc-addon-note{height:36px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;box-orient:vertical}.vc-addon-name-author{width:100%}.vc-addon-name{display:flex;width:100%;align-items:center;flex-grow:1;gap:8px}.vc-addon-author{font-size:.8em}.vc-addon-author:before{content:"by "}.vc-switch-slider{transition:.1s transform ease-in-out}.client-theme-settings{display:flex;flex-direction:column}.client-theme-container{display:flex;flex-direction:row;justify-content:space-between}.client-theme-settings-labels{display:flex;flex-direction:column;justify-content:flex-start}.client-theme-container>[class^=colorSwatch]>[class^=swatch]{border:thin solid var(--background-modifier-accent)!important}.client-theme-warning{color:var(--text-danger)}.vc-dearrow-toggle-off svg{filter:grayscale(1)}.vc-dearrow-toggle-on,.vc-dearrow-toggle-off{all:unset;display:inline;cursor:pointer;position:absolute;top:.75rem;right:.75rem}.messagelogger-deleted [class^=buttons]{display:none}.messagelogger-deleted :is(video,.emoji,[data-type="sticker"],iframe,.messagelogger-deleted-attachment,[class|="inlineMediaEmbed"]){filter:grayscale(1)!important;transition:.15s filter ease-in-out}.messagelogger-deleted :is(video,.emoji,[data-type="sticker"],iframe,.messagelogger-deleted-attachment,[class|="inlineMediaEmbed"]):hover,.messagelogger-deleted{filter:grayscale(0)!important}.theme-dark .messagelogger-edited{filter:brightness(80%)}.theme-light .messagelogger-edited{opacity:.5}.vc-permviewer-userperms-title-container{display:flex;justify-content:space-between;align-items:center;margin-top:10px;margin-bottom:6px}.vc-permviewer-userperms-btns-container{display:flex;align-items:center}.vc-permviewer-userperms-sortorder-btn{all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px}.vc-permviewer-userperms-permdetails-btn,.vc-permviewer-userperms-toggleperms-btn{all:unset;cursor:pointer;display:flex;align-items:center}.vc-permviewer-perms-title{flex-grow:1}.vc-permviewer-perms-no-perms{width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center}.vc-permviewer-perms-container{display:grid;grid-template-columns:1fr 2fr;grid-template-areas:"list permissions";padding:16px 0}.vc-permviewer-perms-list{grid-area:list;display:flex;flex-direction:column;gap:2px;border-right:2px solid var(--background-modifier-active)}.vc-permviewer-perms-list-item-btn{all:unset;cursor:pointer}.vc-permviewer-perms-list-item{display:flex;align-items:center;padding:8px 5px;cursor:pointer;width:230px;border-radius:5px}.vc-permviewer-perms-list-item:hover{background-color:var(--background-modifier-hover)}.vc-permviewer-perms-list-item-active{background-color:var(--background-modifier-selected)}.vc-permviewer-perms-list-item>div{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.vc-permviewer-perms-role-circle{border-radius:50%;width:12px;height:12px;margin-left:3px;margin-right:11px;flex-shrink:0}.vc-permviewer-perms-user-img{border-radius:50%;width:20px;height:20px;margin-right:6px}.vc-permviewer-perms-perms{grid-area:permissions;display:flex;flex-direction:column;margin-left:5px}.vc-permviewer-perms-perms-item{position:relative;display:flex;align-items:center;padding:10px;border-bottom:2px solid var(--background-modifier-active)}.vc-permviewer-perms-perms-item:last-child{border:0}.vc-permviewer-perms-perms-item-icon{border:1px solid var(--background-modifier-selected);width:24px;height:24px;margin-right:5px}.vc-permviewer-perms-perms-item .vc-info-icon{color:var(--interactive-muted);cursor:pointer;position:absolute;right:0;scale:.9;transition:color ease-in .1s}.vc-permviewer-perms-perms-item .vc-info-icon:hover{color:var(--interactive-active)}.vc-expandableheader-center-flex{display:flex;justify-items:center;align-items:center}.vc-expandableheader-btn{all:unset;cursor:pointer;width:24px;height:24px}.vc-pip-button{color:var(--interactive-normal)}.vc-pip-button:hover{background-color:var(--background-modifier-hover);color:var(--interactive-hover)}.vc-pronoundb-compact{display:none}[class*=compact] .vc-pronoundb-compact{display:inline-block;margin-left:-2px;margin-right:.25rem}.vc-st-modal-content input{background-color:var(--input-background);color:var(--text-normal);width:95%;padding:8px 8px 8px 12px;margin:1em 0;outline:none;border:1px solid var(--input-background);border-radius:4px;font-weight:500;font-style:inherit;font-size:100%}.vc-st-format-label,.vc-st-format-label span{background-color:transparent}.vc-st-modal-content [class|=select]{margin-bottom:1em}.vc-st-modal-content [class|=select] span{background-color:var(--input-background)}.vc-st-modal-header{justify-content:space-between;align-content:center}.vc-st-modal-header h1{margin:0}.vc-st-modal-header button{padding:0}.vc-st-preview-text{margin-bottom:1em}.vc-st-button{padding:0 6px}.vc-st-button svg{transform:scale(1.1) translateY(1px)}.vc-gp-root{height:100%;user-select:text}.vc-gp-banner{width:100%;cursor:pointer}.vc-gp-header{display:flex;flex-direction:row;align-items:center;gap:.5em;margin:.5em}.vc-gp-header img{width:48px;height:48px;cursor:pointer}.vc-gp-name-and-description{display:flex;flex-direction:column;gap:.2em}.vc-gp-name{margin:0}.vc-gp-tab-bar{border-bottom:2px solid var(--background-modifier-accent);margin:20px 12px 0;display:flex;gap:40px;align-items:stretch;flex-direction:row}.vc-gp-tab{border-bottom:2px solid transparent;color:var(--interactive-normal);cursor:pointer;height:39px;line-height:14px}.vc-gp-tab-content{margin:1em}.vc-gp-tab:where(.vc-gp-selected,:hover,:focus){border-bottom-color:var(--interactive-active)}.vc-gp-info{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1em}.vc-gp-server-info-pair{color:var(--text-normal)}.vc-gp-server-info-pair [class^=timestamp]{margin-left:0}.vc-gp-owner{display:flex;align-items:center;gap:.2em}.vc-gp-owner img{height:20px;border-radius:50%;cursor:pointer}.vc-gp-scroller{width:100%;max-height:500px}.vc-gp-scroller [class^=listRow]{margin:1px 0}.vc-gp-scroller [class^=listRow]:hover{background-color:var(--background-modifier-hover)}.shiki-container{border:4px;background-color:var(--background-secondary)}.shiki-root{border-radius:4px}.shiki-root code{display:block;overflow-x:auto;padding:.5em;position:relative;font-size:.875rem;line-height:1.125rem;text-indent:0;white-space:pre-wrap;background:transparent;border:none}.shiki-devicon{margin-right:8px;user-select:none}.shiki-plain code{padding-top:8px}.shiki-btns{font-size:1em;position:absolute;right:0;bottom:0;opacity:0}.shiki-root:hover .shiki-btns{opacity:1}.shiki-btn{border-radius:4px 4px 0 0;padding:4px 8px;user-select:none}.shiki-btn~.shiki-btn{margin-left:4px}.shiki-btn:last-child{border-radius:4px 0}.shiki-spinner-container{align-items:center;background-color:#0009;display:flex;position:absolute;justify-content:center;inset:0}.shiki-preview{margin-bottom:2em}.shiki-lang{padding:0 5px;margin-bottom:6px;font-weight:700;text-transform:capitalize;display:flex;align-items:center}.shiki-table{border-collapse:collapse;width:100%}.shiki-table tr{height:19px;width:100%}.shiki-root td:first-child{border-right:1px solid transparent;padding-left:5px;padding-right:8px;user-select:none}.shiki-root td:last-child{padding-left:8px;word-break:break-word;width:100%}.vc-user-connection{all:unset;display:inline-block;cursor:pointer}.vc-sc-tooltip{display:inline-flex;gap:.25em;align-items:center}.shc-lock-screen-outer-container{overflow:hidden scroll;flex:1 1 auto;height:100%;width:100%}.shc-lock-screen-container{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:100%}.shc-lock-screen-container>*{margin:5px}.shc-lock-screen-logo{width:180px;height:180px}.shc-lock-screen-heading-container{display:flex;flex-direction:row;align-items:center}.shc-lock-screen-heading-container>*{margin:inherit}.shc-lock-screen-heading-nsfw-icon{color:var(--text-normal)}.shc-lock-screen-topic-container{color:var(--text-normal);background:var(--bg-overlay-3, var(--background-secondary));border-radius:5px;padding:10px;max-width:70vw}.shc-lock-screen-tags-container{background:var(--bg-overlay-3, var(--background-secondary));border-radius:5px;padding:10px;max-width:70vw}.shc-lock-screen-tags-container>*{margin:inherit}.shc-lock-screen-tags{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px}.shc-evenodd-fill-current-color{fill-rule:evenodd;fill:currentcolor}.shc-hidden-channel-icon{margin-left:6px;z-index:0;cursor:not-allowed}.shc-lock-screen-default-emoji-container{display:flex;flex-direction:row;align-items:center}.shc-lock-screen-default-emoji-container>[class^=emojiContainer]{background:var(--bg-overlay-3, var(--background-secondary));border-radius:8px;padding:5px 6px;margin-left:5px}.shc-lock-screen-allowed-users-and-roles-container{display:flex;flex-direction:column;align-items:center;background:var(--bg-overlay-3, var(--background-secondary));border-radius:5px;padding:10px;max-width:70vw}.shc-lock-screen-allowed-users-and-roles-container-title{display:flex;flex-direction:row;align-items:center}.shc-lock-screen-allowed-users-and-roles-container-toggle-btn{all:unset;margin-left:5px;cursor:pointer;display:flex;align-items:center}.shc-lock-screen-allowed-users-and-roles-container-toggle-btn>svg{color:var(--text-normal)}.shc-lock-screen-allowed-users-and-roles-container-permdetails-btn{all:unset;margin-right:5px;cursor:pointer;display:flex;align-items:center}.shc-lock-screen-allowed-users-and-roles-container-permdetails-btn>svg{color:var(--text-normal)}.shc-lock-screen-allowed-users-and-roles-container>[class^=members]{margin-left:10px;flex-wrap:wrap;justify-content:center}.vc-smyn-suffix{color:var(--text-muted)}.vc-smyn-suffix:before{content:"("}.vc-smyn-suffix:after{content:")"}#vc-spotify-player{padding:.375rem .5rem;border-bottom:1px solid var(--background-modifier-accent);--vc-spotify-green: #1db954}.theme-light #vc-spotify-player{background:var(--bg-overlay-3, var(--background-secondary-alt))}.theme-dark #vc-spotify-player{background:var(--bg-overlay-1, var(--background-secondary-alt))}.vc-spotify-button{background:none;color:var(--interactive-normal);padding:0;width:32px;height:32px;border-radius:100%;display:flex;justify-content:center;align-items:center}.vc-spotify-button:hover{color:var(--interactive-hover);background-color:var(--background-modifier-selected)}.vc-spotify-button svg{height:24px;width:24px}[class*=vc-spotify-shuffle]>svg,[class*=vc-spotify-repeat]>svg{width:22px;height:22px}.vc-spotify-button svg path{width:100%;height:100%}.vc-spotify-shuffle-on,.vc-spotify-repeat-context,.vc-spotify-repeat-track,.vc-spotify-shuffle-on:hover,.vc-spotify-repeat-context:hover,.vc-spotify-repeat-track:hover{color:var(--vc-spotify-green)}.vc-spotify-tooltip-text{overflow:hidden;white-space:nowrap;padding-right:.2em;max-width:100%;margin:unset}.vc-spotify-repeat-1{font-size:70%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.vc-spotify-button-row{justify-content:center}#vc-spotify-info-wrapper{display:flex;flex-direction:row;align-items:center;height:3em;gap:.5em}#vc-spotify-info-wrapper img{height:90%;object-fit:contain}#vc-spotify-album-expanded-wrapper img{width:100%;object-fit:contain}#vc-spotify-titles{display:flex;flex-direction:column;padding:.2rem;justify-content:center;align-items:flex-start;align-content:flex-start;overflow:hidden}#vc-spotify-song-title{color:var(--header-primary);font-size:14px;font-weight:600}.vc-spotify-ellipoverflow{white-space:nowrap;overflow:hidden;width:100%;text-overflow:ellipsis}.vc-spotify-artist,.vc-spotify-album{font-size:12px;text-decoration:none;color:var(--header-secondary)}.vc-spotify-comma{color:var(--header-secondary)}.vc-spotify-artist[role=link]:hover,#vc-spotify-album-title[role=link]:hover,#vc-spotify-song-title[role=link]:hover{text-decoration:underline;cursor:pointer}#vc-spotify-album-image{border-radius:3px;transition:filter .2s}#vc-spotify-album-image:hover{filter:brightness(1.2);cursor:pointer}#vc-spotify-progress-bar{position:relative;color:var(--text-normal);width:100%;margin:.5em 0 5px}#vc-spotify-progress-bar>[class^=slider]{flex-grow:1;width:100%;padding:0!important}#vc-spotify-progress-bar>[class^=slider] [class^=bar-]{height:4px!important}#vc-spotify-progress-bar>[class^=slider] [class^=grabber]{height:10px!important;width:10px!important;background-color:var(--interactive-normal);border-color:var(--interactive-normal);color:var(--interactive-normal)}#vc-spotify-progress-text{margin:0}.vc-spotify-progress-time{font-size:12px;top:10px;position:absolute}.vc-spotify-time-left{left:0}.vc-spotify-time-right{right:0}.vc-spotify-fallback{padding:.5em;color:var(--text-normal)}.vc-trans-modal-content{padding:1em}.vc-trans-modal-header{justify-content:space-between;align-content:center}.vc-trans-modal-header h1{margin:0}.vc-trans-accessory{color:var(--text-muted);margin-top:.5em;font-style:italic;font-weight:400}.vc-trans-accessory svg{margin-right:.25em}.vc-trans-dismiss{all:unset;cursor:pointer;color:var(--text-link)}.vc-trans-dismiss:is(:hover,:focus){text-decoration:underline}.vc-trans-auto-translate{color:var(--green-360)}.vc-uvs-button>div{white-space:normal!important}.vc-uvs-button{width:100%;margin:auto;height:unset}.vc-uvs-header{color:var(--header-primary);margin-bottom:6px}.vc-uvs-modal-margin{margin:0 12px}.vc-uvs-modal-margin div{margin-bottom:0!important}.vc-uvs-popout-margin-self>[class^=section]{padding-top:0;padding-bottom:12px}.vc-toolbox-btn,.vc-toolbox-btn>svg{-webkit-app-region:no-drag}.vc-toolbox-btn>svg{color:var(--interactive-normal)}.vc-toolbox-btn[class*=selected]>svg{color:var(--interactive-active)}.vc-toolbox-btn:hover>svg{color:var(--interactive-hover)}.vc-vmsg-modal{padding:1em}.vc-vmsg-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5em;margin-bottom:1em}.vc-vmsg-modal audio{width:100%}.vc-vmsg-preview{color:var(--text-normal);border-radius:24px;background-color:var(--background-secondary);position:relative;display:flex;align-items:center;padding:0 16px;height:48px}.vc-vmsg-preview-indicator{background:var(--button-secondary-background);width:16px;height:16px;border-radius:50%;transition:background .2s ease-in-out}.vc-vmsg-preview-recording .vc-vmsg-preview-indicator{background:var(--status-danger)}.vc-vmsg-preview-time{opacity:.8;margin:0 .5em;font-size:80%;font-family:var(--font-code)}.vc-vmsg-preview-label{opacity:.5;letter-spacing:.125em;font-weight:600;flex:1;text-align:center} +.vc-error-card{padding:2em;background-color:#e7828430;border:1px solid #e78284;border-radius:5px;color:var(--text-normal, white)}.vc-notification-root{all:unset;display:flex;flex-direction:column;color:var(--text-normal);background-color:var(--background-secondary-alt);border-radius:6px;overflow:hidden;cursor:pointer;width:100%}.vc-notification-root:not(.vc-notification-log-wrapper > .vc-notification-root){position:absolute;z-index:2147483647;right:1rem;width:25vw;min-height:10vh}.vc-notification{display:flex;flex-direction:row;padding:1.25rem;gap:1.25rem}.vc-notification-content{width:100%}.vc-notification-header{display:flex;justify-content:space-between}.vc-notification-title{color:var(--header-primary);font-size:1rem;font-weight:600;line-height:1.25rem;text-transform:uppercase}.vc-notification-close-btn{all:unset;cursor:pointer;color:var(--interactive-normal);opacity:.5;transition:opacity .2s ease-in-out,color .2s ease-in-out}.vc-notification-close-btn:hover{color:var(--interactive-hover);opacity:1}.vc-notification-icon{height:4rem;width:4rem;border-radius:6px}.vc-notification-progressbar{height:.25rem;border-radius:5px;margin-top:auto}.vc-notification-p{margin:.5rem 0 0;line-height:140%}.vc-notification-img{width:100%}.vc-notification-log-empty{height:218px;background:url(/assets/b36de980b174d7b798c89f35c116e5c6.svg) center no-repeat;margin-bottom:40px}.vc-notification-log-container{display:flex;flex-direction:column;padding:1em;overflow:hidden}.vc-notification-log-wrapper{transition:.2s ease;transition-property:height,opacity}.vc-notification-log-wrapper:not(:last-child){margin-bottom:1em}.vc-notification-log-removing{height:0!important;opacity:0;margin-bottom:1em}.vc-notification-log-body{display:flex;flex-direction:column}.vc-notification-log-timestamp{margin-left:auto;font-size:.8em;font-weight:lighter}.vc-notification-log-danger-btn{color:var(--white-500);background-color:var(--button-danger-background)}.vc-settings-tab-bar{margin-top:20px;margin-bottom:10px;border-bottom:2px solid var(--background-modifier-accent)}.vc-settings-tab-bar-item{margin-right:32px;padding-bottom:16px;margin-bottom:-2px}.vc-settings-quick-actions-card{padding:1em;display:flex;gap:1em;align-items:center;justify-content:space-evenly;flex-grow:1;flex-flow:row wrap;margin-bottom:1em}.vc-settings-donate{display:flex;flex-direction:row}.vc-settings-card{padding:1em;margin-bottom:1em}.vc-backup-restore-card{background-color:var(--info-warning-background);border-color:var(--info-warning-foreground);color:var(--info-warning-text)}.vc-settings-theme-links{display:inline-block!important;color:var(--text-normal)!important;padding:.5em;border:1px solid var(--background-modifier-accent);max-height:unset}.vc-cloud-settings-sync-grid{display:grid;grid-template-columns:repeat(3,1fr);grid-gap:1em}.vc-cloud-erase-data-danger-btn{color:var(--white-500);background-color:var(--button-danger-background)}.vc-text-selectable,.vc-text-selectable :where([class*="text" i],[class*="title" i]){user-select:text;cursor:initial}.vc-settings-theme-grid{display:grid;grid-gap:16px;grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}.vc-settings-theme-card{display:flex;flex-direction:column;background-color:var(--background-secondary-alt);color:var(--interactive-active);border-radius:8px;padding:1em;width:100%;transition:.1s ease-out;transition-property:box-shadow,transform,background,opacity}.vc-settings-theme-card-text{text-overflow:ellipsis;height:1.2em;margin-bottom:2px;white-space:nowrap;overflow:hidden}.vc-settings-theme-author:before{content:"by "}.vc-plugins-grid{margin-top:16px;display:grid;grid-gap:16px;grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}.vc-plugins-info-button{height:24px;width:24px;padding:0;background:transparent;margin-right:8px}.vc-plugins-settings-button:hover{color:var(--interactive-hover)}.vc-plugins-filter-controls{display:grid;height:40px;gap:10px;grid-template-columns:1fr 150px}.vc-plugins-badge{padding:0 6px;font-family:var(--font-display);font-weight:500;border-radius:8px;height:16px;font-size:12px;line-height:16px;color:var(--white-500);text-align:center}.vc-plugins-dep-name{margin:0 auto}.vc-plugins-info-card{padding:1em;height:8em;display:flex;flex-direction:column}.vc-plugins-info-card div{line-height:32px}.vc-plugins-restart-card{padding:1em;background:var(--info-warning-background);border:1px solid var(--info-warning-foreground);color:var(--info-warning-text)}.vc-plugins-restart-card button{margin-top:.5em}.vc-plugins-info-button svg:not(:hover,:focus){color:var(--text-muted)}.vc-open-external-icon{transform:rotate(45deg)}.vc-owner-crown-icon{color:var(--text-warning)}.vc-author-modal-root{padding:1em}.vc-author-modal-header{display:flex;align-items:center;margin-bottom:1em}.vc-author-modal-name{text-transform:none;flex-grow:0;background:var(--background-tertiary);border-radius:0 9999px 9999px 0;padding:6px .8em 6px .5em;font-size:20px;height:20px;position:relative;text-wrap:nowrap}.vc-author-modal-name:before{content:"";display:block;position:absolute;height:100%;width:16px;background:var(--background-tertiary);z-index:-1;left:-16px;top:0}.vc-author-modal-avatar{height:32px;width:32px;border-radius:50%}.vc-author-modal-links{margin-left:auto;display:flex;gap:.2em}.vc-author-modal-links img{height:32px;width:32px;border-radius:50%;border:4px solid var(--background-tertiary);box-sizing:border-box}.vc-author-modal-plugins{display:grid;gap:.5em}.vc-addon-card{background-color:var(--background-secondary-alt);color:var(--interactive-active);border-radius:8px;display:block;height:100%;padding:12px;width:100%;transition:.1s ease-out;transition-property:box-shadow,transform,background,opacity;box-sizing:border-box}.vc-addon-card-disabled{opacity:.6}.vc-addon-card:hover{background-color:var(--background-tertiary);transform:translateY(-1px);box-shadow:var(--elevation-high)}.vc-addon-header{margin-top:auto;display:flex;width:100%;justify-content:flex-end;align-items:center;gap:8px;margin-bottom:.5em}.vc-addon-note{height:36px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;box-orient:vertical}.vc-addon-name-author{width:100%}.vc-addon-name{display:flex;width:100%;align-items:center;flex-grow:1;gap:8px}.vc-addon-author{font-size:.8em}.vc-addon-author:before{content:"by "}.vc-switch-slider{transition:.1s transform ease-in-out}.vc-dearrow-toggle-off svg{filter:grayscale(1)}.vc-dearrow-toggle-on,.vc-dearrow-toggle-off{all:unset;display:inline;cursor:pointer;position:absolute;top:.75rem;right:.75rem}.messagelogger-deleted [class^=buttons]{display:none}.messagelogger-deleted :is(video,.emoji,[data-type="sticker"],iframe,.messagelogger-deleted-attachment,[class|="inlineMediaEmbed"]){filter:grayscale(1)!important;transition:.15s filter ease-in-out}.messagelogger-deleted :is(video,.emoji,[data-type="sticker"],iframe,.messagelogger-deleted-attachment,[class|="inlineMediaEmbed"]):hover,.messagelogger-deleted{filter:grayscale(0)!important}.theme-dark .messagelogger-edited{filter:brightness(80%)}.theme-light .messagelogger-edited{opacity:.5}.vc-permviewer-userperms-title-container{display:flex;justify-content:space-between;align-items:center;margin-top:10px;margin-bottom:6px}.vc-permviewer-userperms-btns-container{display:flex;align-items:center}.vc-permviewer-userperms-sortorder-btn{all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px}.vc-permviewer-userperms-permdetails-btn,.vc-permviewer-userperms-toggleperms-btn{all:unset;cursor:pointer;display:flex;align-items:center}.vc-permviewer-perms-title{flex-grow:1}.vc-permviewer-perms-no-perms{width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center}.vc-permviewer-perms-container{display:grid;grid-template-columns:1fr 2fr;grid-template-areas:"list permissions";padding:16px 0}.vc-permviewer-perms-list{grid-area:list;display:flex;flex-direction:column;gap:2px;border-right:2px solid var(--background-modifier-active)}.vc-permviewer-perms-list-item-btn{all:unset;cursor:pointer}.vc-permviewer-perms-list-item{display:flex;align-items:center;padding:8px 5px;cursor:pointer;width:230px;border-radius:5px}.vc-permviewer-perms-list-item:hover{background-color:var(--background-modifier-hover)}.vc-permviewer-perms-list-item-active{background-color:var(--background-modifier-selected)}.vc-permviewer-perms-list-item>div{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.vc-permviewer-perms-role-circle{border-radius:50%;width:12px;height:12px;margin-left:3px;margin-right:11px;flex-shrink:0}.vc-permviewer-perms-user-img{border-radius:50%;width:20px;height:20px;margin-right:6px}.vc-permviewer-perms-perms{grid-area:permissions;display:flex;flex-direction:column;margin-left:5px}.vc-permviewer-perms-perms-item{position:relative;display:flex;align-items:center;padding:10px;border-bottom:2px solid var(--background-modifier-active)}.vc-permviewer-perms-perms-item:last-child{border:0}.vc-permviewer-perms-perms-item-icon{border:1px solid var(--background-modifier-selected);width:24px;height:24px;margin-right:5px}.vc-permviewer-perms-perms-item .vc-info-icon{color:var(--interactive-muted);cursor:pointer;position:absolute;right:0;scale:.9;transition:color ease-in .1s}.vc-permviewer-perms-perms-item .vc-info-icon:hover{color:var(--interactive-active)}.vc-expandableheader-center-flex{display:flex;justify-items:center;align-items:center}.vc-expandableheader-btn{all:unset;cursor:pointer;width:24px;height:24px}.vc-pip-button{color:var(--interactive-normal)}.vc-pip-button:hover{background-color:var(--background-modifier-hover);color:var(--interactive-hover)}.vc-pronoundb-compact{display:none}[class*=compact] .vc-pronoundb-compact{display:inline-block;margin-left:-2px;margin-right:.25rem}.vc-st-modal-content input{background-color:var(--input-background);color:var(--text-normal);width:95%;padding:8px 8px 8px 12px;margin:1em 0;outline:none;border:1px solid var(--input-background);border-radius:4px;font-weight:500;font-style:inherit;font-size:100%}.vc-st-format-label,.vc-st-format-label span{background-color:transparent}.vc-st-modal-content [class|=select]{margin-bottom:1em}.vc-st-modal-content [class|=select] span{background-color:var(--input-background)}.vc-st-modal-header{justify-content:space-between;align-content:center}.vc-st-modal-header h1{margin:0}.vc-st-modal-header button{padding:0}.vc-st-preview-text{margin-bottom:1em}.vc-st-button{padding:0 6px}.vc-st-button svg{transform:scale(1.1) translateY(1px)}.vc-gp-root{height:100%;user-select:text}.vc-gp-banner{width:100%;cursor:pointer}.vc-gp-header{display:flex;flex-direction:row;align-items:center;gap:.5em;margin:.5em}.vc-gp-header img{width:48px;height:48px;cursor:pointer}.vc-gp-name-and-description{display:flex;flex-direction:column;gap:.2em}.vc-gp-name{margin:0}.vc-gp-tab-bar{border-bottom:2px solid var(--background-modifier-accent);margin:20px 12px 0;display:flex;gap:40px;align-items:stretch;flex-direction:row}.vc-gp-tab{border-bottom:2px solid transparent;color:var(--interactive-normal);cursor:pointer;height:39px;line-height:14px}.vc-gp-tab-content{margin:1em}.vc-gp-tab:where(.vc-gp-selected,:hover,:focus){border-bottom-color:var(--interactive-active)}.vc-gp-info{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1em}.vc-gp-server-info-pair{color:var(--text-normal)}.vc-gp-server-info-pair [class^=timestamp]{margin-left:0}.vc-gp-owner{display:flex;align-items:center;gap:.2em}.vc-gp-owner img{height:20px;border-radius:50%;cursor:pointer}.vc-gp-scroller{width:100%;max-height:500px}.vc-gp-scroller [class^=listRow]{margin:1px 0}.vc-gp-scroller [class^=listRow]:hover{background-color:var(--background-modifier-hover)}.shiki-container{border:4px;background-color:var(--background-secondary)}.shiki-root{border-radius:4px}.shiki-root code{display:block;overflow-x:auto;padding:.5em;position:relative;font-size:.875rem;line-height:1.125rem;text-indent:0;white-space:pre-wrap;background:transparent;border:none}.shiki-devicon{margin-right:8px;user-select:none}.shiki-plain code{padding-top:8px}.shiki-btns{font-size:1em;position:absolute;right:0;bottom:0;opacity:0}.shiki-root:hover .shiki-btns{opacity:1}.shiki-btn{border-radius:4px 4px 0 0;padding:4px 8px;user-select:none}.shiki-btn~.shiki-btn{margin-left:4px}.shiki-btn:last-child{border-radius:4px 0}.shiki-spinner-container{align-items:center;background-color:#0009;display:flex;position:absolute;justify-content:center;inset:0}.shiki-preview{margin-bottom:2em}.shiki-lang{padding:0 5px;margin-bottom:6px;font-weight:700;text-transform:capitalize;display:flex;align-items:center}.shiki-table{border-collapse:collapse;width:100%}.shiki-table tr{height:19px;width:100%}.shiki-root td:first-child{border-right:1px solid transparent;padding-left:5px;padding-right:8px;user-select:none}.shiki-root td:last-child{padding-left:8px;word-break:break-word;width:100%}.vc-user-connection{all:unset;display:inline-block;cursor:pointer}.vc-sc-tooltip{display:inline-flex;gap:.25em;align-items:center}.shc-lock-screen-outer-container{overflow:hidden scroll;flex:1 1 auto;height:100%;width:100%}.shc-lock-screen-container{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:100%}.shc-lock-screen-container>*{margin:5px}.shc-lock-screen-logo{width:180px;height:180px}.shc-lock-screen-heading-container{display:flex;flex-direction:row;align-items:center}.shc-lock-screen-heading-container>*{margin:inherit}.shc-lock-screen-heading-nsfw-icon{color:var(--text-normal)}.shc-lock-screen-topic-container{color:var(--text-normal);background:var(--bg-overlay-3, var(--background-secondary));border-radius:5px;padding:10px;max-width:70vw}.shc-lock-screen-tags-container{background:var(--bg-overlay-3, var(--background-secondary));border-radius:5px;padding:10px;max-width:70vw}.shc-lock-screen-tags-container>*{margin:inherit}.shc-lock-screen-tags{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px}.shc-evenodd-fill-current-color{fill-rule:evenodd;fill:currentcolor}.shc-hidden-channel-icon{margin-left:6px;z-index:0;cursor:not-allowed}.shc-lock-screen-default-emoji-container{display:flex;flex-direction:row;align-items:center}.shc-lock-screen-default-emoji-container>[class^=emojiContainer]{background:var(--bg-overlay-3, var(--background-secondary));border-radius:8px;padding:5px 6px;margin-left:5px}.shc-lock-screen-allowed-users-and-roles-container{display:flex;flex-direction:column;align-items:center;background:var(--bg-overlay-3, var(--background-secondary));border-radius:5px;padding:10px;max-width:70vw}.shc-lock-screen-allowed-users-and-roles-container-title{display:flex;flex-direction:row;align-items:center}.shc-lock-screen-allowed-users-and-roles-container-toggle-btn{all:unset;margin-left:5px;cursor:pointer;display:flex;align-items:center}.shc-lock-screen-allowed-users-and-roles-container-toggle-btn>svg{color:var(--text-normal)}.shc-lock-screen-allowed-users-and-roles-container-permdetails-btn{all:unset;margin-right:5px;cursor:pointer;display:flex;align-items:center}.shc-lock-screen-allowed-users-and-roles-container-permdetails-btn>svg{color:var(--text-normal)}.shc-lock-screen-allowed-users-and-roles-container>[class^=members]{margin-left:10px;flex-wrap:wrap;justify-content:center}.vc-smyn-suffix{color:var(--text-muted)}.vc-smyn-suffix:before{content:"("}.vc-smyn-suffix:after{content:")"}#vc-spotify-player{padding:.375rem .5rem;border-bottom:1px solid var(--background-modifier-accent);--vc-spotify-green: #1db954}.theme-light #vc-spotify-player{background:var(--bg-overlay-3, var(--background-secondary-alt))}.theme-dark #vc-spotify-player{background:var(--bg-overlay-1, var(--background-secondary-alt))}.vc-spotify-button{background:none;color:var(--interactive-normal);padding:0;width:32px;height:32px;border-radius:100%;display:flex;justify-content:center;align-items:center}.vc-spotify-button:hover{color:var(--interactive-hover);background-color:var(--background-modifier-selected)}.vc-spotify-button svg{height:24px;width:24px}[class*=vc-spotify-shuffle]>svg,[class*=vc-spotify-repeat]>svg{width:22px;height:22px}.vc-spotify-button svg path{width:100%;height:100%}.vc-spotify-shuffle-on,.vc-spotify-repeat-context,.vc-spotify-repeat-track,.vc-spotify-shuffle-on:hover,.vc-spotify-repeat-context:hover,.vc-spotify-repeat-track:hover{color:var(--vc-spotify-green)}.vc-spotify-tooltip-text{overflow:hidden;white-space:nowrap;padding-right:.2em;max-width:100%;margin:unset}.vc-spotify-repeat-1{font-size:70%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.vc-spotify-button-row{justify-content:center}#vc-spotify-info-wrapper{display:flex;flex-direction:row;align-items:center;height:3em;gap:.5em}#vc-spotify-info-wrapper img{height:90%;object-fit:contain}#vc-spotify-album-expanded-wrapper img{width:100%;object-fit:contain}#vc-spotify-titles{display:flex;flex-direction:column;padding:.2rem;justify-content:center;align-items:flex-start;align-content:flex-start;overflow:hidden}#vc-spotify-song-title{color:var(--header-primary);font-size:14px;font-weight:600}.vc-spotify-ellipoverflow{white-space:nowrap;overflow:hidden;width:100%;text-overflow:ellipsis}.vc-spotify-artist,.vc-spotify-album{font-size:12px;text-decoration:none;color:var(--header-secondary)}.vc-spotify-comma{color:var(--header-secondary)}.vc-spotify-artist[role=link]:hover,#vc-spotify-album-title[role=link]:hover,#vc-spotify-song-title[role=link]:hover{text-decoration:underline;cursor:pointer}#vc-spotify-album-image{border-radius:3px;transition:filter .2s}#vc-spotify-album-image:hover{filter:brightness(1.2);cursor:pointer}#vc-spotify-progress-bar{position:relative;color:var(--text-normal);width:100%;margin:.5em 0 5px}#vc-spotify-progress-bar>[class^=slider]{flex-grow:1;width:100%;padding:0!important}#vc-spotify-progress-bar>[class^=slider] [class^=bar-]{height:4px!important}#vc-spotify-progress-bar>[class^=slider] [class^=grabber]{height:10px!important;width:10px!important;background-color:var(--interactive-normal);border-color:var(--interactive-normal);color:var(--interactive-normal)}#vc-spotify-progress-text{margin:0}.vc-spotify-progress-time{font-size:12px;top:10px;position:absolute}.vc-spotify-time-left{left:0}.vc-spotify-time-right{right:0}.vc-spotify-fallback{padding:.5em;color:var(--text-normal)}.vc-trans-modal-content{padding:1em}.vc-trans-modal-header{justify-content:space-between;align-content:center}.vc-trans-modal-header h1{margin:0}.vc-trans-accessory{color:var(--text-muted);margin-top:.5em;font-style:italic;font-weight:400}.vc-trans-accessory svg{margin-right:.25em}.vc-trans-dismiss{all:unset;cursor:pointer;color:var(--text-link)}.vc-trans-dismiss:is(:hover,:focus){text-decoration:underline}.vc-trans-auto-translate{color:var(--green-360)}.vc-uvs-button>div{white-space:normal!important}.vc-uvs-button{width:100%;margin:auto;height:unset}.vc-uvs-header{color:var(--header-primary);margin-bottom:6px}.vc-uvs-modal-margin{margin:0 12px}.vc-uvs-modal-margin div{margin-bottom:0!important}.vc-uvs-popout-margin-self>[class^=section]{padding-top:0;padding-bottom:12px}.vc-toolbox-btn,.vc-toolbox-btn>svg{-webkit-app-region:no-drag}.vc-toolbox-btn>svg{color:var(--interactive-normal)}.vc-toolbox-btn[class*=selected]>svg{color:var(--interactive-active)}.vc-toolbox-btn:hover>svg{color:var(--interactive-hover)}.vc-vmsg-modal{padding:1em}.vc-vmsg-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5em;margin-bottom:1em}.vc-vmsg-modal audio{width:100%}.vc-vmsg-preview{color:var(--text-normal);border-radius:24px;background-color:var(--background-secondary);position:relative;display:flex;align-items:center;padding:0 16px;height:48px}.vc-vmsg-preview-indicator{background:var(--button-secondary-background);width:16px;height:16px;border-radius:50%;transition:background .2s ease-in-out}.vc-vmsg-preview-recording .vc-vmsg-preview-indicator{background:var(--status-danger)}.vc-vmsg-preview-time{opacity:.8;margin:0 .5em;font-size:80%;font-family:var(--font-code)}.vc-vmsg-preview-label{opacity:.5;letter-spacing:.125em;font-weight:600;flex:1;text-align:center} diff --git a/VencordDesktop/vencordDist/vencordDesktopRenderer.css.map b/VencordDesktop/vencordDist/vencordDesktopRenderer.css.map index a918db5..c3c47df 100644 --- a/VencordDesktop/vencordDist/vencordDesktopRenderer.css.map +++ b/VencordDesktop/vencordDist/vencordDesktopRenderer.css.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../src/components/ErrorCard.css", "../src/api/Notifications/styles.css", "../src/components/VencordSettings/settingsStyles.css", "../src/components/VencordSettings/themesStyles.css", "../src/components/PluginSettings/styles.css", "../src/components/iconStyles.css", "../src/components/PluginSettings/contributorModal.css", "../src/components/VencordSettings/addonCard.css", "../src/components/Switch.css", "../src/plugins/clientTheme/clientTheme.css", "../src/plugins/dearrow/styles.css", "../src/plugins/messageLogger/messageLogger.css", "../src/plugins/permissionsViewer/styles.css", "../src/components/ExpandableHeader.css", "../src/plugins/pictureInPicture/styles.css", "../src/plugins/pronoundb/styles.css", "../src/plugins/sendTimestamps/styles.css", "../src/plugins/serverProfile/styles.css", "../src/plugins/shikiCodeblocks.desktop/shiki.css", "../src/plugins/showConnections/styles.css", "../src/plugins/showHiddenChannels/style.css", "../src/plugins/showMeYourName/styles.css", "../src/plugins/spotifyControls/spotifyStyles.css", "../src/plugins/translate/styles.css", "../src/plugins/userVoiceShow/components/VoiceChannelSection.css", "../src/plugins/vencordToolbox/index.css", "../src/plugins/voiceMessages/styles.css"], - "sourcesContent": [".vc-error-card {\n padding: 2em;\n background-color: #e7828430;\n border: 1px solid #e78284;\n border-radius: 5px;\n color: var(--text-normal, white);\n}\n", ".vc-notification-root {\n /* clear default button styles */\n all: unset;\n display: flex;\n flex-direction: column;\n color: var(--text-normal);\n background-color: var(--background-secondary-alt);\n border-radius: 6px;\n overflow: hidden;\n cursor: pointer;\n width: 100%;\n}\n\n.vc-notification-root:not(.vc-notification-log-wrapper > .vc-notification-root) {\n position: absolute;\n z-index: 2147483647;\n right: 1rem;\n width: 25vw;\n min-height: 10vh;\n}\n\n.vc-notification {\n display: flex;\n flex-direction: row;\n padding: 1.25rem;\n gap: 1.25rem;\n}\n\n.vc-notification-content {\n width: 100%;\n}\n\n.vc-notification-header {\n display: flex;\n justify-content: space-between;\n}\n\n.vc-notification-title {\n color: var(--header-primary);\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.25rem;\n text-transform: uppercase;\n}\n\n.vc-notification-close-btn {\n all: unset;\n cursor: pointer;\n color: var(--interactive-normal);\n opacity: 0.5;\n transition: opacity 0.2s ease-in-out, color 0.2s ease-in-out;\n}\n\n.vc-notification-close-btn:hover {\n color: var(--interactive-hover);\n opacity: 1;\n}\n\n.vc-notification-icon {\n height: 4rem;\n width: 4rem;\n border-radius: 6px;\n}\n\n.vc-notification-progressbar {\n height: 0.25rem;\n border-radius: 5px;\n margin-top: auto;\n}\n\n.vc-notification-p {\n margin: 0.5rem 0 0;\n line-height: 140%;\n}\n\n.vc-notification-img {\n width: 100%;\n}\n\n.vc-notification-log-empty {\n height: 218px;\n background: url(\"/assets/b36de980b174d7b798c89f35c116e5c6.svg\") center no-repeat;\n margin-bottom: 40px;\n}\n\n.vc-notification-log-container {\n display: flex;\n flex-direction: column;\n padding: 1em;\n overflow: hidden;\n}\n\n.vc-notification-log-wrapper {\n transition: 200ms ease;\n transition-property: height, opacity;\n}\n\n.vc-notification-log-wrapper:not(:last-child) {\n margin-bottom: 1em;\n}\n\n.vc-notification-log-removing {\n height: 0 !important;\n opacity: 0;\n margin-bottom: 1em;\n}\n\n.vc-notification-log-body {\n display: flex;\n flex-direction: column;\n}\n\n.vc-notification-log-timestamp {\n margin-left: auto;\n font-size: 0.8em;\n font-weight: lighter;\n}\n\n.vc-notification-log-danger-btn {\n color: var(--white-500);\n background-color: var(--button-danger-background);\n}\n", ".vc-settings-tab-bar {\n margin-top: 20px;\n margin-bottom: 10px;\n border-bottom: 2px solid var(--background-modifier-accent);\n}\n\n.vc-settings-tab-bar-item {\n margin-right: 32px;\n padding-bottom: 16px;\n margin-bottom: -2px;\n}\n\n.vc-settings-quick-actions-card {\n padding: 1em;\n display: flex;\n gap: 1em;\n align-items: center;\n justify-content: space-evenly;\n flex-grow: 1;\n flex-flow: row wrap;\n margin-bottom: 1em;\n}\n\n.vc-settings-donate {\n display: flex;\n flex-direction: row;\n}\n\n.vc-settings-card {\n padding: 1em;\n margin-bottom: 1em;\n}\n\n.vc-backup-restore-card {\n background-color: var(--info-warning-background);\n border-color: var(--info-warning-foreground);\n color: var(--info-warning-text);\n}\n\n.vc-settings-theme-links {\n /* Needed to fix bad themes that hide certain textarea elements for whatever eldritch reason */\n display: inline-block !important;\n color: var(--text-normal) !important;\n padding: 0.5em;\n border: 1px solid var(--background-modifier-accent);\n max-height: unset;\n}\n\n.vc-cloud-settings-sync-grid {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-gap: 1em;\n}\n\n.vc-cloud-erase-data-danger-btn {\n color: var(--white-500);\n background-color: var(--button-danger-background);\n}\n\n.vc-text-selectable,\n.vc-text-selectable :where([class*=\"text\" i], [class*=\"title\" i]) {\n /* make text selectable, silly discord makes the entirety of settings not selectable */\n user-select: text;\n\n /* discord also sets cursor: default which prevents the cursor from showing as text */\n cursor: initial;\n}\n", ".vc-settings-theme-grid {\n display: grid;\n grid-gap: 16px;\n grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));\n}\n\n.vc-settings-theme-card {\n display: flex;\n flex-direction: column;\n background-color: var(--background-secondary-alt);\n color: var(--interactive-active);\n border-radius: 8px;\n padding: 1em;\n width: 100%;\n transition: 0.1s ease-out;\n transition-property: box-shadow, transform, background, opacity;\n}\n\n.vc-settings-theme-card-text {\n text-overflow: ellipsis;\n height: 1.2em;\n margin-bottom: 2px;\n white-space: nowrap;\n overflow: hidden;\n}\n\n.vc-settings-theme-author::before {\n content: \"by \";\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n.vc-plugins-grid {\n margin-top: 16px;\n display: grid;\n grid-gap: 16px;\n grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));\n}\n\n.vc-plugins-info-button {\n height: 24px;\n width: 24px;\n padding: 0;\n background: transparent;\n margin-right: 8px;\n}\n\n.vc-plugins-settings-button:hover {\n color: var(--interactive-hover);\n}\n\n.vc-plugins-filter-controls {\n display: grid;\n height: 40px;\n gap: 10px;\n grid-template-columns: 1fr 150px;\n}\n\n.vc-plugins-badge {\n padding: 0 6px;\n font-family: var(--font-display);\n font-weight: 500;\n border-radius: 8px;\n height: 16px;\n font-size: 12px;\n line-height: 16px;\n color: var(--white-500);\n text-align: center;\n}\n\n.vc-plugins-dep-name {\n margin: 0 auto;\n}\n\n.vc-plugins-info-card {\n padding: 1em;\n height: 8em;\n display: flex;\n flex-direction: column;\n}\n\n.vc-plugins-info-card div {\n line-height: 32px;\n}\n\n.vc-plugins-restart-card {\n padding: 1em;\n background: var(--info-warning-background);\n border: 1px solid var(--info-warning-foreground);\n color: var(--info-warning-text);\n}\n\n.vc-plugins-restart-card button {\n margin-top: 0.5em;\n}\n\n.vc-plugins-info-button svg:not(:hover, :focus) {\n color: var(--text-muted);\n}\n", ".vc-open-external-icon {\n transform: rotate(45deg);\n}\n\n.vc-owner-crown-icon {\n color: var(--text-warning);\n}\n", ".vc-author-modal-root {\n padding: 1em;\n}\n\n.vc-author-modal-header {\n display: flex;\n align-items: center;\n margin-bottom: 1em;\n}\n\n.vc-author-modal-name {\n text-transform: none;\n flex-grow: 0;\n background: var(--background-tertiary);\n border-radius: 0 9999px 9999px 0;\n padding: 6px 0.8em 6px 0.5em;\n font-size: 20px;\n height: 20px;\n position: relative;\n text-wrap: nowrap;\n}\n\n.vc-author-modal-name::before {\n content: \"\";\n display: block;\n position: absolute;\n height: 100%;\n width: 16px;\n background: var(--background-tertiary);\n z-index: -1;\n left: -16px;\n top: 0;\n}\n\n.vc-author-modal-avatar {\n height: 32px;\n width: 32px;\n border-radius: 50%;\n}\n\n.vc-author-modal-links {\n margin-left: auto;\n display: flex;\n gap: 0.2em;\n}\n\n.vc-author-modal-links img {\n height: 32px;\n width: 32px;\n border-radius: 50%;\n border: 4px solid var(--background-tertiary);\n box-sizing: border-box\n}\n\n.vc-author-modal-plugins {\n display: grid;\n gap: 0.5em;\n}\n", ".vc-addon-card {\n background-color: var(--background-secondary-alt);\n color: var(--interactive-active);\n border-radius: 8px;\n display: block;\n height: 100%;\n padding: 12px;\n width: 100%;\n transition: 0.1s ease-out;\n transition-property: box-shadow, transform, background, opacity;\n box-sizing: border-box;\n}\n\n.vc-addon-card-disabled {\n opacity: 0.6;\n}\n\n.vc-addon-card:hover {\n background-color: var(--background-tertiary);\n transform: translateY(-1px);\n box-shadow: var(--elevation-high);\n}\n\n.vc-addon-header {\n margin-top: auto;\n display: flex;\n width: 100%;\n justify-content: flex-end;\n align-items: center;\n gap: 8px;\n margin-bottom: 0.5em;\n}\n\n.vc-addon-note {\n height: 36px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n -webkit-box-orient: vertical;\n /* stylelint-disable-next-line property-no-unknown */\n box-orient: vertical;\n}\n\n.vc-addon-name-author {\n width: 100%;\n}\n\n.vc-addon-name {\n display: flex;\n width: 100%;\n align-items: center;\n flex-grow: 1;\n gap: 8px;\n}\n\n.vc-addon-author {\n font-size: 0.8em;\n}\n\n.vc-addon-author::before {\n content: \"by \";\n}\n", ".vc-switch-slider {\n transition: 100ms transform ease-in-out;\n}\n", ".client-theme-settings {\n display: flex;\n flex-direction: column;\n}\n\n.client-theme-container {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n}\n\n.client-theme-settings-labels {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n}\n\n.client-theme-container > [class^=\"colorSwatch\"] > [class^=\"swatch\"] {\n border: thin solid var(--background-modifier-accent) !important;\n}\n\n.client-theme-warning {\n color: var(--text-danger);\n}\n", ".vc-dearrow-toggle-off svg {\n filter: grayscale(1);\n}\n\n.vc-dearrow-toggle-on, .vc-dearrow-toggle-off {\n all: unset;\n display: inline;\n cursor: pointer;\n position: absolute;\n top: 0.75rem;\n right: 0.75rem;\n}\n", ".messagelogger-deleted [class^=\"buttons\"] {\n display: none;\n}\n\n.messagelogger-deleted\n:is(\n video,\n .emoji,\n [data-type=\"sticker\"],\n iframe,\n .messagelogger-deleted-attachment,\n [class|=\"inlineMediaEmbed\"]\n) {\n filter: grayscale(1) !important;\n transition: 150ms filter ease-in-out;\n}\n\n.messagelogger-deleted\n:is(\n video,\n .emoji,\n [data-type=\"sticker\"],\n iframe,\n .messagelogger-deleted-attachment,\n [class|=\"inlineMediaEmbed\"]\n):hover,\n.messagelogger-deleted {\n filter: grayscale(0) !important;\n}\n\n.theme-dark .messagelogger-edited {\n filter: brightness(80%);\n}\n\n.theme-light .messagelogger-edited {\n opacity: 0.5;\n}\n", "/* User Permissions Component */\n\n.vc-permviewer-userperms-title-container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-top: 10px;\n margin-bottom: 6px;\n}\n\n.vc-permviewer-userperms-btns-container {\n display: flex;\n align-items: center;\n}\n\n.vc-permviewer-userperms-sortorder-btn {\n all: unset;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n}\n\n.vc-permviewer-userperms-permdetails-btn {\n all: unset;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n\n.vc-permviewer-userperms-toggleperms-btn {\n all: unset;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n\n/* RolesAndUsersPermissions Component */\n\n.vc-permviewer-perms-title {\n flex-grow: 1;\n}\n\n.vc-permviewer-perms-no-perms {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n}\n\n.vc-permviewer-perms-container {\n display: grid;\n grid-template-columns: 1fr 2fr;\n grid-template-areas: \"list permissions\";\n padding: 16px 0;\n}\n\n.vc-permviewer-perms-list {\n grid-area: list;\n display: flex;\n flex-direction: column;\n gap: 2px;\n border-right: 2px solid var(--background-modifier-active);\n}\n\n.vc-permviewer-perms-list-item-btn {\n all: unset;\n cursor: pointer;\n}\n\n.vc-permviewer-perms-list-item {\n display: flex;\n align-items: center;\n padding: 8px 5px;\n cursor: pointer;\n width: 230px;\n border-radius: 5px;\n}\n\n.vc-permviewer-perms-list-item:hover {\n background-color: var(--background-modifier-hover);\n}\n\n.vc-permviewer-perms-list-item-active {\n background-color: var(--background-modifier-selected);\n}\n\n.vc-permviewer-perms-list-item > div {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n\n.vc-permviewer-perms-role-circle {\n border-radius: 50%;\n width: 12px;\n height: 12px;\n margin-left: 3px;\n margin-right: 11px;\n flex-shrink: 0;\n}\n\n.vc-permviewer-perms-user-img {\n border-radius: 50%;\n width: 20px;\n height: 20px;\n margin-right: 6px;\n}\n\n.vc-permviewer-perms-perms {\n grid-area: permissions;\n display: flex;\n flex-direction: column;\n margin-left: 5px;\n}\n\n.vc-permviewer-perms-perms-item {\n position: relative;\n display: flex;\n align-items: center;\n padding: 10px;\n border-bottom: 2px solid var(--background-modifier-active);\n}\n\n.vc-permviewer-perms-perms-item:last-child {\n border: 0;\n}\n\n.vc-permviewer-perms-perms-item-icon {\n border: 1px solid var(--background-modifier-selected);\n width: 24px;\n height: 24px;\n margin-right: 5px;\n}\n\n.vc-permviewer-perms-perms-item .vc-info-icon {\n color: var(--interactive-muted);\n cursor: pointer;\n position: absolute;\n right: 0;\n scale: 0.9;\n transition: color ease-in 0.1s;\n}\n\n.vc-permviewer-perms-perms-item .vc-info-icon:hover {\n color: var(--interactive-active);\n}\n", ".vc-expandableheader-center-flex {\n display: flex;\n justify-items: center;\n align-items: center;\n}\n\n.vc-expandableheader-btn {\n all: unset;\n cursor: pointer;\n width: 24px;\n height: 24px;\n}\n", ".vc-pip-button {\n color: var(--interactive-normal);\n}\n\n.vc-pip-button:hover {\n background-color: var(--background-modifier-hover);\n color: var(--interactive-hover);\n}\n", ".vc-pronoundb-compact {\n display: none;\n}\n\n[class*=\"compact\"] .vc-pronoundb-compact {\n display: inline-block;\n margin-left: -2px;\n margin-right: 0.25rem;\n}\n", ".vc-st-modal-content input {\n background-color: var(--input-background);\n color: var(--text-normal);\n width: 95%;\n padding: 8px 8px 8px 12px;\n margin: 1em 0;\n outline: none;\n border: 1px solid var(--input-background);\n border-radius: 4px;\n font-weight: 500;\n font-style: inherit;\n font-size: 100%;\n}\n\n.vc-st-format-label,\n.vc-st-format-label span {\n background-color: transparent;\n}\n\n.vc-st-modal-content [class|=\"select\"] {\n margin-bottom: 1em;\n}\n\n.vc-st-modal-content [class|=\"select\"] span {\n background-color: var(--input-background);\n}\n\n.vc-st-modal-header {\n justify-content: space-between;\n align-content: center;\n}\n\n.vc-st-modal-header h1 {\n margin: 0;\n}\n\n.vc-st-modal-header button {\n padding: 0;\n}\n\n.vc-st-preview-text {\n margin-bottom: 1em;\n}\n\n.vc-st-button {\n padding: 0 6px;\n}\n\n.vc-st-button svg {\n transform: scale(1.1) translateY(1px);\n}\n", ".vc-gp-root {\n height: 100%;\n user-select: text;\n}\n\n.vc-gp-banner {\n width: 100%;\n cursor: pointer;\n}\n\n.vc-gp-header {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 0.5em;\n margin: 0.5em;\n}\n\n.vc-gp-header img {\n width: 48px;\n height: 48px;\n cursor: pointer;\n}\n\n.vc-gp-name-and-description {\n display: flex;\n flex-direction: column;\n gap: 0.2em;\n}\n\n.vc-gp-name {\n margin: 0;\n}\n\n.vc-gp-tab-bar {\n border-bottom: 2px solid var(--background-modifier-accent);\n margin: 20px 12px 0;\n display: flex;\n gap: 40px;\n align-items: stretch;\n flex-direction: row;\n}\n\n.vc-gp-tab {\n border-bottom: 2px solid transparent;\n color: var(--interactive-normal);\n cursor: pointer;\n height: 39px;\n line-height: 14px;\n}\n\n.vc-gp-tab-content {\n margin: 1em;\n}\n\n.vc-gp-tab:where(.vc-gp-selected, :hover, :focus) {\n border-bottom-color: var(--interactive-active);\n}\n\n.vc-gp-info {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 1em;\n}\n\n.vc-gp-server-info-pair {\n color: var(--text-normal);\n}\n\n.vc-gp-server-info-pair [class^=\"timestamp\"] {\n margin-left: 0;\n}\n\n.vc-gp-owner {\n display: flex;\n align-items: center;\n gap: 0.2em;\n}\n\n.vc-gp-owner img {\n height: 20px;\n border-radius: 50%;\n cursor: pointer;\n}\n\n.vc-gp-scroller {\n width: 100%;\n max-height: 500px;\n}\n\n.vc-gp-scroller [class^=\"listRow\"] {\n margin: 1px 0;\n}\n\n.vc-gp-scroller [class^=\"listRow\"]:hover {\n background-color: var(--background-modifier-hover);\n}\n", ".shiki-container {\n border: 4px;\n background-color: var(--background-secondary);\n}\n\n.shiki-root {\n border-radius: 4px;\n}\n\n.shiki-root code {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n position: relative;\n font-size: 0.875rem;\n line-height: 1.125rem;\n text-indent: 0;\n white-space: pre-wrap;\n background: transparent;\n border: none;\n}\n\n.shiki-devicon {\n margin-right: 8px;\n user-select: none;\n}\n\n.shiki-plain code {\n padding-top: 8px;\n}\n\n.shiki-btns {\n font-size: 1em;\n position: absolute;\n right: 0;\n bottom: 0;\n opacity: 0;\n}\n\n.shiki-root:hover .shiki-btns {\n opacity: 1;\n}\n\n.shiki-btn {\n border-radius: 4px 4px 0 0;\n padding: 4px 8px;\n user-select: none;\n}\n\n.shiki-btn ~ .shiki-btn {\n margin-left: 4px;\n}\n\n.shiki-btn:last-child {\n border-radius: 4px 0;\n}\n\n.shiki-spinner-container {\n align-items: center;\n background-color: rgb(0 0 0 / 60%);\n display: flex;\n position: absolute;\n justify-content: center;\n inset: 0;\n}\n\n.shiki-preview {\n margin-bottom: 2em;\n}\n\n.shiki-lang {\n padding: 0 5px;\n margin-bottom: 6px;\n font-weight: bold;\n text-transform: capitalize;\n display: flex;\n align-items: center;\n}\n\n.shiki-table {\n border-collapse: collapse;\n width: 100%;\n}\n\n.shiki-table tr {\n height: 19px;\n width: 100%;\n}\n\n.shiki-root td:first-child {\n border-right: 1px solid transparent;\n padding-left: 5px;\n padding-right: 8px;\n user-select: none;\n}\n\n.shiki-root td:last-child {\n padding-left: 8px;\n word-break: break-word;\n width: 100%;\n}\n", ".vc-user-connection {\n all: unset;\n display: inline-block;\n cursor: pointer;\n}\n\n.vc-sc-tooltip {\n display: inline-flex;\n gap: 0.25em;\n align-items: center;\n}\n", ".shc-lock-screen-outer-container {\n overflow: hidden scroll;\n flex: 1 1 auto;\n height: 100%;\n width: 100%;\n}\n\n.shc-lock-screen-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n min-height: 100%;\n}\n\n.shc-lock-screen-container > * {\n margin: 5px;\n}\n\n.shc-lock-screen-logo {\n width: 180px;\n height: 180px;\n}\n\n.shc-lock-screen-heading-container {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.shc-lock-screen-heading-container > * {\n margin: inherit;\n}\n\n.shc-lock-screen-heading-nsfw-icon {\n color: var(--text-normal);\n}\n\n.shc-lock-screen-topic-container {\n color: var(--text-normal);\n background: var(--bg-overlay-3, var(--background-secondary));\n border-radius: 5px;\n padding: 10px;\n max-width: 70vw;\n}\n\n.shc-lock-screen-tags-container {\n background: var(--bg-overlay-3, var(--background-secondary));\n border-radius: 5px;\n padding: 10px;\n max-width: 70vw;\n}\n\n.shc-lock-screen-tags-container > * {\n margin: inherit;\n}\n\n.shc-lock-screen-tags {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n gap: 8px;\n}\n\n.shc-evenodd-fill-current-color {\n fill-rule: evenodd;\n fill: currentcolor;\n}\n\n.shc-hidden-channel-icon {\n margin-left: 6px;\n z-index: 0;\n cursor: not-allowed;\n}\n\n.shc-lock-screen-default-emoji-container {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.shc-lock-screen-default-emoji-container > [class^=\"emojiContainer\"] {\n background: var(--bg-overlay-3, var(--background-secondary));\n border-radius: 8px;\n padding: 5px 6px;\n margin-left: 5px;\n}\n\n.shc-lock-screen-allowed-users-and-roles-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n background: var(--bg-overlay-3, var(--background-secondary));\n border-radius: 5px;\n padding: 10px;\n max-width: 70vw;\n}\n\n.shc-lock-screen-allowed-users-and-roles-container-title {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.shc-lock-screen-allowed-users-and-roles-container-toggle-btn {\n all: unset;\n margin-left: 5px;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n\n.shc-lock-screen-allowed-users-and-roles-container-toggle-btn > svg {\n color: var(--text-normal);\n}\n\n.shc-lock-screen-allowed-users-and-roles-container-permdetails-btn {\n all: unset;\n margin-right: 5px;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n\n.shc-lock-screen-allowed-users-and-roles-container-permdetails-btn > svg {\n color: var(--text-normal);\n}\n\n.shc-lock-screen-allowed-users-and-roles-container > [class^=\"members\"] {\n margin-left: 10px;\n flex-wrap: wrap;\n justify-content: center;\n}\n", ".vc-smyn-suffix {\n color: var(--text-muted);\n}\n\n.vc-smyn-suffix::before {\n content: \"(\";\n}\n\n.vc-smyn-suffix::after {\n content: \")\";\n}\n", "#vc-spotify-player {\n padding: 0.375rem 0.5rem;\n border-bottom: 1px solid var(--background-modifier-accent);\n\n --vc-spotify-green: #1db954; /* so custom themes can easily change it */\n}\n\n.theme-light #vc-spotify-player {\n background: var(--bg-overlay-3, var(--background-secondary-alt));\n}\n\n.theme-dark #vc-spotify-player {\n background: var(--bg-overlay-1, var(--background-secondary-alt));\n}\n\n.vc-spotify-button {\n background: none;\n color: var(--interactive-normal);\n padding: 0;\n width: 32px;\n height: 32px;\n border-radius: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.vc-spotify-button:hover {\n color: var(--interactive-hover);\n background-color: var(--background-modifier-selected);\n}\n\n.vc-spotify-button svg {\n height: 24px;\n width: 24px;\n}\n\n[class*=\"vc-spotify-shuffle\"] > svg,\n[class*=\"vc-spotify-repeat\"] > svg {\n width: 22px;\n height: 22px;\n}\n\n.vc-spotify-button svg path {\n width: 100%;\n height: 100%;\n}\n\n/* .vc-spotify-button:hover {\n filter: brightness(1.3);\n} */\n\n.vc-spotify-shuffle-on,\n.vc-spotify-repeat-context,\n.vc-spotify-repeat-track,\n.vc-spotify-shuffle-on:hover,\n.vc-spotify-repeat-context:hover,\n.vc-spotify-repeat-track:hover {\n color: var(--vc-spotify-green);\n}\n\n.vc-spotify-tooltip-text {\n overflow: hidden;\n white-space: nowrap;\n padding-right: 0.2em;\n max-width: 100%;\n margin: unset;\n}\n\n.vc-spotify-repeat-1 {\n font-size: 70%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n\n.vc-spotify-button-row {\n justify-content: center;\n}\n\n#vc-spotify-info-wrapper {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 3em;\n gap: 0.5em;\n}\n\n#vc-spotify-info-wrapper img {\n height: 90%;\n object-fit: contain;\n}\n\n#vc-spotify-album-expanded-wrapper img {\n width: 100%;\n object-fit: contain;\n}\n\n#vc-spotify-titles {\n display: flex;\n flex-direction: column;\n padding: 0.2rem;\n justify-content: center;\n align-items: flex-start;\n align-content: flex-start;\n overflow: hidden;\n}\n\n#vc-spotify-song-title {\n color: var(--header-primary);\n font-size: 14px;\n font-weight: 600;\n}\n\n.vc-spotify-ellipoverflow {\n white-space: nowrap;\n overflow: hidden;\n width: 100%;\n text-overflow: ellipsis;\n}\n\n.vc-spotify-artist,\n.vc-spotify-album {\n font-size: 12px;\n text-decoration: none;\n color: var(--header-secondary);\n}\n\n.vc-spotify-comma {\n color: var(--header-secondary);\n}\n\n.vc-spotify-artist[role=\"link\"]:hover,\n#vc-spotify-album-title[role=\"link\"]:hover,\n#vc-spotify-song-title[role=\"link\"]:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\n#vc-spotify-album-image {\n border-radius: 3px;\n transition: filter 0.2s;\n}\n\n#vc-spotify-album-image:hover {\n filter: brightness(1.2);\n cursor: pointer;\n}\n\n#vc-spotify-progress-bar {\n position: relative;\n color: var(--text-normal);\n width: 100%;\n margin: 0.5em 0;\n margin-bottom: 5px;\n}\n\n#vc-spotify-progress-bar > [class^=\"slider\"] {\n flex-grow: 1;\n width: 100%;\n padding: 0 !important;\n}\n\n#vc-spotify-progress-bar > [class^=\"slider\"] [class^=\"bar-\"] {\n height: 4px !important;\n}\n\n#vc-spotify-progress-bar > [class^=\"slider\"] [class^=\"grabber\"] {\n /* these importants are necessary, it applies a width and height through inline styles */\n height: 10px !important;\n width: 10px !important;\n background-color: var(--interactive-normal);\n border-color: var(--interactive-normal);\n color: var(--interactive-normal);\n}\n\n#vc-spotify-progress-text {\n margin: 0;\n}\n\n.vc-spotify-progress-time {\n font-size: 12px;\n top: 10px;\n position: absolute;\n}\n\n.vc-spotify-time-left {\n left: 0;\n}\n\n.vc-spotify-time-right {\n right: 0;\n}\n\n.vc-spotify-fallback {\n padding: 0.5em;\n color: var(--text-normal);\n}\n", ".vc-trans-modal-content {\n padding: 1em;\n}\n\n.vc-trans-modal-header {\n justify-content: space-between;\n align-content: center;\n}\n\n.vc-trans-modal-header h1 {\n margin: 0;\n}\n\n.vc-trans-accessory {\n color: var(--text-muted);\n margin-top: 0.5em;\n font-style: italic;\n font-weight: 400;\n}\n\n.vc-trans-accessory svg {\n margin-right: 0.25em;\n}\n\n.vc-trans-dismiss {\n all: unset;\n cursor: pointer;\n color: var(--text-link);\n}\n\n.vc-trans-dismiss:is(:hover, :focus) {\n text-decoration: underline;\n}\n\n.vc-trans-auto-translate {\n color: var(--green-360);\n}\n", ".vc-uvs-button>div {\n white-space: normal !important;\n}\n\n.vc-uvs-button {\n width: 100%;\n margin: auto;\n height: unset;\n}\n\n.vc-uvs-header {\n color: var(--header-primary);\n margin-bottom: 6px;\n}\n\n.vc-uvs-modal-margin {\n margin: 0 12px;\n}\n\n.vc-uvs-modal-margin div {\n margin-bottom: 0 !important;\n}\n\n.vc-uvs-popout-margin-self>[class^=\"section\"] {\n padding-top: 0;\n padding-bottom: 12px;\n}\n", ".vc-toolbox-btn,\n.vc-toolbox-btn>svg {\n -webkit-app-region: no-drag;\n}\n\n.vc-toolbox-btn>svg {\n color: var(--interactive-normal);\n}\n\n.vc-toolbox-btn[class*=\"selected\"]>svg {\n color: var(--interactive-active);\n}\n\n.vc-toolbox-btn:hover>svg {\n color: var(--interactive-hover);\n}\n", ".vc-vmsg-modal {\n padding: 1em;\n}\n\n.vc-vmsg-buttons {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 0.5em;\n margin-bottom: 1em;\n}\n\n.vc-vmsg-modal audio {\n width: 100%;\n}\n\n.vc-vmsg-preview {\n color: var(--text-normal);\n border-radius: 24px;\n background-color: var(--background-secondary);\n position: relative;\n display: flex;\n align-items: center;\n padding: 0 16px;\n height: 48px;\n}\n\n.vc-vmsg-preview-indicator {\n background: var(--button-secondary-background);\n width: 16px;\n height: 16px;\n border-radius: 50%;\n transition: background 0.2s ease-in-out;\n}\n\n.vc-vmsg-preview-recording .vc-vmsg-preview-indicator {\n background: var(--status-danger);\n}\n\n.vc-vmsg-preview-time {\n opacity: 0.8;\n margin: 0 0.5em;\n font-size: 80%;\n\n /* monospace so different digits have same size */\n font-family: var(--font-code);\n}\n\n.vc-vmsg-preview-label {\n opacity: 0.5;\n letter-spacing: 0.125em;\n font-weight: 600;\n flex: 1;\n text-align: center;\n}\n"], - "mappings": "AAAA,2BAEI,2BACA,yBAHJ,kBAKI,gCCLJ,sBAEI,UACA,aACA,sBACA,yBACA,iDANJ,kBAQI,gBACA,eACA,WAGJ,gFACI,kBACA,mBACA,WACA,WACA,gBAGJ,iBACI,aACA,mBAvBJ,gBAyBI,YAGJ,yBACI,WAGJ,wBACI,aACA,8BAGJ,uBACI,4BACA,eACA,gBACA,oBACA,yBAGJ,2BACI,UACA,eACA,gCACA,WACA,yDAGJ,iCACI,+BACA,UAGJ,sBACI,YACA,WA5DJ,kBAgEA,6BACI,cAjEJ,kBAmEI,gBAGJ,mBAtEA,iBAwEI,iBAGJ,qBACI,WAGJ,2BACI,aACA,8EACA,mBAGJ,+BACI,aACA,sBAvFJ,YAyFI,gBAGJ,6BACI,oBACA,mCAGJ,8CACI,kBAGJ,8BACI,mBACA,UACA,kBAGJ,0BACI,aACA,sBAGJ,+BACI,iBACA,eACA,oBAGJ,gCACI,uBACA,iDCxHJ,qBACI,gBACA,mBACA,0DAGJ,0BACI,kBACA,oBACA,mBAGJ,gCAZA,YAcI,aACA,QACA,mBACA,6BACA,YACA,mBACA,kBAGJ,oBACI,aACA,mBAGJ,kBA5BA,YA8BI,kBAGJ,wBACI,gDACA,4CACA,+BAGJ,yBAEI,+BACA,mCA1CJ,aA4CI,mDACA,iBAGJ,6BACI,aACA,oCACA,aAGJ,gCACI,uBACA,iDAGJ,qFAGI,iBAGA,eCjEJ,wBACI,aACA,cACA,0DAGJ,wBACI,aACA,sBACA,iDACA,gCAV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I,gCAGJ,sBACI,WAvCJ,cAyCI,cAGA,6BAGJ,uBACI,WACA,sBACA,gBACA,OACA", + "sources": ["../src/components/ErrorCard.css", "../src/api/Notifications/styles.css", "../src/components/VencordSettings/settingsStyles.css", "../src/components/VencordSettings/themesStyles.css", "../src/components/PluginSettings/styles.css", "../src/components/iconStyles.css", "../src/components/PluginSettings/contributorModal.css", "../src/components/VencordSettings/addonCard.css", "../src/components/Switch.css", "../src/plugins/dearrow/styles.css", "../src/plugins/messageLogger/messageLogger.css", "../src/plugins/permissionsViewer/styles.css", "../src/components/ExpandableHeader.css", "../src/plugins/pictureInPicture/styles.css", "../src/plugins/pronoundb/styles.css", "../src/plugins/sendTimestamps/styles.css", "../src/plugins/serverProfile/styles.css", "../src/plugins/shikiCodeblocks.desktop/shiki.css", "../src/plugins/showConnections/styles.css", "../src/plugins/showHiddenChannels/style.css", "../src/plugins/showMeYourName/styles.css", "../src/plugins/spotifyControls/spotifyStyles.css", "../src/plugins/translate/styles.css", "../src/plugins/userVoiceShow/components/VoiceChannelSection.css", "../src/plugins/vencordToolbox/index.css", "../src/plugins/voiceMessages/styles.css"], + "sourcesContent": [".vc-error-card {\n padding: 2em;\n background-color: #e7828430;\n border: 1px solid #e78284;\n border-radius: 5px;\n color: var(--text-normal, white);\n}\n", ".vc-notification-root {\n /* clear default button styles */\n all: unset;\n display: flex;\n flex-direction: column;\n color: var(--text-normal);\n background-color: var(--background-secondary-alt);\n border-radius: 6px;\n overflow: hidden;\n cursor: pointer;\n width: 100%;\n}\n\n.vc-notification-root:not(.vc-notification-log-wrapper > .vc-notification-root) {\n position: absolute;\n z-index: 2147483647;\n right: 1rem;\n width: 25vw;\n min-height: 10vh;\n}\n\n.vc-notification {\n display: flex;\n flex-direction: row;\n padding: 1.25rem;\n gap: 1.25rem;\n}\n\n.vc-notification-content {\n width: 100%;\n}\n\n.vc-notification-header {\n display: flex;\n justify-content: space-between;\n}\n\n.vc-notification-title {\n color: var(--header-primary);\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.25rem;\n text-transform: uppercase;\n}\n\n.vc-notification-close-btn {\n all: unset;\n cursor: pointer;\n color: var(--interactive-normal);\n opacity: 0.5;\n transition: opacity 0.2s ease-in-out, color 0.2s ease-in-out;\n}\n\n.vc-notification-close-btn:hover {\n color: var(--interactive-hover);\n opacity: 1;\n}\n\n.vc-notification-icon {\n height: 4rem;\n width: 4rem;\n border-radius: 6px;\n}\n\n.vc-notification-progressbar {\n height: 0.25rem;\n border-radius: 5px;\n margin-top: auto;\n}\n\n.vc-notification-p {\n margin: 0.5rem 0 0;\n line-height: 140%;\n}\n\n.vc-notification-img {\n width: 100%;\n}\n\n.vc-notification-log-empty {\n height: 218px;\n background: url(\"/assets/b36de980b174d7b798c89f35c116e5c6.svg\") center no-repeat;\n margin-bottom: 40px;\n}\n\n.vc-notification-log-container {\n display: flex;\n flex-direction: column;\n padding: 1em;\n overflow: hidden;\n}\n\n.vc-notification-log-wrapper {\n transition: 200ms ease;\n transition-property: height, opacity;\n}\n\n.vc-notification-log-wrapper:not(:last-child) {\n margin-bottom: 1em;\n}\n\n.vc-notification-log-removing {\n height: 0 !important;\n opacity: 0;\n margin-bottom: 1em;\n}\n\n.vc-notification-log-body {\n display: flex;\n flex-direction: column;\n}\n\n.vc-notification-log-timestamp {\n margin-left: auto;\n font-size: 0.8em;\n font-weight: lighter;\n}\n\n.vc-notification-log-danger-btn {\n color: var(--white-500);\n background-color: var(--button-danger-background);\n}\n", ".vc-settings-tab-bar {\n margin-top: 20px;\n margin-bottom: 10px;\n border-bottom: 2px solid var(--background-modifier-accent);\n}\n\n.vc-settings-tab-bar-item {\n margin-right: 32px;\n padding-bottom: 16px;\n margin-bottom: -2px;\n}\n\n.vc-settings-quick-actions-card {\n padding: 1em;\n display: flex;\n gap: 1em;\n align-items: center;\n justify-content: space-evenly;\n flex-grow: 1;\n flex-flow: row wrap;\n margin-bottom: 1em;\n}\n\n.vc-settings-donate {\n display: flex;\n flex-direction: row;\n}\n\n.vc-settings-card {\n padding: 1em;\n margin-bottom: 1em;\n}\n\n.vc-backup-restore-card {\n background-color: var(--info-warning-background);\n border-color: var(--info-warning-foreground);\n color: var(--info-warning-text);\n}\n\n.vc-settings-theme-links {\n /* Needed to fix bad themes that hide certain textarea elements for whatever eldritch reason */\n display: inline-block !important;\n color: var(--text-normal) !important;\n padding: 0.5em;\n border: 1px solid var(--background-modifier-accent);\n max-height: unset;\n}\n\n.vc-cloud-settings-sync-grid {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-gap: 1em;\n}\n\n.vc-cloud-erase-data-danger-btn {\n color: var(--white-500);\n background-color: var(--button-danger-background);\n}\n\n.vc-text-selectable,\n.vc-text-selectable :where([class*=\"text\" i], [class*=\"title\" i]) {\n /* make text selectable, silly discord makes the entirety of settings not selectable */\n user-select: text;\n\n /* discord also sets cursor: default which prevents the cursor from showing as text */\n cursor: initial;\n}\n", ".vc-settings-theme-grid {\n display: grid;\n grid-gap: 16px;\n grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));\n}\n\n.vc-settings-theme-card {\n display: flex;\n flex-direction: column;\n background-color: var(--background-secondary-alt);\n color: var(--interactive-active);\n border-radius: 8px;\n padding: 1em;\n width: 100%;\n transition: 0.1s ease-out;\n transition-property: box-shadow, transform, background, opacity;\n}\n\n.vc-settings-theme-card-text {\n text-overflow: ellipsis;\n height: 1.2em;\n margin-bottom: 2px;\n white-space: nowrap;\n overflow: hidden;\n}\n\n.vc-settings-theme-author::before {\n content: \"by \";\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n.vc-plugins-grid {\n margin-top: 16px;\n display: grid;\n grid-gap: 16px;\n grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));\n}\n\n.vc-plugins-info-button {\n height: 24px;\n width: 24px;\n padding: 0;\n background: transparent;\n margin-right: 8px;\n}\n\n.vc-plugins-settings-button:hover {\n color: var(--interactive-hover);\n}\n\n.vc-plugins-filter-controls {\n display: grid;\n height: 40px;\n gap: 10px;\n grid-template-columns: 1fr 150px;\n}\n\n.vc-plugins-badge {\n padding: 0 6px;\n font-family: var(--font-display);\n font-weight: 500;\n border-radius: 8px;\n height: 16px;\n font-size: 12px;\n line-height: 16px;\n color: var(--white-500);\n text-align: center;\n}\n\n.vc-plugins-dep-name {\n margin: 0 auto;\n}\n\n.vc-plugins-info-card {\n padding: 1em;\n height: 8em;\n display: flex;\n flex-direction: column;\n}\n\n.vc-plugins-info-card div {\n line-height: 32px;\n}\n\n.vc-plugins-restart-card {\n padding: 1em;\n background: var(--info-warning-background);\n border: 1px solid var(--info-warning-foreground);\n color: var(--info-warning-text);\n}\n\n.vc-plugins-restart-card button {\n margin-top: 0.5em;\n}\n\n.vc-plugins-info-button svg:not(:hover, :focus) {\n color: var(--text-muted);\n}\n", ".vc-open-external-icon {\n transform: rotate(45deg);\n}\n\n.vc-owner-crown-icon {\n color: var(--text-warning);\n}\n", ".vc-author-modal-root {\n padding: 1em;\n}\n\n.vc-author-modal-header {\n display: flex;\n align-items: center;\n margin-bottom: 1em;\n}\n\n.vc-author-modal-name {\n text-transform: none;\n flex-grow: 0;\n background: var(--background-tertiary);\n border-radius: 0 9999px 9999px 0;\n padding: 6px 0.8em 6px 0.5em;\n font-size: 20px;\n height: 20px;\n position: relative;\n text-wrap: nowrap;\n}\n\n.vc-author-modal-name::before {\n content: \"\";\n display: block;\n position: absolute;\n height: 100%;\n width: 16px;\n background: var(--background-tertiary);\n z-index: -1;\n left: -16px;\n top: 0;\n}\n\n.vc-author-modal-avatar {\n height: 32px;\n width: 32px;\n border-radius: 50%;\n}\n\n.vc-author-modal-links {\n margin-left: auto;\n display: flex;\n gap: 0.2em;\n}\n\n.vc-author-modal-links img {\n height: 32px;\n width: 32px;\n border-radius: 50%;\n border: 4px solid var(--background-tertiary);\n box-sizing: border-box\n}\n\n.vc-author-modal-plugins {\n display: grid;\n gap: 0.5em;\n}\n", ".vc-addon-card {\n background-color: var(--background-secondary-alt);\n color: var(--interactive-active);\n border-radius: 8px;\n display: block;\n height: 100%;\n padding: 12px;\n width: 100%;\n transition: 0.1s ease-out;\n transition-property: box-shadow, transform, background, opacity;\n box-sizing: border-box;\n}\n\n.vc-addon-card-disabled {\n opacity: 0.6;\n}\n\n.vc-addon-card:hover {\n background-color: var(--background-tertiary);\n transform: translateY(-1px);\n box-shadow: var(--elevation-high);\n}\n\n.vc-addon-header {\n margin-top: auto;\n display: flex;\n width: 100%;\n justify-content: flex-end;\n align-items: center;\n gap: 8px;\n margin-bottom: 0.5em;\n}\n\n.vc-addon-note {\n height: 36px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n -webkit-box-orient: vertical;\n /* stylelint-disable-next-line property-no-unknown */\n box-orient: vertical;\n}\n\n.vc-addon-name-author {\n width: 100%;\n}\n\n.vc-addon-name {\n display: flex;\n width: 100%;\n align-items: center;\n flex-grow: 1;\n gap: 8px;\n}\n\n.vc-addon-author {\n font-size: 0.8em;\n}\n\n.vc-addon-author::before {\n content: \"by \";\n}\n", ".vc-switch-slider {\n transition: 100ms transform ease-in-out;\n}\n", ".vc-dearrow-toggle-off svg {\n filter: grayscale(1);\n}\n\n.vc-dearrow-toggle-on, .vc-dearrow-toggle-off {\n all: unset;\n display: inline;\n cursor: pointer;\n position: absolute;\n top: 0.75rem;\n right: 0.75rem;\n}\n", ".messagelogger-deleted [class^=\"buttons\"] {\n display: none;\n}\n\n.messagelogger-deleted\n:is(\n video,\n .emoji,\n [data-type=\"sticker\"],\n iframe,\n .messagelogger-deleted-attachment,\n [class|=\"inlineMediaEmbed\"]\n) {\n filter: grayscale(1) !important;\n transition: 150ms filter ease-in-out;\n}\n\n.messagelogger-deleted\n:is(\n video,\n .emoji,\n [data-type=\"sticker\"],\n iframe,\n .messagelogger-deleted-attachment,\n [class|=\"inlineMediaEmbed\"]\n):hover,\n.messagelogger-deleted {\n filter: grayscale(0) !important;\n}\n\n.theme-dark .messagelogger-edited {\n filter: brightness(80%);\n}\n\n.theme-light .messagelogger-edited {\n opacity: 0.5;\n}\n", "/* User Permissions Component */\n\n.vc-permviewer-userperms-title-container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-top: 10px;\n margin-bottom: 6px;\n}\n\n.vc-permviewer-userperms-btns-container {\n display: flex;\n align-items: center;\n}\n\n.vc-permviewer-userperms-sortorder-btn {\n all: unset;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n}\n\n.vc-permviewer-userperms-permdetails-btn {\n all: unset;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n\n.vc-permviewer-userperms-toggleperms-btn {\n all: unset;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n\n/* RolesAndUsersPermissions Component */\n\n.vc-permviewer-perms-title {\n flex-grow: 1;\n}\n\n.vc-permviewer-perms-no-perms {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n}\n\n.vc-permviewer-perms-container {\n display: grid;\n grid-template-columns: 1fr 2fr;\n grid-template-areas: \"list permissions\";\n padding: 16px 0;\n}\n\n.vc-permviewer-perms-list {\n grid-area: list;\n display: flex;\n flex-direction: column;\n gap: 2px;\n border-right: 2px solid var(--background-modifier-active);\n}\n\n.vc-permviewer-perms-list-item-btn {\n all: unset;\n cursor: pointer;\n}\n\n.vc-permviewer-perms-list-item {\n display: flex;\n align-items: center;\n padding: 8px 5px;\n cursor: pointer;\n width: 230px;\n border-radius: 5px;\n}\n\n.vc-permviewer-perms-list-item:hover {\n background-color: var(--background-modifier-hover);\n}\n\n.vc-permviewer-perms-list-item-active {\n background-color: var(--background-modifier-selected);\n}\n\n.vc-permviewer-perms-list-item > div {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n\n.vc-permviewer-perms-role-circle {\n border-radius: 50%;\n width: 12px;\n height: 12px;\n margin-left: 3px;\n margin-right: 11px;\n flex-shrink: 0;\n}\n\n.vc-permviewer-perms-user-img {\n border-radius: 50%;\n width: 20px;\n height: 20px;\n margin-right: 6px;\n}\n\n.vc-permviewer-perms-perms {\n grid-area: permissions;\n display: flex;\n flex-direction: column;\n margin-left: 5px;\n}\n\n.vc-permviewer-perms-perms-item {\n position: relative;\n display: flex;\n align-items: center;\n padding: 10px;\n border-bottom: 2px solid var(--background-modifier-active);\n}\n\n.vc-permviewer-perms-perms-item:last-child {\n border: 0;\n}\n\n.vc-permviewer-perms-perms-item-icon {\n border: 1px solid var(--background-modifier-selected);\n width: 24px;\n height: 24px;\n margin-right: 5px;\n}\n\n.vc-permviewer-perms-perms-item .vc-info-icon {\n color: var(--interactive-muted);\n cursor: pointer;\n position: absolute;\n right: 0;\n scale: 0.9;\n transition: color ease-in 0.1s;\n}\n\n.vc-permviewer-perms-perms-item .vc-info-icon:hover {\n color: var(--interactive-active);\n}\n", ".vc-expandableheader-center-flex {\n display: flex;\n justify-items: center;\n align-items: center;\n}\n\n.vc-expandableheader-btn {\n all: unset;\n cursor: pointer;\n width: 24px;\n height: 24px;\n}\n", ".vc-pip-button {\n color: var(--interactive-normal);\n}\n\n.vc-pip-button:hover {\n background-color: var(--background-modifier-hover);\n color: var(--interactive-hover);\n}\n", ".vc-pronoundb-compact {\n display: none;\n}\n\n[class*=\"compact\"] .vc-pronoundb-compact {\n display: inline-block;\n margin-left: -2px;\n margin-right: 0.25rem;\n}\n", ".vc-st-modal-content input {\n background-color: var(--input-background);\n color: var(--text-normal);\n width: 95%;\n padding: 8px 8px 8px 12px;\n margin: 1em 0;\n outline: none;\n border: 1px solid var(--input-background);\n border-radius: 4px;\n font-weight: 500;\n font-style: inherit;\n font-size: 100%;\n}\n\n.vc-st-format-label,\n.vc-st-format-label span {\n background-color: transparent;\n}\n\n.vc-st-modal-content [class|=\"select\"] {\n margin-bottom: 1em;\n}\n\n.vc-st-modal-content [class|=\"select\"] span {\n background-color: var(--input-background);\n}\n\n.vc-st-modal-header {\n justify-content: space-between;\n align-content: center;\n}\n\n.vc-st-modal-header h1 {\n margin: 0;\n}\n\n.vc-st-modal-header button {\n padding: 0;\n}\n\n.vc-st-preview-text {\n margin-bottom: 1em;\n}\n\n.vc-st-button {\n padding: 0 6px;\n}\n\n.vc-st-button svg {\n transform: scale(1.1) translateY(1px);\n}\n", ".vc-gp-root {\n height: 100%;\n user-select: text;\n}\n\n.vc-gp-banner {\n width: 100%;\n cursor: pointer;\n}\n\n.vc-gp-header {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 0.5em;\n margin: 0.5em;\n}\n\n.vc-gp-header img {\n width: 48px;\n height: 48px;\n cursor: pointer;\n}\n\n.vc-gp-name-and-description {\n display: flex;\n flex-direction: column;\n gap: 0.2em;\n}\n\n.vc-gp-name {\n margin: 0;\n}\n\n.vc-gp-tab-bar {\n border-bottom: 2px solid var(--background-modifier-accent);\n margin: 20px 12px 0;\n display: flex;\n gap: 40px;\n align-items: stretch;\n flex-direction: row;\n}\n\n.vc-gp-tab {\n border-bottom: 2px solid transparent;\n color: var(--interactive-normal);\n cursor: pointer;\n height: 39px;\n line-height: 14px;\n}\n\n.vc-gp-tab-content {\n margin: 1em;\n}\n\n.vc-gp-tab:where(.vc-gp-selected, :hover, :focus) {\n border-bottom-color: var(--interactive-active);\n}\n\n.vc-gp-info {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 1em;\n}\n\n.vc-gp-server-info-pair {\n color: var(--text-normal);\n}\n\n.vc-gp-server-info-pair [class^=\"timestamp\"] {\n margin-left: 0;\n}\n\n.vc-gp-owner {\n display: flex;\n align-items: center;\n gap: 0.2em;\n}\n\n.vc-gp-owner img {\n height: 20px;\n border-radius: 50%;\n cursor: pointer;\n}\n\n.vc-gp-scroller {\n width: 100%;\n max-height: 500px;\n}\n\n.vc-gp-scroller [class^=\"listRow\"] {\n margin: 1px 0;\n}\n\n.vc-gp-scroller [class^=\"listRow\"]:hover {\n background-color: var(--background-modifier-hover);\n}\n", ".shiki-container {\n border: 4px;\n background-color: var(--background-secondary);\n}\n\n.shiki-root {\n border-radius: 4px;\n}\n\n.shiki-root code {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n position: relative;\n font-size: 0.875rem;\n line-height: 1.125rem;\n text-indent: 0;\n white-space: pre-wrap;\n background: transparent;\n border: none;\n}\n\n.shiki-devicon {\n margin-right: 8px;\n user-select: none;\n}\n\n.shiki-plain code {\n padding-top: 8px;\n}\n\n.shiki-btns {\n font-size: 1em;\n position: absolute;\n right: 0;\n bottom: 0;\n opacity: 0;\n}\n\n.shiki-root:hover .shiki-btns {\n opacity: 1;\n}\n\n.shiki-btn {\n border-radius: 4px 4px 0 0;\n padding: 4px 8px;\n user-select: none;\n}\n\n.shiki-btn ~ .shiki-btn {\n margin-left: 4px;\n}\n\n.shiki-btn:last-child {\n border-radius: 4px 0;\n}\n\n.shiki-spinner-container {\n align-items: center;\n background-color: rgb(0 0 0 / 60%);\n display: flex;\n position: absolute;\n justify-content: center;\n inset: 0;\n}\n\n.shiki-preview {\n margin-bottom: 2em;\n}\n\n.shiki-lang {\n padding: 0 5px;\n margin-bottom: 6px;\n font-weight: bold;\n text-transform: capitalize;\n display: flex;\n align-items: center;\n}\n\n.shiki-table {\n border-collapse: collapse;\n width: 100%;\n}\n\n.shiki-table tr {\n height: 19px;\n width: 100%;\n}\n\n.shiki-root td:first-child {\n border-right: 1px solid transparent;\n padding-left: 5px;\n padding-right: 8px;\n user-select: none;\n}\n\n.shiki-root td:last-child {\n padding-left: 8px;\n word-break: break-word;\n width: 100%;\n}\n", ".vc-user-connection {\n all: unset;\n display: inline-block;\n cursor: pointer;\n}\n\n.vc-sc-tooltip {\n display: inline-flex;\n gap: 0.25em;\n align-items: center;\n}\n", ".shc-lock-screen-outer-container {\n overflow: hidden scroll;\n flex: 1 1 auto;\n height: 100%;\n width: 100%;\n}\n\n.shc-lock-screen-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n min-height: 100%;\n}\n\n.shc-lock-screen-container > * {\n margin: 5px;\n}\n\n.shc-lock-screen-logo {\n width: 180px;\n height: 180px;\n}\n\n.shc-lock-screen-heading-container {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.shc-lock-screen-heading-container > * {\n margin: inherit;\n}\n\n.shc-lock-screen-heading-nsfw-icon {\n color: var(--text-normal);\n}\n\n.shc-lock-screen-topic-container {\n color: var(--text-normal);\n background: var(--bg-overlay-3, var(--background-secondary));\n border-radius: 5px;\n padding: 10px;\n max-width: 70vw;\n}\n\n.shc-lock-screen-tags-container {\n background: var(--bg-overlay-3, var(--background-secondary));\n border-radius: 5px;\n padding: 10px;\n max-width: 70vw;\n}\n\n.shc-lock-screen-tags-container > * {\n margin: inherit;\n}\n\n.shc-lock-screen-tags {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n gap: 8px;\n}\n\n.shc-evenodd-fill-current-color {\n fill-rule: evenodd;\n fill: currentcolor;\n}\n\n.shc-hidden-channel-icon {\n margin-left: 6px;\n z-index: 0;\n cursor: not-allowed;\n}\n\n.shc-lock-screen-default-emoji-container {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.shc-lock-screen-default-emoji-container > [class^=\"emojiContainer\"] {\n background: var(--bg-overlay-3, var(--background-secondary));\n border-radius: 8px;\n padding: 5px 6px;\n margin-left: 5px;\n}\n\n.shc-lock-screen-allowed-users-and-roles-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n background: var(--bg-overlay-3, var(--background-secondary));\n border-radius: 5px;\n padding: 10px;\n max-width: 70vw;\n}\n\n.shc-lock-screen-allowed-users-and-roles-container-title {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.shc-lock-screen-allowed-users-and-roles-container-toggle-btn {\n all: unset;\n margin-left: 5px;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n\n.shc-lock-screen-allowed-users-and-roles-container-toggle-btn > svg {\n color: var(--text-normal);\n}\n\n.shc-lock-screen-allowed-users-and-roles-container-permdetails-btn {\n all: unset;\n margin-right: 5px;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n\n.shc-lock-screen-allowed-users-and-roles-container-permdetails-btn > svg {\n color: var(--text-normal);\n}\n\n.shc-lock-screen-allowed-users-and-roles-container > [class^=\"members\"] {\n margin-left: 10px;\n flex-wrap: wrap;\n justify-content: center;\n}\n", ".vc-smyn-suffix {\n color: var(--text-muted);\n}\n\n.vc-smyn-suffix::before {\n content: \"(\";\n}\n\n.vc-smyn-suffix::after {\n content: \")\";\n}\n", "#vc-spotify-player {\n padding: 0.375rem 0.5rem;\n border-bottom: 1px solid var(--background-modifier-accent);\n\n --vc-spotify-green: #1db954; /* so custom themes can easily change it */\n}\n\n.theme-light #vc-spotify-player {\n background: var(--bg-overlay-3, var(--background-secondary-alt));\n}\n\n.theme-dark #vc-spotify-player {\n background: var(--bg-overlay-1, var(--background-secondary-alt));\n}\n\n.vc-spotify-button {\n background: none;\n color: var(--interactive-normal);\n padding: 0;\n width: 32px;\n height: 32px;\n border-radius: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.vc-spotify-button:hover {\n color: var(--interactive-hover);\n background-color: var(--background-modifier-selected);\n}\n\n.vc-spotify-button svg {\n height: 24px;\n width: 24px;\n}\n\n[class*=\"vc-spotify-shuffle\"] > svg,\n[class*=\"vc-spotify-repeat\"] > svg {\n width: 22px;\n height: 22px;\n}\n\n.vc-spotify-button svg path {\n width: 100%;\n height: 100%;\n}\n\n/* .vc-spotify-button:hover {\n filter: brightness(1.3);\n} */\n\n.vc-spotify-shuffle-on,\n.vc-spotify-repeat-context,\n.vc-spotify-repeat-track,\n.vc-spotify-shuffle-on:hover,\n.vc-spotify-repeat-context:hover,\n.vc-spotify-repeat-track:hover {\n color: var(--vc-spotify-green);\n}\n\n.vc-spotify-tooltip-text {\n overflow: hidden;\n white-space: nowrap;\n padding-right: 0.2em;\n max-width: 100%;\n margin: unset;\n}\n\n.vc-spotify-repeat-1 {\n font-size: 70%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n\n.vc-spotify-button-row {\n justify-content: center;\n}\n\n#vc-spotify-info-wrapper {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 3em;\n gap: 0.5em;\n}\n\n#vc-spotify-info-wrapper img {\n height: 90%;\n object-fit: contain;\n}\n\n#vc-spotify-album-expanded-wrapper img {\n width: 100%;\n object-fit: contain;\n}\n\n#vc-spotify-titles {\n display: flex;\n flex-direction: column;\n padding: 0.2rem;\n justify-content: center;\n align-items: flex-start;\n align-content: flex-start;\n overflow: hidden;\n}\n\n#vc-spotify-song-title {\n color: var(--header-primary);\n font-size: 14px;\n font-weight: 600;\n}\n\n.vc-spotify-ellipoverflow {\n white-space: nowrap;\n overflow: hidden;\n width: 100%;\n text-overflow: ellipsis;\n}\n\n.vc-spotify-artist,\n.vc-spotify-album {\n font-size: 12px;\n text-decoration: none;\n color: var(--header-secondary);\n}\n\n.vc-spotify-comma {\n color: var(--header-secondary);\n}\n\n.vc-spotify-artist[role=\"link\"]:hover,\n#vc-spotify-album-title[role=\"link\"]:hover,\n#vc-spotify-song-title[role=\"link\"]:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\n#vc-spotify-album-image {\n border-radius: 3px;\n transition: filter 0.2s;\n}\n\n#vc-spotify-album-image:hover {\n filter: brightness(1.2);\n cursor: pointer;\n}\n\n#vc-spotify-progress-bar {\n position: relative;\n color: var(--text-normal);\n width: 100%;\n margin: 0.5em 0;\n margin-bottom: 5px;\n}\n\n#vc-spotify-progress-bar > [class^=\"slider\"] {\n flex-grow: 1;\n width: 100%;\n padding: 0 !important;\n}\n\n#vc-spotify-progress-bar > [class^=\"slider\"] [class^=\"bar-\"] {\n height: 4px !important;\n}\n\n#vc-spotify-progress-bar > [class^=\"slider\"] [class^=\"grabber\"] {\n /* these importants are necessary, it applies a width and height through inline styles */\n height: 10px !important;\n width: 10px !important;\n background-color: var(--interactive-normal);\n border-color: var(--interactive-normal);\n color: var(--interactive-normal);\n}\n\n#vc-spotify-progress-text {\n margin: 0;\n}\n\n.vc-spotify-progress-time {\n font-size: 12px;\n top: 10px;\n position: absolute;\n}\n\n.vc-spotify-time-left {\n left: 0;\n}\n\n.vc-spotify-time-right {\n right: 0;\n}\n\n.vc-spotify-fallback {\n padding: 0.5em;\n color: var(--text-normal);\n}\n", ".vc-trans-modal-content {\n padding: 1em;\n}\n\n.vc-trans-modal-header {\n justify-content: space-between;\n align-content: center;\n}\n\n.vc-trans-modal-header h1 {\n margin: 0;\n}\n\n.vc-trans-accessory {\n color: var(--text-muted);\n margin-top: 0.5em;\n font-style: italic;\n font-weight: 400;\n}\n\n.vc-trans-accessory svg {\n margin-right: 0.25em;\n}\n\n.vc-trans-dismiss {\n all: unset;\n cursor: pointer;\n color: var(--text-link);\n}\n\n.vc-trans-dismiss:is(:hover, :focus) {\n text-decoration: underline;\n}\n\n.vc-trans-auto-translate {\n color: var(--green-360);\n}\n", ".vc-uvs-button>div {\n white-space: normal !important;\n}\n\n.vc-uvs-button {\n width: 100%;\n margin: auto;\n height: unset;\n}\n\n.vc-uvs-header {\n color: var(--header-primary);\n margin-bottom: 6px;\n}\n\n.vc-uvs-modal-margin {\n margin: 0 12px;\n}\n\n.vc-uvs-modal-margin div {\n margin-bottom: 0 !important;\n}\n\n.vc-uvs-popout-margin-self>[class^=\"section\"] {\n padding-top: 0;\n padding-bottom: 12px;\n}\n", ".vc-toolbox-btn,\n.vc-toolbox-btn>svg {\n -webkit-app-region: no-drag;\n}\n\n.vc-toolbox-btn>svg {\n color: var(--interactive-normal);\n}\n\n.vc-toolbox-btn[class*=\"selected\"]>svg {\n color: var(--interactive-active);\n}\n\n.vc-toolbox-btn:hover>svg {\n color: var(--interactive-hover);\n}\n", ".vc-vmsg-modal {\n padding: 1em;\n}\n\n.vc-vmsg-buttons {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 0.5em;\n margin-bottom: 1em;\n}\n\n.vc-vmsg-modal audio {\n width: 100%;\n}\n\n.vc-vmsg-preview {\n color: var(--text-normal);\n border-radius: 24px;\n background-color: var(--background-secondary);\n position: relative;\n display: flex;\n align-items: center;\n padding: 0 16px;\n height: 48px;\n}\n\n.vc-vmsg-preview-indicator {\n background: var(--button-secondary-background);\n width: 16px;\n height: 16px;\n border-radius: 50%;\n transition: background 0.2s ease-in-out;\n}\n\n.vc-vmsg-preview-recording .vc-vmsg-preview-indicator {\n background: var(--status-danger);\n}\n\n.vc-vmsg-preview-time {\n opacity: 0.8;\n margin: 0 0.5em;\n font-size: 80%;\n\n /* monospace so different digits have same size */\n font-family: var(--font-code);\n}\n\n.vc-vmsg-preview-label {\n opacity: 0.5;\n letter-spacing: 0.125em;\n font-weight: 600;\n flex: 1;\n text-align: center;\n}\n"], + "mappings": "AAAA,2BAEI,2BACA,yBAHJ,kBAKI,gCCLJ,sBAEI,UACA,aACA,sBACA,yBACA,iDANJ,kBAQI,gBACA,eACA,WAGJ,gFACI,kBACA,mBACA,WACA,WACA,gBAGJ,iBACI,aACA,mBAvBJ,gBAyBI,YAGJ,yBACI,WAGJ,wBACI,aACA,8BAGJ,uBACI,4BACA,eACA,gBACA,oBACA,yBAGJ,2BACI,UACA,eACA,gCACA,WACA,yDAGJ,iCACI,+BACA,UAGJ,sBACI,YACA,WA5DJ,kBAgEA,6BACI,cAjEJ,kBAmEI,gBAGJ,mBAtEA,iBAwEI,iBAGJ,qBACI,WAGJ,2BACI,aACA,8EACA,mBAGJ,+BACI,aACA,sBAvFJ,Y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,kBACI,UACA,eACA,uBAGJ,oCACI,0BAGJ,yBACI,uBCnCJ,mBACI,6BAGJ,eACI,WALJ,YAOI,aAGJ,eACI,4BACA,kBAGJ,qBAfA,cAmBA,yBACI,0BAGJ,4CACI,cACA,oBCzBJ,oCAEI,2BAGJ,oBACI,gCAGJ,qCACI,gCAGJ,0BACI,+BCdJ,2BAIA,iBACI,aACA,8CACA,SACA,kBAGJ,qBACI,WAGJ,iBACI,yBAhBJ,mBAkBI,6CACA,kBACA,aACA,mBArBJ,eAuBI,YAGJ,2BACI,8CACA,WACA,YA7BJ,kBA+BI,sCAGJ,sDACI,gCAGJ,sBACI,WAvCJ,cAyCI,cAGA,6BAGJ,uBACI,WACA,sBACA,gBACA,OACA", "names": [] } diff --git a/VencordDesktop/vencordDist/vencordDesktopRenderer.js b/VencordDesktop/vencordDist/vencordDesktopRenderer.js index 03df79b..8fea11e 100644 --- a/VencordDesktop/vencordDist/vencordDesktopRenderer.js +++ b/VencordDesktop/vencordDist/vencordDesktopRenderer.js @@ -1,74 +1,67 @@ -// Vencord 81fb7c6 +// Vencord 96126fa // Standalone: true // Platform: Universal // Updater disabled: false -"use strict";var Vencord=(()=>{var j2=Object.create;var zs=Object.defineProperty;var W2=Object.getOwnPropertyDescriptor;var q2=Object.getOwnPropertyNames;var K2=Object.getPrototypeOf,Y2=Object.prototype.hasOwnProperty;var Rr=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var g=(e,t)=>()=>(e&&(t=e(e=0)),t);var or=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Be=(e,t)=>{for(var n in t)zs(e,n,{get:t[n],enumerable:!0})},$g=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of q2(t))!Y2.call(e,i)&&i!==n&&zs(e,i,{get:()=>t[i],enumerable:!(r=W2(t,i))||r.enumerable});return e};var js=(e,t,n)=>(n=e!=null?j2(K2(e)):{},$g(t||!e||!e.__esModule?zs(n,"default",{value:e,enumerable:!0}):n,e)),To=e=>$g(zs({},"__esModule",{value:!0}),e);var f,o,a=g(()=>{"use strict";f=Symbol.for("react.fragment"),o=(...e)=>(o=Vencord.Webpack.Common.React.createElement)(...e)});var ie,Ze=g(()=>{"use strict";a();ie=class{constructor(t,n="white"){this.name=t;this.color=n}static makeTitle(t,n){return["%c %c %s ","",`background: ${t}; color: black; font-weight: bold; border-radius: 5px;`,n]}_log(t,n,r,i=""){console[t](`%c Vencord %c %c ${this.name} ${i}`,`background: ${n}; color: black; font-weight: bold; border-radius: 5px;`,"",`background: ${this.color}; color: black; font-weight: bold; border-radius: 5px;`,...r)}log(...t){this._log("log","#a6d189",t)}info(...t){this._log("info","#a6d189",t)}error(...t){this._log("error","#e78284",t)}errorCustomFmt(t,...n){this._log("error","#e78284",n,t)}warn(...t){this._log("warn","#e5c890",t)}debug(...t){this._log("debug","#eebebe",t)}}});var Gg,q,at=g(()=>{"use strict";a();Gg="",q={};for(let e of["top","bottom","left","right"])for(let t of[8,16,20]){let n=`vc-m-${e}-${t}`;q[`${e}${t}`]=n,Gg+=`.${n}{margin-${e}:${t}px;}`}document.addEventListener("DOMContentLoaded",()=>document.head.append(Object.assign(document.createElement("style"),{textContent:Gg,id:"vencord-margins"})),{once:!0})});function xo(e,t=5){let n=0,r;return()=>(!r&&t>n++&&(r=e(),!r&&t===n&&console.error("Lazy factory failed:",e)),r)}function yt(e,t=5,n=!1){let r=!0;n||setTimeout(()=>r=!1,0);let i=0,s=Object.assign(function(){},{[wi]:void 0,[Lr](){return!s[wi]&&t>i++&&(s[wi]=e(),!s[wi]&&t===i&&console.error("Lazy factory failed:",e)),s[wi]}});return new Proxy(s,{...Ws,get(l,c,u){return!n&&r?yt(()=>Reflect.get(l[Lr](),c,u),t,!0):Reflect.get(l[Lr](),c,u)}})}var Hg,Ws,Lr,wi,wn=g(()=>{"use strict";a();Hg=["arguments","caller","prototype"],Ws={},Lr=Symbol.for("vencord.lazy.get"),wi=Symbol.for("vencord.lazy.cached");for(let e of["apply","construct","defineProperty","deleteProperty","getOwnPropertyDescriptor","getPrototypeOf","has","isExtensible","ownKeys","preventExtensions","set","setPrototypeOf"])Ws[e]=(t,...n)=>Reflect[e](t[Lr](),...n);Ws.ownKeys=e=>{let t=e[Lr](),n=Reflect.ownKeys(t);for(let r of Hg)n.includes(r)||n.push(r);return n};Ws.getOwnPropertyDescriptor=(e,t)=>{if(typeof t=="string"&&Hg.includes(t))return Reflect.getOwnPropertyDescriptor(e,t);let n=Reflect.getOwnPropertyDescriptor(e[Lr](),t);return n&&Object.defineProperty(e,t,n),n}});function tt(e,t=5){let n=xo(e,t);return r=>{let i=n()??Z2;return o(i,{...r})}}var Z2,ec=g(()=>{"use strict";a();wn();Z2=()=>null});var X2,$n,qs=g(()=>{"use strict";a();Ze();X2=(e,t,n)=>t,$n=X2});function Ys(e){if(Jn!==void 0)throw"no.";return e.push([[Symbol("Vencord")],{},t=>Mn=t]),e.pop(),Mn?(Jn=Mn.c,!0):!1}function Mi(e,...t){let n=new Error(`webpack.${e} found no module`);tc.error(n,"Filter:",t)}function un(e){return yt(()=>Ot(e))}function rr(e){if(typeof e!="function")throw new Error("Invalid filter. Expected a function got "+typeof e);let t=[];for(let n in Jn){let r=Jn[n];!r?.exports||(e(r.exports)&&t.push(r.exports),r.exports.default&&e(r.exports.default)&&t.push(r.exports.default))}return t}function pn(...e){let t=Ot(Ke.byProps(...e),{isIndirect:!0});return t||Mi("findByProps",...e),t}function I(...e){return yt(()=>pn(...e))}function jg(...e){let t=Ot(Ke.byCode(...e),{isIndirect:!0});return t||Mi("findByCode",...e),t}function Pi(...e){return yt(()=>jg(...e))}function Wg(e){let t=Ot(Ke.byStoreName(e),{isIndirect:!0});return t||Mi("findStore",e),t}function Me(e){return yt(()=>Wg(e))}function qg(...e){let t=Ot(Ke.componentByCode(...e),{isIndirect:!0});return t||Mi("findComponentByCode",...e),t}function sc(e){return tt(()=>Ot(e))}function Xe(...e){return tt(()=>qg(...e))}function ac(...e){return tt(()=>pn(...e)?.[e[0]])}function ut(e,t){if(typeof e=="string")e=Ke.byProps(e);else if(Array.isArray(e))e=Ke.byProps(...e);else if(typeof e!="function")throw new Error("filter must be a string, string[] or function, got "+typeof e);let[n,r]=Ot(e,{isIndirect:!0,isWaitFor:!0});if(n)return void t(n,r);zg.set(e,t)}function J2(e){oc.add(e)}function Q2(e){oc.delete(e)}function lc(...e){let t={},n=Mn.m;e:for(let r in n){let i=n[r].original??n[r],s=i.toString();for(let l of e)if(typeof l=="string"&&!s.includes(l)||l instanceof RegExp&&!l.test(s))continue e;t[r]=i}return t}function Zs(e){let t=Mn.m[e];if(!t)return null;let n=` +"use strict";var Vencord=(()=>{var _w=Object.create;var Hs=Object.defineProperty;var Bw=Object.getOwnPropertyDescriptor;var Fw=Object.getOwnPropertyNames;var Uw=Object.getPrototypeOf,$w=Object.prototype.hasOwnProperty;var Rr=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var g=(e,t)=>()=>(e&&(t=e(e=0)),t);var rr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ue=(e,t)=>{for(var n in t)Hs(e,n,{get:t[n],enumerable:!0})},Ug=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Fw(t))!$w.call(e,i)&&i!==n&&Hs(e,i,{get:()=>t[i],enumerable:!(r=Bw(t,i))||r.enumerable});return e};var zs=(e,t,n)=>(n=e!=null?_w(Uw(e)):{},Ug(t||!e||!e.__esModule?Hs(n,"default",{value:e,enumerable:!0}):n,e)),Io=e=>Ug(Hs({},"__esModule",{value:!0}),e);var f,o,a=g(()=>{"use strict";f=Symbol.for("react.fragment"),o=(...e)=>(o=Vencord.Webpack.Common.React.createElement)(...e)});var ie,Je=g(()=>{"use strict";a();ie=class{constructor(t,n="white"){this.name=t;this.color=n}static makeTitle(t,n){return["%c %c %s ","",`background: ${t}; color: black; font-weight: bold; border-radius: 5px;`,n]}_log(t,n,r,i=""){console[t](`%c Vencord %c %c ${this.name} ${i}`,`background: ${n}; color: black; font-weight: bold; border-radius: 5px;`,"",`background: ${this.color}; color: black; font-weight: bold; border-radius: 5px;`,...r)}log(...t){this._log("log","#a6d189",t)}info(...t){this._log("info","#a6d189",t)}error(...t){this._log("error","#e78284",t)}errorCustomFmt(t,...n){this._log("error","#e78284",n,t)}warn(...t){this._log("warn","#e5c890",t)}debug(...t){this._log("debug","#eebebe",t)}}});var $g,Y,ct=g(()=>{"use strict";a();$g="",Y={};for(let e of["top","bottom","left","right"])for(let t of[8,16,20]){let n=`vc-m-${e}-${t}`;Y[`${e}${t}`]=n,$g+=`.${n}{margin-${e}:${t}px;}`}document.addEventListener("DOMContentLoaded",()=>document.head.append(Object.assign(document.createElement("style"),{textContent:$g,id:"vencord-margins"})),{once:!0})});function Ao(e,t=5){let n=0,r;return()=>(!r&&t>n++&&(r=e(),!r&&t===n&&console.error("Lazy factory failed:",e)),r)}function Qe(e,t=5){let n=0,r=Object.assign(function(){},{[Pi]:void 0,[Ws](){return!r[Pi]&&t>n++&&(r[Pi]=e(),!r[Pi]&&t===n&&console.error("Lazy factory failed:",e)),r[Pi]}});return new Proxy(r,js)}var Gg,js,Ws,Pi,Zt=g(()=>{"use strict";a();Gg=["arguments","caller","prototype"],js={},Ws=Symbol.for("vencord.lazy.get"),Pi=Symbol.for("vencord.lazy.cached");for(let e of["apply","construct","defineProperty","deleteProperty","get","getOwnPropertyDescriptor","getPrototypeOf","has","isExtensible","ownKeys","preventExtensions","set","setPrototypeOf"])js[e]=(t,...n)=>Reflect[e](t[Ws](),...n);js.ownKeys=e=>{let t=e[Ws](),n=Reflect.ownKeys(t);for(let r of Gg)n.includes(r)||n.push(r);return n};js.getOwnPropertyDescriptor=(e,t)=>{if(typeof t=="string"&&Gg.includes(t))return Reflect.getOwnPropertyDescriptor(e,t);let n=Reflect.getOwnPropertyDescriptor(e[Ws](),t);return n&&Object.defineProperty(e,t,n),n}});var Gw,Pn,qs=g(()=>{"use strict";a();Je();Gw=(e,t,n)=>t,Pn=Gw});function Zs(e){if(In!==void 0)throw"no.";if(e.push([[Symbol("Vencord")],{},t=>mn=t]),e.pop(),!mn)return!1;In=mn.c;for(let t in In){let{exports:n}=In[t];if(!n)continue;let r=Number(t);for(let i of Ys)try{i(n,r)}catch(s){Ii.error("Error in webpack listener",s)}for(let[i,s]of Lr)try{if(i(n))Lr.delete(i),s(n,r);else if(typeof n=="object"){n.default&&i(n.default)&&(Lr.delete(i),s(n.default,r));for(let l in n)l.length<=3&&n[l]&&i(n[l])&&(Lr.delete(i),s(n[l],r))}}catch(l){Ii.error("Error while firing callback for webpack chunk",l)}}return!0}function Xs(e,...t){let n=new Error(`webpack.${e} found no module`);Ii.error(n,"Filter:",t)}function Lt(e){return Qe(()=>st(e))}function Er(e){if(typeof e!="function")throw new Error("Invalid filter. Expected a function got "+typeof e);let t=[];for(let n in In){let r=In[n];if(!!r?.exports){if(e(r.exports))t.push(r.exports);else if(typeof r.exports!="object")continue;if(r.exports.default&&e(r.exports.default))t.push(r.exports.default);else for(let i in r.exports)if(i.length<=3){let s=r.exports[i];s&&e(s)&&t.push(s)}}}return t}function fn(e,t){return Qe(()=>zg(e,t))}function yt(...e){let t=st(ce.byProps(...e),{isIndirect:!0});return t||Xs("findByProps",...e),t}function A(...e){return Qe(()=>yt(...e))}function Bt(...e){let t=st(ce.byCode(...e),{isIndirect:!0});return t||Xs("findByCode",...e),t}function to(...e){return Qe(()=>Bt(...e))}function jg(e){let t=st(ce.byStoreName(e),{isIndirect:!0});return t||Xs("findStore",e),t}function Ie(e){return Qe(()=>jg(e))}function ut(e,t){if(typeof e=="string")e=ce.byProps(e);else if(Array.isArray(e))e=ce.byProps(...e);else if(typeof e!="function")throw new Error("filter must be a string, string[] or function, got "+typeof e);let[n,r]=st(e,{isIndirect:!0,isWaitFor:!0});if(n)return void t(n,r);Lr.set(e,t)}function Hw(e){Ys.add(e)}function zw(e){Ys.delete(e)}function ic(...e){let t={},n=mn.m;e:for(let r in n){let i=n[r].original??n[r],s=i.toString();for(let l of e)if(typeof l=="string"&&!s.includes(l)||l instanceof RegExp&&!l.test(s))continue e;t[r]=i}return t}function sc(e){let t=mn.m[e];if(!t)return null;let n=` // [EXTRACTED] WebpackModule${e} // WARNING: This module was extracted to be more easily readable. // This module is NOT ACTUALLY USED! This means putting breakpoints will have NO EFFECT!! 0,${t.toString()} //# sourceURL=ExtractedWebpackModule${e} -`;return(0,eval)(n)}var tc,Ks,nc,Mn,Jn,Ke,zg,oc,Ot,rc,ic,j=g(()=>{"use strict";a();wn();ec();Ze();qs();tc=new ie("Webpack"),nc=new Promise(e=>Ks=e),Ke={byProps:(...e)=>e.length===1?t=>t[e[0]]!==void 0:t=>e.every(n=>t[n]!==void 0),byCode:(...e)=>t=>{if(typeof t!="function")return!1;let n=Function.prototype.toString.call(t);for(let r of e)if(!n.includes(r))return!1;return!0},byStoreName:e=>t=>t.constructor?.displayName===e,componentByCode:(...e)=>{let t=Ke.byCode(...e);return n=>t(n)?!0:n.$$typeof?n.type?t(n.type):n.render?t(n.render):!1:!1}},zg=new Map,oc=new Set;Ot=$n("find",function(t,{isIndirect:n=!1,isWaitFor:r=!1}={}){if(typeof t!="function")throw new Error("Invalid filter. Expected a function got "+typeof t);for(let i in Jn){let s=Jn[i];if(!!s?.exports){if(t(s.exports))return r?[s.exports,Number(i)]:s.exports;if(s.exports.default&&t(s.exports.default)){let l=s.exports.default;return r?[l,Number(i)]:l}}}return n||Mi("find",t),r?[null,null]:null});rc=$n("findBulk",function(...t){if(!Array.isArray(t))throw new Error("Invalid filters. Expected function[] got "+typeof t);let{length:n}=t;if(n===0)throw new Error("Expected at least two filters.");if(n===1)return Ot(t[0]);let r=t,i=0,s=Array(n);e:for(let l in Jn){let c=Jn[l];if(!!c?.exports)for(let u=0;u{"use strict";a();j();Xs=un(e=>e.image&&e.modal&&!e.applicationIcon),vt=I("buttonWrapper","buttonContent")});function Js(e,t){let n=function(){throw new Error(`Vencord could not find the ${e} Component`)},r=tt(()=>n);return ut(t,i=>{n=i,Object.assign(r,i)}),r}function At(e,t){ut(Ke.byStoreName(e),t)}var cc=g(()=>{"use strict";a();Qe();j()});var S,wt,R,pt,V,Ve,Qs,re,Pn,Vs,ir,Kt,Ii,Yg,In,Zg,Er,Dr,Or,Ai,_r,Gn,ew,Xg=g(()=>{"use strict";a();j();cc();S={},_r=Js("MaskedLink",e=>e?.type?.toString().includes("MASKED_LINK)")),Gn=Js("Timestamp",Ke.byCode(".Messages.MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL.format")),ew=Js("Flex",["Justify","Align","Wrap"]);ut(["FormItem","Button"],e=>{({useToken:Ai,Card:wt,Button:R,FormSwitch:pt,Tooltip:V,TextInput:Ve,TextArea:Qs,Text:re,Select:Pn,SearchableSelect:Vs,Slider:ir,ButtonLooks:Kt,TabBar:In,Popout:Ii,Dialog:Yg,Paginator:Zg,ScrollerThin:Er,Clickable:Dr,Avatar:Or}=e),S=e})});var G,dn,Jg=g(()=>{"use strict";a();j();G={};ut(["MenuItem","MenuSliderControl"],e=>G=e);dn=I("closeContextMenu","openContextMenu")});var O,J,De,Nt,Yt,Br,ea,sr,Qg=g(()=>{"use strict";a();j();sr=I("createPortal","render");ut("useState",e=>{O=e,{useEffect:De,useState:J,useMemo:Nt,useRef:Yt,useReducer:Br,useCallback:ea}=O})});var uc,Fr,Ni,Vg=g(()=>{"use strict";a();j();uc=I("MessageDisplayCompact"),Fr=I("ShowCurrentGame"),Ni=I("PreloadedUserSettingsActionCreators")});var pc,dc,An,mc,Ce,Ur,ar,Hn,tw,Te,W,nn,Pe,on,Q,ke,nt,Nn,Ci,ki,He,eh=g(()=>{"use strict";a();j();cc();pc=I("connectStores"),dc=(i=>(i[i.ChannelMessage=0]="ChannelMessage",i[i.ThreadSettings=1]="ThreadSettings",i[i.FirstThreadMessage=2]="FirstThreadMessage",i[i.ApplicationLauncherCommand=3]="ApplicationLauncherCommand",i))(dc||{}),mc=I("openPrivateChannel"),{useStateFromStores:He}=I("useStateFromStores");At("DraftStore",e=>ki=e);At("UserStore",e=>W=e);At("UserProfileStore",e=>nn=e);At("ChannelStore",e=>Q=e);At("SelectedChannelStore",e=>Pe=e);At("SelectedGuildStore",e=>on=e);At("GuildStore",e=>Te=e);At("GuildMemberStore",e=>ke=e);At("RelationshipStore",e=>nt=e);At("PermissionStore",e=>Ce=e);At("PresenceStore",e=>Hn=e);At("ReadStateStore",e=>ar=e);At("GuildChannelStore",e=>Ur=e);At("MessageStore",e=>An=e);At("WindowStore",e=>Ci=e);At("EmojiStore",e=>Nn=e)});var th={};var nh=g(()=>{"use strict";a()});var oh={};var rh=g(()=>{"use strict";a()});var ih={};var sh=g(()=>{"use strict";a()});function fn(e,t=ah.MESSAGE){ee.show({id:ee.genId(),message:e,type:t})}var F,wo,Mt,mn,lr,cr,ot,zn,Fe,rn,ah,nw,ee,Rt,Ri,ur,Zt,pr,Qn,Se,lh=g(()=>{"use strict";a();wn();j();ut(["ComponentDispatch","ComponentDispatcher"],e=>wo=e.ComponentDispatch);Mt=I("getAPIBaseURL","get"),mn=I("parseTwoDigitYear"),lr=I("highlight","registerLanguage"),cr=I("debounce","cloneDeep"),ot=un(e=>e.Messages?.["en-US"]);ut(["fromTimestamp","extractTimestamp"],e=>zn=e);ah={MESSAGE:0,SUCCESS:1,FAILURE:2,CUSTOM:3},nw={TOP:0,BOTTOM:1},ee={Type:ah,Position:nw,genId:()=>(Math.random()||Math.random()).toString(36).slice(2)};Rt=I("getUser","fetchCurrentUser"),Ri=I("showUploadFileSizeExceededError","promptToUpload"),ur=I("fetchAssetIds","getAssetImage"),Zt=I("SUPPORTS_COPY","copy"),pr=I("transitionTo","replaceWith","transitionToGuild");ut(["dispatch","subscribe"],e=>{F=e;let t=()=>{e.unsubscribe("CONNECTION_OPEN",t),Ks()};e.subscribe("CONNECTION_OPEN",t)});ut("showToast",e=>{ee.show=e.showToast,ee.pop=e.popToast});ut(["show","close"],e=>rn=e);ut("parseTopic",e=>Fe=e);ut(["open","saveAccountChanges"],e=>Qn=e);Se=yt(()=>Ot(e=>typeof e.Permissions?.ADMINISTRATOR=="bigint").Permissions)});var fc={};Be(fc,{Alerts:()=>rn,ApplicationAssetUtils:()=>ur,Avatar:()=>Or,Button:()=>R,ButtonLooks:()=>Kt,ButtonWrapperClasses:()=>vt,Card:()=>wt,ChannelStore:()=>Q,Clickable:()=>Dr,Clipboard:()=>Zt,ComponentDispatch:()=>wo,ComponentTypes:()=>th,ContextMenuApi:()=>dn,Dialog:()=>Yg,DraftStore:()=>ki,DraftType:()=>dc,EmojiStore:()=>Nn,Flex:()=>ew,Flux:()=>pc,FluxDispatcher:()=>F,Forms:()=>S,GuildChannelStore:()=>Ur,GuildMemberStore:()=>ke,GuildStore:()=>Te,MaskedLink:()=>_r,Menu:()=>G,MenuTypes:()=>oh,MessageStore:()=>An,ModalImageClasses:()=>Xs,NavigationRouter:()=>pr,Paginator:()=>Zg,Parser:()=>Fe,PermissionStore:()=>Ce,PermissionsBits:()=>Se,PoggerModeSettingsStore:()=>tw,Popout:()=>Ii,PresenceStore:()=>Hn,PrivateChannelsStore:()=>mc,React:()=>O,ReactDOM:()=>sr,ReadStateStore:()=>ar,RelationshipStore:()=>nt,RestAPI:()=>Mt,ScrollerThin:()=>Er,SearchableSelect:()=>Vs,Select:()=>Pn,SelectedChannelStore:()=>Pe,SelectedGuildStore:()=>on,SettingsRouter:()=>Qn,Slider:()=>ir,SnowflakeUtils:()=>zn,StatusSettingsStores:()=>Fr,Switch:()=>pt,TabBar:()=>In,Text:()=>re,TextAndImagesSettingsStores:()=>uc,TextArea:()=>Qs,TextInput:()=>Ve,Timestamp:()=>Gn,Toasts:()=>ee,Tooltip:()=>V,UploadHandler:()=>Ri,UserProfileStore:()=>nn,UserSettingsActionCreators:()=>Ni,UserStore:()=>W,UserUtils:()=>Rt,UtilTypes:()=>ih,WindowStore:()=>Ci,hljs:()=>lr,i18n:()=>ot,lodash:()=>cr,moment:()=>mn,showToast:()=>fn,useCallback:()=>ea,useEffect:()=>De,useMemo:()=>Nt,useReducer:()=>Br,useRef:()=>Yt,useState:()=>J,useStateFromStores:()=>He,useToken:()=>Ai});var A=g(()=>{"use strict";a();Kg();Xg();Jg();Qg();Vg();eh();nh();rh();sh();lh()});var sn,$r=g(()=>{a();sn="81fb7c6"});var ta,ch=g(()=>{a();ta="Vendicated/Vencord"});var jn,ow,gc,na,d,Gr,P=g(()=>{"use strict";a();$r();ch();jn="webpackChunkdiscord_app",ow="Vencord.Webpack.Common.React",gc=`Vencord/${sn}${ta?` (https://github.com/${ta})`:""}`,na="1026515880080842772",d=Object.freeze({Ven:{name:"Vendicated",id:343383572805058560n},Arjix:{name:"ArjixWasTaken",id:674710789138939916n},Cyn:{name:"Cynosphere",id:150745989836308480n},Megu:{name:"Megumin",id:545581357812678656n},botato:{name:"botato",id:440990343899643943n},obscurity:{name:"obscurity",id:336678828233588736n},rushii:{name:"rushii",id:295190422244950017n},Glitch:{name:"Glitchy",id:269567451199569920n},Samu:{name:"Samu",id:702973430449832038n},Animal:{name:"Animal",id:118437263754395652n},MaiKokain:{name:"Mai",id:722647978577363026n},echo:{name:"ECHO",id:712639419785412668n},katlyn:{name:"katlyn",id:250322741406859265n},nea:{name:"nea",id:310702108997320705n},Nuckyz:{name:"Nuckyz",id:235834946571337729n},D3SOX:{name:"D3SOX",id:201052085641281538n},Nickyux:{name:"Nickyux",id:427146305651998721n},mantikafasi:{name:"mantikafasi",id:287555395151593473n},Xinto:{name:"Xinto",id:423915768191647755n},JacobTm:{name:"Jacob.Tm",id:302872992097107991n},DustyAngel47:{name:"DustyAngel47",id:714583473804935238n},BanTheNons:{name:"BanTheNons",id:460478012794863637n},BigDuck:{name:"BigDuck",id:1024588272623681609n},AverageReactEnjoyer:{name:"Average React Enjoyer",id:1004904120056029256n},adryd:{name:"adryd",id:0n},Tyman:{name:"Tyman",id:487443883127472129n},afn:{name:"afn",id:420043923822608384n},KraXen72:{name:"KraXen72",id:379304073515499530n},kemo:{name:"kemo",id:299693897859465228n},dzshn:{name:"dzshn",id:310449948011528192n},Ducko:{name:"Ducko",id:506482395269169153n},jewdev:{name:"jewdev",id:222369866529636353n},Luna:{name:"Luny",id:821472922140803112n},Vap:{name:"Vap0r1ze",id:454072114492866560n},KingFish:{name:"King Fish",id:499400512559382538n},Commandtechno:{name:"Commandtechno",id:296776625432035328n},TheSun:{name:"ActuallyTheSun",id:406028027768733696n},axyie:{name:"'ax",id:273562710745284628n},pointy:{name:"pointy",id:99914384989519872n},SammCheese:{name:"Samm-Cheese",id:372148345894076416n},zt:{name:"zt",id:289556910426816513n},captain:{name:"Captain",id:347366054806159360n},nick:{name:"nick",id:347884694408265729n,badge:!1},whqwert:{name:"whqwert",id:586239091520176128n},lewisakura:{name:"lewisakura",id:96269247411400704n},RuiNtD:{name:"RuiNtD",id:157917665162297344n},hunt:{name:"hunt-g",id:222800179697287168n},cloudburst:{name:"cloudburst",id:892128204150685769n},Aria:{name:"Syncxv",id:549244932213309442n},TheKodeToad:{name:"TheKodeToad",id:706152404072267788n},LordElias:{name:"LordElias",id:319460781567639554n},juby:{name:"Juby210",id:324622488644616195n},Alyxia:{name:"Alyxia Sother",id:952185386350829688n},Remty:{name:"Remty",id:335055032204656642n},skyevg:{name:"skyevg",id:1090310844283363348n},Dziurwa:{name:"Dziurwa",id:1001086404203389018n},F53:{name:"F53",id:280411966126948353n},AutumnVN:{name:"AutumnVN",id:393694671383166998n},pylix:{name:"pylix",id:492949202121261067n},Tyler:{name:"\\\\GGTyler\\\\",id:143117463788191746n},RyanCaoDev:{name:"RyanCaoDev",id:952235800110694471n},Strencher:{name:"Strencher",id:415849376598982656n},FieryFlames:{name:"Fiery",id:890228870559698955n},KannaDev:{name:"Kanna",id:317728561106518019n},carince:{name:"carince",id:818323528755314698n},PandaNinjas:{name:"PandaNinjas",id:455128749071925248n},CatNoir:{name:"CatNoir",id:260371016348336128n},outfoxxed:{name:"outfoxxed",id:837425748435796060n},UwUDev:{name:"UwU",id:691413039156690994n},amia:{name:"amia",id:142007603549962240n},phil:{name:"phil",id:305288513941667851n},ImLvna:{name:"Luna <3",id:799319081723232267n},rad:{name:"rad",id:610945092504780823n},AndrewDLO:{name:"Andrew-DLO",id:434135504792059917n},HypedDomi:{name:"HypedDomi",id:354191516979429376n},Rini:{name:"Rini",id:1079479184478441643n},castdrian:{name:"castdrian",id:224617799434108928n},Arrow:{name:"arrow",id:958158495302176778n},bb010g:{name:"bb010g",id:72791153467990016n},Lumap:{name:"lumap",id:635383782576357407n},Dolfies:{name:"Dolfies",id:852892297661906993n},RuukuLada:{name:"RuukuLada",id:119705748346241027n},blahajZip:{name:"blahaj.zip",id:683954422241427471n},archeruwu:{name:"archer_uwu",id:160068695383736320n},ProffDea:{name:"ProffDea",id:609329952180928513n},ant0n:{name:"ant0n",id:145224646868860928n}}),Gr=(()=>Object.freeze(Object.fromEntries(Object.entries(d).filter(e=>e[1].id!==0n).map(([e,t])=>[t.id,t]))))()});function dr(e,t){for(let n in t){let r=t[n];typeof r=="object"&&!Array.isArray(r)?(e[n]??={},dr(e[n],r)):e[n]??=r}return e}function oe(...e){return e.filter(Boolean).join(" ")}function Mo(e){return new Promise(t=>setTimeout(t,e))}function gn(e,t="Copied to clipboard!"){Zt.SUPPORTS_COPY?Zt.copy(e):t="Your browser does not support copying to clipboard",ee.show({message:t,id:ee.genId(),type:ee.Type.SUCCESS})}function rw(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Li(e){for(let t in e)if(Object.hasOwn(e,t))return!1;return!0}function hc(e){try{return new URL(e)}catch{return null}}function oa(e){return e}var yc,iw,Ei,Re=g(()=>{"use strict";a();A();P();yc=e=>{let t=e.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(t.bottom<0||t.top-n>=0)};iw=navigator.userAgent.includes("Mobi"),Ei=e=>Object.hasOwn(Gr,e)});function rt(e,t){let n=Object.assign({fallbackValue:null,deps:[],onError:null},t),[r,i]=J({value:n.fallbackValue,error:null,pending:!0});return De(()=>{let s=!0;return r.pending||i({...r,pending:!0}),e().then(l=>{!s||(i({value:l,error:null,pending:!1}),n.onSuccess?.(l))}).catch(l=>{!s||(i({value:null,error:l,pending:!1}),n.onError?.(l))}),()=>void(s=!1)},n.deps),[r.value,r.error,r.pending]}function Po(e){let t=Br(n=>n+1,0);return e?t:t[1]}function Di({interval:e=1e3,deps:t=[]}){let[n,r]=J(0),i=Nt(()=>Date.now(),t);return De(()=>{let s=setInterval(()=>r(Date.now()-i),e);return()=>{r(0),clearInterval(s)}},t),n}var sw,vc,Qe=g(()=>{"use strict";a();A();Re();ec();sw=()=>null,vc=(e=!1)=>{let t=O.useRef(null),[n,r]=J(!1);return[s=>{t.current?.disconnect(),t.current=null,s&&(yc(s)&&(r(!0),e)||(t.current=new IntersectionObserver(l=>{for(let c of l)c.target===s&&(c.isIntersecting&&e?(r(!0),t.current?.disconnect(),t.current=null):r(c.isIntersecting))}),t.current.observe(s)))},n]}});var uh=g(()=>{});function hn(e){return o("div",{...e,className:oe(e.className,"vc-error-card")},e.children)}var Hr=g(()=>{"use strict";a();uh();Re()});var aw,ph,dh,Sc,_,le=g(()=>{"use strict";a();Ze();at();Qe();A();Hr();aw="#e78284",ph=new ie("React ErrorBoundary",aw),dh={},Sc=tt(()=>class extends O.PureComponent{state={error:dh,stack:"",message:""};static getDerivedStateFromError(t){let n=t?.stack??"",r=t?.message||String(t);if(t instanceof Error&&n){let i=n.indexOf(` -`);i!==-1&&(r=n.slice(0,i),n=n.slice(i+1).replace(/https:\/\/\S+\/assets\//g,""))}return{error:t,stack:n,message:r}}componentDidCatch(t,n){this.props.onError?.({error:t,errorInfo:n,props:this.props.wrappedProps}),ph.error(`A component threw an Error -`,t),ph.error("Component Stack",n.componentStack)}render(){if(this.state.error===dh)return this.props.children;if(this.props.noop)return null;if(this.props.fallback)return o(this.props.fallback,{children:this.props.children,...this.state});let t=this.props.message||"An error occurred while rendering this Component. More info can be found below and in your console.";return o(hn,{style:{overflow:"hidden"}},o("h1",null,"Oh no!"),o("p",null,t),o("code",null,this.state.message,!!this.state.stack&&o("pre",{className:q.top8},this.state.stack)))}});Sc.wrap=(e,t)=>n=>o(Sc,{...t,wrappedProps:n},o(e,{...n}));_=Sc});function ra(){return o("svg",{"aria-hidden":"true",height:"16",viewBox:"0 0 16 16",width:"16",style:{marginRight:"0.5em",transform:"translateY(2px)"}},o("path",{fill:"#db61a2","fill-rule":"evenodd",d:"M4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.565 20.565 0 008 13.393a20.561 20.561 0 003.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.75.75 0 01-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5zM8 14.25l-.345.666-.002-.001-.006-.003-.018-.01a7.643 7.643 0 01-.31-.17 22.075 22.075 0 01-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.08 22.08 0 01-3.744 2.584l-.018.01-.006.003h-.002L8 14.25zm0 0l.345.666a.752.752 0 01-.69 0L8 14.25z"}))}var bc=g(()=>{"use strict";a()});function Oi(e){return o(R,{...e,look:R.Looks.LINK,color:R.Colors.TRANSPARENT,onClick:()=>VencordNative.native.openExternal("https://github.com/sponsors/Vendicated")},o(ra,null),"Donate")}var Tc=g(()=>{"use strict";a();A();bc()});function ge(e){return e.style??={},e.style.display="flex",e.style.gap??="1em",e.style.flexDirection||=e.flexDirection,delete e.flexDirection,o("div",{...e},e.children)}var Lt=g(()=>{"use strict";a()});function _i(e,t){return ia.openModalLazy(e,t)}function je(e,t,n){return ia.openModal(e,t,n)}function Vn(e,t){return ia.closeModal(e,t)}function wc(){return ia.closeAllModals()}var Io,Cn,xc,ze,lt,et,_t,an,ia,dt=g(()=>{"use strict";a();j();Qe();Io=(i=>(i.SMALL="small",i.MEDIUM="medium",i.LARGE="large",i.DYNAMIC="dynamic",i))(Io||{}),Cn=I("ModalRoot","ModalCloseButton"),xc=tt(()=>pn("ImageModal").ImageModal),ze=tt(()=>Cn.ModalRoot),lt=tt(()=>Cn.ModalHeader),et=tt(()=>Cn.ModalContent),_t=tt(()=>Cn.ModalFooter),an=tt(()=>Cn.ModalCloseButton),ia=I("openModalLazy")});function y(e){return e}var w=g(()=>{"use strict";a()});async function mh(e=!1){Mc={};let t={};e&&(t.cache="no-cache");let r=(await fetch("https://gist.githubusercontent.com/Vendicated/51a3dd775f6920429ec6e9b735ca7f01/raw/badges.csv",t).then(i=>i.text())).trim().split(` -`);if(r.shift()!=="id,tooltip,image"){new ie("BadgeAPI").error("Invalid badges.csv file!");return}for(let i of r){let[s,l,c]=i.split(",");(Mc[s]??=[]).push({image:c,description:l})}}var lw,cw,Mc,Pc,fh=g(()=>{"use strict";a();aa();Tc();le();Lt();bc();P();Ze();at();Re();dt();w();A();lw="https://cdn.discordapp.com/attachments/1033680203433660458/1092089947126780035/favicon.png",cw={description:"Vencord Contributor",image:lw,position:0,props:{style:{borderRadius:"50%",transform:"scale(0.9)"}},shouldShow:({user:e})=>Ei(e.id),link:"https://github.com/Vendicated/Vencord"},Mc={};Pc=y({name:"BadgeAPI",description:"API to add badges to users.",authors:[d.Megu,d.Ven,d.TheSun],required:!0,patches:[{find:"Messages.PROFILE_USER_BADGES,role:",replacement:[{match:/&&(\i)\.push\(\{id:"premium".+?\}\);/,replace:"$&$1.unshift(...Vencord.Api.Badges._getBadges(arguments[0]));"},{match:/alt:" ","aria-hidden":!0,src:(?=(\i)\.src)/,replace:"...$1.props,$& $1.image??"},{match:/(?<=text:(\i)\.description,spacing:12,)children:/,replace:"children:$1.component ? () => $self.renderBadgeComponent($1) :"},{match:/href:(\i)\.link/,replace:"...($1.onClick && { onClick: $1.onClick }),$&"}]}],toolboxActions:{async"Refetch Badges"(){await mh(!0),ee.show({id:ee.genId(),message:"Successfully refetched badges!",type:ee.Type.SUCCESS})}},async start(){Vencord.Api.Badges.addBadge(cw),await mh()},renderBadgeComponent:_.wrap(e=>{let t=e.component;return o(t,{...e})},{noop:!0}),getDonorBadges(e){return Mc[e]?.map(t=>({...t,position:0,props:{style:{borderRadius:"50%",transform:"scale(0.9)"}},onClick(){let n=je(r=>o(_,{noop:!0,onError:()=>{Vn(n),VencordNative.native.openExternal("https://github.com/sponsors/Vendicated")}},o(Cn.ModalRoot,{...r},o(Cn.ModalHeader,null,o(ge,{style:{width:"100%",justifyContent:"center"}},o(S.FormTitle,{tag:"h2",style:{width:"100%",textAlign:"center",margin:0}},o(ra,null),"Vencord Donor"))),o(Cn.ModalContent,null,o(ge,null,o("img",{role:"presentation",src:"https://cdn.discordapp.com/emojis/1026533070955872337.png",alt:"",style:{margin:"auto"}}),o("img",{role:"presentation",src:"https://cdn.discordapp.com/emojis/1026533090627174460.png",alt:"",style:{margin:"auto"}})),o("div",{style:{padding:"1em"}},o(S.FormText,null,"This Badge is a special perk for Vencord Donors"),o(S.FormText,{className:q.top20},"Please consider supporting the development of Vencord by becoming a donor. It would mean a lot!!"))),o(Cn.ModalFooter,null,o(ge,{style:{width:"100%",justifyContent:"center"}},o(Oi,null))))))}}))}})});var Ic,gh=g(()=>{"use strict";a();P();w();Ic=y({name:"CommandsAPI",authors:[d.Arjix],description:"Api required by anything that uses commands",patches:[{find:',"tenor"',replacement:[{match:/(?<=\w=)(\w)(\.filter\(.{0,60}tenor)/,replace:"Vencord.Api.Commands._init($1)$2"}]},{find:"Unexpected value for option",replacement:{match:/,(\i)\.execute\((\i),(\i)\)/,replace:(e,t,n,r)=>`,Vencord.Api.Commands._handleCommand(${t}, ${n}, ${r})`}},{find:".source,children",replacement:{match:/(?<=:(.{1,3})\.displayDescription\}.{0,200}\.source,children:)[^}]+/,replace:"$1.plugin||($&)"}}]})});var Ac,hh=g(()=>{"use strict";a();P();w();Ac=y({name:"ContextMenuAPI",description:"API for adding/removing items to/from context menus.",authors:[d.Nuckyz,d.Ven],required:!0,patches:[{find:"\u266B (\u3064\uFF61\u25D5\u203F\u203F\u25D5\uFF61)\u3064 \u266A",replacement:{match:/let{navId:/,replace:"Vencord.Api.ContextMenu._patchContextMenu(arguments[0]);$&"}},{find:".Menu,{",all:!0,replacement:{match:/Menu,{(?<=\.jsxs?\)\(\i\.Menu,{)/g,replace:"$&contextMenuApiArguments:typeof arguments!=='undefined'?arguments:[],"}}]})});var Nc,yh=g(()=>{"use strict";a();P();w();Nc=y({name:"MemberListDecoratorsAPI",description:"API to add decorators to member list (both in servers and DMs)",authors:[d.TheSun,d.Ven],patches:[{find:".lostPermission)",replacement:[{match:/let\{[^}]*lostPermissionTooltipText:\i[^}]*\}=(\i),/,replace:"$&vencordProps=$1,"},{match:/decorators:.{0,100}?children:\[/,replace:"$&...(typeof vencordProps=='undefined'?[]:Vencord.Api.MemberListDecorators.__getDecorators(vencordProps)),"}]},{find:"PrivateChannel.renderAvatar",replacement:{match:/decorators:(\i\.isSystemDM\(\))\?(.+?):null/,replace:"decorators:[...Vencord.Api.MemberListDecorators.__getDecorators(arguments[0]), $1?$2:null]"}}]})});var Cc,vh=g(()=>{"use strict";a();P();w();Cc=y({name:"MessageAccessoriesAPI",description:"API to add message accessories.",authors:[d.Cyn],patches:[{find:".Messages.REMOVE_ATTACHMENT_BODY",replacement:{match:/(?<=.container\)?,children:)(\[.+?\])/,replace:"Vencord.Api.MessageAccessories._modifyAccessories($1,this.props)"}}]})});var kc,Sh=g(()=>{"use strict";a();P();w();kc=y({name:"MessageDecorationsAPI",description:"API to add decorations to messages",authors:[d.TheSun],patches:[{find:'"Message Username"',replacement:{match:/\.Messages\.GUILD_COMMUNICATION_DISABLED_BOTTOM_SHEET_TITLE.+?}\),\i(?=\])/,replace:"$&,...Vencord.Api.MessageDecorations.__addDecorationsToMessage(arguments[0])"}}]})});var Rc,bh=g(()=>{"use strict";a();P();w();Rc=y({name:"MessageEventsAPI",description:"Api required by anything using message events.",authors:[d.Arjix,d.hunt,d.Ven],patches:[{find:'"MessageActionCreators"',replacement:{match:/async editMessage\(.+?\)\{/,replace:"$&await Vencord.Api.MessageEvents._handlePreEdit(...arguments);"}},{find:".handleSendMessage=",replacement:{match:/(type:this\.props\.chatInputType.+?\.then\()(\i=>\{.+?let (\i)=\i\.\i\.parse\((\i),.+?let (\i)=\i\.\i\.getSendMessageOptionsForReply\(\i\);)(?<=\)\(({.+?})\)\.then.+?)/,replace:(e,t,n,r,i,s,l)=>`${t}async ${n}if(await Vencord.Api.MessageEvents._handlePreSend(${i}.id,${r},${l},${s}))return{shoudClear:true,shouldRefocus:true};`}},{find:'("interactionUsernameProfile',replacement:{match:/let\{id:\i}=(\i),{id:\i}=(\i);return \i\.useCallback\((\i)=>\{/,replace:(e,t,n,r)=>`const vcMsg=${t},vcChan=${n};${e}Vencord.Api.MessageEvents._handleClick(vcMsg, vcChan, ${r});`}}]})});var Lc,Th=g(()=>{"use strict";a();P();w();Lc=y({name:"MessagePopoverAPI",description:"API to add buttons to message popovers.",authors:[d.KingFish,d.Ven,d.Nuckyz],patches:[{find:"Messages.MESSAGE_UTILITIES_A11Y_LABEL",replacement:{match:/\i&&!\i\?\(0,\i\.jsxs?\)\(.{0,200}renderEmojiPicker:.{0,500}\?(\i)\(\{key:"reply-other"/,replace:(e,t)=>{let n=e.match(/message:(.{1,3}),/)?.[1];if(!n)throw new Error("Could not find message variable");return`...Vencord.Api.MessagePopover._buildPopoverElements(${n},${t}),${e}`}}}]})});var Ec,xh=g(()=>{"use strict";a();P();w();Ec=y({name:"NoticesAPI",description:"Fixes notices being automatically dismissed",authors:[d.Ven],required:!0,patches:[{find:'displayName="NoticeStore"',replacement:[{match:/\i=null;(?=.{0,80}getPremiumSubscription\(\))/g,replace:"if(Vencord.Api.Notices.currentNotice)return false;$&"},{match:/(?<=,NOTICE_DISMISS:function\(\i\){)return null!=(\i)/,replace:'if($1.id=="VencordNotice")return($1=null,Vencord.Api.Notices.nextNotice(),true);$&'}]}]})});var Dc,wh=g(()=>{"use strict";a();P();w();Dc=y({name:"ServerListAPI",authors:[d.kemo],description:"Api required for plugins that modify the server list",patches:[{find:"Messages.DISCODO_DISABLED",replacement:{match:/(?<=Messages\.DISCODO_DISABLED.+?return)(\(.{0,75}?tutorialContainer.+?}\))(?=}function)/,replace:"[$1].concat(Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.Above))"}},{find:"Messages.SERVERS,children",replacement:{match:/(?<=Messages\.SERVERS,children:).+?default:return null\}\}\)/,replace:"Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.In).concat($&)"}}]})});var Oc,Mh=g(()=>{"use strict";a();P();w();Oc=y({name:"NoTrack",description:"Disable Discord's tracking ('science'), metrics and Sentry crash reporting",authors:[d.Cyn,d.Ven,d.Nuckyz,d.Arrow],required:!0,patches:[{find:"AnalyticsActionHandlers.handle",replacement:{match:/^.+$/,replace:"()=>{}"}},{find:"window.DiscordSentry=",replacement:{match:/^.+$/,replace:"()=>{}"}},{find:".METRICS,",replacement:[{match:/this\._intervalId=/,replace:"this._intervalId=undefined&&"},{match:/(increment\(\i\){)/,replace:"$1return;"}]},{find:".installedLogHooks)",replacement:{match:"getDebugLogging(){",replace:"getDebugLogging(){return false;"}}]})});var Bc={};Be(Bc,{_patchContextMenu:()=>dw,addContextMenuPatch:()=>ce,addGlobalContextMenuPatch:()=>uw,findGroupChildrenByChildId:()=>mt,globalPatches:()=>la,navPatches:()=>Bi,removeContextMenuPatch:()=>de,removeGlobalContextMenuPatch:()=>pw});function ce(e,t){Array.isArray(e)||(e=[e]);for(let n of e){let r=Bi.get(n);r||(r=new Set,Bi.set(n,r)),r.add(t)}}function uw(e){la.add(e)}function de(e,t){let r=(Array.isArray(e)?e:[e]).map(i=>Bi.get(i)?.delete(t)??!1);return Array.isArray(e)?r:r[0]}function pw(e){return la.delete(e)}function mt(e,t,n){for(let r of t){if(r==null)continue;if(Array.isArray(e)&&e.some(s=>r.props?.id===s)||r.props?.id===e)return n??null;let i=r.props?.children;if(i){Array.isArray(i)||(i=[i],r.props.children=i);let s=mt(e,i,i);if(s!==null)return s}}return null}function dw(e){e.contextMenuApiArguments??=[];let t=Bi.get(e.navId);if(Array.isArray(e.children)||(e.children=[e.children]),t)for(let n of t)try{let r=n(e.children,...e.contextMenuApiArguments);_c.has(e)||r?.()}catch(r){Ph.error(`Patch for ${e.navId} errored,`,r)}for(let n of la)try{let r=n(e.navId,e.children,...e.contextMenuApiArguments);_c.has(e)||r?.()}catch(r){Ph.error("Global patch errored,",r)}_c.add(e)}var Ph,Bi,la,_c,Pt=g(()=>{"use strict";a();Ze();Ph=new ie("ContextMenu"),Bi=new Map,la=new Set;_c=new WeakSet});function yn(e,t=300){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}var zr=g(()=>{"use strict";a()});var mr,ca=g(()=>{"use strict";a();({localStorage:mr}=window)});var kn,jr=g(()=>{"use strict";a();kn=class{constructor(t=1/0){this.maxSize=t}queue=[];promise;next(){let t=this.queue.shift();t?this.promise=Promise.resolve().then(t).finally(()=>this.next()):this.promise=void 0}run(){this.promise||this.next()}push(t){this.size>=this.maxSize&&this.queue.shift(),this.queue.push(t),this.run()}unshift(t){this.size>=this.maxSize&&this.queue.pop(),this.queue.unshift(t),this.run()}get size(){return this.queue.length}}});var Ih=g(()=>{});var ua,Fc=g(()=>{"use strict";a();Ih();$();le();Re();A();ua=_.wrap(function({title:t,body:n,richBody:r,color:i,icon:s,onClick:l,onClose:c,image:u,permanent:p,className:m,dismissOnClick:h}){let{timeout:v,position:T}=ct(["notifications.timeout","notifications.position"]).notifications,M=He([Ci],()=>Ci.isFocused()),[b,x]=J(!1),[N,k]=J(0),B=Nt(()=>Date.now(),[v,b,M]);De(()=>{if(b||!M||v===0||p)return void k(0);let Y=setInterval(()=>{let K=Date.now()-B;K>=v?c():k(K)},10);return()=>clearInterval(Y)},[v,b,M]);let U=N/v;return o("button",{className:oe("vc-notification-root",m),style:T==="bottom-right"?{bottom:"1rem"}:{top:"3rem"},onClick:()=>{l?.(),h!==!1&&c()},onContextMenu:Y=>{Y.preventDefault(),Y.stopPropagation(),c()},onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1)},o("div",{className:"vc-notification"},s&&o("img",{className:"vc-notification-icon",src:s,alt:""}),o("div",{className:"vc-notification-content"},o("div",{className:"vc-notification-header"},o("h2",{className:"vc-notification-title"},t),o("button",{className:"vc-notification-close-btn",onClick:Y=>{Y.preventDefault(),Y.stopPropagation(),c()}},o("svg",{width:"24",height:"24",viewBox:"0 0 24 24",role:"img","aria-labelledby":"vc-notification-dismiss-title"},o("title",{id:"vc-notification-dismiss-title"},"Dismiss Notification"),o("path",{fill:"currentColor",d:"M18.4 4L12 10.4L5.6 4L4 5.6L10.4 12L4 18.4L5.6 20L12 13.6L18.4 20L20 18.4L13.6 12L20 5.6L18.4 4Z"})))),o("div",null,r??o("p",{className:"vc-notification-p"},n)))),u&&o("img",{className:"vc-notification-img",src:u,alt:""}),v!==0&&!p&&o("div",{className:"vc-notification-progressbar",style:{width:`${(1-U)*100}%`,backgroundColor:i||"var(--brand-experiment)"}}))},{onError:({props:e})=>e.onClose()})});var eo={};Be(eo,{clear:()=>hw,createStore:()=>Ah,del:()=>$c,delMany:()=>gw,entries:()=>Sw,get:()=>It,getMany:()=>fw,keys:()=>yw,promisifyRequest:()=>Bt,set:()=>Xt,setMany:()=>mw,update:()=>fr,values:()=>vw});function Bt(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function Ah(e,t){let n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);let r=Bt(n);return(i,s)=>r.then(l=>s(l.transaction(t,i).objectStore(t)))}function Rn(){return Uc||(Uc=Ah("VencordData","VencordStore")),Uc}function It(e,t=Rn()){return t("readonly",n=>Bt(n.get(e)))}function Xt(e,t,n=Rn()){return n("readwrite",r=>(r.put(t,e),Bt(r.transaction)))}function mw(e,t=Rn()){return t("readwrite",n=>(e.forEach(r=>n.put(r[1],r[0])),Bt(n.transaction)))}function fw(e,t=Rn()){return t("readonly",n=>Promise.all(e.map(r=>Bt(n.get(r)))))}function fr(e,t,n=Rn()){return n("readwrite",r=>new Promise((i,s)=>{r.get(e).onsuccess=function(){try{r.put(t(this.result),e),i(Bt(r.transaction))}catch(l){s(l)}}}))}function $c(e,t=Rn()){return t("readwrite",n=>(n.delete(e),Bt(n.transaction)))}function gw(e,t=Rn()){return t("readwrite",n=>(e.forEach(r=>n.delete(r)),Bt(n.transaction)))}function hw(e=Rn()){return e("readwrite",t=>(t.clear(),Bt(t.transaction)))}function Gc(e,t){return e.openCursor().onsuccess=function(){!this.result||(t(this.result),this.result.continue())},Bt(e.transaction)}function yw(e=Rn()){return e("readonly",t=>{if(t.getAllKeys)return Bt(t.getAllKeys());let n=[];return Gc(t,r=>n.push(r.key)).then(()=>n)})}function vw(e=Rn()){return e("readonly",t=>{if(t.getAll)return Bt(t.getAll());let n=[];return Gc(t,r=>n.push(r.value)).then(()=>n)})}function Sw(e=Rn()){return e("readonly",t=>{if(t.getAll&&t.getAllKeys)return Promise.all([Bt(t.getAllKeys()),Bt(t.getAll())]).then(([r,i])=>r.map((s,l)=>[s,i[l]]));let n=[];return e("readonly",r=>Gc(r,i=>n.push([i.key,i.value])).then(()=>n))})}var Uc,Wn=g(()=>{"use strict";a();});var jc={};Be(jc,{classNameFactory:()=>Ue,classNameToSelector:()=>Ch,compileStyle:()=>zc,disableStyle:()=>Ft,enableStyle:()=>St,isStyleEnabled:()=>Hc,requireStyle:()=>Fi,setStyleClassNames:()=>Tw,styleMap:()=>Nh,toggleStyle:()=>bw});function Fi(e){let t=Nh.get(e);if(!t)throw new Error(`Style "${e}" does not exist`);return t}function St(e){let t=Fi(e);return t.dom?.isConnected?!1:(t.dom||(t.dom=document.createElement("style"),t.dom.dataset.vencordName=t.name),zc(t),document.head.appendChild(t.dom),!0)}function Ft(e){let t=Fi(e);return t.dom?.isConnected?(t.dom.remove(),t.dom=null,!0):!1}var Nh,bw,Hc,Tw,zc,Ch,Ue,Je=g(()=>{"use strict";a();Nh=window.VencordStyles??=new Map;bw=e=>Hc(e)?Ft(e):St(e),Hc=e=>Fi(e).dom?.isConnected??!1,Tw=(e,t,n=!0)=>{let r=Fi(e);r.classNames=t,n&&Hc(r.name)&&zc(r)},zc=e=>{if(!e.dom)throw new Error("Style has no DOM element");e.dom.textContent=e.source.replace(/\[--(\w+)\]/g,(t,n)=>{let r=e.classNames[n];return r?Ch(r):t})},Ch=(e,t="")=>e.split(" ").map(n=>`.${t}${n}`).join(""),Ue=(e="")=>(...t)=>{let n=new Set;for(let r of t)r&&typeof r=="string"?n.add(r):Array.isArray(r)?r.forEach(i=>n.add(i)):r&&typeof r=="object"&&Object.entries(r).forEach(([i,s])=>s&&n.add(i));return Array.from(n,r=>e+r).join(" ")}});var kh,Rh=g(()=>{a();kh=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"")});async function Eh(e){if(e.noPersist)return;let t=E.notifications.logLimit;t!==0&&(await fr(pa,n=>{let r=n??[],{onClick:i,onClose:s,richBody:l,permanent:c,noPersist:u,dismissOnClick:p,...m}=e;return r.unshift({...m,timestamp:Date.now(),id:kh()}),r.length>t&&t!==200&&(r.length=t),r}),Ui.forEach(n=>n()))}async function xw(e){let t=await Lh(),n=t.findIndex(r=>r.timestamp===e);n!==-1&&(t.splice(n,1),await Xt(pa,t),Ui.forEach(r=>r()))}function ww(){let[e,t]=Br(s=>s+1,0);De(()=>(Ui.add(t),()=>void Ui.delete(t)),[]);let[n,r,i]=rt(Lh,{fallbackValue:[],deps:[e]});return[n,i]}function Mw({data:e}){let[t,n]=J(!1),r=O.useRef(null);return De(()=>{let i=r.current,s=()=>{if(i.clientHeight===0)return requestAnimationFrame(s);i.style.height=`${i.clientHeight}px`};s()},[]),o("div",{className:Wr("wrapper",{removing:t}),ref:r},o(ua,{...e,permanent:!0,dismissOnClick:!1,onClose:()=>{t||(n(!0),setTimeout(()=>xw(e.timestamp),200))},richBody:o("div",{className:Wr("body")},e.body,o(Gn,{timestamp:mn(e.timestamp),className:Wr("timestamp")}))}))}function Pw({log:e,pending:t}){return!e.length&&!t?o("div",{className:Wr("container")},o("div",{className:Wr("empty")}),o(S.FormText,{style:{textAlign:"center"}},"No notifications yet")):o("div",{className:Wr("container")},e.map(n=>o(Mw,{data:n,key:n.id})))}function Iw({modalProps:e,close:t}){let[n,r]=ww();return o(ze,{...e,size:"large"},o(lt,null,o(re,{variant:"heading-lg/semibold",style:{flexGrow:1}},"Notification Log"),o(an,{onClick:t})),o(et,null,o(Pw,{log:n,pending:r})),o(_t,null,o(R,{disabled:n.length===0,onClick:()=>{rn.show({title:"Are you sure?",body:`This will permanently remove ${n.length} notification${n.length===1?"":"s"}. This action cannot be undone.`,async onConfirm(){await Xt(pa,[]),Ui.forEach(i=>i())},confirmText:"Do it!",confirmColor:"vc-notification-log-danger-btn",cancelText:"Nevermind"})}},"Clear Notification Log")))}function da(){let e=je(t=>o(Iw,{modalProps:t,close:()=>Vn(e)}))}var pa,Lh,Wr,Ui,ma=g(()=>{"use strict";a();Wn();$();Je();dt();Qe();A();Rh();Fc();pa="notification-log",Lh=async()=>await It(pa)??[],Wr=Ue("vc-notification-log-"),Ui=new Set});function Cw(){if(!Wc){let e=document.createElement("div");e.id="vc-notification-container",document.body.append(e),Wc=sr.createRoot(e)}return Wc}function kw(e,t){let n=Cw();return new Promise(r=>{n.render(o(ua,{key:t,...e,onClose:()=>{e.onClose?.(),n.render(null),r()}}))})}function Rw(){if(typeof Notification>"u")return!1;let{useNative:e}=E.notifications;return e==="always"?!0:e==="not-focused"?!document.hasFocus():!1}async function Dh(){return Notification.permission==="granted"||Notification.permission!=="denied"&&await Notification.requestPermission()==="granted"}async function Ie(e){if(Eh(e),Rw()&&await Dh()){let{title:t,body:n,icon:r,image:i,onClick:s=null,onClose:l=null}=e,c=new Notification(t,{body:n,icon:r,image:i});c.onclick=s,c.onclose=l}else Aw.push(()=>kw(e,Nw++))}var Aw,Wc,Nw,Oh=g(()=>{"use strict";a();$();jr();A();Fc();ma();Aw=new kn,Nw=42});var qc={};Be(qc,{requestPermission:()=>Dh,showNotification:()=>Ie});var Ao=g(()=>{"use strict";a();Oh()});function jh(e,t){return Gw(e,t||{},0,0)}function Wh(e,t){return Fw(e,t)}var Ut,Jt,fa,ga,ha,Xc,Uh,$h,Gh,Jc,Hh,Lw,_h,Qc,to,Le,qn,Co,Le,Le,Le,Le,Hi,Le,Ew,Dw,Ow,_w,Kc,Ln,Yc,tu,zh,Bw,No,Fw,no,$i,Zc,Vc,Bh,Gi,eu,Fh,Uw,nu,$w,Gw,Hw,zw,qh=g(()=>{a();Ut=Uint8Array,Jt=Uint16Array,fa=Uint32Array,ga=new Ut([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ha=new Ut([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Xc=new Ut([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Uh=function(e,t){for(var n=new Jt(31),r=0;r<31;++r)n[r]=t+=1<>>1|(Le&21845)<<1,to=(to&52428)>>>2|(to&13107)<<2,to=(to&61680)>>>4|(to&3855)<<4,Qc[Le]=((to&65280)>>>8|(to&255)<<8)>>>1;qn=function(e,t,n){for(var r=e.length,i=0,s=new Jt(t);i>>u]=p}else for(c=new Jt(r),i=0;i>>15-e[i]);return c},Co=new Ut(288);for(Le=0;Le<144;++Le)Co[Le]=8;for(Le=144;Le<256;++Le)Co[Le]=9;for(Le=256;Le<280;++Le)Co[Le]=7;for(Le=280;Le<288;++Le)Co[Le]=8;Hi=new Ut(32);for(Le=0;Le<32;++Le)Hi[Le]=5;Ew=qn(Co,9,0),Dw=qn(Co,9,1),Ow=qn(Hi,5,0),_w=qn(Hi,5,1),Kc=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},Ln=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},Yc=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},tu=function(e){return(e+7)/8|0},zh=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e.BYTES_PER_ELEMENT==2?Jt:e.BYTES_PER_ELEMENT==4?fa:Ut)(n-t);return r.set(e.subarray(t,n)),r},Bw=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],No=function(e,t,n){var r=new Error(t||Bw[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,No),!n)throw r;return r},Fw=function(e,t,n){var r=e.length;if(!r||n&&n.f&&!n.l)return t||new Ut(0);var i=!t||n,s=!n||n.i;n||(n={}),t||(t=new Ut(r*3));var l=function(Vo){var So=t.length;if(Vo>So){var bo=new Ut(Math.max(So*2,Vo));bo.set(t),t=bo}},c=n.f||0,u=n.p||0,p=n.b||0,m=n.l,h=n.d,v=n.m,T=n.n,M=r*8;do{if(!m){c=Ln(e,u,1);var b=Ln(e,u+1,3);if(u+=3,b)if(b==1)m=Dw,h=_w,v=9,T=5;else if(b==2){var B=Ln(e,u,31)+257,U=Ln(e,u+10,15)+4,Y=B+Ln(e,u+5,31)+1;u+=14;for(var K=new Ut(Y),z=new Ut(19),L=0;L>>4;if(x<16)K[L++]=x;else{var Ae=0,me=0;for(x==16?(me=3+Ln(e,u,3),u+=2,Ae=K[L-1]):x==17?(me=3+Ln(e,u,7),u+=3):x==18&&(me=11+Ln(e,u,127),u+=7);me--;)K[L++]=Ae}}var ye=K.subarray(0,B),xe=K.subarray(B);v=Kc(ye),T=Kc(xe),m=qn(ye,v,1),h=qn(xe,T,1)}else No(1);else{var x=tu(u)+4,N=e[x-4]|e[x-3]<<8,k=x+N;if(k>r){s&&No(0);break}i&&l(p+N),t.set(e.subarray(x,k),p),n.b=p+=N,n.p=u=k*8,n.f=c;continue}if(u>M){s&&No(0);break}}i&&l(p+131072);for(var we=(1<>>4;if(u+=Ae&15,u>M){s&&No(0);break}if(Ae||No(2),gt<256)t[p++]=gt;else if(gt==256){pe=u,m=null;break}else{var Ye=gt-254;if(gt>264){var L=gt-257,Ne=ga[L];Ye=Ln(e,u,(1<>>4;qt||No(3),u+=qt&15;var xe=Lw[Tt];if(Tt>3){var Ne=ha[Tt];xe+=Yc(e,u)&(1<M){s&&No(0);break}i&&l(p+131072);for(var ht=p+Ye;p>>8},$i=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Zc=function(e,t){for(var n=[],r=0;rv&&(v=s[r].s);var T=new Jt(v+1),M=Vc(n[m-1],T,0);if(M>t){var r=0,b=0,x=M-t,N=1<t)b+=N-(1<>>=x;b>0;){var B=s[r].s;T[B]=0&&b;--r){var U=s[r].s;T[U]==t&&(--T[U],++b)}M=t}return[new Ut(T),M]},Vc=function(e,t,n){return e.s==-1?Math.max(Vc(e.l,t,n+1),Vc(e.r,t,n+1)):t[e.s]=n},Bh=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Jt(++t),r=0,i=e[0],s=1,l=function(u){n[r++]=u},c=1;c<=t;++c)if(e[c]==i&&c!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)l(32754);s>2&&(l(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(l(i),--s;s>6;s-=6)l(8304);s>2&&(l(s-3<<5|8208),s=0)}for(;s--;)l(i);s=1,i=e[c]}return[n.subarray(0,r),t]},Gi=function(e,t){for(var n=0,r=0;r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var s=0;s4&&!ne[Xc[ae-1]];--ae);var Ae=p+5<<3,me=Gi(i,Co)+Gi(s,Hi)+l,ye=Gi(i,v)+Gi(s,b)+l+14+3*ae+Gi(z,ne)+(2*z[16]+3*z[17]+7*z[18]);if(Ae<=me&&Ae<=ye)return eu(t,m,e.subarray(u,u+p));var xe,we,ve,pe;if(no(t,m,1+(ye15&&(no(t,m,qt[L]>>>5&127),m+=qt[L]>>>12)}}else xe=Ew,we=Co,ve=Ow,pe=Hi;for(var L=0;L255){var Tt=r[L]>>>18&31;$i(t,m,xe[Tt+257]),m+=we[Tt+257],Tt>7&&(no(t,m,r[L]>>>23&31),m+=ga[Tt]);var ht=r[L]&31;$i(t,m,ve[ht]),m+=pe[ht],ht>3&&($i(t,m,r[L]>>>5&8191),m+=ha[ht])}else $i(t,m,xe[r[L]]),m+=we[r[L]];return $i(t,m,xe[256]),m+we[256]},Uw=new fa([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nu=new Ut(0),$w=function(e,t,n,r,i,s){var l=e.length,c=new Ut(r+l+5*(1+Math.ceil(l/7e3))+i),u=c.subarray(r,c.length-i),p=0;if(!t||l<8)for(var m=0;m<=l;m+=65535){var h=m+65535;h>=l&&(u[p>>3]=s),p=eu(u,p+1,e.subarray(m,h))}else{for(var v=Uw[t-1],T=v>>>13,M=v&8191,b=(1<7e3||ne>24576)&&xe>423){p=Fh(e,u,0,Y,K,z,X,ne,ae,m-ae,p),ne=L=X=0,ae=m;for(var we=0;we<286;++we)K[we]=0;for(var we=0;we<30;++we)z[we]=0}var ve=2,pe=0,gt=M,Ye=me-ye&32767;if(xe>2&&Ae==U(m-Ye))for(var Ne=Math.min(T,xe)-1,qt=Math.min(32767,m),Tt=Math.min(258,xe);Ye<=qt&&--gt&&me!=ye;){if(e[m+ve]==e[m+ve-Ye]){for(var ht=0;htve){if(ve=ht,pe=Ye,ht>Ne)break;for(var Vo=Math.min(Ye,ht-2),So=0,we=0;weSo&&(So=kt,ye=bo)}}}me=ye,ye=x[me],Ye+=me-ye+32768&32767}if(pe){Y[ne++]=268435456|Jc[ve]<<18|_h[pe];var tr=Jc[ve]&31,C=_h[pe]&31;X+=ga[tr]+ha[C],++K[257+tr],++z[C],be=m+ve,++L}else Y[ne++]=e[m],++K[e[m]]}}p=Fh(e,u,s,Y,K,z,X,ne,ae,m-ae,p),!s&&p&7&&(p=eu(u,p+1,nu))}return zh(c,0,r+tu(p)+i)},Gw=function(e,t,n,r,i){return $w(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,n,r,!i)};Hw=typeof TextDecoder<"u"&&new TextDecoder,zw=0;try{Hw.decode(nu,{stream:!0}),zw=1}catch{}});async function Kh(){let e=await It("Vencord_cloudSecret")??{},t=ou();return e[t]?(await fr("Vencord_cloudSecret",n=>(n??={},n[`${t}:${zi()}`]=n[t],delete n[t],n)),e[t]):e[`${t}:${zi()}`]}async function jw(e){await fr("Vencord_cloudSecret",t=>(t??={},t[`${ou()}:${zi()}`]=e,t))}async function ru(){await fr("Vencord_cloudSecret",e=>(e??={},delete e[`${ou()}:${zi()}`],e))}async function Yh(){if(await Kh()!==void 0){E.cloud.authenticated=!0;return}try{let r=await fetch(new URL("/v1/oauth/settings",ko()));var{clientId:e,redirectUri:t}=await r.json()}catch{Ie({title:"Cloud Integration",body:"Setup failed (couldn't retrieve OAuth configuration)."}),E.cloud.authenticated=!1;return}let{OAuth2AuthorizeModal:n}=pn("OAuth2AuthorizeModal");je(r=>o(n,{...r,scopes:["identify"],responseType:"code",redirectUri:t,permissions:0n,clientId:e,cancelCompletesFlow:!1,callback:async({location:i})=>{if(!i){E.cloud.authenticated=!1;return}try{let s=await fetch(i,{headers:new Headers({Accept:"application/json"})}),{secret:l}=await s.json();l?(ya.info("Authorized with secret"),await jw(l),Ie({title:"Cloud Integration",body:"Cloud integrations enabled!"}),E.cloud.authenticated=!0):(Ie({title:"Cloud Integration",body:"Setup failed (no secret returned?)."}),E.cloud.authenticated=!1)}catch(s){ya.error("Failed to authorize",s),Ie({title:"Cloud Integration",body:`Setup failed (${s.toString()}).`}),E.cloud.authenticated=!1}}}))}async function qr(){let e=await Kh();return window.btoa(`${e}:${zi()}`)}var ya,ko,ou,zi,iu=g(()=>{"use strict";a();Wn();Ao();$();j();A();Ze();dt();ya=new ie("Cloud","#39b7e0"),ko=()=>new URL(E.cloud.url),ou=()=>ko().origin,zi=()=>{let e=W.getCurrentUser()?.id;if(!e)throw new Error("User not yet logged in");return e}});function ln(){window.VesktopNative.app.relaunch()}function va(e){window.VesktopNative.fileManager.showItemInFolder(e)}var Ro=g(()=>{"use strict";a()});function Sa(e){let t=document.createElement("a");t.href=URL.createObjectURL(e),t.download=e.name,document.body.appendChild(t),t.click(),setImmediate(()=>{URL.revokeObjectURL(t.href),document.body.removeChild(t)})}function ba(e){return new Promise(t=>{let n=document.createElement("input");n.type="file",n.style.display="none",n.accept=e,n.onchange=async()=>{t(n.files?.[0]??null)},document.body.appendChild(n),n.click(),setImmediate(()=>document.body.removeChild(n))})}var Ta=g(()=>{"use strict";a()});async function Zh(e){try{var t=JSON.parse(e)}catch(n){throw console.log(e),new Error("Failed to parse JSON: "+String(n))}if("settings"in t&&"quickCss"in t)Object.assign(Kn,t.settings),await VencordNative.settings.set(JSON.stringify(t.settings,null,4)),await VencordNative.quickCss.set(t.quickCss);else throw new Error("Invalid Settings. Is this even a Vencord Settings file?")}async function Xh({minify:e}={}){let t=JSON.parse(VencordNative.settings.get()),n=await VencordNative.quickCss.get();return JSON.stringify({settings:t,quickCss:n},null,e?void 0:4)}async function Jh(){let e="vencord-settings-backup.json",t=await Xh(),n=new TextEncoder().encode(t);Sa(new File([n],e,{type:"application/json"}))}async function Vh(e=!0){if(!1){if(t)try{}catch(n){}}else{let t=await ba("application/json");if(!t)return;let n=new FileReader;n.onload=async()=>{try{await Zh(n.result),e&&Ww()}catch(r){new ie("SettingsSync").error(r),e&&qw(r)}},n.readAsText(t)}}async function Kr(e){let t=await Xh({minify:!0});try{let n=await fetch(new URL("/v1/settings",ko()),{method:"PUT",headers:new Headers({Authorization:await qr(),"Content-Type":"application/octet-stream"}),body:jh(new TextEncoder().encode(t))});if(!n.ok){En.error(`Failed to sync up, API returned ${n.status}`),Ie({title:"Cloud Settings",body:`Could not synchronize settings to cloud (API returned ${n.status}).`,color:"var(--red-360)"});return}let{written:r}=await n.json();Kn.cloud.settingsSyncVersion=r,VencordNative.settings.set(JSON.stringify(Kn,null,4)),En.info("Settings uploaded to cloud successfully"),e&&Ie({title:"Cloud Settings",body:"Synchronized settings to the cloud!",noPersist:!0})}catch(n){En.error("Failed to sync up",n),Ie({title:"Cloud Settings",body:`Could not synchronize settings to the cloud (${n.toString()}).`,color:"var(--red-360)"})}}async function xa(e=!0,t=!1){try{let n=await fetch(new URL("/v1/settings",ko()),{method:"GET",headers:new Headers({Authorization:await qr(),Accept:"application/octet-stream","If-None-Match":E.cloud.settingsSyncVersion.toString()})});if(n.status===404)return En.info("No settings on the cloud"),e&&Ie({title:"Cloud Settings",body:"There are no settings in the cloud.",noPersist:!0}),!1;if(n.status===304)return En.info("Settings up to date"),e&&Ie({title:"Cloud Settings",body:"Your settings are up to date.",noPersist:!0}),!1;if(!n.ok)return En.error(`Failed to sync down, API returned ${n.status}`),Ie({title:"Cloud Settings",body:`Could not synchronize settings from the cloud (API returned ${n.status}).`,color:"var(--red-360)"}),!1;let r=Number(n.headers.get("etag")),i=E.cloud.settingsSyncVersion;if(!t&&r{"use strict";a();Ao();$();A();qh();iu();Ze();Ro();Ta();Qh=(e,t)=>ee.show({type:e,message:t,id:ee.genId()}),Ww=()=>Qh(ee.Type.SUCCESS,"Settings successfully imported. Restart to apply changes!"),qw=e=>Qh(ee.Type.FAILURE,`Failed to import settings: ${String(e)}`);En=new ie("Cloud:Settings","#39b7e0")});var au={};Be(au,{PlainSettings:()=>Kn,Settings:()=>E,addSettingsListener:()=>Wi,definePluginSettings:()=>D,migratePluginSettings:()=>Yw,useSettings:()=>ct});function su(e,t=e,n=""){return ny[n]??=new Proxy(e,{get(r,i){let s=r[i];if(!(i in r)){if(n==="plugins"&&i in Oe)return r[i]=su({enabled:Oe[i].required??Oe[i].enabledByDefault??!1},t,`plugins.${i}`);if(n.startsWith("plugins.")){let l=n.slice(8);if(l in Oe){let c=Oe[l].options?.[i];if(!c)return s;if("default"in c)return r[i]=c.default;if(c.type===4){let u=c.options.find(p=>p.default);return u&&(r[i]=u.value),u?.value}}}return s}return typeof s=="object"&&!Array.isArray(s)&&s!==null?su(s,t,`${n}${n&&"."}${i}`):s},set(r,i,s){if(r[i]===s)return!0;r[i]=s;let l=`${n}${n&&"."}${i}`;delete ny[l];for(let c of wa)(!c._paths||c._paths.includes(l))&&c(s,l);return Kn.cloud.settingsSyncVersion=Date.now(),mr.Vencord_settingsDirty=!0,Kw(),VencordNative.settings.set(JSON.stringify(t,null,4)),!0}})}function ct(e){let[,t]=O.useReducer(()=>({}),{}),n=e?(r,i)=>e.includes(i)&&t():t;return O.useEffect(()=>(wa.add(n),()=>void wa.delete(n)),[]),E}function Wi(e,t){e&&(t._paths??=[]).push(e),wa.add(t)}function Yw(e,...t){let{plugins:n}=Lo;if(!(e in n)){for(let r of t)if(r in n){oy.info(`Migrating settings from old name ${r} to ${e}`),n[e]=n[r],delete n[r],VencordNative.settings.set(JSON.stringify(Lo,null,4));break}}}function D(e,t){let n={get store(){if(!n.pluginName)throw new Error("Cannot access settings before plugin is initialized");return E.plugins[n.pluginName]},use:r=>ct(r?.map(i=>`plugins.${n.pluginName}.${i}`)).plugins[n.pluginName],def:e,checks:t??{},pluginName:"",withPrivateSettings(){return this}};return n}var oy,ty,Lo,Kw,wa,ny,Kn,E,$=g(()=>{"use strict";a();zr();ca();Ze();Re();ji();w();A();gr();oy=new ie("Settings"),ty={notifyAboutUpdates:!0,autoUpdate:!1,autoUpdateNotification:!0,useQuickCss:!0,themeLinks:[],enabledThemes:[],enableReactDevtools:!1,frameless:!1,transparent:!1,winCtrlQ:!1,macosTranslucency:!1,disableMinSize:!1,winNativeTitleBar:!1,plugins:{},notifications:{timeout:5e3,position:"bottom-right",useNative:"not-focused",logLimit:50},cloud:{authenticated:!1,url:"https://api.vencord.dev/",settingsSync:!1,settingsSyncVersion:0}};try{Lo=JSON.parse(VencordNative.settings.get()),dr(Lo,ty)}catch(e){Lo=dr({},ty),oy.error(`An error occurred while loading the settings. Corrupt settings file? -`,e)}Kw=yn(async()=>{E.cloud.settingsSync&&E.cloud.authenticated&&(await Kr(),delete mr.Vencord_settingsDirty)},6e4),wa=new Set,ny={};Kn=Lo,E=su(Lo)});var ry=g(()=>{});var iy=g(()=>{});var cu={};Be(cu,{UpdateLogger:()=>hr,changes:()=>Eo,checkForUpdates:()=>Zr,getRepo:()=>lu,isNewer:()=>qi,isOutdated:()=>Do,maybePromptToUpdate:()=>Ki,update:()=>Xr,updateError:()=>Yr});async function Ma(e){let t=await e;if(t.ok)return t.value;throw Yr=t.error,t.error}async function Zr(){return Eo=await Ma(VencordNative.updater.getUpdates()),Eo.some(e=>e.hash===sn)?(qi=!0,Do=!1):Do=Eo.length>0}async function Xr(){if(!Do)return!0;let e=await Ma(VencordNative.updater.update());if(e&&(Do=!1,!await Ma(VencordNative.updater.rebuild())))throw new Error("The Build failed. Please try manually building the new update");return e}async function Ki(e,t=!1){try{if(await Zr()){let r=confirm(e);if(r&&qi)return alert("Your local copy has more recent commits. Please stash or reset them.");r&&(await Xr(),ln())}}catch(n){hr.error(n),alert("That also failed :( Try updating or re-installing with the installer!")}}var hr,Do,qi,Yr,Eo,lu,yr=g(()=>{"use strict";a();$r();Ze();Ro();hr=new ie("Updater","white"),Do=!1,qi=!1;lu=()=>Ma(VencordNative.updater.getRepo())});function sy(){Ki("Uh Oh! Failed to render this Page. However, there is an update available that might fix it. Would you like to update and restart now?")}var ay=g(()=>{"use strict";a();yr()});function uu(e){let t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments))}}var pu=g(()=>{"use strict";a()});function vn({title:e,children:t}){return o(S.FormSection,null,o(re,{variant:"heading-lg/semibold",tag:"h2",className:q.bottom16},e),t)}function Sn(e,t){return _.wrap(e,{message:`Failed to render the ${t} tab. If this issue persists, try using the installer to reinstall!`,onError:Zw})}var Zw,Oo=g(()=>{"use strict";a();ry();iy();le();ay();at();pu();A();Zw=uu(sy)});var py={};Be(py,{default:()=>Vw});function Xw(){let[e,,t]=rt(VencordNative.settings.getSettingsDir,{fallbackValue:"Loading..."}),n=ct(),r=O.useMemo(()=>Math.random()>.5?cy:uy,[]),i=navigator.platform.toLowerCase().startsWith("win"),s=navigator.platform.toLowerCase().startsWith("mac"),l=[{key:"useQuickCss",title:"Enable Custom CSS",note:"Loads your Custom CSS"},{key:"enableReactDevtools",title:"Enable React Developer Tools",note:"Requires a full restart"},{key:"frameless",title:"Disable the window frame",note:"Requires a full restart"},!1,i&&{key:"winCtrlQ",title:"Register Ctrl+Q as shortcut to close Discord (Alternative to Alt+F4)",note:"Requires a full restart"},!1,!1];return o(vn,{title:"Vencord Settings"},o(Qw,{image:r}),o(S.FormSection,{title:"Quick Actions"},o(wt,{className:ly("quick-actions-card")},o(O.Fragment,null,o(R,{onClick:ln,size:R.Sizes.SMALL},"Restart Client"),o(R,{onClick:()=>VencordNative.quickCss.openEditor(),size:R.Sizes.SMALL,disabled:e==="Loading..."},"Open QuickCSS File"),o(R,{onClick:()=>va(e),size:R.Sizes.SMALL,disabled:t},"Open Settings Folder"),o(R,{onClick:()=>VencordNative.native.openExternal("https://github.com/Vendicated/Vencord"),size:R.Sizes.SMALL,disabled:t},"Open in GitHub")))),o(S.FormDivider,null),o(S.FormSection,{className:q.top16,title:"Settings",tag:"h5"},o(S.FormText,{className:q.bottom20},'Hint: You can change the position of this settings section in the settings of the "Settings" plugin!'),l.map(c=>c&&o(pt,{key:c.key,value:n[c.key],onChange:u=>n[c.key]=u,note:c.note},c.title))),typeof Notification<"u"&&o(Jw,{settings:n.notifications}))}function Jw({settings:e}){return o(f,null,o(S.FormTitle,{tag:"h5"},"Notification Style"),e.useNative!=="never"&&Notification?.permission==="denied"&&o(hn,{style:{padding:"1em"},className:q.bottom8},o(S.FormTitle,{tag:"h5"},"Desktop Notification Permission denied"),o(S.FormText,null,"You have denied Notification Permissions. Thus, Desktop notifications will not work!")),o(S.FormText,{className:q.bottom8},"Some plugins may show you notifications. These come in two styles:",o("ul",null,o("li",null,o("strong",null,"Vencord Notifications"),": These are in-app notifications"),o("li",null,o("strong",null,"Desktop Notifications"),": Native Desktop notifications (like when you get a ping)"))),o(Pn,{placeholder:"Notification Style",options:[{label:"Only use Desktop notifications when Discord is not focused",value:"not-focused",default:!0},{label:"Always use Desktop notifications",value:"always"},{label:"Always use Vencord notifications",value:"never"}],closeOnSelect:!0,select:t=>e.useNative=t,isSelected:t=>t===e.useNative,serialize:oa}),o(S.FormTitle,{tag:"h5",className:q.top16+" "+q.bottom8},"Notification Position"),o(Pn,{isDisabled:e.useNative==="always",placeholder:"Notification Position",options:[{label:"Bottom Right",value:"bottom-right",default:!0},{label:"Top Right",value:"top-right"}],select:t=>e.position=t,isSelected:t=>t===e.position,serialize:oa}),o(S.FormTitle,{tag:"h5",className:q.top16+" "+q.bottom8},"Notification Timeout"),o(S.FormText,{className:q.bottom16},"Set to 0s to never automatically time out"),o(ir,{disabled:e.useNative==="always",markers:[0,1e3,2500,5e3,1e4,2e4],minValue:0,maxValue:2e4,initialValue:e.timeout,onValueChange:t=>e.timeout=t,onValueRender:t=>(t/1e3).toFixed(2)+"s",onMarkerRender:t=>t/1e3+"s",stickToMarkers:!1}),o(S.FormTitle,{tag:"h5",className:q.top16+" "+q.bottom8},"Notification Log Limit"),o(S.FormText,{className:q.bottom16},"The amount of notifications to save in the log until old ones are removed. Set to ",o("code",null,"0")," to disable Notification log and ",o("code",null,"\u221E")," to never automatically remove old Notifications"),o(ir,{markers:[0,25,50,75,100,200],minValue:0,maxValue:200,stickToMarkers:!0,initialValue:e.logLimit,onValueChange:t=>e.logLimit=t,onValueRender:t=>t===200?"\u221E":t,onMarkerRender:t=>t===200?"\u221E":t}),o(R,{onClick:da,disabled:e.logLimit===0},"Open Notification Log"))}function Qw({image:e}){return o(wt,{className:ly("card","donate")},o("div",null,o(S.FormTitle,{tag:"h5"},"Support the Project"),o(S.FormText,null,"Please consider supporting the development of Vencord by donating!"),o(Oi,{style:{transform:"translateX(-1em)"}})),o("img",{role:"presentation",src:e,alt:"",height:128,style:{imageRendering:e===uy?"pixelated":void 0,marginLeft:"auto",transform:e===cy?"rotate(10deg)":void 0}}))}var ly,cy,uy,Vw,dy=g(()=>{"use strict";a();ma();$();Je();Tc();Hr();at();Re();Ro();Qe();A();Oo();ly=Ue("vc-settings-"),cy="https://cdn.discordapp.com/emojis/1026533090627174460.png",uy="https://media.discordapp.net/stickers/1039992459209490513.png";Vw=Sn(Xw,"Vencord Settings")});var my=g(()=>{});var gu={};Be(gu,{currentNotice:()=>Yi,nextNotice:()=>fy,noticesQueue:()=>mu,popNotice:()=>fu,showNotice:()=>Zi});function fu(){du.dismiss()}function fy(){Yi=mu.shift(),Yi&&du.show(...Yi,"VencordNotice")}function Zi(e,t,n){mu.push(["GENERIC",e,t,n]),Yi||fy()}var du,mu,Yi,Pa=g(()=>{"use strict";a();j();ut(e=>e.show&&e.dismiss&&!e.suppressAll,e=>du=e);mu=[],Yi=null});var gy=g(()=>{});function cn({height:e=24,width:t=24,className:n,children:r,viewBox:i,...s}){return o("svg",{className:oe(n,"vc-icon"),role:"img",width:t,height:e,viewBox:i,...s},r)}function Jr({height:e=24,width:t=24,className:n}){return o(cn,{height:e,width:t,className:oe(n,"vc-link-icon"),viewBox:"0 0 24 24"},o("g",{fill:"none","fill-rule":"evenodd"},o("path",{fill:"currentColor",d:"M10.59 13.41c.41.39.41 1.03 0 1.42-.39.39-1.03.39-1.42 0a5.003 5.003 0 0 1 0-7.07l3.54-3.54a5.003 5.003 0 0 1 7.07 0 5.003 5.003 0 0 1 0 7.07l-1.49 1.49c.01-.82-.12-1.64-.4-2.42l.47-.48a2.982 2.982 0 0 0 0-4.24 2.982 2.982 0 0 0-4.24 0l-3.53 3.53a2.982 2.982 0 0 0 0 4.24zm2.82-4.24c.39-.39 1.03-.39 1.42 0a5.003 5.003 0 0 1 0 7.07l-3.54 3.54a5.003 5.003 0 0 1-7.07 0 5.003 5.003 0 0 1 0-7.07l1.49-1.49c-.01.82.12 1.64.4 2.43l-.47.47a2.982 2.982 0 0 0 0 4.24 2.982 2.982 0 0 0 4.24 0l3.53-3.53a2.982 2.982 0 0 0 0-4.24.973.973 0 0 1 0-1.42z"}),o("rect",{width:t,height:e})))}function hy(e){return o(cn,{...e,className:oe(e.className,"vc-copy-icon"),viewBox:"0 0 24 24"},o("g",{fill:"currentColor"},o("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1z"}),o("path",{d:"M15 5H8c-1.1 0-1.99.9-1.99 2L6 21c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V11l-6-6zM8 21V7h6v5h5v9H8z"})))}function Xi(e){return o(cn,{...e,className:oe(e.className,"vc-open-external-icon"),viewBox:"0 0 24 24"},o("polygon",{fill:"currentColor",fillRule:"nonzero",points:"13 20 11 20 11 8 5.5 13.5 4.08 12.08 12 4.16 19.92 12.08 18.5 13.5 13 8"}))}function vr(e){return o(cn,{...e,className:oe(e.className,"vc-image-icon"),viewBox:"0 0 24 24"},o("path",{fill:"currentColor",d:"M21,19V5c0,-1.1 -0.9,-2 -2,-2H5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2zM8.5,13.5l2.5,3.01L14.5,12l4.5,6H5l3.5,-4.5z"}))}function Ia(e){return o(cn,{...e,className:oe(e.className,"vc-info-icon"),viewBox:"0 0 24 24"},o("path",{fill:"currentColor",transform:"translate(2 2)",d:"M9,7 L11,7 L11,5 L9,5 L9,7 Z M10,18 C5.59,18 2,14.41 2,10 C2,5.59 5.59,2 10,2 C14.41,2 18,5.59 18,10 C18,14.41 14.41,18 10,18 L10,18 Z M10,4.4408921e-16 C4.4771525,-1.77635684e-15 4.4408921e-16,4.4771525 0,10 C-1.33226763e-15,12.6521649 1.0535684,15.195704 2.92893219,17.0710678 C4.80429597,18.9464316 7.3478351,20 10,20 C12.6521649,20 15.195704,18.9464316 17.0710678,17.0710678 C18.9464316,15.195704 20,12.6521649 20,10 C20,7.3478351 18.9464316,4.80429597 17.0710678,2.92893219 C15.195704,1.0535684 12.6521649,2.22044605e-16 10,0 L10,4.4408921e-16 Z M9,15 L11,15 L11,9 L9,9 L9,15 L9,15 Z"}))}function yy(e){return o(cn,{"aria-label":ot.Messages.GUILD_OWNER,...e,className:oe(e.className,"vc-owner-crown-icon"),role:"img",viewBox:"0 0 16 16"},o("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M13.6572 5.42868C13.8879 5.29002 14.1806 5.30402 14.3973 5.46468C14.6133 5.62602 14.7119 5.90068 14.6473 6.16202L13.3139 11.4954C13.2393 11.7927 12.9726 12.0007 12.6666 12.0007H3.33325C3.02725 12.0007 2.76058 11.792 2.68592 11.4954L1.35258 6.16202C1.28792 5.90068 1.38658 5.62602 1.60258 5.46468C1.81992 5.30468 2.11192 5.29068 2.34325 5.42868L5.13192 7.10202L7.44592 3.63068C7.46173 3.60697 7.48377 3.5913 7.50588 3.57559C7.5192 3.56612 7.53255 3.55663 7.54458 3.54535L6.90258 2.90268C6.77325 2.77335 6.77325 2.56068 6.90258 2.43135L7.76458 1.56935C7.89392 1.44002 8.10658 1.44002 8.23592 1.56935L9.09792 2.43135C9.22725 2.56068 9.22725 2.77335 9.09792 2.90268L8.45592 3.54535C8.46794 3.55686 8.48154 3.56651 8.49516 3.57618C8.51703 3.5917 8.53897 3.60727 8.55458 3.63068L10.8686 7.10202L13.6572 5.42868ZM2.66667 12.6673H13.3333V14.0007H2.66667V12.6673Z"}))}function vy(e){return o(cn,{...e,className:oe(e.className,"vc-screenshare-icon"),viewBox:"0 0 24 24"},o("path",{fill:"currentColor",d:"M2 4.5C2 3.397 2.897 2.5 4 2.5H20C21.103 2.5 22 3.397 22 4.5V15.5C22 16.604 21.103 17.5 20 17.5H13V19.5H17V21.5H7V19.5H11V17.5H4C2.897 17.5 2 16.604 2 15.5V4.5ZM13.2 14.3375V11.6C9.864 11.6 7.668 12.6625 6 15C6.672 11.6625 8.532 8.3375 13.2 7.6625V5L18 9.6625L13.2 14.3375Z"}))}function Aa(e){return o(cn,{...e,className:oe(e.className,"vc-image-visible"),viewBox:"0 0 24 24"},o("path",{fill:"currentColor",d:"M5 21q-.825 0-1.413-.587Q3 19.825 3 19V5q0-.825.587-1.413Q4.175 3 5 3h14q.825 0 1.413.587Q21 4.175 21 5v14q0 .825-.587 1.413Q19.825 21 19 21Zm0-2h14V5H5v14Zm1-2h12l-3.75-5-3 4L9 13Zm-1 2V5v14Z"}))}function Na(e){return o(cn,{...e,className:oe(e.className,"vc-image-invisible"),viewBox:"0 0 24 24"},o("path",{fill:"currentColor",d:"m21 18.15-2-2V5H7.85l-2-2H19q.825 0 1.413.587Q21 4.175 21 5Zm-1.2 4.45L18.2 21H5q-.825 0-1.413-.587Q3 19.825 3 19V5.8L1.4 4.2l1.4-1.4 18.4 18.4ZM6 17l3-4 2.25 3 .825-1.1L5 7.825V19h11.175l-2-2Zm7.425-6.425ZM10.6 13.4Z"}))}function Sy(e){return o(cn,{...e,className:oe(e.className,"vc-microphone"),viewBox:"0 0 24 24"},o("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.99 11C14.99 12.66 13.66 14 12 14C10.34 14 9 12.66 9 11V5C9 3.34 10.34 2 12 2C13.66 2 15 3.34 15 5L14.99 11ZM12 16.1C14.76 16.1 17.3 14 17.3 11H19C19 14.42 16.28 17.24 13 17.72V21H11V17.72C7.72 17.23 5 14.41 5 11H6.7C6.7 14 9.24 16.1 12 16.1ZM12 4C11.2 4 11 4.66667 11 5V11C11 11.3333 11.2 12 12 12C12.8 12 13 11.3333 13 11V5C13 4.66667 12.8 4 12 4Z",fill:"currentColor"}),o("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.99 11C14.99 12.66 13.66 14 12 14C10.34 14 9 12.66 9 11V5C9 3.34 10.34 2 12 2C13.66 2 15 3.34 15 5L14.99 11ZM12 16.1C14.76 16.1 17.3 14 17.3 11H19C19 14.42 16.28 17.24 13 17.72V22H11V17.72C7.72 17.23 5 14.41 5 11H6.7C6.7 14 9.24 16.1 12 16.1Z",fill:"currentColor"}))}function by(e){return o(cn,{...e,className:oe(e.className,"vc-cog-wheel"),viewBox:"0 0 24 24"},o("path",{clipRule:"evenodd",fill:"currentColor",d:"M19.738 10H22V14H19.739C19.498 14.931 19.1 15.798 18.565 16.564L20 18L18 20L16.565 18.564C15.797 19.099 14.932 19.498 14 19.738V22H10V19.738C9.069 19.498 8.203 19.099 7.436 18.564L6 20L4 18L5.436 16.564C4.901 15.799 4.502 14.932 4.262 14H2V10H4.262C4.502 9.068 4.9 8.202 5.436 7.436L4 6L6 4L7.436 5.436C8.202 4.9 9.068 4.502 10 4.262V2H14V4.261C14.932 4.502 15.797 4.9 16.565 5.435L18 3.999L20 5.999L18.564 7.436C19.099 8.202 19.498 9.069 19.738 10ZM12 16C14.2091 16 16 14.2091 16 12C16 9.79086 14.2091 8 12 8C9.79086 8 8 9.79086 8 12C8 14.2091 9.79086 16 12 16Z"}))}function hu(e){return o(cn,{...e,className:oe(e.className,"vc-reply-icon"),viewBox:"0 0 24 24"},o("path",{fill:"currentColor",d:"M10 8.26667V4L3 11.4667L10 18.9333V14.56C15 14.56 18.5 16.2667 21 20C20 14.6667 17 9.33333 10 8.26667Z"}))}function Ty(e){return o(cn,{...e,className:oe(e.className,"vc-delete-icon"),viewBox:"0 0 24 24"},o("path",{fill:"currentColor",d:"M15 3.999V2H9V3.999H3V5.999H21V3.999H15Z"}),o("path",{fill:"currentColor",d:"M5 6.99902V18.999C5 20.101 5.897 20.999 7 20.999H17C18.103 20.999 19 20.101 19 18.999V6.99902H5ZM11 17H9V11H11V17ZM15 17H13V11H15V17Z"}))}var $t=g(()=>{"use strict";a();gy();Re();A()});function xy(e,t,n){return n===!1?t?e.slice(0,-1):e:e[0]}function Ji(e,t,n=!1){let r=mn.duration(e,t),i=aM.map(u=>({amount:r[u](),unit:u})),s=0;e:for(let u=0;uu==="days");if(l!==-1){let u=i[l],p=u.amount%7;p===0?i.splice(l,1):u.amount=p}let c="";for(;i.length;){let{amount:u,unit:p}=i.shift();c.length&&(c+=i.length?", ":" and "),(u>0||c.length)&&(c+=`${u} ${xy(p,u===1,n)}`)}return c.length?c:`0 ${xy(t,!1,n)}`}function lM(e,t=n=>n){let{length:n}=e;if(n===0)return"";if(n===1)return t(e[0]);let r="";for(let i=0;i2?r+=", ":n-i>1&&(r+=" and ");return r}function Qi(e,t){let n="```";return`${n}${t||""} +`;return(0,eval)(n)}var Ii,Ks,oc,mn,In,ce,Lr,Ys,st,rc,Hg,zg,j=g(()=>{"use strict";a();Zt();Je();qs();Ii=new ie("Webpack"),oc=new Promise(e=>Ks=e),ce={byProps:(...e)=>e.length===1?t=>t[e[0]]!==void 0:t=>e.every(n=>t[n]!==void 0),byCode:(...e)=>t=>{if(typeof t!="function")return!1;let n=Function.prototype.toString.call(t);for(let r of e)if(!n.includes(r))return!1;return!0},byStoreName:e=>t=>t.constructor?.displayName===e},Lr=new Map,Ys=new Set;st=Pn("find",function(t,{isIndirect:n=!1,isWaitFor:r=!1}={}){if(typeof t!="function")throw new Error("Invalid filter. Expected a function got "+typeof t);for(let i in In){let s=In[i];if(!!s?.exports){if(t(s.exports))return r?[s.exports,Number(i)]:s.exports;if(typeof s.exports=="object"){if(s.exports.default&&t(s.exports.default)){let l=s.exports.default;return r?[l,Number(i)]:l}for(let l in s.exports)if(l.length<=3){let c=s.exports[l];if(c&&t(c))return r?[c,Number(i)]:c}}}}return n||Xs("find",t),r?[null,null]:null});rc=Pn("findBulk",function(...t){if(!Array.isArray(t))throw new Error("Invalid filters. Expected function[] got "+typeof t);let{length:n}=t;if(n===0)throw new Error("Expected at least two filters.");if(n===1)return st(t[0]);let r=t,i=0,s=Array(n);e:for(let l in In){let c=In[l];if(!!c?.exports)for(let u=0;u{"use strict";a();j();Js=Lt(e=>e.image&&e.modal&&!e.applicationIcon),vt=A("buttonWrapper","buttonContent")});function Qs(e,t){let n=function(){throw new Error(`Vencord could not find the ${e} Component`)},r=me(()=>n);return ut(t,i=>{n=i,Object.assign(r,i)}),r}function At(e,t){ut(ce.byStoreName(e),t)}var ac=g(()=>{"use strict";a();Oe();j()});var S,xt,E,pt,V,et,Vs,oe,An,ea,ir,Xt,Ai,qg,Nn,Kg,Dr,Or,_r,Ni,Br,Hn,Ww,Yg=g(()=>{"use strict";a();j();ac();S={},Br=Qs("MaskedLink",e=>e?.type?.toString().includes("MASKED_LINK)")),Hn=Qs("Timestamp",ce.byCode(".Messages.MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL.format")),Ww=Qs("Flex",["Justify","Align","Wrap"]);ut(["FormItem","Button"],e=>{({useToken:Ni,Card:xt,Button:E,FormSwitch:pt,Tooltip:V,TextInput:et,TextArea:Vs,Text:oe,Select:An,SearchableSelect:ea,Slider:ir,ButtonLooks:Xt,TabBar:Nn,Popout:Ai,Dialog:qg,Paginator:Kg,ScrollerThin:Dr,Clickable:Or,Avatar:_r}=e),S=e})});var U,gn,Zg=g(()=>{"use strict";a();j();U={};ut(["MenuItem","MenuSliderControl"],e=>U=e);gn=fn('type:"CONTEXT_MENU_OPEN"',{open:ce.byCode("stopPropagation"),openLazy:e=>e.toString().length<50,close:ce.byCode("CONTEXT_MENU_CLOSE")})});var O,J,_e,Nt,Jt,Fr,ta,sr,Xg=g(()=>{"use strict";a();j();sr=A("createPortal","render");ut("useState",e=>{O=e,{useEffect:_e,useState:J,useMemo:Nt,useRef:Jt,useReducer:Fr,useCallback:ta}=O})});var lc,Ur,Ci,Jg=g(()=>{"use strict";a();j();lc=A("MessageDisplayCompact"),Ur=A("ShowCurrentGame"),Ci=A("PreloadedUserSettingsActionCreators")});var cc,uc,Cn,pc,Re,$r,ar,zn,qw,we,W,rn,Ae,sn,Q,Le,nt,kn,ki,Ri,Kw,We,Qg=g(()=>{"use strict";a();Zt();j();ac();cc=A("connectStores"),uc=(i=>(i[i.ChannelMessage=0]="ChannelMessage",i[i.ThreadSettings=1]="ThreadSettings",i[i.FirstThreadMessage=2]="FirstThreadMessage",i[i.ApplicationLauncherCommand=3]="ApplicationLauncherCommand",i))(uc||{}),pc=A("openPrivateChannel"),Kw=fn('"MaskedLinkStore"',{openUntrustedLink:ce.byCode(".apply(this,arguments)")}),We=Qe(()=>yt("useStateFromStores").useStateFromStores);At("DraftStore",e=>Ri=e);At("UserStore",e=>W=e);At("UserProfileStore",e=>rn=e);At("ChannelStore",e=>Q=e);At("SelectedChannelStore",e=>Ae=e);At("SelectedGuildStore",e=>sn=e);At("GuildStore",e=>we=e);At("GuildMemberStore",e=>Le=e);At("RelationshipStore",e=>nt=e);At("PermissionStore",e=>Re=e);At("PresenceStore",e=>zn=e);At("ReadStateStore",e=>ar=e);At("GuildChannelStore",e=>$r=e);At("MessageStore",e=>Cn=e);At("WindowStore",e=>ki=e);At("EmojiStore",e=>kn=e)});var Vg={};var eh=g(()=>{"use strict";a()});var th={};var nh=g(()=>{"use strict";a()});var oh={};var rh=g(()=>{"use strict";a()});function yn(e,t=ih.MESSAGE){ee.show({id:ee.genId(),message:e,type:t})}var B,Gr,wt,hn,lr,cr,Ct,jn,$e,an,ih,Yw,ee,Et,Li,ur,Qt,pr,no,Te,sh=g(()=>{"use strict";a();Zt();j();ut(["ComponentDispatch","ComponentDispatcher"],e=>Gr=e.ComponentDispatch);wt=A("getAPIBaseURL","get"),hn=A("parseTwoDigitYear"),lr=A("highlight"),cr=A("debounce","cloneDeep"),Ct=Lt(e=>e.Messages?.["en-US"]);ut(["fromTimestamp","extractTimestamp"],e=>jn=e);ih={MESSAGE:0,SUCCESS:1,FAILURE:2,CUSTOM:3},Yw={TOP:0,BOTTOM:1},ee={Type:ih,Position:Yw,genId:()=>(Math.random()||Math.random()).toString(36).slice(2)};Et=A("getUser","fetchCurrentUser"),Li=A("showUploadFileSizeExceededError","promptToUpload"),ur=A("fetchAssetIds","getAssetImage"),Qt=fn('document.queryCommandEnabled("copy")||document.queryCommandSupported("copy")',{copy:ce.byCode(".copy("),SUPPORTS_COPY:e=>typeof e=="boolean"}),pr=fn("transitionToGuild - ",{transitionTo:ce.byCode("transitionTo -"),transitionToGuild:ce.byCode("transitionToGuild -"),goBack:ce.byCode("goBack()"),goForward:ce.byCode("goForward()")});ut(["dispatch","subscribe"],e=>{B=e;let t=()=>{e.unsubscribe("CONNECTION_OPEN",t),Ks()};e.subscribe("CONNECTION_OPEN",t)});ut("showToast",e=>{ee.show=e.showToast,ee.pop=e.popToast});ut(["show","close"],e=>an=e);ut("parseTopic",e=>$e=e);ut(["open","saveAccountChanges"],e=>no=e);Te=Qe(()=>st(e=>typeof e.Permissions?.ADMINISTRATOR=="bigint").Permissions)});var dc={};Ue(dc,{Alerts:()=>an,ApplicationAssetUtils:()=>ur,Avatar:()=>_r,Button:()=>E,ButtonLooks:()=>Xt,ButtonWrapperClasses:()=>vt,Card:()=>xt,ChannelStore:()=>Q,Clickable:()=>Or,Clipboard:()=>Qt,ComponentDispatch:()=>Gr,ComponentTypes:()=>Vg,ContextMenu:()=>gn,Dialog:()=>qg,DraftStore:()=>Ri,DraftType:()=>uc,EmojiStore:()=>kn,Flex:()=>Ww,Flux:()=>cc,FluxDispatcher:()=>B,Forms:()=>S,GuildChannelStore:()=>$r,GuildMemberStore:()=>Le,GuildStore:()=>we,MaskedLink:()=>Br,MaskedLinkStore:()=>Kw,Menu:()=>U,MenuTypes:()=>th,MessageStore:()=>Cn,ModalImageClasses:()=>Js,NavigationRouter:()=>pr,Paginator:()=>Kg,Parser:()=>$e,PermissionStore:()=>Re,PermissionsBits:()=>Te,PoggerModeSettingsStore:()=>qw,Popout:()=>Ai,PresenceStore:()=>zn,PrivateChannelsStore:()=>pc,React:()=>O,ReactDOM:()=>sr,ReadStateStore:()=>ar,RelationshipStore:()=>nt,RestAPI:()=>wt,ScrollerThin:()=>Dr,SearchableSelect:()=>ea,Select:()=>An,SelectedChannelStore:()=>Ae,SelectedGuildStore:()=>sn,SettingsRouter:()=>no,Slider:()=>ir,SnowflakeUtils:()=>jn,StatusSettingsStores:()=>Ur,Switch:()=>pt,TabBar:()=>Nn,Text:()=>oe,TextAndImagesSettingsStores:()=>lc,TextArea:()=>Vs,TextInput:()=>et,Timestamp:()=>Hn,Toasts:()=>ee,Tooltip:()=>V,UploadHandler:()=>Li,UserProfileStore:()=>rn,UserSettingsActionCreators:()=>Ci,UserStore:()=>W,UserUtils:()=>Et,UtilTypes:()=>oh,WindowStore:()=>ki,hljs:()=>lr,i18n:()=>Ct,lodash:()=>cr,moment:()=>hn,showToast:()=>yn,useCallback:()=>ta,useEffect:()=>_e,useMemo:()=>Nt,useReducer:()=>Fr,useRef:()=>Jt,useState:()=>J,useStateFromStores:()=>We,useToken:()=>Ni});var I=g(()=>{"use strict";a();Wg();Yg();Zg();Xg();Jg();Qg();eh();nh();rh();sh()});var ln,Hr=g(()=>{a();ln="96126fa"});var na,ah=g(()=>{a();na="Vendicated/Vencord"});var Wn,Zw,mc,oa,p,zr,P=g(()=>{"use strict";a();Hr();ah();Wn="webpackChunkdiscord_app",Zw="Vencord.Webpack.Common.React",mc=`Vencord/${ln}${na?` (https://github.com/${na})`:""}`,oa="1026515880080842772",p=Object.freeze({Ven:{name:"Vendicated",id:343383572805058560n},Arjix:{name:"ArjixWasTaken",id:674710789138939916n},Cyn:{name:"Cynosphere",id:150745989836308480n},Megu:{name:"Megumin",id:545581357812678656n},botato:{name:"botato",id:440990343899643943n},obscurity:{name:"obscurity",id:336678828233588736n},rushii:{name:"rushii",id:295190422244950017n},Glitch:{name:"Glitchy",id:269567451199569920n},Samu:{name:"Samu",id:702973430449832038n},Animal:{name:"Animal",id:118437263754395652n},MaiKokain:{name:"Mai",id:722647978577363026n},echo:{name:"ECHO",id:712639419785412668n},katlyn:{name:"katlyn",id:250322741406859265n},nea:{name:"nea",id:310702108997320705n},Nuckyz:{name:"Nuckyz",id:235834946571337729n},D3SOX:{name:"D3SOX",id:201052085641281538n},Nickyux:{name:"Nickyux",id:427146305651998721n},mantikafasi:{name:"mantikafasi",id:287555395151593473n},Xinto:{name:"Xinto",id:423915768191647755n},JacobTm:{name:"Jacob.Tm",id:302872992097107991n},DustyAngel47:{name:"DustyAngel47",id:714583473804935238n},BanTheNons:{name:"BanTheNons",id:460478012794863637n},BigDuck:{name:"BigDuck",id:1024588272623681609n},AverageReactEnjoyer:{name:"Average React Enjoyer",id:1004904120056029256n},adryd:{name:"adryd",id:0n},Tyman:{name:"Tyman",id:487443883127472129n},afn:{name:"afn",id:420043923822608384n},KraXen72:{name:"KraXen72",id:379304073515499530n},kemo:{name:"kemo",id:299693897859465228n},dzshn:{name:"dzshn",id:310449948011528192n},Ducko:{name:"Ducko",id:506482395269169153n},jewdev:{name:"jewdev",id:222369866529636353n},Luna:{name:"Luny",id:821472922140803112n},Vap:{name:"Vap0r1ze",id:454072114492866560n},KingFish:{name:"King Fish",id:499400512559382538n},Commandtechno:{name:"Commandtechno",id:296776625432035328n},TheSun:{name:"ActuallyTheSun",id:406028027768733696n},axyie:{name:"'ax",id:273562710745284628n},pointy:{name:"pointy",id:99914384989519872n},SammCheese:{name:"Samm-Cheese",id:372148345894076416n},zt:{name:"zt",id:289556910426816513n},captain:{name:"Captain",id:347366054806159360n},nick:{name:"nick",id:347884694408265729n,badge:!1},whqwert:{name:"whqwert",id:586239091520176128n},lewisakura:{name:"lewisakura",id:96269247411400704n},RuiNtD:{name:"RuiNtD",id:157917665162297344n},hunt:{name:"hunt-g",id:222800179697287168n},cloudburst:{name:"cloudburst",id:892128204150685769n},Aria:{name:"Syncxv",id:549244932213309442n},TheKodeToad:{name:"TheKodeToad",id:706152404072267788n},LordElias:{name:"LordElias",id:319460781567639554n},juby:{name:"Juby210",id:324622488644616195n},Alyxia:{name:"Alyxia Sother",id:952185386350829688n},Remty:{name:"Remty",id:335055032204656642n},skyevg:{name:"skyevg",id:1090310844283363348n},Dziurwa:{name:"Dziurwa",id:1001086404203389018n},AutumnVN:{name:"AutumnVN",id:393694671383166998n},pylix:{name:"pylix",id:492949202121261067n},Tyler:{name:"\\\\GGTyler\\\\",id:143117463788191746n},RyanCaoDev:{name:"RyanCaoDev",id:952235800110694471n},Strencher:{name:"Strencher",id:415849376598982656n},FieryFlames:{name:"Fiery",id:890228870559698955n},KannaDev:{name:"Kanna",id:317728561106518019n},carince:{name:"carince",id:818323528755314698n},PandaNinjas:{name:"PandaNinjas",id:455128749071925248n},CatNoir:{name:"CatNoir",id:260371016348336128n},outfoxxed:{name:"outfoxxed",id:837425748435796060n},UwUDev:{name:"UwU",id:691413039156690994n},amia:{name:"amia",id:142007603549962240n},phil:{name:"phil",id:305288513941667851n},ImLvna:{name:"Luna <3",id:799319081723232267n},rad:{name:"rad",id:610945092504780823n},AndrewDLO:{name:"Andrew-DLO",id:434135504792059917n},HypedDomi:{name:"HypedDomi",id:354191516979429376n},Rini:{name:"Rini",id:1079479184478441643n},castdrian:{name:"castdrian",id:224617799434108928n},Arrow:{name:"arrow",id:958158495302176778n},bb010g:{name:"bb010g",id:72791153467990016n},Lumap:{name:"lumap",id:635383782576357407n},Dolfies:{name:"Dolfies",id:852892297661906993n},RuukuLada:{name:"RuukuLada",id:119705748346241027n},blahajZip:{name:"blahaj.zip",id:683954422241427471n},archeruwu:{name:"archer_uwu",id:160068695383736320n},ProffDea:{name:"ProffDea",id:609329952180928513n},ant0n:{name:"ant0n",id:145224646868860928n}}),zr=(()=>Object.freeze(Object.fromEntries(Object.entries(p).filter(e=>e[1].id!==0n).map(([e,t])=>[t.id,t]))))()});function dr(e,t){for(let n in t){let r=t[n];typeof r=="object"&&!Array.isArray(r)?(e[n]??={},dr(e[n],r)):e[n]??=r}return e}function re(...e){return e.filter(Boolean).join(" ")}function No(e){return new Promise(t=>setTimeout(t,e))}function vn(e,t="Copied to clipboard!"){Qt.SUPPORTS_COPY?Qt.copy(e):t="Your browser does not support copying to clipboard",ee.show({message:t,id:ee.genId(),type:ee.Type.SUCCESS})}function Xw(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ei(e){for(let t in e)if(Object.hasOwn(e,t))return!1;return!0}function fc(e){try{return new URL(e)}catch{return null}}function ra(e){return e}var gc,Jw,Di,Be=g(()=>{"use strict";a();I();P();gc=e=>{let t=e.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(t.bottom<0||t.top-n>=0)};Jw=navigator.userAgent.includes("Mobi"),Di=e=>Object.hasOwn(zr,e)});function ot(e,t){let n=Object.assign({fallbackValue:null,deps:[],onError:null},t),[r,i]=J({value:n.fallbackValue,error:null,pending:!0});return _e(()=>{let s=!0;return r.pending||i({...r,pending:!0}),e().then(l=>{!s||(i({value:l,error:null,pending:!1}),n.onSuccess?.(l))}).catch(l=>{!s||(i({value:null,error:l,pending:!1}),n.onError?.(l))}),()=>void(s=!1)},n.deps),[r.value,r.error,r.pending]}function qn(e){let t=Fr(n=>n+1,0);return e?t:t[1]}function me(e,t=5){let n=Ao(e,t);return r=>{let i=n()??lh;return o(i,{...r})}}function Oi({interval:e=1e3,deps:t=[]}){let[n,r]=J(0),i=Nt(()=>Date.now(),t);return _e(()=>{let s=setInterval(()=>r(Date.now()-i),e);return()=>{r(0),clearInterval(s)}},t),n}var lh,hc,Oe=g(()=>{"use strict";a();I();Zt();Be();lh=()=>null,hc=(e=!1)=>{let t=O.useRef(null),[n,r]=J(!1);return[s=>{t.current?.disconnect(),t.current=null,s&&(gc(s)&&(r(!0),e)||(t.current=new IntersectionObserver(l=>{for(let c of l)c.target===s&&(c.isIntersecting&&e?(r(!0),t.current?.disconnect(),t.current=null):r(c.isIntersecting))}),t.current.observe(s)))},n]}});var ch=g(()=>{});function Sn(e){return o("div",{...e,className:re(e.className,"vc-error-card")},e.children)}var jr=g(()=>{"use strict";a();ch();Be()});var Qw,uh,ph,yc,_,le=g(()=>{"use strict";a();Je();ct();Oe();I();jr();Qw="#e78284",uh=new ie("React ErrorBoundary",Qw),ph={},yc=me(()=>class extends O.PureComponent{state={error:ph,stack:"",message:""};static getDerivedStateFromError(t){let n=t?.stack??"",r=t?.message||String(t);if(t instanceof Error&&n){let i=n.indexOf(` +`);i!==-1&&(r=n.slice(0,i),n=n.slice(i+1).replace(/https:\/\/\S+\/assets\//g,""))}return{error:t,stack:n,message:r}}componentDidCatch(t,n){this.props.onError?.({error:t,errorInfo:n,props:this.props.wrappedProps}),uh.error(`A component threw an Error +`,t),uh.error("Component Stack",n.componentStack)}render(){if(this.state.error===ph)return this.props.children;if(this.props.noop)return null;if(this.props.fallback)return o(this.props.fallback,{children:this.props.children,...this.state});let t=this.props.message||"An error occurred while rendering this Component. More info can be found below and in your console.";return o(Sn,{style:{overflow:"hidden"}},o("h1",null,"Oh no!"),o("p",null,t),o("code",null,this.state.message,!!this.state.stack&&o("pre",{className:Y.top8},this.state.stack)))}});yc.wrap=(e,t)=>n=>o(yc,{...t,wrappedProps:n},o(e,{...n}));_=yc});function ia(){return o("svg",{"aria-hidden":"true",height:"16",viewBox:"0 0 16 16",width:"16",style:{marginRight:"0.5em",transform:"translateY(2px)"}},o("path",{fill:"#db61a2","fill-rule":"evenodd",d:"M4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.565 20.565 0 008 13.393a20.561 20.561 0 003.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.75.75 0 01-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5zM8 14.25l-.345.666-.002-.001-.006-.003-.018-.01a7.643 7.643 0 01-.31-.17 22.075 22.075 0 01-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.08 22.08 0 01-3.744 2.584l-.018.01-.006.003h-.002L8 14.25zm0 0l.345.666a.752.752 0 01-.69 0L8 14.25z"}))}var vc=g(()=>{"use strict";a()});function _i(e){return o(E,{...e,look:E.Looks.LINK,color:E.Colors.TRANSPARENT,onClick:()=>VencordNative.native.openExternal("https://github.com/sponsors/Vendicated")},o(ia,null),"Donate")}var Sc=g(()=>{"use strict";a();I();vc()});function ye(e){return e.style??={},e.style.display="flex",e.style.gap??="1em",e.style.flexDirection||=e.flexDirection,delete e.flexDirection,o("div",{...e},e.children)}var Dt=g(()=>{"use strict";a()});function Bi(e,t){return sa.openModalLazy(e,t)}function Ke(e,t,n){return sa.openModal(e,t,n)}function oo(e,t){return sa.closeModal(e,t)}function Tc(){return sa.closeAllModals()}var Co,Rn,bc,qe,at,tt,Ft,cn,sa,dt=g(()=>{"use strict";a();j();Oe();Co=(i=>(i.SMALL="small",i.MEDIUM="medium",i.LARGE="large",i.DYNAMIC="dynamic",i))(Co||{}),Rn=fn(".closeWithCircleBackground",{ModalRoot:ce.byCode(".root"),ModalHeader:ce.byCode(".header"),ModalContent:ce.byCode(".content"),ModalFooter:ce.byCode(".footerSeparator"),ModalCloseButton:ce.byCode(".closeWithCircleBackground")}),bc=me(()=>yt("ImageModal").ImageModal),qe=me(()=>Rn.ModalRoot),at=me(()=>Rn.ModalHeader),tt=me(()=>Rn.ModalContent),Ft=me(()=>Rn.ModalFooter),cn=me(()=>Rn.ModalCloseButton),sa=A("openModalLazy")});function y(e){return e}var M=g(()=>{"use strict";a()});async function dh(e=!1){xc={};let t={};e&&(t.cache="no-cache");let r=(await fetch("https://gist.githubusercontent.com/Vendicated/51a3dd775f6920429ec6e9b735ca7f01/raw/badges.csv",t).then(i=>i.text())).trim().split(` +`);if(r.shift()!=="id,tooltip,image"){new ie("BadgeAPI").error("Invalid badges.csv file!");return}for(let i of r){let[s,l,c]=i.split(",");(xc[s]??=[]).push({image:c,description:l})}}var Vw,e2,xc,wc,mh=g(()=>{"use strict";a();la();Sc();le();Dt();vc();P();Je();ct();Be();dt();M();I();Vw="https://cdn.discordapp.com/attachments/1033680203433660458/1092089947126780035/favicon.png",e2={description:"Vencord Contributor",image:Vw,position:0,props:{style:{borderRadius:"50%",transform:"scale(0.9)"}},shouldShow:({user:e})=>Di(e.id),link:"https://github.com/Vendicated/Vencord"},xc={};wc=y({name:"BadgeAPI",description:"API to add badges to users.",authors:[p.Megu,p.Ven,p.TheSun],required:!0,patches:[{find:"Messages.PROFILE_USER_BADGES,role:",replacement:[{match:/&&(\i)\.push\(\{id:"premium".+?\}\);/,replace:"$&$1.unshift(...Vencord.Api.Badges._getBadges(arguments[0]));"},{match:/alt:" ","aria-hidden":!0,src:(?=(\i)\.src)/,replace:"...$1.props,$& $1.image??"},{match:/(?<=text:(\i)\.description,spacing:12,)children:/,replace:"children:$1.component ? () => $self.renderBadgeComponent($1) :"},{match:/href:(\i)\.link/,replace:"...($1.onClick && { onClick: $1.onClick }),$&"}]}],toolboxActions:{async"Refetch Badges"(){await dh(!0),ee.show({id:ee.genId(),message:"Successfully refetched badges!",type:ee.Type.SUCCESS})}},async start(){Vencord.Api.Badges.addBadge(e2),await dh()},renderBadgeComponent:_.wrap(e=>{let t=e.component;return o(t,{...e})},{noop:!0}),getDonorBadges(e){return xc[e]?.map(t=>({...t,position:0,props:{style:{borderRadius:"50%",transform:"scale(0.9)"}},onClick(){let n=Ke(r=>o(_,{noop:!0,onError:()=>{oo(n),VencordNative.native.openExternal("https://github.com/sponsors/Vendicated")}},o(Rn.ModalRoot,{...r},o(Rn.ModalHeader,null,o(ye,{style:{width:"100%",justifyContent:"center"}},o(S.FormTitle,{tag:"h2",style:{width:"100%",textAlign:"center",margin:0}},o(ia,null),"Vencord Donor"))),o(Rn.ModalContent,null,o(ye,null,o("img",{role:"presentation",src:"https://cdn.discordapp.com/emojis/1026533070955872337.png",alt:"",style:{margin:"auto"}}),o("img",{role:"presentation",src:"https://cdn.discordapp.com/emojis/1026533090627174460.png",alt:"",style:{margin:"auto"}})),o("div",{style:{padding:"1em"}},o(S.FormText,null,"This Badge is a special perk for Vencord Donors"),o(S.FormText,{className:Y.top20},"Please consider supporting the development of Vencord by becoming a donor. It would mean a lot!!"))),o(Rn.ModalFooter,null,o(ye,{style:{width:"100%",justifyContent:"center"}},o(_i,null))))))}}))}})});var Mc,fh=g(()=>{"use strict";a();P();M();Mc=y({name:"CommandsAPI",authors:[p.Arjix],description:"Api required by anything that uses commands",patches:[{find:',"tenor"',replacement:[{match:/(?<=\w=)(\w)(\.filter\(.{0,60}tenor)/,replace:"Vencord.Api.Commands._init($1)$2"}]},{find:"Unexpected value for option",replacement:{match:/,(\i)\.execute\((\i),(\i)\)/,replace:(e,t,n,r)=>`,Vencord.Api.Commands._handleCommand(${t}, ${n}, ${r})`}},{find:".source,children",replacement:{match:/(?<=:(.{1,3})\.displayDescription\}.{0,200}\.source,children:)[^}]+/,replace:"$1.plugin||($&)"}}]})});var Pc,gh=g(()=>{"use strict";a();P();M();Pc=y({name:"ContextMenuAPI",description:"API for adding/removing items to/from context menus.",authors:[p.Nuckyz,p.Ven],required:!0,patches:[{find:"\u266B (\u3064\uFF61\u25D5\u203F\u203F\u25D5\uFF61)\u3064 \u266A",replacement:{match:/let{navId:/,replace:"Vencord.Api.ContextMenu._patchContextMenu(arguments[0]);$&"}},{find:".Menu,{",all:!0,replacement:{match:/Menu,{(?<=\.jsxs?\)\(\i\.Menu,{)/g,replace:"$&contextMenuApiArguments:typeof arguments!=='undefined'?arguments:[],"}}]})});var Ic,hh=g(()=>{"use strict";a();P();M();Ic=y({name:"MemberListDecoratorsAPI",description:"API to add decorators to member list (both in servers and DMs)",authors:[p.TheSun,p.Ven],patches:[{find:".lostPermission)",replacement:[{match:/let\{[^}]*lostPermissionTooltipText:\i[^}]*\}=(\i),/,replace:"$&vencordProps=$1,"},{match:/decorators:.{0,100}?children:\[/,replace:"$&...(typeof vencordProps=='undefined'?[]:Vencord.Api.MemberListDecorators.__getDecorators(vencordProps)),"}]},{find:"PrivateChannel.renderAvatar",replacement:{match:/decorators:(\i\.isSystemDM\(\))\?(.+?):null/,replace:"decorators:[...Vencord.Api.MemberListDecorators.__getDecorators(arguments[0]), $1?$2:null]"}}]})});var Ac,yh=g(()=>{"use strict";a();P();M();Ac=y({name:"MessageAccessoriesAPI",description:"API to add message accessories.",authors:[p.Cyn],patches:[{find:".Messages.REMOVE_ATTACHMENT_BODY",replacement:{match:/(?<=.container\)?,children:)(\[.+?\])/,replace:"Vencord.Api.MessageAccessories._modifyAccessories($1,this.props)"}}]})});var Nc,vh=g(()=>{"use strict";a();P();M();Nc=y({name:"MessageDecorationsAPI",description:"API to add decorations to messages",authors:[p.TheSun],patches:[{find:'"Message Username"',replacement:{match:/\.Messages\.GUILD_COMMUNICATION_DISABLED_BOTTOM_SHEET_TITLE.+?}\),\i(?=\])/,replace:"$&,...Vencord.Api.MessageDecorations.__addDecorationsToMessage(arguments[0])"}}]})});var Cc,Sh=g(()=>{"use strict";a();P();M();Cc=y({name:"MessageEventsAPI",description:"Api required by anything using message events.",authors:[p.Arjix,p.hunt,p.Ven],patches:[{find:'"MessageActionCreators"',replacement:{match:/async editMessage\(.+?\)\{/,replace:"$&await Vencord.Api.MessageEvents._handlePreEdit(...arguments);"}},{find:".handleSendMessage=",replacement:{match:/(type:this\.props\.chatInputType.+?\.then\()(\i=>\{.+?let (\i)=\i\.\i\.parse\((\i),.+?let (\i)=\i\.\i\.getSendMessageOptionsForReply\(\i\);)(?<=\)\(({.+?})\)\.then.+?)/,replace:(e,t,n,r,i,s,l)=>`${t}async ${n}if(await Vencord.Api.MessageEvents._handlePreSend(${i}.id,${r},${l},${s}))return{shoudClear:true,shouldRefocus:true};`}},{find:'("interactionUsernameProfile',replacement:{match:/let\{id:\i}=(\i),{id:\i}=(\i);return \i\.useCallback\((\i)=>\{/,replace:(e,t,n,r)=>`const vcMsg=${t},vcChan=${n};${e}Vencord.Api.MessageEvents._handleClick(vcMsg, vcChan, ${r});`}}]})});var kc,bh=g(()=>{"use strict";a();P();M();kc=y({name:"MessagePopoverAPI",description:"API to add buttons to message popovers.",authors:[p.KingFish,p.Ven,p.Nuckyz],patches:[{find:"Messages.MESSAGE_UTILITIES_A11Y_LABEL",replacement:{match:/\i&&!\i\?\(0,\i\.jsxs?\)\(.{0,200}renderEmojiPicker:.{0,500}\?(\i)\(\{key:"reply-other"/,replace:(e,t)=>{let n=e.match(/message:(.{1,3}),/)?.[1];if(!n)throw new Error("Could not find message variable");return`...Vencord.Api.MessagePopover._buildPopoverElements(${n},${t}),${e}`}}}]})});var Rc,Th=g(()=>{"use strict";a();P();M();Rc=y({name:"NoticesAPI",description:"Fixes notices being automatically dismissed",authors:[p.Ven],required:!0,patches:[{find:'displayName="NoticeStore"',replacement:[{match:/\i=null;(?=.{0,80}getPremiumSubscription\(\))/g,replace:"if(Vencord.Api.Notices.currentNotice)return false;$&"},{match:/(?<=,NOTICE_DISMISS:function\(\i\){)return null!=(\i)/,replace:'if($1.id=="VencordNotice")return($1=null,Vencord.Api.Notices.nextNotice(),true);$&'}]}]})});var Lc,xh=g(()=>{"use strict";a();P();M();Lc=y({name:"ServerListAPI",authors:[p.kemo],description:"Api required for plugins that modify the server list",patches:[{find:"Messages.DISCODO_DISABLED",replacement:{match:/(?<=Messages\.DISCODO_DISABLED.+?return)(\(.{0,75}?tutorialContainer.+?}\))(?=}function)/,replace:"[$1].concat(Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.Above))"}},{find:"Messages.SERVERS,children",replacement:{match:/(?<=Messages\.SERVERS,children:).+?default:return null\}\}\)/,replace:"Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.In).concat($&)"}}]})});var Ec,wh=g(()=>{"use strict";a();P();M();Ec=y({name:"NoTrack",description:"Disable Discord's tracking ('science'), metrics and Sentry crash reporting",authors:[p.Cyn,p.Ven,p.Nuckyz,p.Arrow],required:!0,patches:[{find:"AnalyticsActionHandlers.handle",replacement:{match:/^.+$/,replace:"()=>{}"}},{find:"window.DiscordSentry=",replacement:{match:/^.+$/,replace:"()=>{}"}},{find:".METRICS,",replacement:[{match:/this\._intervalId=/,replace:"this._intervalId=undefined&&"},{match:/(increment\(\i\){)/,replace:"$1return;"}]},{find:".installedLogHooks)",replacement:{match:"getDebugLogging(){",replace:"getDebugLogging(){return false;"}}]})});var Oc={};Ue(Oc,{_patchContextMenu:()=>o2,addContextMenuPatch:()=>ue,addGlobalContextMenuPatch:()=>t2,findGroupChildrenByChildId:()=>mt,globalPatches:()=>ca,navPatches:()=>Fi,removeContextMenuPatch:()=>fe,removeGlobalContextMenuPatch:()=>n2});function ue(e,t){Array.isArray(e)||(e=[e]);for(let n of e){let r=Fi.get(n);r||(r=new Set,Fi.set(n,r)),r.add(t)}}function t2(e){ca.add(e)}function fe(e,t){let r=(Array.isArray(e)?e:[e]).map(i=>Fi.get(i)?.delete(t)??!1);return Array.isArray(e)?r:r[0]}function n2(e){return ca.delete(e)}function mt(e,t,n){for(let r of t){if(r==null)continue;if(Array.isArray(e)&&e.some(s=>r.props?.id===s)||r.props?.id===e)return n??null;let i=r.props?.children;if(i){Array.isArray(i)||(i=[i],r.props.children=i);let s=mt(e,i,i);if(s!==null)return s}}return null}function o2(e){e.contextMenuApiArguments??=[];let t=Fi.get(e.navId);if(Array.isArray(e.children)||(e.children=[e.children]),t)for(let n of t)try{let r=n(e.children,...e.contextMenuApiArguments);Dc.has(e)||r?.()}catch(r){Mh.error(`Patch for ${e.navId} errored,`,r)}for(let n of ca)try{let r=n(e.navId,e.children,...e.contextMenuApiArguments);Dc.has(e)||r?.()}catch(r){Mh.error("Global patch errored,",r)}Dc.add(e)}var Mh,Fi,ca,Dc,Mt=g(()=>{"use strict";a();Je();Mh=new ie("ContextMenu"),Fi=new Map,ca=new Set;Dc=new WeakSet});function bn(e,t=300){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}var Wr=g(()=>{"use strict";a()});var mr,ua=g(()=>{"use strict";a();({localStorage:mr}=window)});var Ln,qr=g(()=>{"use strict";a();Ln=class{constructor(t=1/0){this.maxSize=t}queue=[];promise;next(){let t=this.queue.shift();t?this.promise=Promise.resolve().then(t).finally(()=>this.next()):this.promise=void 0}run(){this.promise||this.next()}push(t){this.size>=this.maxSize&&this.queue.shift(),this.queue.push(t),this.run()}unshift(t){this.size>=this.maxSize&&this.queue.pop(),this.queue.unshift(t),this.run()}get size(){return this.queue.length}}});var Ph=g(()=>{});var pa,_c=g(()=>{"use strict";a();Ph();$();le();Be();I();pa=_.wrap(function({title:t,body:n,richBody:r,color:i,icon:s,onClick:l,onClose:c,image:u,permanent:d,className:m,dismissOnClick:h}){let{timeout:v,position:T}=lt(["notifications.timeout","notifications.position"]).notifications,w=We([ki],()=>ki.isFocused()),[b,x]=J(!1),[N,k]=J(0),F=Nt(()=>Date.now(),[v,b,w]);_e(()=>{if(b||!w||v===0||d)return void k(0);let K=setInterval(()=>{let q=Date.now()-F;q>=v?c():k(q)},10);return()=>clearInterval(K)},[v,b,w]);let G=N/v;return o("button",{className:re("vc-notification-root",m),style:T==="bottom-right"?{bottom:"1rem"}:{top:"3rem"},onClick:()=>{l?.(),h!==!1&&c()},onContextMenu:K=>{K.preventDefault(),K.stopPropagation(),c()},onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1)},o("div",{className:"vc-notification"},s&&o("img",{className:"vc-notification-icon",src:s,alt:""}),o("div",{className:"vc-notification-content"},o("div",{className:"vc-notification-header"},o("h2",{className:"vc-notification-title"},t),o("button",{className:"vc-notification-close-btn",onClick:K=>{K.preventDefault(),K.stopPropagation(),c()}},o("svg",{width:"24",height:"24",viewBox:"0 0 24 24",role:"img","aria-labelledby":"vc-notification-dismiss-title"},o("title",{id:"vc-notification-dismiss-title"},"Dismiss Notification"),o("path",{fill:"currentColor",d:"M18.4 4L12 10.4L5.6 4L4 5.6L10.4 12L4 18.4L5.6 20L12 13.6L18.4 20L20 18.4L13.6 12L20 5.6L18.4 4Z"})))),o("div",null,r??o("p",{className:"vc-notification-p"},n)))),u&&o("img",{className:"vc-notification-img",src:u,alt:""}),v!==0&&!d&&o("div",{className:"vc-notification-progressbar",style:{width:`${(1-G)*100}%`,backgroundColor:i||"var(--brand-experiment)"}}))},{onError:({props:e})=>e.onClose()})});var ro={};Ue(ro,{clear:()=>a2,createStore:()=>Ih,del:()=>Fc,delMany:()=>s2,entries:()=>u2,get:()=>Pt,getMany:()=>i2,keys:()=>l2,promisifyRequest:()=>Ut,set:()=>Vt,setMany:()=>r2,update:()=>fr,values:()=>c2});function Ut(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function Ih(e,t){let n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);let r=Ut(n);return(i,s)=>r.then(l=>s(l.transaction(t,i).objectStore(t)))}function En(){return Bc||(Bc=Ih("VencordData","VencordStore")),Bc}function Pt(e,t=En()){return t("readonly",n=>Ut(n.get(e)))}function Vt(e,t,n=En()){return n("readwrite",r=>(r.put(t,e),Ut(r.transaction)))}function r2(e,t=En()){return t("readwrite",n=>(e.forEach(r=>n.put(r[1],r[0])),Ut(n.transaction)))}function i2(e,t=En()){return t("readonly",n=>Promise.all(e.map(r=>Ut(n.get(r)))))}function fr(e,t,n=En()){return n("readwrite",r=>new Promise((i,s)=>{r.get(e).onsuccess=function(){try{r.put(t(this.result),e),i(Ut(r.transaction))}catch(l){s(l)}}}))}function Fc(e,t=En()){return t("readwrite",n=>(n.delete(e),Ut(n.transaction)))}function s2(e,t=En()){return t("readwrite",n=>(e.forEach(r=>n.delete(r)),Ut(n.transaction)))}function a2(e=En()){return e("readwrite",t=>(t.clear(),Ut(t.transaction)))}function Uc(e,t){return e.openCursor().onsuccess=function(){!this.result||(t(this.result),this.result.continue())},Ut(e.transaction)}function l2(e=En()){return e("readonly",t=>{if(t.getAllKeys)return Ut(t.getAllKeys());let n=[];return Uc(t,r=>n.push(r.key)).then(()=>n)})}function c2(e=En()){return e("readonly",t=>{if(t.getAll)return Ut(t.getAll());let n=[];return Uc(t,r=>n.push(r.value)).then(()=>n)})}function u2(e=En()){return e("readonly",t=>{if(t.getAll&&t.getAllKeys)return Promise.all([Ut(t.getAllKeys()),Ut(t.getAll())]).then(([r,i])=>r.map((s,l)=>[s,i[l]]));let n=[];return e("readonly",r=>Uc(r,i=>n.push([i.key,i.value])).then(()=>n))})}var Bc,Kn=g(()=>{"use strict";a();});var Hc={};Ue(Hc,{classNameFactory:()=>Ge,classNameToSelector:()=>Nh,compileStyle:()=>Gc,disableStyle:()=>$t,enableStyle:()=>St,isStyleEnabled:()=>$c,requireStyle:()=>Ui,setStyleClassNames:()=>d2,styleMap:()=>Ah,toggleStyle:()=>p2});function Ui(e){let t=Ah.get(e);if(!t)throw new Error(`Style "${e}" does not exist`);return t}function St(e){let t=Ui(e);return t.dom?.isConnected?!1:(t.dom||(t.dom=document.createElement("style"),t.dom.dataset.vencordName=t.name),Gc(t),document.head.appendChild(t.dom),!0)}function $t(e){let t=Ui(e);return t.dom?.isConnected?(t.dom.remove(),t.dom=null,!0):!1}var Ah,p2,$c,d2,Gc,Nh,Ge,Ve=g(()=>{"use strict";a();Ah=window.VencordStyles??=new Map;p2=e=>$c(e)?$t(e):St(e),$c=e=>Ui(e).dom?.isConnected??!1,d2=(e,t,n=!0)=>{let r=Ui(e);r.classNames=t,n&&$c(r.name)&&Gc(r)},Gc=e=>{if(!e.dom)throw new Error("Style has no DOM element");e.dom.textContent=e.source.replace(/\[--(\w+)\]/g,(t,n)=>{let r=e.classNames[n];return r?Nh(r):t})},Nh=(e,t="")=>e.split(" ").map(n=>`.${t}${n}`).join(""),Ge=(e="")=>(...t)=>{let n=new Set;for(let r of t)r&&typeof r=="string"?n.add(r):Array.isArray(r)?r.forEach(i=>n.add(i)):r&&typeof r=="object"&&Object.entries(r).forEach(([i,s])=>s&&n.add(i));return Array.from(n,r=>e+r).join(" ")}});var Ch,kh=g(()=>{a();Ch=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"")});async function Lh(e){if(e.noPersist)return;let t=L.notifications.logLimit;t!==0&&(await fr(da,n=>{let r=n??[],{onClick:i,onClose:s,richBody:l,permanent:c,noPersist:u,dismissOnClick:d,...m}=e;return r.unshift({...m,timestamp:Date.now(),id:Ch()}),r.length>t&&t!==200&&(r.length=t),r}),$i.forEach(n=>n()))}async function m2(e){let t=await Rh(),n=t.findIndex(r=>r.timestamp===e);n!==-1&&(t.splice(n,1),await Vt(da,t),$i.forEach(r=>r()))}function f2(){let[e,t]=Fr(s=>s+1,0);_e(()=>($i.add(t),()=>void $i.delete(t)),[]);let[n,r,i]=ot(Rh,{fallbackValue:[],deps:[e]});return[n,i]}function g2({data:e}){let[t,n]=J(!1),r=O.useRef(null);return _e(()=>{let i=r.current,s=()=>{if(i.clientHeight===0)return requestAnimationFrame(s);i.style.height=`${i.clientHeight}px`};s()},[]),o("div",{className:Kr("wrapper",{removing:t}),ref:r},o(pa,{...e,permanent:!0,dismissOnClick:!1,onClose:()=>{t||(n(!0),setTimeout(()=>m2(e.timestamp),200))},richBody:o("div",{className:Kr("body")},e.body,o(Hn,{timestamp:hn(e.timestamp),className:Kr("timestamp")}))}))}function h2({log:e,pending:t}){return!e.length&&!t?o("div",{className:Kr("container")},o("div",{className:Kr("empty")}),o(S.FormText,{style:{textAlign:"center"}},"No notifications yet")):o("div",{className:Kr("container")},e.map(n=>o(g2,{data:n,key:n.id})))}function y2({modalProps:e,close:t}){let[n,r]=f2();return o(qe,{...e,size:"large"},o(at,null,o(oe,{variant:"heading-lg/semibold",style:{flexGrow:1}},"Notification Log"),o(cn,{onClick:t})),o(tt,null,o(h2,{log:n,pending:r})),o(Ft,null,o(E,{disabled:n.length===0,onClick:()=>{an.show({title:"Are you sure?",body:`This will permanently remove ${n.length} notification${n.length===1?"":"s"}. This action cannot be undone.`,async onConfirm(){await Vt(da,[]),$i.forEach(i=>i())},confirmText:"Do it!",confirmColor:"vc-notification-log-danger-btn",cancelText:"Nevermind"})}},"Clear Notification Log")))}function ma(){let e=Ke(t=>o(y2,{modalProps:t,close:()=>oo(e)}))}var da,Rh,Kr,$i,fa=g(()=>{"use strict";a();Kn();$();Ve();dt();Oe();I();kh();_c();da="notification-log",Rh=async()=>await Pt(da)??[],Kr=Ge("vc-notification-log-"),$i=new Set});function b2(){if(!zc){let e=document.createElement("div");e.id="vc-notification-container",document.body.append(e),zc=sr.createRoot(e)}return zc}function T2(e,t){let n=b2();return new Promise(r=>{n.render(o(pa,{key:t,...e,onClose:()=>{e.onClose?.(),n.render(null),r()}}))})}function x2(){if(typeof Notification>"u")return!1;let{useNative:e}=L.notifications;return e==="always"?!0:e==="not-focused"?!document.hasFocus():!1}async function Eh(){return Notification.permission==="granted"||Notification.permission!=="denied"&&await Notification.requestPermission()==="granted"}async function Ne(e){if(Lh(e),x2()&&await Eh()){let{title:t,body:n,icon:r,image:i,onClick:s=null,onClose:l=null}=e,c=new Notification(t,{body:n,icon:r,image:i});c.onclick=s,c.onclose=l}else v2.push(()=>T2(e,S2++))}var v2,zc,S2,Dh=g(()=>{"use strict";a();$();qr();I();_c();fa();v2=new Ln,S2=42});var jc={};Ue(jc,{requestPermission:()=>Eh,showNotification:()=>Ne});var ko=g(()=>{"use strict";a();Dh()});function zh(e,t){return L2(e,t||{},0,0)}function jh(e,t){return C2(e,t)}var Gt,en,ga,ha,ya,Yc,Fh,Uh,$h,Zc,Gh,w2,Oh,Xc,io,Ee,Yn,Lo,Ee,Ee,Ee,Ee,zi,Ee,M2,P2,I2,A2,Wc,Dn,qc,Vc,Hh,N2,Ro,C2,so,Gi,Kc,Jc,_h,Hi,Qc,Bh,k2,eu,R2,L2,E2,D2,Wh=g(()=>{a();Gt=Uint8Array,en=Uint16Array,ga=Uint32Array,ha=new Gt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ya=new Gt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Yc=new Gt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Fh=function(e,t){for(var n=new en(31),r=0;r<31;++r)n[r]=t+=1<>>1|(Ee&21845)<<1,io=(io&52428)>>>2|(io&13107)<<2,io=(io&61680)>>>4|(io&3855)<<4,Xc[Ee]=((io&65280)>>>8|(io&255)<<8)>>>1;Yn=function(e,t,n){for(var r=e.length,i=0,s=new en(t);i>>u]=d}else for(c=new en(r),i=0;i>>15-e[i]);return c},Lo=new Gt(288);for(Ee=0;Ee<144;++Ee)Lo[Ee]=8;for(Ee=144;Ee<256;++Ee)Lo[Ee]=9;for(Ee=256;Ee<280;++Ee)Lo[Ee]=7;for(Ee=280;Ee<288;++Ee)Lo[Ee]=8;zi=new Gt(32);for(Ee=0;Ee<32;++Ee)zi[Ee]=5;M2=Yn(Lo,9,0),P2=Yn(Lo,9,1),I2=Yn(zi,5,0),A2=Yn(zi,5,1),Wc=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},Dn=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},qc=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},Vc=function(e){return(e+7)/8|0},Hh=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e.BYTES_PER_ELEMENT==2?en:e.BYTES_PER_ELEMENT==4?ga:Gt)(n-t);return r.set(e.subarray(t,n)),r},N2=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ro=function(e,t,n){var r=new Error(t||N2[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Ro),!n)throw r;return r},C2=function(e,t,n){var r=e.length;if(!r||n&&n.f&&!n.l)return t||new Gt(0);var i=!t||n,s=!n||n.i;n||(n={}),t||(t=new Gt(r*3));var l=function(er){var Mo=t.length;if(er>Mo){var Po=new Gt(Math.max(Mo*2,er));Po.set(t),t=Po}},c=n.f||0,u=n.p||0,d=n.b||0,m=n.l,h=n.d,v=n.m,T=n.n,w=r*8;do{if(!m){c=Dn(e,u,1);var b=Dn(e,u+1,3);if(u+=3,b)if(b==1)m=P2,h=A2,v=9,T=5;else if(b==2){var F=Dn(e,u,31)+257,G=Dn(e,u+10,15)+4,K=F+Dn(e,u+5,31)+1;u+=14;for(var q=new Gt(K),z=new Gt(19),R=0;R>>4;if(x<16)q[R++]=x;else{var Ce=0,ge=0;for(x==16?(ge=3+Dn(e,u,3),u+=2,Ce=q[R-1]):x==17?(ge=3+Dn(e,u,7),u+=3):x==18&&(ge=11+Dn(e,u,127),u+=7);ge--;)q[R++]=Ce}}var Se=q.subarray(0,F),Me=q.subarray(F);v=Wc(Se),T=Wc(Me),m=Yn(Se,v,1),h=Yn(Me,T,1)}else Ro(1);else{var x=Vc(u)+4,N=e[x-4]|e[x-3]<<8,k=x+N;if(k>r){s&&Ro(0);break}i&&l(d+N),t.set(e.subarray(x,k),d),n.b=d+=N,n.p=u=k*8,n.f=c;continue}if(u>w){s&&Ro(0);break}}i&&l(d+131072);for(var Pe=(1<>>4;if(u+=Ce&15,u>w){s&&Ro(0);break}if(Ce||Ro(2),gt<256)t[d++]=gt;else if(gt==256){de=u,m=null;break}else{var Xe=gt-254;if(gt>264){var R=gt-257,ke=ha[R];Xe=Dn(e,u,(1<>>4;Yt||Ro(3),u+=Yt&15;var Me=w2[bt];if(bt>3){var ke=ya[bt];Me+=qc(e,u)&(1<w){s&&Ro(0);break}i&&l(d+131072);for(var ht=d+Xe;d>>8},Gi=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Kc=function(e,t){for(var n=[],r=0;rv&&(v=s[r].s);var T=new en(v+1),w=Jc(n[m-1],T,0);if(w>t){var r=0,b=0,x=w-t,N=1<t)b+=N-(1<>>=x;b>0;){var F=s[r].s;T[F]=0&&b;--r){var G=s[r].s;T[G]==t&&(--T[G],++b)}w=t}return[new Gt(T),w]},Jc=function(e,t,n){return e.s==-1?Math.max(Jc(e.l,t,n+1),Jc(e.r,t,n+1)):t[e.s]=n},_h=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new en(++t),r=0,i=e[0],s=1,l=function(u){n[r++]=u},c=1;c<=t;++c)if(e[c]==i&&c!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)l(32754);s>2&&(l(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(l(i),--s;s>6;s-=6)l(8304);s>2&&(l(s-3<<5|8208),s=0)}for(;s--;)l(i);s=1,i=e[c]}return[n.subarray(0,r),t]},Hi=function(e,t){for(var n=0,r=0;r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var s=0;s4&&!ne[Yc[ae-1]];--ae);var Ce=d+5<<3,ge=Hi(i,Lo)+Hi(s,zi)+l,Se=Hi(i,v)+Hi(s,b)+l+14+3*ae+Hi(z,ne)+(2*z[16]+3*z[17]+7*z[18]);if(Ce<=ge&&Ce<=Se)return Qc(t,m,e.subarray(u,u+d));var Me,Pe,be,de;if(so(t,m,1+(Se15&&(so(t,m,Yt[R]>>>5&127),m+=Yt[R]>>>12)}}else Me=M2,Pe=Lo,be=I2,de=zi;for(var R=0;R255){var bt=r[R]>>>18&31;Gi(t,m,Me[bt+257]),m+=Pe[bt+257],bt>7&&(so(t,m,r[R]>>>23&31),m+=ha[bt]);var ht=r[R]&31;Gi(t,m,be[ht]),m+=de[ht],ht>3&&(Gi(t,m,r[R]>>>5&8191),m+=ya[ht])}else Gi(t,m,Me[r[R]]),m+=Pe[r[R]];return Gi(t,m,Me[256]),m+Pe[256]},k2=new ga([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),eu=new Gt(0),R2=function(e,t,n,r,i,s){var l=e.length,c=new Gt(r+l+5*(1+Math.ceil(l/7e3))+i),u=c.subarray(r,c.length-i),d=0;if(!t||l<8)for(var m=0;m<=l;m+=65535){var h=m+65535;h>=l&&(u[d>>3]=s),d=Qc(u,d+1,e.subarray(m,h))}else{for(var v=k2[t-1],T=v>>>13,w=v&8191,b=(1<7e3||ne>24576)&&Me>423){d=Bh(e,u,0,K,q,z,X,ne,ae,m-ae,d),ne=R=X=0,ae=m;for(var Pe=0;Pe<286;++Pe)q[Pe]=0;for(var Pe=0;Pe<30;++Pe)z[Pe]=0}var be=2,de=0,gt=w,Xe=ge-Se&32767;if(Me>2&&Ce==G(m-Xe))for(var ke=Math.min(T,Me)-1,Yt=Math.min(32767,m),bt=Math.min(258,Me);Xe<=Yt&&--gt&&ge!=Se;){if(e[m+be]==e[m+be-Xe]){for(var ht=0;htbe){if(be=ht,de=Xe,ht>ke)break;for(var er=Math.min(Xe,ht-2),Mo=0,Pe=0;PeMo&&(Mo=Rt,Se=Po)}}}ge=Se,Se=x[ge],Xe+=ge-Se+32768&32767}if(de){K[ne++]=268435456|Zc[be]<<18|Oh[de];var nr=Zc[be]&31,C=Oh[de]&31;X+=ha[nr]+ya[C],++q[257+nr],++z[C],xe=m+be,++R}else K[ne++]=e[m],++q[e[m]]}}d=Bh(e,u,s,K,q,z,X,ne,ae,m-ae,d),!s&&d&7&&(d=Qc(u,d+1,eu))}return Hh(c,0,r+Vc(d)+i)},L2=function(e,t,n,r,i){return R2(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,n,r,!i)};E2=typeof TextDecoder<"u"&&new TextDecoder,D2=0;try{E2.decode(eu,{stream:!0}),D2=1}catch{}});async function qh(){let e=await Pt("Vencord_cloudSecret")??{},t=tu();return e[t]?(await fr("Vencord_cloudSecret",n=>(n??={},n[`${t}:${ji()}`]=n[t],delete n[t],n)),e[t]):e[`${t}:${ji()}`]}async function O2(e){await fr("Vencord_cloudSecret",t=>(t??={},t[`${tu()}:${ji()}`]=e,t))}async function nu(){await fr("Vencord_cloudSecret",e=>(e??={},delete e[`${tu()}:${ji()}`],e))}async function Kh(){if(await qh()!==void 0){L.cloud.authenticated=!0;return}try{let r=await fetch(new URL("/v1/oauth/settings",Eo()));var{clientId:e,redirectUri:t}=await r.json()}catch{Ne({title:"Cloud Integration",body:"Setup failed (couldn't retrieve OAuth configuration)."}),L.cloud.authenticated=!1;return}let{OAuth2AuthorizeModal:n}=yt("OAuth2AuthorizeModal");Ke(r=>o(n,{...r,scopes:["identify"],responseType:"code",redirectUri:t,permissions:0n,clientId:e,cancelCompletesFlow:!1,callback:async({location:i})=>{if(!i){L.cloud.authenticated=!1;return}try{let s=await fetch(i,{headers:new Headers({Accept:"application/json"})}),{secret:l}=await s.json();l?(va.info("Authorized with secret"),await O2(l),Ne({title:"Cloud Integration",body:"Cloud integrations enabled!"}),L.cloud.authenticated=!0):(Ne({title:"Cloud Integration",body:"Setup failed (no secret returned?)."}),L.cloud.authenticated=!1)}catch(s){va.error("Failed to authorize",s),Ne({title:"Cloud Integration",body:`Setup failed (${s.toString()}).`}),L.cloud.authenticated=!1}}}))}async function Yr(){let e=await qh();return window.btoa(`${e}:${ji()}`)}var va,Eo,tu,ji,ou=g(()=>{"use strict";a();Kn();ko();$();j();I();Je();dt();va=new ie("Cloud","#39b7e0"),Eo=()=>new URL(L.cloud.url),tu=()=>Eo().origin,ji=()=>{let e=W.getCurrentUser()?.id;if(!e)throw new Error("User not yet logged in");return e}});function un(){window.VesktopNative.app.relaunch()}function Sa(e){window.VesktopNative.fileManager.showItemInFolder(e)}var Do=g(()=>{"use strict";a()});function ba(e){let t=document.createElement("a");t.href=URL.createObjectURL(e),t.download=e.name,document.body.appendChild(t),t.click(),setImmediate(()=>{URL.revokeObjectURL(t.href),document.body.removeChild(t)})}function Ta(e){return new Promise(t=>{let n=document.createElement("input");n.type="file",n.style.display="none",n.accept=e,n.onchange=async()=>{t(n.files?.[0]??null)},document.body.appendChild(n),n.click(),setImmediate(()=>document.body.removeChild(n))})}var xa=g(()=>{"use strict";a()});async function Yh(e){try{var t=JSON.parse(e)}catch(n){throw console.log(e),new Error("Failed to parse JSON: "+String(n))}if("settings"in t&&"quickCss"in t)Object.assign(Zn,t.settings),await VencordNative.settings.set(JSON.stringify(t.settings,null,4)),await VencordNative.quickCss.set(t.quickCss);else throw new Error("Invalid Settings. Is this even a Vencord Settings file?")}async function Zh({minify:e}={}){let t=JSON.parse(VencordNative.settings.get()),n=await VencordNative.quickCss.get();return JSON.stringify({settings:t,quickCss:n},null,e?void 0:4)}async function Xh(){let e="vencord-settings-backup.json",t=await Zh(),n=new TextEncoder().encode(t);ba(new File([n],e,{type:"application/json"}))}async function Qh(e=!0){if(!1){if(t)try{}catch(n){}}else{let t=await Ta("application/json");if(!t)return;let n=new FileReader;n.onload=async()=>{try{await Yh(n.result),e&&_2()}catch(r){new ie("SettingsSync").error(r),e&&B2(r)}},n.readAsText(t)}}async function Zr(e){let t=await Zh({minify:!0});try{let n=await fetch(new URL("/v1/settings",Eo()),{method:"PUT",headers:new Headers({Authorization:await Yr(),"Content-Type":"application/octet-stream"}),body:zh(new TextEncoder().encode(t))});if(!n.ok){On.error(`Failed to sync up, API returned ${n.status}`),Ne({title:"Cloud Settings",body:`Could not synchronize settings to cloud (API returned ${n.status}).`,color:"var(--red-360)"});return}let{written:r}=await n.json();Zn.cloud.settingsSyncVersion=r,VencordNative.settings.set(JSON.stringify(Zn,null,4)),On.info("Settings uploaded to cloud successfully"),e&&Ne({title:"Cloud Settings",body:"Synchronized settings to the cloud!",noPersist:!0})}catch(n){On.error("Failed to sync up",n),Ne({title:"Cloud Settings",body:`Could not synchronize settings to the cloud (${n.toString()}).`,color:"var(--red-360)"})}}async function wa(e=!0,t=!1){try{let n=await fetch(new URL("/v1/settings",Eo()),{method:"GET",headers:new Headers({Authorization:await Yr(),Accept:"application/octet-stream","If-None-Match":L.cloud.settingsSyncVersion.toString()})});if(n.status===404)return On.info("No settings on the cloud"),e&&Ne({title:"Cloud Settings",body:"There are no settings in the cloud.",noPersist:!0}),!1;if(n.status===304)return On.info("Settings up to date"),e&&Ne({title:"Cloud Settings",body:"Your settings are up to date.",noPersist:!0}),!1;if(!n.ok)return On.error(`Failed to sync down, API returned ${n.status}`),Ne({title:"Cloud Settings",body:`Could not synchronize settings from the cloud (API returned ${n.status}).`,color:"var(--red-360)"}),!1;let r=Number(n.headers.get("etag")),i=L.cloud.settingsSyncVersion;if(!t&&r{"use strict";a();ko();$();I();Wh();ou();Je();Do();xa();Jh=(e,t)=>ee.show({type:e,message:t,id:ee.genId()}),_2=()=>Jh(ee.Type.SUCCESS,"Settings successfully imported. Restart to apply changes!"),B2=e=>Jh(ee.Type.FAILURE,`Failed to import settings: ${String(e)}`);On=new ie("Cloud:Settings","#39b7e0")});var iu={};Ue(iu,{PlainSettings:()=>Zn,Settings:()=>L,addSettingsListener:()=>qi,definePluginSettings:()=>D,migratePluginSettings:()=>U2,useSettings:()=>lt});function ru(e,t=e,n=""){return ty[n]??=new Proxy(e,{get(r,i){let s=r[i];if(!(i in r)){if(n==="plugins"&&i in He)return r[i]=ru({enabled:He[i].required??He[i].enabledByDefault??!1},t,`plugins.${i}`);if(n.startsWith("plugins.")){let l=n.slice(8);if(l in He){let c=He[l].options?.[i];if(!c)return s;if("default"in c)return r[i]=c.default;if(c.type===4){let u=c.options.find(d=>d.default);return u&&(r[i]=u.value),u?.value}}}return s}return typeof s=="object"&&!Array.isArray(s)&&s!==null?ru(s,t,`${n}${n&&"."}${i}`):s},set(r,i,s){if(r[i]===s)return!0;r[i]=s;let l=`${n}${n&&"."}${i}`;delete ty[l];for(let c of Ma)(!c._paths||c._paths.includes(l))&&c(s,l);return Zn.cloud.settingsSyncVersion=Date.now(),mr.Vencord_settingsDirty=!0,F2(),VencordNative.settings.set(JSON.stringify(t,null,4)),!0}})}function lt(e){let[,t]=O.useReducer(()=>({}),{}),n=e?(r,i)=>e.includes(i)&&t():t;return O.useEffect(()=>(Ma.add(n),()=>void Ma.delete(n)),[]),L}function qi(e,t){e&&(t._paths??=[]).push(e),Ma.add(t)}function U2(e,...t){let{plugins:n}=Oo;if(!(e in n)){for(let r of t)if(r in n){ny.info(`Migrating settings from old name ${r} to ${e}`),n[e]=n[r],delete n[r],VencordNative.settings.set(JSON.stringify(Oo,null,4));break}}}function D(e,t){let n={get store(){if(!n.pluginName)throw new Error("Cannot access settings before plugin is initialized");return L.plugins[n.pluginName]},use:r=>lt(r?.map(i=>`plugins.${n.pluginName}.${i}`)).plugins[n.pluginName],def:e,checks:t??{},pluginName:"",withPrivateSettings(){return this}};return n}var ny,ey,Oo,F2,Ma,ty,Zn,L,$=g(()=>{"use strict";a();Wr();ua();Je();Be();Wi();M();I();gr();ny=new ie("Settings"),ey={notifyAboutUpdates:!0,autoUpdate:!1,autoUpdateNotification:!0,useQuickCss:!0,themeLinks:[],enabledThemes:[],enableReactDevtools:!1,frameless:!1,transparent:!1,winCtrlQ:!1,macosTranslucency:!1,disableMinSize:!1,winNativeTitleBar:!1,plugins:{},notifications:{timeout:5e3,position:"bottom-right",useNative:"not-focused",logLimit:50},cloud:{authenticated:!1,url:"https://api.vencord.dev/",settingsSync:!1,settingsSyncVersion:0}};try{Oo=JSON.parse(VencordNative.settings.get()),dr(Oo,ey)}catch(e){Oo=dr({},ey),ny.error(`An error occurred while loading the settings. Corrupt settings file? +`,e)}F2=bn(async()=>{L.cloud.settingsSync&&L.cloud.authenticated&&(await Zr(),delete mr.Vencord_settingsDirty)},6e4),Ma=new Set,ty={};Zn=Oo,L=ru(Oo)});var oy=g(()=>{});var ry=g(()=>{});var au={};Ue(au,{UpdateLogger:()=>hr,changes:()=>_o,checkForUpdates:()=>Jr,getRepo:()=>su,isNewer:()=>Ki,isOutdated:()=>Bo,maybePromptToUpdate:()=>Yi,update:()=>Qr,updateError:()=>Xr});async function Pa(e){let t=await e;if(t.ok)return t.value;throw Xr=t.error,t.error}async function Jr(){return _o=await Pa(VencordNative.updater.getUpdates()),_o.some(e=>e.hash===ln)?(Ki=!0,Bo=!1):Bo=_o.length>0}async function Qr(){if(!Bo)return!0;let e=await Pa(VencordNative.updater.update());if(e&&(Bo=!1,!await Pa(VencordNative.updater.rebuild())))throw new Error("The Build failed. Please try manually building the new update");return e}async function Yi(e,t=!1){try{if(await Jr()){let r=confirm(e);if(r&&Ki)return alert("Your local copy has more recent commits. Please stash or reset them.");r&&(await Qr(),un())}}catch(n){hr.error(n),alert("That also failed :( Try updating or re-installing with the installer!")}}var hr,Bo,Ki,Xr,_o,su,yr=g(()=>{"use strict";a();Hr();Je();Do();hr=new ie("Updater","white"),Bo=!1,Ki=!1;su=()=>Pa(VencordNative.updater.getRepo())});function iy(){Yi("Uh Oh! Failed to render this Page. However, there is an update available that might fix it. Would you like to update and restart now?")}var sy=g(()=>{"use strict";a();yr()});function lu(e){let t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments))}}var cu=g(()=>{"use strict";a()});function Tn({title:e,children:t}){return o(S.FormSection,null,o(oe,{variant:"heading-lg/semibold",tag:"h2",className:Y.bottom16},e),t)}function xn(e,t){return _.wrap(e,{message:`Failed to render the ${t} tab. If this issue persists, try using the installer to reinstall!`,onError:$2})}var $2,Fo=g(()=>{"use strict";a();oy();ry();le();sy();ct();cu();I();$2=lu(iy)});var uy={};Ue(uy,{default:()=>j2});function G2(){let[e,,t]=ot(VencordNative.settings.getSettingsDir,{fallbackValue:"Loading..."}),n=lt(),r=O.useMemo(()=>Math.random()>.5?ly:cy,[]),i=navigator.platform.toLowerCase().startsWith("win"),s=navigator.platform.toLowerCase().startsWith("mac"),l=[{key:"useQuickCss",title:"Enable Custom CSS",note:"Loads your Custom CSS"},{key:"enableReactDevtools",title:"Enable React Developer Tools",note:"Requires a full restart"},{key:"frameless",title:"Disable the window frame",note:"Requires a full restart"},!1,i&&{key:"winCtrlQ",title:"Register Ctrl+Q as shortcut to close Discord (Alternative to Alt+F4)",note:"Requires a full restart"},!1,!1];return o(Tn,{title:"Vencord Settings"},o(z2,{image:r}),o(S.FormSection,{title:"Quick Actions"},o(xt,{className:ay("quick-actions-card")},o(O.Fragment,null,o(E,{onClick:un,size:E.Sizes.SMALL},"Restart Client"),o(E,{onClick:()=>VencordNative.quickCss.openEditor(),size:E.Sizes.SMALL,disabled:e==="Loading..."},"Open QuickCSS File"),o(E,{onClick:()=>Sa(e),size:E.Sizes.SMALL,disabled:t},"Open Settings Folder"),o(E,{onClick:()=>VencordNative.native.openExternal("https://github.com/Vendicated/Vencord"),size:E.Sizes.SMALL,disabled:t},"Open in GitHub")))),o(S.FormDivider,null),o(S.FormSection,{className:Y.top16,title:"Settings",tag:"h5"},o(S.FormText,{className:Y.bottom20},'Hint: You can change the position of this settings section in the settings of the "Settings" plugin!'),l.map(c=>c&&o(pt,{key:c.key,value:n[c.key],onChange:u=>n[c.key]=u,note:c.note},c.title))),typeof Notification<"u"&&o(H2,{settings:n.notifications}))}function H2({settings:e}){return o(f,null,o(S.FormTitle,{tag:"h5"},"Notification Style"),e.useNative!=="never"&&Notification?.permission==="denied"&&o(Sn,{style:{padding:"1em"},className:Y.bottom8},o(S.FormTitle,{tag:"h5"},"Desktop Notification Permission denied"),o(S.FormText,null,"You have denied Notification Permissions. Thus, Desktop notifications will not work!")),o(S.FormText,{className:Y.bottom8},"Some plugins may show you notifications. These come in two styles:",o("ul",null,o("li",null,o("strong",null,"Vencord Notifications"),": These are in-app notifications"),o("li",null,o("strong",null,"Desktop Notifications"),": Native Desktop notifications (like when you get a ping)"))),o(An,{placeholder:"Notification Style",options:[{label:"Only use Desktop notifications when Discord is not focused",value:"not-focused",default:!0},{label:"Always use Desktop notifications",value:"always"},{label:"Always use Vencord notifications",value:"never"}],closeOnSelect:!0,select:t=>e.useNative=t,isSelected:t=>t===e.useNative,serialize:ra}),o(S.FormTitle,{tag:"h5",className:Y.top16+" "+Y.bottom8},"Notification Position"),o(An,{isDisabled:e.useNative==="always",placeholder:"Notification Position",options:[{label:"Bottom Right",value:"bottom-right",default:!0},{label:"Top Right",value:"top-right"}],select:t=>e.position=t,isSelected:t=>t===e.position,serialize:ra}),o(S.FormTitle,{tag:"h5",className:Y.top16+" "+Y.bottom8},"Notification Timeout"),o(S.FormText,{className:Y.bottom16},"Set to 0s to never automatically time out"),o(ir,{disabled:e.useNative==="always",markers:[0,1e3,2500,5e3,1e4,2e4],minValue:0,maxValue:2e4,initialValue:e.timeout,onValueChange:t=>e.timeout=t,onValueRender:t=>(t/1e3).toFixed(2)+"s",onMarkerRender:t=>t/1e3+"s",stickToMarkers:!1}),o(S.FormTitle,{tag:"h5",className:Y.top16+" "+Y.bottom8},"Notification Log Limit"),o(S.FormText,{className:Y.bottom16},"The amount of notifications to save in the log until old ones are removed. Set to ",o("code",null,"0")," to disable Notification log and ",o("code",null,"\u221E")," to never automatically remove old Notifications"),o(ir,{markers:[0,25,50,75,100,200],minValue:0,maxValue:200,stickToMarkers:!0,initialValue:e.logLimit,onValueChange:t=>e.logLimit=t,onValueRender:t=>t===200?"\u221E":t,onMarkerRender:t=>t===200?"\u221E":t}),o(E,{onClick:ma,disabled:e.logLimit===0},"Open Notification Log"))}function z2({image:e}){return o(xt,{className:ay("card","donate")},o("div",null,o(S.FormTitle,{tag:"h5"},"Support the Project"),o(S.FormText,null,"Please consider supporting the development of Vencord by donating!"),o(_i,{style:{transform:"translateX(-1em)"}})),o("img",{role:"presentation",src:e,alt:"",height:128,style:{imageRendering:e===cy?"pixelated":void 0,marginLeft:"auto",transform:e===ly?"rotate(10deg)":void 0}}))}var ay,ly,cy,j2,py=g(()=>{"use strict";a();fa();$();Ve();Sc();jr();ct();Be();Do();Oe();I();Fo();ay=Ge("vc-settings-"),ly="https://cdn.discordapp.com/emojis/1026533090627174460.png",cy="https://media.discordapp.net/stickers/1039992459209490513.png";j2=xn(G2,"Vencord Settings")});var dy=g(()=>{});var mu={};Ue(mu,{currentNotice:()=>Zi,nextNotice:()=>my,noticesQueue:()=>pu,popNotice:()=>du,showNotice:()=>Xi});function du(){uu.dismiss()}function my(){Zi=pu.shift(),Zi&&uu.show(...Zi,"VencordNotice")}function Xi(e,t,n){pu.push(["GENERIC",e,t,n]),Zi||my()}var uu,pu,Zi,Ia=g(()=>{"use strict";a();j();ut(e=>e.show&&e.dismiss&&!e.suppressAll,e=>uu=e);pu=[],Zi=null});var fy=g(()=>{});function pn({height:e=24,width:t=24,className:n,children:r,viewBox:i,...s}){return o("svg",{className:re(n,"vc-icon"),role:"img",width:t,height:e,viewBox:i,...s},r)}function Vr({height:e=24,width:t=24,className:n}){return o(pn,{height:e,width:t,className:re(n,"vc-link-icon"),viewBox:"0 0 24 24"},o("g",{fill:"none","fill-rule":"evenodd"},o("path",{fill:"currentColor",d:"M10.59 13.41c.41.39.41 1.03 0 1.42-.39.39-1.03.39-1.42 0a5.003 5.003 0 0 1 0-7.07l3.54-3.54a5.003 5.003 0 0 1 7.07 0 5.003 5.003 0 0 1 0 7.07l-1.49 1.49c.01-.82-.12-1.64-.4-2.42l.47-.48a2.982 2.982 0 0 0 0-4.24 2.982 2.982 0 0 0-4.24 0l-3.53 3.53a2.982 2.982 0 0 0 0 4.24zm2.82-4.24c.39-.39 1.03-.39 1.42 0a5.003 5.003 0 0 1 0 7.07l-3.54 3.54a5.003 5.003 0 0 1-7.07 0 5.003 5.003 0 0 1 0-7.07l1.49-1.49c-.01.82.12 1.64.4 2.43l-.47.47a2.982 2.982 0 0 0 0 4.24 2.982 2.982 0 0 0 4.24 0l3.53-3.53a2.982 2.982 0 0 0 0-4.24.973.973 0 0 1 0-1.42z"}),o("rect",{width:t,height:e})))}function gy(e){return o(pn,{...e,className:re(e.className,"vc-copy-icon"),viewBox:"0 0 24 24"},o("g",{fill:"currentColor"},o("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1z"}),o("path",{d:"M15 5H8c-1.1 0-1.99.9-1.99 2L6 21c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V11l-6-6zM8 21V7h6v5h5v9H8z"})))}function Ji(e){return o(pn,{...e,className:re(e.className,"vc-open-external-icon"),viewBox:"0 0 24 24"},o("polygon",{fill:"currentColor",fillRule:"nonzero",points:"13 20 11 20 11 8 5.5 13.5 4.08 12.08 12 4.16 19.92 12.08 18.5 13.5 13 8"}))}function vr(e){return o(pn,{...e,className:re(e.className,"vc-image-icon"),viewBox:"0 0 24 24"},o("path",{fill:"currentColor",d:"M21,19V5c0,-1.1 -0.9,-2 -2,-2H5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2zM8.5,13.5l2.5,3.01L14.5,12l4.5,6H5l3.5,-4.5z"}))}function Aa(e){return o(pn,{...e,className:re(e.className,"vc-info-icon"),viewBox:"0 0 24 24"},o("path",{fill:"currentColor",transform:"translate(2 2)",d:"M9,7 L11,7 L11,5 L9,5 L9,7 Z M10,18 C5.59,18 2,14.41 2,10 C2,5.59 5.59,2 10,2 C14.41,2 18,5.59 18,10 C18,14.41 14.41,18 10,18 L10,18 Z M10,4.4408921e-16 C4.4771525,-1.77635684e-15 4.4408921e-16,4.4771525 0,10 C-1.33226763e-15,12.6521649 1.0535684,15.195704 2.92893219,17.0710678 C4.80429597,18.9464316 7.3478351,20 10,20 C12.6521649,20 15.195704,18.9464316 17.0710678,17.0710678 C18.9464316,15.195704 20,12.6521649 20,10 C20,7.3478351 18.9464316,4.80429597 17.0710678,2.92893219 C15.195704,1.0535684 12.6521649,2.22044605e-16 10,0 L10,4.4408921e-16 Z M9,15 L11,15 L11,9 L9,9 L9,15 L9,15 Z"}))}function hy(e){return o(pn,{"aria-label":Ct.Messages.GUILD_OWNER,...e,className:re(e.className,"vc-owner-crown-icon"),role:"img",viewBox:"0 0 16 16"},o("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M13.6572 5.42868C13.8879 5.29002 14.1806 5.30402 14.3973 5.46468C14.6133 5.62602 14.7119 5.90068 14.6473 6.16202L13.3139 11.4954C13.2393 11.7927 12.9726 12.0007 12.6666 12.0007H3.33325C3.02725 12.0007 2.76058 11.792 2.68592 11.4954L1.35258 6.16202C1.28792 5.90068 1.38658 5.62602 1.60258 5.46468C1.81992 5.30468 2.11192 5.29068 2.34325 5.42868L5.13192 7.10202L7.44592 3.63068C7.46173 3.60697 7.48377 3.5913 7.50588 3.57559C7.5192 3.56612 7.53255 3.55663 7.54458 3.54535L6.90258 2.90268C6.77325 2.77335 6.77325 2.56068 6.90258 2.43135L7.76458 1.56935C7.89392 1.44002 8.10658 1.44002 8.23592 1.56935L9.09792 2.43135C9.22725 2.56068 9.22725 2.77335 9.09792 2.90268L8.45592 3.54535C8.46794 3.55686 8.48154 3.56651 8.49516 3.57618C8.51703 3.5917 8.53897 3.60727 8.55458 3.63068L10.8686 7.10202L13.6572 5.42868ZM2.66667 12.6673H13.3333V14.0007H2.66667V12.6673Z"}))}function yy(e){return o(pn,{...e,className:re(e.className,"vc-screenshare-icon"),viewBox:"0 0 24 24"},o("path",{fill:"currentColor",d:"M2 4.5C2 3.397 2.897 2.5 4 2.5H20C21.103 2.5 22 3.397 22 4.5V15.5C22 16.604 21.103 17.5 20 17.5H13V19.5H17V21.5H7V19.5H11V17.5H4C2.897 17.5 2 16.604 2 15.5V4.5ZM13.2 14.3375V11.6C9.864 11.6 7.668 12.6625 6 15C6.672 11.6625 8.532 8.3375 13.2 7.6625V5L18 9.6625L13.2 14.3375Z"}))}function Na(e){return o(pn,{...e,className:re(e.className,"vc-image-visible"),viewBox:"0 0 24 24"},o("path",{fill:"currentColor",d:"M5 21q-.825 0-1.413-.587Q3 19.825 3 19V5q0-.825.587-1.413Q4.175 3 5 3h14q.825 0 1.413.587Q21 4.175 21 5v14q0 .825-.587 1.413Q19.825 21 19 21Zm0-2h14V5H5v14Zm1-2h12l-3.75-5-3 4L9 13Zm-1 2V5v14Z"}))}function Ca(e){return o(pn,{...e,className:re(e.className,"vc-image-invisible"),viewBox:"0 0 24 24"},o("path",{fill:"currentColor",d:"m21 18.15-2-2V5H7.85l-2-2H19q.825 0 1.413.587Q21 4.175 21 5Zm-1.2 4.45L18.2 21H5q-.825 0-1.413-.587Q3 19.825 3 19V5.8L1.4 4.2l1.4-1.4 18.4 18.4ZM6 17l3-4 2.25 3 .825-1.1L5 7.825V19h11.175l-2-2Zm7.425-6.425ZM10.6 13.4Z"}))}function vy(e){return o(pn,{...e,className:re(e.className,"vc-microphone"),viewBox:"0 0 24 24"},o("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.99 11C14.99 12.66 13.66 14 12 14C10.34 14 9 12.66 9 11V5C9 3.34 10.34 2 12 2C13.66 2 15 3.34 15 5L14.99 11ZM12 16.1C14.76 16.1 17.3 14 17.3 11H19C19 14.42 16.28 17.24 13 17.72V21H11V17.72C7.72 17.23 5 14.41 5 11H6.7C6.7 14 9.24 16.1 12 16.1ZM12 4C11.2 4 11 4.66667 11 5V11C11 11.3333 11.2 12 12 12C12.8 12 13 11.3333 13 11V5C13 4.66667 12.8 4 12 4Z",fill:"currentColor"}),o("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.99 11C14.99 12.66 13.66 14 12 14C10.34 14 9 12.66 9 11V5C9 3.34 10.34 2 12 2C13.66 2 15 3.34 15 5L14.99 11ZM12 16.1C14.76 16.1 17.3 14 17.3 11H19C19 14.42 16.28 17.24 13 17.72V22H11V17.72C7.72 17.23 5 14.41 5 11H6.7C6.7 14 9.24 16.1 12 16.1Z",fill:"currentColor"}))}function Sy(e){return o(pn,{...e,className:re(e.className,"vc-cog-wheel"),viewBox:"0 0 24 24"},o("path",{clipRule:"evenodd",fill:"currentColor",d:"M19.738 10H22V14H19.739C19.498 14.931 19.1 15.798 18.565 16.564L20 18L18 20L16.565 18.564C15.797 19.099 14.932 19.498 14 19.738V22H10V19.738C9.069 19.498 8.203 19.099 7.436 18.564L6 20L4 18L5.436 16.564C4.901 15.799 4.502 14.932 4.262 14H2V10H4.262C4.502 9.068 4.9 8.202 5.436 7.436L4 6L6 4L7.436 5.436C8.202 4.9 9.068 4.502 10 4.262V2H14V4.261C14.932 4.502 15.797 4.9 16.565 5.435L18 3.999L20 5.999L18.564 7.436C19.099 8.202 19.498 9.069 19.738 10ZM12 16C14.2091 16 16 14.2091 16 12C16 9.79086 14.2091 8 12 8C9.79086 8 8 9.79086 8 12C8 14.2091 9.79086 16 12 16Z"}))}function fu(e){return o(pn,{...e,className:re(e.className,"vc-reply-icon"),viewBox:"0 0 24 24"},o("path",{fill:"currentColor",d:"M10 8.26667V4L3 11.4667L10 18.9333V14.56C15 14.56 18.5 16.2667 21 20C20 14.6667 17 9.33333 10 8.26667Z"}))}function by(e){return o(pn,{...e,className:re(e.className,"vc-delete-icon"),viewBox:"0 0 24 24"},o("path",{fill:"currentColor",d:"M15 3.999V2H9V3.999H3V5.999H21V3.999H15Z"}),o("path",{fill:"currentColor",d:"M5 6.99902V18.999C5 20.101 5.897 20.999 7 20.999H17C18.103 20.999 19 20.101 19 18.999V6.99902H5ZM11 17H9V11H11V17ZM15 17H13V11H15V17Z"}))}var Ht=g(()=>{"use strict";a();fy();Be();I()});function Ty(e,t,n){return n===!1?t?e.slice(0,-1):e:e[0]}function Qi(e,t,n=!1){let r=hn.duration(e,t),i=Q2.map(u=>({amount:r[u](),unit:u})),s=0;e:for(let u=0;uu==="days");if(l!==-1){let u=i[l],d=u.amount%7;d===0?i.splice(l,1):u.amount=d}let c="";for(;i.length;){let{amount:u,unit:d}=i.shift();c.length&&(c+=i.length?", ":" and "),(u>0||c.length)&&(c+=`${u} ${Ty(d,u===1,n)}`)}return c.length?c:`0 ${Ty(t,!1,n)}`}function V2(e,t=n=>n){let{length:n}=e;if(n===0)return"";if(n===1)return t(e[0]);let r="";for(let i=0;i2?r+=", ":n-i>1&&(r+=" and ");return r}function Vi(e,t){let n="```";return`${n}${t||""} ${e.replaceAll("```","\\`\\`\\`")} -${n}`}var yu,eM,tM,vu,nM,oM,rM,iM,sM,oo,aM,ro=g(()=>{"use strict";a();A();yu=e=>e.split(/(?=[A-Z])/).map(t=>t.toLowerCase()),eM=e=>e.toLowerCase().split("_"),tM=e=>e.toLowerCase().split("-"),vu=e=>e.split(/(?=[A-Z])/).map(t=>t.toLowerCase()),nM=e=>e.toLowerCase().split(" "),oM=e=>e.map((t,n)=>n?t[0].toUpperCase()+t.slice(1):t).join(""),rM=e=>e.join("_").toUpperCase(),iM=e=>e.join("-").toLowerCase(),sM=e=>e.map(t=>t[0].toUpperCase()+t.slice(1)).join(""),oo=e=>e.map(t=>t[0].toUpperCase()+t.slice(1)).join(" "),aM=["years","months","weeks","days","hours","minutes","seconds"]});function Vi(){return`-${zn.fromTimestamp(Date.now())}`}function ue(e,t){let n=cM.createBotMessage({channelId:e,content:"",embeds:[]});return uM.receiveMessage(e,dr(t,n)),t}function it(e,t,n){return e.find(r=>r.name===t)?.value||n}var cM,uM,Su=g(()=>{"use strict";a();Re();j();A();cM=I("createBotMessage"),uM=I("receiveMessage")});var io,Dn,bu,Ca=g(()=>{"use strict";a();io=(h=>(h[h.SUB_COMMAND=1]="SUB_COMMAND",h[h.SUB_COMMAND_GROUP=2]="SUB_COMMAND_GROUP",h[h.STRING=3]="STRING",h[h.INTEGER=4]="INTEGER",h[h.BOOLEAN=5]="BOOLEAN",h[h.USER=6]="USER",h[h.CHANNEL=7]="CHANNEL",h[h.ROLE=8]="ROLE",h[h.MENTIONABLE=9]="MENTIONABLE",h[h.NUMBER=10]="NUMBER",h[h.ATTACHMENT=11]="ATTACHMENT",h))(io||{}),Dn=(s=>(s[s.BUILT_IN=0]="BUILT_IN",s[s.BUILT_IN_TEXT=1]="BUILT_IN_TEXT",s[s.BUILT_IN_INTEGRATION=2]="BUILT_IN_INTEGRATION",s[s.BOT=3]="BOT",s[s.PLACEHOLDER=4]="PLACEHOLDER",s))(Dn||{}),bu=(r=>(r[r.CHAT_INPUT=1]="CHAT_INPUT",r[r.USER=2]="USER",r[r.MESSAGE=3]="MESSAGE",r))(bu||{})});var wu={};Be(wu,{ApplicationCommandInputType:()=>Dn,ApplicationCommandOptionType:()=>io,ApplicationCommandType:()=>bu,BUILT_IN:()=>_o,OptionalMessageOption:()=>Bo,RequiredMessageOption:()=>es,_handleCommand:()=>dM,_init:()=>pM,commands:()=>Tu,findOption:()=>it,generateId:()=>Vi,prepareOption:()=>xu,registerCommand:()=>Qr,sendBotMessage:()=>ue,unregisterCommand:()=>ts});function xu(e){return e.displayName||=e.name,e.displayDescription||=e.description,e.options?.forEach((t,n,r)=>{t===wy?r[n]=Bo:t===My&&(r[n]=es),t.choices?.forEach(i=>i.displayName||=i.name),xu(r[n])}),e}function mM(e,t){e.options?.forEach(n=>{if(n.type!==1)throw new Error("When specifying sub-command options, all options must be sub-commands.");let r={...e,...n,type:1,name:`${e.name} ${n.name}`,id:`${n.name}-${e.id}`,displayName:`${e.name} ${n.name}`,subCommandPath:[{name:n.name,type:n.type,displayName:n.name}],rootCommand:e};Qr(r,t)})}function Qr(e,t){if(!_o){console.warn("[CommandsAPI]",`Not registering ${e.name} as the CommandsAPI hasn't been initialised.`,"Please restart to use commands");return}if(_o.some(n=>n.name===e.name))throw new Error(`Command '${e.name}' already exists.`);if(e.isVencordCommand=!0,e.id??=`-${_o.length+1}`,e.applicationId??="-1",e.type??=1,e.inputType??=1,e.plugin||=t,xu(e),e.options?.[0]?.type===1){mM(e,t);return}Tu[e.name]=e,_o.push(e)}function ts(e){let t=_o.findIndex(n=>n.name===e);return t===-1?!1:(_o.splice(t,1),delete Tu[e],!0)}var _o,Tu,wy,My,Bo,es,pM,dM,Qt=g(()=>{"use strict";a();ro();Su();Ca();Su();Ca();Tu={},wy=Symbol("OptionalMessageOption"),My=Symbol("RequiredMessageOption"),Bo=wy,es=My,pM=function(e){try{_o=e,Bo=e.find(t=>t.name==="shrug").options[0],es=e.find(t=>t.name==="me").options[0]}catch{console.error("Failed to load CommandsApi")}return e},dM=function(e,t,n){if(!e.isVencordCommand)return e.execute(t,n);let r=i=>{let s=`An Error occurred while executing command "${e.name}"`,l=i instanceof Error?i.stack||i.message:String(i);console.error(s,i),ue(n.channel.id,{content:`${s}: -${Qi(l)}`,author:{username:"Vencord"}})};try{let i=e.execute(t,n);return i instanceof Promise?i.catch(r):i}catch(i){return r(i)}}});function Py({text:e,color:t}){return o("div",{className:"vc-plugins-badge",style:{backgroundColor:t,justifySelf:"flex-end",marginLeft:"auto"}},e)}var Mu=g(()=>{"use strict";a()});function Iy({option:e,pluginSettings:t,definedSettings:n,id:r,onChange:i,onError:s}){let l=t[r]??e.default,[c,u]=O.useState(l??!1),[p,m]=O.useState(null);O.useEffect(()=>{s(p!==null)},[p]);function h(v){let T=e.isValid?.call(n,v)??!0;typeof T=="string"?m(T):T?(m(null),u(v),i(v)):m("Invalid input provided.")}return o(S.FormSection,null,o(pt,{value:c,onChange:h,note:e.description,disabled:e.disabled?.call(n)??!1,...e.componentProps,hideBorder:!0,style:{marginBottom:"0.5em"}},oo(yu(r))),p&&o(S.FormText,{style:{color:"var(--text-danger)"}},p))}var Ay=g(()=>{"use strict";a();ro();A()});function Ny({option:e,onChange:t,onError:n}){return e.component({setValue:t,setError:n,option:e})}var Cy=g(()=>{"use strict";a()});function Pu({option:e,pluginSettings:t,definedSettings:n,id:r,onChange:i,onError:s}){function l(v){return e.type===2?BigInt(v):Number(v)}let[c,u]=O.useState(`${t[r]??e.default??0}`),[p,m]=O.useState(null);O.useEffect(()=>{s(p!==null)},[p]);function h(v){let T=e.isValid?.call(n,v)??!0;m(null),typeof T=="string"?m(T):T||m("Invalid input provided."),e.type===1&&BigInt(v)>=fM?(u(`${Number.MAX_SAFE_INTEGER}`),i(l(v))):(u(v),i(l(v)))}return o(S.FormSection,null,o(S.FormTitle,null,e.description),o(Ve,{type:"number",pattern:"-?[0-9]+",value:c,onChange:h,placeholder:e.placeholder??"Enter a number",disabled:e.disabled?.call(n)??!1,...e.componentProps}),p&&o(S.FormText,{style:{color:"var(--text-danger)"}},p))}var fM,ky=g(()=>{"use strict";a();w();A();fM=BigInt(Number.MAX_SAFE_INTEGER)});function Ry({option:e,pluginSettings:t,definedSettings:n,onChange:r,onError:i,id:s}){let l=t[s]??e.options?.find(v=>v.default)?.value,[c,u]=O.useState(l??null),[p,m]=O.useState(null);O.useEffect(()=>{i(p!==null)},[p]);function h(v){let T=e.isValid?.call(n,v)??!0;typeof T=="string"?m(T):T?(m(null),u(v),r(v)):m("Invalid input provided.")}return o(S.FormSection,null,o(S.FormTitle,null,e.description),o(Pn,{isDisabled:e.disabled?.call(n)??!1,options:e.options,placeholder:e.placeholder??"Select an option",maxVisibleItems:5,closeOnSelect:!0,select:h,isSelected:v=>v===c,serialize:v=>String(v),...e.componentProps}),p&&o(S.FormText,{style:{color:"var(--text-danger)"}},p))}var Ly=g(()=>{"use strict";a();A()});function Fo(e,t,n=1){let r=[];for(let i=e;i<=t;i+=n)r.push(Math.round(i*100)/100);return r}function Ey({option:e,pluginSettings:t,definedSettings:n,id:r,onChange:i,onError:s}){let l=t[r]??e.default,[c,u]=O.useState(null);O.useEffect(()=>{s(c!==null)},[c]);function p(m){let h=e.isValid?.call(n,m)??!0;typeof h=="string"?u(h):h?(u(null),i(m)):u("Invalid input provided.")}return o(S.FormSection,null,o(S.FormTitle,null,e.description),o(ir,{disabled:e.disabled?.call(n)??!1,markers:e.markers,minValue:e.markers[0],maxValue:e.markers[e.markers.length-1],initialValue:l,onValueChange:p,onValueRender:m=>String(m.toFixed(2)),stickToMarkers:e.stickToMarkers??!0,...e.componentProps}))}var Iu=g(()=>{"use strict";a();A()});function Dy({option:e,pluginSettings:t,definedSettings:n,id:r,onChange:i,onError:s}){let[l,c]=O.useState(t[r]??e.default??null),[u,p]=O.useState(null);O.useEffect(()=>{s(u!==null)},[u]);function m(h){let v=e.isValid?.call(n,h)??!0;p(typeof v=="string"?v:v?null:"Invalid input provided."),c(h),i(h)}return o(S.FormSection,null,o(S.FormTitle,null,e.description),o(Ve,{type:"text",value:l,onChange:m,placeholder:e.placeholder??"Enter a value",disabled:e.disabled?.call(n)??!1,...e.componentProps}),u&&o(S.FormText,{style:{color:"var(--text-danger)"}},u))}var Oy=g(()=>{"use strict";a();A()});var ka=g(()=>{"use strict";a();Mu();Ay();Cy();ky();Ly();Iu();Oy()});var _y=g(()=>{});function Vr(){return Q.getChannel(Pe.getChannelId())}function Au(){return Te.getGuild(Vr()?.guild_id)}function yM(e){mc.openPrivateChannel(e)}function Uo(){return Ni.PreloadedUserSettingsActionCreators.getCurrentValue()?.appearance?.theme}function so(e){wo.dispatchToLastSubscribed("INSERT_TEXT",{rawText:e,plainText:e})}function vM(e,t,n,r){let i={content:"",invalidEmojis:[],tts:!1,validNonShortcutEmojis:[],...t};return gM.sendMessage(e,i,n,r)}function On(e,t){return je(n=>o(ze,{...n,className:Xs.modal,size:"dynamic"},o(xc,{className:Xs.image,original:e,placeholder:e,src:e,renderLinkComponent:r=>o(_r,{...r}),shouldHideMediaOptions:!1,shouldAnimate:!0,...t})))}async function _n(e){if(!await Rt.getUser(e))throw new Error("No such user: "+e);let n=on.getGuildId();hM.openUserProfileModal({userId:e,guildId:n,channelId:Pe.getChannelId(),analyticsLocation:{page:n?"Guild Channel":"DM Channel",section:"Profile Popout"}})}async function Nu(e,t){let n=nn.getUserProfile(e);if(n)return n;F.dispatch({type:"USER_PROFILE_FETCH_START",userId:e});let{body:r}=await Mt.get({url:`/users/${e}/profile`,query:{with_mutual_guilds:!1,with_mutual_friends_count:!1,...t},oldFormErrors:!0});return F.dispatch({type:"USER_UPDATE",user:r.user}),await F.dispatch({type:"USER_PROFILE_FETCH_SUCCESS",...r}),t?.guild_id&&r.guild_member&&F.dispatch({type:"GUILD_MEMBER_PROFILE_UPDATE",guildId:t.guild_id,guildMember:r.guild_member}),nn.getUserProfile(e)}function ao(e){return e.discriminator==="0"?e.username:e.tag}var gM,hM,ns,bt=g(()=>{"use strict";a();j();A();dt();gM=I("editMessage","sendMessage"),hM=I("openUserProfileModal","closeUserProfileModal");ns=(n=>(n[n.Dark=1]="Dark",n[n.Light=2]="Light",n))(ns||{})});function By(e){je(t=>o(ze,{...t},o(_,null,o(et,{className:ei("root")},o(PM,{user:e})))))}function wM(){let e=Uo()===2?TM:xM;return o("img",{src:e,alt:"GitHub"})}function MM(){let e=Uo()===2?bM:SM;return o("img",{src:e,alt:"Website"})}function PM({user:e}){ct();let t=He([nn],()=>nn.getUserProfile(e.id));De(()=>{!t&&!e.bot&&e.id&&Nu(e.id)},[e.id]);let n=t?.connectedAccounts?.find(s=>s.type==="github")?.name,r=t?.connectedAccounts?.find(s=>s.type==="domain")?.name,i=Nt(()=>{let s=Object.values(Oe);return(Gr[e.id]?s.filter(c=>c.authors.includes(Gr[e.id])):s.filter(c=>c.authors.some(u=>u.name===e.username))).filter(c=>!c.name.endsWith("API")).sort((c,u)=>Number(c.required??!1)-Number(u.required??!1))},[e.id,e.username]);return o(f,null,o("div",{className:ei("header")},o("img",{className:ei("avatar"),src:e.getAvatarURL(void 0,512,!0),alt:""}),o(S.FormTitle,{tag:"h2",className:ei("name")},e.username),o("div",{className:ei("links")},r&&o(_r,{href:"https://"+r},o(MM,null)),n&&o(_r,{href:`https://github.com/${n}`},o(wM,null)))),o("div",{className:ei("plugins")},i.map(s=>o(Ra,{key:s.name,plugin:s,disabled:s.required??!1,onRestartNeeded:()=>fn("Restart to apply changes!")}))))}var SM,bM,TM,xM,ei,Fy=g(()=>{"use strict";a();_y();$();Je();le();P();bt();dt();A();gr();Cu();SM="/assets/e1e96d89e192de1997f73730db26e94f.svg",bM="/assets/730f58bcfd5a57a5e22460c445a0c6cf.svg",TM="/assets/3ff98ad75ac94fa883af5ed62d17c459.svg",xM="/assets/6a853b4c87fce386cbfef4a2efbacb09.svg",ei=Ue("vc-author-modal-")});function Uy(e){let t=new AM({username:e.username,id:e.id??Vi(),avatar:e.avatar,bot:!0});return F.dispatch({type:"USER_UPDATE",user:t}),t}function Ru({plugin:e,onRestartNeeded:t,onClose:n,transitionState:r}){let[i,s]=O.useState([]),l=ct().plugins[e.name],[c,u]=O.useState({}),[p,m]=O.useState({}),[h,v]=O.useState(null),T=()=>Object.values(p).every(k=>!k),M=Boolean(l&&e.options&&!Li(e.options));O.useEffect(()=>{(async()=>{for(let k of e.authors.slice(0,6)){let B=k.id?await Rt.getUser(`${k.id}`).catch(()=>Uy({username:k.name})):Uy({username:k.name});s(U=>[...U,B])}})()},[]);async function b(){if(!e.options){n();return}if(e.beforeSave){let B=await Promise.resolve(e.beforeSave(c));if(B!==!0){v(B);return}}let k=!1;for(let[B,U]of Object.entries(c)){let Y=e.options[B];l[B]=U,Y?.onChange?.(U),Y?.restartNeeded&&(k=!0)}k&&t(),n()}function x(){if(!M||!e.options)return o(S.FormText,null,"There are no settings for this plugin.");{let k=Object.entries(e.options).map(([B,U])=>{if(U.hidden)return null;function Y(L){u(X=>({...X,[B]:L}))}function K(L){m(X=>({...X,[B]:L}))}let z=NM[U.type];return o(z,{id:B,key:B,option:U,onChange:Y,onError:K,pluginSettings:l,definedSettings:e.settings})});return o(ge,{flexDirection:"column",style:{gap:12,marginBottom:16}},k)}}function N(k,B){let U=e.authors.length-B,Y=e.authors.length-U,K=Y+e.authors.length-B;return o(V,{text:e.authors.slice(Y,K).map(z=>z.name).join(", ")},({onMouseEnter:z,onMouseLeave:L})=>o("div",{className:ku.moreUsers,onMouseEnter:z,onMouseLeave:L},"+",U))}return o(ze,{transitionState:r,size:"medium",className:"vc-text-selectable"},o(lt,{separator:!1},o(re,{variant:"heading-lg/semibold",style:{flexGrow:1}},e.name),o(an,{onClick:n})),o(et,null,o(S.FormSection,null,o(S.FormTitle,{tag:"h3"},"About ",e.name),o(S.FormText,null,e.description),o(S.FormTitle,{tag:"h3",style:{marginTop:8,marginBottom:0}},"Authors"),o("div",{style:{width:"fit-content",marginBottom:8}},o(IM,{users:i,count:e.authors.length,guildId:void 0,renderIcon:!1,max:6,showDefaultAvatarsForNullUsers:!0,showUserPopout:!0,renderMoreUsers:N,renderUser:k=>o(Dr,{className:ku.clickableAvatar,onClick:()=>By(k)},o("img",{className:ku.avatar,src:k.getAvatarURL(void 0,80,!0),alt:k.username,title:k.username}))}))),!!e.settingsAboutComponent&&o("div",{className:oe(q.bottom8,"vc-text-selectable")},o(S.FormSection,null,o(_,{message:"An error occurred while rendering this plugin's custom InfoComponent"},o(e.settingsAboutComponent,{tempSettings:c})))),o(S.FormSection,{className:q.bottom16},o(S.FormTitle,{tag:"h3"},"Settings"),x())),M&&o(_t,null,o(ge,{flexDirection:"column",style:{width:"100%"}},o(ge,{style:{marginLeft:"auto"}},o(R,{onClick:n,size:R.Sizes.SMALL,color:R.Colors.PRIMARY,look:R.Looks.LINK},"Cancel"),o(V,{text:"You must fix all errors before saving",shouldShow:!T()},({onMouseEnter:k,onMouseLeave:B})=>o(R,{size:R.Sizes.SMALL,color:R.Colors.BRAND,onClick:b,onMouseEnter:k,onMouseLeave:B,disabled:!T()},"Save & Close"))),h&&o(re,{variant:"text-md/semibold",style:{color:"var(--text-danger)"}},"Error while saving: ",h))))}var IM,ku,AM,NM,$y=g(()=>{"use strict";a();Qt();$();le();Lt();wn();at();Re();dt();w();j();A();ka();Fy();IM=Xe("defaultRenderUser","showDefaultAvatarsForNullUsers"),ku=I("moreUsers","emptyUser","avatarContainer","clickableAvatar"),AM=yt(()=>W.getCurrentUser().constructor);NM={[0]:Dy,[1]:Pu,[2]:Pu,[3]:Iy,[4]:Ry,[5]:Ey,[6]:Ny}});var Gy=g(()=>{});var Hy=g(()=>{});function zy({checked:e,onChange:t,disabled:n}){return o("div",null,o("div",{className:oe(La.container,"default-colors",e?La.checked:void 0),style:{backgroundColor:e?Lu:Eu,opacity:n?.3:1}},o("svg",{className:La.slider+" vc-switch-slider",viewBox:"0 0 28 20",preserveAspectRatio:"xMinYMid meet","aria-hidden":"true",style:{transform:e?"translateX(12px)":"translateX(-3px)"}},o("rect",{fill:"white",x:"4",y:"0",height:"20",width:"20",rx:"10"}),o("svg",{viewBox:"0 0 20 20",fill:"none"},e?o(f,null,o("path",{fill:Lu,d:"M7.89561 14.8538L6.30462 13.2629L14.3099 5.25755L15.9009 6.84854L7.89561 14.8538Z"}),o("path",{fill:Lu,d:"M4.08643 11.0903L5.67742 9.49929L9.4485 13.2704L7.85751 14.8614L4.08643 11.0903Z"})):o(f,null,o("path",{fill:Eu,d:"M5.13231 6.72963L6.7233 5.13864L14.855 13.2704L13.264 14.8614L5.13231 6.72963Z"}),o("path",{fill:Eu,d:"M13.2704 5.13864L14.8614 6.72963L6.72963 14.8614L5.13864 13.2704L13.2704 5.13864Z"})))),o("input",{disabled:n,type:"checkbox",className:La.input,tabIndex:0,checked:e,onChange:r=>t(r.currentTarget.checked)})))}var Lu,Eu,La,jy=g(()=>{"use strict";a();Hy();Re();j();Lu="var(--green-360)",Eu="var(--primary-400)",La=I("slider","input","container")});function Ea({disabled:e,isNew:t,name:n,infoButton:r,footer:i,author:s,enabled:l,setEnabled:c,description:u,onMouseEnter:p,onMouseLeave:m}){return o("div",{className:ti("card",{"card-disabled":e}),onMouseEnter:p,onMouseLeave:m},o("div",{className:ti("header")},o("div",{className:ti("name-author")},o(re,{variant:"text-md/bold",className:ti("name")},n,t&&o(Py,{text:"NEW",color:"#ED4245"})),!!s&&o(re,{variant:"text-md/normal",className:ti("author")},s)),r,o(zy,{checked:l,onChange:c,disabled:e})),o(re,{className:ti("note"),variant:"text-sm/normal"},u),i)}var ti,Du=g(()=>{"use strict";a();Gy();Je();Mu();jy();A();ti=Ue("vc-addon-")});var os,Ou=g(()=>{"use strict";a();os=class{set=new Set;get changeCount(){return this.set.size}get hasChanges(){return this.changeCount>0}handleChange(t){this.set.delete(t)||this.set.add(t)}add(t){return this.set.add(t)}remove(t){return this.set.delete(t)}getChanges(){return this.set.values()}map(t){return[...this.getChanges()].map(t)}}});var Uu={};Be(Uu,{PMLogger:()=>CM,isPluginEnabled:()=>Bu,patches:()=>qy,plugins:()=>kM,startAllPlugins:()=>rs,startDependenciesRecursive:()=>Da,startPlugin:()=>is,stopPlugin:()=>Fu});function Bu(e){return(Oe[e]?.required||Oe[e]?.isDependency||_u[e]?.enabled)??!1}function Da(e){let t=!1,n=[];return e.dependencies?.forEach(r=>{if(!E.plugins[r].enabled){if(Da(Oe[r]),E.plugins[r].enabled=!0,Oe[r].patches){Vt.warn(`Enabling dependency ${r} requires restart.`),t=!0;return}is(Oe[r])||n.push(r)}}),{restartNeeded:t,failures:n}}var Vt,CM,kM,qy,_u,Ky,rs,is,Fu,Oa=g(()=>{"use strict";a();Qt();$();Ze();w();A();gr();qs();Vt=new ie("PluginManager","#a6d189"),CM=Vt,kM=Oe,qy=[],_u=E.plugins;Ky=Object.values(Oe);for(let e of Ky)_u[e.name]?.enabled&&e.dependencies?.forEach(t=>{let n=Oe[t];if(n)_u[t].enabled=!0,n.isDependency=!0;else{let r=new Error(`Plugin ${e.name} has unresolved dependency ${t}`);Vt.warn(r)}});for(let e of Ky){if(e.settings){e.settings.pluginName=e.name,e.options??={};for(let[t,n]of Object.entries(e.settings.def)){let r=e.settings.checks?.[t];e.options[t]={...n,...r}}}if(e.patches&&Bu(e.name))for(let t of e.patches)t.plugin=e.name,Array.isArray(t.replacement)||(t.replacement=[t.replacement]),qy.push(t)}rs=$n("startAllPlugins",function(t){Vt.info(`Starting plugins (stage ${t})`);for(let n in Oe)if(Bu(n)){if((Oe[n].startAt??"WebpackReady")!==t)continue;is(Oe[n])}});is=$n("startPlugin",function(t){let{name:n,commands:r,flux:i}=t;if(t.start){if(Vt.info("Starting plugin",n),t.started)return Vt.warn(`${n} already started`),!1;try{t.start(),t.started=!0}catch(s){return Vt.error(`Failed to start ${n} -`,s),!1}}if(r?.length){Vt.info("Registering commands of plugin",n);for(let s of r)try{Qr(s,n)}catch(l){return Vt.error(`Failed to register command ${s.name} -`,l),!1}}if(i)for(let s in i)F.subscribe(s,i[s]);return!0},e=>`startPlugin ${e.name}`),Fu=$n("stopPlugin",function(t){let{name:n,commands:r,flux:i}=t;if(t.stop){if(Vt.info("Stopping plugin",n),!t.started)return Vt.warn(`${n} already stopped`),!1;try{t.stop(),t.started=!1}catch(s){return Vt.error(`Failed to stop ${n} -`,s),!1}}if(r?.length){Vt.info("Unregistering commands of plugin",n);for(let s of r)try{ts(s.name)}catch(l){return Vt.error(`Failed to unregister command ${s.name} -`,l),!1}}if(i)for(let s in i)F.unsubscribe(s,i[s]);return!0},e=>`stopPlugin ${e.name}`)});function LM(e){ee.show({message:e,type:ee.Type.FAILURE,id:ee.genId(),options:{position:ee.Position.BOTTOM}})}function EM({required:e}){return o(wt,{className:Sr("info-card",{"restart-card":e})},e?o(f,null,o(S.FormTitle,{tag:"h5"},"Restart required!"),o(S.FormText,{className:Sr("dep-text")},"Restart now to apply new plugins and their settings"),o(R,{color:R.Colors.YELLOW,onClick:()=>location.reload()},"Restart")):o(f,null,o(S.FormTitle,{tag:"h5"},"Plugin Management"),o(S.FormText,null,"Press the cog wheel or info icon to get more info on a plugin"),o(S.FormText,null,"Plugins with a cog wheel have settings you can modify!")))}function Ra({plugin:e,disabled:t,onRestartNeeded:n,onMouseEnter:r,onMouseLeave:i,isNew:s}){let l=E.plugins[e.name],c=()=>l.enabled??!1;function u(){_i(async()=>m=>o(Ru,{...m,plugin:e,onRestartNeeded:()=>n(e.name)}))}function p(){let m=c();if(!m){let{restartNeeded:v,failures:T}=Da(e);if(T.length){Yy.error(`Failed to start dependencies for ${e.name}: ${T.join(", ")}`),Zi("Failed to start dependencies: "+T.join(", "),"Close",()=>null);return}else if(v){l.enabled=!0,n(e.name);return}}if(e.patches?.length){l.enabled=!m,n(e.name);return}if(m&&!e.started){l.enabled=!m;return}if(!(m?Fu(e):is(e))){l.enabled=!1;let v=`Error while ${m?"stopping":"starting"} plugin ${e.name}`;Yy.error(v),LM(v);return}l.enabled=!m}return o(Ea,{name:e.name,description:e.description,isNew:s,enabled:c(),setEnabled:p,disabled:t,onMouseEnter:r,onMouseLeave:i,infoButton:o("button",{role:"switch",onClick:()=>u(),className:oe(RM.button,Sr("info-button"))},e.options&&!Li(e.options)?o(by,null):o(Ia,null))})}function $u(){let e=ct(),t=O.useMemo(()=>new os,[]);O.useEffect(()=>()=>void(t.hasChanges&&rn.show({title:"Restart required",body:o(f,null,o("p",null,"The following plugins require a restart:"),o("div",null,t.map((v,T)=>o(f,null,T>0&&", ",Fe.parse("`"+v+"`"))))),confirmText:"Restart now",cancelText:"Later!",onConfirm:()=>location.reload()})),[]);let n=O.useMemo(()=>{let v={};for(let T in Oe){let M=Oe[T].dependencies;if(M)for(let b of M)v[b]??=[],v[b].push(T)}return v},[]),r=O.useMemo(()=>Object.values(Oe).sort((v,T)=>v.name.localeCompare(T.name)),[]),[i,s]=O.useState({value:"",status:0}),l=v=>s(T=>({...T,value:v})),c=v=>s(T=>({...T,status:v})),u=v=>{let T=e.plugins[v.name]?.enabled;if(T&&i.status===2||!T&&i.status===1||i.status===3&&!p?.includes(v.name))return!1;if(!i.value.length)return!0;let M=i.value.toLowerCase();return v.name.toLowerCase().includes(M)||v.description.toLowerCase().includes(M)||v.tags?.some(b=>b.toLowerCase().includes(M))},[p]=rt(()=>It("Vencord_existingPlugins").then(v=>{let T=Date.now()/1e3,M={},b=Object.values(r).map(N=>N.name),x=[];for(let{name:N}of r)(M[N]=v?.[N]??T)+60*60*24*2>T&&x.push(N);return Xt("Vencord_existingPlugins",M),cr.isEqual(x,b)?[]:x})),m,h;if(r?.length){m=[],h=[];for(let v of r){if(!v.options&&v.name.endsWith("API")&&i.value!=="API"||!u(v))continue;if(v.required||n[v.name]?.some(M=>e.plugins[M].enabled)){let M=v.required?"This plugin is required for Vencord to function.":DM(n[v.name]?.filter(b=>e.plugins[b].enabled));h.push(o(V,{text:M,key:v.name},({onMouseLeave:b,onMouseEnter:x})=>o(Ra,{onMouseLeave:b,onMouseEnter:x,onRestartNeeded:N=>t.handleChange(N),disabled:!0,plugin:v})))}else m.push(o(Ra,{onRestartNeeded:M=>t.handleChange(M),disabled:!1,plugin:v,isNew:p?.includes(v.name),key:v.name}))}}else m=h=o(re,{variant:"text-md/normal"},"No plugins meet search criteria.");return o(vn,{title:"Plugins"},o(EM,{required:t.hasChanges}),o(S.FormTitle,{tag:"h5",className:oe(q.top20,q.bottom8)},"Filters"),o("div",{className:Sr("filter-controls")},o(Ve,{autoFocus:!0,value:i.value,placeholder:"Search for a plugin...",onChange:l,className:q.bottom20}),o("div",{className:Zy.inputWrapper},o(Pn,{className:Zy.inputDefault,options:[{label:"Show All",value:0,default:!0},{label:"Show Enabled",value:1},{label:"Show Disabled",value:2},{label:"Show New",value:3}],serialize:String,select:c,isSelected:v=>v===i.status,closeOnSelect:!0}))),o(S.FormTitle,{className:q.top20},"Plugins"),o("div",{className:Sr("grid")},m),o(S.FormDivider,{className:q.top20}),o(S.FormTitle,{tag:"h5",className:oe(q.top20,q.bottom8)},"Required Plugins"),o("div",{className:Sr("grid")},h))}function DM(e){return o(O.Fragment,null,o(S.FormText,null,"This plugin is required by:"),e.map(t=>o(S.FormText,{className:Sr("dep-text")},t)))}var Sr,Yy,Zy,RM,Cu=g(()=>{"use strict";a();my();Wn();Pa();$();Je();$t();$y();Du();Oo();Ou();Ze();at();Re();dt();Qe();j();A();gr();Oa();Sr=Ue("vc-plugins-"),Yy=new ie("PluginSettings","#a6d189"),Zy=I("inputDefault","inputWrapper"),RM=I("button","disabled","enabled")});var Xy={};Be(Xy,{default:()=>OM});var OM,Jy=g(()=>{"use strict";a();Cu();Oo();OM=Sn($u,"Plugins")});function st(e){return e.disabled&&(e.style??={},e.style.pointerEvents="none",e["aria-disabled"]=!0),o("a",{role:"link",target:"_blank",...e},e.children)}var lo=g(()=>{"use strict";a()});var Qy={};Be(Qy,{default:()=>zM});function UM({link:e}){let[t,n,r]=rt(()=>fetch(e).then(s=>{if(s.status>300)throw`${s.status} ${s.statusText}`;let l=s.headers.get("Content-Type");if(!l?.startsWith("text/css")&&!l?.startsWith("text/plain"))throw"Not a CSS file. Remember to use the raw link!";return"Okay!"})),i=r?"Checking...":n?`Error: ${n instanceof Error?n.message:String(n)}`:"Valid!";return o(S.FormText,{style:{color:r?"var(--text-muted)":n?"var(--text-danger)":"var(--text-positive)"}},i)}function $M({themeLinks:e}){return e.length?o(f,null,o(S.FormTitle,{className:q.top20,tag:"h5"},"Validator"),o(S.FormText,null,"This section will tell you whether your themes can successfully be loaded"),o("div",null,e.map(t=>o(wt,{style:{padding:".5em",marginBottom:".5em",marginTop:".5em"},key:t},o(S.FormTitle,{tag:"h5",style:{overflowWrap:"break-word"}},t),o(UM,{link:t}))))):null}function GM({theme:e,enabled:t,onChange:n,onDelete:r}){return o(Ea,{name:e.name,description:e.description,author:e.author,enabled:t,setEnabled:n,infoButton:!1,footer:o(ge,{flexDirection:"row",style:{gap:"0.2em"}},!!e.website&&o(st,{href:e.website},"Website"),!!(e.website&&e.invite)&&" \u2022 ",!!e.invite&&o(st,{href:`https://discord.gg/${e.invite}`,onClick:async i=>{i.preventDefault();let{invite:s}=await _M.resolveInvite(e.invite,"Desktop Modal");if(!s)return fn("Invalid or expired invite");F.dispatch({type:"INVITE_MODAL_OPEN",invite:s,code:e.invite,context:"APP"})}},"Discord Server"))})}function HM(){let e=ct(["themeLinks","enabledThemes"]),t=Yt(null),[n,r]=J(0),[i,s]=J(e.themeLinks.join(` -`)),[l,c]=J(null),[u,,p]=rt(VencordNative.themes.getThemesDir);De(()=>{m()},[]);async function m(){let x=await VencordNative.themes.getThemesList();c(x)}function h(x,N){if(N){if(e.enabledThemes.includes(x))return;e.enabledThemes=[...e.enabledThemes,x]}else e.enabledThemes=e.enabledThemes.filter(k=>k!==x)}async function v(x){if(x.stopPropagation(),x.preventDefault(),!x.currentTarget?.files?.length)return;let{files:N}=x.currentTarget,k=Array.from(N,B=>{let{name:U}=B;if(!!U.endsWith(".css"))return new Promise((Y,K)=>{let z=new FileReader;z.onload=()=>{VencordNative.themes.uploadTheme(U,z.result).then(Y).catch(K)},z.readAsText(B)})});await Promise.all(k),m()}function T(){return o(f,null,o(wt,{className:"vc-settings-card"},o(S.FormTitle,{tag:"h5"},"Find Themes:"),o("div",{style:{marginBottom:".5em",display:"flex",flexDirection:"column"}},o(st,{style:{marginRight:".5em"},href:"https://betterdiscord.app/themes"},"BetterDiscord Themes"),o(st,{href:"https://github.com/search?q=discord+theme"},"GitHub")),o(S.FormText,null,'If using the BD site, click on "Download" and place the downloaded .theme.css file into your themes folder.')),o(S.FormSection,{title:"Local Themes"},o(wt,{className:"vc-settings-quick-actions-card"},o(f,null,o(R,{onClick:()=>va(u),size:R.Sizes.SMALL,disabled:p},"Open Themes Folder"),o(R,{onClick:m,size:R.Sizes.SMALL},"Load missing Themes"),o(R,{onClick:()=>VencordNative.quickCss.openEditor(),size:R.Sizes.SMALL},"Edit QuickCSS"))),o("div",{className:FM("grid")},l?.map(x=>o(GM,{key:x.fileName,enabled:e.enabledThemes.includes(x.fileName),onChange:N=>h(x.fileName,N),onDelete:async()=>{h(x.fileName,!1),await VencordNative.themes.deleteTheme(x.fileName),m()},theme:x})))))}function M(){e.themeLinks=[...new Set(i.trim().split(/\n+/).map(x=>x.trim()).filter(Boolean))]}function b(){return o(f,null,o(wt,{className:"vc-settings-card vc-text-selectable"},o(S.FormTitle,{tag:"h5"},"Paste links to css files here"),o(S.FormText,null,"One link per line"),o(S.FormText,null,"Make sure to use direct links to files (raw or github.io)!")),o(S.FormSection,{title:"Online Themes",tag:"h5"},o(Qs,{value:i,onChange:s,className:oe(BM.textarea,"vc-settings-theme-links"),placeholder:"Theme Links",spellCheck:!1,onBlur:M,rows:10}),o($M,{themeLinks:e.themeLinks})))}return o(vn,{title:"Themes"},o(In,{type:"top",look:"brand",className:"vc-settings-tab-bar",selectedItem:n,onItemSelect:r},o(In.Item,{className:"vc-settings-tab-bar-item",id:0},"Local Themes"),o(In.Item,{className:"vc-settings-tab-bar-item",id:1},"Online Themes")),n===0&&T(),n===1&&b())}var _M,JO,BM,FM,zM,Vy=g(()=>{"use strict";a();$();Je();Lt();$t();lo();at();Re();Ro();Qe();j();A();Du();Oo();_M=I("resolveInvite"),JO=un(e=>e.prototype?.activateUploadDialogue&&e.prototype.setRef),BM=un(e=>typeof e.textarea=="string"),FM=Ue("vc-settings-theme-");zM=Sn(HM,"Themes")});var ov={};Be(ov,{default:()=>KM});function ev(e,t){return async()=>{e(!0);try{await t()}catch(r){if(hr.error("Failed to update",r),r)if(r.code&&r.cmd){let{code:i,path:s,cmd:l,stderr:c}=r;if(i==="ENOENT")var n=`Command \`${s}\` not found. +${n}`}var gu,W2,q2,hu,K2,Y2,Z2,X2,J2,ao,Q2,lo=g(()=>{"use strict";a();I();gu=e=>e.split(/(?=[A-Z])/).map(t=>t.toLowerCase()),W2=e=>e.toLowerCase().split("_"),q2=e=>e.toLowerCase().split("-"),hu=e=>e.split(/(?=[A-Z])/).map(t=>t.toLowerCase()),K2=e=>e.toLowerCase().split(" "),Y2=e=>e.map((t,n)=>n?t[0].toUpperCase()+t.slice(1):t).join(""),Z2=e=>e.join("_").toUpperCase(),X2=e=>e.join("-").toLowerCase(),J2=e=>e.map(t=>t[0].toUpperCase()+t.slice(1)).join(""),ao=e=>e.map(t=>t[0].toUpperCase()+t.slice(1)).join(" "),Q2=["years","months","weeks","days","hours","minutes","seconds"]});function es(){return`-${jn.fromTimestamp(Date.now())}`}function pe(e,t){let n=eM.createBotMessage({channelId:e,content:"",embeds:[]});return tM.receiveMessage(e,dr(t,n)),t}function rt(e,t,n){return e.find(r=>r.name===t)?.value||n}var eM,tM,yu=g(()=>{"use strict";a();Be();j();I();eM=A("createBotMessage"),tM=A("receiveMessage")});var co,_n,vu,ka=g(()=>{"use strict";a();co=(h=>(h[h.SUB_COMMAND=1]="SUB_COMMAND",h[h.SUB_COMMAND_GROUP=2]="SUB_COMMAND_GROUP",h[h.STRING=3]="STRING",h[h.INTEGER=4]="INTEGER",h[h.BOOLEAN=5]="BOOLEAN",h[h.USER=6]="USER",h[h.CHANNEL=7]="CHANNEL",h[h.ROLE=8]="ROLE",h[h.MENTIONABLE=9]="MENTIONABLE",h[h.NUMBER=10]="NUMBER",h[h.ATTACHMENT=11]="ATTACHMENT",h))(co||{}),_n=(s=>(s[s.BUILT_IN=0]="BUILT_IN",s[s.BUILT_IN_TEXT=1]="BUILT_IN_TEXT",s[s.BUILT_IN_INTEGRATION=2]="BUILT_IN_INTEGRATION",s[s.BOT=3]="BOT",s[s.PLACEHOLDER=4]="PLACEHOLDER",s))(_n||{}),vu=(r=>(r[r.CHAT_INPUT=1]="CHAT_INPUT",r[r.USER=2]="USER",r[r.MESSAGE=3]="MESSAGE",r))(vu||{})});var Tu={};Ue(Tu,{ApplicationCommandInputType:()=>_n,ApplicationCommandOptionType:()=>co,ApplicationCommandType:()=>vu,BUILT_IN:()=>Uo,OptionalMessageOption:()=>$o,RequiredMessageOption:()=>ts,_handleCommand:()=>oM,_init:()=>nM,commands:()=>Su,findOption:()=>rt,generateId:()=>es,prepareOption:()=>bu,registerCommand:()=>ei,sendBotMessage:()=>pe,unregisterCommand:()=>ns});function bu(e){return e.displayName||=e.name,e.displayDescription||=e.description,e.options?.forEach((t,n,r)=>{t===xy?r[n]=$o:t===wy&&(r[n]=ts),t.choices?.forEach(i=>i.displayName||=i.name),bu(r[n])}),e}function rM(e,t){e.options?.forEach(n=>{if(n.type!==1)throw new Error("When specifying sub-command options, all options must be sub-commands.");let r={...e,...n,type:1,name:`${e.name} ${n.name}`,id:`${n.name}-${e.id}`,displayName:`${e.name} ${n.name}`,subCommandPath:[{name:n.name,type:n.type,displayName:n.name}],rootCommand:e};ei(r,t)})}function ei(e,t){if(!Uo){console.warn("[CommandsAPI]",`Not registering ${e.name} as the CommandsAPI hasn't been initialised.`,"Please restart to use commands");return}if(Uo.some(n=>n.name===e.name))throw new Error(`Command '${e.name}' already exists.`);if(e.isVencordCommand=!0,e.id??=`-${Uo.length+1}`,e.applicationId??="-1",e.type??=1,e.inputType??=1,e.plugin||=t,bu(e),e.options?.[0]?.type===1){rM(e,t);return}Su[e.name]=e,Uo.push(e)}function ns(e){let t=Uo.findIndex(n=>n.name===e);return t===-1?!1:(Uo.splice(t,1),delete Su[e],!0)}var Uo,Su,xy,wy,$o,ts,nM,oM,tn=g(()=>{"use strict";a();lo();yu();ka();yu();ka();Su={},xy=Symbol("OptionalMessageOption"),wy=Symbol("RequiredMessageOption"),$o=xy,ts=wy,nM=function(e){try{Uo=e,$o=e.find(t=>t.name==="shrug").options[0],ts=e.find(t=>t.name==="me").options[0]}catch{console.error("Failed to load CommandsApi")}return e},oM=function(e,t,n){if(!e.isVencordCommand)return e.execute(t,n);let r=i=>{let s=`An Error occurred while executing command "${e.name}"`,l=i instanceof Error?i.stack||i.message:String(i);console.error(s,i),pe(n.channel.id,{content:`${s}: +${Vi(l)}`,author:{username:"Vencord"}})};try{let i=e.execute(t,n);return i instanceof Promise?i.catch(r):i}catch(i){return r(i)}}});function My({text:e,color:t}){return o("div",{className:"vc-plugins-badge",style:{backgroundColor:t,justifySelf:"flex-end",marginLeft:"auto"}},e)}var xu=g(()=>{"use strict";a()});function Py({option:e,pluginSettings:t,definedSettings:n,id:r,onChange:i,onError:s}){let l=t[r]??e.default,[c,u]=O.useState(l??!1),[d,m]=O.useState(null);O.useEffect(()=>{s(d!==null)},[d]);function h(v){let T=e.isValid?.call(n,v)??!0;typeof T=="string"?m(T):T?(m(null),u(v),i(v)):m("Invalid input provided.")}return o(S.FormSection,null,o(pt,{value:c,onChange:h,note:e.description,disabled:e.disabled?.call(n)??!1,...e.componentProps,hideBorder:!0,style:{marginBottom:"0.5em"}},ao(gu(r))),d&&o(S.FormText,{style:{color:"var(--text-danger)"}},d))}var Iy=g(()=>{"use strict";a();lo();I()});function Ay({option:e,onChange:t,onError:n}){return e.component({setValue:t,setError:n,option:e})}var Ny=g(()=>{"use strict";a()});function wu({option:e,pluginSettings:t,definedSettings:n,id:r,onChange:i,onError:s}){function l(v){return e.type===2?BigInt(v):Number(v)}let[c,u]=O.useState(`${t[r]??e.default??0}`),[d,m]=O.useState(null);O.useEffect(()=>{s(d!==null)},[d]);function h(v){let T=e.isValid?.call(n,v)??!0;m(null),typeof T=="string"?m(T):T||m("Invalid input provided."),e.type===1&&BigInt(v)>=iM?(u(`${Number.MAX_SAFE_INTEGER}`),i(l(v))):(u(v),i(l(v)))}return o(S.FormSection,null,o(S.FormTitle,null,e.description),o(et,{type:"number",pattern:"-?[0-9]+",value:c,onChange:h,placeholder:e.placeholder??"Enter a number",disabled:e.disabled?.call(n)??!1,...e.componentProps}),d&&o(S.FormText,{style:{color:"var(--text-danger)"}},d))}var iM,Cy=g(()=>{"use strict";a();M();I();iM=BigInt(Number.MAX_SAFE_INTEGER)});function ky({option:e,pluginSettings:t,definedSettings:n,onChange:r,onError:i,id:s}){let l=t[s]??e.options?.find(v=>v.default)?.value,[c,u]=O.useState(l??null),[d,m]=O.useState(null);O.useEffect(()=>{i(d!==null)},[d]);function h(v){let T=e.isValid?.call(n,v)??!0;typeof T=="string"?m(T):T?(m(null),u(v),r(v)):m("Invalid input provided.")}return o(S.FormSection,null,o(S.FormTitle,null,e.description),o(An,{isDisabled:e.disabled?.call(n)??!1,options:e.options,placeholder:e.placeholder??"Select an option",maxVisibleItems:5,closeOnSelect:!0,select:h,isSelected:v=>v===c,serialize:v=>String(v),...e.componentProps}),d&&o(S.FormText,{style:{color:"var(--text-danger)"}},d))}var Ry=g(()=>{"use strict";a();I()});function Go(e,t,n=1){let r=[];for(let i=e;i<=t;i+=n)r.push(Math.round(i*100)/100);return r}function Ly({option:e,pluginSettings:t,definedSettings:n,id:r,onChange:i,onError:s}){let l=t[r]??e.default,[c,u]=O.useState(null);O.useEffect(()=>{s(c!==null)},[c]);function d(m){let h=e.isValid?.call(n,m)??!0;typeof h=="string"?u(h):h?(u(null),i(m)):u("Invalid input provided.")}return o(S.FormSection,null,o(S.FormTitle,null,e.description),o(ir,{disabled:e.disabled?.call(n)??!1,markers:e.markers,minValue:e.markers[0],maxValue:e.markers[e.markers.length-1],initialValue:l,onValueChange:d,onValueRender:m=>String(m.toFixed(2)),stickToMarkers:e.stickToMarkers??!0,...e.componentProps}))}var Mu=g(()=>{"use strict";a();I()});function Ey({option:e,pluginSettings:t,definedSettings:n,id:r,onChange:i,onError:s}){let[l,c]=O.useState(t[r]??e.default??null),[u,d]=O.useState(null);O.useEffect(()=>{s(u!==null)},[u]);function m(h){let v=e.isValid?.call(n,h)??!0;d(typeof v=="string"?v:v?null:"Invalid input provided."),c(h),i(h)}return o(S.FormSection,null,o(S.FormTitle,null,e.description),o(et,{type:"text",value:l,onChange:m,placeholder:e.placeholder??"Enter a value",disabled:e.disabled?.call(n)??!1,...e.componentProps}),u&&o(S.FormText,{style:{color:"var(--text-danger)"}},u))}var Dy=g(()=>{"use strict";a();I()});var Ra=g(()=>{"use strict";a();xu();Iy();Ny();Cy();Ry();Mu();Dy()});var Oy=g(()=>{});function ti(){return Q.getChannel(Ae.getChannelId())}function Pu(){return we.getGuild(ti()?.guild_id)}function lM(e){pc.openPrivateChannel(e)}function ni(){return Ci.PreloadedUserSettingsActionCreators.getCurrentValue()?.appearance?.theme}function uo(e){Gr.dispatchToLastSubscribed("INSERT_TEXT",{rawText:e,plainText:e})}function cM(e,t,n,r){let i={content:"",invalidEmojis:[],tts:!1,validNonShortcutEmojis:[],...t};return sM.sendMessage(e,i,n,r)}function Bn(e,t){return Ke(n=>o(qe,{...n,className:Js.modal,size:"dynamic"},o(bc,{className:Js.image,original:e,placeholder:e,src:e,renderLinkComponent:r=>o(Br,{...r}),shouldHideMediaOptions:!1,shouldAnimate:!0,...t})))}async function Fn(e){if(!await Et.getUser(e))throw new Error("No such user: "+e);let n=sn.getGuildId();aM.openUserProfileModal({userId:e,guildId:n,channelId:Ae.getChannelId(),analyticsLocation:{page:n?"Guild Channel":"DM Channel",section:"Profile Popout"}})}async function Iu(e,t){let n=rn.getUserProfile(e);if(n)return n;B.dispatch({type:"USER_PROFILE_FETCH_START",userId:e});let{body:r}=await wt.get({url:`/users/${e}/profile`,query:{with_mutual_guilds:!1,with_mutual_friends_count:!1,...t},oldFormErrors:!0});return B.dispatch({type:"USER_UPDATE",user:r.user}),await B.dispatch({type:"USER_PROFILE_FETCH_SUCCESS",...r}),t?.guild_id&&r.guild_member&&B.dispatch({type:"GUILD_MEMBER_PROFILE_UPDATE",guildId:t.guild_id,guildMember:r.guild_member}),rn.getUserProfile(e)}function po(e){return e.discriminator==="0"?e.username:e.tag}var sM,aM,La,It=g(()=>{"use strict";a();j();I();dt();sM=A("editMessage","sendMessage"),aM=A("openUserProfileModal","closeUserProfileModal");La=(n=>(n[n.Dark=1]="Dark",n[n.Light=2]="Light",n))(La||{})});function _y(e){Ke(t=>o(qe,{...t},o(_,null,o(tt,{className:oi("root")},o(hM,{user:e})))))}function fM(){let e=ni()===2?dM:mM;return o("img",{src:e,alt:"GitHub"})}function gM(){let e=ni()===2?pM:uM;return o("img",{src:e,alt:"Website"})}function hM({user:e}){lt();let t=We([rn],()=>rn.getUserProfile(e.id));_e(()=>{!t&&!e.bot&&e.id&&Iu(e.id)},[e.id]);let n=t?.connectedAccounts?.find(s=>s.type==="github")?.name,r=t?.connectedAccounts?.find(s=>s.type==="domain")?.name,i=Nt(()=>{let s=Object.values(He);return(zr[e.id]?s.filter(c=>c.authors.includes(zr[e.id])):s.filter(c=>c.authors.some(u=>u.name===e.username))).filter(c=>!c.name.endsWith("API")).sort((c,u)=>Number(c.required??!1)-Number(u.required??!1))},[e.id,e.username]);return o(f,null,o("div",{className:oi("header")},o("img",{className:oi("avatar"),src:e.getAvatarURL(void 0,512,!0),alt:""}),o(S.FormTitle,{tag:"h2",className:oi("name")},e.username),o("div",{className:oi("links")},r&&o(Br,{href:"https://"+r},o(gM,null)),n&&o(Br,{href:`https://github.com/${n}`},o(fM,null)))),o("div",{className:oi("plugins")},i.map(s=>o(Ea,{key:s.name,plugin:s,disabled:s.required??!1,onRestartNeeded:()=>yn("Restart to apply changes!")}))))}var uM,pM,dM,mM,oi,By=g(()=>{"use strict";a();Oy();$();Ve();le();P();It();dt();I();gr();Au();uM="/assets/e1e96d89e192de1997f73730db26e94f.svg",pM="/assets/730f58bcfd5a57a5e22460c445a0c6cf.svg",dM="/assets/3ff98ad75ac94fa883af5ed62d17c459.svg",mM="/assets/6a853b4c87fce386cbfef4a2efbacb09.svg",oi=Ge("vc-author-modal-")});function Fy(e){let t=new vM({username:e.username,id:e.id??es(),avatar:e.avatar,bot:!0});return B.dispatch({type:"USER_UPDATE",user:t}),t}function Cu({plugin:e,onRestartNeeded:t,onClose:n,transitionState:r}){let[i,s]=O.useState([]),l=lt().plugins[e.name],[c,u]=O.useState({}),[d,m]=O.useState({}),[h,v]=O.useState(null),T=()=>Object.values(d).every(k=>!k),w=Boolean(l&&e.options&&!Ei(e.options));O.useEffect(()=>{(async()=>{for(let k of e.authors.slice(0,6)){let F=k.id?await Et.getUser(`${k.id}`).catch(()=>Fy({username:k.name})):Fy({username:k.name});s(G=>[...G,F])}})()},[]);async function b(){if(!e.options){n();return}if(e.beforeSave){let F=await Promise.resolve(e.beforeSave(c));if(F!==!0){v(F);return}}let k=!1;for(let[F,G]of Object.entries(c)){let K=e.options[F];l[F]=G,K?.onChange?.(G),K?.restartNeeded&&(k=!0)}k&&t(),n()}function x(){if(!w||!e.options)return o(S.FormText,null,"There are no settings for this plugin.");{let k=Object.entries(e.options).map(([F,G])=>{if(G.hidden)return null;function K(R){u(X=>({...X,[F]:R}))}function q(R){m(X=>({...X,[F]:R}))}let z=SM[G.type];return o(z,{id:F,key:F,option:G,onChange:K,onError:q,pluginSettings:l,definedSettings:e.settings})});return o(ye,{flexDirection:"column",style:{gap:12,marginBottom:16}},k)}}function N(k,F){let G=e.authors.length-F,K=e.authors.length-G,q=K+e.authors.length-F;return o(V,{text:e.authors.slice(K,q).map(z=>z.name).join(", ")},({onMouseEnter:z,onMouseLeave:R})=>o("div",{className:Nu.moreUsers,onMouseEnter:z,onMouseLeave:R},"+",G))}return o(qe,{transitionState:r,size:"medium",className:"vc-text-selectable"},o(at,{separator:!1},o(oe,{variant:"heading-lg/semibold",style:{flexGrow:1}},e.name),o(cn,{onClick:n})),o(tt,null,o(S.FormSection,null,o(S.FormTitle,{tag:"h3"},"About ",e.name),o(S.FormText,null,e.description),o(S.FormTitle,{tag:"h3",style:{marginTop:8,marginBottom:0}},"Authors"),o("div",{style:{width:"fit-content",marginBottom:8}},o(yM,{users:i,count:e.authors.length,guildId:void 0,renderIcon:!1,max:6,showDefaultAvatarsForNullUsers:!0,showUserPopout:!0,renderMoreUsers:N,renderUser:k=>o(Or,{className:Nu.clickableAvatar,onClick:()=>_y(k)},o("img",{className:Nu.avatar,src:k.getAvatarURL(void 0,80,!0),alt:k.username,title:k.username}))}))),!!e.settingsAboutComponent&&o("div",{className:re(Y.bottom8,"vc-text-selectable")},o(S.FormSection,null,o(_,{message:"An error occurred while rendering this plugin's custom InfoComponent"},o(e.settingsAboutComponent,{tempSettings:c})))),o(S.FormSection,{className:Y.bottom16},o(S.FormTitle,{tag:"h3"},"Settings"),x())),w&&o(Ft,null,o(ye,{flexDirection:"column",style:{width:"100%"}},o(ye,{style:{marginLeft:"auto"}},o(E,{onClick:n,size:E.Sizes.SMALL,color:E.Colors.PRIMARY,look:E.Looks.LINK},"Cancel"),o(V,{text:"You must fix all errors before saving",shouldShow:!T()},({onMouseEnter:k,onMouseLeave:F})=>o(E,{size:E.Sizes.SMALL,color:E.Colors.BRAND,onClick:b,onMouseEnter:k,onMouseLeave:F,disabled:!T()},"Save & Close"))),h&&o(oe,{variant:"text-md/semibold",style:{color:"var(--text-danger)"}},"Error while saving: ",h))))}var yM,Nu,vM,SM,Uy=g(()=>{"use strict";a();tn();$();le();Dt();Zt();ct();Be();dt();Oe();M();j();I();Ra();By();yM=me(()=>Bt("defaultRenderUser","showDefaultAvatarsForNullUsers")),Nu=A("moreUsers","emptyUser","avatarContainer","clickableAvatar"),vM=Qe(()=>W.getCurrentUser().constructor);SM={[0]:Ey,[1]:wu,[2]:wu,[3]:Py,[4]:ky,[5]:Ly,[6]:Ay}});var $y=g(()=>{});var Gy=g(()=>{});function Hy({checked:e,onChange:t,disabled:n}){return o("div",null,o("div",{className:re(Da.container,"default-colors",e?Da.checked:void 0),style:{backgroundColor:e?ku:Ru,opacity:n?.3:1}},o("svg",{className:Da.slider+" vc-switch-slider",viewBox:"0 0 28 20",preserveAspectRatio:"xMinYMid meet","aria-hidden":"true",style:{transform:e?"translateX(12px)":"translateX(-3px)"}},o("rect",{fill:"white",x:"4",y:"0",height:"20",width:"20",rx:"10"}),o("svg",{viewBox:"0 0 20 20",fill:"none"},e?o(f,null,o("path",{fill:ku,d:"M7.89561 14.8538L6.30462 13.2629L14.3099 5.25755L15.9009 6.84854L7.89561 14.8538Z"}),o("path",{fill:ku,d:"M4.08643 11.0903L5.67742 9.49929L9.4485 13.2704L7.85751 14.8614L4.08643 11.0903Z"})):o(f,null,o("path",{fill:Ru,d:"M5.13231 6.72963L6.7233 5.13864L14.855 13.2704L13.264 14.8614L5.13231 6.72963Z"}),o("path",{fill:Ru,d:"M13.2704 5.13864L14.8614 6.72963L6.72963 14.8614L5.13864 13.2704L13.2704 5.13864Z"})))),o("input",{disabled:n,type:"checkbox",className:Da.input,tabIndex:0,checked:e,onChange:r=>t(r.currentTarget.checked)})))}var ku,Ru,Da,zy=g(()=>{"use strict";a();Gy();Be();j();ku="var(--green-360)",Ru="var(--primary-400)",Da=A("slider","input","container")});function Oa({disabled:e,isNew:t,name:n,infoButton:r,footer:i,author:s,enabled:l,setEnabled:c,description:u,onMouseEnter:d,onMouseLeave:m}){return o("div",{className:ri("card",{"card-disabled":e}),onMouseEnter:d,onMouseLeave:m},o("div",{className:ri("header")},o("div",{className:ri("name-author")},o(oe,{variant:"text-md/bold",className:ri("name")},n,t&&o(My,{text:"NEW",color:"#ED4245"})),!!s&&o(oe,{variant:"text-md/normal",className:ri("author")},s)),r,o(Hy,{checked:l,onChange:c,disabled:e})),o(oe,{className:ri("note"),variant:"text-sm/normal"},u),i)}var ri,Lu=g(()=>{"use strict";a();$y();Ve();xu();zy();I();ri=Ge("vc-addon-")});var os,Eu=g(()=>{"use strict";a();os=class{set=new Set;get changeCount(){return this.set.size}get hasChanges(){return this.changeCount>0}handleChange(t){this.set.delete(t)||this.set.add(t)}add(t){return this.set.add(t)}remove(t){return this.set.delete(t)}getChanges(){return this.set.values()}map(t){return[...this.getChanges()].map(t)}}});var Fu={};Ue(Fu,{PMLogger:()=>bM,isPluginEnabled:()=>Ou,patches:()=>jy,plugins:()=>TM,startAllPlugins:()=>_u,startDependenciesRecursive:()=>_a,startPlugin:()=>rs,stopPlugin:()=>Bu});function Ou(e){return(He[e]?.required||He[e]?.isDependency||Du[e]?.enabled)??!1}function _a(e){let t=!1,n=[];return e.dependencies?.forEach(r=>{if(!L.plugins[r].enabled){if(_a(He[r]),L.plugins[r].enabled=!0,He[r].patches){dn.warn(`Enabling dependency ${r} requires restart.`),t=!0;return}rs(He[r])||n.push(r)}}),{restartNeeded:t,failures:n}}var dn,bM,TM,jy,Du,Wy,_u,rs,Bu,Ba=g(()=>{"use strict";a();tn();$();Je();I();gr();qs();dn=new ie("PluginManager","#a6d189"),bM=dn,TM=He,jy=[],Du=L.plugins;Wy=Object.values(He);for(let e of Wy)Du[e.name]?.enabled&&e.dependencies?.forEach(t=>{let n=He[t];if(n)Du[t].enabled=!0,n.isDependency=!0;else{let r=new Error(`Plugin ${e.name} has unresolved dependency ${t}`);dn.warn(r)}});for(let e of Wy){if(e.settings){e.settings.pluginName=e.name,e.options??={};for(let[t,n]of Object.entries(e.settings.def)){let r=e.settings.checks?.[t];e.options[t]={...n,...r}}}if(e.patches&&Ou(e.name))for(let t of e.patches)t.plugin=e.name,Array.isArray(t.replacement)||(t.replacement=[t.replacement]),jy.push(t)}_u=Pn("startAllPlugins",function(){for(let t in He)Ou(t)&&rs(He[t])});rs=Pn("startPlugin",function(t){let{name:n,commands:r,flux:i}=t;if(t.start){if(dn.info("Starting plugin",n),t.started)return dn.warn(`${n} already started`),!1;try{t.start(),t.started=!0}catch(s){return dn.error(`Failed to start ${n} +`,s),!1}}if(r?.length){dn.info("Registering commands of plugin",n);for(let s of r)try{ei(s,n)}catch(l){return dn.error(`Failed to register command ${s.name} +`,l),!1}}if(i)for(let s in i)B.subscribe(s,i[s]);return!0},e=>`startPlugin ${e.name}`),Bu=Pn("stopPlugin",function(t){let{name:n,commands:r,flux:i}=t;if(t.stop){if(dn.info("Stopping plugin",n),!t.started)return dn.warn(`${n} already stopped`),!1;try{t.stop(),t.started=!1}catch(s){return dn.error(`Failed to stop ${n} +`,s),!1}}if(r?.length){dn.info("Unregistering commands of plugin",n);for(let s of r)try{ns(s.name)}catch(l){return dn.error(`Failed to unregister command ${s.name} +`,l),!1}}if(i)for(let s in i)B.unsubscribe(s,i[s]);return!0},e=>`stopPlugin ${e.name}`)});function wM(e){ee.show({message:e,type:ee.Type.FAILURE,id:ee.genId(),options:{position:ee.Position.BOTTOM}})}function MM({required:e}){return o(xt,{className:Sr("info-card",{"restart-card":e})},e?o(f,null,o(S.FormTitle,{tag:"h5"},"Restart required!"),o(S.FormText,{className:Sr("dep-text")},"Restart now to apply new plugins and their settings"),o(E,{color:E.Colors.YELLOW,onClick:()=>location.reload()},"Restart")):o(f,null,o(S.FormTitle,{tag:"h5"},"Plugin Management"),o(S.FormText,null,"Press the cog wheel or info icon to get more info on a plugin"),o(S.FormText,null,"Plugins with a cog wheel have settings you can modify!")))}function Ea({plugin:e,disabled:t,onRestartNeeded:n,onMouseEnter:r,onMouseLeave:i,isNew:s}){let l=L.plugins[e.name],c=()=>l.enabled??!1;function u(){Bi(async()=>m=>o(Cu,{...m,plugin:e,onRestartNeeded:()=>n(e.name)}))}function d(){let m=c();if(!m){let{restartNeeded:v,failures:T}=_a(e);if(T.length){qy.error(`Failed to start dependencies for ${e.name}: ${T.join(", ")}`),Xi("Failed to start dependencies: "+T.join(", "),"Close",()=>null);return}else if(v){l.enabled=!0,n(e.name);return}}if(e.patches?.length){l.enabled=!m,n(e.name);return}if(m&&!e.started){l.enabled=!m;return}if(!(m?Bu(e):rs(e))){l.enabled=!1;let v=`Error while ${m?"stopping":"starting"} plugin ${e.name}`;qy.error(v),wM(v);return}l.enabled=!m}return o(Oa,{name:e.name,description:e.description,isNew:s,enabled:c(),setEnabled:d,disabled:t,onMouseEnter:r,onMouseLeave:i,infoButton:o("button",{role:"switch",onClick:()=>u(),className:re(xM.button,Sr("info-button"))},e.options&&!Ei(e.options)?o(Sy,null):o(Aa,null))})}function Uu(){let e=lt(),t=O.useMemo(()=>new os,[]);O.useEffect(()=>()=>void(t.hasChanges&&an.show({title:"Restart required",body:o(f,null,o("p",null,"The following plugins require a restart:"),o("div",null,t.map((v,T)=>o(f,null,T>0&&", ",$e.parse("`"+v+"`"))))),confirmText:"Restart now",cancelText:"Later!",onConfirm:()=>location.reload()})),[]);let n=O.useMemo(()=>{let v={};for(let T in He){let w=He[T].dependencies;if(w)for(let b of w)v[b]??=[],v[b].push(T)}return v},[]),r=O.useMemo(()=>Object.values(He).sort((v,T)=>v.name.localeCompare(T.name)),[]),[i,s]=O.useState({value:"",status:0}),l=v=>s(T=>({...T,value:v})),c=v=>s(T=>({...T,status:v})),u=v=>{let T=e.plugins[v.name]?.enabled;if(T&&i.status===2||!T&&i.status===1||i.status===3&&!d?.includes(v.name))return!1;if(!i.value.length)return!0;let w=i.value.toLowerCase();return v.name.toLowerCase().includes(w)||v.description.toLowerCase().includes(w)||v.tags?.some(b=>b.toLowerCase().includes(w))},[d]=ot(()=>Pt("Vencord_existingPlugins").then(v=>{let T=Date.now()/1e3,w={},b=Object.values(r).map(N=>N.name),x=[];for(let{name:N}of r)(w[N]=v?.[N]??T)+60*60*24*2>T&&x.push(N);return Vt("Vencord_existingPlugins",w),cr.isEqual(x,b)?[]:x})),m,h;if(r?.length){m=[],h=[];for(let v of r){if(!v.options&&v.name.endsWith("API")&&i.value!=="API"||!u(v))continue;if(v.required||n[v.name]?.some(w=>e.plugins[w].enabled)){let w=v.required?"This plugin is required for Vencord to function.":PM(n[v.name]?.filter(b=>e.plugins[b].enabled));h.push(o(V,{text:w,key:v.name},({onMouseLeave:b,onMouseEnter:x})=>o(Ea,{onMouseLeave:b,onMouseEnter:x,onRestartNeeded:N=>t.handleChange(N),disabled:!0,plugin:v})))}else m.push(o(Ea,{onRestartNeeded:w=>t.handleChange(w),disabled:!1,plugin:v,isNew:d?.includes(v.name),key:v.name}))}}else m=h=o(oe,{variant:"text-md/normal"},"No plugins meet search criteria.");return o(Tn,{title:"Plugins"},o(MM,{required:t.hasChanges}),o(S.FormTitle,{tag:"h5",className:re(Y.top20,Y.bottom8)},"Filters"),o("div",{className:Sr("filter-controls")},o(et,{autoFocus:!0,value:i.value,placeholder:"Search for a plugin...",onChange:l,className:Y.bottom20}),o("div",{className:Ky.inputWrapper},o(An,{className:Ky.inputDefault,options:[{label:"Show All",value:0,default:!0},{label:"Show Enabled",value:1},{label:"Show Disabled",value:2},{label:"Show New",value:3}],serialize:String,select:c,isSelected:v=>v===i.status,closeOnSelect:!0}))),o(S.FormTitle,{className:Y.top20},"Plugins"),o("div",{className:Sr("grid")},m),o(S.FormDivider,{className:Y.top20}),o(S.FormTitle,{tag:"h5",className:re(Y.top20,Y.bottom8)},"Required Plugins"),o("div",{className:Sr("grid")},h))}function PM(e){return o(O.Fragment,null,o(S.FormText,null,"This plugin is required by:"),e.map(t=>o(S.FormText,{className:Sr("dep-text")},t)))}var Sr,qy,Ky,xM,Au=g(()=>{"use strict";a();dy();Kn();Ia();$();Ve();Ht();Uy();Lu();Fo();Eu();Je();ct();Be();dt();Oe();j();I();gr();Ba();Sr=Ge("vc-plugins-"),qy=new ie("PluginSettings","#a6d189"),Ky=A("inputDefault","inputWrapper"),xM=A("button","disabled","enabled")});var Yy={};Ue(Yy,{default:()=>IM});var IM,Zy=g(()=>{"use strict";a();Au();Fo();IM=xn(Uu,"Plugins")});function it(e){return e.disabled&&(e.style??={},e.style.pointerEvents="none",e["aria-disabled"]=!0),o("a",{role:"link",target:"_blank",...e},e.children)}var mo=g(()=>{"use strict";a()});var Xy={};Ue(Xy,{default:()=>DM});function kM({link:e}){let[t,n,r]=ot(()=>fetch(e).then(s=>{if(s.status>300)throw`${s.status} ${s.statusText}`;let l=s.headers.get("Content-Type");if(!l?.startsWith("text/css")&&!l?.startsWith("text/plain"))throw"Not a CSS file. Remember to use the raw link!";return"Okay!"})),i=r?"Checking...":n?`Error: ${n instanceof Error?n.message:String(n)}`:"Valid!";return o(S.FormText,{style:{color:r?"var(--text-muted)":n?"var(--text-danger)":"var(--text-positive)"}},i)}function RM({themeLinks:e}){return e.length?o(f,null,o(S.FormTitle,{className:Y.top20,tag:"h5"},"Validator"),o(S.FormText,null,"This section will tell you whether your themes can successfully be loaded"),o("div",null,e.map(t=>o(xt,{style:{padding:".5em",marginBottom:".5em",marginTop:".5em"},key:t},o(S.FormTitle,{tag:"h5",style:{overflowWrap:"break-word"}},t),o(kM,{link:t}))))):null}function LM({theme:e,enabled:t,onChange:n,onDelete:r}){return o(Oa,{name:e.name,description:e.description,author:e.author,enabled:t,setEnabled:n,infoButton:!1,footer:o(ye,{flexDirection:"row",style:{gap:"0.2em"}},!!e.website&&o(it,{href:e.website},"Website"),!!(e.website&&e.invite)&&" \u2022 ",!!e.invite&&o(it,{href:`https://discord.gg/${e.invite}`,onClick:async i=>{i.preventDefault();let{invite:s}=await AM.resolveInvite(e.invite,"Desktop Modal");if(!s)return yn("Invalid or expired invite");B.dispatch({type:"INVITE_MODAL_OPEN",invite:s,code:e.invite,context:"APP"})}},"Discord Server"))})}function EM(){let e=lt(["themeLinks","enabledThemes"]),t=Jt(null),[n,r]=J(0),[i,s]=J(e.themeLinks.join(` +`)),[l,c]=J(null),[u,,d]=ot(VencordNative.themes.getThemesDir);_e(()=>{m()},[]);async function m(){let x=await VencordNative.themes.getThemesList();c(x)}function h(x,N){if(N){if(e.enabledThemes.includes(x))return;e.enabledThemes=[...e.enabledThemes,x]}else e.enabledThemes=e.enabledThemes.filter(k=>k!==x)}async function v(x){if(x.stopPropagation(),x.preventDefault(),!x.currentTarget?.files?.length)return;let{files:N}=x.currentTarget,k=Array.from(N,F=>{let{name:G}=F;if(!!G.endsWith(".css"))return new Promise((K,q)=>{let z=new FileReader;z.onload=()=>{VencordNative.themes.uploadTheme(G,z.result).then(K).catch(q)},z.readAsText(F)})});await Promise.all(k),m()}function T(){return o(f,null,o(xt,{className:"vc-settings-card"},o(S.FormTitle,{tag:"h5"},"Find Themes:"),o("div",{style:{marginBottom:".5em",display:"flex",flexDirection:"column"}},o(it,{style:{marginRight:".5em"},href:"https://betterdiscord.app/themes"},"BetterDiscord Themes"),o(it,{href:"https://github.com/search?q=discord+theme"},"GitHub")),o(S.FormText,null,'If using the BD site, click on "Download" and place the downloaded .theme.css file into your themes folder.')),o(S.FormSection,{title:"Local Themes"},o(xt,{className:"vc-settings-quick-actions-card"},o(f,null,o(E,{onClick:()=>Sa(u),size:E.Sizes.SMALL,disabled:d},"Open Themes Folder"),o(E,{onClick:m,size:E.Sizes.SMALL},"Load missing Themes"),o(E,{onClick:()=>VencordNative.quickCss.openEditor(),size:E.Sizes.SMALL},"Edit QuickCSS"))),o("div",{className:CM("grid")},l?.map(x=>o(LM,{key:x.fileName,enabled:e.enabledThemes.includes(x.fileName),onChange:N=>h(x.fileName,N),onDelete:async()=>{h(x.fileName,!1),await VencordNative.themes.deleteTheme(x.fileName),m()},theme:x})))))}function w(){e.themeLinks=[...new Set(i.trim().split(/\n+/).map(x=>x.trim()).filter(Boolean))]}function b(){return o(f,null,o(xt,{className:"vc-settings-card vc-text-selectable"},o(S.FormTitle,{tag:"h5"},"Paste links to css files here"),o(S.FormText,null,"One link per line"),o(S.FormText,null,"Make sure to use direct links to files (raw or github.io)!")),o(S.FormSection,{title:"Online Themes",tag:"h5"},o(Vs,{value:i,onChange:s,className:re(NM.textarea,"vc-settings-theme-links"),placeholder:"Theme Links",spellCheck:!1,onBlur:w,rows:10}),o(RM,{themeLinks:e.themeLinks})))}return o(Tn,{title:"Themes"},o(Nn,{type:"top",look:"brand",className:"vc-settings-tab-bar",selectedItem:n,onItemSelect:r},o(Nn.Item,{className:"vc-settings-tab-bar-item",id:0},"Local Themes"),o(Nn.Item,{className:"vc-settings-tab-bar-item",id:1},"Online Themes")),n===0&&T(),n===1&&b())}var AM,LO,NM,CM,DM,Jy=g(()=>{"use strict";a();$();Ve();Dt();Ht();mo();ct();Be();Do();Oe();j();I();Lu();Fo();AM=A("resolveInvite"),LO=Lt(e=>e.prototype?.activateUploadDialogue&&e.prototype.setRef),NM=Lt(e=>typeof e.textarea=="string"),CM=Ge("vc-settings-theme-");DM=xn(EM,"Themes")});var tv={};Ue(tv,{default:()=>FM});function Qy(e,t){return async()=>{e(!0);try{await t()}catch(r){if(hr.error("Failed to update",r),r)if(r.code&&r.cmd){let{code:i,path:s,cmd:l,stderr:c}=r;if(i==="ENOENT")var n=`Command \`${s}\` not found. Please install it and try again`;else{var n=`An error occurred while running \`${l}\`: `;n+=c||`Code \`${i}\`. See the console for more info`}}else var n="An unknown error occurred. See the console for more info.";else var n=`An unknown error occurred (error is undefined). -Please try again.`;rn.show({title:"Oops!",body:o(hn,null,n.split(` -`).map(i=>o("div",null,Fe.parse(i))))})}finally{e(!1)}}}function tv({repo:e,hash:t,disabled:n=!1}){return o(st,{href:`${e}/commit/${t}`,disabled:n},t)}function nv({updates:e,repo:t,repoPending:n}){return o(wt,{style:{padding:".5em"}},e.map(({hash:r,author:i,message:s})=>o("div",null,o("code",null,o(tv,{repo:t,hash:r,disabled:n})),o("span",{style:{marginLeft:"0.5em",color:"var(--text-normal)"}},s," - ",i))))}function jM(e){let[t,n]=O.useState(Eo),[r,i]=O.useState(!1),[s,l]=O.useState(!1),c=(t?.length??0)>0;return o(f,null,!t&&Yr?o(f,null,o(S.FormText,null,"Failed to check updates. Check the console for more info"),o(hn,{style:{padding:"1em"}},o("p",null,Yr.stderr||Yr.stdout||"An unknown error occurred"))):o(S.FormText,{className:q.bottom8},c?`There are ${t.length} Updates`:"Up to Date!"),c&&o(nv,{updates:t,...e}),o(ge,{className:oe(q.bottom8,q.top8)},c&&o(R,{size:R.Sizes.SMALL,disabled:s||r,onClick:ev(l,async()=>{await Xr()&&(n([]),await new Promise(u=>{rn.show({title:"Update Success!",body:"Successfully updated. Restart now to apply the changes?",confirmText:"Restart",cancelText:"Not now!",onConfirm(){ln(),u()},onCancel:u})}))})},"Update Now"),o(R,{size:R.Sizes.SMALL,disabled:s||r,onClick:ev(i,async()=>{await Zr()?n(Eo):(n([]),ee.show({message:"No updates found!",id:ee.genId(),type:ee.Type.MESSAGE,options:{position:ee.Position.BOTTOM}}))})},"Check for Updates")))}function WM(e){return o(f,null,o(S.FormText,{className:q.bottom8},"Your local copy has more recent commits. Please stash or reset them."),o(nv,{...e,updates:Eo}))}function qM(){let e=ct(["notifyAboutUpdates","autoUpdate","autoUpdateNotification"]),[t,n,r]=rt(lu,{fallbackValue:"Loading..."});O.useEffect(()=>{n&&hr.error("Failed to retrieve repo",n)},[n]);let i={repo:t,repoPending:r};return o(vn,{title:"Vencord Updater"},o(S.FormTitle,{tag:"h5"},"Updater Settings"),o(pt,{value:e.notifyAboutUpdates,onChange:s=>e.notifyAboutUpdates=s,note:"Shows a notification on startup",disabled:e.autoUpdate},"Get notified about new updates"),o(pt,{value:e.autoUpdate,onChange:s=>e.autoUpdate=s,note:"Automatically update Vencord without confirmation prompt"},"Automatically update"),o(pt,{value:e.autoUpdateNotification,onChange:s=>e.autoUpdateNotification=s,note:"Shows a notification when Vencord automatically updates",disabled:!e.autoUpdate},"Get notified when an automatic update completes"),o(S.FormTitle,{tag:"h5"},"Repo"),o(S.FormText,{className:"vc-text-selectable"},r?t:n?"Failed to retrieve - check console":o(st,{href:t},t.split("/").slice(-2).join("/"))," ","(",o(tv,{hash:sn,repo:t,disabled:r}),")"),o(S.FormDivider,{className:q.top8+" "+q.bottom8}),o(S.FormTitle,{tag:"h5"},"Updates"),qi?o(WM,{...i}):o(jM,{...i}))}var KM,rv=g(()=>{"use strict";a();$();Hr();Lt();lo();at();Re();Ro();Qe();yr();A();$r();Oo();KM=Sn(qM,"Updater")});function _a({value:e,onChange:t,validate:n}){let[r,i]=O.useState(e),[s,l]=O.useState();function c(u){i(u);let p=n(u);p===!0?(l(void 0),t(u)):l(p)}return o(f,null,o(Ve,{type:"text",value:r,onChange:c,error:s}))}var Gu=g(()=>{"use strict";a();A()});var iv={};Be(iv,{default:()=>QM});function YM(e){try{return new URL(e),!0}catch{return"Invalid URL"}}async function ZM(){let e=await fetch(new URL("/v1/",ko()),{method:"DELETE",headers:new Headers({Authorization:await qr()})});if(!e.ok){ya.error(`Failed to erase data, API returned ${e.status}`),Ie({title:"Cloud Integrations",body:`Could not erase all data (API returned ${e.status}), please contact support.`,color:"var(--red-360)"});return}E.cloud.authenticated=!1,await ru(),Ie({title:"Cloud Integrations",body:"Successfully erased all data.",color:"var(--green-360)"})}function XM(){let{cloud:e}=ct(["cloud.authenticated","cloud.settingsSync"]),t=e.authenticated&&e.settingsSync;return o(S.FormSection,{title:"Settings Sync",className:q.top16},o(S.FormText,{variant:"text-md/normal",className:q.bottom20},"Synchronize your settings to the cloud. This allows easy synchronization across multiple devices with minimal effort."),o(pt,{key:"cloud-sync",disabled:!e.authenticated,value:e.settingsSync,onChange:n=>{e.settingsSync=n}},"Settings Sync"),o("div",{className:"vc-cloud-settings-sync-grid"},o(R,{size:R.Sizes.SMALL,disabled:!t,onClick:()=>Kr(!0)},"Sync to Cloud"),o(V,{text:"This will overwrite your local settings with the ones on the cloud. Use wisely!"},({onMouseLeave:n,onMouseEnter:r})=>o(R,{onMouseLeave:n,onMouseEnter:r,size:R.Sizes.SMALL,color:R.Colors.RED,disabled:!t,onClick:()=>xa(!0,!0)},"Sync from Cloud")),o(R,{size:R.Sizes.SMALL,color:R.Colors.RED,disabled:!t,onClick:()=>ey()},"Delete Cloud Settings")))}function JM(){let e=ct(["cloud.authenticated","cloud.url"]);return o(vn,{title:"Vencord Cloud"},o(S.FormSection,{title:"Cloud Settings",className:q.top16},o(S.FormText,{variant:"text-md/normal",className:q.bottom20},"Vencord comes with a cloud integration that adds goodies like settings sync across devices. It ",o(st,{href:"https://vencord.dev/cloud/privacy"},"respects your privacy"),", and the ",o(st,{href:"https://github.com/Vencord/Backend"},"source code")," is AGPL 3.0 licensed so you can host it yourself."),o(pt,{key:"backend",value:e.cloud.authenticated,onChange:t=>{t&&Yh(),t||(e.cloud.authenticated=t)},note:"This will request authorization if you have not yet set up cloud integrations."},"Enable Cloud Integrations"),o(S.FormTitle,{tag:"h5"},"Backend URL"),o(S.FormText,{className:q.bottom8},"Which backend to use when using cloud integrations."),o(_a,{key:"backendUrl",value:e.cloud.url,onChange:t=>{e.cloud.url=t,e.cloud.authenticated=!1,ru()},validate:YM}),o(R,{className:q.top8,size:R.Sizes.MEDIUM,color:R.Colors.RED,disabled:!e.cloud.authenticated,onClick:()=>rn.show({title:"Are you sure?",body:"Once your data is erased, we cannot recover it. There's no going back!",onConfirm:ZM,confirmText:"Erase it!",confirmColor:"vc-cloud-erase-data-danger-btn",cancelText:"Nevermind"})},"Erase All Data"),o(S.FormDivider,{className:q.top16})),o(XM,null))}var QM,sv=g(()=>{"use strict";a();Ao();$();Gu();lo();iu();at();ji();A();Oo();QM=Sn(JM,"Cloud")});var av={};Be(av,{default:()=>eP});function VM(){return o(vn,{title:"Backup & Restore"},o(wt,{className:oe("vc-settings-card","vc-backup-restore-card")},o(ge,{flexDirection:"column"},o("strong",null,"Warning"),o("span",null,"Importing a settings file will overwrite your current settings."))),o(re,{variant:"text-md/normal",className:q.bottom8},"You can import and export your Vencord settings as a JSON file. This allows you to easily transfer your settings to another device, or recover your settings after reinstalling Vencord or Discord."),o(re,{variant:"text-md/normal",className:q.bottom8},"Settings Export contains:",o("ul",null,o("li",null,"\u2014 Custom QuickCSS"),o("li",null,"\u2014 Theme Links"),o("li",null,"\u2014 Plugin Settings"))),o(ge,null,o(R,{onClick:()=>Vh(),size:R.Sizes.SMALL},"Import Settings"),o(R,{onClick:Jh,size:R.Sizes.SMALL},"Export Settings")))}var eP,lv=g(()=>{"use strict";a();Lt();at();Re();ji();A();Oo();eP=Sn(VM,"Backup & Restore")});var ss,Hu=g(()=>{"use strict";a();Pt();$();P();w();A();$r();ss=y({name:"Settings",description:"Adds Settings UI and debug info",authors:[d.Ven,d.Megu],required:!0,start(){ce("user-settings-cog",e=>()=>{e.find(n=>Array.isArray(n)&&n.some(r=>r?.props?.id==="VencordSettings"))?.forEach(n=>{let r=n?.props?.id;(r?.startsWith("Vencord")||r?.startsWith("Vesktop"))&&(n.props.action=()=>Qn.open(r))})})},patches:[{find:".versionHash",replacement:[{match:/\[\(0,.{1,3}\.jsxs?\)\((.{1,10}),(\{[^{}}]+\{.{0,20}.versionHash,.+?\})\)," "/,replace:(e,t,n)=>(n=n.replace(/children:\[.+\]/,""),`${e},Vencord.Plugins.plugins.Settings.makeInfoElements(${t}, ${n})`)}]},{find:"Messages.ACTIVITY_SETTINGS",replacement:{get match(){switch(E.plugins.Settings.settingsLocation){case"top":return/\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.USER_SETTINGS\}/;case"aboveNitro":return/\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.BILLING_SETTINGS\}/;case"belowNitro":return/\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.APP_SETTINGS\}/;case"belowActivity":return/(?<=\{section:(\i\.\i)\.DIVIDER},)\{section:"changelog"/;case"bottom":return/\{section:(\i\.\i)\.CUSTOM,\s*element:.+?}/;case"aboveActivity":default:return/\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.ACTIVITY_SETTINGS\}/}},replace:"...$self.makeSettingsCategories($1),$&"}}],customSections:[],makeSettingsCategories(e){return[{section:e.HEADER,label:"Vencord",className:"vc-settings-header"},{section:"VencordSettings",label:"Vencord",element:(dy(),To(py)).default,className:"vc-settings"},{section:"VencordPlugins",label:"Plugins",element:(Jy(),To(Xy)).default,className:"vc-plugins"},{section:"VencordThemes",label:"Themes",element:(Vy(),To(Qy)).default,className:"vc-themes"},{section:"VencordUpdater",label:"Updater",element:(rv(),To(ov)).default,className:"vc-updater"},{section:"VencordCloud",label:"Cloud",element:(sv(),To(iv)).default,className:"vc-cloud"},{section:"VencordSettingsSync",label:"Backup & Restore",element:(lv(),To(av)).default,className:"vc-backup-restore"},!1,...this.customSections.map(t=>t(e)),{section:e.DIVIDER}].filter(Boolean)},options:{settingsLocation:{type:4,description:"Where to put the Vencord settings section",options:[{label:"At the very top",value:"top"},{label:"Above the Nitro section",value:"aboveNitro"},{label:"Below the Nitro section",value:"belowNitro"},{label:"Above Activity Settings",value:"aboveActivity",default:!0},{label:"Below Activity Settings",value:"belowActivity"},{label:"At the very bottom",value:"bottom"}],restartNeeded:!0}},get electronVersion(){return VencordNative.native.getVersions().electron||window.armcord?.electron||null},get chromiumVersion(){try{return VencordNative.native.getVersions().chrome||navigator.userAgentData?.brands?.find(e=>e.brand==="Chromium"||e.brand==="Google Chrome")?.version||null}catch{return null}},get additionalInfo(){return` (Vesktop v${VesktopNative.app.getVersion()})`},makeInfoElements(e,t){let{electronVersion:n,chromiumVersion:r,additionalInfo:i}=this;return o(f,null,o(e,{...t},"Vencord ",sn,i),n&&o(e,{...t},"Electron ",n),r&&o(e,{...t},"Chromium ",r))}})});var cv,tP,zu,uv=g(()=>{"use strict";a();as();P();Re();ro();w();yr();A();$r();gr();Hu();cv="Vencord-SupportHelper-Dismiss",tP=[na,"1024286218801926184","1033680203433660458"],zu=y({name:"SupportHelper",required:!0,description:"Helps us provide support to you",authors:[d.Ven],dependencies:["CommandsAPI"],commands:[{name:"vencord-debug",description:"Send Vencord Debug info",predicate:e=>tP.includes(e.channel.id),async execute(){let{RELEASE_CHANNEL:e}=window.GLOBAL_ENV,t=(()=>`Vesktop v${VesktopNative.app.getVersion()}`)(),n=c=>c.endsWith("API")||Oe[c].required,r=Object.keys(Oe).filter(c=>Vencord.Plugins.isPluginEnabled(c)&&!n(c)),i=Object.keys(Oe).filter(c=>Vencord.Plugins.isPluginEnabled(c)&&n(c)),s={Vencord:`v1.6.3 \u2022 ${sn}${ss.additionalInfo} - ${Intl.DateTimeFormat("en-GB",{dateStyle:"medium"}).format(1700718501616)}`,"Discord Branch":e,Client:t,Platform:window.navigator.platform,Outdated:Do,OpenAsar:"openasar"in window};return{content:` +Please try again.`;an.show({title:"Oops!",body:o(Sn,null,n.split(` +`).map(i=>o("div",null,$e.parse(i))))})}finally{e(!1)}}}function Vy({repo:e,hash:t,disabled:n=!1}){return o(it,{href:`${e}/commit/${t}`,disabled:n},t)}function ev({updates:e,repo:t,repoPending:n}){return o(xt,{style:{padding:".5em"}},e.map(({hash:r,author:i,message:s})=>o("div",null,o("code",null,o(Vy,{repo:t,hash:r,disabled:n})),o("span",{style:{marginLeft:"0.5em",color:"var(--text-normal)"}},s," - ",i))))}function OM(e){let[t,n]=O.useState(_o),[r,i]=O.useState(!1),[s,l]=O.useState(!1),c=(t?.length??0)>0;return o(f,null,!t&&Xr?o(f,null,o(S.FormText,null,"Failed to check updates. Check the console for more info"),o(Sn,{style:{padding:"1em"}},o("p",null,Xr.stderr||Xr.stdout||"An unknown error occurred"))):o(S.FormText,{className:Y.bottom8},c?`There are ${t.length} Updates`:"Up to Date!"),c&&o(ev,{updates:t,...e}),o(ye,{className:re(Y.bottom8,Y.top8)},c&&o(E,{size:E.Sizes.SMALL,disabled:s||r,onClick:Qy(l,async()=>{await Qr()&&(n([]),await new Promise(u=>{an.show({title:"Update Success!",body:"Successfully updated. Restart now to apply the changes?",confirmText:"Restart",cancelText:"Not now!",onConfirm(){un(),u()},onCancel:u})}))})},"Update Now"),o(E,{size:E.Sizes.SMALL,disabled:s||r,onClick:Qy(i,async()=>{await Jr()?n(_o):(n([]),ee.show({message:"No updates found!",id:ee.genId(),type:ee.Type.MESSAGE,options:{position:ee.Position.BOTTOM}}))})},"Check for Updates")))}function _M(e){return o(f,null,o(S.FormText,{className:Y.bottom8},"Your local copy has more recent commits. Please stash or reset them."),o(ev,{...e,updates:_o}))}function BM(){let e=lt(["notifyAboutUpdates","autoUpdate","autoUpdateNotification"]),[t,n,r]=ot(su,{fallbackValue:"Loading..."});O.useEffect(()=>{n&&hr.error("Failed to retrieve repo",n)},[n]);let i={repo:t,repoPending:r};return o(Tn,{title:"Vencord Updater"},o(S.FormTitle,{tag:"h5"},"Updater Settings"),o(pt,{value:e.notifyAboutUpdates,onChange:s=>e.notifyAboutUpdates=s,note:"Shows a notification on startup",disabled:e.autoUpdate},"Get notified about new updates"),o(pt,{value:e.autoUpdate,onChange:s=>e.autoUpdate=s,note:"Automatically update Vencord without confirmation prompt"},"Automatically update"),o(pt,{value:e.autoUpdateNotification,onChange:s=>e.autoUpdateNotification=s,note:"Shows a notification when Vencord automatically updates",disabled:!e.autoUpdate},"Get notified when an automatic update completes"),o(S.FormTitle,{tag:"h5"},"Repo"),o(S.FormText,{className:"vc-text-selectable"},r?t:n?"Failed to retrieve - check console":o(it,{href:t},t.split("/").slice(-2).join("/"))," ","(",o(Vy,{hash:ln,repo:t,disabled:r}),")"),o(S.FormDivider,{className:Y.top8+" "+Y.bottom8}),o(S.FormTitle,{tag:"h5"},"Updates"),Ki?o(_M,{...i}):o(OM,{...i}))}var FM,nv=g(()=>{"use strict";a();$();jr();Dt();mo();ct();Be();Do();Oe();yr();I();Hr();Fo();FM=xn(BM,"Updater")});function Fa({value:e,onChange:t,validate:n}){let[r,i]=O.useState(e),[s,l]=O.useState();function c(u){i(u);let d=n(u);d===!0?(l(void 0),t(u)):l(d)}return o(f,null,o(et,{type:"text",value:r,onChange:c,error:s}))}var $u=g(()=>{"use strict";a();I()});var ov={};Ue(ov,{default:()=>zM});function UM(e){try{return new URL(e),!0}catch{return"Invalid URL"}}async function $M(){let e=await fetch(new URL("/v1/",Eo()),{method:"DELETE",headers:new Headers({Authorization:await Yr()})});if(!e.ok){va.error(`Failed to erase data, API returned ${e.status}`),Ne({title:"Cloud Integrations",body:`Could not erase all data (API returned ${e.status}), please contact support.`,color:"var(--red-360)"});return}L.cloud.authenticated=!1,await nu(),Ne({title:"Cloud Integrations",body:"Successfully erased all data.",color:"var(--green-360)"})}function GM(){let{cloud:e}=lt(["cloud.authenticated","cloud.settingsSync"]),t=e.authenticated&&e.settingsSync;return o(S.FormSection,{title:"Settings Sync",className:Y.top16},o(S.FormText,{variant:"text-md/normal",className:Y.bottom20},"Synchronize your settings to the cloud. This allows easy synchronization across multiple devices with minimal effort."),o(pt,{key:"cloud-sync",disabled:!e.authenticated,value:e.settingsSync,onChange:n=>{e.settingsSync=n}},"Settings Sync"),o("div",{className:"vc-cloud-settings-sync-grid"},o(E,{size:E.Sizes.SMALL,disabled:!t,onClick:()=>Zr(!0)},"Sync to Cloud"),o(V,{text:"This will overwrite your local settings with the ones on the cloud. Use wisely!"},({onMouseLeave:n,onMouseEnter:r})=>o(E,{onMouseLeave:n,onMouseEnter:r,size:E.Sizes.SMALL,color:E.Colors.RED,disabled:!t,onClick:()=>wa(!0,!0)},"Sync from Cloud")),o(E,{size:E.Sizes.SMALL,color:E.Colors.RED,disabled:!t,onClick:()=>Vh()},"Delete Cloud Settings")))}function HM(){let e=lt(["cloud.authenticated","cloud.url"]);return o(Tn,{title:"Vencord Cloud"},o(S.FormSection,{title:"Cloud Settings",className:Y.top16},o(S.FormText,{variant:"text-md/normal",className:Y.bottom20},"Vencord comes with a cloud integration that adds goodies like settings sync across devices. It ",o(it,{href:"https://vencord.dev/cloud/privacy"},"respects your privacy"),", and the ",o(it,{href:"https://github.com/Vencord/Backend"},"source code")," is AGPL 3.0 licensed so you can host it yourself."),o(pt,{key:"backend",value:e.cloud.authenticated,onChange:t=>{t&&Kh(),t||(e.cloud.authenticated=t)},note:"This will request authorization if you have not yet set up cloud integrations."},"Enable Cloud Integrations"),o(S.FormTitle,{tag:"h5"},"Backend URL"),o(S.FormText,{className:Y.bottom8},"Which backend to use when using cloud integrations."),o(Fa,{key:"backendUrl",value:e.cloud.url,onChange:t=>{e.cloud.url=t,e.cloud.authenticated=!1,nu()},validate:UM}),o(E,{className:Y.top8,size:E.Sizes.MEDIUM,color:E.Colors.RED,disabled:!e.cloud.authenticated,onClick:()=>an.show({title:"Are you sure?",body:"Once your data is erased, we cannot recover it. There's no going back!",onConfirm:$M,confirmText:"Erase it!",confirmColor:"vc-cloud-erase-data-danger-btn",cancelText:"Nevermind"})},"Erase All Data"),o(S.FormDivider,{className:Y.top16})),o(GM,null))}var zM,rv=g(()=>{"use strict";a();ko();$();$u();mo();ou();ct();Wi();I();Fo();zM=xn(HM,"Cloud")});var iv={};Ue(iv,{default:()=>WM});function jM(){return o(Tn,{title:"Backup & Restore"},o(xt,{className:re("vc-settings-card","vc-backup-restore-card")},o(ye,{flexDirection:"column"},o("strong",null,"Warning"),o("span",null,"Importing a settings file will overwrite your current settings."))),o(oe,{variant:"text-md/normal",className:Y.bottom8},"You can import and export your Vencord settings as a JSON file. This allows you to easily transfer your settings to another device, or recover your settings after reinstalling Vencord or Discord."),o(oe,{variant:"text-md/normal",className:Y.bottom8},"Settings Export contains:",o("ul",null,o("li",null,"\u2014 Custom QuickCSS"),o("li",null,"\u2014 Theme Links"),o("li",null,"\u2014 Plugin Settings"))),o(ye,null,o(E,{onClick:()=>Qh(),size:E.Sizes.SMALL},"Import Settings"),o(E,{onClick:Xh,size:E.Sizes.SMALL},"Export Settings")))}var WM,sv=g(()=>{"use strict";a();Dt();ct();Be();Wi();I();Fo();WM=xn(jM,"Backup & Restore")});var is,Gu=g(()=>{"use strict";a();Mt();$();P();M();I();Hr();is=y({name:"Settings",description:"Adds Settings UI and debug info",authors:[p.Ven,p.Megu],required:!0,start(){ue("user-settings-cog",e=>()=>{e.find(n=>Array.isArray(n)&&n.some(r=>r?.props?.id==="VencordSettings"))?.forEach(n=>{let r=n?.props?.id;(r?.startsWith("Vencord")||r?.startsWith("Vesktop"))&&(n.props.action=()=>no.open(r))})})},patches:[{find:".versionHash",replacement:[{match:/\[\(0,.{1,3}\.jsxs?\)\((.{1,10}),(\{[^{}}]+\{.{0,20}.versionHash,.+?\})\)," "/,replace:(e,t,n)=>(n=n.replace(/children:\[.+\]/,""),`${e},Vencord.Plugins.plugins.Settings.makeInfoElements(${t}, ${n})`)}]},{find:"Messages.ACTIVITY_SETTINGS",replacement:{get match(){switch(L.plugins.Settings.settingsLocation){case"top":return/\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.USER_SETTINGS\}/;case"aboveNitro":return/\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.BILLING_SETTINGS\}/;case"belowNitro":return/\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.APP_SETTINGS\}/;case"belowActivity":return/(?<=\{section:(\i\.\i)\.DIVIDER},)\{section:"changelog"/;case"bottom":return/\{section:(\i\.\i)\.CUSTOM,\s*element:.+?}/;case"aboveActivity":default:return/\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.ACTIVITY_SETTINGS\}/}},replace:"...$self.makeSettingsCategories($1),$&"}}],customSections:[],makeSettingsCategories(e){return[{section:e.HEADER,label:"Vencord",className:"vc-settings-header"},{section:"VencordSettings",label:"Vencord",element:(py(),Io(uy)).default,className:"vc-settings"},{section:"VencordPlugins",label:"Plugins",element:(Zy(),Io(Yy)).default,className:"vc-plugins"},{section:"VencordThemes",label:"Themes",element:(Jy(),Io(Xy)).default,className:"vc-themes"},{section:"VencordUpdater",label:"Updater",element:(nv(),Io(tv)).default,className:"vc-updater"},{section:"VencordCloud",label:"Cloud",element:(rv(),Io(ov)).default,className:"vc-cloud"},{section:"VencordSettingsSync",label:"Backup & Restore",element:(sv(),Io(iv)).default,className:"vc-backup-restore"},!1,...this.customSections.map(t=>t(e)),{section:e.DIVIDER}].filter(Boolean)},options:{settingsLocation:{type:4,description:"Where to put the Vencord settings section",options:[{label:"At the very top",value:"top"},{label:"Above the Nitro section",value:"aboveNitro"},{label:"Below the Nitro section",value:"belowNitro"},{label:"Above Activity Settings",value:"aboveActivity",default:!0},{label:"Below Activity Settings",value:"belowActivity"},{label:"At the very bottom",value:"bottom"}],restartNeeded:!0}},get electronVersion(){return VencordNative.native.getVersions().electron||window.armcord?.electron||null},get chromiumVersion(){try{return VencordNative.native.getVersions().chrome||navigator.userAgentData?.brands?.find(e=>e.brand==="Chromium"||e.brand==="Google Chrome")?.version||null}catch{return null}},get additionalInfo(){return` (Vesktop v${VesktopNative.app.getVersion()})`},makeInfoElements(e,t){let{electronVersion:n,chromiumVersion:r,additionalInfo:i}=this;return o(f,null,o(e,{...t},"Vencord ",ln,i),n&&o(e,{...t},"Electron ",n),r&&o(e,{...t},"Chromium ",r))}})});var av,qM,Hu,lv=g(()=>{"use strict";a();ss();P();Be();lo();M();yr();I();Hr();gr();Gu();av="Vencord-SupportHelper-Dismiss",qM=[oa,"1024286218801926184","1033680203433660458"],Hu=y({name:"SupportHelper",required:!0,description:"Helps us provide support to you",authors:[p.Ven],dependencies:["CommandsAPI"],commands:[{name:"vencord-debug",description:"Send Vencord Debug info",predicate:e=>qM.includes(e.channel.id),async execute(){let{RELEASE_CHANNEL:e}=window.GLOBAL_ENV,t=(()=>`Vesktop v${VesktopNative.app.getVersion()}`)(),n=c=>c.endsWith("API")||He[c].required,r=Object.keys(He).filter(c=>Vencord.Plugins.isPluginEnabled(c)&&!n(c)),i=Object.keys(He).filter(c=>Vencord.Plugins.isPluginEnabled(c)&&n(c)),s={Vencord:`v1.6.3 \u2022 ${ln}${is.additionalInfo} - ${Intl.DateTimeFormat("en-GB",{dateStyle:"medium"}).format(1699510576725)}`,"Discord Branch":e,Client:t,Platform:window.navigator.platform,Outdated:Bo,OpenAsar:"openasar"in window};return{content:` **Vencord Debug Info** >>> ${Object.entries(s).map(([c,u])=>`${c}: ${u}`).join(` `)} Enabled Plugins (${r.length+i.length}): -${Qi(r.join(", ")+` +${Vi(r.join(", ")+` `+i.join(", "))} -`.trim().replaceAll("```\n","```")}}}],flux:{async CHANNEL_SELECT({channelId:e}){if(e===na&&!Ei(W.getCurrentUser().id)&&Do&&sn!==await Gt.get(cv)){let t=()=>Gt.set(cv,sn);rn.show({title:"Hold on!",body:o("div",null,o(S.FormText,null,"You are using an outdated version of Vencord! Chances are, your issue is already fixed."),o(S.FormText,null,"Please first update using the Updater Page in Settings, or use the VencordInstaller (Update Vencord Button) to do so, in case you can't access the Updater page.")),onCancel:t,onConfirm:t})}}}})});var ju,pv=g(()=>{"use strict";a();P();w();ju=y({name:"AlwaysAnimate",description:"Animates anything that can be animated",authors:[d.FieryFlames],patches:[{find:"canAnimate:",all:!0,noWarn:!0,replacement:{match:/canAnimate:.+?(?=([,}].*?\)))/g,replace:(e,t)=>t.match(/}=.+/)==null?"canAnimate:!0":e}},{find:".Messages.GUILD_OWNER,",replacement:{match:/(?<=\.activityEmoji,.+?animate:)\i/,replace:"!0"}}]})});var Wu,dv=g(()=>{"use strict";a();P();w();Wu=y({name:"AlwaysTrust",description:"Removes the annoying untrusted domain and suspicious file popup",authors:[d.zt],patches:[{find:'.displayName="MaskedLinkStore"',replacement:{match:/(?<=isTrustedDomain\(\i\){)return \i\(\i\)/,replace:"return true"}},{find:"isSuspiciousDownload:",replacement:{match:/function \i\(\i\){(?=.{0,60}\.parse\(\i\))/,replace:"$&return null;"}}]})});var nP,qu,mv=g(()=>{"use strict";a();$();P();w();nP=/\.tar\.\w+$/,qu=y({name:"AnonymiseFileNames",authors:[d.obscurity],description:"Anonymise uploaded file names",patches:[{find:"instantBatchUpload:function",replacement:{match:/uploadFiles:(.{1,2}),/,replace:"uploadFiles:(...args)=>(args[0].uploads.forEach(f=>f.filename=$self.anonymise(f.filename)),$1(...args)),"}}],options:{method:{description:"Anonymising method",type:4,options:[{label:"Random Characters",value:0,default:!0},{label:"Consistent",value:1},{label:"Timestamp (4chan-like)",value:2}]},randomisedLength:{description:"Random characters length",type:1,default:7,disabled:()=>E.plugins.AnonymiseFileNames.method!==0},consistent:{description:"Consistent filename",type:0,default:"image",disabled:()=>E.plugins.AnonymiseFileNames.method!==1}},anonymise(e){let t="image",r=nP.exec(e)?.index??e.lastIndexOf("."),i=r!==-1?e.slice(r):"";switch(E.plugins.AnonymiseFileNames.method){case 0:let s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";t=Array.from({length:E.plugins.AnonymiseFileNames.randomisedLength},()=>s[Math.floor(Math.random()*s.length)]).join("");break;case 1:t=E.plugins.AnonymiseFileNames.consistent;break;case 2:t=`${Math.floor(Date.now()/1e3)}${Math.floor(window.performance.now())}`;break}return t+i}})});async function fv(e,t){return(await ur.fetchAssetIds(e,[t]))[0]}async function rP(e){let t={};return await oP.fetchApplicationsRPC(t,e),t.application}var oP,gv,ni,Ku,hv=g(()=>{"use strict";a();Pa();lo();P();w();j();A();oP=I("fetchApplicationsRPC","getRemoteIconURL");gv={};Ku=y({name:"WebRichPresence (arRPC)",description:"Client plugin for arRPC to enable RPC on Discord Web (experimental)",authors:[d.Ducko],settingsAboutComponent:()=>o(f,null,o(S.FormTitle,{tag:"h3"},"How to use arRPC"),o(S.FormText,null,o(st,{href:"https://github.com/OpenAsar/arrpc/tree/main#server"},"Follow the instructions in the GitHub repo")," to get the server running, and then enable the plugin.")),async handleEvent(e){let t=JSON.parse(e.data),{activity:n}=t,r=n?.assets;if(r?.large_image&&(r.large_image=await fv(n.application_id,r.large_image)),r?.small_image&&(r.small_image=await fv(n.application_id,r.small_image)),n){let i=n.application_id;gv[i]||=await rP(i);let s=gv[i];n.name||=s.name}F.dispatch({type:"LOCAL_ACTIVITY_UPDATE",...t})},async start(){if("armcord"in window)return;if(ni&&ni.close(),ni=new WebSocket("ws://127.0.0.1:1337"),ni.onmessage=this.handleEvent,!await new Promise(t=>setTimeout(()=>t(ni.readyState===WebSocket.OPEN),1e3))){Zi("Failed to connect to arRPC, is it running?","Retry",()=>{fu(),this.start()});return}ee.show({message:"Connected to arRPC",type:ee.Type.SUCCESS,id:ee.genId(),options:{duration:1e3,position:ee.Position.BOTTOM}})},stop(){F.dispatch({type:"LOCAL_ACTIVITY_UPDATE",activity:null}),ni?.close()}})});var Yu,yv=g(()=>{"use strict";a();P();w();Yu=y({name:"BANger",description:"Replaces the GIF in the ban dialogue with a custom one.",authors:[d.Xinto,d.Glitch],patches:[{find:"BAN_CONFIRM_TITLE.",replacement:{match:/src:\i\("\d+"\)/g,replace:"src: Vencord.Settings.plugins.BANger.source"}}],options:{source:{description:"Source to replace ban GIF with (Video or Gif)",type:0,default:"https://i.imgur.com/wp5q52C.mp4",restartNeeded:!0}}})});var vv,Sv,iP,bv,Tv=g(()=>{"use strict";a();le();j();A();Zu();vv=Me("ChannelRTCStore"),Sv=I("a","animated","useTransition"),iP=Xe('("guildsnav")'),bv=_.wrap(e=>{let t=He([oi],()=>oi.getExpandedFolders()),n=He([vv],()=>vv.isFullscreenInContext()),r=o(iP,{...e,isBetterFolders:!0,betterFoldersExpandedIds:t}),i=!!t.size,s=document.querySelector(e.className.split(" ").map(c=>`.${c}`).join("")),l={display:n?"none":"flex"};return!s||!ft.store.sidebarAnim?i?o("div",{style:l},r):null:o(Sv.Transition,{items:i,from:{width:0},enter:{width:s.getBoundingClientRect().width},leave:{width:0},config:{duration:200}},(c,u)=>u&&o(Sv.animated.div,{style:{...c,...l}},r))},{noop:!0})});function lP(e){return aP.getGuildFolders().find(t=>t.guildIds.includes(e))}function wv(){for(let e of oi.getExpandedFolders())Ju.toggleGuildFolderExpand(e)}var sP,aP,oi,Ju,xv,Xu,ft,Qu,Zu=g(()=>{"use strict";a();$();P();w();j();A();Tv();({GuildsTree:sP}=I("GuildsTree")),aP=Me("SortedGuildStore"),oi=Me("ExpandedGuildFolderStore"),Ju=I("move","toggleGuildFolderExpand"),xv=null,Xu=!1;ft=D({sidebar:{type:3,description:"Display servers from folder on dedicated sidebar",restartNeeded:!0,default:!0},sidebarAnim:{type:3,description:"Animate opening the folder sidebar",default:!0},closeAllFolders:{type:3,description:"Close all folders when selecting a server not in a folder",default:!1},closeAllHomeButton:{type:3,description:"Close all folders when clicking on the home button",restartNeeded:!0,default:!1},closeOthers:{type:3,description:"Close other folders when opening a folder",default:!1},forceOpen:{type:3,description:"Force a folder to open when switching to a server of that folder",default:!1},keepIcons:{type:3,description:"Keep showing guild icons in the primary guild bar folder when it's open in the BetterFolders sidebar",restartNeeded:!0,default:!1},showFolderIcon:{type:4,description:"Show the folder icon above the folder guilds in the BetterFolders sidebar",options:[{label:"Never",value:0},{label:"Always",value:1,default:!0},{label:"When more than one folder is expanded",value:2}],restartNeeded:!0}}),Qu=y({name:"BetterFolders",description:"Shows server folders on dedicated sidebar and adds folder related improvements",authors:[d.juby,d.AutumnVN,d.Nuckyz],settings:ft,patches:[{find:'("guildsnav")',predicate:()=>ft.store.sidebar,replacement:[{match:/(?<=let{disableAppDownload:\i=\i\.isPlatformEmbedded,isOverlay:.+?)(?=}=\i,)/,replace:",isBetterFolders"},{match:/(useStateFromStoresArray\).{0,25}let \i)=(\i\.\i.getGuildsTree\(\))/,replace:(e,t,n)=>`${t}=$self.getGuildTree(!!arguments[0].isBetterFolders,${n},arguments[0].betterFoldersExpandedIds)`},{match:/lastTargetNode:\i\[\i\.length-1\].+?Fragment.+?\]}\)\]/,replace:"$&.filter($self.makeGuildsBarGuildListFilter(!!arguments[0].isBetterFolders))"},{match:/unreadMentionsIndicatorBottom,barClassName.+?}\)\]/,replace:"$&.filter($self.makeGuildsBarTreeFilter(!!arguments[0].isBetterFolders))"},{match:/(?<=\.Messages\.SERVERS.+?switch\((\i)\.type\){case \i\.\i\.FOLDER:.+?folderNode:\i,)/,replace:'isBetterFolders:typeof isBetterFolders!=="undefined"?isBetterFolders:false,'}]},{find:".MAX_GUILD_FOLDER_NAME_LENGTH,",predicate:()=>ft.store.sidebar&&ft.store.showFolderIcon!==1,replacement:[{match:/(useStateFromStores\).{0,20}=>)(\i\.\i)\.isFolderExpanded\(\i\)/,replace:(e,t,n)=>`${t}${n}.getExpandedFolders()`},{match:/(?<=folderNode:(\i),expanded:)\i(?=,)/,replace:(e,t)=>`typeof ${e}==="boolean"?${e}:${e}.has(${t}.id),betterFoldersExpandedIds:${e} instanceof Set?${e}:void 0`}]},{find:".FOLDER_ITEM_GUILD_ICON_MARGIN);",predicate:()=>ft.store.sidebar,replacement:[{predicate:()=>ft.store.keepIcons,match:/(?<=let{folderNode:\i,setNodeRef:\i,.+?expanded:(\i),.+?;)(?=let)/,replace:(e,t)=>`${t}=!!arguments[0].isBetterFolders&&${t};`},{predicate:()=>!ft.store.keepIcons,match:/(?<=\.Messages\.SERVER_FOLDER_PLACEHOLDER.+?useTransition\)\()/,replace:"!!arguments[0].isBetterFolders&&"},{predicate:()=>!ft.store.keepIcons,match:/expandedFolderBackground,.+?,(?=\i\(\(\i,\i,\i\)=>{let{key.{0,45}ul)(?<=selected:\i,expanded:(\i),.+?)/,replace:(e,t)=>`${e}!arguments[0].isBetterFolders&&${t}?null:`},{predicate:()=>ft.store.showFolderIcon!==1,match:/(?<=\.wrapper,children:\[)/,replace:"$self.shouldShowFolderIconAndBackground(!!arguments[0].isBetterFolders,arguments[0].betterFoldersExpandedIds)&&"},{predicate:()=>ft.store.showFolderIcon!==1,match:/(?<=\.expandedFolderBackground.+?}\),)(?=\i,)/,replace:"!$self.shouldShowFolderIconAndBackground(!!arguments[0].isBetterFolders,arguments[0].betterFoldersExpandedIds)?null:"}]},{find:"APPLICATION_LIBRARY,render",predicate:()=>ft.store.sidebar,replacement:{match:/(?<=({className:\i\.guilds,themeOverride:\i})\))/,replace:",$self.FolderSideBar($1)"}},{find:".Messages.DISCODO_DISABLED",predicate:()=>ft.store.closeAllHomeButton,replacement:{match:/(?<=onClick:\(\)=>{)(?=.{0,200}"discodo")/,replace:"$self.closeFolders();"}}],flux:{CHANNEL_SELECT(e){if(!(!ft.store.closeAllFolders&&!ft.store.forceOpen)&&xv!==e.guildId){xv=e.guildId;let t=lP(e.guildId);t?.folderId?ft.store.forceOpen&&!oi.isFolderExpanded(t.folderId)&&Ju.toggleGuildFolderExpand(t.folderId):ft.store.closeAllFolders&&wv()}},TOGGLE_GUILD_FOLDER_EXPAND(e){ft.store.closeOthers&&!Xu&&(Xu=!0,F.wait(()=>{let t=oi.getExpandedFolders();if(t.size>1)for(let n of t)n!==e.folderId&&Ju.toggleGuildFolderExpand(n);Xu=!1}))}},getGuildTree(e,t,n){if(!e||n==null)return t;let r=new sP;return r.root.children=t.root.children.filter(i=>n.has(i.id)),r.nodes=Object.fromEntries(Object.entries(t.nodes).filter(([i,s])=>n.has(s.id)||n.has(s.parentId))),r},makeGuildsBarGuildListFilter(e){return t=>e?t?.props?.["aria-label"]===ot.Messages.SERVERS:!0},makeGuildsBarTreeFilter(e){return t=>e?"onScroll"in t.props:!0},shouldShowFolderIconAndBackground(e,t){if(!e)return!0;switch(ft.store.showFolderIcon){case 0:return!1;case 1:return!0;case 2:return(t?.size??0)>1;default:return!0}},FolderSideBar:e=>o(bv,{...e}),closeFolders:wv})});var Vu,Mv=g(()=>{"use strict";a();P();w();Vu=y({name:"BetterGifAltText",authors:[d.Ven],description:"Change GIF alt text from simply being 'GIF' to containing the gif tags / filename",patches:[{find:"onCloseImage=",replacement:{match:/(return.{0,10}\.jsx.{0,50}isWindowFocused)/,replace:"$self.altify(e);$1"}},{find:".Messages.GIF,",replacement:{match:/alt:(\i)=(\i\.default\.Messages\.GIF)(?=,[^}]*\}=(\i))/,replace:"alt_$$:$1=$self.altify($3)||$2"}}],altify(e){if(e.alt??="GIF",e.alt!=="GIF")return e.alt;let t=e.original||e.src;try{t=decodeURI(t)}catch{}let n=t.slice(t.lastIndexOf("/")+1).replace(/\d/g,"").replace(/.gif$/,"").split(/[,\-_ ]+/g).slice(0,20).join(" ");return n.length>300&&(n=n.slice(0,300)+"..."),n&&(e.alt+=` - ${n}`),e.alt}})});var cP,ep,Pv=g(()=>{"use strict";a();$();P();w();j();cP=I("section","lastSection"),ep=y({name:"BetterNotesBox",description:"Hide notes or disable spellcheck (Configure in settings!!)",authors:[d.Ven],patches:[{find:"hideNote:",all:!0,noWarn:!0,predicate:()=>Vencord.Settings.plugins.BetterNotesBox.hide,replacement:{match:/hideNote:.+?(?=([,}].*?\)))/g,replace:(e,t)=>t.match(/}=.+/)==null?"hideNote:!0":e}},{find:"Messages.NOTE_PLACEHOLDER",replacement:{match:/\.NOTE_PLACEHOLDER,/,replace:"$&spellCheck:!Vencord.Settings.plugins.BetterNotesBox.noSpellCheck,"}},{find:".Messages.NOTE}",replacement:{match:/(?<=return \i\?)null(?=:\(0,\i\.jsxs)/,replace:"$self.patchPadding(arguments[0])"}}],options:{hide:{type:3,description:"Hide notes",default:!1,restartNeeded:!0},noSpellCheck:{type:3,description:"Disable spellcheck in notes",disabled:()=>E.plugins.BetterNotesBox.hide,default:!1}},patchPadding(e){if(!!e.lastSection)return o("div",{className:cP.lastSection})}})});var tp,Iv=g(()=>{"use strict";a();$();P();w();A();tp=y({name:"BetterRoleDot",authors:[d.Ven,d.AutumnVN],description:"Copy role colour on RoleDot (accessibility setting) click. Also allows using both RoleDot and coloured names simultaneously",patches:[{find:".dotBorderBase",replacement:{match:/,viewBox:"0 0 20 20"/,replace:"$&,onClick:()=>$self.copyToClipBoard(arguments[0].color),style:{cursor:'pointer'}"}},{find:'"dot"===',all:!0,noWarn:!0,predicate:()=>E.plugins.BetterRoleDot.bothStyles,replacement:{match:/"(?:username|dot)"===\i(?!\.\i)/g,replace:"true"}},{find:".ADD_ROLE_A11Y_LABEL",predicate:()=>E.plugins.BetterRoleDot.copyRoleColorInProfilePopout&&!E.plugins.BetterRoleDot.bothStyles,noWarn:!0,replacement:{match:/"dot"===\i/,replace:"true"}},{find:".roleVerifiedIcon",predicate:()=>E.plugins.BetterRoleDot.copyRoleColorInProfilePopout&&!E.plugins.BetterRoleDot.bothStyles,noWarn:!0,replacement:{match:/"dot"===\i/,replace:"true"}}],options:{bothStyles:{type:3,description:"Show both role dot and coloured names",restartNeeded:!0,default:!1},copyRoleColorInProfilePopout:{type:3,description:"Allow click on role dot in profile popout to copy role color",restartNeeded:!0,default:!1}},copyToClipBoard(e){Zt.copy(e),ee.show({message:"Copied to Clipboard!",type:ee.Type.SUCCESS,id:ee.genId(),options:{duration:1e3,position:ee.Position.BOTTOM}})}})});var np,Av=g(()=>{"use strict";a();P();w();np=y({name:"BetterUploadButton",authors:[d.obscurity,d.Ven],description:"Upload with a single click, open menu with right click",patches:[{find:"Messages.CHAT_ATTACH_UPLOAD_OR_INVITE",replacement:{match:/CHAT_ATTACH_UPLOAD_OR_INVITE,onDoubleClick:(.+?:void 0),\.\.\.(\i),/,replace:"$&onClick:$1,onContextMenu:$2.onClick,"}}]})});var Nv,Cv,kv=g(()=>{"use strict";a();j();Nv=Me("ApplicationStreamPreviewStore"),Cv=Me("ApplicationStreamingStore")});var uP,Ev,Rv,Lv,op,Dv=g(()=>{"use strict";a();Pt();$t();P();bt();w();A();kv();uP=async({guildId:e,channelId:t,ownerId:n})=>{let r=await Nv.getPreviewURL(e,t,n);!r||On(r)},Ev=(e,{userId:t})=>()=>{let n=Cv.getAnyStreamForUser(t);if(!n)return;let r=o(G.MenuItem,{label:"View Stream Preview",id:"view-stream-preview",icon:vy,action:()=>n&&uP(n),disabled:!n});e.push(o(G.MenuSeparator,null),r)},Rv=(e,{stream:t})=>Ev(e,{userId:t.ownerId}),Lv=(e,{user:t})=>Ev(e,{userId:t.id}),op=y({name:"BiggerStreamPreview",description:"This plugin allows you to enlarge stream previews",authors:[d.phil],start:()=>{ce("user-context",Lv),ce("stream-context",Rv)},stop:()=>{de("user-context",Lv),de("stream-context",Rv)}})});function Ov(){ls.textContent=` +`.trim().replaceAll("```\n","```")}}}],flux:{async CHANNEL_SELECT({channelId:e}){if(e===oa&&!Di(W.getCurrentUser().id)&&Bo&&ln!==await zt.get(av)){let t=()=>zt.set(av,ln);an.show({title:"Hold on!",body:o("div",null,o(S.FormText,null,"You are using an outdated version of Vencord! Chances are, your issue is already fixed."),o(S.FormText,null,"Please first update using the Updater Page in Settings, or use the VencordInstaller (Update Vencord Button) to do so, in case you can't access the Updater page.")),onCancel:t,onConfirm:t})}}}})});var zu,cv=g(()=>{"use strict";a();P();M();zu=y({name:"AlwaysAnimate",description:"Animates anything that can be animated",authors:[p.FieryFlames],patches:[{find:"canAnimate:",all:!0,noWarn:!0,replacement:{match:/canAnimate:.+?(?=([,}].*?\)))/g,replace:(e,t)=>t.match(/}=.+/)==null?"canAnimate:!0":e}},{find:".Messages.GUILD_OWNER,",replacement:{match:/(?<=\.activityEmoji,.+?animate:)\i/,replace:"!0"}}]})});var ju,uv=g(()=>{"use strict";a();P();M();ju=y({name:"AlwaysTrust",description:"Removes the annoying untrusted domain and suspicious file popup",authors:[p.zt],patches:[{find:'.displayName="MaskedLinkStore"',replacement:{match:/(?<=isTrustedDomain\(\i\){)return \i\(\i\)/,replace:"return true"}},{find:"isSuspiciousDownload:",replacement:{match:/function \i\(\i\){(?=.{0,60}\.parse\(\i\))/,replace:"$&return null;"}}]})});var KM,Wu,pv=g(()=>{"use strict";a();$();P();M();KM=/\.tar\.\w+$/,Wu=y({name:"AnonymiseFileNames",authors:[p.obscurity],description:"Anonymise uploaded file names",patches:[{find:"instantBatchUpload:function",replacement:{match:/uploadFiles:(.{1,2}),/,replace:"uploadFiles:(...args)=>(args[0].uploads.forEach(f=>f.filename=$self.anonymise(f.filename)),$1(...args)),"}}],options:{method:{description:"Anonymising method",type:4,options:[{label:"Random Characters",value:0,default:!0},{label:"Consistent",value:1},{label:"Timestamp (4chan-like)",value:2}]},randomisedLength:{description:"Random characters length",type:1,default:7,disabled:()=>L.plugins.AnonymiseFileNames.method!==0},consistent:{description:"Consistent filename",type:0,default:"image",disabled:()=>L.plugins.AnonymiseFileNames.method!==1}},anonymise(e){let t="image",r=KM.exec(e)?.index??e.lastIndexOf("."),i=r!==-1?e.slice(r):"";switch(L.plugins.AnonymiseFileNames.method){case 0:let s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";t=Array.from({length:L.plugins.AnonymiseFileNames.randomisedLength},()=>s[Math.floor(Math.random()*s.length)]).join("");break;case 1:t=L.plugins.AnonymiseFileNames.consistent;break;case 2:t=`${Math.floor(Date.now()/1e3)}${Math.floor(window.performance.now())}`;break}return t+i}})});async function dv(e,t){return(await ur.fetchAssetIds(e,[t]))[0]}async function ZM(e){let t={};return await YM.fetchApplicationsRPC(t,e),t.application}var YM,mv,ii,qu,fv=g(()=>{"use strict";a();Ia();mo();P();M();j();I();YM=A("fetchApplicationsRPC","getRemoteIconURL");mv={};qu=y({name:"WebRichPresence (arRPC)",description:"Client plugin for arRPC to enable RPC on Discord Web (experimental)",authors:[p.Ducko],settingsAboutComponent:()=>o(f,null,o(S.FormTitle,{tag:"h3"},"How to use arRPC"),o(S.FormText,null,o(it,{href:"https://github.com/OpenAsar/arrpc/tree/main#server"},"Follow the instructions in the GitHub repo")," to get the server running, and then enable the plugin.")),async handleEvent(e){let t=JSON.parse(e.data),{activity:n}=t,r=n?.assets;if(r?.large_image&&(r.large_image=await dv(n.application_id,r.large_image)),r?.small_image&&(r.small_image=await dv(n.application_id,r.small_image)),n){let i=n.application_id;mv[i]||=await ZM(i);let s=mv[i];n.name||=s.name}B.dispatch({type:"LOCAL_ACTIVITY_UPDATE",...t})},async start(){if("armcord"in window)return;if(ii&&ii.close(),ii=new WebSocket("ws://127.0.0.1:1337"),ii.onmessage=this.handleEvent,!await new Promise(t=>setTimeout(()=>t(ii.readyState===WebSocket.OPEN),1e3))){Xi("Failed to connect to arRPC, is it running?","Retry",()=>{du(),this.start()});return}ee.show({message:"Connected to arRPC",type:ee.Type.SUCCESS,id:ee.genId(),options:{duration:1e3,position:ee.Position.BOTTOM}})},stop(){B.dispatch({type:"LOCAL_ACTIVITY_UPDATE",activity:null}),ii?.close()}})});var Ku,gv=g(()=>{"use strict";a();P();M();Ku=y({name:"BANger",description:"Replaces the GIF in the ban dialogue with a custom one.",authors:[p.Xinto,p.Glitch],patches:[{find:"BAN_CONFIRM_TITLE.",replacement:{match:/src:\i\("\d+"\)/g,replace:"src: Vencord.Settings.plugins.BANger.source"}}],options:{source:{description:"Source to replace ban GIF with (Video or Gif)",type:0,default:"https://i.imgur.com/wp5q52C.mp4",restartNeeded:!0}}})});var hv,yv,XM,vv,Sv=g(()=>{"use strict";a();le();Oe();j();I();Yu();hv=Ie("ChannelRTCStore"),yv=A("a","animated","useTransition"),XM=me(()=>st(e=>e.type?.toString().includes('("guildsnav")'))),vv=_.wrap(e=>{let t=We([si],()=>si.getExpandedFolders()),n=We([hv],()=>hv.isFullscreenInContext()),r=o(XM,{...e,isBetterFolders:!0,betterFoldersExpandedIds:t}),i=!!t.size,s=document.querySelector(e.className.split(" ").map(c=>`.${c}`).join("")),l={display:n?"none":"flex"};return!s||!ft.store.sidebarAnim?i?o("div",{style:l},r):null:o(yv.Transition,{items:i,from:{width:0},enter:{width:s.getBoundingClientRect().width},leave:{width:0},config:{duration:200}},(c,u)=>u&&o(yv.animated.div,{style:{...c,...l}},r))},{noop:!0})});function VM(e){return QM.getGuildFolders().find(t=>t.guildIds.includes(e))}function Tv(){for(let e of si.getExpandedFolders())Xu.toggleGuildFolderExpand(e)}var JM,QM,si,Xu,bv,Zu,ft,Ju,Yu=g(()=>{"use strict";a();$();P();Zt();M();j();I();Sv();JM=Qe(()=>yt("GuildsTree").GuildsTree),QM=Ie("SortedGuildStore"),si=Ie("ExpandedGuildFolderStore"),Xu=A("move","toggleGuildFolderExpand"),bv=null,Zu=!1;ft=D({sidebar:{type:3,description:"Display servers from folder on dedicated sidebar",restartNeeded:!0,default:!0},sidebarAnim:{type:3,description:"Animate opening the folder sidebar",default:!0},closeAllFolders:{type:3,description:"Close all folders when selecting a server not in a folder",default:!1},closeAllHomeButton:{type:3,description:"Close all folders when clicking on the home button",restartNeeded:!0,default:!1},closeOthers:{type:3,description:"Close other folders when opening a folder",default:!1},forceOpen:{type:3,description:"Force a folder to open when switching to a server of that folder",default:!1},keepIcons:{type:3,description:"Keep showing guild icons in the primary guild bar folder when it's open in the BetterFolders sidebar",restartNeeded:!0,default:!1},showFolderIcon:{type:4,description:"Show the folder icon above the folder guilds in the BetterFolders sidebar",options:[{label:"Never",value:0},{label:"Always",value:1,default:!0},{label:"When more than one folder is expanded",value:2}],restartNeeded:!0}}),Ju=y({name:"BetterFolders",description:"Shows server folders on dedicated sidebar and adds folder related improvements",authors:[p.juby,p.AutumnVN,p.Nuckyz],settings:ft,patches:[{find:'("guildsnav")',predicate:()=>ft.store.sidebar,replacement:[{match:/(?<=let{disableAppDownload:\i=\i\.isPlatformEmbedded,isOverlay:.+?)(?=}=\i,)/,replace:",isBetterFolders"},{match:/(useStateFromStoresArray\).{0,25}let \i)=(\i\.\i.getGuildsTree\(\))/,replace:(e,t,n)=>`${t}=$self.getGuildTree(!!arguments[0].isBetterFolders,${n},arguments[0].betterFoldersExpandedIds)`},{match:/lastTargetNode:\i\[\i\.length-1\].+?Fragment.+?\]}\)\]/,replace:"$&.filter($self.makeGuildsBarGuildListFilter(!!arguments[0].isBetterFolders))"},{match:/unreadMentionsIndicatorBottom,barClassName.+?}\)\]/,replace:"$&.filter($self.makeGuildsBarTreeFilter(!!arguments[0].isBetterFolders))"},{match:/(?<=\.Messages\.SERVERS.+?switch\((\i)\.type\){case \i\.\i\.FOLDER:.+?folderNode:\i,)/,replace:'isBetterFolders:typeof isBetterFolders!=="undefined"?isBetterFolders:false,'}]},{find:".MAX_GUILD_FOLDER_NAME_LENGTH,",predicate:()=>ft.store.sidebar&&ft.store.showFolderIcon!==1,replacement:[{match:/(useStateFromStores\).{0,20}=>)(\i\.\i)\.isFolderExpanded\(\i\)/,replace:(e,t,n)=>`${t}${n}.getExpandedFolders()`},{match:/(?<=folderNode:(\i),expanded:)\i(?=,)/,replace:(e,t)=>`typeof ${e}==="boolean"?${e}:${e}.has(${t}.id),betterFoldersExpandedIds:${e} instanceof Set?${e}:void 0`}]},{find:".FOLDER_ITEM_GUILD_ICON_MARGIN);",predicate:()=>ft.store.sidebar,replacement:[{predicate:()=>ft.store.keepIcons,match:/(?<=let{folderNode:\i,setNodeRef:\i,.+?expanded:(\i),.+?;)(?=let)/,replace:(e,t)=>`${t}=!!arguments[0].isBetterFolders&&${t};`},{predicate:()=>!ft.store.keepIcons,match:/(?<=\.Messages\.SERVER_FOLDER_PLACEHOLDER.+?useTransition\)\()/,replace:"!!arguments[0].isBetterFolders&&"},{predicate:()=>!ft.store.keepIcons,match:/expandedFolderBackground,.+?,(?=\i\(\(\i,\i,\i\)=>{let{key.{0,45}ul)(?<=selected:\i,expanded:(\i),.+?)/,replace:(e,t)=>`${e}!arguments[0].isBetterFolders&&${t}?null:`},{predicate:()=>ft.store.showFolderIcon!==1,match:/(?<=\.wrapper,children:\[)/,replace:"$self.shouldShowFolderIconAndBackground(!!arguments[0].isBetterFolders,arguments[0].betterFoldersExpandedIds)&&"},{predicate:()=>ft.store.showFolderIcon!==1,match:/(?<=\.expandedFolderBackground.+?}\),)(?=\i,)/,replace:"!$self.shouldShowFolderIconAndBackground(!!arguments[0].isBetterFolders,arguments[0].betterFoldersExpandedIds)?null:"}]},{find:"APPLICATION_LIBRARY,render",predicate:()=>ft.store.sidebar,replacement:{match:/(?<=({className:\i\.guilds,themeOverride:\i})\))/,replace:",$self.FolderSideBar($1)"}},{find:".Messages.DISCODO_DISABLED",predicate:()=>ft.store.closeAllHomeButton,replacement:{match:/(?<=onClick:\(\)=>{)(?=.{0,200}"discodo")/,replace:"$self.closeFolders();"}}],flux:{CHANNEL_SELECT(e){if(!(!ft.store.closeAllFolders&&!ft.store.forceOpen)&&bv!==e.guildId){bv=e.guildId;let t=VM(e.guildId);t?.folderId?ft.store.forceOpen&&!si.isFolderExpanded(t.folderId)&&Xu.toggleGuildFolderExpand(t.folderId):ft.store.closeAllFolders&&Tv()}},TOGGLE_GUILD_FOLDER_EXPAND(e){ft.store.closeOthers&&!Zu&&(Zu=!0,B.wait(()=>{let t=si.getExpandedFolders();if(t.size>1)for(let n of t)n!==e.folderId&&Xu.toggleGuildFolderExpand(n);Zu=!1}))}},getGuildTree(e,t,n){if(!e||n==null)return t;let r=new JM;return r.root.children=t.root.children.filter(i=>n.has(i.id)),r.nodes=Object.fromEntries(Object.entries(t.nodes).filter(([i,s])=>n.has(s.id)||n.has(s.parentId))),r},makeGuildsBarGuildListFilter(e){return t=>e?t?.props?.["aria-label"]===Ct.Messages.SERVERS:!0},makeGuildsBarTreeFilter(e){return t=>e?"onScroll"in t.props:!0},shouldShowFolderIconAndBackground(e,t){if(!e)return!0;switch(ft.store.showFolderIcon){case 0:return!1;case 1:return!0;case 2:return(t?.size??0)>1;default:return!0}},FolderSideBar:e=>o(vv,{...e}),closeFolders:Tv})});var Qu,xv=g(()=>{"use strict";a();P();M();Qu=y({name:"BetterGifAltText",authors:[p.Ven],description:"Change GIF alt text from simply being 'GIF' to containing the gif tags / filename",patches:[{find:"onCloseImage=",replacement:{match:/(return.{0,10}\.jsx.{0,50}isWindowFocused)/,replace:"$self.altify(e);$1"}},{find:".Messages.GIF,",replacement:{match:/alt:(\i)=(\i\.default\.Messages\.GIF)(?=,[^}]*\}=(\i))/,replace:"alt_$$:$1=$self.altify($3)||$2"}}],altify(e){if(e.alt??="GIF",e.alt!=="GIF")return e.alt;let t=e.original||e.src;try{t=decodeURI(t)}catch{}let n=t.slice(t.lastIndexOf("/")+1).replace(/\d/g,"").replace(/.gif$/,"").split(/[,\-_ ]+/g).slice(0,20).join(" ");return n.length>300&&(n=n.slice(0,300)+"..."),n&&(e.alt+=` - ${n}`),e.alt}})});var eP,Vu,wv=g(()=>{"use strict";a();$();P();M();j();eP=A("section","lastSection"),Vu=y({name:"BetterNotesBox",description:"Hide notes or disable spellcheck (Configure in settings!!)",authors:[p.Ven],patches:[{find:"hideNote:",all:!0,noWarn:!0,predicate:()=>Vencord.Settings.plugins.BetterNotesBox.hide,replacement:{match:/hideNote:.+?(?=([,}].*?\)))/g,replace:(e,t)=>t.match(/}=.+/)==null?"hideNote:!0":e}},{find:"Messages.NOTE_PLACEHOLDER",replacement:{match:/\.NOTE_PLACEHOLDER,/,replace:"$&spellCheck:!Vencord.Settings.plugins.BetterNotesBox.noSpellCheck,"}},{find:".Messages.NOTE}",replacement:{match:/(?<=return \i\?)null(?=:\(0,\i\.jsxs)/,replace:"$self.patchPadding(arguments[0])"}}],options:{hide:{type:3,description:"Hide notes",default:!1,restartNeeded:!0},noSpellCheck:{type:3,description:"Disable spellcheck in notes",disabled:()=>L.plugins.BetterNotesBox.hide,default:!1}},patchPadding(e){if(!!e.lastSection)return o("div",{className:eP.lastSection})}})});var ep,Mv=g(()=>{"use strict";a();$();P();M();I();ep=y({name:"BetterRoleDot",authors:[p.Ven,p.AutumnVN],description:"Copy role colour on RoleDot (accessibility setting) click. Also allows using both RoleDot and coloured names simultaneously",patches:[{find:".dotBorderBase",replacement:{match:/,viewBox:"0 0 20 20"/,replace:"$&,onClick:()=>$self.copyToClipBoard(arguments[0].color),style:{cursor:'pointer'}"}},{find:'"dot"===',all:!0,noWarn:!0,predicate:()=>L.plugins.BetterRoleDot.bothStyles,replacement:{match:/"(?:username|dot)"===\i(?!\.\i)/g,replace:"true"}},{find:".ADD_ROLE_A11Y_LABEL",predicate:()=>L.plugins.BetterRoleDot.copyRoleColorInProfilePopout&&!L.plugins.BetterRoleDot.bothStyles,noWarn:!0,replacement:{match:/"dot"===\i/,replace:"true"}},{find:".roleVerifiedIcon",predicate:()=>L.plugins.BetterRoleDot.copyRoleColorInProfilePopout&&!L.plugins.BetterRoleDot.bothStyles,noWarn:!0,replacement:{match:/"dot"===\i/,replace:"true"}}],options:{bothStyles:{type:3,description:"Show both role dot and coloured names",restartNeeded:!0,default:!1},copyRoleColorInProfilePopout:{type:3,description:"Allow click on role dot in profile popout to copy role color",restartNeeded:!0,default:!1}},copyToClipBoard(e){Qt.copy(e),ee.show({message:"Copied to Clipboard!",type:ee.Type.SUCCESS,id:ee.genId(),options:{duration:1e3,position:ee.Position.BOTTOM}})}})});var tp,Pv=g(()=>{"use strict";a();P();M();tp=y({name:"BetterUploadButton",authors:[p.obscurity,p.Ven],description:"Upload with a single click, open menu with right click",patches:[{find:"Messages.CHAT_ATTACH_UPLOAD_OR_INVITE",replacement:{match:/CHAT_ATTACH_UPLOAD_OR_INVITE,onDoubleClick:(.+?:void 0),\.\.\.(\i),/,replace:"$&onClick:$1,onContextMenu:$2.onClick,"}}]})});var Iv,Av,Nv=g(()=>{"use strict";a();j();Iv=Ie("ApplicationStreamPreviewStore"),Av=Ie("ApplicationStreamingStore")});var tP,Rv,Cv,kv,np,Lv=g(()=>{"use strict";a();Mt();Ht();P();It();M();I();Nv();tP=async({guildId:e,channelId:t,ownerId:n})=>{let r=await Iv.getPreviewURL(e,t,n);!r||Bn(r)},Rv=(e,{userId:t})=>()=>{let n=Av.getAnyStreamForUser(t);if(!n)return;let r=o(U.MenuItem,{label:"View Stream Preview",id:"view-stream-preview",icon:yy,action:()=>n&&tP(n),disabled:!n});e.push(o(U.MenuSeparator,null),r)},Cv=(e,{stream:t})=>Rv(e,{userId:t.ownerId}),kv=(e,{user:t})=>Rv(e,{userId:t.id}),np=y({name:"BiggerStreamPreview",description:"This plugin allows you to enlarge stream previews",authors:[p.phil],start:()=>{ue("user-context",kv),ue("stream-context",Cv)},stop:()=>{fe("user-context",kv),fe("stream-context",Cv)}})});function Ev(){as.textContent=` .vc-nsfw-img [class^=imageWrapper] img, .vc-nsfw-img [class^=wrapperPaused] video { - filter: blur(${E.plugins.BlurNSFW.blurAmount}px); + filter: blur(${L.plugins.BlurNSFW.blurAmount}px); transition: filter 0.2s; } .vc-nsfw-img [class^=imageWrapper]:hover img, .vc-nsfw-img [class^=wrapperPaused]:hover video { filter: unset; } - `}var ls,rp,_v=g(()=>{"use strict";a();$();P();w();rp=y({name:"BlurNSFW",description:"Blur attachments in NSFW channels until hovered",authors:[d.Ven],patches:[{find:".embedWrapper,embed",replacement:[{match:/\.embedWrapper/g,replace:"$&+(this.props.channel.nsfw?' vc-nsfw-img':'')"}]}],options:{blurAmount:{type:1,description:"Blur Amount",default:10,onChange:Ov}},start(){ls=document.createElement("style"),ls.id="VcBlurNsfw",document.head.appendChild(ls),Ov()},stop(){ls?.remove()}})});function pP(e){let t=E.plugins.CallTimer.format==="human",n=m=>t?m:m.toString().padStart(2,"0"),r=m=>t?m:"",i=t?" ":":",s=Math.floor(e/864e5),l=Math.floor(e%864e5/36e5),c=Math.floor(e%864e5%36e5/6e4),u=Math.floor(e%864e5%36e5%6e4/1e3),p="";return s&&(p+=`${s}d `),(l||p)&&(p+=`${n(l)}${r("h")}${i}`),(c||p||!t)&&(p+=`${n(c)}${r("m")}${i}`),p+=`${n(u)}${r("s")}`,p}var ip,Bv=g(()=>{"use strict";a();$();le();P();Qe();w();ip=y({name:"CallTimer",description:"Adds a timer to vcs",authors:[d.Ven],startTime:0,interval:void 0,options:{format:{type:4,description:"The timer format. This can be any valid moment.js format",options:[{label:"30d 23:00:42",value:"stopwatch",default:!0},{label:"30d 23h 00m 42s",value:"human"}]}},patches:[{find:"renderConnectionStatus(){",replacement:{match:/(?<=renderConnectionStatus\(\)\{.+\.channel,children:)\i/,replace:"[$&, $self.renderTimer(this.props.channel.id)]"}}],renderTimer(e){return o(_,{noop:!0},o(this.Timer,{channelId:e}))},Timer({channelId:e}){let t=Di({deps:[e]});return o("p",{style:{margin:0}},"Connected for ",o("span",{style:{fontFamily:"var(--font-code)"}},pP(t)))}})});var dp={};Be(dp,{_handleClick:()=>fP,_handlePreEdit:()=>mP,_handlePreSend:()=>dP,addClickListener:()=>up,addPreEditListener:()=>br,addPreSendListener:()=>Ht,removeClickListener:()=>pp,removePreEditListener:()=>Tr,removePreSendListener:()=>zt});async function dP(e,t,n,r){n.replyOptions=r;for(let i of ap)try{let s=await i(e,t,n);if(s&&s.cancel===!0)return!0}catch(s){sp.error(`MessageSendHandler: Listener encountered an unknown error -`,s)}return!1}async function mP(e,t,n){for(let r of lp)try{await r(e,t,n)}catch(i){sp.error(`MessageEditHandler: Listener encountered an unknown error -`,i)}}function Ht(e){return ap.add(e),e}function br(e){return lp.add(e),e}function zt(e){return ap.delete(e)}function Tr(e){return lp.delete(e)}function fP(e,t,n){e=An.getMessage(t.id,e.id)??e;for(let r of cp)try{r(e,t,n)}catch(i){sp.error(`MessageClickHandler: Listener encountered an unknown error -`,i)}}function up(e){return cp.add(e),e}function pp(e){return cp.delete(e)}var sp,ap,lp,cp,Yn=g(()=>{"use strict";a();Ze();A();sp=new ie("MessageEvents","#e5c890"),ap=new Set,lp=new Set;cp=new Set});var Fv,Uv=g(()=>{"use strict";a();Fv=["action_object_map","action_type_map","action_ref_map","spm@*.aliexpress.com","scm@*.aliexpress.com","aff_platform","aff_trace_key","algo_expid@*.aliexpress.*","algo_pvid@*.aliexpress.*","btsid","ws_ab_test","pd_rd_*@amazon.*","_encoding@amazon.*","psc@amazon.*","tag@amazon.*","ref_@amazon.*","pf_rd_*@amazon.*","pf@amazon.*","crid@amazon.*","keywords@amazon.*","sprefix@amazon.*","sr@amazon.*","ie@amazon.*","node@amazon.*","qid@amazon.*","callback@bilibili.com","cvid@bing.com","form@bing.com","sk@bing.com","sp@bing.com","sc@bing.com","qs@bing.com","pq@bing.com","sc_cid","mkt_tok","trk","trkCampaign","ga_*","gclid","gclsrc","hmb_campaign","hmb_medium","hmb_source","spReportId","spJobID","spUserID","spMailingID","itm_*","s_cid","elqTrackId","elqTrack","assetType","assetId","recipientId","campaignId","siteId","mc_cid","mc_eid","pk_*","sc_campaign","sc_channel","sc_content","sc_medium","sc_outcome","sc_geo","sc_country","nr_email_referer","vero_conv","vero_id","yclid","_openstat","mbid","cmpid","cid","c_id","campaign_id","Campaign","hash@ebay.*","fb_action_ids","fb_action_types","fb_ref","fb_source","fbclid","refsrc@facebook.com","hrc@facebook.com","gs_l","gs_lcp@google.*","ved@google.*","ei@google.*","sei@google.*","gws_rd@google.*","gs_gbg@google.*","gs_mss@google.*","gs_rn@google.*","_hsenc","_hsmi","__hssc","__hstc","hsCtaTracking","source@sourceforge.net","position@sourceforge.net","t@*.twitter.com","s@*.twitter.com","ref_*@*.twitter.com","tt_medium","tt_content","lr@yandex.*","redircnt@yandex.*","feature@youtube.com","kw@youtube.com","si@youtube.com","pp@youtube.com","si@youtu.be","wt_zmc","utm_source","utm_content","utm_medium","utm_campaign","utm_term","si@open.spotify.com","igshid","share_id@reddit.com"]});var $v,gP,mp,Gv=g(()=>{"use strict";a();Yn();P();w();Uv();$v=/[\\^$.*+?()[\]{}|]/g,gP=RegExp($v.source),mp=y({name:"ClearURLs",description:"Removes tracking garbage from URLs",authors:[d.adryd],dependencies:["MessageEventsAPI"],escapeRegExp(e){return e&&gP.test(e)?e.replace($v,"\\$&"):e||""},createRules(){let e=Fv;this.universalRules=new Set,this.rulesByHost=new Map,this.hostRules=new Map;for(let t of e){let n=t.split("@"),r=new RegExp("^"+this.escapeRegExp(n[0]).replace(/\\\*/,".+?")+"$");if(!n[1]){this.universalRules.add(r);continue}let i=new RegExp("^(www\\.)?"+this.escapeRegExp(n[1]).replace(/\\\./,"\\.").replace(/^\\\*\\\./,"(.+?\\.)?").replace(/\\\*/,".+?")+"$"),s=i.toString();this.hostRules.set(s,i),this.rulesByHost.get(s)==null&&this.rulesByHost.set(s,new Set),this.rulesByHost.get(s).add(r)}},removeParam(e,t,n){(t===e||e instanceof RegExp&&e.test(t))&&n.delete(t)},replacer(e){try{var t=new URL(e)}catch{return e}return t.searchParams.entries().next().done?e:(this.universalRules.forEach(n=>{t.searchParams.forEach((r,i,s)=>{this.removeParam(n,i,s)})}),this.hostRules.forEach((n,r)=>{!n.test(t.hostname)||this.rulesByHost.get(r).forEach(i=>{t.searchParams.forEach((s,l,c)=>{this.removeParam(i,l,c)})})}),t.toString())},onSend(e){e.content.match(/http(s)?:\/\//)&&(e.content=e.content.replace(/(https?:\/\/[^\s<]+[^<.,:;"'>)|\]\s])/g,t=>this.replacer(t)))},start(){this.createRules(),this.preSend=Ht((e,t)=>this.onSend(t)),this.preEdit=br((e,t,n)=>this.onSend(n))},stop(){zt(this.preSend),Tr(this.preEdit)}})});var Hv=g(()=>{});function jv(e){let t=e.toString(16).padStart(6,"0");cs.store.color=t,Wv(t)}function vP(){let e=TP(cs.store.color)>45,t=Uo()===2;return o("div",{className:"client-theme-settings"},o("div",{className:"client-theme-container"},o("div",{className:"client-theme-settings-labels"},o(S.FormTitle,{tag:"h3"},"Theme Color"),o(S.FormText,null,"Add a color to your Discord client theme")),o(hP,{color:parseInt(cs.store.color,16),onChange:jv,showEyeDropper:!1,suggestedColors:yP})),e||t?o("div",null,o(S.FormDivider,{className:oe(q.top8,q.bottom8)}),o(S.FormText,{className:"client-theme-warning"},"Your theme won't look good:"),e&&o(S.FormText,{className:"client-theme-warning"},"Selected color is very light"),t&&o(S.FormText,{className:"client-theme-warning"},"Light mode isn't supported")):null)}async function SP(){let e=document.querySelectorAll('link[rel="stylesheet"]'),t={};for(let i of e){let s=i.getAttribute("href");if(!s)continue;let c=await(await fetch(s)).text(),u=zv.exec(c);for(;u!==null;){let[,p,m]=u;t[p]=parseFloat(m),u=zv.exec(c)}}let n=Object.entries(t).map(([i,s])=>{let l=s-t["--primary-600-hsl"],c=l>=0?"+":"-";return`${i}: var(--theme-h) var(--theme-s) calc(var(--theme-l) ${c} ${Math.abs(l).toFixed(2)}%);`}).join(` -`),r=document.createElement("style");r.setAttribute("id","clientThemeOffsets"),r.textContent=`:root:root { - ${n} - }`,document.head.appendChild(r)}function Wv(e){let{hue:t,saturation:n,lightness:r}=bP(e),i=document.getElementById("clientThemeVars");i||(i=document.createElement("style"),i.setAttribute("id","clientThemeVars"),document.head.appendChild(i)),i.textContent=`:root { - --theme-h: ${t}; - --theme-s: ${n}%; - --theme-l: ${r}%; - }`}function bP(e){let t=parseInt(e.substring(0,2),16)/255,n=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,i=Math.max(t,n,r),s=Math.min(t,n,r),l=i-s,c,u,p;return p=(i+s)/2,l===0?(c=0,u=0):(u=l/(1-Math.abs(2*p-1)),i===t?c=(n-r)/l%6:i===n?c=(r-t)/l+2:c=(t-n)/l+4,c*=60,c<0&&(c+=360)),u*=100,p*=100,{hue:c,saturation:u,lightness:p}}function TP(e){let t=parseInt(e.substring(0,2),16)/255,n=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,i=Math.max(t,n,r),s=Math.min(t,n,r);return 100*((i+s)/2)}var hP,yP,cs,fp,zv,qv=g(()=>{"use strict";a();Hv();$();P();bt();at();Re();w();j();A();hP=Xe(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR"),yP=["#1E1514","#172019","#13171B","#1C1C28","#402D2D","#3A483D","#344242","#313D4B","#2D2F47","#322B42","#3C2E42","#422938"];cs=D({color:{description:"Color your Discord client theme will be based around. Light mode isn't supported",type:6,default:"313338",component:()=>o(vP,null)},resetColor:{description:"Reset Theme Color",type:6,default:"313338",component:()=>o(R,{onClick:()=>jv(3224376)},"Reset Theme Color")}}),fp=y({name:"ClientTheme",authors:[d.F53,d.Nuckyz],description:"Recreation of the old client theme experiment. Add a color to your Discord client theme",settings:cs,startAt:"DOMContentLoaded",start(){Wv(cs.store.color),SP()},stop(){document.getElementById("clientThemeVars")?.remove(),document.getElementById("clientThemeOffsets")?.remove()}}),zv=/(--primary-[5-9]\d{2}-hsl):.*?(\S*)%;/g});var gp,Kv=g(()=>{"use strict";a();P();w();gp=y({name:"ColorSighted",description:"Removes the colorblind-friendly icons from statuses, just like 2015-2017 Discord",authors:[d.lewisakura],patches:[{find:"Masks.STATUS_ONLINE",replacement:{match:/Masks\.STATUS_(?:IDLE|DND|STREAMING|OFFLINE)/g,replace:"Masks.STATUS_ONLINE"}},{find:".AVATAR_STATUS_MOBILE_16;",replacement:{match:/(?<=fromIsMobile:\i=!0,.+?)status:(\i)/,replace:'status_$:$1="online"'}}]})});function xr(e){if(typeof e=="string")return e;let t=e.source.replaceAll("\\i","[A-Za-z_$][\\w$]*");return new RegExp(t,e.flags)}function Ba(e,t){let n=`Vencord.Plugins.plugins[${JSON.stringify(t)}]`;return typeof e!="function"?e.replaceAll("$self",n):(...r)=>e(...r).replaceAll("$self",n)}function hp(e,t){if(e.get){let n=e.get;e.get=function(){return t(n.call(this))}}else e.value&&(e.value=t(e.value));return e}function us(e,t){let n=Object.getOwnPropertyDescriptors(e);n.match=hp(n.match,xr),n.replace=hp(n.replace,r=>Ba(r,t)),Object.defineProperties(e,n)}var ps=g(()=>{"use strict";a()});var yp,Yv=g(()=>{"use strict";a();P();Ro();ps();w();j();j();A();yp=y({name:"ConsoleShortcuts",description:"Adds shorter Aliases for many things on the window. Run `shortcutList` for a list.",authors:[d.Ven],getShortcuts(){function e(r){let i=new Map;return function(...s){let l=String(s);if(i.has(l))return i.get(l);let c=rr(r(...s)),u=(()=>{switch(c.length){case 0:return null;case 1:return c[0];default:let p=[...new Set(c)];return p.length>1&&console.warn(`Warning: This filter matches ${c.length} modules. Make it more specific! -`,p),c[0]}})();return u&&l&&i.set(l,u),u}}let t,n=e(r=>r);return{...Vencord.Webpack.Common,wp:Vencord.Webpack,wpc:Mn.c,wreq:Mn,wpsearch:lc,wpex:Zs,wpexs:r=>Zs(ic(r)),find:n,findAll:rr,findByProps:e(Ke.byProps),findAllByProps:(...r)=>rr(Ke.byProps(...r)),findByCode:e(Ke.byCode),findAllByCode:r=>rr(Ke.byCode(r)),findComponentByCode:e(Ke.componentByCode),findAllComponentsByCode:(...r)=>rr(Ke.componentByCode(...r)),findExportedComponent:(...r)=>n(...r)[r[0]],findStore:e(Ke.byStoreName),PluginsApi:Vencord.Plugins,plugins:Vencord.Plugins.plugins,Settings:Vencord.Settings,Api:Vencord.Api,reload:()=>location.reload(),restart:ln,canonicalizeMatch:xr,canonicalizeReplace:Ba,canonicalizeReplacement:us,fakeRender:(r,i)=>{let s=t?.deref(),l=s?.closed===!1?s:window.open("about:blank","Fake Render","popup,width=500,height=500");t=new WeakRef(l),l.focus();let c=l.document;c.body.style.margin="1em",l.prepared||(l.prepared=!0,[...document.querySelectorAll("style"),...document.querySelectorAll("link[rel=stylesheet]")].forEach(u=>{let p=u.cloneNode(!0);u.parentElement?.tagName==="HEAD"?c.head.append(p):p.id?.startsWith("vencord-")||p.id?.startsWith("vcd-")?c.documentElement.append(p):c.body.append(p)})),sr.render(O.createElement(r,i),c.body.appendChild(document.createElement("div")))}}},start(){let e=this.getShortcuts();window.shortcutList=e;for(let[t,n]of Object.entries(e))window[t]=n},stop(){delete window.shortcutList;for(let e in this.getShortcuts())delete window[e]}})});var Zv,vp,Xv=g(()=>{"use strict";a();Pt();$t();P();w();A();Zv=(e,{user:t})=>()=>{e.push(o(G.MenuItem,{id:"vc-copy-user-url",label:"Copy User URL",action:()=>Zt.copy(``),icon:Jr}))},vp=y({name:"CopyUserURLs",authors:[d.castdrian],description:"Adds a 'Copy User URL' option to the user context menu.",start(){ce("user-context",Zv)},stop(){de("user-context",Zv)}})});var $o,xP,Sp,bp,Fa,Tp,xp,Jv=g(()=>{"use strict";a();Ao();$();P();Ze();dt();w();yr();j();A();$o=new ie("CrashHandler"),xP=I("pushLazy","popAll"),Sp=D({attemptToPreventCrashes:{type:3,description:"Whether to attempt to prevent Discord crashes.",default:!0},attemptToNavigateToHome:{type:3,description:"Whether to attempt to navigate to the home when preventing Discord crashes.",default:!1}}),bp=0,Fa=0,Tp=!1,xp=y({name:"CrashHandler",description:"Utility plugin for handling and possibly recovering from Crashes without a restart",authors:[d.Nuckyz],enabledByDefault:!0,settings:Sp,patches:[{find:".Messages.ERRORS_UNEXPECTED_CRASH",replacement:{match:/(?=this\.setState\()/,replace:"$self.handleCrash(this)||"}}],handleCrash(e){if(Date.now()-Fa<=1e3&&!Tp)return!0;if(Tp=!1,++bp>5){try{Ie({color:"#eed202",title:"Discord has crashed!",body:"Awn :( Discord has crashed more than five times, not attempting to recover.",noPersist:!0})}catch{}return Fa=Date.now(),!1}setTimeout(()=>bp--,6e4);try{return bp===1&&Ki("Uh oh, Discord has just crashed... but good news, there is a Vencord update available that might fix this issue! Would you like to update now?",!0),Sp.store.attemptToPreventCrashes?(this.handlePreventCrash(e),!0):!1}catch(t){return $o.error("Failed to handle crash",t),!1}finally{Fa=Date.now()}},handlePreventCrash(e){if(Date.now()-Fa>=1e3)try{Ie({color:"#eed202",title:"Discord has crashed!",body:"Attempting to recover...",noPersist:!0})}catch{}try{F.dispatch({type:"CONTEXT_MENU_CLOSE"})}catch(t){$o.debug("Failed to close open context menu.",t)}try{xP?.popAll()}catch(t){$o.debug("Failed to close old modals.",t)}try{wc()}catch(t){$o.debug("Failed to close all open modals.",t)}try{F.dispatch({type:"USER_PROFILE_MODAL_CLOSE"})}catch(t){$o.debug("Failed to close user popout.",t)}try{F.dispatch({type:"LAYER_POP_ALL"})}catch(t){$o.debug("Failed to pop all layers.",t)}if(Sp.store.attemptToNavigateToHome)try{pr.transitionTo("/channels/@me")}catch(t){$o.debug("Failed to navigate to home",t)}try{Tp=!0,e.forceUpdate()}catch(t){$o.debug("Failed to update crash handler component.",t)}}})});function Ua(e){return Boolean(e)}function wp(e){return e!=null}var $a=g(()=>{"use strict";a()});async function Qv(e){return/https?:\/\/(cdn|media)\.discordapp\.(com|net)\/attachments\//.test(e)?"mp:"+e.replace(/https?:\/\/(cdn|media)\.discordapp\.(com|net)\//,""):(await ur.fetchAssetIds(wr.store.appID,[e]))[0]}function Ct(){Ga(!0),E.plugins.CustomRPC.enabled&&Ga()}function t1(){return wr.store.type!==1}function IP(e){return!t1()&&!/https?:\/\/(www\.)?(twitch\.tv|youtube\.com)\/\w+/.test(e)?"Streaming link must be a valid URL.":!0}function Vv(){return wr.store.timestampMode!==3}function e1(e){return/https?:\/\/(?!i\.)?imgur\.com\//.test(e)?"Imgur link must be a direct link to the image. (e.g. https://i.imgur.com/...)":/https?:\/\/(?!media\.)?tenor\.com\//.test(e)?"Tenor link must be a direct link to the image. (e.g. https://media.tenor.com/...)":!0}async function n1(){let{appID:e,appName:t,details:n,state:r,type:i,streamLink:s,startTime:l,endTime:c,imageBig:u,imageBigTooltip:p,imageSmall:m,imageSmallTooltip:h,buttonOneText:v,buttonOneURL:T,buttonTwoText:M,buttonTwoURL:b}=wr.store;if(!t)return;let x={application_id:e||"0",name:t,state:r,details:n,type:i,flags:1<<0};switch(i===1&&(x.url=s),wr.store.timestampMode){case 1:x.timestamps={start:Math.floor(Date.now()/1e3)};break;case 2:x.timestamps={start:Math.floor(Date.now()/1e3)-new Date().getHours()*3600-new Date().getMinutes()*60-new Date().getSeconds()};break;case 3:(l||c)&&(x.timestamps={},l&&(x.timestamps.start=l),c&&(x.timestamps.end=c));break;case 0:default:break}v&&(x.buttons=[v,M].filter(Ua),x.metadata={button_urls:[T,b].filter(Ua)}),u&&(x.assets={large_image:await Qv(u),large_text:p||void 0}),m&&(x.assets={...x.assets,small_image:await Qv(m),small_text:h||void 0});for(let N in x){if(N==="type")continue;let k=x[N];(!k||k.length===0)&&delete x[N]}return x}async function Ga(e){let t=await n1();F.dispatch({type:"LOCAL_ACTIVITY_UPDATE",activity:e?null:t,socketId:"CustomRPC"})}var wP,MP,PP,wr,Mp,o1=g(()=>{"use strict";a();$();lo();P();$a();Qe();w();j();A();wP=Xe("onOpenGameProfile"),MP=I("activity","buttonColor"),PP=I("profileColors");wr=D({appID:{type:0,description:"Application ID (required)",onChange:Ct,isValid:e=>e?e&&!/^\d+$/.test(e)?"Application ID must be a number.":!0:"Application ID is required."},appName:{type:0,description:"Application name (required)",onChange:Ct,isValid:e=>e?e.length>128?"Application name must be not longer than 128 characters.":!0:"Application name is required."},details:{type:0,description:"Details (line 1)",onChange:Ct,isValid:e=>e&&e.length>128?"Details (line 1) must be not longer than 128 characters.":!0},state:{type:0,description:"State (line 2)",onChange:Ct,isValid:e=>e&&e.length>128?"State (line 2) must be not longer than 128 characters.":!0},type:{type:4,description:"Activity type",onChange:Ct,options:[{label:"Playing",value:0,default:!0},{label:"Streaming",value:1},{label:"Listening",value:2},{label:"Watching",value:3},{label:"Competing",value:5}]},streamLink:{type:0,description:"Twitch.tv or Youtube.com link (only for Streaming activity type)",onChange:Ct,disabled:t1,isValid:IP},timestampMode:{type:4,description:"Timestamp mode",onChange:Ct,options:[{label:"None",value:0,default:!0},{label:"Since discord open",value:1},{label:"Same as your current time",value:2},{label:"Custom",value:3}]},startTime:{type:1,description:"Start timestamp (only for custom timestamp mode)",onChange:Ct,disabled:Vv,isValid:e=>e&&e<0?"Start timestamp must be greater than 0.":!0},endTime:{type:1,description:"End timestamp (only for custom timestamp mode)",onChange:Ct,disabled:Vv,isValid:e=>e&&e<0?"End timestamp must be greater than 0.":!0},imageBig:{type:0,description:"Big image key/link",onChange:Ct,isValid:e1},imageBigTooltip:{type:0,description:"Big image tooltip",onChange:Ct,isValid:e=>e&&e.length>128?"Big image tooltip must be not longer than 128 characters.":!0},imageSmall:{type:0,description:"Small image key/link",onChange:Ct,isValid:e1},imageSmallTooltip:{type:0,description:"Small image tooltip",onChange:Ct,isValid:e=>e&&e.length>128?"Small image tooltip must be not longer than 128 characters.":!0},buttonOneText:{type:0,description:"Button 1 text",onChange:Ct,isValid:e=>e&&e.length>31?"Button 1 text must be not longer than 31 characters.":!0},buttonOneURL:{type:0,description:"Button 1 URL",onChange:Ct},buttonTwoText:{type:0,description:"Button 2 text",onChange:Ct,isValid:e=>e&&e.length>31?"Button 2 text must be not longer than 31 characters.":!0},buttonTwoURL:{type:0,description:"Button 2 URL",onChange:Ct}});Mp=y({name:"CustomRPC",description:"Allows you to set a custom rich presence.",authors:[d.captain,d.AutumnVN],start:Ga,stop:()=>Ga(!0),settings:wr,settingsAboutComponent:()=>{let e=rt(n1);return o(f,null,o(S.FormText,null,"Go to ",o(st,{href:"https://discord.com/developers/applications"},"Discord Developer Portal")," to create an application and get the application ID."),o(S.FormText,null,"Upload images in the Rich Presence tab to get the image keys."),o(S.FormText,null,"If you want to use image link, download your image and reupload the image to ",o(st,{href:"https://imgur.com"},"Imgur"),' and get the image link by right-clicking the image and select "Copy image address".'),o(S.FormDivider,null),o("div",{style:{width:"284px"},className:PP.profileColors},e[0]&&o(wP,{activity:e[0],className:MP.activity,channelId:Pe.getChannelId(),guild:Te.getGuild(on.getLastSelectedGuildId()),application:{id:wr.store.appID},user:W.getCurrentUser()})))}})});var r1=g(()=>{});async function NP(){try{let{embed:e}=this.props;if(!e||e.dearrow||e.provider?.name!=="YouTube"||!e.video?.url)return;let t=AP.exec(e.video.url)?.[1];if(!t)return;let n=await fetch(`https://sponsor.ajay.app/api/branding?videoID=${t}`);if(!n.ok)return;let{titles:r,thumbnails:i}=await n.json(),s=r[0]?.votes>=0,l=i[0]?.votes>=0&&!i[0].original;if(!s&&!l)return;e.dearrow={enabled:!0},s&&(e.dearrow.oldTitle=e.rawTitle,e.rawTitle=r[0].title),l&&(e.dearrow.oldThumb=e.thumbnail.proxyURL,e.thumbnail.proxyURL=`https://dearrow-thumb.ajay.app/api/v1/getThumbnail?videoID=${t}&time=${i[0].timestamp}`),this.forceUpdate()}catch(e){new ie("Dearrow").error("Failed to dearrow embed",e)}}function CP({component:e}){let{embed:t}=e.props;return t?.dearrow?o(V,{text:t.dearrow.enabled?"This embed has been dearrowed, click to restore":"Click to dearrow"},({onMouseEnter:n,onMouseLeave:r})=>o("button",{onMouseEnter:n,onMouseLeave:r,className:"vc-dearrow-toggle-"+(t.dearrow.enabled?"on":"off"),onClick:()=>{let{enabled:i,oldThumb:s,oldTitle:l}=t.dearrow;t.dearrow.enabled=!i,l&&(t.dearrow.oldTitle=t.rawTitle,t.rawTitle=l),s&&(t.dearrow.oldThumb=t.thumbnail.proxyURL,t.thumbnail.proxyURL=s),e.forceUpdate()}},o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24px",height:"24px",viewBox:"0 0 36 36","aria-label":"Toggle Dearrow"},o("path",{fill:"#1213BD",d:"M36 18.302c0 4.981-2.46 9.198-5.655 12.462s-7.323 5.152-12.199 5.152s-9.764-1.112-12.959-4.376S0 23.283 0 18.302s2.574-9.38 5.769-12.644S13.271 0 18.146 0s9.394 2.178 12.589 5.442C33.931 8.706 36 13.322 36 18.302z"}),o("path",{fill:"#88c9f9",d:"m 30.394282,18.410186 c 0,3.468849 -1.143025,6.865475 -3.416513,9.137917 -2.273489,2.272442 -5.670115,2.92874 -9.137918,2.92874 -3.467803,0 -6.373515,-1.147212 -8.6470033,-3.419654 -2.2734888,-2.272442 -3.5871299,-5.178154 -3.5871299,-8.647003 0,-3.46885 0.9420533,-6.746149 3.2144954,-9.0196379 2.2724418,-2.2734888 5.5507878,-3.9513905 9.0196378,-3.9513905 3.46885,0 6.492841,1.9322561 8.76633,4.204698 2.273489,2.2724424 3.788101,5.2974804 3.788101,8.7663304 z"}),o("path",{fill:"#0a62a5",d:"m 23.95823,17.818306 c 0,3.153748 -2.644888,5.808102 -5.798635,5.808102 -3.153748,0 -5.599825,-2.654354 -5.599825,-5.808102 0,-3.153747 2.446077,-5.721714 5.599825,-5.721714 3.153747,0 5.798635,2.567967 5.798635,5.721714 z"})))):null}var AP,Pp,i1=g(()=>{"use strict";a();r1();le();P();Ze();w();A();AP=/https:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9_-]{11})/;Pp=y({name:"Dearrow",description:"Makes YouTube embed titles and thumbnails less sensationalist, powered by Dearrow",authors:[d.Ven],embedDidMount:NP,renderButton(e){return o(_,{noop:!0},o(CP,{component:e}))},patches:[{find:"this.renderInlineMediaEmbed",replacement:[{match:/render\(\)\{let\{embed:/,replace:"componentDidMount=$self.embedDidMount;$&"},{match:/children:\[(?=null!=\i\?\i\.renderSuppressButton)/,replace:"children:[$self.renderButton(this),"}]}]})});var Ip,s1=g(()=>{"use strict";a();P();w();Ip=y({name:"DisableDMCallIdle",description:"Disables automatically getting kicked from a DM voice call after 3 minutes.",authors:[d.Nuckyz],patches:[{find:".Messages.BOT_CALL_IDLE_DISCONNECT",replacement:{match:/(?<=function \i\(\){)(?=.{1,120}\.Messages\.BOT_CALL_IDLE_DISCONNECT)/,replace:"return;"}}]})});function Ap(e){return e.t==="Emoji"?`${location.protocol}//${window.GLOBAL_ENV.CDN_HOST}/emojis/${e.id}.${e.isAnimated?"gif":"png"}`:`${location.origin}/stickers/${e.id}.${LP[e.format_type]}`}async function c1(e){let t=kP.getStickerById(e);if(t)return t;let{body:n}=await Mt.get({url:`/stickers/${e}`});return F.dispatch({type:"STICKER_FETCH_SUCCESS",sticker:n}),n}async function EP(e,t){let n=new FormData;n.append("name",t.name),n.append("tags",t.tags),n.append("description",t.description),n.append("file",await u1(Ap(t)));let{body:r}=await Mt.post({url:`/guilds/${e}/stickers`,body:n});F.dispatch({type:"GUILD_STICKERS_CREATE_SUCCESS",guildId:e,sticker:{...r,user:W.getCurrentUser()}})}async function DP(e,t){let n=await u1(Ap(t)),r=await new Promise(i=>{let s=new FileReader;s.onload=()=>i(s.result),s.readAsDataURL(n)});return RP.uploadEmoji({guildId:e,name:t.name.split("~")[0],image:r})}function OP(e){let t=W.getCurrentUser().id;return Object.values(Te.getGuilds()).filter(n=>{if(!(n.ownerId===t||(Ce.getGuildPermissions({id:n.id})&Se.CREATE_GUILD_EXPRESSIONS)===Se.CREATE_GUILD_EXPRESSIONS))return!1;if(e.t==="Sticker")return!0;let{isAnimated:i}=e,s=n.getMaxEmojiSlots(),{emojis:l}=Nn.getGuilds()[n.id],c=0;for(let u of l)u.animated===i&&c++;return cn.name.localeCompare(r.name))}async function u1(e){let t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch ${e} - ${t.status}`);return t.blob()}async function _P(e,t){try{t.t==="Sticker"?await EP(e,t):await DP(e,t),ee.show({message:`Successfully cloned ${t.name} to ${Te.getGuild(e)?.name??"your server"}!`,type:ee.Type.SUCCESS,id:ee.genId()})}catch(n){let r="Something went wrong (check console!)";try{r=JSON.parse(n.text).message}catch{}new ie("EmoteCloner").error("Failed to clone",t.name,"to",e,n),ee.show({message:"Failed to clone: "+r,type:ee.Type.FAILURE,id:ee.genId()})}}function UP({data:e}){let[t,n]=O.useState(!1),[r,i]=O.useState(e.name),[s,l]=O.useReducer(u=>u+1,0),c=O.useMemo(()=>OP(e),[e.id,s]);return o(f,null,o(S.FormTitle,{className:q.top20},"Custom Name"),o(_a,{value:r,onChange:u=>{e.name=u,i(u)},validate:u=>e.t==="Emoji"&&u.length>2&&u.length<32&&FP.test(u)||e.t==="Sticker"&&u.length>2&&u.length<30||"Name must be between 2 and 32 characters and only contain alphanumeric characters"}),o("div",{style:{display:"flex",flexWrap:"wrap",gap:"1em",padding:"1em 0.5em",justifyContent:"center",alignItems:"center"}},c.map(u=>o(V,{text:u.name},({onMouseLeave:p,onMouseEnter:m})=>o("div",{onMouseLeave:p,onMouseEnter:m,role:"button","aria-label":"Clone to "+u.name,"aria-disabled":t,style:{borderRadius:"50%",backgroundColor:"var(--background-secondary)",display:"inline-flex",justifyContent:"center",alignItems:"center",width:"4em",height:"4em",cursor:t?"not-allowed":"pointer",filter:t?"brightness(50%)":"none"},onClick:t?void 0:async()=>{n(!0),_P(u.id,e).finally(()=>{l(),n(!1)})}},u.icon?o("img",{"aria-hidden":!0,style:{borderRadius:"50%",width:"100%",height:"100%"},src:u.getIconURL(512,!0),alt:u.name}):o(S.FormText,{style:{fontSize:BP(u.acronym),width:"100%",overflow:"hidden",whiteSpace:"nowrap",textAlign:"center",cursor:t?"not-allowed":"pointer"}},u.acronym))))))}function Ha(e,t){return o(G.MenuItem,{id:"emote-cloner",key:"emote-cloner",label:`Clone ${e}`,action:()=>_i(async()=>{let n=await t(),r={t:e,...n},i=Ap(r);return s=>o(ze,{...s},o(lt,null,o("img",{role:"presentation","aria-hidden":!0,src:i,alt:"",height:24,width:24,style:{marginRight:"0.5em"}}),o(S.FormText,null,"Clone ",r.name)),o(et,null,o(UP,{data:r})))})})}function p1(e){return new URL(e).pathname.endsWith(".gif")}var kP,RP,LP,BP,FP,a1,l1,Np,d1=g(()=>{"use strict";a();Pt();Gu();P();Ze();at();dt();w();j();A();kP=Me("StickersStore"),RP=I("fetchEmoji","uploadEmoji","deleteEmoji"),LP=[,"png","png","json","gif"];BP=e=>[20,20,18,18,16,14,12][e.length]??4,FP=/^\w+$/i;a1=(e,t)=>()=>{let{favoriteableId:n,itemHref:r,itemSrc:i,favoriteableType:s}=t??{};if(!n)return;let l=(()=>{switch(s){case"emoji":let c=t.message.content.match(RegExp(`|https://cdn\\.discordapp\\.com/emojis/${n}\\.`));if(!c)return;let u=c[1]??"FakeNitroEmoji";return Ha("Emoji",()=>({id:n,name:u,isAnimated:p1(r??i)}));case"sticker":return t.message.stickerItems.find(m=>m.id===n)?.format_type===3?void 0:Ha("Sticker",()=>c1(n))}})();l&&mt("copy-link",e)?.push(l)},l1=(e,t)=>()=>{let{id:n,name:r,type:i}=t?.target?.dataset??{};if(!!n)if(i==="emoji"&&r){let s=t.target.firstChild;e.push(Ha("Emoji",()=>({id:n,name:r,isAnimated:s&&p1(s.src)})))}else i==="sticker"&&!t.target.className?.includes("lottieCanvas")&&e.push(Ha("Sticker",()=>c1(n)))},Np=y({name:"EmoteCloner",description:"Allows you to clone Emotes & Stickers to your own server (right click them)",tags:["StickerCloner"],authors:[d.Ven,d.Nuckyz],start(){ce("message",a1),ce("expression-picker",l1)},stop(){de("message",a1),de("expression-picker",l1)}})});var Cp,m1,kp,f1=g(()=>{"use strict";a();$();le();Hr();P();at();w();j();A();Cp=I("key","removeBuildOverride"),m1=D({enableIsStaff:{description:"Enable isStaff",type:3,default:!1,restartNeeded:!0}}),kp=y({name:"Experiments",description:"Enable Access to Experiments in Discord!",authors:[d.Megu,d.Ven,d.Nickyux,d.BanTheNons,d.Nuckyz],settings:m1,patches:[{find:"Object.defineProperties(this,{isDeveloper",replacement:{match:/(?<={isDeveloper:\{[^}]+?,get:\(\)=>)\i/,replace:"true"}},{find:'type:"user",revision',replacement:{match:/!(\i)&&"CONNECTION_OPEN".+?;/g,replace:"$1=!0;"}},{find:".isStaff=()",predicate:()=>m1.store.enableIsStaff,replacement:[{match:/=>*?(\i)\.hasFlag\((\i\.\i)\.STAFF\)}/,replace:(e,t,n)=>`=>Vencord.Webpack.Common.UserStore.getCurrentUser()?.id===${t}.id||${t}.hasFlag(${n}.STAFF)}`},{match:/hasFreePremium\(\){return this.isStaff\(\)\s*?\|\|/,replace:"hasFreePremium(){return "}]},{find:'H1,title:"Experiments"',replacement:{match:'title:"Experiments",children:[',replace:"$&$self.WarningCard(),"}}],settingsAboutComponent:()=>{let e=navigator.platform.includes("Mac"),t=e?"cmd":"ctrl",n=e?"opt":"alt";return o(O.Fragment,null,o(S.FormTitle,{tag:"h3"},"More Information"),o(S.FormText,{variant:"text-md/normal"},"You can enable client DevTools"," ",o("kbd",{className:Cp.key},t)," +"," ",o("kbd",{className:Cp.key},n)," +"," ",o("kbd",{className:Cp.key},"O")," ","after enabling ",o("code",null,"isStaff")," below"),o(S.FormText,null,"and then toggling ",o("code",null,"Enable DevTools")," in the ",o("code",null,"Developer Options")," tab in settings."))},WarningCard:_.wrap(()=>o(hn,{id:"vc-experiments-warning-card",className:q.bottom16},o(S.FormTitle,{tag:"h2"},"Hold on!!"),o(S.FormText,null,"Experiments are unreleased Discord features. They might not work, or even break your client or get your account disabled."),o(S.FormText,{className:q.top8},"Only use experiments if you know what you're doing. Vencord is not responsible for any damage caused by enabling experiments.")),{noop:!0})})});var Rp,g1=g(()=>{"use strict";a();P();w();Rp=y({name:"F8Break",description:"Pause the client when you press F8 with DevTools (+ breakpoints) open.",authors:[d.lewisakura],start(){window.addEventListener("keydown",this.event)},stop(){window.removeEventListener("keydown",this.event)},event(e){if(e.code==="F8")debugger}})});var h1=g(()=>{"use strict";a()});var v1=or((D8,y1)=>{"use strict";a();var co=y1.exports;(function e(t,n,r){function i(c,u){if(!n[c]){if(!t[c]){var p=typeof Rr=="function"&&Rr;if(!u&&p)return p(c,!0);if(s)return s(c,!0);throw new Error("Cannot find module '"+c+"'")}var m=n[c]={exports:{}};t[c][0].call(m.exports,function(h){var v=t[c][1][h];return i(v||h)},m,m.exports,e,t,n,r)}return n[c].exports}for(var s=typeof Rr=="function"&&Rr,l=0;l"u"&&r!==void 0&&{}.toString.call(r)==="[object process]",N=typeof Uint8ClampedArray<"u"&&typeof importScripts<"u"&&typeof MessageChannel<"u";function k(){var C=setTimeout;return function(){return C(U,1)}}var B=new Array(1e3);function U(){for(var C=0;Ci+r.playTime;)i+=r.playTime;i+=M.delay}else u=!(c=!1)}}},{}],4:[function(e,t,n){"use strict";for(var r=new Uint32Array(256),i=0;i<256;i++){for(var s=i,l=0;l<8;l++)s=1&s?3988292384^s>>>1:s>>>1;r[i]=s}t.exports=function(c,u,p){for(var m=-1,h=u=u||0,v=u+(p=p||c.length-u);h>>8^r[255&(m^c[h])];return-1^m}},{}],5:[function(e,t,n){(function(r){"use strict";var i=e("./support-test"),s=e("./parser"),l=e("./loader"),c=r.APNG={};c.checkNativeFeatures=i.checkNativeFeatures,c.ifNeeded=i.ifNeeded,c.parseBuffer=function(p){return s(p)};var u={};c.parseURL=function(p){return p in u||(u[p]=l(p).then(s)),u[p]},c.animateContext=function(p,m){return c.parseURL(p).then(function(h){return h.addContext(m),h.play(),h})},c.animateImage=function(p){return p.setAttribute("data-is-apng","progress"),c.parseURL(p.src).then(function(m){p.setAttribute("data-is-apng","yes");var h=document.createElement("canvas");h.width=m.width,h.height=m.height,Array.prototype.slice.call(p.attributes).forEach(function(N){["alt","src","usemap","ismap","data-is-apng","width","height"].indexOf(N.nodeName)==-1&&h.setAttributeNode(N.cloneNode(!1))}),h.setAttribute("data-apng-src",p.src),p.alt!=""&&h.appendChild(document.createTextNode(p.alt));var v="",T="",M=0,b="";p.style.width!=""&&p.style.width!="auto"?v=p.style.width:p.hasAttribute("width")&&(v=p.getAttribute("width")+"px"),p.style.height!=""&&p.style.height!="auto"?T=p.style.height:p.hasAttribute("height")&&(T=p.getAttribute("height")+"px"),v!=""&&T==""&&(M=parseFloat(v),b=v.match(/\D+$/)[0],T=Math.round(h.height*M/h.width)+b),T!=""&&v==""&&(M=parseFloat(T),b=T.match(/\D+$/)[0],v=Math.round(h.width*M/h.height)+b),h.style.width=v,h.style.height=T;var x=p.parentNode;x.insertBefore(h,p),x.removeChild(p),m.addContext(h.getContext("2d")),m.play()},function(){p.setAttribute("data-is-apng","no")})},c.releaseCanvas=function(p){var m=p.getContext("2d");"_apng_animation"in m&&m._apng_animation.removeContext(m)}}).call(this,typeof co<"u"?co:typeof window<"u"?window:{})},{"./loader":6,"./parser":7,"./support-test":8}],6:[function(e,t,n){"use strict";var r=r||e("es6-promise").Promise;t.exports=function(i){return new r(function(s,l){var c=new XMLHttpRequest;c.open("GET",i),c.responseType="arraybuffer",c.onload=function(){this.status==200?s(this.response):l(this)},c.send()})}},{"es6-promise":1}],7:[function(e,t,n){"use strict";var r=r||e("es6-promise").Promise,i=e("./animation"),s=e("./crc32"),l=new Uint8Array([137,80,78,71,13,10,26,10]);t.exports=function(b){var x=new Uint8Array(b);return new r(function(N,k){for(var B=0;B>>0;for(var k=1;k<4;k++)N+=b[k+x]<<8*(3-k);return N},p=function(b,x){for(var N=0,k=0;k<2;k++)N+=b[k+x]<<8*(1-k);return N},m=function(b,x){return b[x]},h=function(b,x,N){var k=new Uint8Array(N);return k.set(b.subarray(x,x+N)),k},v=function(b,x,N){var k=Array.prototype.slice.call(b.subarray(x,x+N));return String.fromCharCode.apply(String,k)},T=function(b){return[b>>>24&255,b>>>16&255,b>>>8&255,255&b]},M=function(b,x){var N=b.length+x.length,k=new Uint8Array(new ArrayBuffer(N+8));k.set(T(x.length),0),k.set(function(U){for(var Y=[],K=0;K{"use strict";a();wn();h1();S1=xo(()=>v1().APNG),$P="https://unpkg.com/@sapphi-red/web-noise-suppressor@0.3.3/dist",$8=`${$P}/rnnoise/workletProcessor.js`,b1="https://unpkg.com/@vap/shiki-worker@0.0.8/dist/index.min.js",T1="https://unpkg.com/@vap/shiki@0.10.3/dist/onig.wasm",x1=xo(()=>import("https://unpkg.com/stegcloak-dist@1.0.0/index.js"))});var _p=or(Op=>{a();var I1=Object.defineProperty,GP=e=>I1(e,"__esModule",{value:!0}),HP=(e,t)=>{for(var n in t)I1(e,n,{get:t[n],enumerable:!0})};GP(Op);HP(Op,{GIFEncoder:()=>E1,applyPalette:()=>JP,default:()=>aI,nearestColor:()=>tI,nearestColorIndex:()=>R1,nearestColorIndexWithDistance:()=>L1,prequantize:()=>XP,quantize:()=>YP,snapColorsToPalette:()=>eI});var zP={signature:"GIF",version:"89a",trailer:59,extensionIntroducer:33,applicationExtensionLabel:255,graphicControlExtensionLabel:249,imageSeparator:44,signatureSize:3,versionSize:3,globalColorTableFlagMask:128,colorResolutionMask:112,sortFlagMask:8,globalColorTableSizeMask:7,applicationIdentifierSize:8,applicationAuthCodeSize:3,disposalMethodMask:28,userInputFlagMask:2,transparentColorFlagMask:1,localColorTableFlagMask:128,interlaceFlagMask:64,idSortFlagMask:32,localColorTableSizeMask:7};function A1(e=256){let t=0,n=new Uint8Array(e);return{get buffer(){return n.buffer},reset(){t=0},bytesView(){return n.subarray(0,t)},bytes(){return n.slice(0,t)},writeByte(i){r(t+1),n[t]=i,t++},writeBytes(i,s=0,l=i.length){r(t+l);for(let c=0;c=i)return;var l=1024*1024;i=Math.max(i,s*(s>>0),s!=0&&(i=Math.max(i,256));let c=n;n=new Uint8Array(i),t>0&&n.set(c.subarray(0,t),0)}}var Lp=12,w1=5003,jP=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function WP(e,t,n,r,i=A1(512),s=new Uint8Array(256),l=new Int32Array(w1),c=new Int32Array(w1)){let u=l.length,p=Math.max(2,r);s.fill(0),c.fill(0),l.fill(-1);let m=0,h=0,v=p+1,T=v,M=!1,b=T,x=(1<=0;)if(ae-=Ae,ae<0&&(ae+=u),l[ae]===be){Y=c[ae];break e}L(Y),Y=ne,B<1<0?m|=X<=8;)s[U++]=m&255,U>=254&&(i.writeByte(U),i.writeBytesView(s,0,U),U=0),m>>=8,h-=8;if((B>x||M)&&(M?(b=T,x=(1<0;)s[U++]=m&255,U>=254&&(i.writeByte(U),i.writeBytesView(s,0,U),U=0),m>>=8,h-=8;U>0&&(i.writeByte(U),i.writeBytesView(s,0,U),U=0)}}}var qP=WP;function N1(e,t,n){return e<<8&63488|t<<2&992|n>>3}function C1(e,t,n,r){return e>>4|t&240|(n&240)<<4|(r&240)<<8}function k1(e,t,n){return e>>4<<8|t&240|n>>4}function ja(e,t,n){return en?n:e}function ds(e){return e*e}function M1(e,t,n){var r=0,i=1e100;let s=e[t],l=s.cnt,c=s.ac,u=s.rc,p=s.gc,m=s.bc;for(var h=s.fw;h!=0;h=e[h].fw){let T=e[h],M=T.cnt,b=l*M/(l+M);if(!(b>=i)){var v=0;n&&(v+=b*ds(T.ac-c),v>=i)||(v+=b*ds(T.rc-u),!(v>=i)&&(v+=b*ds(T.gc-p),!(v>=i)&&(v+=b*ds(T.bc-m),!(v>=i)&&(i=v,r=h))))}}s.err=i,s.nn=r}function Ep(){return{ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0}}function KP(e,t){let n=t==="rgb444"?4096:65536,r=new Array(n),i=e.length;if(t==="rgba4444")for(let s=0;s>24&255,u=l>>16&255,p=l>>8&255,m=l&255,h=C1(m,p,u,c),v=h in r?r[h]:r[h]=Ep();v.rc+=m,v.gc+=p,v.bc+=u,v.ac+=c,v.cnt++}else if(t==="rgb444")for(let s=0;s>16&255,u=l>>8&255,p=l&255,m=k1(p,u,c),h=m in r?r[m]:r[m]=Ep();h.rc+=p,h.gc+=u,h.bc+=c,h.cnt++}else for(let s=0;s>16&255,u=l>>8&255,p=l&255,m=N1(p,u,c),h=m in r?r[m]:r[m]=Ep();h.rc+=p,h.gc+=u,h.bc+=c,h.cnt++}return r}function YP(e,t,n={}){let{format:r="rgb565",clearAlpha:i=!0,clearAlphaColor:s=0,clearAlphaThreshold:l=0,oneBitAlpha:c=!1}=n;if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array)&&!(e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");let u=new Uint32Array(e.buffer),p=n.useSqrt!==!1,m=r==="rgba4444",h=KP(u,r),v=h.length,T=v-1,M=new Uint32Array(v+1);for(var b=0,N=0;N1&&(U=B>>1,!(h[k=M[U]].err<=Y));B=U)M[B]=k;M[B]=N}var K=b-t;for(N=0;N=z.mtm&&h[z.nn].mtm<=z.tm)break;z.mtm==T?L=M[1]=M[M[0]--]:(M1(h,L,!1),z.tm=N);var Y=h[L].err;for(B=1;(U=B+B)<=M[0]&&(Uh[M[U+1]].err&&U++,!(Y<=h[k=M[U]].err));B=U)M[B]=k;M[B]=L}var X=h[z.nn],ne=z.cnt,be=X.cnt,x=1/(ne+be);m&&(z.ac=x*(ne*z.ac+be*X.ac)),z.rc=x*(ne*z.rc+be*X.rc),z.gc=x*(ne*z.gc+be*X.gc),z.bc=x*(ne*z.bc+be*X.bc),z.cnt+=X.cnt,z.mtm=++N,h[X.bk].fw=X.fw,h[X.fw].bk=X.bk,X.mtm=T}let ae=[];var Ae=0;for(N=0;;++Ae){let me=ja(Math.round(h[N].rc),0,255),ye=ja(Math.round(h[N].gc),0,255),xe=ja(Math.round(h[N].bc),0,255),we=255;m&&(we=ja(Math.round(h[N].ac),0,255),c&&(we=we<=(typeof c=="number"?c:127)?0:255),i&&we<=l&&(me=ye=xe=s,we=0));let ve=m?[me,ye,xe,we]:[me,ye,xe];if(ZP(ae,ve)||ae.push(ve),(N=h[N].fw)==0)break}return ae}function ZP(e,t){for(let n=0;n=4&&t.length>=4?r[3]===t[3]:!0;if(i&&s)return!0}return!1}function qa(e,t){var n=0,r;for(r=0;r1?Math.round(e/t)*t:e}function XP(e,{roundRGB:t=5,roundAlpha:n=10,oneBitAlpha:r=null}={}){let i=new Uint32Array(e.buffer);for(let s=0;s>24&255,u=l>>16&255,p=l>>8&255,m=l&255;c=Wa(c,n),r&&(c=c<=(typeof r=="number"?r:127)?0:255),m=Wa(m,t),p=Wa(p,t),u=Wa(u,t),i[s]=c<<24|u<<16|p<<8|m<<0}}function JP(e,t,n="rgb565"){if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array)&&!(e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");if(t.length>256)throw new Error("applyPalette() only works with 256 colors or less");let r=new Uint32Array(e.buffer),i=r.length,s=n==="rgb444"?4096:65536,l=new Uint8Array(i),c=new Array(s),u=n==="rgba4444";if(n==="rgba4444")for(let p=0;p>24&255,v=m>>16&255,T=m>>8&255,M=m&255,b=C1(M,T,v,h),x=b in c?c[b]:c[b]=QP(M,T,v,h,t);l[p]=x}else{let p=n==="rgb444"?k1:N1;for(let m=0;m>16&255,T=h>>8&255,M=h&255,b=p(M,T,v),x=b in c?c[b]:c[b]=VP(M,T,v,t);l[m]=x}}return l}function QP(e,t,n,r,i){let s=0,l=1e100;for(let c=0;cl)continue;let h=u[0];if(m+=Mr(h-e),m>l)continue;let v=u[1];if(m+=Mr(v-t),m>l)continue;let T=u[2];m+=Mr(T-n),!(m>l)&&(l=m,s=c)}return s}function VP(e,t,n,r){let i=0,s=1e100;for(let l=0;ls)continue;let m=c[1];if(p+=Mr(m-t),p>s)continue;let h=c[2];p+=Mr(h-n),!(p>s)&&(s=p,i=l)}return i}function eI(e,t,n=5){if(!e.length||!t.length)return;let r=e.map(l=>l.slice(0,3)),i=n*n,s=e[0].length;for(let l=0;ls?c=c.slice(0,3):c=c.slice();let u=L1(r,c.slice(0,3),qa),p=u[0],m=u[1];m>0&&m<=i&&(e[p]=c)}}function Mr(e){return e*e}function R1(e,t,n=qa){let r=1/0,i=-1;for(let s=0;s=0&&rI(r,k)}let K=Math.round(x/10);nI(r,U,K,M,b);let z=Boolean(N)&&!Y;iI(r,h,v,z?N:null),z&&P1(r,N),sI(r,m,h,v,B,s,l,c)}};function p(){D1(r,"GIF89a")}}function nI(e,t,n,r,i){e.writeByte(33),e.writeByte(249),e.writeByte(4),i<0&&(i=0,r=!1);var s,l;r?(s=1,l=2):(s=0,l=0),t>=0&&(l=t&7),l<<=2;let c=0;e.writeByte(0|l|c|s),Go(e,n),e.writeByte(i||0),e.writeByte(0)}function oI(e,t,n,r,i=8){let c=Dp(r.length)-1,u=1<<7|i-1<<4|0<<3|c,p=0,m=0;Go(e,t),Go(e,n),e.writeBytes([u,p,m])}function rI(e,t){e.writeByte(33),e.writeByte(255),e.writeByte(11),D1(e,"NETSCAPE2.0"),e.writeByte(3),e.writeByte(1),Go(e,t),e.writeByte(0)}function P1(e,t){let n=1<>8&255)}function D1(e,t){for(var n=0;ni.localName===e);return n?Object.values(n).find(i=>typeof i=="function")?.():void 0}var ri,lI,Pr,ms,O1,fs,Ho,Ka,cI,uI,Bp,Fp,Ya,We,Up,B1=g(()=>{"use strict";a();Yn();$();P();za();bt();wn();Ze();w();j();A();ri=js(_p()),lI=0,Pr=Me("StickersStore"),ms=Me("UserSettingsProtoStore"),O1=I("BINARY_READ_OPTIONS");fs=yt(()=>Ni.PreloadedUserSettingsActionCreators),Ho=yt(()=>_1("appearance",fs.ProtoClass)),Ka=yt(()=>_1("clientThemeSettings",Ho)),cI=1n<<18n,uI=1n<<37n,Bp=/\/emojis\/(\d+?)\.(png|webp|gif)/,Fp=/\/stickers\/(\d+?)\./,Ya=/\/attachments\/\d+?\/\d+?\/(\d+?)\.gif/,We=D({enableEmojiBypass:{description:"Allow sending fake emojis",type:3,default:!0,restartNeeded:!0},emojiSize:{description:"Size of the emojis when sending",type:5,default:48,markers:[32,48,64,128,160,256,512]},transformEmojis:{description:"Whether to transform fake emojis into real ones",type:3,default:!0,restartNeeded:!0},enableStickerBypass:{description:"Allow sending fake stickers",type:3,default:!0,restartNeeded:!0},stickerSize:{description:"Size of the stickers when sending",type:5,default:160,markers:[32,64,128,160,256,512]},transformStickers:{description:"Whether to transform fake stickers into real ones",type:3,default:!0,restartNeeded:!0},transformCompoundSentence:{description:"Whether to transform fake stickers and emojis in compound sentences (sentences with more content than just the fake emoji or sticker link)",type:3,default:!1},enableStreamQualityBypass:{description:"Allow streaming in nitro quality",type:3,default:!0,restartNeeded:!0}}),Up=y({name:"FakeNitro",authors:[d.Arjix,d.D3SOX,d.Ven,d.obscurity,d.captain,d.Nuckyz,d.AutumnVN],description:"Allows you to stream in nitro quality, send fake emojis/stickers and use client themes.",dependencies:["MessageEventsAPI"],settings:We,patches:[{find:".PREMIUM_LOCKED;",predicate:()=>We.store.enableEmojiBypass,replacement:[{match:/(?<=,intention:(\i).+?;)/,replace:(e,t)=>`let fakeNitroIntention=${t};`},{match:/\.(?:canUseEmojisEverywhere|canUseAnimatedEmojis)\(\i(?=\))/g,replace:'$&,typeof fakeNitroIntention!=="undefined"?fakeNitroIntention:void 0'},{match:/(&&!\i&&)!(\i)(?=\)return \i\.\i\.DISALLOW_EXTERNAL;)/,replace:(e,t,n)=>`${t}(!${n}&&(typeof fakeNitroIntention==="undefined"||![${3},${4}].includes(fakeNitroIntention)))`},{match:/if\(!\i\.available/,replace:e=>`${e}&&(typeof fakeNitroIntention==="undefined"||![${3},${4}].includes(fakeNitroIntention))`}]},{find:"canUseAnimatedEmojis:function",predicate:()=>We.store.enableEmojiBypass,replacement:{match:/((?:canUseEmojisEverywhere|canUseAnimatedEmojis):function\(\i)\){(.+?\))(?=})/g,replace:(e,t,n)=>`${t},fakeNitroIntention){${n}||fakeNitroIntention==null||[${3},${4}].includes(fakeNitroIntention)`}},{find:"canUseCustomStickersEverywhere:function",predicate:()=>We.store.enableStickerBypass,replacement:{match:/canUseCustomStickersEverywhere:function\(\i\){/,replace:"$&return true;"}},{find:'"SENDABLE"',predicate:()=>We.store.enableStickerBypass,replacement:{match:/(\w+)\.available\?/,replace:"true?"}},{find:"canUseHighVideoUploadQuality:function",predicate:()=>We.store.enableStreamQualityBypass,replacement:["canUseHighVideoUploadQuality","canStreamQuality"].map(e=>({match:new RegExp(`${e}:function\\(\\i(?:,\\i)?\\){`,"g"),replace:"$&return true;"}))},{find:"STREAM_FPS_OPTION.format",predicate:()=>We.store.enableStreamQualityBypass,replacement:{match:/guildPremiumTier:\i\.\i\.TIER_\d,?/g,replace:""}},{find:"canUseClientThemes:function",replacement:{match:/canUseClientThemes:function\(\i\){/,replace:"$&return true;"}},{find:'.displayName="UserSettingsProtoStore"',replacement:[{match:/CONNECTION_OPEN:function\((\i)\){/,replace:(e,t)=>`${e}$self.handleProtoChange(${t}.userSettingsProto,${t}.user);`},{match:/let{settings:/,replace:"arguments[0].local||$self.handleProtoChange(arguments[0].settings.proto);$&"}]},{find:",updateTheme(",replacement:{match:/(function \i\(\i\){let{backgroundGradientPresetId:(\i).+?)(\i\.\i\.updateAsync.+?theme=(.+?),.+?},\i\))/,replace:(e,t,n,r,i)=>`${t}$self.handleGradientThemeSelect(${n},${i},()=>${r});`}},{find:'["strong","em","u","text","inlineCode","s","spoiler"]',replacement:[{predicate:()=>We.store.transformEmojis,match:/1!==(\i)\.length\|\|1!==\i\.length/,replace:(e,t)=>`${e}||$self.shouldKeepEmojiLink(${t}[0])`},{predicate:()=>We.store.transformEmojis||We.store.transformStickers,match:/(?=return{hasSpoilerEmbeds:\i,content:(\i)})/,replace:(e,t)=>`${t}=$self.patchFakeNitroEmojisOrRemoveStickersLinks(${t},arguments[2]?.formatInline);`}]},{find:"renderEmbeds(",replacement:[{predicate:()=>We.store.transformEmojis||We.store.transformStickers,match:/(renderEmbeds\((\i)\){)(.+?embeds\.map\((\i)=>{)/,replace:(e,t,n,r,i)=>`${t}const fakeNitroMessage=${n};${r}if($self.shouldIgnoreEmbed(${i},fakeNitroMessage))return null;`},{predicate:()=>We.store.transformStickers,match:/(?<=renderStickersAccessories\((\i)\){let (\i)=\(0,\i\.\i\)\(\i\).+?;)/,replace:(e,t,n)=>`${n}=$self.patchFakeNitroStickers(${n},${t});`},{predicate:()=>We.store.transformStickers,match:/renderAttachments\(\i\){let{attachments:(\i).+?;/,replace:(e,t)=>`${e}${t}=$self.filterAttachments(${t});`}]},{find:".Messages.STICKER_POPOUT_UNJOINED_PRIVATE_GUILD_DESCRIPTION.format",predicate:()=>We.store.transformStickers,replacement:[{match:/let{renderableSticker:(\i).{0,250}isGuildSticker.+?channel:\i,/,replace:(e,t)=>`${e}fakeNitroRenderableSticker:${t},`},{match:/(let \i,{sticker:\i,channel:\i,closePopout:\i.+?}=(\i).+?;)(.+?description:)(\i)(?=,sticker:\i)/,replace:(e,t,n,r,i)=>`${t}let{fakeNitroRenderableSticker}=${n};${r}$self.addFakeNotice(${0},${i},!!fakeNitroRenderableSticker?.fake)`}]},{find:".EMOJI_UPSELL_POPOUT_MORE_EMOJIS_OPENED,",predicate:()=>We.store.transformEmojis,replacement:{match:/isDiscoverable:\i,shouldHideRoleSubscriptionCTA:\i,(?<={node:(\i),.+?)/,replace:(e,t)=>`${e}fakeNitroNode:${t},`}},{find:".Messages.EMOJI_POPOUT_UNJOINED_DISCOVERABLE_GUILD_DESCRIPTION",predicate:()=>We.store.transformEmojis,replacement:{match:/(?<=isDiscoverable:\i,emojiComesFromCurrentGuild:\i,.+?}=(\i).+?;)(.+?return )(.{0,1000}\.Messages\.EMOJI_POPOUT_UNJOINED_DISCOVERABLE_GUILD_DESCRIPTION.+?)(?=},)/,replace:(e,t,n,r)=>`let{fakeNitroNode}=${t};${n}$self.addFakeNotice(${1},${r},!!fakeNitroNode?.fake)`}},{find:"canUsePremiumAppIcons:function",replacement:{match:/canUsePremiumAppIcons:function\(\i\){/,replace:"$&return true;"}},{find:'location:"AppIconHome"',replacement:{match:/\i\.\i\.isPremium\(\i\.\i\.getCurrentUser\(\)\)/,replace:"true"}}],get guildId(){return Au()?.id},get canUseEmotes(){return(W.getCurrentUser().premiumType??0)>0},get canUseStickers(){return(W.getCurrentUser().premiumType??0)>1},handleProtoChange(e,t){if(e==null||typeof e=="string"||!ms||!fs||!Ho||!Ka)return;if((t?.premium_type??W?.getCurrentUser()?.premiumType??0)!==2){if(e.appearance??=Ho.create(),ms.settings.appearance?.theme!=null){let r=Ho.create({theme:ms.settings.appearance.theme});e.appearance.theme=r.theme}if(ms.settings.appearance?.clientThemeSettings?.backgroundGradientPresetId?.value!=null){let r=Ka.create({backgroundGradientPresetId:{value:ms.settings.appearance.clientThemeSettings.backgroundGradientPresetId.value}});e.appearance.clientThemeSettings??=r,e.appearance.clientThemeSettings.backgroundGradientPresetId=r.backgroundGradientPresetId}}},handleGradientThemeSelect(e,t,n){if((W?.getCurrentUser()?.premiumType??0)===2||e==null)return n();if(!fs||!Ho||!Ka||!O1)return;let i=fs.getCurrentValue().appearance,s=i!=null?Ho.fromBinary(Ho.toBinary(i),O1.BINARY_READ_OPTIONS):Ho.create();s.theme=t;let l=Ka.create({backgroundGradientPresetId:{value:e}});s.clientThemeSettings??=l,s.clientThemeSettings.backgroundGradientPresetId=l.backgroundGradientPresetId;let c=fs.ProtoClass.create();c.appearance=s,F.dispatch({type:"USER_SETTINGS_PROTO_UPDATE",local:!0,partial:!0,settings:{type:1,proto:c}})},trimContent(e){let t=e[0];typeof t=="string"&&(e[0]=t.trimStart()),e[0]===""&&e.shift();let n=e.length-1,r=e[n];typeof r=="string"&&(e[n]=r.trimEnd()),e[n]===""&&e.pop()},clearEmptyArrayItems(e){return e.filter(t=>t!=null)},ensureChildrenIsArray(e){Array.isArray(e.props.children)||(e.props.children=[e.props.children])},patchFakeNitroEmojisOrRemoveStickersLinks(e,t){if((e.length>1||typeof e[0]?.type=="string")&&!We.store.transformCompoundSentence)return e;let n=e.length,r=c=>{if(We.store.transformEmojis){let u=c.props.href.match(Bp);if(u){let p=null;try{p=new URL(c.props.href)}catch{}let m=Nn.getCustomEmojiById(u[1])?.name??p?.searchParams.get("name")??"FakeNitroEmoji";return Fe.defaultRules.customEmoji.react({jumboable:!t&&e.length===1&&typeof e[0].type!="string",animated:u[2]==="gif",emojiId:u[1],name:m,fake:!0},void 0,{key:String(n++)})}}if(We.store.transformStickers){if(Fp.test(c.props.href))return null;let u=c.props.href.match(Ya);if(u&&Pr.getStickerById(u[1]))return null}return c},i=c=>c?.props?.trusted!=null?r(c):c?.props?.children!=null?Array.isArray(c.props.children)?(c.props.children=l(c.props.children),c.props.children.length===0?null:c):(c.props.children=s(c.props.children),c):c,s=c=>{let u=i(c);if(u?.type==="ul"||u?.type==="ol"){if(this.ensureChildrenIsArray(u),u.props.children.length===0)return null;let p=!1;for(let[m,h]of u.props.children.entries()){if(h==null){delete u.props.children[m];continue}this.ensureChildrenIsArray(h),h.props.children.length>0?p=!0:delete u.props.children[m]}if(!p)return null;u.props.children=this.clearEmptyArrayItems(u.props.children)}return u},l=c=>{for(let[u,p]of c.entries())c[u]=s(p);return c=this.clearEmptyArrayItems(c),this.trimContent(c),c};try{return l(cr.cloneDeep(e))}catch(c){return new ie("FakeNitro").error(c),e}},patchFakeNitroStickers(e,t){let n=[],r=t.content.split(/\s/);We.store.transformCompoundSentence?n.push(...r):r.length===1&&n.push(r[0]),n.push(...t.attachments.filter(i=>i.content_type==="image/gif").map(i=>i.url));for(let i of n){if(!We.store.transformCompoundSentence&&!i.startsWith("http"))continue;let s=i.match(Fp);if(s){let c=null;try{c=new URL(i)}catch{}let u=Pr.getStickerById(s[1])?.name??c?.searchParams.get("name")??"FakeNitroSticker";e.push({format_type:1,id:s[1],name:u,fake:!0});continue}let l=i.match(Ya);if(l){if(!Pr.getStickerById(l[1]))continue;let c=Pr.getStickerById(l[1])?.name??"FakeNitroSticker";e.push({format_type:2,id:l[1],name:c,fake:!0})}}return e},shouldIgnoreEmbed(e,t){let n=t.content.split(/\s/);if(n.length>1&&!We.store.transformCompoundSentence)return!1;switch(e.type){case"image":{if(!We.store.transformCompoundSentence&&!n.includes(e.url)&&!n.includes(e.image?.proxyURL))return!1;if(We.store.transformEmojis&&Bp.test(e.url))return!0;if(We.store.transformStickers){if(Fp.test(e.url))return!0;let r=e.url.match(Ya);if(r&&Pr.getStickerById(r[1]))return!0}break}}return!1},filterAttachments(e){return e.filter(t=>{if(t.content_type!=="image/gif")return!0;let n=t.url.match(Ya);return!(n&&Pr.getStickerById(n[1]))})},shouldKeepEmojiLink(e){return e.target&&Bp.test(e.target)},addFakeNotice(e,t,n){if(!n)return t;switch(t=Array.isArray(t)?t:[t],e){case 0:return t.push(" This is a FakeNitro sticker and renders like a real sticker only for you. Appears as a link to non-plugin users."),t;case 1:return t.push(" This is a FakeNitro emoji and renders like a real emoji only for you. Appears as a link to non-plugin users."),t}},hasPermissionToUseExternalEmojis(e){let t=Q.getChannel(e);return!t||t.isDM()||t.isGroupDM()||t.isMultiUserDM()?!0:Ce.can(cI,t)},hasPermissionToUseExternalStickers(e){let t=Q.getChannel(e);return!t||t.isDM()||t.isGroupDM()||t.isMultiUserDM()?!0:Ce.can(uI,t)},getStickerLink(e){return`https://media.discordapp.net/stickers/${e}.png?size=${E.plugins.FakeNitro.stickerSize}`},async sendAnimatedSticker(e,t,n){let{parseURL:r}=S1(),{frames:i,width:s,height:l}=await r(e),c=(0,ri.GIFEncoder)(),u=E.plugins.FakeNitro.stickerSize,p=document.createElement("canvas");p.width=u,p.height=u;let m=p.getContext("2d",{willReadFrequently:!0}),h=u/Math.max(s,l);m.scale(h,h);let v;for(let M of i){let{left:b,top:x,width:N,height:k,img:B,delay:U,blendOp:Y,disposeOp:K}=M;v=m.getImageData(b,x,N,k),Y===0&&m.clearRect(b,x,N,k),m.drawImage(B,b,x,N,k);let{data:z}=m.getImageData(0,0,u,u),L=(0,ri.quantize)(z,256),X=(0,ri.applyPalette)(z,L);c.writeFrame(X,u,u,{transparent:!0,palette:L,delay:U}),K===1?m.clearRect(b,x,N,k):K===2&&m.putImageData(v,b,x)}c.finish();let T=new File([c.bytesView()],`${t}.gif`,{type:"image/gif"});Ri.promptToUpload([T],Q.getChannel(n),lI)},start(){let e=We.store;if(!e.enableEmojiBypass&&!e.enableStickerBypass)return;function t(n,r){return!n[r]||/\s/.test(n[r])?"":" "}this.preSend=Ht((n,r,i)=>{let{guildId:s}=this;e:{if(!e.enableStickerBypass)break e;let l=Pr.getStickerById(i.stickers?.[0]);if(!l||"pack_id"in l)break e;let c=this.canUseStickers&&this.hasPermissionToUseExternalStickers(n);if(l.available!==!1&&(c||l.guild_id===s))break e;let u=this.getStickerLink(l.id);if(l.format_type===2)return this.sendAnimatedSticker(u,l.id,n),{cancel:!0};i.stickers.length=0,r.content+=` ${u}&name=${encodeURIComponent(l.name)}`}if(e.enableEmojiBypass){let l=this.canUseEmotes&&this.hasPermissionToUseExternalEmojis(n);for(let c of r.validNonShortcutEmojis){if(!c.require_colons||c.available!==!1&&l||c.guildId===s&&!c.animated)continue;let u=`<${c.animated?"a":""}:${c.originalName||c.name}:${c.id}>`,p=c.url.replace(/\?size=\d+/,"?"+new URLSearchParams({size:E.plugins.FakeNitro.emojiSize,name:encodeURIComponent(c.name)}));r.content=r.content.replace(u,(m,h,v)=>`${t(v,h-1)}${p}${t(v,h+m.length)}`)}}return{cancel:!1}}),this.preEdit=br((n,r,i)=>{if(!e.enableEmojiBypass)return;let s=this.canUseEmotes&&this.hasPermissionToUseExternalEmojis(n),{guildId:l}=this;i.content=i.content.replace(/(?/ig,(c,u,p,m)=>{let h=Nn.getCustomEmojiById(u);if(h==null||!h.require_colons||h.available!==!1&&s||h.guildId===l&&!h.animated)return c;let v=h.url.replace(/\?size=\d+/,"?"+new URLSearchParams({size:E.plugins.FakeNitro.emojiSize,name:encodeURIComponent(h.name)}));return`${t(m,p-1)}${v}${t(m,p+c.length)}`})})},stop(){zt(this.preSend),Tr(this.preEdit)}})});function F1(...e){let t={};function n(i){for(let s=e.length-1;s>=0;s--)if(i in e[s])return e[s];return t}let r={ownKeys(){return e.reduce((i,s)=>(i.push(...Reflect.ownKeys(s)),i),Reflect.ownKeys(t))}};for(let i of["defineProperty","deleteProperty","get","getOwnPropertyDescriptor","has","set"])r[i]=function(s,...l){return Reflect[i](n(l[0]),...l)};return new Proxy(t,r)}var U1,$1=g(()=>{"use strict";a();U1=F1;typeof module<"u"&&(module.exports=F1)});function pI(e,t){let n=`[#${e.toString(16).padStart(6,"0")},#${t.toString(16).padStart(6,"0")}]`,r="",i=Array.from(n).map(s=>s.codePointAt(0)).filter(s=>s>=32&&s<=127).map(s=>String.fromCodePoint(s+917504)).join("");return(r||"")+" "+i}function dI(e){if(e==null)return null;let t=e.match(/\u{e005b}\u{e0023}([\u{e0061}-\u{e0066}\u{e0041}-\u{e0046}\u{e0030}-\u{e0039}]+?)\u{e002c}\u{e0023}([\u{e0061}-\u{e0066}\u{e0041}-\u{e0046}\u{e0030}-\u{e0039}]+?)\u{e005d}/u);if(t!=null){let n=[...t[0]].map(i=>String.fromCodePoint(i.codePointAt(0)-917504)).join("");return n.substring(1,n.length-1).split(",").map(i=>parseInt(i.replace("#","0x"),16))}else return null}var G1,$p,H1=g(()=>{"use strict";a();$();le();P();at();Re();w();A();$1();G1=D({nitroFirst:{description:"Default color source if both are present",type:4,options:[{label:"Nitro colors",value:!0,default:!0},{label:"Fake colors",value:!1}]}}),$p=y({name:"FakeProfileThemes",description:"Allows profile theming by hiding the colors in your bio thanks to invisible 3y3 encoding",authors:[d.Alyxia,d.Remty],patches:[{find:"UserProfileStore",replacement:{match:/(?<=getUserProfile\(\i\){return )(\i\[\i\])/,replace:"$self.colorDecodeHook($1)"}},{find:".USER_SETTINGS_PROFILE_THEME_ACCENT",replacement:{match:/RESET_PROFILE_THEME}\)(?<=color:(\i),.{0,500}?color:(\i),.{0,500}?)/,replace:"$&,$self.addCopy3y3Button({primary:$1,accent:$2})"}}],settingsAboutComponent:()=>o(S.FormSection,null,o(S.FormTitle,{tag:"h3"},"Usage"),o(S.FormText,null,"After enabling this plugin, you will see custom colors in the profiles of other people using compatible plugins. ",o("br",null),"To set your own colors:",o("ul",null,o("li",null,"\u2022 go to your profile settings"),o("li",null,"\u2022 choose your own colors in the Nitro preview"),o("li",null,'\u2022 click the "Copy 3y3" button'),o("li",null,"\u2022 paste the invisible text anywhere in your bio")),o("br",null),o("b",null,"Please note:")," if you are using a theme which hides nitro ads, you should disable it temporarily to set colors.")),settings:G1,colorDecodeHook(e){if(e){if(G1.store.nitroFirst&&e.themeColors)return e;let t=dI(e.bio);if(t)return U1(e,{premiumType:2,themeColors:t})}return e},addCopy3y3Button:_.wrap(function({primary:e,accent:t}){return o(R,{onClick:()=>{let n=pI(e,t);gn(n)},color:R.Colors.PRIMARY,size:R.Sizes.XLARGE,className:q.left16},"Copy 3y3")},{noop:!0})})});var Gp,z1=g(()=>{"use strict";a();P();w();A();Gp=y({name:"FavoriteEmojiFirst",authors:[d.Aria,d.Ven],description:"Puts your favorite emoji first in the emoji autocomplete.",patches:[{find:"renderResults({results:",replacement:[{match:/let \i=.{1,100}renderResults\({results:(\i)\.query\.results,/,replace:"$self.sortEmojis($1);$&"}]},{find:"MAX_AUTOCOMPLETE_RESULTS+",replacement:[{match:/,maxCount:(\i)(.{1,500}\i)=(\i)\.slice\(0,(\i-\i\.length)\)/,replace:",maxCount:Infinity$2=($3.sliceTo = $4, $3)"}]}],sortEmojis({query:e}){if(e?.type!=="EMOJIS_AND_STICKERS"||e.typeInfo?.sentinel!==":"||!e.results?.emojis?.length)return;let t=Nn.getDisambiguatedEmojiContext();e.results.emojis=e.results.emojis.sort((n,r)=>{let i=t.isFavoriteEmojiWithoutFetchingLatest(n),s=t.isFavoriteEmojiWithoutFetchingLatest(r);return i&&!s?-1:!i&&s?1:0}).slice(0,e.results.emojis.sliceTo??10)}})});function fI({instance:e,SearchBarComponent:t}){let[n,r]=J(""),i=Yt(null),s=ea(l=>{r(l);let{props:c}=e;if(l===""){c.favorites=c.favCopy,e.forceUpdate();return}i.current?.containerRef?.current.closest("#gif-picker-tab-panel")?.querySelector('[class|="content"]')?.firstElementChild?.scrollTo(0,0);let u=c.favCopy.map(p=>({score:gI(l.toLowerCase(),W1(p.url??p.src).replace(/(%20|[_-])/g," ").toLowerCase()),gif:p})).filter(p=>p.score!=null);u.sort((p,m)=>m.score-p.score),c.favorites=u.map(p=>p.gif),e.forceUpdate()},[e.state]);return De(()=>()=>{e.dead=!0},[]),o(t,{ref:i,autoFocus:!0,className:mI.searchBar,size:t.Sizes.MEDIUM,onChange:s,onClear:()=>{r(""),e.props.favCopy!=null&&(e.props.favorites=e.props.favCopy,e.forceUpdate())},query:n,placeholder:"Search Favorite Gifs"})}function W1(e){let t=new URL(e);switch(j1.store.searchOption){case"url":return t.href;case"path":return t.host==="media.discordapp.net"||t.host==="tenor.com"?t.pathname.split("/").at(-1)??t.pathname:t.pathname;case"hostandpath":return t.host==="media.discordapp.net"||t.host==="tenor.com"?`${t.host} ${t.pathname.split("/").at(-1)??t.pathname}`:`${t.host} ${t.pathname}`;default:return""}}function gI(e,t){let n=0,r=0;for(let i=0;i{"use strict";a();$();le();P();w();j();A();mI=I("searchBar","searchBarFullRow"),j1=D({searchOption:{type:4,description:"The part of the url you want to search",options:[{label:"Entire Url",value:"url"},{label:"Path Only (/somegif.gif)",value:"path"},{label:"Host & Path (tenor.com somgif.gif)",value:"hostandpath",default:!0}]}}),Hp=y({name:"FavoriteGifSearch",authors:[d.Aria],description:"Adds a search bar to favorite gifs.",patches:[{find:"renderHeaderContent()",replacement:[{match:/(renderHeaderContent\(\).{1,150}FAVORITES:return)(.{1,150});(case.{1,200}default:return\(0,\i\.jsx\)\((?\i\..{1,10}),)/,replace:"$1 this.state.resultType === 'Favorites' ? $self.renderSearchBar(this, $) : $2;$3"},{match:/(,suggestions:\i,favorites:)(\i),/,replace:"$1$self.getFav($2),favCopy:$2,"}]}],settings:j1,getTargetString:W1,instance:null,renderSearchBar(e,t){return this.instance=e,o(_,{noop:!0},o(fI,{instance:e,SearchBarComponent:t}))},getFav(e){if(!this.instance||this.instance.dead)return e;let{favorites:t}=this.instance.props;return t!=null&&t?.length!==e.length?t:e}})});var zp,K1=g(()=>{"use strict";a();$();ka();P();w();zp=y({name:"FixSpotifyEmbeds",description:"Fixes spotify embeds being incredibly loud by letting you customise the volume",authors:[d.Ven],settings:D({volume:{type:5,description:"The volume % to set for spotify embeds. Anything above 10% is veeeery loud",markers:Fo(0,100,10),stickToMarkers:!1,default:10}})})});var jp,Y1=g(()=>{"use strict";a();P();w();A();jp=y({name:"ForceOwnerCrown",description:"Force the owner crown next to usernames even if the server is large.",authors:[d.D3SOX,d.Nickyux],patches:[{find:"AVATAR_DECORATION_PADDING:",replacement:{match:/,isOwner:(\i),/,replace:",_isOwner:$1=$self.isGuildOwner(e),"}}],isGuildOwner(e){if(!e?.user?.id||e.channel?.type===3)return e.isOwner;let t=e.guildId??e.channel?.guild_id,n=e.user.id;return Te.getGuild(t)?.ownerId===n}})});var Za,hI,Wp,Z1=g(()=>{"use strict";a();Qt();P();w();j();A();Za=I("createFriendInvite"),{uuid4:hI}=I("uuid4"),Wp=y({name:"FriendInvites",description:"Create and manage friend invite links via slash commands (/create friend invite, /view friend invites, /revoke friend invites).",authors:[d.afn,d.Dziurwa],dependencies:["CommandsAPI"],commands:[{name:"create friend invite",description:"Generates a friend invite link.",inputType:3,options:[{name:"Uses",description:"How many uses?",choices:[{label:"1",name:"1",value:"1"},{label:"5",name:"5",value:"5"}],required:!1,type:4}],execute:async(e,t)=>{let n=it(e,"Uses",5);if(n===1&&!W.getCurrentUser().phone)return ue(t.channel.id,{content:"You need to have a phone number connected to your account to create a friend invite with 1 use!"});let r;if(n===1){let i=hI(),{body:{invite_suggestions:s}}=await Mt.post({url:"/friend-finder/find-friends",body:{modified_contacts:{[i]:[1,"",""]},phone_contact_methods_count:1}});r=await Za.createFriendInvite({code:s[0][3],recipient_phone_number_or_email:i,contact_visibility:1,filter_visibilities:[],filtered_invite_suggestions_index:1})}else r=await Za.createFriendInvite();ue(t.channel.id,{content:` + `}var as,op,Dv=g(()=>{"use strict";a();$();P();M();op=y({name:"BlurNSFW",description:"Blur attachments in NSFW channels until hovered",authors:[p.Ven],patches:[{find:".embedWrapper,embed",replacement:[{match:/\.embedWrapper/g,replace:"$&+(this.props.channel.nsfw?' vc-nsfw-img':'')"}]}],options:{blurAmount:{type:1,description:"Blur Amount",default:10,onChange:Ev}},start(){as=document.createElement("style"),as.id="VcBlurNsfw",document.head.appendChild(as),Ev()},stop(){as?.remove()}})});function nP(e){let t=L.plugins.CallTimer.format==="human",n=m=>t?m:m.toString().padStart(2,"0"),r=m=>t?m:"",i=t?" ":":",s=Math.floor(e/864e5),l=Math.floor(e%864e5/36e5),c=Math.floor(e%864e5%36e5/6e4),u=Math.floor(e%864e5%36e5%6e4/1e3),d="";return s&&(d+=`${s}d `),(l||d)&&(d+=`${n(l)}${r("h")}${i}`),(c||d||!t)&&(d+=`${n(c)}${r("m")}${i}`),d+=`${n(u)}${r("s")}`,d}var rp,Ov=g(()=>{"use strict";a();$();le();P();Oe();M();rp=y({name:"CallTimer",description:"Adds a timer to vcs",authors:[p.Ven],startTime:0,interval:void 0,options:{format:{type:4,description:"The timer format. This can be any valid moment.js format",options:[{label:"30d 23:00:42",value:"stopwatch",default:!0},{label:"30d 23h 00m 42s",value:"human"}]}},patches:[{find:"renderConnectionStatus(){",replacement:{match:/(?<=renderConnectionStatus\(\)\{.+\.channel,children:)\i/,replace:"[$&, $self.renderTimer(this.props.channel.id)]"}}],renderTimer(e){return o(_,{noop:!0},o(this.Timer,{channelId:e}))},Timer({channelId:e}){let t=Oi({deps:[e]});return o("p",{style:{margin:0}},"Connected for ",o("span",{style:{fontFamily:"var(--font-code)"}},nP(t)))}})});var pp={};Ue(pp,{_handleClick:()=>iP,_handlePreEdit:()=>rP,_handlePreSend:()=>oP,addClickListener:()=>cp,addPreEditListener:()=>br,addPreSendListener:()=>jt,removeClickListener:()=>up,removePreEditListener:()=>Tr,removePreSendListener:()=>Wt});async function oP(e,t,n,r){n.replyOptions=r;for(let i of sp)try{let s=await i(e,t,n);if(s&&s.cancel===!0)return!0}catch(s){ip.error(`MessageSendHandler: Listener encountered an unknown error +`,s)}return!1}async function rP(e,t,n){for(let r of ap)try{await r(e,t,n)}catch(i){ip.error(`MessageEditHandler: Listener encountered an unknown error +`,i)}}function jt(e){return sp.add(e),e}function br(e){return ap.add(e),e}function Wt(e){return sp.delete(e)}function Tr(e){return ap.delete(e)}function iP(e,t,n){e=Cn.getMessage(t.id,e.id)??e;for(let r of lp)try{r(e,t,n)}catch(i){ip.error(`MessageClickHandler: Listener encountered an unknown error +`,i)}}function cp(e){return lp.add(e),e}function up(e){return lp.delete(e)}var ip,sp,ap,lp,Xn=g(()=>{"use strict";a();Je();I();ip=new ie("MessageEvents","#e5c890"),sp=new Set,ap=new Set;lp=new Set});var _v,Bv=g(()=>{"use strict";a();_v=["action_object_map","action_type_map","action_ref_map","spm@*.aliexpress.com","scm@*.aliexpress.com","aff_platform","aff_trace_key","algo_expid@*.aliexpress.*","algo_pvid@*.aliexpress.*","btsid","ws_ab_test","pd_rd_*@amazon.*","_encoding@amazon.*","psc@amazon.*","tag@amazon.*","ref_@amazon.*","pf_rd_*@amazon.*","pf@amazon.*","crid@amazon.*","keywords@amazon.*","sprefix@amazon.*","sr@amazon.*","ie@amazon.*","node@amazon.*","qid@amazon.*","callback@bilibili.com","cvid@bing.com","form@bing.com","sk@bing.com","sp@bing.com","sc@bing.com","qs@bing.com","pq@bing.com","sc_cid","mkt_tok","trk","trkCampaign","ga_*","gclid","gclsrc","hmb_campaign","hmb_medium","hmb_source","spReportId","spJobID","spUserID","spMailingID","itm_*","s_cid","elqTrackId","elqTrack","assetType","assetId","recipientId","campaignId","siteId","mc_cid","mc_eid","pk_*","sc_campaign","sc_channel","sc_content","sc_medium","sc_outcome","sc_geo","sc_country","nr_email_referer","vero_conv","vero_id","yclid","_openstat","mbid","cmpid","cid","c_id","campaign_id","Campaign","hash@ebay.*","fb_action_ids","fb_action_types","fb_ref","fb_source","fbclid","refsrc@facebook.com","hrc@facebook.com","gs_l","gs_lcp@google.*","ved@google.*","ei@google.*","sei@google.*","gws_rd@google.*","gs_gbg@google.*","gs_mss@google.*","gs_rn@google.*","_hsenc","_hsmi","__hssc","__hstc","hsCtaTracking","source@sourceforge.net","position@sourceforge.net","t@*.twitter.com","s@*.twitter.com","ref_*@*.twitter.com","tt_medium","tt_content","lr@yandex.*","redircnt@yandex.*","feature@youtube.com","kw@youtube.com","si@youtube.com","pp@youtube.com","si@youtu.be","wt_zmc","utm_source","utm_content","utm_medium","utm_campaign","utm_term","si@open.spotify.com","igshid","share_id@reddit.com"]});var Fv,sP,dp,Uv=g(()=>{"use strict";a();Xn();P();M();Bv();Fv=/[\\^$.*+?()[\]{}|]/g,sP=RegExp(Fv.source),dp=y({name:"ClearURLs",description:"Removes tracking garbage from URLs",authors:[p.adryd],dependencies:["MessageEventsAPI"],escapeRegExp(e){return e&&sP.test(e)?e.replace(Fv,"\\$&"):e||""},createRules(){let e=_v;this.universalRules=new Set,this.rulesByHost=new Map,this.hostRules=new Map;for(let t of e){let n=t.split("@"),r=new RegExp("^"+this.escapeRegExp(n[0]).replace(/\\\*/,".+?")+"$");if(!n[1]){this.universalRules.add(r);continue}let i=new RegExp("^(www\\.)?"+this.escapeRegExp(n[1]).replace(/\\\./,"\\.").replace(/^\\\*\\\./,"(.+?\\.)?").replace(/\\\*/,".+?")+"$"),s=i.toString();this.hostRules.set(s,i),this.rulesByHost.get(s)==null&&this.rulesByHost.set(s,new Set),this.rulesByHost.get(s).add(r)}},removeParam(e,t,n){(t===e||e instanceof RegExp&&e.test(t))&&n.delete(t)},replacer(e){try{var t=new URL(e)}catch{return e}return t.searchParams.entries().next().done?e:(this.universalRules.forEach(n=>{t.searchParams.forEach((r,i,s)=>{this.removeParam(n,i,s)})}),this.hostRules.forEach((n,r)=>{!n.test(t.hostname)||this.rulesByHost.get(r).forEach(i=>{t.searchParams.forEach((s,l,c)=>{this.removeParam(i,l,c)})})}),t.toString())},onSend(e){e.content.match(/http(s)?:\/\//)&&(e.content=e.content.replace(/(https?:\/\/[^\s<]+[^<.,:;"'>)|\]\s])/g,t=>this.replacer(t)))},start(){this.createRules(),this.preSend=jt((e,t)=>this.onSend(t)),this.preEdit=br((e,t,n)=>this.onSend(n))},stop(){Wt(this.preSend),Tr(this.preEdit)}})});var mp,$v=g(()=>{"use strict";a();P();M();mp=y({name:"ColorSighted",description:"Removes the colorblind-friendly icons from statuses, just like 2015-2017 Discord",authors:[p.lewisakura],patches:[{find:"Masks.STATUS_ONLINE",replacement:{match:/Masks\.STATUS_(?:IDLE|DND|STREAMING|OFFLINE)/g,replace:"Masks.STATUS_ONLINE"}},{find:".AVATAR_STATUS_MOBILE_16;",replacement:{match:/(?<=fromIsMobile:\i=!0,.+?)status:(\i)/,replace:'status_$:$1="online"'}}]})});function xr(e){if(typeof e=="string")return e;let t=e.source.replaceAll("\\i","[A-Za-z_$][\\w$]*");return new RegExp(t,e.flags)}function Ua(e,t){let n=`Vencord.Plugins.plugins[${JSON.stringify(t)}]`;return typeof e!="function"?e.replaceAll("$self",n):(...r)=>e(...r).replaceAll("$self",n)}function fp(e,t){if(e.get){let n=e.get;e.get=function(){return t(n.call(this))}}else e.value&&(e.value=t(e.value));return e}function ls(e,t){let n=Object.getOwnPropertyDescriptors(e);n.match=fp(n.match,xr),n.replace=fp(n.replace,r=>Ua(r,t)),Object.defineProperties(e,n)}var cs=g(()=>{"use strict";a()});var gp,Gv=g(()=>{"use strict";a();P();Do();cs();M();j();j();I();gp=y({name:"ConsoleShortcuts",description:"Adds shorter Aliases for many things on the window. Run `shortcutList` for a list.",authors:[p.Ven],getShortcuts(){function e(n){let r=new Map;return function(...i){let s=String(i);if(r.has(s))return r.get(s);let l=Er(n(...i)),c=(()=>{switch(l.length){case 0:return null;case 1:return l[0];default:let u=[...new Set(l)];return u.length>1&&console.warn(`Warning: This filter matches ${l.length} modules. Make it more specific! +`,u),l[0]}})();return c&&s&&r.set(s,c),c}}let t;return{wp:Vencord.Webpack,wpc:mn.c,wreq:mn,wpsearch:ic,wpex:sc,wpexs:n=>Vencord.Webpack.extract(Vencord.Webpack.findModuleId(n)),find:e(n=>n),findAll:Er,findByProps:e(ce.byProps),findAllByProps:(...n)=>Er(ce.byProps(...n)),findByCode:e(ce.byCode),findAllByCode:n=>Er(ce.byCode(n)),findStore:e(ce.byStoreName),PluginsApi:Vencord.Plugins,plugins:Vencord.Plugins.plugins,React:O,Settings:Vencord.Settings,Api:Vencord.Api,reload:()=>location.reload(),restart:un,canonicalizeMatch:xr,canonicalizeReplace:Ua,canonicalizeReplacement:ls,fakeRender:(n,r)=>{let i=t?.deref(),s=i?.closed===!1?i:window.open("about:blank","Fake Render","popup,width=500,height=500");t=new WeakRef(s),s.focus(),sr.render(O.createElement(n,r),s.document.body)}}},start(){let e=this.getShortcuts();window.shortcutList=e;for(let[t,n]of Object.entries(e))window[t]=n},stop(){delete window.shortcutList;for(let e in this.getShortcuts())delete window[e]}})});var Hv,hp,zv=g(()=>{"use strict";a();Mt();Ht();P();M();I();Hv=(e,{user:t})=>()=>{e.push(o(U.MenuItem,{id:"vc-copy-user-url",label:"Copy User URL",action:()=>Qt.copy(``),icon:Vr}))},hp=y({name:"CopyUserURLs",authors:[p.castdrian],description:"Adds a 'Copy User URL' option to the user context menu.",start(){ue("user-context",Hv)},stop(){fe("user-context",Hv)}})});var Ho,aP,yp,vp,$a,Sp,bp,jv=g(()=>{"use strict";a();ko();$();P();Je();dt();M();yr();j();I();Ho=new ie("CrashHandler"),aP=A("pushLazy","popAll"),yp=D({attemptToPreventCrashes:{type:3,description:"Whether to attempt to prevent Discord crashes.",default:!0},attemptToNavigateToHome:{type:3,description:"Whether to attempt to navigate to the home when preventing Discord crashes.",default:!1}}),vp=0,$a=0,Sp=!1,bp=y({name:"CrashHandler",description:"Utility plugin for handling and possibly recovering from Crashes without a restart",authors:[p.Nuckyz],enabledByDefault:!0,settings:yp,patches:[{find:".Messages.ERRORS_UNEXPECTED_CRASH",replacement:{match:/(?=this\.setState\()/,replace:"$self.handleCrash(this)||"}}],handleCrash(e){if(Date.now()-$a<=1e3&&!Sp)return!0;if(Sp=!1,++vp>5){try{Ne({color:"#eed202",title:"Discord has crashed!",body:"Awn :( Discord has crashed more than five times, not attempting to recover.",noPersist:!0})}catch{}return $a=Date.now(),!1}setTimeout(()=>vp--,6e4);try{return vp===1&&Yi("Uh oh, Discord has just crashed... but good news, there is a Vencord update available that might fix this issue! Would you like to update now?",!0),yp.store.attemptToPreventCrashes?(this.handlePreventCrash(e),!0):!1}catch(t){return Ho.error("Failed to handle crash",t),!1}finally{$a=Date.now()}},handlePreventCrash(e){if(Date.now()-$a>=1e3)try{Ne({color:"#eed202",title:"Discord has crashed!",body:"Attempting to recover...",noPersist:!0})}catch{}try{B.dispatch({type:"CONTEXT_MENU_CLOSE"})}catch(t){Ho.debug("Failed to close open context menu.",t)}try{aP?.popAll()}catch(t){Ho.debug("Failed to close old modals.",t)}try{Tc()}catch(t){Ho.debug("Failed to close all open modals.",t)}try{B.dispatch({type:"USER_PROFILE_MODAL_CLOSE"})}catch(t){Ho.debug("Failed to close user popout.",t)}try{B.dispatch({type:"LAYER_POP_ALL"})}catch(t){Ho.debug("Failed to pop all layers.",t)}if(yp.store.attemptToNavigateToHome)try{pr.transitionTo("/channels/@me")}catch(t){Ho.debug("Failed to navigate to home",t)}try{Sp=!0,e.forceUpdate()}catch(t){Ho.debug("Failed to update crash handler component.",t)}}})});function Ga(e){return Boolean(e)}function Tp(e){return e!=null}var Ha=g(()=>{"use strict";a()});async function Wv(e){return/https?:\/\/(cdn|media)\.discordapp\.(com|net)\/attachments\//.test(e)?"mp:"+e.replace(/https?:\/\/(cdn|media)\.discordapp\.(com|net)\//,""):(await ur.fetchAssetIds(wr.store.appID,[e]))[0]}function kt(){za(!0),L.plugins.CustomRPC.enabled&&za()}function Yv(){return wr.store.type!==1}function pP(e){return!Yv()&&!/https?:\/\/(www\.)?(twitch\.tv|youtube\.com)\/\w+/.test(e)?"Streaming link must be a valid URL.":!0}function qv(){return wr.store.timestampMode!==3}function Kv(e){return/https?:\/\/(?!i\.)?imgur\.com\//.test(e)?"Imgur link must be a direct link to the image. (e.g. https://i.imgur.com/...)":/https?:\/\/(?!media\.)?tenor\.com\//.test(e)?"Tenor link must be a direct link to the image. (e.g. https://media.tenor.com/...)":!0}async function Zv(){let{appID:e,appName:t,details:n,state:r,type:i,streamLink:s,startTime:l,endTime:c,imageBig:u,imageBigTooltip:d,imageSmall:m,imageSmallTooltip:h,buttonOneText:v,buttonOneURL:T,buttonTwoText:w,buttonTwoURL:b}=wr.store;if(!t)return;let x={application_id:e||"0",name:t,state:r,details:n,type:i,flags:1<<0};switch(i===1&&(x.url=s),wr.store.timestampMode){case 1:x.timestamps={start:Math.floor(Date.now()/1e3)};break;case 2:x.timestamps={start:Math.floor(Date.now()/1e3)-new Date().getHours()*3600-new Date().getMinutes()*60-new Date().getSeconds()};break;case 3:(l||c)&&(x.timestamps={},l&&(x.timestamps.start=l),c&&(x.timestamps.end=c));break;case 0:default:break}v&&(x.buttons=[v,w].filter(Ga),x.metadata={button_urls:[T,b].filter(Ga)}),u&&(x.assets={large_image:await Wv(u),large_text:d||void 0}),m&&(x.assets={...x.assets,small_image:await Wv(m),small_text:h||void 0});for(let N in x){if(N==="type")continue;let k=x[N];(!k||k.length===0)&&delete x[N]}return x}async function za(e){let t=await Zv();B.dispatch({type:"LOCAL_ACTIVITY_UPDATE",activity:e?null:t,socketId:"CustomRPC"})}var lP,cP,uP,wr,xp,Xv=g(()=>{"use strict";a();$();mo();P();Ha();Oe();M();j();I();lP=to("onOpenGameProfile"),cP=A("activity","buttonColor"),uP=A("profileColors");wr=D({appID:{type:0,description:"Application ID (required)",onChange:kt,isValid:e=>e?e&&!/^\d+$/.test(e)?"Application ID must be a number.":!0:"Application ID is required."},appName:{type:0,description:"Application name (required)",onChange:kt,isValid:e=>e?e.length>128?"Application name must be not longer than 128 characters.":!0:"Application name is required."},details:{type:0,description:"Details (line 1)",onChange:kt,isValid:e=>e&&e.length>128?"Details (line 1) must be not longer than 128 characters.":!0},state:{type:0,description:"State (line 2)",onChange:kt,isValid:e=>e&&e.length>128?"State (line 2) must be not longer than 128 characters.":!0},type:{type:4,description:"Activity type",onChange:kt,options:[{label:"Playing",value:0,default:!0},{label:"Streaming",value:1},{label:"Listening",value:2},{label:"Watching",value:3},{label:"Competing",value:5}]},streamLink:{type:0,description:"Twitch.tv or Youtube.com link (only for Streaming activity type)",onChange:kt,disabled:Yv,isValid:pP},timestampMode:{type:4,description:"Timestamp mode",onChange:kt,options:[{label:"None",value:0,default:!0},{label:"Since discord open",value:1},{label:"Same as your current time",value:2},{label:"Custom",value:3}]},startTime:{type:1,description:"Start timestamp (only for custom timestamp mode)",onChange:kt,disabled:qv,isValid:e=>e&&e<0?"Start timestamp must be greater than 0.":!0},endTime:{type:1,description:"End timestamp (only for custom timestamp mode)",onChange:kt,disabled:qv,isValid:e=>e&&e<0?"End timestamp must be greater than 0.":!0},imageBig:{type:0,description:"Big image key/link",onChange:kt,isValid:Kv},imageBigTooltip:{type:0,description:"Big image tooltip",onChange:kt,isValid:e=>e&&e.length>128?"Big image tooltip must be not longer than 128 characters.":!0},imageSmall:{type:0,description:"Small image key/link",onChange:kt,isValid:Kv},imageSmallTooltip:{type:0,description:"Small image tooltip",onChange:kt,isValid:e=>e&&e.length>128?"Small image tooltip must be not longer than 128 characters.":!0},buttonOneText:{type:0,description:"Button 1 text",onChange:kt,isValid:e=>e&&e.length>31?"Button 1 text must be not longer than 31 characters.":!0},buttonOneURL:{type:0,description:"Button 1 URL",onChange:kt},buttonTwoText:{type:0,description:"Button 2 text",onChange:kt,isValid:e=>e&&e.length>31?"Button 2 text must be not longer than 31 characters.":!0},buttonTwoURL:{type:0,description:"Button 2 URL",onChange:kt}});xp=y({name:"CustomRPC",description:"Allows you to set a custom rich presence.",authors:[p.captain,p.AutumnVN],start:za,stop:()=>za(!0),settings:wr,settingsAboutComponent:()=>{let e=ot(Zv);return o(f,null,o(S.FormText,null,"Go to ",o(it,{href:"https://discord.com/developers/applications"},"Discord Developer Portal")," to create an application and get the application ID."),o(S.FormText,null,"Upload images in the Rich Presence tab to get the image keys."),o(S.FormText,null,"If you want to use image link, download your image and reupload the image to ",o(it,{href:"https://imgur.com"},"Imgur"),' and get the image link by right-clicking the image and select "Copy image address".'),o(S.FormDivider,null),o("div",{style:{width:"284px"},className:uP.profileColors},e[0]&&o(lP,{activity:e[0],className:cP.activity,channelId:Ae.getChannelId(),guild:we.getGuild(sn.getLastSelectedGuildId()),application:{id:wr.store.appID},user:W.getCurrentUser()})))}})});var Jv=g(()=>{});async function mP(){try{let{embed:e}=this.props;if(!e||e.dearrow||e.provider?.name!=="YouTube"||!e.video?.url)return;let t=dP.exec(e.video.url)?.[1];if(!t)return;let n=await fetch(`https://sponsor.ajay.app/api/branding?videoID=${t}`);if(!n.ok)return;let{titles:r,thumbnails:i}=await n.json(),s=r[0]?.votes>=0,l=i[0]?.votes>=0;if(!s&&!l)return;e.dearrow={enabled:!0},r[0]?.votes>=0&&(e.dearrow.oldTitle=e.rawTitle,e.rawTitle=r[0].title),i[0]?.votes>=0&&i[0].timestamp&&(e.dearrow.oldThumb=e.thumbnail.proxyURL,e.thumbnail.proxyURL=`https://dearrow-thumb.ajay.app/api/v1/getThumbnail?videoID=${t}&time=${i[0].timestamp}`),this.forceUpdate()}catch(e){new ie("Dearrow").error("Failed to dearrow embed",e)}}function fP({component:e}){let{embed:t}=e.props;return t?.dearrow?o(V,{text:t.dearrow.enabled?"This embed has been dearrowed, click to restore":"Click to dearrow"},({onMouseEnter:n,onMouseLeave:r})=>o("button",{onMouseEnter:n,onMouseLeave:r,className:"vc-dearrow-toggle-"+(t.dearrow.enabled?"on":"off"),onClick:()=>{let{enabled:i,oldThumb:s,oldTitle:l}=t.dearrow;t.dearrow.enabled=!i,l&&(t.dearrow.oldTitle=t.rawTitle,t.rawTitle=l),s&&(t.dearrow.oldThumb=t.thumbnail.proxyURL,t.thumbnail.proxyURL=s),e.forceUpdate()}},o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24px",height:"24px",viewBox:"0 0 36 36","aria-label":"Toggle Dearrow"},o("path",{fill:"#1213BD",d:"M36 18.302c0 4.981-2.46 9.198-5.655 12.462s-7.323 5.152-12.199 5.152s-9.764-1.112-12.959-4.376S0 23.283 0 18.302s2.574-9.38 5.769-12.644S13.271 0 18.146 0s9.394 2.178 12.589 5.442C33.931 8.706 36 13.322 36 18.302z"}),o("path",{fill:"#88c9f9",d:"m 30.394282,18.410186 c 0,3.468849 -1.143025,6.865475 -3.416513,9.137917 -2.273489,2.272442 -5.670115,2.92874 -9.137918,2.92874 -3.467803,0 -6.373515,-1.147212 -8.6470033,-3.419654 -2.2734888,-2.272442 -3.5871299,-5.178154 -3.5871299,-8.647003 0,-3.46885 0.9420533,-6.746149 3.2144954,-9.0196379 2.2724418,-2.2734888 5.5507878,-3.9513905 9.0196378,-3.9513905 3.46885,0 6.492841,1.9322561 8.76633,4.204698 2.273489,2.2724424 3.788101,5.2974804 3.788101,8.7663304 z"}),o("path",{fill:"#0a62a5",d:"m 23.95823,17.818306 c 0,3.153748 -2.644888,5.808102 -5.798635,5.808102 -3.153748,0 -5.599825,-2.654354 -5.599825,-5.808102 0,-3.153747 2.446077,-5.721714 5.599825,-5.721714 3.153747,0 5.798635,2.567967 5.798635,5.721714 z"})))):null}var dP,wp,Qv=g(()=>{"use strict";a();Jv();le();P();Je();M();I();dP=/https:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9_-]{11})/;wp=y({name:"Dearrow",description:"Makes YouTube embed titles and thumbnails less sensationalist, powered by Dearrow",authors:[p.Ven],embedDidMount:mP,renderButton(e){return o(_,{noop:!0},o(fP,{component:e}))},patches:[{find:"this.renderInlineMediaEmbed",replacement:[{match:/render\(\)\{let\{embed:/,replace:"componentDidMount=$self.embedDidMount;$&"},{match:/children:\[(?=null!=\i\?\i\.renderSuppressButton)/,replace:"children:[$self.renderButton(this),"}]}]})});var Mp,Vv=g(()=>{"use strict";a();P();M();Mp=y({name:"DisableDMCallIdle",description:"Disables automatically getting kicked from a DM voice call after 3 minutes.",authors:[p.Nuckyz],patches:[{find:".Messages.BOT_CALL_IDLE_DISCONNECT",replacement:{match:/(?<=function \i\(\){)(?=.{1,120}\.Messages\.BOT_CALL_IDLE_DISCONNECT)/,replace:"return;"}}]})});function Pp(e){return e.t==="Emoji"?`${location.protocol}//${window.GLOBAL_ENV.CDN_HOST}/emojis/${e.id}.${e.isAnimated?"gif":"png"}`:`${location.origin}/stickers/${e.id}.${yP[e.format_type]}`}async function n1(e){let t=gP.getStickerById(e);if(t)return t;let{body:n}=await wt.get({url:`/stickers/${e}`});return B.dispatch({type:"STICKER_FETCH_SUCCESS",sticker:n}),n}async function vP(e,t){let n=new FormData;n.append("name",t.name),n.append("tags",t.tags),n.append("description",t.description),n.append("file",await o1(Pp(t)));let{body:r}=await wt.post({url:`/guilds/${e}/stickers`,body:n});B.dispatch({type:"GUILD_STICKERS_CREATE_SUCCESS",guildId:e,sticker:{...r,user:W.getCurrentUser()}})}async function SP(e,t){let n=await o1(Pp(t)),r=await new Promise(i=>{let s=new FileReader;s.onload=()=>i(s.result),s.readAsDataURL(n)});return hP.uploadEmoji({guildId:e,name:t.name.split("~")[0],image:r})}function bP(e){let t=W.getCurrentUser().id;return Object.values(we.getGuilds()).filter(n=>{if(!(n.ownerId===t||(Re.getGuildPermissions({id:n.id})&Te.CREATE_GUILD_EXPRESSIONS)===Te.CREATE_GUILD_EXPRESSIONS))return!1;if(e.t==="Sticker")return!0;let{isAnimated:i}=e,s=n.getMaxEmojiSlots(),{emojis:l}=kn.getGuilds()[n.id],c=0;for(let u of l)u.animated===i&&c++;return cn.name.localeCompare(r.name))}async function o1(e){let t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch ${e} - ${t.status}`);return t.blob()}async function TP(e,t){try{t.t==="Sticker"?await vP(e,t):await SP(e,t),ee.show({message:`Successfully cloned ${t.name} to ${we.getGuild(e)?.name??"your server"}!`,type:ee.Type.SUCCESS,id:ee.genId()})}catch(n){let r="Something went wrong (check console!)";try{r=JSON.parse(n.text).message}catch{}new ie("EmoteCloner").error("Failed to clone",t.name,"to",e,n),ee.show({message:"Failed to clone: "+r,type:ee.Type.FAILURE,id:ee.genId()})}}function MP({data:e}){let[t,n]=O.useState(!1),[r,i]=O.useState(e.name),[s,l]=O.useReducer(u=>u+1,0),c=O.useMemo(()=>bP(e),[e.id,s]);return o(f,null,o(S.FormTitle,{className:Y.top20},"Custom Name"),o(Fa,{value:r,onChange:u=>{e.name=u,i(u)},validate:u=>e.t==="Emoji"&&u.length>2&&u.length<32&&wP.test(u)||e.t==="Sticker"&&u.length>2&&u.length<30||"Name must be between 2 and 32 characters and only contain alphanumeric characters"}),o("div",{style:{display:"flex",flexWrap:"wrap",gap:"1em",padding:"1em 0.5em",justifyContent:"center",alignItems:"center"}},c.map(u=>o(V,{text:u.name},({onMouseLeave:d,onMouseEnter:m})=>o("div",{onMouseLeave:d,onMouseEnter:m,role:"button","aria-label":"Clone to "+u.name,"aria-disabled":t,style:{borderRadius:"50%",backgroundColor:"var(--background-secondary)",display:"inline-flex",justifyContent:"center",alignItems:"center",width:"4em",height:"4em",cursor:t?"not-allowed":"pointer",filter:t?"brightness(50%)":"none"},onClick:t?void 0:async()=>{n(!0),TP(u.id,e).finally(()=>{l(),n(!1)})}},u.icon?o("img",{"aria-hidden":!0,style:{borderRadius:"50%",width:"100%",height:"100%"},src:u.getIconURL(512,!0),alt:u.name}):o(S.FormText,{style:{fontSize:xP(u.acronym),width:"100%",overflow:"hidden",whiteSpace:"nowrap",textAlign:"center",cursor:t?"not-allowed":"pointer"}},u.acronym))))))}function ja(e,t){return o(U.MenuItem,{id:"emote-cloner",key:"emote-cloner",label:`Clone ${e}`,action:()=>Bi(async()=>{let n=await t(),r={t:e,...n},i=Pp(r);return s=>o(qe,{...s},o(at,null,o("img",{role:"presentation","aria-hidden":!0,src:i,alt:"",height:24,width:24,style:{marginRight:"0.5em"}}),o(S.FormText,null,"Clone ",r.name)),o(tt,null,o(MP,{data:r})))})})}function r1(e){return new URL(e).pathname.endsWith(".gif")}var gP,hP,yP,xP,wP,e1,t1,Ip,i1=g(()=>{"use strict";a();Mt();$u();P();Je();ct();dt();M();j();I();gP=Ie("StickersStore"),hP=A("fetchEmoji","uploadEmoji","deleteEmoji"),yP=[,"png","png","json","gif"];xP=e=>[20,20,18,18,16,14,12][e.length]??4,wP=/^\w+$/i;e1=(e,t)=>()=>{let{favoriteableId:n,itemHref:r,itemSrc:i,favoriteableType:s}=t??{};if(!n)return;let l=(()=>{switch(s){case"emoji":let c=t.message.content.match(RegExp(`|https://cdn\\.discordapp\\.com/emojis/${n}\\.`));if(!c)return;let u=c[1]??"FakeNitroEmoji";return ja("Emoji",()=>({id:n,name:u,isAnimated:r1(r??i)}));case"sticker":return t.message.stickerItems.find(m=>m.id===n)?.format_type===3?void 0:ja("Sticker",()=>n1(n))}})();l&&mt("copy-link",e)?.push(l)},t1=(e,t)=>()=>{let{id:n,name:r,type:i}=t?.target?.dataset??{};if(!!n)if(i==="emoji"&&r){let s=t.target.firstChild;e.push(ja("Emoji",()=>({id:n,name:r,isAnimated:s&&r1(s.src)})))}else i==="sticker"&&!t.target.className?.includes("lottieCanvas")&&e.push(ja("Sticker",()=>n1(n)))},Ip=y({name:"EmoteCloner",description:"Allows you to clone Emotes & Stickers to your own server (right click them)",tags:["StickerCloner"],authors:[p.Ven,p.Nuckyz],start(){ue("message",e1),ue("expression-picker",t1)},stop(){fe("message",e1),fe("expression-picker",t1)}})});var Ap,Np,Cp,s1=g(()=>{"use strict";a();$();le();jr();P();ct();M();j();I();Ap=A("key","removeBuildOverride"),Np=D({enableIsStaff:{description:"Enable isStaff",type:3,default:!1,restartNeeded:!0}}),Cp=y({name:"Experiments",description:"Enable Access to Experiments in Discord!",authors:[p.Megu,p.Ven,p.Nickyux,p.BanTheNons,p.Nuckyz],settings:Np,patches:[{find:"Object.defineProperties(this,{isDeveloper",replacement:{match:/(?<={isDeveloper:\{[^}]+?,get:\(\)=>)\i/,replace:"true"}},{find:'type:"user",revision',replacement:{match:/!(\i)&&"CONNECTION_OPEN".+?;/g,replace:"$1=!0;"}},{find:".isStaff=()",predicate:()=>Np.store.enableIsStaff,replacement:[{match:/=>*?(\i)\.hasFlag\((\i\.\i)\.STAFF\)}/,replace:(e,t,n)=>`=>Vencord.Webpack.Common.UserStore.getCurrentUser()?.id===${t}.id||${t}.hasFlag(${n}.STAFF)}`},{match:/hasFreePremium\(\){return this.isStaff\(\)\s*?\|\|/,replace:"hasFreePremium(){return "}]},{find:'("showNewSearch")',predicate:()=>Np.store.enableIsStaff,replacement:{match:/(?<=showNewSearch"\);return)\s?/,replace:"!1&&"}},{find:'H1,title:"Experiments"',replacement:{match:'title:"Experiments",children:[',replace:"$&$self.WarningCard(),"}}],settingsAboutComponent:()=>{let e=navigator.platform.includes("Mac"),t=e?"cmd":"ctrl",n=e?"opt":"alt";return o(O.Fragment,null,o(S.FormTitle,{tag:"h3"},"More Information"),o(S.FormText,{variant:"text-md/normal"},"You can enable client DevTools"," ",o("kbd",{className:Ap.key},t)," +"," ",o("kbd",{className:Ap.key},n)," +"," ",o("kbd",{className:Ap.key},"O")," ","after enabling ",o("code",null,"isStaff")," below"),o(S.FormText,null,"and then toggling ",o("code",null,"Enable DevTools")," in the ",o("code",null,"Developer Options")," tab in settings."))},WarningCard:_.wrap(()=>o(Sn,{id:"vc-experiments-warning-card",className:Y.bottom16},o(S.FormTitle,{tag:"h2"},"Hold on!!"),o(S.FormText,null,"Experiments are unreleased Discord features. They might not work, or even break your client or get your account disabled."),o(S.FormText,{className:Y.top8},"Only use experiments if you know what you're doing. Vencord is not responsible for any damage caused by enabling experiments.")),{noop:!0})})});var kp,a1=g(()=>{"use strict";a();P();M();kp=y({name:"F8Break",description:"Pause the client when you press F8 with DevTools (+ breakpoints) open.",authors:[p.lewisakura],start(){window.addEventListener("keydown",this.event)},stop(){window.removeEventListener("keydown",this.event)},event(e){if(e.code==="F8")debugger}})});var l1=g(()=>{"use strict";a()});var u1=rr((r8,c1)=>{"use strict";a();var fo=c1.exports;(function e(t,n,r){function i(c,u){if(!n[c]){if(!t[c]){var d=typeof Rr=="function"&&Rr;if(!u&&d)return d(c,!0);if(s)return s(c,!0);throw new Error("Cannot find module '"+c+"'")}var m=n[c]={exports:{}};t[c][0].call(m.exports,function(h){var v=t[c][1][h];return i(v||h)},m,m.exports,e,t,n,r)}return n[c].exports}for(var s=typeof Rr=="function"&&Rr,l=0;l"u"&&r!==void 0&&{}.toString.call(r)==="[object process]",N=typeof Uint8ClampedArray<"u"&&typeof importScripts<"u"&&typeof MessageChannel<"u";function k(){var C=setTimeout;return function(){return C(G,1)}}var F=new Array(1e3);function G(){for(var C=0;Ci+r.playTime;)i+=r.playTime;i+=w.delay}else u=!(c=!1)}}},{}],4:[function(e,t,n){"use strict";for(var r=new Uint32Array(256),i=0;i<256;i++){for(var s=i,l=0;l<8;l++)s=1&s?3988292384^s>>>1:s>>>1;r[i]=s}t.exports=function(c,u,d){for(var m=-1,h=u=u||0,v=u+(d=d||c.length-u);h>>8^r[255&(m^c[h])];return-1^m}},{}],5:[function(e,t,n){(function(r){"use strict";var i=e("./support-test"),s=e("./parser"),l=e("./loader"),c=r.APNG={};c.checkNativeFeatures=i.checkNativeFeatures,c.ifNeeded=i.ifNeeded,c.parseBuffer=function(d){return s(d)};var u={};c.parseURL=function(d){return d in u||(u[d]=l(d).then(s)),u[d]},c.animateContext=function(d,m){return c.parseURL(d).then(function(h){return h.addContext(m),h.play(),h})},c.animateImage=function(d){return d.setAttribute("data-is-apng","progress"),c.parseURL(d.src).then(function(m){d.setAttribute("data-is-apng","yes");var h=document.createElement("canvas");h.width=m.width,h.height=m.height,Array.prototype.slice.call(d.attributes).forEach(function(N){["alt","src","usemap","ismap","data-is-apng","width","height"].indexOf(N.nodeName)==-1&&h.setAttributeNode(N.cloneNode(!1))}),h.setAttribute("data-apng-src",d.src),d.alt!=""&&h.appendChild(document.createTextNode(d.alt));var v="",T="",w=0,b="";d.style.width!=""&&d.style.width!="auto"?v=d.style.width:d.hasAttribute("width")&&(v=d.getAttribute("width")+"px"),d.style.height!=""&&d.style.height!="auto"?T=d.style.height:d.hasAttribute("height")&&(T=d.getAttribute("height")+"px"),v!=""&&T==""&&(w=parseFloat(v),b=v.match(/\D+$/)[0],T=Math.round(h.height*w/h.width)+b),T!=""&&v==""&&(w=parseFloat(T),b=T.match(/\D+$/)[0],v=Math.round(h.width*w/h.height)+b),h.style.width=v,h.style.height=T;var x=d.parentNode;x.insertBefore(h,d),x.removeChild(d),m.addContext(h.getContext("2d")),m.play()},function(){d.setAttribute("data-is-apng","no")})},c.releaseCanvas=function(d){var m=d.getContext("2d");"_apng_animation"in m&&m._apng_animation.removeContext(m)}}).call(this,typeof fo<"u"?fo:typeof window<"u"?window:{})},{"./loader":6,"./parser":7,"./support-test":8}],6:[function(e,t,n){"use strict";var r=r||e("es6-promise").Promise;t.exports=function(i){return new r(function(s,l){var c=new XMLHttpRequest;c.open("GET",i),c.responseType="arraybuffer",c.onload=function(){this.status==200?s(this.response):l(this)},c.send()})}},{"es6-promise":1}],7:[function(e,t,n){"use strict";var r=r||e("es6-promise").Promise,i=e("./animation"),s=e("./crc32"),l=new Uint8Array([137,80,78,71,13,10,26,10]);t.exports=function(b){var x=new Uint8Array(b);return new r(function(N,k){for(var F=0;F>>0;for(var k=1;k<4;k++)N+=b[k+x]<<8*(3-k);return N},d=function(b,x){for(var N=0,k=0;k<2;k++)N+=b[k+x]<<8*(1-k);return N},m=function(b,x){return b[x]},h=function(b,x,N){var k=new Uint8Array(N);return k.set(b.subarray(x,x+N)),k},v=function(b,x,N){var k=Array.prototype.slice.call(b.subarray(x,x+N));return String.fromCharCode.apply(String,k)},T=function(b){return[b>>>24&255,b>>>16&255,b>>>8&255,255&b]},w=function(b,x){var N=b.length+x.length,k=new Uint8Array(new ArrayBuffer(N+8));k.set(T(x.length),0),k.set(function(G){for(var K=[],q=0;q{"use strict";a();Zt();l1();p1=Ao(()=>u1().APNG),PP="https://unpkg.com/@sapphi-red/web-noise-suppressor@0.3.3/dist",u8=`${PP}/rnnoise/workletProcessor.js`,d1="https://unpkg.com/@vap/shiki-worker@0.0.8/dist/index.min.js",m1="https://unpkg.com/@vap/shiki@0.10.3/dist/onig.wasm",f1=Ao(()=>import("https://unpkg.com/stegcloak-dist@1.0.0/index.js"))});var Op=rr(Dp=>{a();var v1=Object.defineProperty,IP=e=>v1(e,"__esModule",{value:!0}),AP=(e,t)=>{for(var n in t)v1(e,n,{get:t[n],enumerable:!0})};IP(Dp);AP(Dp,{GIFEncoder:()=>P1,applyPalette:()=>_P,default:()=>qP,nearestColor:()=>$P,nearestColorIndex:()=>w1,nearestColorIndexWithDistance:()=>M1,prequantize:()=>OP,quantize:()=>EP,snapColorsToPalette:()=>UP});var NP={signature:"GIF",version:"89a",trailer:59,extensionIntroducer:33,applicationExtensionLabel:255,graphicControlExtensionLabel:249,imageSeparator:44,signatureSize:3,versionSize:3,globalColorTableFlagMask:128,colorResolutionMask:112,sortFlagMask:8,globalColorTableSizeMask:7,applicationIdentifierSize:8,applicationAuthCodeSize:3,disposalMethodMask:28,userInputFlagMask:2,transparentColorFlagMask:1,localColorTableFlagMask:128,interlaceFlagMask:64,idSortFlagMask:32,localColorTableSizeMask:7};function S1(e=256){let t=0,n=new Uint8Array(e);return{get buffer(){return n.buffer},reset(){t=0},bytesView(){return n.subarray(0,t)},bytes(){return n.slice(0,t)},writeByte(i){r(t+1),n[t]=i,t++},writeBytes(i,s=0,l=i.length){r(t+l);for(let c=0;c=i)return;var l=1024*1024;i=Math.max(i,s*(s>>0),s!=0&&(i=Math.max(i,256));let c=n;n=new Uint8Array(i),t>0&&n.set(c.subarray(0,t),0)}}var Rp=12,g1=5003,CP=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function kP(e,t,n,r,i=S1(512),s=new Uint8Array(256),l=new Int32Array(g1),c=new Int32Array(g1)){let u=l.length,d=Math.max(2,r);s.fill(0),c.fill(0),l.fill(-1);let m=0,h=0,v=d+1,T=v,w=!1,b=T,x=(1<=0;)if(ae-=Ce,ae<0&&(ae+=u),l[ae]===xe){K=c[ae];break e}R(K),K=ne,F<1<0?m|=X<=8;)s[G++]=m&255,G>=254&&(i.writeByte(G),i.writeBytesView(s,0,G),G=0),m>>=8,h-=8;if((F>x||w)&&(w?(b=T,x=(1<0;)s[G++]=m&255,G>=254&&(i.writeByte(G),i.writeBytesView(s,0,G),G=0),m>>=8,h-=8;G>0&&(i.writeByte(G),i.writeBytesView(s,0,G),G=0)}}}var RP=kP;function b1(e,t,n){return e<<8&63488|t<<2&992|n>>3}function T1(e,t,n,r){return e>>4|t&240|(n&240)<<4|(r&240)<<8}function x1(e,t,n){return e>>4<<8|t&240|n>>4}function qa(e,t,n){return en?n:e}function us(e){return e*e}function h1(e,t,n){var r=0,i=1e100;let s=e[t],l=s.cnt,c=s.ac,u=s.rc,d=s.gc,m=s.bc;for(var h=s.fw;h!=0;h=e[h].fw){let T=e[h],w=T.cnt,b=l*w/(l+w);if(!(b>=i)){var v=0;n&&(v+=b*us(T.ac-c),v>=i)||(v+=b*us(T.rc-u),!(v>=i)&&(v+=b*us(T.gc-d),!(v>=i)&&(v+=b*us(T.bc-m),!(v>=i)&&(i=v,r=h))))}}s.err=i,s.nn=r}function Lp(){return{ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0}}function LP(e,t){let n=t==="rgb444"?4096:65536,r=new Array(n),i=e.length;if(t==="rgba4444")for(let s=0;s>24&255,u=l>>16&255,d=l>>8&255,m=l&255,h=T1(m,d,u,c),v=h in r?r[h]:r[h]=Lp();v.rc+=m,v.gc+=d,v.bc+=u,v.ac+=c,v.cnt++}else if(t==="rgb444")for(let s=0;s>16&255,u=l>>8&255,d=l&255,m=x1(d,u,c),h=m in r?r[m]:r[m]=Lp();h.rc+=d,h.gc+=u,h.bc+=c,h.cnt++}else for(let s=0;s>16&255,u=l>>8&255,d=l&255,m=b1(d,u,c),h=m in r?r[m]:r[m]=Lp();h.rc+=d,h.gc+=u,h.bc+=c,h.cnt++}return r}function EP(e,t,n={}){let{format:r="rgb565",clearAlpha:i=!0,clearAlphaColor:s=0,clearAlphaThreshold:l=0,oneBitAlpha:c=!1}=n;if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array)&&!(e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");let u=new Uint32Array(e.buffer),d=n.useSqrt!==!1,m=r==="rgba4444",h=LP(u,r),v=h.length,T=v-1,w=new Uint32Array(v+1);for(var b=0,N=0;N1&&(G=F>>1,!(h[k=w[G]].err<=K));F=G)w[F]=k;w[F]=N}var q=b-t;for(N=0;N=z.mtm&&h[z.nn].mtm<=z.tm)break;z.mtm==T?R=w[1]=w[w[0]--]:(h1(h,R,!1),z.tm=N);var K=h[R].err;for(F=1;(G=F+F)<=w[0]&&(Gh[w[G+1]].err&&G++,!(K<=h[k=w[G]].err));F=G)w[F]=k;w[F]=R}var X=h[z.nn],ne=z.cnt,xe=X.cnt,x=1/(ne+xe);m&&(z.ac=x*(ne*z.ac+xe*X.ac)),z.rc=x*(ne*z.rc+xe*X.rc),z.gc=x*(ne*z.gc+xe*X.gc),z.bc=x*(ne*z.bc+xe*X.bc),z.cnt+=X.cnt,z.mtm=++N,h[X.bk].fw=X.fw,h[X.fw].bk=X.bk,X.mtm=T}let ae=[];var Ce=0;for(N=0;;++Ce){let ge=qa(Math.round(h[N].rc),0,255),Se=qa(Math.round(h[N].gc),0,255),Me=qa(Math.round(h[N].bc),0,255),Pe=255;m&&(Pe=qa(Math.round(h[N].ac),0,255),c&&(Pe=Pe<=(typeof c=="number"?c:127)?0:255),i&&Pe<=l&&(ge=Se=Me=s,Pe=0));let be=m?[ge,Se,Me,Pe]:[ge,Se,Me];if(DP(ae,be)||ae.push(be),(N=h[N].fw)==0)break}return ae}function DP(e,t){for(let n=0;n=4&&t.length>=4?r[3]===t[3]:!0;if(i&&s)return!0}return!1}function Ya(e,t){var n=0,r;for(r=0;r1?Math.round(e/t)*t:e}function OP(e,{roundRGB:t=5,roundAlpha:n=10,oneBitAlpha:r=null}={}){let i=new Uint32Array(e.buffer);for(let s=0;s>24&255,u=l>>16&255,d=l>>8&255,m=l&255;c=Ka(c,n),r&&(c=c<=(typeof r=="number"?r:127)?0:255),m=Ka(m,t),d=Ka(d,t),u=Ka(u,t),i[s]=c<<24|u<<16|d<<8|m<<0}}function _P(e,t,n="rgb565"){if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array)&&!(e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");if(t.length>256)throw new Error("applyPalette() only works with 256 colors or less");let r=new Uint32Array(e.buffer),i=r.length,s=n==="rgb444"?4096:65536,l=new Uint8Array(i),c=new Array(s),u=n==="rgba4444";if(n==="rgba4444")for(let d=0;d>24&255,v=m>>16&255,T=m>>8&255,w=m&255,b=T1(w,T,v,h),x=b in c?c[b]:c[b]=BP(w,T,v,h,t);l[d]=x}else{let d=n==="rgb444"?x1:b1;for(let m=0;m>16&255,T=h>>8&255,w=h&255,b=d(w,T,v),x=b in c?c[b]:c[b]=FP(w,T,v,t);l[m]=x}}return l}function BP(e,t,n,r,i){let s=0,l=1e100;for(let c=0;cl)continue;let h=u[0];if(m+=Mr(h-e),m>l)continue;let v=u[1];if(m+=Mr(v-t),m>l)continue;let T=u[2];m+=Mr(T-n),!(m>l)&&(l=m,s=c)}return s}function FP(e,t,n,r){let i=0,s=1e100;for(let l=0;ls)continue;let m=c[1];if(d+=Mr(m-t),d>s)continue;let h=c[2];d+=Mr(h-n),!(d>s)&&(s=d,i=l)}return i}function UP(e,t,n=5){if(!e.length||!t.length)return;let r=e.map(l=>l.slice(0,3)),i=n*n,s=e[0].length;for(let l=0;ls?c=c.slice(0,3):c=c.slice();let u=M1(r,c.slice(0,3),Ya),d=u[0],m=u[1];m>0&&m<=i&&(e[d]=c)}}function Mr(e){return e*e}function w1(e,t,n=Ya){let r=1/0,i=-1;for(let s=0;s=0&&zP(r,k)}let q=Math.round(x/10);GP(r,G,q,w,b);let z=Boolean(N)&&!K;jP(r,h,v,z?N:null),z&&y1(r,N),WP(r,m,h,v,F,s,l,c)}};function d(){I1(r,"GIF89a")}}function GP(e,t,n,r,i){e.writeByte(33),e.writeByte(249),e.writeByte(4),i<0&&(i=0,r=!1);var s,l;r?(s=1,l=2):(s=0,l=0),t>=0&&(l=t&7),l<<=2;let c=0;e.writeByte(0|l|c|s),zo(e,n),e.writeByte(i||0),e.writeByte(0)}function HP(e,t,n,r,i=8){let c=Ep(r.length)-1,u=1<<7|i-1<<4|0<<3|c,d=0,m=0;zo(e,t),zo(e,n),e.writeBytes([u,d,m])}function zP(e,t){e.writeByte(33),e.writeByte(255),e.writeByte(11),I1(e,"NETSCAPE2.0"),e.writeByte(3),e.writeByte(1),zo(e,t),e.writeByte(0)}function y1(e,t){let n=1<>8&255)}function I1(e,t){for(var n=0;ni.localName===e);return n?Object.values(n).find(i=>typeof i=="function")?.():void 0}var ai,KP,Pr,ps,A1,ds,jo,Za,YP,ZP,_p,Bp,Xa,Ye,Fp,C1=g(()=>{"use strict";a();Xn();$();P();Wa();It();Zt();Je();M();j();I();ai=zs(Op()),KP=0,Pr=Ie("StickersStore"),ps=Ie("UserSettingsProtoStore"),A1=A("BINARY_READ_OPTIONS");ds=Qe(()=>Ci.PreloadedUserSettingsActionCreators),jo=Qe(()=>N1("appearance",ds.ProtoClass)),Za=Qe(()=>N1("clientThemeSettings",jo)),YP=1n<<18n,ZP=1n<<37n,_p=/\/emojis\/(\d+?)\.(png|webp|gif)/,Bp=/\/stickers\/(\d+?)\./,Xa=/\/attachments\/\d+?\/\d+?\/(\d+?)\.gif/,Ye=D({enableEmojiBypass:{description:"Allow sending fake emojis",type:3,default:!0,restartNeeded:!0},emojiSize:{description:"Size of the emojis when sending",type:5,default:48,markers:[32,48,64,128,160,256,512]},transformEmojis:{description:"Whether to transform fake emojis into real ones",type:3,default:!0,restartNeeded:!0},enableStickerBypass:{description:"Allow sending fake stickers",type:3,default:!0,restartNeeded:!0},stickerSize:{description:"Size of the stickers when sending",type:5,default:160,markers:[32,64,128,160,256,512]},transformStickers:{description:"Whether to transform fake stickers into real ones",type:3,default:!0,restartNeeded:!0},transformCompoundSentence:{description:"Whether to transform fake stickers and emojis in compound sentences (sentences with more content than just the fake emoji or sticker link)",type:3,default:!1},enableStreamQualityBypass:{description:"Allow streaming in nitro quality",type:3,default:!0,restartNeeded:!0}}),Fp=y({name:"FakeNitro",authors:[p.Arjix,p.D3SOX,p.Ven,p.obscurity,p.captain,p.Nuckyz,p.AutumnVN],description:"Allows you to stream in nitro quality, send fake emojis/stickers and use client themes.",dependencies:["MessageEventsAPI"],settings:Ye,patches:[{find:".PREMIUM_LOCKED;",predicate:()=>Ye.store.enableEmojiBypass,replacement:[{match:/(?<=,intention:(\i).+?;)/,replace:(e,t)=>`let fakeNitroIntention=${t};`},{match:/\.(?:canUseEmojisEverywhere|canUseAnimatedEmojis)\(\i(?=\))/g,replace:'$&,typeof fakeNitroIntention!=="undefined"?fakeNitroIntention:void 0'},{match:/(&&!\i&&)!(\i)(?=\)return \i\.\i\.DISALLOW_EXTERNAL;)/,replace:(e,t,n)=>`${t}(!${n}&&(typeof fakeNitroIntention==="undefined"||![${3},${4}].includes(fakeNitroIntention)))`},{match:/if\(!\i\.available/,replace:e=>`${e}&&(typeof fakeNitroIntention==="undefined"||![${3},${4}].includes(fakeNitroIntention))`}]},{find:"canUseAnimatedEmojis:function",predicate:()=>Ye.store.enableEmojiBypass,replacement:{match:/((?:canUseEmojisEverywhere|canUseAnimatedEmojis):function\(\i)\){(.+?\))(?=})/g,replace:(e,t,n)=>`${t},fakeNitroIntention){${n}||fakeNitroIntention==null||[${3},${4}].includes(fakeNitroIntention)`}},{find:"canUseCustomStickersEverywhere:function",predicate:()=>Ye.store.enableStickerBypass,replacement:{match:/canUseCustomStickersEverywhere:function\(\i\){/,replace:"$&return true;"}},{find:'"SENDABLE"',predicate:()=>Ye.store.enableStickerBypass,replacement:{match:/(\w+)\.available\?/,replace:"true?"}},{find:"canUseHighVideoUploadQuality:function",predicate:()=>Ye.store.enableStreamQualityBypass,replacement:["canUseHighVideoUploadQuality","canStreamQuality"].map(e=>({match:new RegExp(`${e}:function\\(\\i(?:,\\i)?\\){`,"g"),replace:"$&return true;"}))},{find:"STREAM_FPS_OPTION.format",predicate:()=>Ye.store.enableStreamQualityBypass,replacement:{match:/guildPremiumTier:\i\.\i\.TIER_\d,?/g,replace:""}},{find:"canUseClientThemes:function",replacement:{match:/canUseClientThemes:function\(\i\){/,replace:"$&return true;"}},{find:'.displayName="UserSettingsProtoStore"',replacement:[{match:/CONNECTION_OPEN:function\((\i)\){/,replace:(e,t)=>`${e}$self.handleProtoChange(${t}.userSettingsProto,${t}.user);`},{match:/let{settings:/,replace:"arguments[0].local||$self.handleProtoChange(arguments[0].settings.proto);$&"}]},{find:",updateTheme(",replacement:{match:/(function \i\(\i\){let{backgroundGradientPresetId:(\i).+?)(\i\.\i\.updateAsync.+?theme=(.+?),.+?},\i\))/,replace:(e,t,n,r,i)=>`${t}$self.handleGradientThemeSelect(${n},${i},()=>${r});`}},{find:'["strong","em","u","text","inlineCode","s","spoiler"]',replacement:[{predicate:()=>Ye.store.transformEmojis,match:/1!==(\i)\.length\|\|1!==\i\.length/,replace:(e,t)=>`${e}||$self.shouldKeepEmojiLink(${t}[0])`},{predicate:()=>Ye.store.transformEmojis||Ye.store.transformStickers,match:/(?=return{hasSpoilerEmbeds:\i,content:(\i)})/,replace:(e,t)=>`${t}=$self.patchFakeNitroEmojisOrRemoveStickersLinks(${t},arguments[2]?.formatInline);`}]},{find:"renderEmbeds(",replacement:[{predicate:()=>Ye.store.transformEmojis||Ye.store.transformStickers,match:/(renderEmbeds\((\i)\){)(.+?embeds\.map\((\i)=>{)/,replace:(e,t,n,r,i)=>`${t}const fakeNitroMessage=${n};${r}if($self.shouldIgnoreEmbed(${i},fakeNitroMessage))return null;`},{predicate:()=>Ye.store.transformStickers,match:/(?<=renderStickersAccessories\((\i)\){let (\i)=\(0,\i\.\i\)\(\i\).+?;)/,replace:(e,t,n)=>`${n}=$self.patchFakeNitroStickers(${n},${t});`},{predicate:()=>Ye.store.transformStickers,match:/renderAttachments\(\i\){let{attachments:(\i).+?;/,replace:(e,t)=>`${e}${t}=$self.filterAttachments(${t});`}]},{find:".Messages.STICKER_POPOUT_UNJOINED_PRIVATE_GUILD_DESCRIPTION.format",predicate:()=>Ye.store.transformStickers,replacement:[{match:/let{renderableSticker:(\i).{0,250}isGuildSticker.+?channel:\i,/,replace:(e,t)=>`${e}fakeNitroRenderableSticker:${t},`},{match:/(let \i,{sticker:\i,channel:\i,closePopout:\i.+?}=(\i).+?;)(.+?description:)(\i)(?=,sticker:\i)/,replace:(e,t,n,r,i)=>`${t}let{fakeNitroRenderableSticker}=${n};${r}$self.addFakeNotice(${0},${i},!!fakeNitroRenderableSticker?.fake)`}]},{find:".EMOJI_UPSELL_POPOUT_MORE_EMOJIS_OPENED,",predicate:()=>Ye.store.transformEmojis,replacement:{match:/isDiscoverable:\i,shouldHideRoleSubscriptionCTA:\i,(?<={node:(\i),.+?)/,replace:(e,t)=>`${e}fakeNitroNode:${t},`}},{find:".Messages.EMOJI_POPOUT_UNJOINED_DISCOVERABLE_GUILD_DESCRIPTION",predicate:()=>Ye.store.transformEmojis,replacement:{match:/(?<=isDiscoverable:\i,emojiComesFromCurrentGuild:\i,.+?}=(\i).+?;)(.+?return )(.{0,1000}\.Messages\.EMOJI_POPOUT_UNJOINED_DISCOVERABLE_GUILD_DESCRIPTION.+?)(?=},)/,replace:(e,t,n,r)=>`let{fakeNitroNode}=${t};${n}$self.addFakeNotice(${1},${r},!!fakeNitroNode?.fake)`}},{find:"canUsePremiumAppIcons:function",replacement:{match:/canUsePremiumAppIcons:function\(\i\){/,replace:"$&return true;"}},{find:'location:"AppIconHome"',replacement:{match:/\i\.\i\.isPremium\(\i\.\i\.getCurrentUser\(\)\)/,replace:"true"}}],get guildId(){return Pu()?.id},get canUseEmotes(){return(W.getCurrentUser().premiumType??0)>0},get canUseStickers(){return(W.getCurrentUser().premiumType??0)>1},handleProtoChange(e,t){if(e==null||typeof e=="string"||!ps||!ds||!jo||!Za)return;if((t?.premium_type??W?.getCurrentUser()?.premiumType??0)!==2){if(e.appearance??=jo.create(),ps.settings.appearance?.theme!=null){let r=jo.create({theme:ps.settings.appearance.theme});e.appearance.theme=r.theme}if(ps.settings.appearance?.clientThemeSettings?.backgroundGradientPresetId?.value!=null){let r=Za.create({backgroundGradientPresetId:{value:ps.settings.appearance.clientThemeSettings.backgroundGradientPresetId.value}});e.appearance.clientThemeSettings??=r,e.appearance.clientThemeSettings.backgroundGradientPresetId=r.backgroundGradientPresetId}}},handleGradientThemeSelect(e,t,n){if((W?.getCurrentUser()?.premiumType??0)===2||e==null)return n();if(!ds||!jo||!Za||!A1)return;let i=ds.getCurrentValue().appearance,s=i!=null?jo.fromBinary(jo.toBinary(i),A1.BINARY_READ_OPTIONS):jo.create();s.theme=t;let l=Za.create({backgroundGradientPresetId:{value:e}});s.clientThemeSettings??=l,s.clientThemeSettings.backgroundGradientPresetId=l.backgroundGradientPresetId;let c=ds.ProtoClass.create();c.appearance=s,B.dispatch({type:"USER_SETTINGS_PROTO_UPDATE",local:!0,partial:!0,settings:{type:1,proto:c}})},trimContent(e){let t=e[0];typeof t=="string"&&(e[0]=t.trimStart()),e[0]===""&&e.shift();let n=e.length-1,r=e[n];typeof r=="string"&&(e[n]=r.trimEnd()),e[n]===""&&e.pop()},clearEmptyArrayItems(e){return e.filter(t=>t!=null)},ensureChildrenIsArray(e){Array.isArray(e.props.children)||(e.props.children=[e.props.children])},patchFakeNitroEmojisOrRemoveStickersLinks(e,t){if((e.length>1||typeof e[0]?.type=="string")&&!Ye.store.transformCompoundSentence)return e;let n=e.length,r=c=>{if(Ye.store.transformEmojis){let u=c.props.href.match(_p);if(u){let d=null;try{d=new URL(c.props.href)}catch{}let m=kn.getCustomEmojiById(u[1])?.name??d?.searchParams.get("name")??"FakeNitroEmoji";return $e.defaultRules.customEmoji.react({jumboable:!t&&e.length===1&&typeof e[0].type!="string",animated:u[2]==="gif",emojiId:u[1],name:m,fake:!0},void 0,{key:String(n++)})}}if(Ye.store.transformStickers){if(Bp.test(c.props.href))return null;let u=c.props.href.match(Xa);if(u&&Pr.getStickerById(u[1]))return null}return c},i=c=>c?.props?.trusted!=null?r(c):c?.props?.children!=null?Array.isArray(c.props.children)?(c.props.children=l(c.props.children),c.props.children.length===0?null:c):(c.props.children=s(c.props.children),c):c,s=c=>{let u=i(c);if(u?.type==="ul"||u?.type==="ol"){if(this.ensureChildrenIsArray(u),u.props.children.length===0)return null;let d=!1;for(let[m,h]of u.props.children.entries()){if(h==null){delete u.props.children[m];continue}this.ensureChildrenIsArray(h),h.props.children.length>0?d=!0:delete u.props.children[m]}if(!d)return null;u.props.children=this.clearEmptyArrayItems(u.props.children)}return u},l=c=>{for(let[u,d]of c.entries())c[u]=s(d);return c=this.clearEmptyArrayItems(c),this.trimContent(c),c};try{return l(cr.cloneDeep(e))}catch(c){return new ie("FakeNitro").error(c),e}},patchFakeNitroStickers(e,t){let n=[],r=t.content.split(/\s/);Ye.store.transformCompoundSentence?n.push(...r):r.length===1&&n.push(r[0]),n.push(...t.attachments.filter(i=>i.content_type==="image/gif").map(i=>i.url));for(let i of n){if(!Ye.store.transformCompoundSentence&&!i.startsWith("http"))continue;let s=i.match(Bp);if(s){let c=null;try{c=new URL(i)}catch{}let u=Pr.getStickerById(s[1])?.name??c?.searchParams.get("name")??"FakeNitroSticker";e.push({format_type:1,id:s[1],name:u,fake:!0});continue}let l=i.match(Xa);if(l){if(!Pr.getStickerById(l[1]))continue;let c=Pr.getStickerById(l[1])?.name??"FakeNitroSticker";e.push({format_type:2,id:l[1],name:c,fake:!0})}}return e},shouldIgnoreEmbed(e,t){let n=t.content.split(/\s/);if(n.length>1&&!Ye.store.transformCompoundSentence)return!1;switch(e.type){case"image":{if(!Ye.store.transformCompoundSentence&&!n.includes(e.url)&&!n.includes(e.image?.proxyURL))return!1;if(Ye.store.transformEmojis&&_p.test(e.url))return!0;if(Ye.store.transformStickers){if(Bp.test(e.url))return!0;let r=e.url.match(Xa);if(r&&Pr.getStickerById(r[1]))return!0}break}}return!1},filterAttachments(e){return e.filter(t=>{if(t.content_type!=="image/gif")return!0;let n=t.url.match(Xa);return!(n&&Pr.getStickerById(n[1]))})},shouldKeepEmojiLink(e){return e.target&&_p.test(e.target)},addFakeNotice(e,t,n){if(!n)return t;switch(t=Array.isArray(t)?t:[t],e){case 0:return t.push(" This is a FakeNitro sticker and renders like a real sticker only for you. Appears as a link to non-plugin users."),t;case 1:return t.push(" This is a FakeNitro emoji and renders like a real emoji only for you. Appears as a link to non-plugin users."),t}},hasPermissionToUseExternalEmojis(e){let t=Q.getChannel(e);return!t||t.isDM()||t.isGroupDM()||t.isMultiUserDM()?!0:Re.can(YP,t)},hasPermissionToUseExternalStickers(e){let t=Q.getChannel(e);return!t||t.isDM()||t.isGroupDM()||t.isMultiUserDM()?!0:Re.can(ZP,t)},getStickerLink(e){return`https://media.discordapp.net/stickers/${e}.png?size=${L.plugins.FakeNitro.stickerSize}`},async sendAnimatedSticker(e,t,n){let{parseURL:r}=p1(),{frames:i,width:s,height:l}=await r(e),c=(0,ai.GIFEncoder)(),u=L.plugins.FakeNitro.stickerSize,d=document.createElement("canvas");d.width=u,d.height=u;let m=d.getContext("2d",{willReadFrequently:!0}),h=u/Math.max(s,l);m.scale(h,h);let v;for(let w of i){let{left:b,top:x,width:N,height:k,img:F,delay:G,blendOp:K,disposeOp:q}=w;v=m.getImageData(b,x,N,k),K===0&&m.clearRect(b,x,N,k),m.drawImage(F,b,x,N,k);let{data:z}=m.getImageData(0,0,u,u),R=(0,ai.quantize)(z,256),X=(0,ai.applyPalette)(z,R);c.writeFrame(X,u,u,{transparent:!0,palette:R,delay:G}),q===1?m.clearRect(b,x,N,k):q===2&&m.putImageData(v,b,x)}c.finish();let T=new File([c.bytesView()],`${t}.gif`,{type:"image/gif"});Li.promptToUpload([T],Q.getChannel(n),KP)},start(){let e=Ye.store;if(!e.enableEmojiBypass&&!e.enableStickerBypass)return;function t(n,r){return!n[r]||/\s/.test(n[r])?"":" "}this.preSend=jt((n,r,i)=>{let{guildId:s}=this;e:{if(!e.enableStickerBypass)break e;let l=Pr.getStickerById(i.stickers?.[0]);if(!l||"pack_id"in l)break e;let c=this.canUseStickers&&this.hasPermissionToUseExternalStickers(n);if(l.available!==!1&&(c||l.guild_id===s))break e;let u=this.getStickerLink(l.id);if(l.format_type===2)return this.sendAnimatedSticker(u,l.id,n),{cancel:!0};i.stickers.length=0,r.content+=` ${u}&name=${encodeURIComponent(l.name)}`}if(e.enableEmojiBypass){let l=this.canUseEmotes&&this.hasPermissionToUseExternalEmojis(n);for(let c of r.validNonShortcutEmojis){if(!c.require_colons||c.available!==!1&&l||c.guildId===s&&!c.animated)continue;let u=`<${c.animated?"a":""}:${c.originalName||c.name}:${c.id}>`,d=c.url.replace(/\?size=\d+/,"?"+new URLSearchParams({size:L.plugins.FakeNitro.emojiSize,name:encodeURIComponent(c.name)}));r.content=r.content.replace(u,(m,h,v)=>`${t(v,h-1)}${d}${t(v,h+m.length)}`)}}return{cancel:!1}}),this.preEdit=br((n,r,i)=>{if(!e.enableEmojiBypass)return;let s=this.canUseEmotes&&this.hasPermissionToUseExternalEmojis(n),{guildId:l}=this;i.content=i.content.replace(/(?/ig,(c,u,d,m)=>{let h=kn.getCustomEmojiById(u);if(h==null||!h.require_colons||h.available!==!1&&s||h.guildId===l&&!h.animated)return c;let v=h.url.replace(/\?size=\d+/,"?"+new URLSearchParams({size:L.plugins.FakeNitro.emojiSize,name:encodeURIComponent(h.name)}));return`${t(m,d-1)}${v}${t(m,d+c.length)}`})})},stop(){Wt(this.preSend),Tr(this.preEdit)}})});function k1(...e){let t={};function n(i){for(let s=e.length-1;s>=0;s--)if(i in e[s])return e[s];return t}let r={ownKeys(){return e.reduce((i,s)=>(i.push(...Reflect.ownKeys(s)),i),Reflect.ownKeys(t))}};for(let i of["defineProperty","deleteProperty","get","getOwnPropertyDescriptor","has","set"])r[i]=function(s,...l){return Reflect[i](n(l[0]),...l)};return new Proxy(t,r)}var R1,L1=g(()=>{"use strict";a();R1=k1;typeof module<"u"&&(module.exports=k1)});function XP(e,t){let n=`[#${e.toString(16).padStart(6,"0")},#${t.toString(16).padStart(6,"0")}]`,r="",i=Array.from(n).map(s=>s.codePointAt(0)).filter(s=>s>=32&&s<=127).map(s=>String.fromCodePoint(s+917504)).join("");return(r||"")+" "+i}function JP(e){if(e==null)return null;let t=e.match(/\u{e005b}\u{e0023}([\u{e0061}-\u{e0066}\u{e0041}-\u{e0046}\u{e0030}-\u{e0039}]+?)\u{e002c}\u{e0023}([\u{e0061}-\u{e0066}\u{e0041}-\u{e0046}\u{e0030}-\u{e0039}]+?)\u{e005d}/u);if(t!=null){let n=[...t[0]].map(i=>String.fromCodePoint(i.codePointAt(0)-917504)).join("");return n.substring(1,n.length-1).split(",").map(i=>parseInt(i.replace("#","0x"),16))}else return null}var E1,Up,D1=g(()=>{"use strict";a();$();le();P();ct();Be();M();I();L1();E1=D({nitroFirst:{description:"Default color source if both are present",type:4,options:[{label:"Nitro colors",value:!0,default:!0},{label:"Fake colors",value:!1}]}}),Up=y({name:"FakeProfileThemes",description:"Allows profile theming by hiding the colors in your bio thanks to invisible 3y3 encoding",authors:[p.Alyxia,p.Remty],patches:[{find:"UserProfileStore",replacement:{match:/(?<=getUserProfile\(\i\){return )(\i\[\i\])/,replace:"$self.colorDecodeHook($1)"}},{find:".USER_SETTINGS_PROFILE_THEME_ACCENT",replacement:{match:/RESET_PROFILE_THEME}\)(?<=color:(\i),.{0,500}?color:(\i),.{0,500}?)/,replace:"$&,$self.addCopy3y3Button({primary:$1,accent:$2})"}}],settingsAboutComponent:()=>o(S.FormSection,null,o(S.FormTitle,{tag:"h3"},"Usage"),o(S.FormText,null,"After enabling this plugin, you will see custom colors in the profiles of other people using compatible plugins. ",o("br",null),"To set your own colors:",o("ul",null,o("li",null,"\u2022 go to your profile settings"),o("li",null,"\u2022 choose your own colors in the Nitro preview"),o("li",null,'\u2022 click the "Copy 3y3" button'),o("li",null,"\u2022 paste the invisible text anywhere in your bio")),o("br",null),o("b",null,"Please note:")," if you are using a theme which hides nitro ads, you should disable it temporarily to set colors.")),settings:E1,colorDecodeHook(e){if(e){if(E1.store.nitroFirst&&e.themeColors)return e;let t=JP(e.bio);if(t)return R1(e,{premiumType:2,themeColors:t})}return e},addCopy3y3Button:_.wrap(function({primary:e,accent:t}){return o(E,{onClick:()=>{let n=XP(e,t);vn(n)},color:E.Colors.PRIMARY,size:E.Sizes.XLARGE,className:Y.left16},"Copy 3y3")},{noop:!0})})});var $p,O1=g(()=>{"use strict";a();P();M();I();$p=y({name:"FavoriteEmojiFirst",authors:[p.Aria,p.Ven],description:"Puts your favorite emoji first in the emoji autocomplete.",patches:[{find:"renderResults({results:",replacement:[{match:/let \i=.{1,100}renderResults\({results:(\i)\.query\.results,/,replace:"$self.sortEmojis($1);$&"}]},{find:"MAX_AUTOCOMPLETE_RESULTS+",replacement:[{match:/,maxCount:(\i)(.{1,500}\i)=(\i)\.slice\(0,(\i-\i\.length)\)/,replace:",maxCount:Infinity$2=($3.sliceTo = $4, $3)"}]}],sortEmojis({query:e}){if(e?.type!=="EMOJIS_AND_STICKERS"||e.typeInfo?.sentinel!==":"||!e.results?.emojis?.length)return;let t=kn.getDisambiguatedEmojiContext();e.results.emojis=e.results.emojis.sort((n,r)=>{let i=t.isFavoriteEmojiWithoutFetchingLatest(n),s=t.isFavoriteEmojiWithoutFetchingLatest(r);return i&&!s?-1:!i&&s?1:0}).slice(0,e.results.emojis.sliceTo??10)}})});function VP({instance:e,SearchBarComponent:t}){let[n,r]=J(""),i=Jt(null),s=ta(l=>{r(l);let{props:c}=e;if(l===""){c.favorites=c.favCopy,e.forceUpdate();return}i.current?.containerRef?.current.closest("#gif-picker-tab-panel")?.querySelector('[class|="content"]')?.firstElementChild?.scrollTo(0,0);let u=c.favCopy.map(d=>({score:eI(l.toLowerCase(),B1(d.url??d.src).replace(/(%20|[_-])/g," ").toLowerCase()),gif:d})).filter(d=>d.score!=null);u.sort((d,m)=>m.score-d.score),c.favorites=u.map(d=>d.gif),e.forceUpdate()},[e.state]);return _e(()=>()=>{e.dead=!0},[]),o(t,{ref:i,autoFocus:!0,className:QP.searchBar,size:t.Sizes.MEDIUM,onChange:s,onClear:()=>{r(""),e.props.favCopy!=null&&(e.props.favorites=e.props.favCopy,e.forceUpdate())},query:n,placeholder:"Search Favorite Gifs"})}function B1(e){let t=new URL(e);switch(_1.store.searchOption){case"url":return t.href;case"path":return t.host==="media.discordapp.net"||t.host==="tenor.com"?t.pathname.split("/").at(-1)??t.pathname:t.pathname;case"hostandpath":return t.host==="media.discordapp.net"||t.host==="tenor.com"?`${t.host} ${t.pathname.split("/").at(-1)??t.pathname}`:`${t.host} ${t.pathname}`;default:return""}}function eI(e,t){let n=0,r=0;for(let i=0;i{"use strict";a();$();le();P();M();j();I();QP=A("searchBar","searchBarFullRow"),_1=D({searchOption:{type:4,description:"The part of the url you want to search",options:[{label:"Entire Url",value:"url"},{label:"Path Only (/somegif.gif)",value:"path"},{label:"Host & Path (tenor.com somgif.gif)",value:"hostandpath",default:!0}]}}),Gp=y({name:"FavoriteGifSearch",authors:[p.Aria],description:"Adds a search bar to favorite gifs.",patches:[{find:"renderHeaderContent()",replacement:[{match:/(renderHeaderContent\(\).{1,150}FAVORITES:return)(.{1,150});(case.{1,200}default:return\(0,\i\.jsx\)\((?\i\..{1,10}),)/,replace:"$1 this.state.resultType === 'Favorites' ? $self.renderSearchBar(this, $) : $2;$3"},{match:/(,suggestions:\i,favorites:)(\i),/,replace:"$1$self.getFav($2),favCopy:$2,"}]}],settings:_1,getTargetString:B1,instance:null,renderSearchBar(e,t){return this.instance=e,o(_,{noop:!0},o(VP,{instance:e,SearchBarComponent:t}))},getFav(e){if(!this.instance||this.instance.dead)return e;let{favorites:t}=this.instance.props;return t!=null&&t?.length!==e.length?t:e}})});var Hp,U1=g(()=>{"use strict";a();$();Ra();P();M();Hp=y({name:"FixSpotifyEmbeds",description:"Fixes spotify embeds being incredibly loud by letting you customise the volume",authors:[p.Ven],settings:D({volume:{type:5,description:"The volume % to set for spotify embeds. Anything above 10% is veeeery loud",markers:Go(0,100,10),stickToMarkers:!1,default:10}})})});var zp,$1=g(()=>{"use strict";a();P();M();I();zp=y({name:"ForceOwnerCrown",description:"Force the owner crown next to usernames even if the server is large.",authors:[p.D3SOX,p.Nickyux],patches:[{find:"AVATAR_DECORATION_PADDING:",replacement:{match:/,isOwner:(\i),/,replace:",_isOwner:$1=$self.isGuildOwner(e),"}}],isGuildOwner(e){if(!e?.user?.id||e.channel?.type===3)return e.isOwner;let t=e.guildId??e.channel?.guild_id,n=e.user.id;return we.getGuild(t)?.ownerId===n}})});var Ja,tI,jp,G1=g(()=>{"use strict";a();tn();P();M();j();I();Ja=A("createFriendInvite"),tI=A("v4","v1"),jp=y({name:"FriendInvites",description:"Create and manage friend invite links via slash commands (/create friend invite, /view friend invites, /revoke friend invites).",authors:[p.afn,p.Dziurwa],dependencies:["CommandsAPI"],commands:[{name:"create friend invite",description:"Generates a friend invite link.",inputType:3,options:[{name:"Uses",description:"How many uses?",choices:[{label:"1",name:"1",value:"1"},{label:"5",name:"5",value:"5"}],required:!1,type:4}],execute:async(e,t)=>{let n=rt(e,"Uses",5);if(n===1&&!W.getCurrentUser().phone)return pe(t.channel.id,{content:"You need to have a phone number connected to your account to create a friend invite with 1 use!"});let r;if(n===1){let i=tI.v4(),{body:{invite_suggestions:s}}=await wt.post({url:"/friend-finder/find-friends",body:{modified_contacts:{[i]:[1,"",""]},phone_contact_methods_count:1}});r=await Ja.createFriendInvite({code:s[0][3],recipient_phone_number_or_email:i,contact_visibility:1,filter_visibilities:[],filtered_invite_suggestions_index:1})}else r=await Ja.createFriendInvite();pe(t.channel.id,{content:` discord.gg/${r.code} \xB7 Expires: \xB7 Max uses: \`${r.max_uses}\` - `.trim().replace(/\s+/g," ")})}},{name:"view friend invites",description:"View a list of all generated friend invites.",inputType:3,execute:async(e,t)=>{let r=(await Za.getAllFriendInvites()).map(i=>` + `.trim().replace(/\s+/g," ")})}},{name:"view friend invites",description:"View a list of all generated friend invites.",inputType:3,execute:async(e,t)=>{let r=(await Ja.getAllFriendInvites()).map(i=>` _discord.gg/${i.code}_ \xB7 Expires: \xB7 Times used: \`${i.uses}/${i.max_uses}\` - `.trim().replace(/\s+/g," "));ue(t.channel.id,{content:r.join(` -`)||"You have no active friend invites!"})}},{name:"revoke friend invites",description:"Revokes all generated friend invites.",inputType:3,execute:async(e,t)=>{await Za.revokeFriendInvites(),ue(t.channel.id,{content:"All friend invites have been revoked."})}}]})});var qp,X1=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/gameActivityToggle/style.css",{name:"src/plugins/gameActivityToggle/style.css",source:`[class*="withTagAsButton"] { + `.trim().replace(/\s+/g," "));pe(t.channel.id,{content:r.join(` +`)||"You have no active friend invites!"})}},{name:"revoke friend invites",description:"Revokes all generated friend invites.",inputType:3,execute:async(e,t)=>{await Ja.revokeFriendInvites(),pe(t.channel.id,{content:"All friend invites have been revoked."})}}]})});var Wp,H1=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/gameActivityToggle/style.css",{name:"src/plugins/gameActivityToggle/style.css",source:`[class*="withTagAsButton"] { min-width: 88px !important; } -`,classNames:{},dom:null});qp="src/plugins/gameActivityToggle/style.css"});function vI(e){return function(){return o("svg",{width:"20",height:"20",viewBox:"0 0 24 24"},o("path",{fill:"currentColor",mask:"url(#gameActivityMask)",d:"M3.06 20.4q-1.53 0-2.37-1.065T.06 16.74l1.26-9q.27-1.8 1.605-2.97T6.06 3.6h11.88q1.8 0 3.135 1.17t1.605 2.97l1.26 9q.21 1.53-.63 2.595T20.94 20.4q-.63 0-1.17-.225T18.78 19.5l-2.7-2.7H7.92l-2.7 2.7q-.45.45-.99.675t-1.17.225Zm14.94-7.2q.51 0 .855-.345T19.2 12q0-.51-.345-.855T18 10.8q-.51 0-.855.345T16.8 12q0 .51.345 .855T18 13.2Zm-2.4-3.6q.51 0 .855-.345T16.8 8.4q0-.51-.345-.855T15.6 7.2q-.51 0-.855.345T14.4 8.4q0 .51.345 .855T15.6 9.6ZM6.9 13.2h1.8v-2.1h2.1v-1.8h-2.1v-2.1h-1.8v2.1h-2.1v1.8h2.1v2.1Z"}),!e&&o(f,null,o("mask",{id:"gameActivityMask"},o("rect",{fill:"white",x:"0",y:"0",width:"24",height:"24"}),o("path",{fill:"black",d:"M23.27 4.54 19.46.73 .73 19.46 4.54 23.27 23.27 4.54Z"})),o("path",{fill:"var(--status-danger)",d:"M23 2.27 21.73 1 1 21.73 2.27 23 23 2.27Z"})))}}function SI(){let e=Fr.ShowCurrentGame.useSetting();return o(yI,{tooltipText:e?"Disable Game Activity":"Enable Game Activity",icon:vI(e),role:"switch","aria-checked":!e,onClick:()=>Fr.ShowCurrentGame.updateSetting(t=>!t)})}var yI,Kp,J1=g(()=>{"use strict";a();Je();le();P();w();j();A();X1();yI=Xe("Button.Sizes.NONE,disabled:");Kp=y({name:"GameActivityToggle",description:"Adds a button next to the mic and deafen button to toggle game activity.",authors:[d.Nuckyz,d.RuukuLada],patches:[{find:".Messages.ACCOUNT_SPEAKING_WHILE_MUTED",replacement:{match:/this\.renderNameZone\(\).+?children:\[/,replace:"$&$self.GameActivityToggleButton(),"}}],GameActivityToggleButton:_.wrap(SI,{noop:!0}),start(){St(qp)},stop(){Ft(qp)}})});var bI,Yp,Q1=g(()=>{"use strict";a();P();bt();w();j();({closeExpressionPicker:bI}=I("closeExpressionPicker")),Yp=y({name:"GifPaste",description:"Makes picking a gif in the gif picker insert a link into the chatbox instead of instantly sending it",authors:[d.Ven],patches:[{find:".handleSelectGIF=",replacement:{match:/\.handleSelectGIF=(\i)=>\{/,replace:".handleSelectGIF=$1=>{if (!this.props.className) return $self.handleSelect($1);"}}],handleSelect(e){e&&(so(e.url+" "),bI())}})});function e0(e,t,n){let r=Zp.getSendMessageOptionsForReply({channel:e,message:t,shouldMention:!0,showMentionToggle:!0});if(Xa.store.greetMode==="Message"||n.length>1){r.stickerIds=n;let i={content:"",tts:!1,invalidEmojis:[],validNonShortcutEmojis:[]};Zp._sendMessage(e.id,i,r)}else Zp.sendGreetMessage(e.id,n[0],r)}function TI({channel:e,message:t}){let n=Xa.use(["greetMode","multiGreetChoices"]),{greetMode:r,multiGreetChoices:i=[]}=n;return o(G.Menu,{navId:"greet-sticker-picker",onClose:()=>F.dispatch({type:"CONTEXT_MENU_CLOSE"}),"aria-label":"Greet Sticker Picker"},o(G.MenuGroup,{label:"Greet Mode"},Object.values(t0).map(s=>o(G.MenuRadioItem,{key:s,group:"greet-mode",id:"greet-mode-"+s,label:s,checked:s===r,action:()=>n.greetMode=s}))),o(G.MenuSeparator,null),o(G.MenuGroup,{label:"Greet Stickers"},V1.map(s=>o(G.MenuItem,{key:s.id,id:"greet-"+s.id,label:s.description.split(" ")[0],action:()=>e0(e,t,[s.id])}))),Xa.store.unholyMultiGreetEnabled?o(f,null,o(G.MenuSeparator,null),o(G.MenuItem,{label:"Unholy Multi-Greet",id:"unholy-multi-greet"},V1.map(s=>{let l=i.some(c=>c===s.id);return o(G.MenuCheckboxItem,{key:s.id,id:"multi-greet-"+s.id,label:s.description.split(" ")[0],checked:l,disabled:!l&&i.length>=3,action:()=>{n.multiGreetChoices=l?i.filter(c=>c!==s.id):[...i,s.id]}})}),o(G.MenuSeparator,null),o(G.MenuItem,{id:"multi-greet-submit",label:"Send Greets",action:()=>e0(e,t,i),disabled:i.length===0}))):null)}var t0,Xa,Zp,V1,Xp,n0=g(()=>{"use strict";a();$();P();w();j();A();t0=(n=>(n.Greet="Greet",n.NormalMessage="Message",n))(t0||{}),Xa=D({greetMode:{type:4,options:[{label:"Greet (you can only greet 3 times)",value:"Greet",default:!0},{label:"Normal Message (you can greet spam)",value:"Message"}],description:"Choose the greet mode"}}).withPrivateSettings(),Zp=I("sendGreetMessage"),{WELCOME_STICKERS:V1}=I("WELCOME_STICKERS");Xp=y({name:"GreetStickerPicker",description:"Allows you to use any greet sticker instead of only the random one by right-clicking the 'Wave to say hi!' button",authors:[d.Ven],settings:Xa,patches:[{find:"Messages.WELCOME_CTA_LABEL",replacement:{match:/innerClassName:\i\.welcomeCTAButton,(?<={channel:\i,message:\i}=(\i).{0,400}?)/,replace:"$&onContextMenu:(vcEvent)=>$self.pickSticker(vcEvent, $1),"}}],pickSticker(e,t){t.message.deleted||dn.openContextMenu(e,()=>o(TI,{...t}))}})});var Jp={};Be(Jp,{_buildPopoverElements:()=>wI,addButton:()=>Bn,buttons:()=>Ja,removeButton:()=>Fn});function Bn(e,t){Ja.set(e,t)}function Fn(e){Ja.delete(e)}function wI(e,t){let n=[];for(let[r,i]of Ja.entries())try{let s=i(e);s&&(s.key??=r,n.push(t(s)))}catch(s){xI.error(`[${r}]`,s)}return n}var xI,Ja,Ir=g(()=>{"use strict";a();Ze();xI=new ie("MessagePopover"),Ja=new Map});var gs,r0,hs,o0,MI,Qp,i0=g(()=>{"use strict";a();Wn();Ir();$t();P();w();A();r0="HideAttachments_HiddenIds",hs=new Set,o0=()=>It(r0).then(e=>(hs=e??new Set,hs)),MI=e=>Xt(r0,e),Qp=y({name:"HideAttachments",description:"Hide attachments and Embeds for individual messages via hover button",authors:[d.Ven],dependencies:["MessagePopoverAPI"],async start(){gs=document.createElement("style"),gs.id="VencordHideAttachments",document.head.appendChild(gs),await o0(),await this.buildCss(),Bn("HideAttachments",e=>{if(!e.attachments.length&&!e.embeds.length&&!e.stickerItems.length)return null;let t=hs.has(e.id);return{label:t?"Show Attachments":"Hide Attachments",icon:t?Aa:Na,message:e,channel:Q.getChannel(e.channel_id),onClick:()=>this.toggleHide(e.id)}})},stop(){gs.remove(),hs.clear(),Fn("HideAttachments")},async buildCss(){let e=[...hs].map(t=>`#message-accessories-${t}`).join(",");gs.textContent=` +`,classNames:{},dom:null});Wp="src/plugins/gameActivityToggle/style.css"});function oI(e){return function(){return o("svg",{width:"20",height:"20",viewBox:"0 0 24 24"},o("path",{fill:"currentColor",mask:"url(#gameActivityMask)",d:"M3.06 20.4q-1.53 0-2.37-1.065T.06 16.74l1.26-9q.27-1.8 1.605-2.97T6.06 3.6h11.88q1.8 0 3.135 1.17t1.605 2.97l1.26 9q.21 1.53-.63 2.595T20.94 20.4q-.63 0-1.17-.225T18.78 19.5l-2.7-2.7H7.92l-2.7 2.7q-.45.45-.99.675t-1.17.225Zm14.94-7.2q.51 0 .855-.345T19.2 12q0-.51-.345-.855T18 10.8q-.51 0-.855.345T16.8 12q0 .51.345 .855T18 13.2Zm-2.4-3.6q.51 0 .855-.345T16.8 8.4q0-.51-.345-.855T15.6 7.2q-.51 0-.855.345T14.4 8.4q0 .51.345 .855T15.6 9.6ZM6.9 13.2h1.8v-2.1h2.1v-1.8h-2.1v-2.1h-1.8v2.1h-2.1v1.8h2.1v2.1Z"}),!e&&o(f,null,o("mask",{id:"gameActivityMask"},o("rect",{fill:"white",x:"0",y:"0",width:"24",height:"24"}),o("path",{fill:"black",d:"M23.27 4.54 19.46.73 .73 19.46 4.54 23.27 23.27 4.54Z"})),o("path",{fill:"var(--status-danger)",d:"M23 2.27 21.73 1 1 21.73 2.27 23 23 2.27Z"})))}}function rI(){let e=Ur.ShowCurrentGame.useSetting();return o(nI,{tooltipText:e?"Disable Game Activity":"Enable Game Activity",icon:oI(e),role:"switch","aria-checked":!e,onClick:()=>Ur.ShowCurrentGame.updateSetting(t=>!t)})}var nI,qp,z1=g(()=>{"use strict";a();Ve();le();P();M();j();I();H1();nI=to("Button.Sizes.NONE,disabled:");qp=y({name:"GameActivityToggle",description:"Adds a button next to the mic and deafen button to toggle game activity.",authors:[p.Nuckyz,p.RuukuLada],patches:[{find:".Messages.ACCOUNT_SPEAKING_WHILE_MUTED",replacement:{match:/this\.renderNameZone\(\).+?children:\[/,replace:"$&$self.GameActivityToggleButton(),"}}],GameActivityToggleButton:_.wrap(rI,{noop:!0}),start(){St(Wp)},stop(){$t(Wp)}})});var iI,Kp,j1=g(()=>{"use strict";a();P();It();M();j();iI=fn('name:"expression-picker-last-active-view"',{close:ce.byCode("activeView:null","setState")}),Kp=y({name:"GifPaste",description:"Makes picking a gif in the gif picker insert a link into the chatbox instead of instantly sending it",authors:[p.Ven],patches:[{find:".handleSelectGIF=",replacement:{match:/\.handleSelectGIF=(\i)=>\{/,replace:".handleSelectGIF=$1=>{if (!this.props.className) return $self.handleSelect($1);"}}],handleSelect(e){e&&(uo(e.url+" "),iI.close())}})});function q1(e,t,n){let r=Yp.getSendMessageOptionsForReply({channel:e,message:t,shouldMention:!0,showMentionToggle:!0});if(Qa.store.greetMode==="Message"||n.length>1){r.stickerIds=n;let i={content:"",tts:!1,invalidEmojis:[],validNonShortcutEmojis:[]};Yp._sendMessage(e.id,i,r)}else Yp.sendGreetMessage(e.id,n[0],r)}function sI({channel:e,message:t}){let n=Qa.use(["greetMode","multiGreetChoices"]),{greetMode:r,multiGreetChoices:i=[]}=n;return o(U.Menu,{navId:"greet-sticker-picker",onClose:()=>B.dispatch({type:"CONTEXT_MENU_CLOSE"}),"aria-label":"Greet Sticker Picker"},o(U.MenuGroup,{label:"Greet Mode"},Object.values(K1).map(s=>o(U.MenuRadioItem,{key:s,group:"greet-mode",id:"greet-mode-"+s,label:s,checked:s===r,action:()=>n.greetMode=s}))),o(U.MenuSeparator,null),o(U.MenuGroup,{label:"Greet Stickers"},W1.map(s=>o(U.MenuItem,{key:s.id,id:"greet-"+s.id,label:s.description.split(" ")[0],action:()=>q1(e,t,[s.id])}))),Qa.store.unholyMultiGreetEnabled?o(f,null,o(U.MenuSeparator,null),o(U.MenuItem,{label:"Unholy Multi-Greet",id:"unholy-multi-greet"},W1.map(s=>{let l=i.some(c=>c===s.id);return o(U.MenuCheckboxItem,{key:s.id,id:"multi-greet-"+s.id,label:s.description.split(" ")[0],checked:l,disabled:!l&&i.length>=3,action:()=>{n.multiGreetChoices=l?i.filter(c=>c!==s.id):[...i,s.id]}})}),o(U.MenuSeparator,null),o(U.MenuItem,{id:"multi-greet-submit",label:"Send Greets",action:()=>q1(e,t,i),disabled:i.length===0}))):null)}var K1,Qa,Yp,W1,Zp,Y1=g(()=>{"use strict";a();$();P();Zt();M();j();I();K1=(n=>(n.Greet="Greet",n.NormalMessage="Message",n))(K1||{}),Qa=D({greetMode:{type:4,options:[{label:"Greet (you can only greet 3 times)",value:"Greet",default:!0},{label:"Normal Message (you can greet spam)",value:"Message"}],description:"Choose the greet mode"}}).withPrivateSettings(),Yp=A("sendGreetMessage"),W1=Qe(()=>yt("WELCOME_STICKERS")?.WELCOME_STICKERS);Zp=y({name:"GreetStickerPicker",description:"Allows you to use any greet sticker instead of only the random one by right-clicking the 'Wave to say hi!' button",authors:[p.Ven],settings:Qa,patches:[{find:"Messages.WELCOME_CTA_LABEL",replacement:{match:/innerClassName:\i\.welcomeCTAButton,(?<={channel:\i,message:\i}=(\i).{0,400}?)/,replace:"$&onContextMenu:(vcEvent)=>$self.pickSticker(vcEvent, $1),"}}],pickSticker(e,t){t.message.deleted||gn.open(e,()=>o(sI,{...t}))}})});var Xp={};Ue(Xp,{_buildPopoverElements:()=>lI,addButton:()=>Un,buttons:()=>Va,removeButton:()=>$n});function Un(e,t){Va.set(e,t)}function $n(e){Va.delete(e)}function lI(e,t){let n=[];for(let[r,i]of Va.entries())try{let s=i(e);s&&(s.key??=r,n.push(t(s)))}catch(s){aI.error(`[${r}]`,s)}return n}var aI,Va,Ir=g(()=>{"use strict";a();Je();aI=new ie("MessagePopover"),Va=new Map});var ms,X1,fs,Z1,cI,Jp,J1=g(()=>{"use strict";a();Kn();Ir();Ht();P();M();I();X1="HideAttachments_HiddenIds",fs=new Set,Z1=()=>Pt(X1).then(e=>(fs=e??new Set,fs)),cI=e=>Vt(X1,e),Jp=y({name:"HideAttachments",description:"Hide attachments and Embeds for individual messages via hover button",authors:[p.Ven],dependencies:["MessagePopoverAPI"],async start(){ms=document.createElement("style"),ms.id="VencordHideAttachments",document.head.appendChild(ms),await Z1(),await this.buildCss(),Un("HideAttachments",e=>{if(!e.attachments.length&&!e.embeds.length&&!e.stickerItems.length)return null;let t=fs.has(e.id);return{label:t?"Show Attachments":"Hide Attachments",icon:t?Na:Ca,message:e,channel:Q.getChannel(e.channel_id),onClick:()=>this.toggleHide(e.id)}})},stop(){ms.remove(),fs.clear(),$n("HideAttachments")},async buildCss(){let e=[...fs].map(t=>`#message-accessories-${t}`).join(",");ms.textContent=` :is(${e}) :is([class*="embedWrapper"], [class*="clickableSticker"]) { /* important is not necessary, but add it to make sure bad themes won't break it */ display: none !important; @@ -78,7 +71,7 @@ ${Qi(r.join(", ")+` color: var(--text-muted); font-size: 80%; } - `},async toggleHide(e){let t=await o0();t.delete(e)||t.add(e),await MI(t),await this.buildCss()}})});var Vp,s0=g(()=>{"use strict";a();P();w();Vp=y({name:"iLoveSpam",description:"Do not hide messages from 'likely spammers'",authors:[d.botato,d.Animal],patches:[{find:"hasFlag:{writable",replacement:{match:/if\((\i)<=(?:1<<30|1073741824)\)return/,replace:"if($1===(1<<20))return false;$&"}}]})});function c0(e,t,n,r){return o(V,{text:t},i=>o("button",{...i,onClick:s=>AI(s,e),style:{all:"unset",cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center"}},o("svg",{width:"24",height:"24",viewBox:"0 -960 960 960"},o("path",{fill:r,d:n}))))}function l0(e,t=!1){let n=ii.use(["ignoredActivities"]),{ignoredActivities:r=[]}=n;return r.some(i=>i.id===e.id)?II(e,"var(--status-danger)"):PI(e,t?"var(--green-300)":"var(--primary-400)")}function AI(e,t){e.stopPropagation();let n=zo().findIndex(r=>r.id===t.id);n===-1?ii.store.ignoredActivities=zo().concat(t):ii.store.ignoredActivities=zo().filter((r,i)=>i!==n),Fr.ShowCurrentGame.updateSetting(r=>r)}function zo(){return ii.store.ignoredActivities??=[]}var a0,PI,II,ii,ed,u0=g(()=>{"use strict";a();Wn();$();le();P();w();j();A();a0=Me("RunningGameStore");PI=(e,t)=>c0(e,"Disable Activity","M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z",t),II=(e,t)=>c0(e,"Enable Activity","m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z",t);ii=D({}).withPrivateSettings();ed=y({name:"IgnoreActivities",authors:[d.Nuckyz],description:"Ignore activities from showing up on your status ONLY. You can configure which ones are ignored from the Registered Games and Activities tabs.",settings:ii,patches:[{find:'.displayName="LocalActivityStore"',replacement:[{match:/HANG_STATUS.+?(?=!\i\(\i,\i\)&&)(?<=(\i)\.push.+?)/,replace:(e,t)=>`${e}${t}=${t}.filter($self.isActivityNotIgnored);`}]},{find:".Messages.SETTINGS_GAMES_TOGGLE_OVERLAY",replacement:{match:/\.Messages\.SETTINGS_GAMES_TOGGLE_OVERLAY.+?}\(\),(?<={overlay:\i,.+?=(\i),.+?)(?=!(\i))/,replace:(e,t,n)=>`${e}$self.renderToggleGameActivityButton(${t},${n}),`}},{find:".activityTitleText,variant",replacement:{match:/(?<=\i\.activityTitleText.+?children:(\i)\.name.*?}\),)/,replace:(e,t)=>`$self.renderToggleActivityButton(${t}),`}},{find:".activityCardDetails,children",replacement:{match:/(?<=\i\.activityCardDetails.+?children:(\i\.application)\.name.*?}\),)/,replace:(e,t)=>`$self.renderToggleActivityButton(${t}),`}}],async start(){let e=await It("IgnoreActivities_ignoredActivities");if(e!=null&&(ii.store.ignoredActivities=Array.from(e.values()).map(t=>({...t,name:"Unknown Name"})),$c("IgnoreActivities_ignoredActivities")),zo().length!==0){let t=a0.getGamesSeen();for(let[n,r]of zo().entries())r.type===0&&(t.some(i=>i.id===r.id||i.exePath===r.id)||zo().splice(n,1))}},isActivityNotIgnored(e){if(e.type===0||e.type===3){if(e.application_id!=null)return!zo().some(t=>t.id===e.application_id);{let t=a0.getRunningGames().find(n=>n.name===e.name)?.exePath;if(t)return!zo().some(n=>n.id===t)}}return!0},renderToggleGameActivityButton(e,t){return o(_,{noop:!0},o("div",{style:{marginLeft:12,zIndex:0}},l0({id:e.id??e.exePath,name:e.name,type:0},t)))},renderToggleActivityButton(e){return o(_,{noop:!0},l0({id:e.id,name:e.name,type:1}))}})});var ys,td=g(()=>{"use strict";a();ys="vc-imgzoom-magnify-modal"});function nd(e,t){e()?t():requestAnimationFrame(()=>nd(e,t))}var p0=g(()=>{"use strict";a()});var NI,od,d0=g(()=>{"use strict";a();Je();A();td();rd();p0();NI=Ue("vc-imgzoom-"),od=({instance:e,size:t,zoom:n})=>{let[r,i]=J(!1),[s,l]=J({x:0,y:0}),[c,u]=J({x:0,y:0}),[p,m]=J(0),h=Yt(!1),v=Yt(n),T=Yt(t),M=Yt(null),b=Yt(null),x=Yt(null),N=Yt(null);if(O.useLayoutEffect(()=>{let B=ne=>{ne.key==="Shift"&&(h.current=!0)},U=ne=>{ne.key==="Shift"&&(h.current=!1)},Y=()=>{b.current.currentTime=x.current.currentTime},K=ne=>{if(e.state.mouseOver&&e.state.mouseDown){let be=T.current/2,ae={x:ne.pageX,y:ne.pageY},Ae=-((ae.x-M.current.getBoundingClientRect().left)*v.current-be),me=-((ae.y-M.current.getBoundingClientRect().top)*v.current-be);l({x:ne.x-be,y:ne.y-be}),u({x:Ae,y:me}),m(1)}else m(0)},z=ne=>{e.state.mouseOver&&ne.button===0&&(v.current=_e.store.zoom,T.current=_e.store.size,document.getElementById("image-context")&&F.dispatch({type:"CONTEXT_MENU_CLOSE"}),K(ne),m(1))},L=()=>{m(0),_e.store.saveZoomValues&&(_e.store.zoom=v.current,_e.store.size=T.current)},X=async ne=>{if(e.state.mouseOver&&e.state.mouseDown&&!h.current){let be=v.current+ne.deltaY/100*(_e.store.invertScroll?-1:1)*_e.store.zoomSpeed;v.current=be<=1?1:be,K(ne)}if(e.state.mouseOver&&e.state.mouseDown&&h.current){let be=T.current+ne.deltaY*(_e.store.invertScroll?-1:1)*_e.store.zoomSpeed;T.current=be<=50?50:be,K(ne)}};return nd(()=>e.state.readyState==="READY",()=>{let ne=document.getElementById(ys);M.current=ne,ne.firstElementChild.setAttribute("draggable","false"),e.props.animated&&(x.current=ne.querySelector("video"),x.current.addEventListener("timeupdate",Y)),i(!0)}),document.addEventListener("keydown",B),document.addEventListener("keyup",U),document.addEventListener("mousemove",K),document.addEventListener("mousedown",z),document.addEventListener("mouseup",L),document.addEventListener("wheel",X),()=>{document.removeEventListener("keydown",B),document.removeEventListener("keyup",U),document.removeEventListener("mousemove",K),document.removeEventListener("mousedown",z),document.removeEventListener("mouseup",L),document.removeEventListener("wheel",X),_e.store.saveZoomValues&&(_e.store.zoom=v.current,_e.store.size=T.current)}},[]),!r)return null;let k=M.current.getBoundingClientRect();return o("div",{className:NI("lens",{"nearest-neighbor":_e.store.nearestNeighbour,square:_e.store.square}),style:{opacity:p,width:T.current+"px",height:T.current+"px",transform:`translate(${s.x}px, ${s.y}px)`}},e.props.animated?o("video",{ref:b,style:{position:"absolute",left:`${c.x}px`,top:`${c.y}px`},width:`${k.width*v.current}px`,height:`${k.height*v.current}px`,poster:e.props.src,src:x.current?.src??e.props.src,autoPlay:!0,loop:!0}):o("img",{ref:N,style:{position:"absolute",transform:`translate(${c.x}px, ${c.y}px)`},width:`${k.width*v.current}px`,height:`${k.height*v.current}px`,src:e.props.src,alt:""}))}});var id,m0=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/imageZoom/styles.css",{name:"src/plugins/imageZoom/styles.css",source:`.vc-imgzoom-lens { + `},async toggleHide(e){let t=await Z1();t.delete(e)||t.add(e),await cI(t),await this.buildCss()}})});var Qp,Q1=g(()=>{"use strict";a();P();M();Qp=y({name:"iLoveSpam",description:"Do not hide messages from 'likely spammers'",authors:[p.botato,p.Animal],patches:[{find:"hasFlag:{writable",replacement:{match:/if\((\i)<=(?:1<<30|1073741824)\)return/,replace:"if($1===(1<<20))return false;$&"}}]})});function tS(e,t,n,r){let i=qn();return o(V,{text:t},s=>o("button",{...s,onClick:l=>dI(l,e,i),style:{all:"unset",cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center"}},o("svg",{width:"24",height:"24",viewBox:"0 -960 960 960"},o("path",{fill:r,d:n}))))}function eS(e,t=!1){return go().some(n=>n.id===e.id)?pI(e,"var(--status-danger)"):uI(e,t?"var(--green-300)":"var(--primary-400)")}function dI(e,t,n){e.stopPropagation();let r=go().findIndex(i=>i.id===t.id);r===-1?gs.store.ignoredActivities=go().concat(t):gs.store.ignoredActivities=go().filter((i,s)=>s!==r),Ur.ShowCurrentGame.updateSetting(i=>i),n()}function go(){return gs.store.ignoredActivities??=[]}var V1,uI,pI,gs,Vp,nS=g(()=>{"use strict";a();Kn();$();le();P();Oe();M();j();I();V1=Ie("RunningGameStore");uI=(e,t)=>tS(e,"Disable Activity","M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z",t),pI=(e,t)=>tS(e,"Enable Activity","m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z",t);gs=D({}).withPrivateSettings();Vp=y({name:"IgnoreActivities",authors:[p.Nuckyz],description:"Ignore activities from showing up on your status ONLY. You can configure which ones are ignored from the Registered Games and Activities tabs.",settings:gs,patches:[{find:'.displayName="LocalActivityStore"',replacement:[{match:/LISTENING.+?}\),(?<=(\i)\.push.+?)/,replace:(e,t)=>`${e}${t}=${t}.filter($self.isActivityNotIgnored),`}]},{find:".Messages.SETTINGS_GAMES_TOGGLE_OVERLAY",replacement:{match:/\.Messages\.SETTINGS_GAMES_TOGGLE_OVERLAY.+?}\(\),(?<={overlay:\i,.+?=(\i),.+?)(?=!(\i))/,replace:(e,t,n)=>`${e}$self.renderToggleGameActivityButton(${t},${n}),`}},{find:".activityTitleText,variant",replacement:{match:/(?<=\i\.activityTitleText.+?children:(\i)\.name.*?}\),)/,replace:(e,t)=>`$self.renderToggleActivityButton(${t}),`}},{find:".activityCardDetails,children",replacement:{match:/(?<=\i\.activityCardDetails.+?children:(\i\.application)\.name.*?}\),)/,replace:(e,t)=>`$self.renderToggleActivityButton(${t}),`}}],async start(){let e=await Pt("IgnoreActivities_ignoredActivities");if(e!=null&&(gs.store.ignoredActivities=Array.from(e.values()).map(t=>({...t,name:"Unknown Name"})),Fc("IgnoreActivities_ignoredActivities")),go().length!==0){let t=V1.getGamesSeen();for(let[n,r]of go().entries())r.type===0&&(t.some(i=>i.id===r.id||i.exePath===r.id)||go().splice(n,1))}},isActivityNotIgnored(e){if(e.type===0||e.type===3){if(e.application_id!=null)return!go().some(t=>t.id===e.application_id);{let t=V1.getRunningGames().find(n=>n.name===e.name)?.exePath;if(t)return!go().some(n=>n.id===t)}}return!0},renderToggleGameActivityButton(e,t){return o(_,{noop:!0},o("div",{style:{marginLeft:12,zIndex:0}},eS({id:e.id??e.exePath,name:e.name,type:0},t)))},renderToggleActivityButton(e){return o(_,{noop:!0},eS({id:e.id,name:e.name,type:1}))}})});var hs,ed=g(()=>{"use strict";a();hs="vc-imgzoom-magnify-modal"});function td(e,t){e()?t():requestAnimationFrame(()=>td(e,t))}var oS=g(()=>{"use strict";a()});var mI,nd,rS=g(()=>{"use strict";a();Ve();I();ed();od();oS();mI=Ge("vc-imgzoom-"),nd=({instance:e,size:t,zoom:n})=>{let[r,i]=J(!1),[s,l]=J({x:0,y:0}),[c,u]=J({x:0,y:0}),[d,m]=J(0),h=Jt(!1),v=Jt(n),T=Jt(t),w=Jt(null),b=Jt(null),x=Jt(null),N=Jt(null);if(O.useLayoutEffect(()=>{let F=ne=>{ne.key==="Shift"&&(h.current=!0)},G=ne=>{ne.key==="Shift"&&(h.current=!1)},K=()=>{b.current.currentTime=x.current.currentTime},q=ne=>{if(e.state.mouseOver&&e.state.mouseDown){let xe=T.current/2,ae={x:ne.pageX,y:ne.pageY},Ce=-((ae.x-w.current.getBoundingClientRect().left)*v.current-xe),ge=-((ae.y-w.current.getBoundingClientRect().top)*v.current-xe);l({x:ne.x-xe,y:ne.y-xe}),u({x:Ce,y:ge}),m(1)}else m(0)},z=ne=>{e.state.mouseOver&&ne.button===0&&(v.current=Fe.store.zoom,T.current=Fe.store.size,document.getElementById("image-context")&&B.dispatch({type:"CONTEXT_MENU_CLOSE"}),q(ne),m(1))},R=()=>{m(0),Fe.store.saveZoomValues&&(Fe.store.zoom=v.current,Fe.store.size=T.current)},X=async ne=>{if(e.state.mouseOver&&e.state.mouseDown&&!h.current){let xe=v.current+ne.deltaY/100*(Fe.store.invertScroll?-1:1)*Fe.store.zoomSpeed;v.current=xe<=1?1:xe,q(ne)}if(e.state.mouseOver&&e.state.mouseDown&&h.current){let xe=T.current+ne.deltaY*(Fe.store.invertScroll?-1:1)*Fe.store.zoomSpeed;T.current=xe<=50?50:xe,q(ne)}};return td(()=>e.state.readyState==="READY",()=>{let ne=document.getElementById(hs);w.current=ne,ne.firstElementChild.setAttribute("draggable","false"),e.props.animated&&(x.current=ne.querySelector("video"),x.current.addEventListener("timeupdate",K)),i(!0)}),document.addEventListener("keydown",F),document.addEventListener("keyup",G),document.addEventListener("mousemove",q),document.addEventListener("mousedown",z),document.addEventListener("mouseup",R),document.addEventListener("wheel",X),()=>{document.removeEventListener("keydown",F),document.removeEventListener("keyup",G),document.removeEventListener("mousemove",q),document.removeEventListener("mousedown",z),document.removeEventListener("mouseup",R),document.removeEventListener("wheel",X),Fe.store.saveZoomValues&&(Fe.store.zoom=v.current,Fe.store.size=T.current)}},[]),!r)return null;let k=w.current.getBoundingClientRect();return o("div",{className:mI("lens",{"nearest-neighbor":Fe.store.nearestNeighbour,square:Fe.store.square}),style:{opacity:d,width:T.current+"px",height:T.current+"px",transform:`translate(${s.x}px, ${s.y}px)`}},e.props.animated?o("video",{ref:b,style:{position:"absolute",left:`${c.x}px`,top:`${c.y}px`},width:`${k.width*v.current}px`,height:`${k.height*v.current}px`,poster:e.props.src,src:x.current?.src??e.props.src,autoPlay:!0,loop:!0}):o("img",{ref:N,style:{position:"absolute",transform:`translate(${c.x}px, ${c.y}px)`},width:`${k.width*v.current}px`,height:`${k.height*v.current}px`,src:e.props.src,alt:""}))}});var rd,iS=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/imageZoom/styles.css",{name:"src/plugins/imageZoom/styles.css",source:`.vc-imgzoom-lens { position: absolute; inset: 0; z-index: 9999; @@ -109,10 +102,10 @@ ${Qi(r.join(", ")+` [class*="carouselModal_"] { height: 0 !important; } -`,classNames:{},dom:null});id="src/plugins/imageZoom/styles.css"});var _e,f0,sd,rd=g(()=>{"use strict";a();Pt();$();Je();ka();P();zr();w();A();d0();td();m0();_e=D({saveZoomValues:{type:3,description:"Whether to save zoom and lens size values",default:!0},invertScroll:{type:3,description:"Invert scroll",default:!0},nearestNeighbour:{type:3,description:"Use Nearest Neighbour Interpolation when scaling images",default:!1},square:{type:3,description:"Make the lens square",default:!1},zoom:{description:"Zoom of the lens",type:5,markers:Fo(1,50,4),default:2,stickToMarkers:!1},size:{description:"Radius / Size of the lens",type:5,markers:Fo(50,1e3,50),default:100,stickToMarkers:!1},zoomSpeed:{description:"How fast the zoom / lens size changes",type:5,markers:Fo(.1,5,.2),default:.5,stickToMarkers:!1}}),f0=e=>()=>{e.push(o(G.MenuGroup,{id:"image-zoom"},o(G.MenuCheckboxItem,{id:"vc-square",label:"Square Lens",checked:_e.store.square,action:()=>{_e.store.square=!_e.store.square,dn.closeContextMenu()}}),o(G.MenuCheckboxItem,{id:"vc-nearest-neighbour",label:"Nearest Neighbour",checked:_e.store.nearestNeighbour,action:()=>{_e.store.nearestNeighbour=!_e.store.nearestNeighbour,dn.closeContextMenu()}}),o(G.MenuControlItem,{id:"vc-zoom",label:"Zoom",control:(t,n)=>o(G.MenuSliderControl,{ref:n,...t,minValue:1,maxValue:50,value:_e.store.zoom,onChange:yn(r=>_e.store.zoom=r,100)})}),o(G.MenuControlItem,{id:"vc-size",label:"Lens Size",control:(t,n)=>o(G.MenuSliderControl,{ref:n,...t,minValue:50,maxValue:1e3,value:_e.store.size,onChange:yn(r=>_e.store.size=r,100)})}),o(G.MenuControlItem,{id:"vc-zoom-speed",label:"Zoom Speed",control:(t,n)=>o(G.MenuSliderControl,{ref:n,...t,minValue:.1,maxValue:5,value:_e.store.zoomSpeed,onChange:yn(r=>_e.store.zoomSpeed=r,100),renderValue:r=>`${r.toFixed(3)}x`})})))},sd=y({name:"ImageZoom",description:"Lets you zoom in to images and gifs. Use scroll wheel to zoom in and shift + scroll wheel to increase lens radius / size",authors:[d.Aria],tags:["ImageUtilities"],patches:[{find:"Messages.OPEN_IN_BROWSER",replacement:{match:/return.{1,200}\.wrapper.{1,200}src:\i,/g,replace:`$&id: '${ys}',`}},{find:"handleImageLoad=",replacement:[{match:/showThumbhashPlaceholder:\i,/,replace:"...$self.makeProps(this),$&"},{match:/componentDidMount\(\){/,replace:"$&$self.renderMagnifier(this);"},{match:/componentWillUnmount\(\){/,replace:"$&$self.unMountMagnifier();"}]},{find:".carouselModal",replacement:{match:/(?<=\.carouselModal.{0,100}onClick:)\i,/,replace:"()=>{},"}}],settings:_e,currentMagnifierElement:null,element:null,Magnifier:od,root:null,makeProps(e){return{onMouseOver:()=>this.onMouseOver(e),onMouseOut:()=>this.onMouseOut(e),onMouseDown:t=>this.onMouseDown(t,e),onMouseUp:()=>this.onMouseUp(e),id:e.props.id}},renderMagnifier(e){e.props.id===ys&&(this.currentMagnifierElement||(this.currentMagnifierElement=o(od,{size:_e.store.size,zoom:_e.store.zoom,instance:e}),this.root=sr.createRoot(this.element),this.root.render(this.currentMagnifierElement)))},unMountMagnifier(){this.root?.unmount(),this.currentMagnifierElement=null,this.root=null},onMouseOver(e){e.setState(t=>({...t,mouseOver:!0}))},onMouseOut(e){e.setState(t=>({...t,mouseOver:!1}))},onMouseDown(e,t){e.button===0&&t.setState(n=>({...n,mouseDown:!0}))},onMouseUp(e){e.setState(t=>({...t,mouseDown:!1}))},start(){St(id),ce("image-context",f0),this.element=document.createElement("div"),this.element.classList.add("MagnifierContainer"),document.body.appendChild(this.element)},stop(){Ft(id),this.root&&this.root.unmount(),this.element?.remove(),de("image-context",f0)}})});function CI(e){let t=e?.message?.content,[n,r]=O.useState("password");return o(ze,{...e},o(lt,null,o(S.FormTitle,{tag:"h4"},"Decrypt Message")),o(et,null,o(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Message with Encryption"),o(Ve,{defaultValue:t,disabled:!0}),o(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Password"),o(Ve,{style:{marginBottom:"20px"},onChange:r})),o(_t,null,o(R,{color:R.Colors.GREEN,onClick:()=>{let i=ad(t,n,!0);!i||!e?.message||(Vencord.Plugins.plugins.InvisibleChat.buildEmbed(e?.message,i),e.onClose())}},"Decrypt"),o(R,{color:R.Colors.TRANSPARENT,look:R.Looks.LINK,style:{left:15,position:"absolute"},onClick:e.onClose},"Cancel")))}function g0(e){je(t=>o(CI,{...t,...e}))}var h0=g(()=>{"use strict";a();dt();A();Qa()});function kI(e){let[t,n]=O.useState(""),[r,i]=O.useState(""),[s,l]=O.useState("password"),[c,u]=O.useState(!1),p=t&&(c||r&&r.trim().split(" ").length>1);return o(ze,{...e},o(lt,null,o(S.FormTitle,{tag:"h4"},"Encrypt Message")),o(et,null,o(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Secret"),o(Ve,{onChange:m=>{n(m)}}),o(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Cover (2 or more Words!!)"),o(Ve,{disabled:c,onChange:m=>{i(m)}}),o(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Password"),o(Ve,{style:{marginBottom:"20px"},defaultValue:"password",onChange:m=>{l(m)}}),o(pt,{value:c,onChange:m=>{u(m)}},"Don't use a Cover")),o(_t,null,o(R,{color:R.Colors.GREEN,disabled:!p,onClick:()=>{if(!p)return;let m=S0(t,s,c?"d d":r),h=c?m.replaceAll("d",""):m;!h||(so(h),e.onClose())}},"Send"),o(R,{color:R.Colors.TRANSPARENT,look:R.Looks.LINK,style:{left:15,position:"absolute"},onClick:()=>{e.onClose()}},"Cancel")))}function y0(){je(e=>o(kI,{...e}))}var v0=g(()=>{"use strict";a();bt();dt();A();Qa()});function RI(){return o("svg",{fill:"var(--header-secondary)",width:24,height:24,viewBox:"0 0 64 64"},o("path",{d:"M 32 9 C 24.832 9 19 14.832 19 22 L 19 27.347656 C 16.670659 28.171862 15 30.388126 15 33 L 15 49 C 15 52.314 17.686 55 21 55 L 43 55 C 46.314 55 49 52.314 49 49 L 49 33 C 49 30.388126 47.329341 28.171862 45 27.347656 L 45 22 C 45 14.832 39.168 9 32 9 z M 32 13 C 36.963 13 41 17.038 41 22 L 41 27 L 23 27 L 23 22 C 23 17.038 27.037 13 32 13 z"}))}function LI(){return o(V,{text:"This message has a hidden message! (InvisibleChat)"},({onMouseEnter:e,onMouseLeave:t})=>o("img",{"aria-label":"Hidden Message Indicator (InvisibleChat)",onMouseEnter:e,onMouseLeave:t,src:"https://github.com/SammCheese/invisible-chat/raw/NewReplugged/src/assets/lock.png",width:20,height:20,style:{transform:"translateY(4p)",paddingInline:4}}))}function EI(e){return e.type.analyticsName!=="normal"?null:o(V,{text:"Encrypt Message"},({onMouseEnter:t,onMouseLeave:n})=>o("div",{style:{display:"flex"}},o(R,{"aria-haspopup":"dialog","aria-label":"Encrypt Message",size:"",look:Kt.BLANK,onMouseEnter:t,onMouseLeave:n,innerClassName:vt.button,onClick:()=>y0(),style:{padding:"0 2px",scale:"0.9"}},o("div",{className:vt.buttonWrapper},o("svg",{"aria-hidden":!0,role:"img",width:"32",height:"32",viewBox:"0 0 64 64",style:{scale:"1.1"}},o("path",{fill:"currentColor",d:"M 32 9 C 24.832 9 19 14.832 19 22 L 19 27.347656 C 16.670659 28.171862 15 30.388126 15 33 L 15 49 C 15 52.314 17.686 55 21 55 L 43 55 C 46.314 55 49 52.314 49 49 L 49 33 C 49 30.388126 47.329341 28.171862 45 27.347656 L 45 22 C 45 14.832 39.168 9 32 9 z M 32 13 C 36.963 13 41 17.038 41 22 L 41 27 L 23 27 L 23 22 C 23 17.038 27.037 13 32 13 z"}))))))}function S0(e,t,n){return ld.hide(e+"\u200B",t,n)}function ad(e,t,n){let r=ld.reveal(e,t);return n?r.replace("\u200B",""):r}function DI(e){return e.endsWith("\u200B")}async function OI(e){let t=b0.store.savedPasswords.split(",").map(r=>r.trim());if(!e?.content||!t?.length)return!1;let{content:n}=e;/^\W/.test(e.content)&&(n=`d ${e.content}d`);for(let r=0;r{"use strict";a();Ir();$();le();P();za();w();A();h0();v0();b0=D({savedPasswords:{type:0,default:"password, Password",description:"Saved Passwords (Seperated with a , )"}}),cd=y({name:"InvisibleChat",description:"Encrypt your Messages in a non-suspicious way!",authors:[d.SammCheese],dependencies:["MessagePopoverAPI"],patches:[{find:".Messages.MESSAGE_EDITED,",replacement:{match:/let\{className:\i,message:\i[^}]*\}=(\i)/,replace:"try {$1 && $self.INV_REGEX.test($1.message.content) ? $1.content.push($self.indicator()) : null } catch {};$&"}},{find:"ChannelTextAreaButtons",replacement:{match:/(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/,replace:"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()"}}],EMBED_API_URL:"https://embed.sammcheese.net",INV_REGEX:new RegExp(/( \u200c|\u200d |[\u2060-\u2064])[^\u200b]/),URL_REGEX:new RegExp(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/),settings:b0,async start(){let{default:e}=await x1();ld=new e(!0,!1),Bn("invDecrypt",t=>this.INV_REGEX.test(t?.content)?{label:"Decrypt Message",icon:this.popOverIcon,message:t,channel:Q.getChannel(t.channel_id),onClick:async()=>{await OI(t).then(n=>n?void this.buildEmbed(t,n):void g0({message:t}))}}:null)},stop(){Fn("invDecrypt")},async getEmbed(e){let{body:t}=await Mt.post({url:"/unfurler/embed-urls",body:{urls:[e]}});return await t.embeds[0]},async buildEmbed(e,t){let n=t.match(this.URL_REGEX);if(e.embeds.push({type:"rich",title:"Decrypted Message",color:"0x45f5f5",description:t,footer:{text:"Made with \u2764\uFE0F by c0dine and Sammy!"}}),n?.length){let r=await this.getEmbed(new URL(n[0]));r&&e.embeds.push(r)}this.updateMessage(e)},updateMessage:e=>{F.dispatch({type:"MESSAGE_UPDATE",message:e})},chatBarIcon:_.wrap(EI,{noop:!0}),popOverIcon:()=>o(RI,null),indicator:_.wrap(LI,{noop:!0})})});function T0(e,t){!Q.hasChannel(t)||pr.transitionTo(`/channels/${e??"@me"}/${t}`)}var Va,bn,ud,x0=g(()=>{"use strict";a();Wn();P();w();A();Va=!1;ud=y({name:"KeepCurrentChannel",description:"Attempt to navigate to the channel you were in before switching accounts or loading Discord.",authors:[d.Nuckyz],flux:{LOGOUT(e){({isSwitchingAccount:Va}=e)},CONNECTION_OPEN(){!Va||(Va=!1,bn?.channelId&&T0(bn.guildId,bn.channelId))},async CHANNEL_SELECT({guildId:e,channelId:t}){Va||(bn={guildId:e,channelId:t},await Xt("KeepCurrentChannel_previousData",bn))}},async start(){bn=await It("KeepCurrentChannel_previousData"),bn?bn.channelId&&T0(bn.guildId,bn.channelId):(bn={guildId:on.getGuildId(),channelId:Pe.getChannelId()??null},await Xt("KeepCurrentChannel_previousData",bn))}})});async function pd(e){return(await ur.fetchAssetIds(dd,[e]))[0]}function FI(e){F.dispatch({type:"LOCAL_ACTIVITY_UPDATE",activity:e,socketId:"LastFM"})}var dd,_I,w0,BI,Tn,md,M0=g(()=>{"use strict";a();$();lo();P();Ze();w();j();A();dd="1108588077900898414",_I="2a96cbd8b46e442fc41c2b86b821562f",w0=new ie("LastFMRichPresence"),BI=I("getLocalPresence");Tn=D({username:{description:"last.fm username",type:0},apiKey:{description:"last.fm api key",type:0},shareUsername:{description:"show link to last.fm profile",type:3,default:!1},hideWithSpotify:{description:"hide last.fm presence if spotify is running",type:3,default:!0},statusName:{description:"custom status text",type:0,default:"some music"},nameFormat:{description:"Show name of song and artist in status name",type:4,options:[{label:"Use custom status name",value:"status-name",default:!0},{label:"Use format 'artist - song'",value:"artist-first"},{label:"Use format 'song - artist'",value:"song-first"},{label:"Use artist name only",value:"artist"},{label:"Use song name only",value:"song"}]},useListeningStatus:{description:'show "Listening to" status instead of "Playing"',type:3,default:!1},missingArt:{description:"When album or album art is missing",type:4,options:[{label:"Use large Last.fm logo",value:"lastfmLogo",default:!0},{label:"Use generic placeholder",value:"placeholder"}]}}),md=y({name:"LastFMRichPresence",description:"Little plugin for Last.fm rich presence",authors:[d.dzshn,d.RuiNtD,d.blahajZip,d.archeruwu],settingsAboutComponent:()=>o(f,null,o(S.FormTitle,{tag:"h3"},"How to get an API key"),o(S.FormText,null,"An API key is required to fetch your current track. To get one, you can visit ",o(st,{href:"https://www.last.fm/api/account/create"},"this page")," and fill in the following information: ",o("br",null)," ",o("br",null),"Application name: Discord Rich Presence ",o("br",null),"Application description: (personal use) ",o("br",null)," ",o("br",null),"And copy the API key (not the shared secret!)")),settings:Tn,start(){this.updatePresence(),this.updateInterval=setInterval(()=>{this.updatePresence()},16e3)},stop(){clearInterval(this.updateInterval)},async fetchTrackData(){if(!Tn.store.username||!Tn.store.apiKey)return null;try{let e=new URLSearchParams({method:"user.getrecenttracks",api_key:Tn.store.apiKey,user:Tn.store.username,limit:"1",format:"json"}),t=await fetch(`https://ws.audioscrobbler.com/2.0/?${e}`);if(!t.ok)throw`${t.status} ${t.statusText}`;let n=await t.json();if(n.error)return w0.error("Error from Last.fm API",`${n.error}: ${n.message}`),null;let r=n.recenttracks?.track[0];return r?.["@attr"]?.nowplaying?{name:r.name||"Unknown",album:r.album["#text"],artist:r.artist["#text"]||"Unknown",url:r.url,imageUrl:r.image?.find(i=>i.size==="large")?.["#text"]}:null}catch(e){return w0.error("Failed to query Last.fm API",e),null}},async updatePresence(){FI(await this.getActivity())},getLargeImage(e){if(e.imageUrl&&!e.imageUrl.includes(_I))return e.imageUrl;if(Tn.store.missingArt==="placeholder")return"placeholder"},async getActivity(){if(Tn.store.hideWithSpotify){for(let s of BI.getActivities())if(s.type===2&&s.application_id!==dd)return null}let e=await this.fetchTrackData();if(!e)return null;let t=this.getLargeImage(e),n=t?{large_image:await pd(t),large_text:e.album||void 0,small_image:await pd("lastfm-small"),small_text:"Last.fm"}:{large_image:await pd("lastfm-large"),large_text:e.album||void 0},r=[{label:"View Song",url:e.url}];Tn.store.shareUsername&&r.push({label:"Last.fm Profile",url:`https://www.last.fm/user/${Tn.store.username}`});let i=(()=>{switch(Tn.store.nameFormat){case"artist-first":return e.artist+" - "+e.name;case"song-first":return e.name+" - "+e.artist;case"artist":return e.artist;case"song":return e.name;default:return Tn.store.statusName}})();return{application_id:dd,name:i,details:e.name,state:e.artist,assets:n,buttons:r.map(s=>s.label),metadata:{button_urls:r.map(s=>s.url)},type:Tn.store.useListeningStatus?2:0,flags:1}}})});var P0,I0,fd,A0=g(()=>{"use strict";a();$();P();w();P0=["Eyrokac","Rdcg$l`'k|~n",'H`tf$d&iajo+d`{"',"Sucqplh`(Eclhualva()&","Lncgmka'8KNMDC,shpanf'`x./,","Ioqweijnfn*IeuvfvAotkfxo./,","Hd{#cp\x7Ft$)nbd!{lq%mig~*\x7Fh`v#mk&sm{gx nd#idjb(a\x7Ffao\"bja&amdkge!Rlo\xECkhf)hyedfjjb*'^hzdrdmm$lu'|ao+mnqw$fijxh~bbmg#Tjm\xEEefd+fnp#lpkffz5","h",`sijklm&cam*rot"hjjq'|ak\x7F xmv#wc'ep*mawmvvlrb(|ynr>"Aqq&cgg-\x7F ugoh%rom)e\x7Fhdpp%$`,'Tnfb}"u\'~`nno!kp$vvhfzeyee"a}%Tfam*Xh`fls%Jboldos-"lj`&hn)~ce!`jcbct|)gdbhnf$wikm$zgaxkmc%afely+og"144?\'ign+iu%p$qisiefr gpfa$',"Ndtfv%ahfgk+ghtf$|ir(|z' Oguaw&`ggdj mgw$|ir(me|n","(!\u0363\xB3$\u0359\u0290'\u0369\xB9#","(\uFF88\u25D7\u30ED\u25D1,\uFF8F-2\uFF6C\uFF95\u272C","Ynw#hjil(ze+psgwp|&sgmkr!","Tikmolh`(fl+a!dvjk\x7F'y|e\x7Fe/,-","3/3750?5><9>885:7","mdmt","Wdn`khc+(oxbeof","Ig\"zkp*'g{*xolglj`&~g|*gowg/$mgt(Eclm`.#ticf{l*xed\"wl`&Kangj igbhqn'd`dn `v#lqrw{3%$bhv-h|)kangj_imwhlhb","Tscmw%Tnoa~x",'I\u2018f#npus(ec`e!vl$lhsm{`ncu"ekw&f(defeov-$Rnf|)sdu\u2018pf$wcam{ceg!vl$du\'D`d~x-"jw%oi(okht-"DJP)Kag\x7Fs,!mq$du\'A\u2010|n sg`akrkq)~jkdl#pj&diefbnf"jp)&@F\\*{ltq#Hlhrp\'',"Ynw$v`&cg`dl fml`%rhlhs*","Dnl$p%qhz{s' hv$w%hh|aceg!;#gpvt(fl+cndea`&dg|fon&v#wjjqm(","\uD83D)pft`gs(ec`e!13$qojmz#",`a!njcmr'ide~nu"lb%rheoedldpz$lu'gbkr`,'dn"zkp&kg\x7Fo4',"hnpqkw",'sn"fau\x7F','Sn"tmqnh}}*musvkaw&flf&+ldv$w%lr{}*aulr#vlao|)cetn"jp$',"Dxkmc%ot(hhxomwwai\x7F'{hln",`hd{#}js&(pe~'sg#gprb(3#"`,"hd{b${","<;vqkijbq33271:56<3799?24944:",`Thof$lu'ofdn,!qsefc'az*bnrcma+&Om{o+iu"\`khct$)bnrd"bcdoi&`,"snofplkb{)c\x7F'r\"lod\x7F'|f*aurv#cpno`abchijklmno","Wdn`khc'|f*eghl{%"],I0=D({replaceEvents:{description:"Replace Event Quotes too",type:3,default:!0}}),fd=y({name:"LoadingQuotes",description:"Replace Discords loading quotes",authors:[d.Ven,d.KraXen72],settings:I0,patches:[{find:".LOADING_DID_YOU_KNOW}",replacement:[{match:/\._loadingText=function\(\)\{/,replace:"$&return $self.quote;"},{match:/\._eventLoadingText=function\(\)\{/,replace:"$&return $self.quote;",predicate:()=>I0.store.replaceEvents}]}],xor(e){let t="read if cute",n=Array.from(e,(r,i)=>r.charCodeAt(0)^i%t.length);return String.fromCharCode(...n)},get quote(){return this.xor(P0[Math.floor(Math.random()*P0.length)])}})});function $I(){let{id:e,guild_id:t}=He([Pe],()=>Vr()),{groups:n}=He([C0],()=>C0.getProps(t,e)),r=He([N0],()=>N0.getMemberCount(t));if(r==null)return null;let i=n.length===1&&n[0].id==="unknown"?0:n.reduce((s,l)=>s+(l.id==="offline"?0:l.count),0);return o(ge,{id:"vc-membercount",style:{marginTop:"1em",paddingInline:"1em",justifyContent:"center",alignContent:"center",gap:0}},o(V,{text:`${el(i)} online in this channel`,position:"bottom"},s=>o("div",{...s},o("span",{style:{backgroundColor:"var(--green-360)",width:"12px",height:"12px",borderRadius:"50%",display:"inline-block",marginRight:"0.5em"}}),o("span",{style:{color:"var(--green-360)"}},el(i)))),o(V,{text:`${el(r)} total server members`,position:"bottom"},s=>o("div",{...s},o("span",{style:{width:"6px",height:"6px",borderRadius:"50%",border:"3px solid var(--primary-400)",display:"inline-block",marginRight:"0.5em",marginLeft:"1em"}}),o("span",{style:{color:"var(--primary-400)"}},el(r)))))}var N0,C0,UI,el,gd,k0=g(()=>{"use strict";a();le();Lt();P();bt();w();j();A();N0=Me("GuildMemberCountStore"),C0=Me("ChannelMemberStore"),UI=new Intl.NumberFormat,el=e=>UI.format(e);gd=y({name:"MemberCount",description:"Shows the amount of online & total members in the server member list",authors:[d.Ven,d.Commandtechno],patches:[{find:"{isSidebarVisible:",replacement:{match:/(?<=let\{className:(\i),.+?children):\[(\i\.useMemo[^}]+"aria-multiselectable")/,replace:":[$1?.startsWith('members')?$self.render():null,$2"}}],render:_.wrap($I,{noop:!0})})});var hd,R0,L0,vs,yd,E0=g(()=>{"use strict";a();Yn();$();P();w();j();A();hd=!1,R0=e=>e.key==="Backspace"&&(hd=!0),L0=e=>e.key==="Backspace"&&(hd=!1),vs=D({enableDeleteOnClick:{type:3,description:"Enable delete on click while holding backspace",default:!0},enableDoubleClickToEdit:{type:3,description:"Enable double click to edit",default:!0},enableDoubleClickToReply:{type:3,description:"Enable double click to reply",default:!0},requireModifier:{type:3,description:"Only do double click actions when shift/ctrl is held",default:!1}}),yd=y({name:"MessageClickActions",description:"Hold Backspace and click to delete, double click to edit/reply",authors:[d.Ven],dependencies:["MessageEventsAPI"],settings:vs,start(){let e=I("deleteMessage","startEditMessage"),t=I("isEditing","isEditingAny");document.addEventListener("keydown",R0),document.addEventListener("keyup",L0),this.onClick=up((n,r,i)=>{let s=n.author.id===W.getCurrentUser().id;if(hd)vs.store.enableDeleteOnClick&&(s||Ce.can(Se.MANAGE_MESSAGES,r))&&(n.deleted?F.dispatch({type:"MESSAGE_DELETE",channelId:r.id,id:n.id,mlDeleted:!0}):e.deleteMessage(r.id,n.id),i.preventDefault());else{if(i.detail<2||vs.store.requireModifier&&!i.ctrlKey&&!i.shiftKey||r.guild_id&&!Ce.can(Se.SEND_MESSAGES,r))return;if(s){if(!vs.store.enableDoubleClickToEdit||t.isEditing(r.id,n.id))return;e.startEditMessage(r.id,n.id,n.content),i.preventDefault()}else{if(!vs.store.enableDoubleClickToReply)return;F.dispatch({type:"CREATE_PENDING_REPLY",channel:r,message:n,shouldMention:!E.plugins.NoReplyMention.enabled,showMentionToggle:r.guild_id!==null})}}})},stop(){pp(this.onClick),document.removeEventListener("keydown",R0),document.removeEventListener("keyup",L0)}})});var Sd={};Be(Sd,{_modifyAccessories:()=>GI,accessories:()=>tl,addAccessory:()=>Ss,removeAccessory:()=>vd});function Ss(e,t,n){tl.set(e,{callback:t,position:n})}function vd(e){tl.delete(e)}function GI(e,t){for(let n of tl.values()){let r=n.callback(t);if(r!=null){if(!Array.isArray(r))r=[r];else if(r.length===0)continue;e.splice(n.position!=null?n.position<0?e.length+n.position:n.position:e.length,0,...r.filter(i=>i!=null))}}return e}var tl,nl=g(()=>{"use strict";a();tl=new Map});async function qI(e,t){let n=si.get(t);if(n)return n.message;si.set(t,{fetched:!1});let i=(await Mt.get({url:`/channels/${e}/messages`,query:{limit:1,around:t},retries:2}).catch(()=>null))?.body?.[0];if(!i)return;let s=An.getMessages(i.channel_id).receiveMessage(i).get(i.id);return si.set(s.id,{message:s,fetched:!0}),s}function KI(e){let t=[];for(let{content_type:n,height:r,width:i,url:s,proxy_url:l}of e.attachments??[])n?.startsWith("image/")&&t.push({height:r,width:i,url:s,proxyURL:l});for(let{type:n,image:r,thumbnail:i,url:s}of e.embeds??[])n==="image"?t.push({...r??i}):s&&n==="gifv"&&!O0.test(s)&&t.push({height:i.height,width:i.width,url:s});return t}function YI(e,t){return!e&&!t?"":e?t?`[no content, ${e} attachment${e!==1?"s":""} and ${t} embed${t!==1?"s":""}]`:`[no content, ${e} attachment${e!==1?"s":""}]`:`[no content, ${t} embed${t!==1?"s":""}]`}function ZI(e){return!!(e.components.length||e.attachments.some(t=>!t.content_type?.startsWith("image/"))||e.embeds.some(t=>t.type!=="image"&&(t.type!=="gifv"||O0.test(t.url))))}function XI(e,t){if(e>t){let s=Math.min(e,400);return{width:s,height:Math.round(t/(e/s))}}let i=Math.min(t,300);return{width:Math.round(e/(t/i)),height:i}}function JI(e,t){return new Proxy(e,{get(n,r){return r==="vencordEmbeddedBy"?t:Reflect.get(...arguments)}})}function QI({message:e}){let t=e.vencordEmbeddedBy??[],n=[],r=null;for(;(r=bd.exec(e.content))!==null;){let[i,s,l,c]=r;if(t.includes(c))continue;let u=Q.getChannel(l);if(!u||s!=="@me"&&!Ce.can(1024n,u))continue;let{listMode:p,idList:m}=ol.store,h=[s,l,e.author.id].some(b=>b&&m.includes(b));if(p==="blacklist"&&h||p==="whitelist"&&!h)continue;let v=si.get(c)?.message;if(!v)if(v??=An.getMessage(l,c),v)si.set(c,{message:v,fetched:!0});else{let b={...e};delete b.embeds,delete b.interaction,WI.push(()=>qI(l,c).then(x=>x&&F.dispatch({type:"MESSAGE_UPDATE",message:b})));continue}let T={message:JI(v,[...t,e.id]),channel:u,guildID:s},M=ol.store.automodEmbeds;n.push(M==="always"||M==="prefer"&&!ZI(v)?o(eA,{...T}):o(VI,{...T}))}return n.length?o(f,null,n):null}function VI({message:e,channel:t,guildID:n}){let r=n==="@me",i=!r&&Te.getGuild(t.guild_id),s=W.getUser(Q.getChannel(t.id).recipients?.[0]);return o(HI,{embed:{rawDescription:"",color:"var(--background-secondary)",author:{name:o(re,{variant:"text-xs/medium",tag:"span"},o("span",null,r?"Direct Message - ":i.name+" - "),r?Fe.parse(`<@${s.id}>`):Fe.parse(`<#${t.id}>`)),iconProxyURL:i?`https://${window.GLOBAL_ENV.CDN_HOST}/icons/${i.id}/${i.icon}.png`:`https://${window.GLOBAL_ENV.CDN_HOST}/avatars/${s.id}/${s.avatar}`}},renderDescription:()=>o("div",{key:e.id,className:oe(D0.message,ol.store.messageBackgroundColor&&D0.searchResult)},o(jI,{id:`message-link-embeds-${e.id}`,message:e,channel:t,subscribeToComponentDispatch:!1}))})}function eA(e){let{message:t,channel:n,guildID:r}=e,i=uc.MessageDisplayCompact.useSetting(),s=r==="@me",l=KI(t),{parse:c}=Fe;return o(zI,{channel:n,childrenAccessories:o(re,{color:"text-muted",variant:"text-xs/medium",tag:"span"},c(s?`<@${Q.getChannel(n.id).recipients[0]}>`:`<#${n.id}>`),o("span",null,s?" - Direct Message":" - "+Te.getGuild(n.guild_id)?.name)),compact:i,content:o(f,null,t.content||t.attachments.length<=l.length?c(t.content):[YI(t.attachments.length,t.embeds.length)],l.map(u=>{let{width:p,height:m}=XI(u.width,u.height);return o("div",null,o("img",{src:u.url,width:p,height:m}))})),hideTimestamp:!1,message:t,_messageEmbed:"automod"})}var si,HI,zI,jI,D0,bd,O0,WI,ol,Td,_0=g(()=>{"use strict";a();nl();$();le();P();Re();jr();w();j();A();si=new Map,HI=Xe(".inlineMediaEmbed"),zI=Xe(".withFooter]:","childrenMessageContent:"),jI=Xe("renderSimpleAccessories)"),D0=I("message","searchResult"),bd=/(?o(R,{onClick:()=>si.clear()},"Clear the linked message cache")}});Td=y({name:"MessageLinkEmbeds",description:"Adds a preview to messages that link another message",authors:[d.TheSun,d.Ven,d.RyanCaoDev],dependencies:["MessageAccessoriesAPI"],settings:ol,start(){Ss("messageLinkEmbed",e=>bd.test(e.message.content)?(bd.lastIndex=0,o(_,null,o(QI,{message:e.message}))):null,4)}})});var B0=g(()=>{});var xd,F0=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/messageLogger/deleteStyleOverlay.css",{name:"src/plugins/messageLogger/deleteStyleOverlay.css",source:`.messagelogger-deleted { +`,classNames:{},dom:null});rd="src/plugins/imageZoom/styles.css"});var Fe,sS,id,od=g(()=>{"use strict";a();Mt();$();Ve();Ra();P();Wr();M();I();rS();ed();iS();Fe=D({saveZoomValues:{type:3,description:"Whether to save zoom and lens size values",default:!0},invertScroll:{type:3,description:"Invert scroll",default:!0},nearestNeighbour:{type:3,description:"Use Nearest Neighbour Interpolation when scaling images",default:!1},square:{type:3,description:"Make the lens square",default:!1},zoom:{description:"Zoom of the lens",type:5,markers:Go(1,50,4),default:2,stickToMarkers:!1},size:{description:"Radius / Size of the lens",type:5,markers:Go(50,1e3,50),default:100,stickToMarkers:!1},zoomSpeed:{description:"How fast the zoom / lens size changes",type:5,markers:Go(.1,5,.2),default:.5,stickToMarkers:!1}}),sS=e=>()=>{e.push(o(U.MenuGroup,{id:"image-zoom"},o(U.MenuCheckboxItem,{id:"vc-square",label:"Square Lens",checked:Fe.store.square,action:()=>{Fe.store.square=!Fe.store.square,gn.close()}}),o(U.MenuCheckboxItem,{id:"vc-nearest-neighbour",label:"Nearest Neighbour",checked:Fe.store.nearestNeighbour,action:()=>{Fe.store.nearestNeighbour=!Fe.store.nearestNeighbour,gn.close()}}),o(U.MenuControlItem,{id:"vc-zoom",label:"Zoom",control:(t,n)=>o(U.MenuSliderControl,{ref:n,...t,minValue:1,maxValue:50,value:Fe.store.zoom,onChange:bn(r=>Fe.store.zoom=r,100)})}),o(U.MenuControlItem,{id:"vc-size",label:"Lens Size",control:(t,n)=>o(U.MenuSliderControl,{ref:n,...t,minValue:50,maxValue:1e3,value:Fe.store.size,onChange:bn(r=>Fe.store.size=r,100)})}),o(U.MenuControlItem,{id:"vc-zoom-speed",label:"Zoom Speed",control:(t,n)=>o(U.MenuSliderControl,{ref:n,...t,minValue:.1,maxValue:5,value:Fe.store.zoomSpeed,onChange:bn(r=>Fe.store.zoomSpeed=r,100),renderValue:r=>`${r.toFixed(3)}x`})})))},id=y({name:"ImageZoom",description:"Lets you zoom in to images and gifs. Use scroll wheel to zoom in and shift + scroll wheel to increase lens radius / size",authors:[p.Aria],tags:["ImageUtilities"],patches:[{find:"Messages.OPEN_IN_BROWSER",replacement:{match:/return.{1,200}\.wrapper.{1,200}src:\i,/g,replace:`$&id: '${hs}',`}},{find:"handleImageLoad=",replacement:[{match:/showThumbhashPlaceholder:\i,/,replace:"...$self.makeProps(this),$&"},{match:/componentDidMount\(\){/,replace:"$&$self.renderMagnifier(this);"},{match:/componentWillUnmount\(\){/,replace:"$&$self.unMountMagnifier();"}]},{find:".carouselModal",replacement:{match:/(?<=\.carouselModal.{0,100}onClick:)\i,/,replace:"()=>{},"}}],settings:Fe,currentMagnifierElement:null,element:null,Magnifier:nd,root:null,makeProps(e){return{onMouseOver:()=>this.onMouseOver(e),onMouseOut:()=>this.onMouseOut(e),onMouseDown:t=>this.onMouseDown(t,e),onMouseUp:()=>this.onMouseUp(e),id:e.props.id}},renderMagnifier(e){e.props.id===hs&&(this.currentMagnifierElement||(this.currentMagnifierElement=o(nd,{size:Fe.store.size,zoom:Fe.store.zoom,instance:e}),this.root=sr.createRoot(this.element),this.root.render(this.currentMagnifierElement)))},unMountMagnifier(){this.root?.unmount(),this.currentMagnifierElement=null,this.root=null},onMouseOver(e){e.setState(t=>({...t,mouseOver:!0}))},onMouseOut(e){e.setState(t=>({...t,mouseOver:!1}))},onMouseDown(e,t){e.button===0&&t.setState(n=>({...n,mouseDown:!0}))},onMouseUp(e){e.setState(t=>({...t,mouseDown:!1}))},start(){St(rd),ue("image-context",sS),this.element=document.createElement("div"),this.element.classList.add("MagnifierContainer"),document.body.appendChild(this.element)},stop(){$t(rd),this.root&&this.root.unmount(),this.element?.remove(),fe("image-context",sS)}})});function fI(e){let t=e?.message?.content,[n,r]=O.useState("password");return o(qe,{...e},o(at,null,o(S.FormTitle,{tag:"h4"},"Decrypt Message")),o(tt,null,o(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Message with Encryption"),o(et,{defaultValue:t,disabled:!0}),o(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Password"),o(et,{style:{marginBottom:"20px"},onChange:r})),o(Ft,null,o(E,{color:E.Colors.GREEN,onClick:()=>{let i=sd(t,n,!0);!i||!e?.message||(Vencord.Plugins.plugins.InvisibleChat.buildEmbed(e?.message,i),e.onClose())}},"Decrypt"),o(E,{color:E.Colors.TRANSPARENT,look:E.Looks.LINK,style:{left:15,position:"absolute"},onClick:e.onClose},"Cancel")))}function aS(e){Ke(t=>o(fI,{...t,...e}))}var lS=g(()=>{"use strict";a();dt();I();el()});function gI(e){let[t,n]=O.useState(""),[r,i]=O.useState(""),[s,l]=O.useState("password"),[c,u]=O.useState(!1),d=t&&(c||r&&r.trim().split(" ").length>1);return o(qe,{...e},o(at,null,o(S.FormTitle,{tag:"h4"},"Encrypt Message")),o(tt,null,o(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Secret"),o(et,{onChange:m=>{n(m)}}),o(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Cover (2 or more Words!!)"),o(et,{disabled:c,onChange:m=>{i(m)}}),o(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Password"),o(et,{style:{marginBottom:"20px"},defaultValue:"password",onChange:m=>{l(m)}}),o(pt,{value:c,onChange:m=>{u(m)}},"Don't use a Cover")),o(Ft,null,o(E,{color:E.Colors.GREEN,disabled:!d,onClick:()=>{if(!d)return;let m=pS(t,s,c?"d d":r),h=c?m.replaceAll("d",""):m;!h||(uo(h),e.onClose())}},"Send"),o(E,{color:E.Colors.TRANSPARENT,look:E.Looks.LINK,style:{left:15,position:"absolute"},onClick:()=>{e.onClose()}},"Cancel")))}function cS(){Ke(e=>o(gI,{...e}))}var uS=g(()=>{"use strict";a();It();dt();I();el()});function hI(){return o("svg",{fill:"var(--header-secondary)",width:24,height:24,viewBox:"0 0 64 64"},o("path",{d:"M 32 9 C 24.832 9 19 14.832 19 22 L 19 27.347656 C 16.670659 28.171862 15 30.388126 15 33 L 15 49 C 15 52.314 17.686 55 21 55 L 43 55 C 46.314 55 49 52.314 49 49 L 49 33 C 49 30.388126 47.329341 28.171862 45 27.347656 L 45 22 C 45 14.832 39.168 9 32 9 z M 32 13 C 36.963 13 41 17.038 41 22 L 41 27 L 23 27 L 23 22 C 23 17.038 27.037 13 32 13 z"}))}function yI(){return o(V,{text:"This message has a hidden message! (InvisibleChat)"},({onMouseEnter:e,onMouseLeave:t})=>o("img",{"aria-label":"Hidden Message Indicator (InvisibleChat)",onMouseEnter:e,onMouseLeave:t,src:"https://github.com/SammCheese/invisible-chat/raw/NewReplugged/src/assets/lock.png",width:20,height:20,style:{transform:"translateY(4p)",paddingInline:4}}))}function vI(e){return e.type.analyticsName!=="normal"?null:o(V,{text:"Encrypt Message"},({onMouseEnter:t,onMouseLeave:n})=>o("div",{style:{display:"flex"}},o(E,{"aria-haspopup":"dialog","aria-label":"Encrypt Message",size:"",look:Xt.BLANK,onMouseEnter:t,onMouseLeave:n,innerClassName:vt.button,onClick:()=>cS(),style:{padding:"0 2px",scale:"0.9"}},o("div",{className:vt.buttonWrapper},o("svg",{"aria-hidden":!0,role:"img",width:"32",height:"32",viewBox:"0 0 64 64",style:{scale:"1.1"}},o("path",{fill:"currentColor",d:"M 32 9 C 24.832 9 19 14.832 19 22 L 19 27.347656 C 16.670659 28.171862 15 30.388126 15 33 L 15 49 C 15 52.314 17.686 55 21 55 L 43 55 C 46.314 55 49 52.314 49 49 L 49 33 C 49 30.388126 47.329341 28.171862 45 27.347656 L 45 22 C 45 14.832 39.168 9 32 9 z M 32 13 C 36.963 13 41 17.038 41 22 L 41 27 L 23 27 L 23 22 C 23 17.038 27.037 13 32 13 z"}))))))}function pS(e,t,n){return ad.hide(e+"\u200B",t,n)}function sd(e,t,n){let r=ad.reveal(e,t);return n?r.replace("\u200B",""):r}function SI(e){return e.endsWith("\u200B")}async function bI(e){let t=dS.store.savedPasswords.split(",").map(r=>r.trim());if(!e?.content||!t?.length)return!1;let{content:n}=e;/^\W/.test(e.content)&&(n=`d ${e.content}d`);for(let r=0;r{"use strict";a();Ir();$();le();P();Wa();M();I();lS();uS();dS=D({savedPasswords:{type:0,default:"password, Password",description:"Saved Passwords (Seperated with a , )"}}),ld=y({name:"InvisibleChat",description:"Encrypt your Messages in a non-suspicious way!",authors:[p.SammCheese],dependencies:["MessagePopoverAPI"],patches:[{find:".Messages.MESSAGE_EDITED,",replacement:{match:/let\{className:\i,message:\i[^}]*\}=(\i)/,replace:"try {$1 && $self.INV_REGEX.test($1.message.content) ? $1.content.push($self.indicator()) : null } catch {};$&"}},{find:"ChannelTextAreaButtons",replacement:{match:/(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/,replace:"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()"}}],EMBED_API_URL:"https://embed.sammcheese.net",INV_REGEX:new RegExp(/( \u200c|\u200d |[\u2060-\u2064])[^\u200b]/),URL_REGEX:new RegExp(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/),settings:dS,async start(){let{default:e}=await f1();ad=new e(!0,!1),Un("invDecrypt",t=>this.INV_REGEX.test(t?.content)?{label:"Decrypt Message",icon:this.popOverIcon,message:t,channel:Q.getChannel(t.channel_id),onClick:async()=>{await bI(t).then(n=>n?void this.buildEmbed(t,n):void aS({message:t}))}}:null)},stop(){$n("invDecrypt")},async getEmbed(e){let{body:t}=await wt.post({url:"/unfurler/embed-urls",body:{urls:[e]}});return await t.embeds[0]},async buildEmbed(e,t){let n=t.match(this.URL_REGEX);if(e.embeds.push({type:"rich",title:"Decrypted Message",color:"0x45f5f5",description:t,footer:{text:"Made with \u2764\uFE0F by c0dine and Sammy!"}}),n?.length){let r=await this.getEmbed(new URL(n[0]));r&&e.embeds.push(r)}this.updateMessage(e)},updateMessage:e=>{B.dispatch({type:"MESSAGE_UPDATE",message:e})},chatBarIcon:_.wrap(vI,{noop:!0}),popOverIcon:()=>o(hI,null),indicator:_.wrap(yI,{noop:!0})})});function mS(e,t){!Q.hasChannel(t)||pr.transitionTo(`/channels/${e??"@me"}/${t}`)}var tl,wn,cd,fS=g(()=>{"use strict";a();Kn();P();M();I();tl=!1;cd=y({name:"KeepCurrentChannel",description:"Attempt to navigate to the channel you were in before switching accounts or loading Discord.",authors:[p.Nuckyz],flux:{LOGOUT(e){({isSwitchingAccount:tl}=e)},CONNECTION_OPEN(){!tl||(tl=!1,wn?.channelId&&mS(wn.guildId,wn.channelId))},async CHANNEL_SELECT({guildId:e,channelId:t}){tl||(wn={guildId:e,channelId:t},await Vt("KeepCurrentChannel_previousData",wn))}},async start(){wn=await Pt("KeepCurrentChannel_previousData"),wn?wn.channelId&&mS(wn.guildId,wn.channelId):(wn={guildId:sn.getGuildId(),channelId:Ae.getChannelId()??null},await Vt("KeepCurrentChannel_previousData",wn))}})});async function ud(e){return(await ur.fetchAssetIds(pd,[e]))[0]}function wI(e){B.dispatch({type:"LOCAL_ACTIVITY_UPDATE",activity:e,socketId:"LastFM"})}var pd,TI,gS,xI,Mn,dd,hS=g(()=>{"use strict";a();$();mo();P();Je();M();j();I();pd="1108588077900898414",TI="2a96cbd8b46e442fc41c2b86b821562f",gS=new ie("LastFMRichPresence"),xI=A("getLocalPresence");Mn=D({username:{description:"last.fm username",type:0},apiKey:{description:"last.fm api key",type:0},shareUsername:{description:"show link to last.fm profile",type:3,default:!1},hideWithSpotify:{description:"hide last.fm presence if spotify is running",type:3,default:!0},statusName:{description:"custom status text",type:0,default:"some music"},nameFormat:{description:"Show name of song and artist in status name",type:4,options:[{label:"Use custom status name",value:"status-name",default:!0},{label:"Use format 'artist - song'",value:"artist-first"},{label:"Use format 'song - artist'",value:"song-first"},{label:"Use artist name only",value:"artist"},{label:"Use song name only",value:"song"}]},useListeningStatus:{description:'show "Listening to" status instead of "Playing"',type:3,default:!1},missingArt:{description:"When album or album art is missing",type:4,options:[{label:"Use large Last.fm logo",value:"lastfmLogo",default:!0},{label:"Use generic placeholder",value:"placeholder"}]}}),dd=y({name:"LastFMRichPresence",description:"Little plugin for Last.fm rich presence",authors:[p.dzshn,p.RuiNtD,p.blahajZip,p.archeruwu],settingsAboutComponent:()=>o(f,null,o(S.FormTitle,{tag:"h3"},"How to get an API key"),o(S.FormText,null,"An API key is required to fetch your current track. To get one, you can visit ",o(it,{href:"https://www.last.fm/api/account/create"},"this page")," and fill in the following information: ",o("br",null)," ",o("br",null),"Application name: Discord Rich Presence ",o("br",null),"Application description: (personal use) ",o("br",null)," ",o("br",null),"And copy the API key (not the shared secret!)")),settings:Mn,start(){this.updatePresence(),this.updateInterval=setInterval(()=>{this.updatePresence()},16e3)},stop(){clearInterval(this.updateInterval)},async fetchTrackData(){if(!Mn.store.username||!Mn.store.apiKey)return null;try{let e=new URLSearchParams({method:"user.getrecenttracks",api_key:Mn.store.apiKey,user:Mn.store.username,limit:"1",format:"json"}),t=await fetch(`https://ws.audioscrobbler.com/2.0/?${e}`);if(!t.ok)throw`${t.status} ${t.statusText}`;let n=await t.json();if(n.error)return gS.error("Error from Last.fm API",`${n.error}: ${n.message}`),null;let r=n.recenttracks?.track[0];return r?.["@attr"]?.nowplaying?{name:r.name||"Unknown",album:r.album["#text"],artist:r.artist["#text"]||"Unknown",url:r.url,imageUrl:r.image?.find(i=>i.size==="large")?.["#text"]}:null}catch(e){return gS.error("Failed to query Last.fm API",e),null}},async updatePresence(){wI(await this.getActivity())},getLargeImage(e){if(e.imageUrl&&!e.imageUrl.includes(TI))return e.imageUrl;if(Mn.store.missingArt==="placeholder")return"placeholder"},async getActivity(){if(Mn.store.hideWithSpotify){for(let s of xI.getActivities())if(s.type===2&&s.application_id!==pd)return null}let e=await this.fetchTrackData();if(!e)return null;let t=this.getLargeImage(e),n=t?{large_image:await ud(t),large_text:e.album||void 0,small_image:await ud("lastfm-small"),small_text:"Last.fm"}:{large_image:await ud("lastfm-large"),large_text:e.album||void 0},r=[{label:"View Song",url:e.url}];Mn.store.shareUsername&&r.push({label:"Last.fm Profile",url:`https://www.last.fm/user/${Mn.store.username}`});let i=(()=>{switch(Mn.store.nameFormat){case"artist-first":return e.artist+" - "+e.name;case"song-first":return e.name+" - "+e.artist;case"artist":return e.artist;case"song":return e.name;default:return Mn.store.statusName}})();return{application_id:pd,name:i,details:e.name,state:e.artist,assets:n,buttons:r.map(s=>s.label),metadata:{button_urls:r.map(s=>s.url)},type:Mn.store.useListeningStatus?2:0,flags:1}}})});var yS,vS,md,SS=g(()=>{"use strict";a();$();P();M();yS=["Eyrokac","Rdcg$l`'k|~n",'H`tf$d&iajo+d`{"',"Sucqplh`(Eclhualva()&","Lncgmka'8KNMDC,shpanf'`x./,","Ioqweijnfn*IeuvfvAotkfxo./,","Hd{#cp\x7Ft$)nbd!{lq%mig~*\x7Fh`v#mk&sm{gx nd#idjb(a\x7Ffao\"bja&amdkge!Rlo\xECkhf)hyedfjjb*'^hzdrdmm$lu'|ao+mnqw$fijxh~bbmg#Tjm\xEEefd+fnp#lpkffz5","h",`sijklm&cam*rot"hjjq'|ak\x7F xmv#wc'ep*mawmvvlrb(|ynr>"Aqq&cgg-\x7F ugoh%rom)e\x7Fhdpp%$`,'Tnfb}"u\'~`nno!kp$vvhfzeyee"a}%Tfam*Xh`fls%Jboldos-"lj`&hn)~ce!`jcbct|)gdbhnf$wikm$zgaxkmc%afely+og"144?\'ign+iu%p$qisiefr gpfa$',"Ndtfv%ahfgk+ghtf$|ir(|z' Oguaw&`ggdj mgw$|ir(me|n","(!\u0363\xB3$\u0359\u0290'\u0369\xB9#","(\uFF88\u25D7\u30ED\u25D1,\uFF8F-2\uFF6C\uFF95\u272C","Ynw#hjil(ze+psgwp|&sgmkr!","Tikmolh`(fl+a!dvjk\x7F'y|e\x7Fe/,-","3/3750?5><9>885:7","mdmt","Wdn`khc+(oxbeof","Ig\"zkp*'g{*xolglj`&~g|*gowg/$mgt(Eclm`.#ticf{l*xed\"wl`&Kangj igbhqn'd`dn `v#lqrw{3%$bhv-h|)kangj_imwhlhb","Tscmw%Tnoa~x",'I\u2018f#npus(ec`e!vl$lhsm{`ncu"ekw&f(defeov-$Rnf|)sdu\u2018pf$wcam{ceg!vl$du\'D`d~x-"jw%oi(okht-"DJP)Kag\x7Fs,!mq$du\'A\u2010|n sg`akrkq)~jkdl#pj&diefbnf"jp)&@F\\*{ltq#Hlhrp\'',"Ynw$v`&cg`dl fml`%rhlhs*","Dnl$p%qhz{s' hv$w%hh|aceg!;#gpvt(fl+cndea`&dg|fon&v#wjjqm(","\uD83D)pft`gs(ec`e!13$qojmz#",`a!njcmr'ide~nu"lb%rheoedldpz$lu'gbkr`,'dn"zkp&kg\x7Fo4',"hnpqkw",'sn"fau\x7F','Sn"tmqnh}}*musvkaw&flf&+ldv$w%lr{}*aulr#vlao|)cetn"jp$',"Dxkmc%ot(hhxomwwai\x7F'{hln",`hd{#}js&(pe~'sg#gprb(3#"`,"hd{b${","<;vqkijbq33271:56<3799?24944:",`Thof$lu'ofdn,!qsefc'az*bnrcma+&Om{o+iu"\`khct$)bnrd"bcdoi&`,"snofplkb{)c\x7F'r\"lod\x7F'|f*aurv#cpno`abchijklmno","Wdn`khc'|f*eghl{%"],vS=D({replaceEvents:{description:"Replace Event Quotes too",type:3,default:!0}}),md=y({name:"LoadingQuotes",description:"Replace Discords loading quotes",authors:[p.Ven,p.KraXen72],settings:vS,patches:[{find:".LOADING_DID_YOU_KNOW}",replacement:[{match:/\._loadingText=function\(\)\{/,replace:"$&return $self.quote;"},{match:/\._eventLoadingText=function\(\)\{/,replace:"$&return $self.quote;",predicate:()=>vS.store.replaceEvents}]}],xor(e){let t="read if cute",n=Array.from(e,(r,i)=>r.charCodeAt(0)^i%t.length);return String.fromCharCode(...n)},get quote(){return this.xor(yS[Math.floor(Math.random()*yS.length)])}})});function PI(){let{id:e,guild_id:t}=We([Ae],()=>ti()),{groups:n}=We([TS],()=>TS.getProps(t,e)),r=We([bS],()=>bS.getMemberCount(t));if(r==null)return null;let i=n.length===1&&n[0].id==="unknown"?0:n.reduce((s,l)=>s+(l.id==="offline"?0:l.count),0);return o(ye,{id:"vc-membercount",style:{marginTop:"1em",paddingInline:"1em",justifyContent:"center",alignContent:"center",gap:0}},o(V,{text:`${nl(i)} online in this channel`,position:"bottom"},s=>o("div",{...s},o("span",{style:{backgroundColor:"var(--green-360)",width:"12px",height:"12px",borderRadius:"50%",display:"inline-block",marginRight:"0.5em"}}),o("span",{style:{color:"var(--green-360)"}},nl(i)))),o(V,{text:`${nl(r)} total server members`,position:"bottom"},s=>o("div",{...s},o("span",{style:{width:"6px",height:"6px",borderRadius:"50%",border:"3px solid var(--primary-400)",display:"inline-block",marginRight:"0.5em",marginLeft:"1em"}}),o("span",{style:{color:"var(--primary-400)"}},nl(r)))))}var bS,TS,MI,nl,fd,xS=g(()=>{"use strict";a();le();Dt();P();It();M();j();I();bS=Ie("GuildMemberCountStore"),TS=Ie("ChannelMemberStore"),MI=new Intl.NumberFormat,nl=e=>MI.format(e);fd=y({name:"MemberCount",description:"Shows the amount of online & total members in the server member list",authors:[p.Ven,p.Commandtechno],patches:[{find:"{isSidebarVisible:",replacement:{match:/(?<=let\{className:(\i),.+?children):\[(\i\.useMemo[^}]+"aria-multiselectable")/,replace:":[$1?.startsWith('members')?$self.render():null,$2"}}],render:_.wrap(PI,{noop:!0})})});var gd,wS,MS,ys,hd,PS=g(()=>{"use strict";a();Xn();$();P();M();j();I();gd=!1,wS=e=>e.key==="Backspace"&&(gd=!0),MS=e=>e.key==="Backspace"&&(gd=!1),ys=D({enableDeleteOnClick:{type:3,description:"Enable delete on click while holding backspace",default:!0},enableDoubleClickToEdit:{type:3,description:"Enable double click to edit",default:!0},enableDoubleClickToReply:{type:3,description:"Enable double click to reply",default:!0},requireModifier:{type:3,description:"Only do double click actions when shift/ctrl is held",default:!1}}),hd=y({name:"MessageClickActions",description:"Hold Backspace and click to delete, double click to edit/reply",authors:[p.Ven],dependencies:["MessageEventsAPI"],settings:ys,start(){let e=A("deleteMessage","startEditMessage"),t=A("isEditing","isEditingAny");document.addEventListener("keydown",wS),document.addEventListener("keyup",MS),this.onClick=cp((n,r,i)=>{let s=n.author.id===W.getCurrentUser().id;if(gd)ys.store.enableDeleteOnClick&&(s||Re.can(Te.MANAGE_MESSAGES,r))&&(n.deleted?B.dispatch({type:"MESSAGE_DELETE",channelId:r.id,id:n.id,mlDeleted:!0}):e.deleteMessage(r.id,n.id),i.preventDefault());else{if(i.detail<2||ys.store.requireModifier&&!i.ctrlKey&&!i.shiftKey||r.guild_id&&!Re.can(Te.SEND_MESSAGES,r))return;if(s){if(!ys.store.enableDoubleClickToEdit||t.isEditing(r.id,n.id))return;e.startEditMessage(r.id,n.id,n.content),i.preventDefault()}else{if(!ys.store.enableDoubleClickToReply)return;B.dispatch({type:"CREATE_PENDING_REPLY",channel:r,message:n,shouldMention:!L.plugins.NoReplyMention.enabled,showMentionToggle:r.guild_id!==null})}}})},stop(){up(this.onClick),document.removeEventListener("keydown",wS),document.removeEventListener("keyup",MS)}})});var vd={};Ue(vd,{_modifyAccessories:()=>II,accessories:()=>ol,addAccessory:()=>vs,removeAccessory:()=>yd});function vs(e,t,n){ol.set(e,{callback:t,position:n})}function yd(e){ol.delete(e)}function II(e,t){for(let n of ol.values()){let r=n.callback(t);if(r!=null){if(!Array.isArray(r))r=[r];else if(r.length===0)continue;e.splice(n.position!=null?n.position<0?e.length+n.position:n.position:e.length,0,...r.filter(i=>i!=null))}}return e}var ol,rl=g(()=>{"use strict";a();ol=new Map});async function RI(e,t){let n=li.get(t);if(n)return n.message;li.set(t,{fetched:!1});let i=(await wt.get({url:`/channels/${e}/messages`,query:{limit:1,around:t},retries:2}).catch(()=>null))?.body?.[0];if(!i)return;let s=Cn.getMessages(i.channel_id).receiveMessage(i).get(i.id);return li.set(s.id,{message:s,fetched:!0}),s}function LI(e){let t=[];for(let{content_type:n,height:r,width:i,url:s,proxy_url:l}of e.attachments??[])n?.startsWith("image/")&&t.push({height:r,width:i,url:s,proxyURL:l});for(let{type:n,image:r,thumbnail:i,url:s}of e.embeds??[])n==="image"?t.push({...r??i}):s&&n==="gifv"&&!AS.test(s)&&t.push({height:i.height,width:i.width,url:s});return t}function EI(e,t){return!e&&!t?"":e?t?`[no content, ${e} attachment${e!==1?"s":""} and ${t} embed${t!==1?"s":""}]`:`[no content, ${e} attachment${e!==1?"s":""}]`:`[no content, ${t} embed${t!==1?"s":""}]`}function DI(e){return!!(e.components.length||e.attachments.some(t=>!t.content_type?.startsWith("image/"))||e.embeds.some(t=>t.type!=="image"&&(t.type!=="gifv"||AS.test(t.url))))}function OI(e,t){if(e>t){let s=Math.min(e,400);return{width:s,height:Math.round(t/(e/s))}}let i=Math.min(t,300);return{width:Math.round(e/(t/i)),height:i}}function _I(e,t){return new Proxy(e,{get(n,r){return r==="vencordEmbeddedBy"?t:Reflect.get(...arguments)}})}function BI({message:e}){let t=e.vencordEmbeddedBy??[],n=[],r=null;for(;(r=Sd.exec(e.content))!==null;){let[i,s,l,c]=r;if(t.includes(c))continue;let u=Q.getChannel(l);if(!u||s!=="@me"&&!Re.can(1024n,u))continue;let{listMode:d,idList:m}=il.store,h=[s,l,e.author.id].some(b=>b&&m.includes(b));if(d==="blacklist"&&h||d==="whitelist"&&!h)continue;let v=li.get(c)?.message;if(!v)if(v??=Cn.getMessage(l,c),v)li.set(c,{message:v,fetched:!0});else{let b={...e};delete b.embeds,delete b.interaction,kI.push(()=>RI(l,c).then(x=>x&&B.dispatch({type:"MESSAGE_UPDATE",message:b})));continue}let T={message:_I(v,[...t,e.id]),channel:u,guildID:s},w=il.store.automodEmbeds;n.push(w==="always"||w==="prefer"&&!DI(v)?o(UI,{...T}):o(FI,{...T}))}return n.length?o(f,null,n):null}function FI({message:e,channel:t,guildID:n}){let r=n==="@me",i=!r&&we.getGuild(t.guild_id),s=W.getUser(Q.getChannel(t.id).recipients?.[0]);return o(AI,{embed:{rawDescription:"",color:"var(--background-secondary)",author:{name:o(oe,{variant:"text-xs/medium",tag:"span"},o("span",null,r?"Direct Message - ":i.name+" - "),r?$e.parse(`<@${s.id}>`):$e.parse(`<#${t.id}>`)),iconProxyURL:i?`https://${window.GLOBAL_ENV.CDN_HOST}/icons/${i.id}/${i.icon}.png`:`https://${window.GLOBAL_ENV.CDN_HOST}/avatars/${s.id}/${s.avatar}`}},renderDescription:()=>o("div",{key:e.id,className:re(IS.message,il.store.messageBackgroundColor&&IS.searchResult)},o(CI,{id:`message-link-embeds-${e.id}`,message:e,channel:t,subscribeToComponentDispatch:!1}))})}function UI(e){let{message:t,channel:n,guildID:r}=e,i=lc.MessageDisplayCompact.useSetting(),s=r==="@me",l=LI(t),{parse:c}=$e;return o(NI,{channel:n,childrenAccessories:o(oe,{color:"text-muted",variant:"text-xs/medium",tag:"span"},c(s?`<@${Q.getChannel(n.id).recipients[0]}>`:`<#${n.id}>`),o("span",null,s?" - Direct Message":" - "+we.getGuild(n.guild_id)?.name)),compact:i,content:o(f,null,t.content||t.attachments.length<=l.length?c(t.content):[EI(t.attachments.length,t.embeds.length)],l.map(u=>{let{width:d,height:m}=OI(u.width,u.height);return o("div",null,o("img",{src:u.url,width:d,height:m}))})),hideTimestamp:!1,message:t,_messageEmbed:"automod"})}var li,AI,NI,CI,IS,Sd,AS,kI,il,bd,NS=g(()=>{"use strict";a();rl();$();le();P();Be();qr();Oe();M();j();I();li=new Map,AI=me(()=>Bt(".inlineMediaEmbed")),NI=me(()=>Bt(".withFooter]:","childrenMessageContent:")),CI=me(()=>st(e=>e.type?.toString()?.includes("renderSimpleAccessories)"))),IS=A("message","searchResult"),Sd=/(?o(E,{onClick:()=>li.clear()},"Clear the linked message cache")}});bd=y({name:"MessageLinkEmbeds",description:"Adds a preview to messages that link another message",authors:[p.TheSun,p.Ven,p.RyanCaoDev],dependencies:["MessageAccessoriesAPI"],settings:il,start(){vs("messageLinkEmbed",e=>Sd.test(e.message.content)?(Sd.lastIndex=0,o(_,null,o(BI,{message:e.message}))):null,4)}})});var CS=g(()=>{});var Td,kS=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/messageLogger/deleteStyleOverlay.css",{name:"src/plugins/messageLogger/deleteStyleOverlay.css",source:`.messagelogger-deleted { background-color: rgba(240 71 71 / 15%) !important; } -`,classNames:{},dom:null});xd="src/plugins/messageLogger/deleteStyleOverlay.css"});var wd,U0=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/messageLogger/deleteStyleText.css",{name:"src/plugins/messageLogger/deleteStyleText.css",source:`/* Message content highlighting */ +`,classNames:{},dom:null});Td="src/plugins/messageLogger/deleteStyleOverlay.css"});var xd,RS=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/messageLogger/deleteStyleText.css",{name:"src/plugins/messageLogger/deleteStyleText.css",source:`/* Message content highlighting */ .messagelogger-deleted [class*="contents"] > :is(div, h1, h2, h3, p) { color: #f04747 !important; } @@ -131,15 +124,15 @@ ${Qi(r.join(", ")+` color: #be3535 !important; text-decoration: underline; } -`,classNames:{},dom:null});wd="src/plugins/messageLogger/deleteStyleText.css"});function $0(){E.plugins.MessageLogger.deleteStyle==="text"?(St(wd),Ft(xd)):(Ft(wd),St(xd))}var tA,G0,H0,z0,Md,j0=g(()=>{"use strict";a();B0();Pt();$();Je();le();P();Ze();w();j();A();F0();U0();tA=I("edited","communicationDisabled","isSystemMessage");G0="ml-remove-history",H0="ml-toggle-style",z0=(e,t)=>()=>{let{message:n}=t,{deleted:r,editHistory:i,id:s,channel_id:l}=n;if(!r&&!i?.length)return;e:{if(!r)break e;let c=document.getElementById(`chat-messages-${l}-${s}`);if(!c)break e;e.push(o(G.MenuItem,{id:H0,key:H0,label:"Toggle Deleted Highlight",action:()=>c.classList.toggle("messagelogger-deleted")}))}e.push(o(G.MenuItem,{id:G0,key:G0,label:"Remove Message History",color:"danger",action:()=>{r?F.dispatch({type:"MESSAGE_DELETE",channelId:l,id:s,mlDeleted:!0}):n.editHistory=[]}}))},Md=y({name:"MessageLogger",description:"Temporarily logs deleted and edited messages.",authors:[d.rushii,d.Ven,d.AutumnVN],start(){$0(),ce("message",z0)},stop(){de("message",z0)},renderEdit(e){return o(_,{noop:!0},o("div",{className:"messagelogger-edited"},Fe.parse(e.content),o(Gn,{timestamp:e.timestamp,isEdited:!0,isInline:!1},o("span",{className:tA.edited}," ","(",ot.Messages.MESSAGE_EDITED,")"))))},makeEdit(e,t){return{timestamp:mn?.call(e.edited_timestamp),content:t.content}},options:{deleteStyle:{type:4,description:"The style of deleted messages",default:"text",options:[{label:"Red text",value:"text",default:!0},{label:"Red overlay",value:"overlay"}],onChange:()=>$0()},ignoreBots:{type:3,description:"Whether to ignore messages by bots",default:!1},ignoreSelf:{type:3,description:"Whether to ignore messages by yourself",default:!1},ignoreUsers:{type:0,description:"Comma-separated list of user IDs to ignore",default:""},ignoreChannels:{type:0,description:"Comma-separated list of channel IDs to ignore",default:""},ignoreGuilds:{type:0,description:"Comma-separated list of guild IDs to ignore",default:""}},handleDelete(e,t,n){try{if(e==null||!n&&!e.has(t.id))return e;let r=i=>{let s=e.get(i);if(!s)return;let l=64;t.mlDeleted||(s.flags&l)===l||this.shouldIgnore(s)?e=e.remove(i):e=e.update(i,u=>u.set("deleted",!0).set("attachments",u.attachments.map(p=>(p.deleted=!0,p))))};n?t.ids.forEach(r):r(t.id)}catch(r){new ie("MessageLogger").error("Error during handleDelete",r)}return e},shouldIgnore(e){let{ignoreBots:t,ignoreSelf:n,ignoreUsers:r,ignoreChannels:i,ignoreGuilds:s}=E.plugins.MessageLogger,l=W.getCurrentUser().id;return t&&e.author?.bot||n&&e.author?.id===l||r.includes(e.author?.id)||i.includes(e.channel_id)||i.includes(Q.getChannel(e.channel_id)?.parent_id)||s.includes(Q.getChannel(e.channel_id)?.guild_id)},patches:[{find:'displayName="MessageStore"',replacement:[{match:/MESSAGE_DELETE:function\((\i)\){let.+?((?:\i\.){2})getOrCreate.+?},/,replace:"MESSAGE_DELETE:function($1){ var cache = $2getOrCreate($1.channelId); cache = $self.handleDelete(cache, $1, false); $2commit(cache);},"},{match:/MESSAGE_DELETE_BULK:function\((\i)\){let.+?((?:\i\.){2})getOrCreate.+?},/,replace:"MESSAGE_DELETE_BULK:function($1){ var cache = $2getOrCreate($1.channelId); cache = $self.handleDelete(cache, $1, true); $2commit(cache);},"},{match:/(MESSAGE_UPDATE:function\((\i)\).+?)\.update\((\i)/,replace:"$1.update($3,m => (($2.message.flags & 64) === 64 || $self.shouldIgnore($2.message)) ? m : $2.message.content !== m.editHistory?.[0]?.content && $2.message.content !== m.content ? m.set('editHistory',[...(m.editHistory || []), $self.makeEdit($2.message, m)]) : m).update($3"},{match:/(?<=getLastEditableMessage\(\i\)\{.{0,200}\.find\((\i)=>)/,replace:"!$1.deleted &&"}]},{find:"}addReaction(",replacement:[{match:/this\.customRenderedContent=(\i)\.customRenderedContent,/,replace:"this.customRenderedContent = $1.customRenderedContent,this.deleted = $1.deleted || false,this.editHistory = $1.editHistory || [],"}]},{find:"THREAD_STARTER_MESSAGE?null===",replacement:[{match:/interactionData:(\i)\.interactionData/,replace:"interactionData:$1.interactionData,deleted:$1.deleted,editHistory:$1.editHistory,attachments:$1.attachments"},{match:/attachments:(\i)\((\i)\)/,replace:"attachments: $1((() => { if ($self.shouldIgnore($2)) return $2; let old = arguments[1]?.attachments; if (!old) return $2; let new_ = $2.attachments?.map(a => a.id) ?? []; let diff = old.filter(a => !new_.includes(a.id)); old.forEach(a => a.deleted = true); $2.attachments = [...diff, ...$2.attachments]; return $2;})()),deleted: arguments[1]?.deleted,editHistory: arguments[1]?.editHistory"},{match:/(\((\i)\){return null==\2\.attachments.+?)spoiler:/,replace:"$1deleted: arguments[0]?.deleted,spoiler:"}]},{find:".removeAttachmentHoverButton",replacement:[{match:/(className:\i,attachment:\i),/,replace:"$1,attachment: {deleted},"},{match:/\[\i\.obscured\]:.+?,/,replace:"$& 'messagelogger-deleted-attachment': deleted,"}]},{find:"Message must not be a thread starter message",replacement:[{match:/\)\("li",\{(.+?),className:/,replace:')("li",{$1,className:(arguments[0].message.deleted ? "messagelogger-deleted " : "")+'}]},{find:'Messages.MESSAGE_EDITED,")"',replacement:[{match:/(\)\("div",\{id:.+?children:\[)/,replace:"$1 (arguments[0].message.editHistory?.length > 0 ? arguments[0].message.editHistory.map(edit => $self.renderEdit(edit)) : null), "}]},{find:'displayName="ReferencedMessageStore"',replacement:[{match:/MESSAGE_DELETE:function\((\i)\).+?},/,replace:"MESSAGE_DELETE:function($1){},"},{match:/MESSAGE_DELETE_BULK:function\((\i)\).+?},/,replace:"MESSAGE_DELETE_BULK:function($1){},"}]},{find:"useMessageMenu:",replacement:[{match:/children:(\[""===.+?\])/,replace:"children:arguments[0].message.deleted?[]:$1"}]}]})});function W0(e){Qr({name:e.name,description:e.name,inputType:1,execute:async(t,n)=>await rl(e.name)?(E.plugins.MessageTags.clyde&&ue(n.channel.id,{content:`${jo} The tag **${e.name}** has been sent!`}),{content:e.message.replaceAll("\\n",` -`)}):(ue(n.channel.id,{content:`${jo} The tag **${e.name}** does not exist anymore! Please reload ur Discord to fix :)`}),{content:`/${e.name}`}),[nA]:!0},"CustomTags")}var jo,sl,nA,il,rl,oA,rA,Pd,q0=g(()=>{"use strict";a();Qt();Wn();$();P();w();jo="<:luna:1035316192220553236>",sl="MessageTags_TAGS",nA=Symbol("MessageTags"),il=()=>It(sl).then(e=>e??[]),rl=e=>It(sl).then(t=>(t??[]).find(n=>n.name===e)??null),oA=async e=>{let t=await il();return t.push(e),Xt(sl,t),t},rA=async e=>{let t=await il();return t=await t.filter(n=>n.name!==e),Xt(sl,t),t};Pd=y({name:"MessageTags",description:"Allows you to save messages and to use them with a simple command.",authors:[d.Luna],options:{clyde:{name:"Clyde message on send",description:"If enabled, clyde will send you an ephemeral message when a tag was used.",type:3,default:!0}},dependencies:["CommandsAPI"],async start(){for(let e of await il())W0(e)},commands:[{name:"tags",description:"Manage all the tags for yourself",inputType:0,options:[{name:"create",description:"Create a new tag",type:1,options:[{name:"tag-name",description:"The name of the tag to trigger the response",type:3,required:!0},{name:"message",description:"The message that you will send when using this tag",type:3,required:!0}]},{name:"list",description:"List all tags from yourself",type:1,options:[]},{name:"delete",description:"Remove a tag from your yourself",type:1,options:[{name:"tag-name",description:"The name of the tag to trigger the response",type:3,required:!0}]},{name:"preview",description:"Preview a tag without sending it publicly",type:1,options:[{name:"tag-name",description:"The name of the tag to trigger the response",type:3,required:!0}]}],async execute(e,t){switch(e[0].name){case"create":{let n=it(e[0].options,"tag-name",""),r=it(e[0].options,"message","");if(await rl(n))return ue(t.channel.id,{content:`${jo} A Tag with the name **${n}** already exists!`});let i={name:n,enabled:!0,message:r};W0(i),await oA(i),ue(t.channel.id,{content:`${jo} Successfully created the tag **${n}**!`});break}case"delete":{let n=it(e[0].options,"tag-name","");if(!await rl(n))return ue(t.channel.id,{content:`${jo} A Tag with the name **${n}** does not exist!`});ts(n),await rA(n),ue(t.channel.id,{content:`${jo} Successfully deleted the tag **${n}**!`});break}case"list":{ue(t.channel.id,{embeds:[{title:"All Tags:",description:(await il()).map(n=>`\`${n.name}\`: ${n.message.slice(0,72).replaceAll("\\n"," ")}${n.message.length>72?"...":""}`).join(` -`)||`${jo} Woops! There are no tags yet, use \`/tags create\` to create one!`,color:14122879,type:"rich"}]});break}case"preview":{let n=it(e[0].options,"tag-name",""),r=await rl(n);if(!r)return ue(t.channel.id,{content:`${jo} A Tag with the name **${n}** does not exist!`});ue(t.channel.id,{content:r.message.replaceAll("\\n",` -`)});break}default:{ue(t.channel.id,{content:"Invalid sub-command"});break}}}}]})});function iA(e){let t="";for(let n=0;n{"use strict";a();Qt();P();w();Id=y({name:"MoreCommands",description:"echo, lenny, mock",authors:[d.Arjix,d.echo,d.Samu],dependencies:["CommandsAPI"],commands:[{name:"echo",description:"Sends a message as Clyde (locally)",options:[Bo],inputType:3,execute:(e,t)=>{let n=it(e,"message","");ue(t.channel.id,{content:n})}},{name:"lenny",description:"Sends a lenny face",options:[Bo],execute:e=>({content:it(e,"message","")+" ( \u0361\xB0 \u035C\u0296 \u0361\xB0)"})},{name:"mock",description:"mOcK PeOpLe",options:[es],execute:e=>({content:iA(it(e,"message",""))})}]})});var Ad,Y0=g(()=>{"use strict";a();Qt();P();w();Ad=y({name:"MoreKaomoji",description:"Adds more Kaomoji to discord. \u30FD(\xB4\u25BD`)/",authors:[d.JacobTm],dependencies:["CommandsAPI"],commands:[{name:"dissatisfaction",description:" \uFF1E\uFE4F\uFF1C"},{name:"smug",description:" \u0CA0_\u0CA0"},{name:"happy",description:" \u30FD(\xB4\u25BD`)/"},{name:"crying",description:" \u0CA5_\u0CA5"},{name:"angry",description:" \u30FD(\uFF40\u0414\xB4)\uFF89"},{name:"anger",description:" \u30FD(\uFF4F`\u76BF\u2032\uFF4F)\uFF89"},{name:"joy",description:" <(\uFFE3\uFE36\uFFE3)>"},{name:"blush",description:"\u0AEE \u02F6\u1D54 \u1D55 \u1D54\u02F6 \u10D0"},{name:"confused",description:"(\u2022\u0E34_\u2022\u0E34)?"},{name:"sleeping",description:"(\u1D17_\u1D17)"},{name:"laughing",description:"o(\u2267\u25BD\u2266)o"}].map(e=>({...e,options:[Bo],execute:t=>({content:it(t,"message","")+e.description})}))})});function aA(e){Wo.store.tagSettings??=Nd;let[t,n]=J(Wo.store.tagSettings),r=i=>{n(i),e.setValue(i)};return o(ge,{flexDirection:"column"},ai.map(i=>o(wt,{style:{padding:"1em 1em 0"}},o(S.FormTitle,{style:{width:"fit-content"}},o(V,{text:i.description},({onMouseEnter:s,onMouseLeave:l})=>o("div",{onMouseEnter:s,onMouseLeave:l},i.displayName," Tag ",o(uo,{type:uo.Types[i.name]})))),o(Ve,{type:"text",value:t[i.name]?.text??i.displayName,placeholder:`Text on tag (default: ${i.displayName})`,onChange:s=>{t[i.name].text=s,r(t)},className:q.bottom16}),o(pt,{value:t[i.name]?.showInChat??!0,onChange:s=>{t[i.name].showInChat=s,r(t)},hideBorder:!0},"Show in messages"),o(pt,{value:t[i.name]?.showInNotChat??!0,onChange:s=>{t[i.name].showInNotChat=s,r(t)},hideBorder:!0},"Show in member list and profiles"))))}var sA,uo,Z0,ai,Nd,Wo,Cd,X0=g(()=>{"use strict";a();$();Lt();P();at();w();j();A();sA=I("computePermissions","canEveryoneRole"),uo=un(e=>e.Types?.[0]==="BOT"),Z0=(e,t)=>!!e?.webhookId&&t.isNonUserBot(),ai=[{name:"WEBHOOK",displayName:"Webhook",description:"Messages sent by webhooks",condition:Z0},{name:"OWNER",displayName:"Owner",description:"Owns the server",condition:(e,t,n)=>Te.getGuild(n?.guild_id)?.ownerId===t.id},{name:"ADMINISTRATOR",displayName:"Admin",description:"Has the administrator permission",permissions:["ADMINISTRATOR"]},{name:"MODERATOR_STAFF",displayName:"Staff",description:"Can manage the server, channels or roles",permissions:["MANAGE_GUILD","MANAGE_CHANNELS","MANAGE_ROLES"]},{name:"MODERATOR",displayName:"Mod",description:"Can manage messages or kick/ban people",permissions:["MANAGE_MESSAGES","KICK_MEMBERS","BAN_MEMBERS"]},{name:"VOICE_MODERATOR",displayName:"VC Mod",description:"Can manage voice chats",permissions:["MOVE_MEMBERS","MUTE_MEMBERS","DEAFEN_MEMBERS"]}],Nd=Object.fromEntries(ai.map(({name:e,displayName:t})=>[e,{text:t,showInChat:!0,showInNotChat:!0}]));Wo=D({dontShowForBots:{description:"Don't show extra tags for bots (excluding webhooks)",type:3},dontShowBotTag:{description:"Only show extra tags for bots / Hide [BOT] text",type:3},tagSettings:{type:6,component:aA,description:"fill me"}}),Cd=y({name:"MoreUserTags",description:"Adds tags for webhooks and moderative roles (owner, admin, etc.)",authors:[d.Cyn,d.TheSun,d.RyanCaoDev,d.LordElias,d.AutumnVN],settings:Wo,patches:[{find:"BotTagTypes:",replacement:{match:/\((\i)=\{\}\)\)\[(\i)\.BOT/,replace:"($1=$self.getTagTypes()))[$2.BOT"}},{find:".DISCORD_SYSTEM_MESSAGE_BOT_TAG_TOOLTIP,",replacement:[{match:/(switch\((\i)\){.+?)case (\i(?:\.\i)?)\.BOT:default:(\i)=(\i\.\i\.Messages)\.BOT_TAG_BOT/,replace:(e,t,n,r,i,s)=>`${t}default:{${i} = $self.getTagText(${r}[${n}], ${s})}`},{match:/(\i)=(\i)===\i(?:\.\i)?\.ORIGINAL_POSTER/,replace:"$1=$self.isOPTag($2)"},{match:/.botText,children:(\i)}\)]/,replace:"$&,'data-tag':$1.toLowerCase()"}]},{find:"renderSystemTag:",replacement:{match:/;return\((\(null==\i\?void 0:\i\.isSystemDM\(\).+?.Types.ORIGINAL_POSTER\)),null==(\i)\)/,replace:";$1;$2=$self.getTag({...arguments[0],origType:$2,location:'chat'});return $2 == null"}},{find:".Messages.GUILD_OWNER,",replacement:{match:/(?\i)=\(null==.{0,100}\.BOT;return null!=(?\i)&&\i\.bot/,replace:"$ = $self.getTag({user: $, channel: arguments[0].channel, origType: $.bot ? 0 : null, location: 'not-chat' }); return typeof $ === 'number'"}},{find:".hasAvatarForGuild(null==",replacement:{match:/(?=usernameIcon:)/,replace:"moreTags_channelId:arguments[0].channelId,"}},{find:'copyMetaData:"User Tag"',replacement:{match:/(?=,botClass:)/,replace:",moreTags_channelId:arguments[0].moreTags_channelId"}},{find:",overrideDiscriminator:",replacement:[{match:/user:\i,nick:\i,/,replace:"$&moreTags_channelId,"},{match:/,botType:(\i\((\i)\)),/g,replace:",botType:$self.getTag({user:$2,channelId:moreTags_channelId,origType:$1,location:'not-chat'}),"}]}],start(){if(!Wo.store.tagSettings)if(!Wo.store.visibility_WEBHOOK)Wo.store.tagSettings=Nd;else{let e={...Nd};Object.entries(Vencord.PlainSettings.plugins.MoreUserTags).forEach(([t,n])=>{let[r,i]=t.split("_");if(r==="visibility")switch(n){case"always":break;case"chat":e[i].showInNotChat=!1;break;case"not-chat":e[i].showInChat=!1;break;case"never":e[i].showInChat=!1,e[i].showInNotChat=!1;break}Wo.store.tagSettings=e,delete Vencord.Settings.plugins.MoreUserTags[t]})}},getPermissions(e,t){let n=Te.getGuild(t?.guild_id);if(!n)return[];let r=sA.computePermissions({user:e,context:n,overwrites:t.permissionOverwrites});return Object.entries(Se).map(([i,s])=>r&s?i:"").filter(Boolean)},getTagTypes(){let e={},t=100;return ai.forEach(({name:n})=>{e[n]=++t,e[t]=n,e[`${n}-BOT`]=++t,e[t]=`${n}-BOT`,e[`${n}-OP`]=++t,e[t]=`${n}-OP`}),e},isOPTag:e=>e===uo.Types.ORIGINAL_POSTER||ai.some(t=>e===uo.Types[`${t.name}-OP`]),getTagText(e,t){if(!e)return t.BOT_TAG_BOT;let[n,r]=e.split("-"),i=ai.find(({name:l})=>n===l);if(!i||r==="BOT"&&n!=="WEBHOOK"&&this.settings.store.dontShowForBots)return t.BOT_TAG_BOT;let s=Wo.store.tagSettings?.[i.name]?.text||i.displayName;switch(r){case"OP":return`${t.BOT_TAG_FORUM_ORIGINAL_POSTER} \u2022 ${s}`;case"BOT":return`${t.BOT_TAG_BOT} \u2022 ${s}`;default:return s}},getTag({message:e,user:t,channelId:n,origType:r,location:i,channel:s}){if(!t)return null;if(i==="chat"&&t.id==="1")return uo.Types.OFFICIAL;if(t.isClyde())return uo.Types.AI;let l=typeof r=="number"?r:null;if(s??=Q.getChannel(n),!s)return l;let c=this.settings.store,u=this.getPermissions(t,s);for(let p of ai)if(!(i==="chat"&&!c.tagSettings[p.name].showInChat)&&!(i==="not-chat"&&!c.tagSettings[p.name].showInNotChat)&&(p.permissions?.some(m=>u.includes(m))||p.condition?.(e,t,s))){s.isForumPost()&&s.ownerId===t.id?l=uo.Types[`${p.name}-OP`]:t.bot&&!Z0(e,t)&&!c.dontShowBotTag?l=uo.Types[`${p.name}-BOT`]:l=uo.Types[p.name];break}return l}})});function uA(e,t){let n=0,r=0;for(;(r=e.indexOf(t,r)+1)!==0;)n++;return n}function pA(e,t){if(!t.global)throw new Error("pattern must be global");let n=0;for(;t.test(e);)n++;return n}function mA(e){let t=uA(e,Rd)+pA(e,dA);return Math.min(t,10)}function kd(){if(!qo.store.triggerWhenUnfocused&&!document.hasFocus())return;let e=document.createElement("audio");e.src=qo.store.quality==="HD"?cA:lA,e.volume=qo.store.volume,e.play()}var Rd,lA,cA,qo,Ld,dA,J0=g(()=>{"use strict";a();$();Iu();P();Re();w();A();Rd="\u{1F5FF}",lA="https://raw.githubusercontent.com/MeguminSama/VencordPlugins/main/plugins/moyai/moyai.mp3",cA="https://raw.githubusercontent.com/MeguminSama/VencordPlugins/main/plugins/moyai/moyai_hd.wav",qo=D({volume:{description:"Volume of the \u{1F5FF}\u{1F5FF}\u{1F5FF}",type:5,markers:Fo(0,1,.1),default:.5,stickToMarkers:!1},quality:{description:"Quality of the \u{1F5FF}\u{1F5FF}\u{1F5FF}",type:4,options:[{label:"Normal",value:"Normal",default:!0},{label:"HD",value:"HD"}]},triggerWhenUnfocused:{description:"Trigger the \u{1F5FF} even when the window is unfocused",type:3,default:!0},ignoreBots:{description:"Ignore bots",type:3,default:!0},ignoreBlocked:{description:"Ignore blocked users",type:3,default:!0}}),Ld=y({name:"Moyai",authors:[d.Megu,d.Nuckyz],description:"\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}",settings:qo,flux:{async MESSAGE_CREATE({optimistic:e,type:t,message:n,channelId:r}){if(e||t!=="MESSAGE_CREATE"||n.state==="SENDING"||qo.store.ignoreBots&&n.author?.bot||qo.store.ignoreBlocked&&nt.isBlocked(n.author?.id)||!n.content||r!==Pe.getChannelId())return;let i=mA(n.content);for(let s=0;s/gi});var al,Ed,Q0=g(()=>{"use strict";a();$();P();w();j();al=D({guild:{description:"Mute Guild",type:3,default:!0},everyone:{description:"Suppress @everyone and @here",type:3,default:!0},role:{description:"Suppress All Role @mentions",type:3,default:!0}}),Ed=y({name:"MuteNewGuild",description:"Mutes newly joined guilds",authors:[d.Glitch,d.Nuckyz,d.carince],patches:[{find:",acceptInvite(",replacement:{match:/INVITE_ACCEPT_SUCCESS.+?,(\i)=null!==.+?;/,replace:(e,t)=>`${e}$self.handleMute(${t});`}},{find:"{joinGuild:",replacement:{match:/guildId:(\i),lurker:(\i).{0,20}}\)\);/,replace:(e,t,n)=>`${e}if(!${n})$self.handleMute(${t});`}}],settings:al,handleMute(e){e==="@me"||e==="null"||e==null||pn("updateGuildNotificationSettings").updateGuildNotificationSettings(e,{muted:al.store.guild,suppress_everyone:al.store.everyone,suppress_roles:al.store.role})}})});function vA(e){return e.name||e.recipients.map(W.getUser).filter(wp).map(t=>nt.getNickname(t.id)||hA.getName(t)).join(", ")}var fA,gA,hA,Ko,yA,Dd,V0=g(()=>{"use strict";a();P();$a();w();j();A();fA=I("selectPrivateChannel"),gA=I("getChannelIconURL"),hA=I("getGlobalName"),Ko=I("emptyIconFriends","emptyIconGuilds"),yA=I("guildNick","guildAvatarWithoutIcon");Dd=y({name:"MutualGroupDMs",description:"Shows mutual group dms in profiles",authors:[d.amia],patches:[{find:".Messages.USER_PROFILE_MODAL",replacement:{match:/(?<=\.MUTUAL_GUILDS\}\),)(?=(\i\.bot).{0,20}(\(0,\i\.jsx\)\(.{0,100}id:))/,replace:'($1||arguments[0].isCurrentUser)?null:$2"MUTUAL_GDMS",children:"Mutual Groups"}),'}},{find:".UserProfileSections.USER_INFO_CONNECTIONS:",replacement:{match:/(?<={user:(\i),onClose:(\i)}\);)(?=case \i\.\i\.MUTUAL_FRIENDS)/,replace:'case "MUTUAL_GDMS":return $self.renderMutualGDMs($1,$2);'}}],renderMutualGDMs(e,t){let n=Q.getSortedPrivateChannels().filter(r=>r.isGroupDM()&&r.recipients.includes(e.id)).map(r=>o(Dr,{className:Ko.listRow,onClick:()=>{t(),fA.selectPrivateChannel(r.id)}},o(Or,{src:gA.getChannelIconURL({id:r.id,icon:r.icon,size:32}),size:"SIZE_40",className:Ko.listAvatar}),o("div",{className:Ko.listRowContent},o("div",{className:Ko.listName},vA(r)),o("div",{className:yA.guildNick},r.recipients.length+1," Members"))));return o(Er,{className:Ko.listScroller,fade:!0,onClose:t},n.length>0?n:o("div",{className:Ko.empty},o("div",{className:Ko.emptyIconFriends}),o("div",{className:Ko.emptyText},"No group dms in common")))}})});var SA,Od,eS=g(()=>{"use strict";a();$();P();w();j();SA=I("getRelationships","isBlocked"),Od=y({name:"NoBlockedMessages",description:"Hides all blocked messages from chat completely.",authors:[d.rushii,d.Samu],patches:[{find:"Messages.BLOCKED_MESSAGES_HIDE",replacement:[{match:/let\{[^}]*collapsedReason[^}]*\}/,replace:"return null;$&"}]},...['displayName="MessageStore"','displayName="ReadStateStore"'].map(e=>({find:e,predicate:()=>E.plugins.NoBlockedMessages.ignoreBlockedMessages===!0,replacement:[{match:/(?<=MESSAGE_CREATE:function\((\i)\){)/,replace:(t,n)=>`if($self.isBlocked(${n}.message))return;`}]}))],options:{ignoreBlockedMessages:{description:"Completely ignores (recent) incoming messages from blocked users (locally).",type:3,default:!1,restartNeeded:!0}},isBlocked:e=>SA.isBlocked(e.author.id)})});var _d,tS=g(()=>{"use strict";a();P();w();_d=y({name:"NoDevtoolsWarning",description:"Disables the 'HOLD UP' banner in the console. As a side effect, also prevents Discord from hiding your token, which prevents random logouts.",authors:[d.Ven],patches:[{find:"setDevtoolsCallbacks",replacement:{match:/if\(null!=\i&&"0.0.0"===\i\.remoteApp\.getVersion\(\)\)/,replace:"if(true)"}}]})});var Bd,nS=g(()=>{"use strict";a();P();w();Bd=y({name:"NoF1",description:"Disables F1 help bind.",authors:[d.Cyn],patches:[{find:',"f1"],comboKeysBindGlobal:',replacement:{match:',"f1"],comboKeysBindGlobal:',replace:"],comboKeysBindGlobal:"}}]})});var Fd,oS=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/noMosaic/styles.css",{name:"src/plugins/noMosaic/styles.css",source:`[class^="nonMediaAttachmentsContainer_"] [class*="messageAttachment_"] { +`,classNames:{},dom:null});xd="src/plugins/messageLogger/deleteStyleText.css"});function LS(){L.plugins.MessageLogger.deleteStyle==="text"?(St(xd),$t(Td)):($t(xd),St(Td))}var $I,ES,DS,OS,wd,_S=g(()=>{"use strict";a();CS();Mt();$();Ve();le();P();Je();M();j();I();kS();RS();$I=A("edited","communicationDisabled","isSystemMessage");ES="ml-remove-history",DS="ml-toggle-style",OS=(e,t)=>()=>{let{message:n}=t,{deleted:r,editHistory:i,id:s,channel_id:l}=n;if(!r&&!i?.length)return;e:{if(!r)break e;let c=document.getElementById(`chat-messages-${l}-${s}`);if(!c)break e;e.push(o(U.MenuItem,{id:DS,key:DS,label:"Toggle Deleted Highlight",action:()=>c.classList.toggle("messagelogger-deleted")}))}e.push(o(U.MenuItem,{id:ES,key:ES,label:"Remove Message History",color:"danger",action:()=>{r?B.dispatch({type:"MESSAGE_DELETE",channelId:l,id:s,mlDeleted:!0}):n.editHistory=[]}}))},wd=y({name:"MessageLogger",description:"Temporarily logs deleted and edited messages.",authors:[p.rushii,p.Ven,p.AutumnVN],start(){LS(),ue("message",OS)},stop(){fe("message",OS)},renderEdit(e){return o(_,{noop:!0},o("div",{className:"messagelogger-edited"},$e.parse(e.content),o(Hn,{timestamp:e.timestamp,isEdited:!0,isInline:!1},o("span",{className:$I.edited}," ","(",Ct.Messages.MESSAGE_EDITED,")"))))},makeEdit(e,t){return{timestamp:hn?.call(e.edited_timestamp),content:t.content}},options:{deleteStyle:{type:4,description:"The style of deleted messages",default:"text",options:[{label:"Red text",value:"text",default:!0},{label:"Red overlay",value:"overlay"}],onChange:()=>LS()},ignoreBots:{type:3,description:"Whether to ignore messages by bots",default:!1},ignoreSelf:{type:3,description:"Whether to ignore messages by yourself",default:!1},ignoreUsers:{type:0,description:"Comma-separated list of user IDs to ignore",default:""},ignoreChannels:{type:0,description:"Comma-separated list of channel IDs to ignore",default:""},ignoreGuilds:{type:0,description:"Comma-separated list of guild IDs to ignore",default:""}},handleDelete(e,t,n){try{if(e==null||!n&&!e.has(t.id))return e;let r=i=>{let s=e.get(i);if(!s)return;let l=64;t.mlDeleted||(s.flags&l)===l||this.shouldIgnore(s)?e=e.remove(i):e=e.update(i,u=>u.set("deleted",!0).set("attachments",u.attachments.map(d=>(d.deleted=!0,d))))};n?t.ids.forEach(r):r(t.id)}catch(r){new ie("MessageLogger").error("Error during handleDelete",r)}return e},shouldIgnore(e){let{ignoreBots:t,ignoreSelf:n,ignoreUsers:r,ignoreChannels:i,ignoreGuilds:s}=L.plugins.MessageLogger,l=W.getCurrentUser().id;return t&&e.author?.bot||n&&e.author?.id===l||r.includes(e.author?.id)||i.includes(e.channel_id)||i.includes(Q.getChannel(e.channel_id)?.parent_id)||s.includes(Q.getChannel(e.channel_id)?.guild_id)},patches:[{find:'displayName="MessageStore"',replacement:[{match:/MESSAGE_DELETE:function\((\i)\){let.+?((?:\i\.){2})getOrCreate.+?},/,replace:"MESSAGE_DELETE:function($1){ var cache = $2getOrCreate($1.channelId); cache = $self.handleDelete(cache, $1, false); $2commit(cache);},"},{match:/MESSAGE_DELETE_BULK:function\((\i)\){let.+?((?:\i\.){2})getOrCreate.+?},/,replace:"MESSAGE_DELETE_BULK:function($1){ var cache = $2getOrCreate($1.channelId); cache = $self.handleDelete(cache, $1, true); $2commit(cache);},"},{match:/(MESSAGE_UPDATE:function\((\i)\).+?)\.update\((\i)/,replace:"$1.update($3,m => (($2.message.flags & 64) === 64 || $self.shouldIgnore($2.message)) ? m : $2.message.content !== m.editHistory?.[0]?.content && $2.message.content !== m.content ? m.set('editHistory',[...(m.editHistory || []), $self.makeEdit($2.message, m)]) : m).update($3"},{match:/(?<=getLastEditableMessage\(\i\)\{.{0,200}\.find\((\i)=>)/,replace:"!$1.deleted &&"}]},{find:"}addReaction(",replacement:[{match:/this\.customRenderedContent=(\i)\.customRenderedContent,/,replace:"this.customRenderedContent = $1.customRenderedContent,this.deleted = $1.deleted || false,this.editHistory = $1.editHistory || [],"}]},{find:"THREAD_STARTER_MESSAGE?null===",replacement:[{match:/interactionData:(\i)\.interactionData/,replace:"interactionData:$1.interactionData,deleted:$1.deleted,editHistory:$1.editHistory,attachments:$1.attachments"},{match:/attachments:(\i)\((\i)\)/,replace:"attachments: $1((() => { let old = arguments[1]?.attachments; if (!old) return $2; let new_ = $2.attachments?.map(a => a.id) ?? []; let diff = old.filter(a => !new_.includes(a.id)); old.forEach(a => a.deleted = true); $2.attachments = [...diff, ...$2.attachments]; return $2;})()),deleted: arguments[1]?.deleted,editHistory: arguments[1]?.editHistory"},{match:/(\((\i)\){return null==\2\.attachments.+?)spoiler:/,replace:"$1deleted: arguments[0]?.deleted,spoiler:"}]},{find:".removeAttachmentHoverButton",replacement:[{match:/(className:\i,attachment:\i),/,replace:"$1,attachment: {deleted},"},{match:/\[\i\.obscured\]:.+?,/,replace:"$& 'messagelogger-deleted-attachment': deleted,"}]},{find:"Message must not be a thread starter message",replacement:[{match:/\)\("li",\{(.+?),className:/,replace:')("li",{$1,className:(arguments[0].message.deleted ? "messagelogger-deleted " : "")+'}]},{find:'Messages.MESSAGE_EDITED,")"',replacement:[{match:/(\)\("div",\{id:.+?children:\[)/,replace:"$1 (arguments[0].message.editHistory?.length > 0 ? arguments[0].message.editHistory.map(edit => $self.renderEdit(edit)) : null), "}]},{find:'displayName="ReferencedMessageStore"',replacement:[{match:/MESSAGE_DELETE:function\((\i)\).+?},/,replace:"MESSAGE_DELETE:function($1){},"},{match:/MESSAGE_DELETE_BULK:function\((\i)\).+?},/,replace:"MESSAGE_DELETE_BULK:function($1){},"}]},{find:"useMessageMenu:",replacement:[{match:/children:(\[""===.+?\])/,replace:"children:arguments[0].message.deleted?[]:$1"}]}]})});function BS(e){ei({name:e.name,description:e.name,inputType:1,execute:async(t,n)=>await sl(e.name)?(L.plugins.MessageTags.clyde&&pe(n.channel.id,{author:Jn,content:`${Wo} The tag **${e.name}** has been sent!`}),{content:e.message.replaceAll("\\n",` +`)}):(pe(n.channel.id,{author:Jn,content:`${Wo} The tag **${e.name}** does not exist anymore! Please reload ur Discord to fix :)`}),{content:`/${e.name}`}),[GI]:!0},"CustomTags")}var Wo,ll,GI,Jn,al,sl,HI,zI,Md,FS=g(()=>{"use strict";a();tn();Kn();$();P();M();Wo="<:luna:1035316192220553236>",ll="MessageTags_TAGS",GI=Symbol("MessageTags"),Jn={id:"821472922140803112",bot:!1},al=()=>Pt(ll).then(e=>e??[]),sl=e=>Pt(ll).then(t=>(t??[]).find(n=>n.name===e)??null),HI=async e=>{let t=await al();return t.push(e),Vt(ll,t),t},zI=async e=>{let t=await al();return t=await t.filter(n=>n.name!==e),Vt(ll,t),t};Md=y({name:"MessageTags",description:"Allows you to save messages and to use them with a simple command.",authors:[p.Luna],options:{clyde:{name:"Clyde message on send",description:"If enabled, clyde will send you an ephemeral message when a tag was used.",type:3,default:!0}},dependencies:["CommandsAPI"],async start(){for(let e of await al())BS(e)},commands:[{name:"tags",description:"Manage all the tags for yourself",inputType:0,options:[{name:"create",description:"Create a new tag",type:1,options:[{name:"tag-name",description:"The name of the tag to trigger the response",type:3,required:!0},{name:"message",description:"The message that you will send when using this tag",type:3,required:!0}]},{name:"list",description:"List all tags from yourself",type:1,options:[]},{name:"delete",description:"Remove a tag from your yourself",type:1,options:[{name:"tag-name",description:"The name of the tag to trigger the response",type:3,required:!0}]},{name:"preview",description:"Preview a tag without sending it publicly",type:1,options:[{name:"tag-name",description:"The name of the tag to trigger the response",type:3,required:!0}]}],async execute(e,t){switch(e[0].name){case"create":{let n=rt(e[0].options,"tag-name",""),r=rt(e[0].options,"message","");if(await sl(n))return pe(t.channel.id,{author:Jn,content:`${Wo} A Tag with the name **${n}** already exists!`});let i={name:n,enabled:!0,message:r};BS(i),await HI(i),pe(t.channel.id,{author:Jn,content:`${Wo} Successfully created the tag **${n}**!`});break}case"delete":{let n=rt(e[0].options,"tag-name","");if(!await sl(n))return pe(t.channel.id,{author:Jn,content:`${Wo} A Tag with the name **${n}** does not exist!`});ns(n),await zI(n),pe(t.channel.id,{author:Jn,content:`${Wo} Successfully deleted the tag **${n}**!`});break}case"list":{pe(t.channel.id,{author:Jn,embeds:[{title:"All Tags:",description:(await al()).map(n=>`\`${n.name}\`: ${n.message.slice(0,72).replaceAll("\\n"," ")}${n.message.length>72?"...":""}`).join(` +`)||`${Wo} Woops! There are no tags yet, use \`/tags create\` to create one!`,color:14122879,type:"rich"}]});break}case"preview":{let n=rt(e[0].options,"tag-name",""),r=await sl(n);if(!r)return pe(t.channel.id,{author:Jn,content:`${Wo} A Tag with the name **${n}** does not exist!`});pe(t.channel.id,{author:Jn,content:r.message.replaceAll("\\n",` +`)});break}default:{pe(t.channel.id,{author:Jn,content:"Invalid sub-command"});break}}}}]})});function jI(e){let t="";for(let n=0;n{"use strict";a();tn();P();M();Pd=y({name:"MoreCommands",description:"echo, lenny, mock",authors:[p.Arjix,p.echo,p.Samu],dependencies:["CommandsAPI"],commands:[{name:"echo",description:"Sends a message as Clyde (locally)",options:[$o],inputType:3,execute:(e,t)=>{let n=rt(e,"message","");pe(t.channel.id,{content:n})}},{name:"lenny",description:"Sends a lenny face",options:[$o],execute:e=>({content:rt(e,"message","")+" ( \u0361\xB0 \u035C\u0296 \u0361\xB0)"})},{name:"mock",description:"mOcK PeOpLe",options:[ts],execute:e=>({content:jI(rt(e,"message",""))})}]})});var Id,$S=g(()=>{"use strict";a();tn();P();M();Id=y({name:"MoreKaomoji",description:"Adds more Kaomoji to discord. \u30FD(\xB4\u25BD`)/",authors:[p.JacobTm],dependencies:["CommandsAPI"],commands:[{name:"dissatisfaction",description:" \uFF1E\uFE4F\uFF1C"},{name:"smug",description:" \u0CA0_\u0CA0"},{name:"happy",description:" \u30FD(\xB4\u25BD`)/"},{name:"crying",description:" \u0CA5_\u0CA5"},{name:"angry",description:" \u30FD(\uFF40\u0414\xB4)\uFF89"},{name:"anger",description:" \u30FD(\uFF4F`\u76BF\u2032\uFF4F)\uFF89"},{name:"joy",description:" <(\uFFE3\uFE36\uFFE3)>"},{name:"blush",description:"\u0AEE \u02F6\u1D54 \u1D55 \u1D54\u02F6 \u10D0"},{name:"confused",description:"(\u2022\u0E34_\u2022\u0E34)?"},{name:"sleeping",description:"(\u1D17_\u1D17)"},{name:"laughing",description:"o(\u2267\u25BD\u2266)o"}].map(e=>({...e,options:[$o],execute:t=>({content:rt(t,"message","")+e.description})}))})});function qI(e){qo.store.tagSettings??=Ad;let[t,n]=J(qo.store.tagSettings),r=i=>{n(i),e.setValue(i)};return o(ye,{flexDirection:"column"},ci.map(i=>o(xt,{style:{padding:"1em 1em 0"}},o(S.FormTitle,{style:{width:"fit-content"}},o(V,{text:i.description},({onMouseEnter:s,onMouseLeave:l})=>o("div",{onMouseEnter:s,onMouseLeave:l},i.displayName," Tag ",o(ho,{type:ho.Types[i.name]})))),o(et,{type:"text",value:t[i.name]?.text??i.displayName,placeholder:`Text on tag (default: ${i.displayName})`,onChange:s=>{t[i.name].text=s,r(t)},className:Y.bottom16}),o(pt,{value:t[i.name]?.showInChat??!0,onChange:s=>{t[i.name].showInChat=s,r(t)},hideBorder:!0},"Show in messages"),o(pt,{value:t[i.name]?.showInNotChat??!0,onChange:s=>{t[i.name].showInNotChat=s,r(t)},hideBorder:!0},"Show in member list and profiles"))))}var WI,ho,GS,ci,Ad,qo,Nd,HS=g(()=>{"use strict";a();$();Dt();P();ct();M();j();I();WI=A("computePermissions","canEveryoneRole"),ho=Lt(e=>e.Types?.[0]==="BOT"),GS=(e,t)=>!!e?.webhookId&&t.isNonUserBot(),ci=[{name:"WEBHOOK",displayName:"Webhook",description:"Messages sent by webhooks",condition:GS},{name:"OWNER",displayName:"Owner",description:"Owns the server",condition:(e,t,n)=>we.getGuild(n?.guild_id)?.ownerId===t.id},{name:"ADMINISTRATOR",displayName:"Admin",description:"Has the administrator permission",permissions:["ADMINISTRATOR"]},{name:"MODERATOR_STAFF",displayName:"Staff",description:"Can manage the server, channels or roles",permissions:["MANAGE_GUILD","MANAGE_CHANNELS","MANAGE_ROLES"]},{name:"MODERATOR",displayName:"Mod",description:"Can manage messages or kick/ban people",permissions:["MANAGE_MESSAGES","KICK_MEMBERS","BAN_MEMBERS"]},{name:"VOICE_MODERATOR",displayName:"VC Mod",description:"Can manage voice chats",permissions:["MOVE_MEMBERS","MUTE_MEMBERS","DEAFEN_MEMBERS"]}],Ad=Object.fromEntries(ci.map(({name:e,displayName:t})=>[e,{text:t,showInChat:!0,showInNotChat:!0}]));qo=D({dontShowForBots:{description:"Don't show extra tags for bots (excluding webhooks)",type:3},dontShowBotTag:{description:"Only show extra tags for bots / Hide [BOT] text",type:3},tagSettings:{type:6,component:qI,description:"fill me"}}),Nd=y({name:"MoreUserTags",description:"Adds tags for webhooks and moderative roles (owner, admin, etc.)",authors:[p.Cyn,p.TheSun,p.RyanCaoDev,p.LordElias,p.AutumnVN],settings:qo,patches:[{find:"BotTagTypes:",replacement:{match:/\((\i)=\{\}\)\)\[(\i)\.BOT/,replace:"($1=$self.getTagTypes()))[$2.BOT"}},{find:".DISCORD_SYSTEM_MESSAGE_BOT_TAG_TOOLTIP,",replacement:[{match:/(switch\((\i)\){.+?)case (\i(?:\.\i)?)\.BOT:default:(\i)=(\i\.\i\.Messages)\.BOT_TAG_BOT/,replace:(e,t,n,r,i,s)=>`${t}default:{${i} = $self.getTagText(${r}[${n}], ${s})}`},{match:/(\i)=(\i)===\i(?:\.\i)?\.ORIGINAL_POSTER/,replace:"$1=$self.isOPTag($2)"},{match:/.botText,children:(\i)}\)]/,replace:"$&,'data-tag':$1.toLowerCase()"}]},{find:"renderSystemTag:",replacement:{match:/;return\((\(null==\i\?void 0:\i\.isSystemDM\(\).+?.Types.ORIGINAL_POSTER\)),null==(\i)\)/,replace:";$1;$2=$self.getTag({...arguments[0],origType:$2,location:'chat'});return $2 == null"}},{find:".Messages.GUILD_OWNER,",replacement:{match:/(?\i)=\(null==.{0,100}\.BOT;return null!=(?\i)&&\i\.bot/,replace:"$ = $self.getTag({user: $, channel: arguments[0].channel, origType: $.bot ? 0 : null, location: 'not-chat' }); return typeof $ === 'number'"}},{find:".hasAvatarForGuild(null==",replacement:{match:/(?=usernameIcon:)/,replace:"moreTags_channelId:arguments[0].channelId,"}},{find:'copyMetaData:"User Tag"',replacement:{match:/(?=,botClass:)/,replace:",moreTags_channelId:arguments[0].moreTags_channelId"}},{find:",overrideDiscriminator:",replacement:[{match:/user:\i,nick:\i,/,replace:"$&moreTags_channelId,"},{match:/,botType:(\i\((\i)\)),/g,replace:",botType:$self.getTag({user:$2,channelId:moreTags_channelId,origType:$1,location:'not-chat'}),"}]}],start(){if(!qo.store.tagSettings)if(!qo.store.visibility_WEBHOOK)qo.store.tagSettings=Ad;else{let e={...Ad};Object.entries(Vencord.PlainSettings.plugins.MoreUserTags).forEach(([t,n])=>{let[r,i]=t.split("_");if(r==="visibility")switch(n){case"always":break;case"chat":e[i].showInNotChat=!1;break;case"not-chat":e[i].showInChat=!1;break;case"never":e[i].showInChat=!1,e[i].showInNotChat=!1;break}qo.store.tagSettings=e,delete Vencord.Settings.plugins.MoreUserTags[t]})}},getPermissions(e,t){let n=we.getGuild(t?.guild_id);if(!n)return[];let r=WI.computePermissions({user:e,context:n,overwrites:t.permissionOverwrites});return Object.entries(Te).map(([i,s])=>r&s?i:"").filter(Boolean)},getTagTypes(){let e={},t=100;return ci.forEach(({name:n})=>{e[n]=++t,e[t]=n,e[`${n}-BOT`]=++t,e[t]=`${n}-BOT`,e[`${n}-OP`]=++t,e[t]=`${n}-OP`}),e},isOPTag:e=>e===ho.Types.ORIGINAL_POSTER||ci.some(t=>e===ho.Types[`${t.name}-OP`]),getTagText(e,t){if(!e)return t.BOT_TAG_BOT;let[n,r]=e.split("-"),i=ci.find(({name:l})=>n===l);if(!i||r==="BOT"&&n!=="WEBHOOK"&&this.settings.store.dontShowForBots)return t.BOT_TAG_BOT;let s=qo.store.tagSettings?.[i.name]?.text||i.displayName;switch(r){case"OP":return`${t.BOT_TAG_FORUM_ORIGINAL_POSTER} \u2022 ${s}`;case"BOT":return`${t.BOT_TAG_BOT} \u2022 ${s}`;default:return s}},getTag({message:e,user:t,channelId:n,origType:r,location:i,channel:s}){if(!t)return null;if(i==="chat"&&t.id==="1")return ho.Types.OFFICIAL;if(t.isClyde())return ho.Types.AI;let l=typeof r=="number"?r:null;if(s??=Q.getChannel(n),!s)return l;let c=this.settings.store,u=this.getPermissions(t,s);for(let d of ci)if(!(i==="chat"&&!c.tagSettings[d.name].showInChat)&&!(i==="not-chat"&&!c.tagSettings[d.name].showInNotChat)&&(d.permissions?.some(m=>u.includes(m))||d.condition?.(e,t,s))){s.isForumPost()&&s.ownerId===t.id?l=ho.Types[`${d.name}-OP`]:t.bot&&!GS(e,t)&&!c.dontShowBotTag?l=ho.Types[`${d.name}-BOT`]:l=ho.Types[d.name];break}return l}})});function ZI(e,t){let n=0,r=0;for(;(r=e.indexOf(t,r)+1)!==0;)n++;return n}function XI(e,t){if(!t.global)throw new Error("pattern must be global");let n=0;for(;t.test(e);)n++;return n}function QI(e){let t=ZI(e,kd)+XI(e,JI);return Math.min(t,10)}function Cd(){if(!Ko.store.triggerWhenUnfocused&&!document.hasFocus())return;let e=document.createElement("audio");e.src=Ko.store.quality==="HD"?YI:KI,e.volume=Ko.store.volume,e.play()}var kd,KI,YI,Ko,Rd,JI,zS=g(()=>{"use strict";a();$();Mu();P();Be();M();I();kd="\u{1F5FF}",KI="https://raw.githubusercontent.com/MeguminSama/VencordPlugins/main/plugins/moyai/moyai.mp3",YI="https://raw.githubusercontent.com/MeguminSama/VencordPlugins/main/plugins/moyai/moyai_hd.wav",Ko=D({volume:{description:"Volume of the \u{1F5FF}\u{1F5FF}\u{1F5FF}",type:5,markers:Go(0,1,.1),default:.5,stickToMarkers:!1},quality:{description:"Quality of the \u{1F5FF}\u{1F5FF}\u{1F5FF}",type:4,options:[{label:"Normal",value:"Normal",default:!0},{label:"HD",value:"HD"}]},triggerWhenUnfocused:{description:"Trigger the \u{1F5FF} even when the window is unfocused",type:3,default:!0},ignoreBots:{description:"Ignore bots",type:3,default:!0},ignoreBlocked:{description:"Ignore blocked users",type:3,default:!0}}),Rd=y({name:"Moyai",authors:[p.Megu,p.Nuckyz],description:"\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}",settings:Ko,flux:{async MESSAGE_CREATE({optimistic:e,type:t,message:n,channelId:r}){if(e||t!=="MESSAGE_CREATE"||n.state==="SENDING"||Ko.store.ignoreBots&&n.author?.bot||Ko.store.ignoreBlocked&&nt.isBlocked(n.author?.id)||!n.content||r!==Ae.getChannelId())return;let i=QI(n.content);for(let s=0;s/gi});var cl,Ld,jS=g(()=>{"use strict";a();$();P();M();j();cl=D({guild:{description:"Mute Guild",type:3,default:!0},everyone:{description:"Suppress @everyone and @here",type:3,default:!0},role:{description:"Suppress All Role @mentions",type:3,default:!0}}),Ld=y({name:"MuteNewGuild",description:"Mutes newly joined guilds",authors:[p.Glitch,p.Nuckyz,p.carince],patches:[{find:",acceptInvite(",replacement:{match:/INVITE_ACCEPT_SUCCESS.+?,(\i)=null!==.+?;/,replace:(e,t)=>`${e}$self.handleMute(${t});`}},{find:"{joinGuild:",replacement:{match:/guildId:(\i),lurker:(\i).{0,20}}\)\);/,replace:(e,t,n)=>`${e}if(!${n})$self.handleMute(${t});`}}],settings:cl,handleMute(e){e==="@me"||e==="null"||e==null||yt("updateGuildNotificationSettings").updateGuildNotificationSettings(e,{muted:cl.store.guild,suppress_everyone:cl.store.everyone,suppress_roles:cl.store.role})}})});function oA(e){return e.name||e.recipients.map(W.getUser).filter(Tp).map(t=>nt.getNickname(t.id)||tA.getName(t)).join(", ")}var VI,eA,tA,Yo,nA,Ed,WS=g(()=>{"use strict";a();P();Ha();M();j();I();VI=A("selectPrivateChannel"),eA=A("getChannelIconURL"),tA=A("getGlobalName"),Yo=A("emptyIconFriends","emptyIconGuilds"),nA=A("guildNick","guildAvatarWithoutIcon");Ed=y({name:"MutualGroupDMs",description:"Shows mutual group dms in profiles",authors:[p.amia],patches:[{find:".Messages.USER_PROFILE_MODAL",replacement:{match:/(?<=\.MUTUAL_GUILDS\}\),)(?=(\i\.bot).{0,20}(\(0,\i\.jsx\)\(.{0,100}id:))/,replace:'($1||arguments[0].isCurrentUser)?null:$2"MUTUAL_GDMS",children:"Mutual Groups"}),'}},{find:".UserProfileSections.USER_INFO_CONNECTIONS:",replacement:{match:/(?<={user:(\i),onClose:(\i)}\);)(?=case \i\.\i\.MUTUAL_FRIENDS)/,replace:'case "MUTUAL_GDMS":return $self.renderMutualGDMs($1,$2);'}}],renderMutualGDMs(e,t){let n=Q.getSortedPrivateChannels().filter(r=>r.isGroupDM()&&r.recipients.includes(e.id)).map(r=>o(Or,{className:Yo.listRow,onClick:()=>{t(),VI.selectPrivateChannel(r.id)}},o(_r,{src:eA.getChannelIconURL({id:r.id,icon:r.icon,size:32}),size:"SIZE_40",className:Yo.listAvatar}),o("div",{className:Yo.listRowContent},o("div",{className:Yo.listName},oA(r)),o("div",{className:nA.guildNick},r.recipients.length+1," Members"))));return o(Dr,{className:Yo.listScroller,fade:!0,onClose:t},n.length>0?n:o("div",{className:Yo.empty},o("div",{className:Yo.emptyIconFriends}),o("div",{className:Yo.emptyText},"No group dms in common")))}})});var rA,Dd,qS=g(()=>{"use strict";a();$();P();M();j();rA=A("getRelationships","isBlocked"),Dd=y({name:"NoBlockedMessages",description:"Hides all blocked messages from chat completely.",authors:[p.rushii,p.Samu],patches:[{find:"Messages.BLOCKED_MESSAGES_HIDE",replacement:[{match:/let\{[^}]*collapsedReason[^}]*\}/,replace:"return null;$&"}]},...['displayName="MessageStore"','displayName="ReadStateStore"'].map(e=>({find:e,predicate:()=>L.plugins.NoBlockedMessages.ignoreBlockedMessages===!0,replacement:[{match:/(?<=MESSAGE_CREATE:function\((\i)\){)/,replace:(t,n)=>`if($self.isBlocked(${n}.message))return;`}]}))],options:{ignoreBlockedMessages:{description:"Completely ignores (recent) incoming messages from blocked users (locally).",type:3,default:!1,restartNeeded:!0}},isBlocked:e=>rA.isBlocked(e.author.id)})});var Od,KS=g(()=>{"use strict";a();P();M();Od=y({name:"NoDevtoolsWarning",description:"Disables the 'HOLD UP' banner in the console. As a side effect, also prevents Discord from hiding your token, which prevents random logouts.",authors:[p.Ven],patches:[{find:"setDevtoolsCallbacks",replacement:{match:/if\(null!=\i&&"0.0.0"===\i\.remoteApp\.getVersion\(\)\)/,replace:"if(true)"}}]})});var _d,YS=g(()=>{"use strict";a();P();M();_d=y({name:"NoF1",description:"Disables F1 help bind.",authors:[p.Cyn],patches:[{find:',"f1"],comboKeysBindGlobal:',replacement:{match:',"f1"],comboKeysBindGlobal:',replace:"],comboKeysBindGlobal:"}}]})});var Bd,ZS=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/noMosaic/styles.css",{name:"src/plugins/noMosaic/styles.css",source:`[class^="nonMediaAttachmentsContainer_"] [class*="messageAttachment_"] { position: relative; } -`,classNames:{},dom:null});Fd="src/plugins/noMosaic/styles.css"});var Ud,$d,rS=g(()=>{"use strict";a();$();Je();P();w();oS();Ud=D({inlineVideo:{description:"Play videos without carousel modal",type:3,default:!0,restartNeeded:!0},mediaLayoutType:{description:"Choose media layout type",type:4,restartNeeded:!0,options:[{label:"STATIC, render loading image but image isn't resposive, no problem unless discord window width is too small",value:"STATIC",default:!0},{label:"RESPONSIVE, image is responsive but not render loading image, cause messages shift when loaded",value:"RESPONSIVE"}]}}),$d=y({name:"NoMosaic",authors:[d.AutumnVN],description:"Removes Discord new image mosaic",tags:["image","mosaic","media"],settings:Ud,patches:[{find:".oneByTwoLayoutThreeGrid",replacement:[{match:/mediaLayoutType:\i\.\i\.MOSAIC/,replace:"mediaLayoutType:$self.mediaLayoutType()"},{match:/null!==\(\i=\i\.get\(\i\)\)&&void 0!==\i\?\i:"INVALID"/,replace:'"INVALID"'}]},{find:"renderAttachments(",predicate:()=>Ud.store.inlineVideo,replacement:{match:/url:(\i)\.url\}\);return /,replace:"$&$1.content_type?.startsWith('image/')&&"}},{find:"Messages.REMOVE_ATTACHMENT_TOOLTIP_TEXT",replacement:{match:/\i===\i\.\i\.MOSAIC/,replace:"true"}}],mediaLayoutType(){return Ud.store.mediaLayoutType},start(){St(Fd)},stop(){Ft(Fd)}})});var bA,bs,Gd,iS=g(()=>{"use strict";a();$();P();w();j();bA=I("getMessageRequestsCount"),bs=D({hideFriendRequestsCount:{type:3,description:"Hide incoming friend requests count",default:!0,restartNeeded:!0},hideMessageRequestsCount:{type:3,description:"Hide message requests count",default:!0,restartNeeded:!0},hidePremiumOffersCount:{type:3,description:"Hide nitro offers count",default:!0,restartNeeded:!0}}),Gd=y({name:"NoPendingCount",description:"Removes the ping count of incoming friend requests, message requests, and nitro offers.",authors:[d.amia],settings:bs,patches:[{find:"getPendingCount(){",predicate:()=>bs.store.hideFriendRequestsCount,replacement:{match:/(?<=getPendingCount\(\)\{)/,replace:"return 0;"}},{find:"getMessageRequestsCount(){",predicate:()=>bs.store.hideMessageRequestsCount,replacement:{match:/(?<=getMessageRequestsCount\(\)\{)/,replace:"return 0;"}},{find:".getSpamChannelsCount(),",predicate:()=>bs.store.hideMessageRequestsCount,replacement:{match:/(?<=getSpamChannelsCount\(\),\i=)\i\.getMessageRequestsCount\(\)/,replace:"$self.getRealMessageRequestCount()"}},{find:"showProgressBadge:",predicate:()=>bs.store.hidePremiumOffersCount,replacement:{match:/(?<=\{unviewedTrialCount:(\i),unviewedDiscountCount:(\i)\}.{0,200}\i=)\1\+\2/,replace:"0"}}],getRealMessageRequestCount(){return bA.getMessageRequestChannelIds().size}})});var Hd,sS=g(()=>{"use strict";a();P();w();Hd=y({name:"NoProfileThemes",description:"Completely removes Nitro profile themes",authors:[d.TheKodeToad],patches:[{find:".NITRO_BANNER,",replacement:{match:/=(?=\i\.\i\.isPremiumAtLeast\(null==(\i))/,replace:"=(arguments[0]?.bannerSrc||$1?.banner)&&"}},{find:".avatarPositionPremiumNoBanner,default:",replacement:{match:/\.avatarPositionPremiumNoBanner(?=,default:\i\.(\i))/,replace:".$1"}},{find:"hasThemeColors(){",replacement:{match:/get canUsePremiumProfileCustomization\(\){return /,replace:"$&false &&"}}]})});var ll,zd,aS=g(()=>{"use strict";a();$();P();w();ll=D({userList:{description:"List of users to allow or exempt pings for (separated by commas or spaces)",type:0,default:"1234567890123445,1234567890123445"},shouldPingListed:{description:"Behaviour",type:4,options:[{label:"Do not ping the listed users",value:!1},{label:"Only ping the listed users",value:!0,default:!0}]},inverseShiftReply:{description:"Invert Discord's shift replying behaviour (enable to make shift reply mention user)",type:3,default:!1}}),zd=y({name:"NoReplyMention",description:"Disables reply pings by default",authors:[d.DustyAngel47,d.axyie,d.pylix,d.outfoxxed],settings:ll,shouldMention(e,t){let n=ll.store.userList.includes(e.author.id),r=ll.store.shouldPingListed?n:!n;return ll.store.inverseShiftReply?t!==r:!t&&r},patches:[{find:',"Message")}function',replacement:{match:/:(\i),shouldMention:!(\i)\.shiftKey/,replace:":$1,shouldMention:$self.shouldMention($1,$2.shiftKey)"}}]})});var jd,lS=g(()=>{"use strict";a();P();w();jd=y({name:"NoScreensharePreview",description:"Disables screenshare previews from being sent.",authors:[d.Nuckyz],patches:[{find:'"ApplicationStreamPreviewUploadManager"',replacement:{match:/await \i\.\i\.(makeChunkedRequest\(|post\(\{url:)\i\.\i\.STREAM_PREVIEW.+?\}\)/g,replace:"0"}}]})});var Wd,cS=g(()=>{"use strict";a();P();w();Wd=y({name:"NoTypingAnimation",authors:[d.AutumnVN],description:"Disables the CPU-intensive typing dots animation",patches:[{find:"dotCycle",replacement:{match:/document.hasFocus\(\)/,replace:"false"}}]})});var qd,uS=g(()=>{"use strict";a();P();w();qd=y({name:"NoUnblockToJump",description:"Allows you to jump to messages of blocked users without unblocking them",authors:[d.dzshn],patches:[{find:'.id,"Search Results"',replacement:{match:/if\(.{1,10}\)(.{1,10}\.show\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/,replace:"if(false)$1"}},{find:"renderJumpButton()",replacement:{match:/if\(.{1,10}\)(.{1,10}\.show\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/,replace:"if(false)$1"}},{find:"flash:!0,returnMessageId",replacement:{match:/.\?(.{1,10}\.show\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/,replace:"false?$1"}}]})});var Kd,pS=g(()=>{"use strict";a();P();w();Kd=y({name:"NormalizeMessageLinks",description:"Strip canary/ptb from message links",authors:[d.bb010g],patches:[{find:".Messages.COPY_MESSAGE_LINK,",replacement:{match:/\.concat\(location\.host\)/,replace:".concat($self.normalizeHost(location.host))"}}],normalizeHost(e){return e.replace(/(^|\b)(canary\.|ptb\.)(discord.com)$/,"$1$3")}})});var Yd,dS=g(()=>{"use strict";a();P();w();Yd=y({name:"NSFWGateBypass",description:"Allows you to access NSFW channels without setting/verifying your age",authors:[d.Commandtechno],patches:[{find:".nsfwAllowed=null",replacement:{match:/(\w+)\.nsfwAllowed=/,replace:"$1.nsfwAllowed=true;"}}]})});var Ts,Zd,mS=g(()=>{"use strict";a();$();P();w();A();Ts=D({channelToAffect:{type:4,description:"Select the type of DM for the plugin to affect",options:[{label:"Both",value:"both_dms",default:!0},{label:"User DMs",value:"user_dm"},{label:"Group DMs",value:"group_dm"}]},allowMentions:{type:3,description:"Receive audio pings for @mentions",default:!1},allowEveryone:{type:3,description:"Receive audio pings for @everyone and @here in group DMs",default:!1}}),Zd=y({name:"OnePingPerDM",description:"If unread messages are sent by a user in DMs multiple times, you'll only receive one audio ping. Read the messages to reset the limit",authors:[d.ProffDea],settings:Ts,patches:[{find:".getDesktopType()===",replacement:[{match:/(\i\.\i\.getDesktopType\(\)===\i\.\i\.NEVER)\)/,replace:"$&if(!$self.isPrivateChannelRead(arguments[0]?.message))return;else "},{match:/sound:(\i\?\i:void 0,volume:\i,onClick)/,replace:"sound:!$self.isPrivateChannelRead(arguments[0]?.message)?undefined:$1"}]}],isPrivateChannelRead(e){let t=Q.getChannel(e.channel_id)?.type;return t!==1&&t!==3||t===1&&Ts.store.channelToAffect==="group_dm"||t===3&&Ts.store.channelToAffect==="user_dm"||Ts.store.allowMentions&&e.mentions.some(n=>n.id===W.getCurrentUser().id)||Ts.store.allowEveryone&&e.mention_everyone?!0:ar.getOldestUnreadMessageId(e.channel_id)===e.id}})});var Xd,fS=g(()=>{"use strict";a();P();w();Xd=y({name:"oneko",description:"cat follow mouse (real)",authors:[d.Ven,d.adryd],start(){fetch("https://raw.githubusercontent.com/adryd325/oneko.js/8fa8a1864aa71cd7a794d58bc139e755e96a236c/oneko.js").then(e=>e.text()).then(e=>e.replace("./oneko.gif","https://raw.githubusercontent.com/adryd325/oneko.js/14bab15a755d0e35cd4ae19c931d96d306f99f42/oneko.gif")).then(eval)},stop(){document.getElementById("oneko")?.remove()}})});var TA,xA,wA,MA,Ar,PA,Jd,gS=g(()=>{"use strict";a();$();P();w();A();TA=/^https:\/\/(spotify\.link|s\.team)\/.+$/,xA=/^https:\/\/open\.spotify\.com\/(track|album|artist|playlist|user|episode)\/(.+)(?:\?.+?)?$/,wA=/^https:\/\/(steamcommunity\.com|(?:help|store)\.steampowered\.com)\/.+$/,MA=/^https:\/\/store\.epicgames\.com\/(.+)$/,Ar=D({spotify:{type:3,description:"Open Spotify links in the Spotify app",default:!0},steam:{type:3,description:"Open Steam links in the Steam app",default:!0},epic:{type:3,description:"Open Epic Games links in the Epic Games Launcher",default:!0}}),PA=VencordNative.pluginHelpers.OpenInApp,Jd=y({name:"OpenInApp",description:"Open Spotify, Steam and Epic Games URLs in their respective apps instead of your browser",authors:[d.Ven],settings:Ar,patches:[{find:"trackAnnouncementMessageLinkClicked({",replacement:{match:/(?<=handleClick:function\(\)\{return (\i)\}.+?)function \1\(.+?\)\{/,replace:"async $& if(await $self.handleLink(...arguments)) return;"}},{find:"WEB_OPEN(",predicate:()=>Ar.store.spotify,replacement:{match:/\i\.\i\.isProtocolRegistered\(\)(.{0,100})window.open/g,replace:"true$1VencordNative.native.openExternal"}},{find:".CONNECTED_ACCOUNT_VIEWED,",replacement:{match:/(?<=href:\i,onClick:\i=>\{)(?=.{0,10}\i=(\i)\.type,.{0,100}CONNECTED_ACCOUNT_VIEWED)/,replace:"$self.handleAccountView(arguments[0],$1.type,$1.id);"}}],async handleLink(e,t){if(!e)return!1;let n=e.href;TA.test(n)&&(t?.preventDefault(),n=await PA.resolveRedirect(n));e:{if(!Ar.store.spotify)break e;let r=xA.exec(n);if(!r)break e;let[,i,s]=r;return VencordNative.native.openExternal(`spotify:${i}:${s}`),t?.preventDefault(),!0}e:{if(!Ar.store.steam||!wA.test(n))break e;return VencordNative.native.openExternal(`steam://openurl/${n}`),t?.preventDefault(),fn("Opened link in Steam",ee.Type.SUCCESS),!0}e:{if(!Ar.store.epic)break e;let r=MA.exec(n);if(!r)break e;return VencordNative.native.openExternal(`com.epicgames.launcher://store/${r[1]}`),t?.preventDefault(),!0}return t?.defaultPrevented?(window.open(n,"_blank"),!0):!1},handleAccountView(e,t,n){t==="spotify"&&Ar.store.spotify?(VencordNative.native.openExternal(`spotify:user:${n}`),e.preventDefault()):t==="steam"&&Ar.store.steam&&(VencordNative.native.openExternal(`steam://openurl/https://steamcommunity.com/profiles/${n}`),fn("Opened link in Steam",ee.Type.SUCCESS),e.preventDefault())}})});function yS(e){F.dispatch({type:"POGGERMODE_SETTINGS_UPDATE",settings:{enabled:e,settingsVisible:e}})}function vS(e){let t={screenshakeEnabledLocations:{0:!0,1:!0,2:!0},shakeIntensity:1,confettiSize:16,confettiCount:5,combosRequiredCount:1};switch(e){case 0:{Object.assign(t,{screenshakeEnabledLocations:{0:!0,1:!1,2:!1},combosRequiredCount:5});break}case 1:{Object.assign(t,{confettiSize:12,confettiCount:8});break}case 2:{Object.assign(t,{shakeIntensity:20,confettiSize:25,confettiCount:15});break}}F.dispatch({type:"POGGERMODE_SETTINGS_UPDATE",settings:t})}var hS,Qd,SS=g(()=>{"use strict";a();$();P();w();A();hS=D({superIntensePartyMode:{description:"Party intensity",type:4,options:[{label:"Normal",value:0,default:!0},{label:"Better",value:1},{label:"Project X",value:2}],restartNeeded:!1,onChange:vS}}),Qd=y({name:"Party mode \u{1F389}",description:"Allows you to use party mode cause the party never ends \u2728",authors:[d.UwUDev],settings:hS,start(){yS(!0),vS(hS.store.superIntensePartyMode)},stop(){yS(!1)}})});var Vd,em,bS=g(()=>{"use strict";a();$();P();w();Vd=D({lockout:{type:3,default:!0,description:`Bypass the permission lockout prevention ("Pretty sure you don't want to do this")`,restartNeeded:!0},onboarding:{type:3,default:!0,description:'Bypass the onboarding requirements ("Making this change will make your server incompatible [...]")',restartNeeded:!0}}),em=y({name:"PermissionFreeWill",description:"Disables the client-side restrictions for channel permission management.",authors:[d.lewisakura],patches:[{find:".showPermissionLockoutModal(",replacement:[{match:/case"DENY":.{0,50}if\((?=\i\.\i\.can)/,replace:"$&true||"}],predicate:()=>Vd.store.lockout},{find:".ONBOARDING_CHANNEL_THRESHOLD_WARNING",replacement:[{match:/(?<=(?:isDefaultChannelThresholdMetAfterDelete|checkDefaultChannelThresholdMetAfterChannelPermissionDeny):function\(\)\{)return \i(?=\})/g,replace:"return () => true"}],predicate:()=>Vd.store.onboarding}],settings:Vd})});var TS=g(()=>{});function IA(e){return oo(e.toLowerCase().split("_"))}function cl(e){return e=xS[e]||e,ot.Messages[e]||IA(e)}function wS(e){e==="USE_APPLICATION_COMMANDS"?e="USE_APPLICATION_COMMANDS_GUILD":e==="SEND_VOICE_MESSAGES"?e="SEND_VOICE_MESSAGE_GUILD":e!=="STREAM"&&(e=xS[e]||e);let t=ot.Messages[`ROLE_PERMISSIONS_${e}_DESCRIPTION`];return t?.hasMarkdown?Fe.parse(t.message):typeof t=="string"?t:""}function ul({roles:e,id:t},n){return[...n.roles,t].map(r=>e[r]).sort((r,i)=>i.position-r.position)}function MS(e){switch(Yo.store.permissionsSortOrder){case 0:return e.sort((t,n)=>n.position-t.position);case 1:return e.sort((t,n)=>t.position-n.position);default:return e}}function pl(e,t){let n=Te.getGuild(t);return e.sort((r,i)=>{if(r.type!==0||i.type!==0)return 0;let s=n.roles[r.id];return n.roles[i.id].position-s.position})}var jt,xS,xs=g(()=>{"use strict";a();Je();ro();A();Ms();ws();jt=Ue("vc-permviewer-");xS={MANAGE_GUILD:"MANAGE_SERVER",MANAGE_GUILD_EXPRESSIONS:"MANAGE_EXPRESSIONS",CREATE_GUILD_EXPRESSIONS:"CREATE_EXPRESSIONS",MODERATE_MEMBERS:"MODERATE_MEMBER",STREAM:"VIDEO",SEND_VOICE_MESSAGES:"ROLE_PERMISSIONS_SEND_VOICE_MESSAGE"}});function tm(){return o("svg",{height:"24",width:"24",viewBox:"0 0 24 24"},o("title",null,"Denied"),o("path",{fill:"var(--status-danger)",d:"M18.4 4L12 10.4L5.6 4L4 5.6L10.4 12L4 18.4L5.6 20L12 13.6L18.4 20L20 18.4L13.6 12L20 5.6L18.4 4Z"}))}function nm(){return o("svg",{height:"24",width:"24",viewBox:"0 0 24 24"},o("title",null,"Allowed"),o("path",{fill:"var(--text-positive)",d:"M8.99991 16.17L4.82991 12L3.40991 13.41L8.99991 19L20.9999 7.00003L19.5899 5.59003L8.99991 16.17ZZ"}))}function IS(){return o("svg",{height:"24",width:"24",viewBox:"0 0 16 16"},o("g",null,o("title",null,"Not overwritten"),o("polygon",{fill:"var(--text-normal)",points:"12 2.32 10.513 2 4 13.68 5.487 14"})))}var AS=g(()=>{"use strict";a()});function NA(e,t,n){return je(r=>o(RA,{modalProps:r,permissions:e,guild:t,header:n}))}function CA({permissions:e,guild:t,modalProps:n,header:r}){e.sort((c,u)=>c.type-u.type),He([ke],()=>ke.getMemberIds(t.id),null,(c,u)=>c.length===u.length),De(()=>{let c=e.filter(u=>u.type===1&&!ke.isMember(t.id,u.id)).map(({id:u})=>u);F.dispatch({type:"GUILD_MEMBERS_REQUEST",guildIds:[t.id],userIds:c})},[]);let[i,s]=J(0),l=e[i];return o(ze,{...n,size:"large"},o(lt,null,o(re,{className:jt("perms-title"),variant:"heading-lg/semibold"},r," permissions:"),o(an,{onClick:n.onClose})),o(et,null,!l&&o("div",{className:jt("perms-no-perms")},o(re,{variant:"heading-lg/normal"},"No permissions to display!")),l&&o("div",{className:jt("perms-container")},o("div",{className:jt("perms-list")},e.map((c,u)=>{let p=W.getUser(c.id??""),m=t.roles[c.id??""];return o("button",{className:jt("perms-list-item-btn"),onClick:()=>s(u)},o("div",{className:jt("perms-list-item",{"perms-list-item-active":i===u}),onContextMenu:h=>{Yo.store.unsafeViewAsRole&&c.type===0&&dn.openContextMenu(h,()=>o(kA,{guild:t,roleId:c.id,onClose:n.onClose}))}},(c.type===0||c.type===2)&&o("span",{className:jt("perms-role-circle"),style:{backgroundColor:m?.colorString??"var(--primary-300)"}}),c.type===1&&p!==void 0&&o("img",{className:jt("perms-user-img"),src:p.getAvatarURL(void 0,void 0,!1)}),o(re,{variant:"text-md/normal"},c.type===0?m?.name??"Unknown Role":c.type===1?(p&&ao(p))??"Unknown User":o(ge,{style:{gap:"0.2em",justifyItems:"center"}},"@owner",o(yy,{height:18,width:18,"aria-hidden":"true"})))))})),o("div",{className:jt("perms-perms")},Object.entries(Se).map(([c,u])=>o("div",{className:jt("perms-perms-item")},o("div",{className:jt("perms-perms-item-icon")},(()=>{let{permissions:p,overwriteAllow:m,overwriteDeny:h}=l;return p?(p&u)===u?nm():tm():m&&(m&u)===u?nm():h&&(h&u)===u?tm():IS()})()),o(re,{variant:"text-md/normal"},cl(c)),o(V,{text:wS(c)||"No Description"},p=>o(Ia,{...p}))))))))}function kA({guild:e,roleId:t,onClose:n}){return o(G.Menu,{navId:jt("role-context-menu"),onClose:dn.closeContextMenu,"aria-label":"Role Options"},o(G.MenuItem,{id:"vc-pw-view-as-role",label:"View As Role",action:()=>{let r=e.roles[t];!r||(n(),F.dispatch({type:"IMPERSONATE_UPDATE",guildId:e.id,data:{type:"ROLES",roles:{[t]:r}}}))}}))}var RA,li,ws=g(()=>{"use strict";a();le();Lt();$t();bt();dt();A();Ms();xs();AS();RA=_.wrap(CA),li=NA});var NS=g(()=>{});function rm({children:e,onMoreClick:t,buttons:n,moreTooltipText:r,defaultState:i=!1,onDropDownClick:s,headerText:l}){let[c,u]=J(i);return o(f,null,o("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"}},o(re,{tag:"h2",variant:"eyebrow",style:{color:"var(--header-primary)",display:"inline"}},l),o("div",{className:om("center-flex")},n??null,t&&o(V,{text:r},p=>o("button",{...p,className:om("btn"),onClick:t},o("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},o("path",{fill:"var(--text-normal)",d:"M7 12.001C7 10.8964 6.10457 10.001 5 10.001C3.89543 10.001 3 10.8964 3 12.001C3 13.1055 3.89543 14.001 5 14.001C6.10457 14.001 7 13.1055 7 12.001ZM14 12.001C14 10.8964 13.1046 10.001 12 10.001C10.8954 10.001 10 10.8964 10 12.001C10 13.1055 10.8954 14.001 12 14.001C13.1046 14.001 14 13.1055 14 12.001ZM19 10.001C20.1046 10.001 21 10.8964 21 12.001C21 13.1055 20.1046 14.001 19 14.001C17.8954 14.001 17 13.1055 17 12.001C17 10.8964 17.8954 10.001 19 10.001Z"})))),o(V,{text:c?"Hide "+l:"Show "+l},p=>o("button",{...p,className:om("btn"),onClick:()=>{u(m=>!m),s?.(c)}},o("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:c?"scale(1 -1)":"scale(1 1)"},o("path",{fill:"var(--text-normal)",d:"M16.59 8.59003L12 13.17L7.41 8.59003L6 10L12 16L18 10L16.59 8.59003Z"})))))),c&&e)}var om,CS=g(()=>{"use strict";a();Je();A();NS();om=Ue("vc-expandableheader-")});function EA({guild:e,guildMember:t,showBorder:n}){let r=Yo.use(["permissionsSortOrder"]),[i,s]=Nt(()=>{let b=[],x=ul(e,t),N=x.map(k=>({type:0,...k}));if(e.ownerId===t.userId){N.push({type:2,permissions:Object.values(Se).reduce((B,U)=>B|U,0n)});let k=ot.Messages.GUILD_OWNER||"Server Owner";b.push({permission:k,roleColor:"var(--primary-300)",rolePosition:1/0})}MS(x);for(let[k,B]of Object.entries(Se))for(let{permissions:U,colorString:Y,position:K}of x)if((U&B)===B){b.push({permission:cl(k),roleColor:Y||"var(--primary-300)",rolePosition:K});break}return b.sort((k,B)=>B.rolePosition-k.rolePosition),[N,b]},[r.permissionsSortOrder]),{root:l,role:c,roleRemoveButton:u,roleNameOverflow:p,roles:m,rolePill:h,rolePillBorder:v,roleCircle:T,roleName:M}=LA;return o(rm,{headerText:"Permissions",moreTooltipText:"Role Details",onMoreClick:()=>li(i,e,t.nick||W.getUser(t.userId).username),defaultState:Yo.store.defaultPermissionsDropdownState,buttons:[o(V,{text:`Sorting by ${r.permissionsSortOrder===0?"Highest Role":"Lowest Role"}`},b=>o("button",{...b,className:jt("userperms-sortorder-btn"),onClick:()=>{r.permissionsSortOrder=r.permissionsSortOrder===0?1:0}},o("svg",{width:"20",height:"20",viewBox:"0 96 960 960",transform:r.permissionsSortOrder===0?"scale(1 1)":"scale(1 -1)"},o("path",{fill:"var(--text-normal)",d:"M440 896V409L216 633l-56-57 320-320 320 320-56 57-224-224v487h-80Z"}))))]},s.length>0&&o("div",{className:oe(l,m)},s.map(({permission:b,roleColor:x})=>o("div",{className:oe(c,h,n?v:null)},o("div",{className:u},o("span",{className:T,style:{backgroundColor:x}})),o("div",{className:M},o(re,{className:p,variant:"text-xs/medium"},b))))))}var LA,kS,RS=g(()=>{"use strict";a();le();CS();wn();Re();j();A();Ms();xs();ws();LA=yt(()=>{let e=rc(Ke.byProps("roles","rolePill","rolePillBorder"),Ke.byProps("roleCircle","dotBorderBase","dotBorderColor"),Ke.byProps("roleNameOverflow","root","roleName","roleRemoveButton"));return Object.assign({},...e)});kS=_.wrap(EA,{noop:!0})});function im(e,t,n){return n===0&&!ke.isMember(e,t)?null:o(G.MenuItem,{id:"perm-viewer-permissions",label:"Permissions",action:()=>{let r=Te.getGuild(e),i,s;switch(n){case 0:{let l=ke.getMember(e,t);i=ul(r,l).map(c=>({type:0,...c})),r.ownerId===t&&i.push({type:2,permissions:Object.values(Se).reduce((c,u)=>c|u,0n)}),s=l.nick??W.getUser(l.userId).username;break}case 1:{let l=Q.getChannel(t);i=pl(Object.values(l.permissionOverwrites).map(({id:c,allow:u,deny:p,type:m})=>({type:m,id:c,overwriteAllow:u,overwriteDeny:p})),e),s=l.name;break}default:{i=Object.values(r.roles).map(l=>({type:0,...l})),s=r.name;break}}li(i,r,s)}})}function sm(e,t){return(n,r)=>()=>{if(!r||t===0&&!r.user||t===2&&!r.guild)return n;let i=mt(e,n),s=(()=>{switch(t){case 0:return im(r.guildId,r.user.id,t);case 1:return im(r.guild.id,r.channel.id,t);case 2:return im(r.guild.id);default:return null}})();s!=null&&(i?i.push(s):e==="roles"&&r.guildId&&n.splice(-1,0,o(G.MenuGroup,null,s)))}}var Yo,am,Ms=g(()=>{"use strict";a();TS();Pt();$();P();w();A();ws();RS();xs();Yo=D({permissionsSortOrder:{description:"The sort method used for defining which role grants an user a certain permission",type:4,options:[{label:"Highest Role",value:0,default:!0},{label:"Lowest Role",value:1}]},defaultPermissionsDropdownState:{description:"Whether the permissions dropdown on user popouts should be open by default",type:3,default:!1}});am=y({name:"PermissionsViewer",description:"View the permissions a user or channel has, and the roles of a server",authors:[d.Nuckyz,d.Ven],settings:Yo,patches:[{find:".popularApplicationCommandIds,",replacement:{match:/showBorder:(.{0,60})}\),(?<=guild:(\i),guildMember:(\i),.+?)/,replace:(e,t,n,r)=>`${e}$self.UserPermissions(${n},${r},${t}),`}}],UserPermissions:(e,t,n)=>!!t&&o(kS,{guild:e,guildMember:t,showBorder:n}),userContextMenuPatch:sm("roles",0),channelContextMenuPatch:sm(["mute-channel","unmute-channel"],1),guildContextMenuPatch:sm("privacy",2),start(){ce("user-context",this.userContextMenuPatch),ce("channel-context",this.channelContextMenuPatch),ce(["guild-context","guild-header-popout"],this.guildContextMenuPatch)},stop(){de("user-context",this.userContextMenuPatch),de("channel-context",this.channelContextMenuPatch),de(["guild-context","guild-header-popout"],this.guildContextMenuPatch)}})});function ES(e){let t=e instanceof File,n=t?URL.createObjectURL(e):e;return new Promise((r,i)=>{let s=new Image;s.onload=()=>{t&&URL.revokeObjectURL(n),r(s)},s.onerror=(l,c,u,p,m)=>i(m||l),s.crossOrigin="Anonymous",s.src=n})}async function FA(e,t,n){for(let r of e)switch(r.name){case"image":let i=BA.getUploads(t.channel.id,LS)[0];if(i){if(!i.isImage)throw"Upload is not an image";return i.item.file}break;case"url":return r.value;case"user":try{return(await Rt.getUser(r.value)).getAvatarURL(n?void 0:t.guild?.id,2048).replace(/\?size=\d+$/,"?size=2048")}catch(s){throw console.error(`[petpet] Failed to fetch user -`,s),"Failed to fetch user. Check the console for more info."}}return null}var ci,LS,DA,OA,dl,_A,BA,lm,DS=g(()=>{"use strict";a();Qt();P();wn();w();j();A();ci=js(_p()),LS=0,DA=20,OA=128,dl=10,_A=xo(()=>Promise.all(Array.from({length:dl},(e,t)=>ES(`https://raw.githubusercontent.com/VenPlugs/petpet/main/frames/pet${t}.gif`)))),BA=I("getUploads");lm=y({name:"petpet",description:"Adds a /petpet slash command to create headpet gifs from any image",authors:[d.Ven],dependencies:["CommandsAPI"],commands:[{inputType:0,name:"petpet",description:"Create a petpet gif. You can only specify one of the image options",options:[{name:"delay",description:"The delay between each frame. Defaults to 20.",type:4},{name:"resolution",description:"Resolution for the gif. Defaults to 120. If you enter an insane number and it freezes Discord that's your fault.",type:4},{name:"image",description:"Image attachment to use",type:11},{name:"url",description:"URL to fetch image from",type:3},{name:"user",description:"User whose avatar to use as image",type:6},{name:"no-server-pfp",description:"Use the normal avatar instead of the server specific one when using the 'user' option",type:5}],execute:async(e,t)=>{let n=await _A(),r=it(e,"no-server-pfp",!1);try{var i=await FA(e,t,r);if(!i)throw"No Image specified!"}catch(v){ue(t.channel.id,{content:String(v)});return}let s=await ES(i),l=it(e,"delay",DA),c=it(e,"resolution",OA),u=(0,ci.GIFEncoder)(),p=document.createElement("canvas");p.width=p.height=c;let m=p.getContext("2d");for(let v=0;vRi.promptToUpload([h],t.channel,LS),10)}}]})});var OS=g(()=>{});var _S,cm,BS=g(()=>{"use strict";a();OS();$();le();P();w();A();_S=D({loop:{description:"Whether to make the PiP video loop or not",type:3,default:!0,restartNeeded:!1}}),cm=y({name:"PictureInPicture",description:"Adds picture in picture to videos (next to the Download button)",authors:[d.Lumap],settings:_S,patches:[{find:".nonMediaAttachment]",replacement:{match:/\.nonMediaAttachment\]:!(\i).{0,10}children:\[(\S)/,replace:"$&,$1&&$2&&$self.renderPiPButton(),"}}],renderPiPButton:_.wrap(()=>o(V,{text:"Toggle Picture in Picture"},e=>o("div",{...e,className:"vc-pip-button",role:"button",style:{cursor:"pointer",paddingTop:"4px",paddingLeft:"4px",paddingRight:"4px"},onClick:t=>{let n=t.currentTarget.parentNode.parentNode.querySelector("video"),r=document.body.appendChild(n.cloneNode(!0));r.loop=_S.store.loop,r.style.display="none",r.onleavepictureinpicture=()=>r.remove();function i(){r.currentTime=n.currentTime,r.requestPictureInPicture(),n.pause(),r.play()}r.readyState===4?i():r.onloadedmetadata=i}},o("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24"},o("path",{fill:"currentColor",d:"M21 3a1 1 0 0 1 1 1v7h-2V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h18zm0 10a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1h8zm-1 2h-6v4h6v-4z"})))),{noop:!0})})});function $S(){return ct(["plugins.PinDMs.pinnedDMs"]),ml()}function ui(e){return ml().has(e)}function GS(e){let t=ml();t.delete(e)||t.add(e),US([...t])}function pm(){return ml(),Ps.store.pinOrder===0?UA.getPrivateChannelIds().filter(ui):Zn}function HS(e){return pm()[e]}function dm(e,t){let n=FS(),r=n.indexOf(e),i=r+t;[n[r],n[i]]=[n[i],n[r]],US(n)}var Ps,UA,Zn,um,FS,US,$A,ml,mm=g(()=>{"use strict";a();$();w();j();Ps=D({pinOrder:{type:4,description:"Which order should pinned DMs be displayed in?",options:[{label:"Most recent message",value:0,default:!0},{label:"Custom (right click channels to reorder)",value:1}]}}),UA=Me("PrivateChannelSortStore"),FS=()=>(E.plugins.PinDMs.pinnedDMs||void 0)?.split(","),US=e=>{um=void 0,E.plugins.PinDMs.pinnedDMs=e.join(",")},$A=()=>(Zn=FS()??[],um=new Set(Zn)),ml=()=>um??$A()});function zS(e){let t=ui(e),n=t&&Ps.store.pinOrder===1;return o(f,null,o(G.MenuItem,{id:"pin-dm",label:t?"Unpin DM":"Pin DM",action:()=>GS(e)}),n&&Zn[0]!==e&&o(G.MenuItem,{id:"move-pin-up",label:"Move Pin Up",action:()=>dm(e,-1)}),n&&Zn[Zn.length-1]!==e&&o(G.MenuItem,{id:"move-pin-down",label:"Move Pin Down",action:()=>dm(e,1)}))}function qS(){ce("gdm-context",jS),ce("user-context",WS)}function KS(){de("gdm-context",jS),de("user-context",WS)}var jS,WS,YS=g(()=>{"use strict";a();Pt();A();mm();jS=(e,t)=>()=>{let n=mt("leave-channel",e);n&&n.unshift(zS(t.channel.id))},WS=(e,t)=>()=>{let n=mt("close-dm",e);if(n){let r=n.findIndex(i=>i?.props?.id==="close-dm");n.splice(r,0,zS(t.channel.id))}}});var fm,ZS=g(()=>{"use strict";a();P();w();YS();mm();fm=y({name:"PinDMs",description:"Allows you to pin private channels to the top of your DM list. To pin/unpin or reorder pins, right click DMs",authors:[d.Ven,d.Strencher],settings:Ps,start:qS,stop:KS,usePinCount(e){let t=$S();return e.length?[t.size]:[]},getChannel(e,t){return e[HS(t)]},isPinned:ui,getSnapshot:pm,getScrollOffset(e,t,n,r,i){return ui(e)?t*(Zn.indexOf(e)+r)+n:(t+n)*2+t*Zn.length+i},patches:[{find:".privateChannelsHeaderContainer,",replacement:[{match:/(?<=\i,{channels:\i,)privateChannelIds:(\i),/,replace:"privateChannelIds:$1.filter(c=>!$self.isPinned(c)),pinCount:$self.usePinCount($1),"},{match:/(?<=renderRow:this\.renderRow,)sections:\[\i,/,replace:"$&...this.props.pinCount??[],"},{match:/children:(\i\.\i\.Messages.DIRECT_MESSAGES)(?<=renderSection=(\i)=>{.+?)/,replace:"children:$2.section===1?'Pinned DMs':$1"},{match:/(?<=renderDM=\((\i),(\i)\)=>{.*?this.state,\i=\i\[\i\],\i=)((\i)\[\i\]);/,replace:"$1===1?$self.getChannel($4,$2):$3;"},{match:/(?<=getRowHeight=\(.{2,50}?)1===\i/,replace:"$&-1"},{match:/(?<=scrollTo\(\{to:\i\}\):\(\i\+=)(\d+)\*\(.+?(?=,)/,replace:"$self.getScrollOffset(arguments[0],$1,this.props.padding,this.state.preRenderedChildren,$&)"}]},{find:".Routes.APPLICATION_STORE&&",replacement:{match:/(?<=\i=__OVERLAY__\?\i:\[\.\.\.\i\(\),\.\.\.)\i/,replace:"$self.getSnapshot().concat($&.filter(c=>!$self.isPinned(c)))"}},{find:".getFlattenedGuildIds()],",replacement:{match:/(?<=\i===\i\.ME\?)\i\.\i\.getPrivateChannelIds\(\)/,replace:"$self.getSnapshot().concat($&.filter(c=>!$self.isPinned(c)))"}}]})});var gm,XS=g(()=>{"use strict";a();P();w();gm=y({name:"PlainFolderIcon",description:"Doesn't show the small guild icons in folders",authors:[d.botato],patches:[{find:".expandedFolderIconWrapper",replacement:[{match:/\(\w\|\|\w\)&&(\(.{0,40}\(.{1,3}\.animated)/,replace:"$1"}]}]})});var vm={};Be(vm,{__getDecorators:()=>GA,addDecorator:()=>hm,decorators:()=>fl,removeDecorator:()=>ym});function hm(e,t,n){fl.set(e,{decorator:t,onlyIn:n})}function ym(e){fl.delete(e)}function GA(e){let t=!!e.guildId;return Array.from(fl.values(),n=>{let{decorator:r,onlyIn:i}=n;return!i||i==="guilds"&&t||i==="dms"&&!t?r(e):null})}var fl,Sm=g(()=>{"use strict";a();fl=new Map});var xm={};Be(xm,{__addDecorationsToMessage:()=>HA,addDecoration:()=>bm,decorations:()=>gl,removeDecoration:()=>Tm});function bm(e,t){gl.set(e,t)}function Tm(e){gl.delete(e)}function HA(e){return[...gl.values()].map(t=>t(e))}var gl,wm=g(()=>{"use strict";a();gl=new Map});function hl(e,t){return({color:n,tooltip:r,small:i})=>o(V,{text:r},s=>o("svg",{...s,height:(t?.height??20)-(i?3:0),width:(t?.width??20)-(i?3:0),viewBox:t?.viewBox??"0 0 24 24",fill:n},o("path",{d:e})))}var zA,JS,jA,WA,qA,Pm,QS,Mm,Im,VS=g(()=>{"use strict";a();aa();Sm();wm();$();le();P();w();j();A();zA=Me("SessionsStore");JS={desktop:hl("M4 2.5c-1.103 0-2 .897-2 2v11c0 1.104.897 2 2 2h7v2H7v2h10v-2h-4v-2h7c1.103 0 2-.896 2-2v-11c0-1.103-.897-2-2-2H4Zm16 2v9H4v-9h16Z"),web:hl("M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2Zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93Zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39Z"),mobile:hl("M 187 0 L 813 0 C 916.277 0 1000 83.723 1000 187 L 1000 1313 C 1000 1416.277 916.277 1500 813 1500 L 187 1500 C 83.723 1500 0 1416.277 0 1313 L 0 187 C 0 83.723 83.723 0 187 0 Z M 125 1000 L 875 1000 L 875 250 L 125 250 Z M 500 1125 C 430.964 1125 375 1180.964 375 1250 C 375 1319.036 430.964 1375 500 1375 C 569.036 1375 625 1319.036 625 1250 C 625 1180.964 569.036 1125 500 1125 Z",{viewBox:"0 0 1000 1500",height:17,width:17}),console:hl("M14.8 2.7 9 3.1V47h3.3c1.7 0 6.2.3 10 .7l6.7.6V2l-4.2.2c-2.4.1-6.9.3-10 .5zm1.8 6.4c1 1.7-1.3 3.6-2.7 2.2C12.7 10.1 13.5 8 15 8c.5 0 1.2.5 1.6 1.1zM16 33c0 6-.4 10-1 10s-1-4-1-10 .4-10 1-10 1 4 1 10zm15-8v23.3l3.8-.7c2-.3 4.7-.6 6-.6H43V3h-2.2c-1.3 0-4-.3-6-.6L31 1.7V25z",{viewBox:"0 0 50 50"})},jA=I("getStatusColor","StatusTypes"),WA=({platform:e,status:t,small:n})=>{let r=e[0].toUpperCase()+e.slice(1),i=JS[e]??JS.desktop;return o(i,{color:`var(--${jA.getStatusColor(t)}`,tooltip:r,small:n})},qA=e=>Hn.getState()?.clientStatuses?.[e],Pm=({user:e,wantMargin:t=!0,wantTopMargin:n=!1,small:r=!1})=>{if(!e||e.bot)return null;if(e.id===W.getCurrentUser().id){let l=zA.getSessions();if(typeof l!="object")return null;let c=Object.values(l).sort(({status:m},{status:h})=>m===h?0:m==="online"?1:h==="online"?-1:m==="idle"?1:h==="idle"?-1:0),u=Object.values(c).reduce((m,h)=>(h.clientInfo.client!=="unknown"&&(m[h.clientInfo.client]=h.status),m),{}),{clientStatuses:p}=Hn.getState();p[W.getCurrentUser().id]=u}let i=Hn.getState()?.clientStatuses?.[e.id];if(!i)return null;let s=Object.entries(i).map(([l,c])=>o(WA,{key:l,platform:l,status:c,small:r}));return s.length?o("span",{className:"vc-platform-indicator",style:{display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:t?4:0,verticalAlign:"top",position:"relative",top:n?2:0,padding:t?0:1,gap:2}},s):null},QS={component:e=>o(Pm,{...e,wantMargin:!1}),position:0,shouldShow:e=>!!Object.keys(qA(e.user.id)??{}).length,key:"indicator"},Mm={list:{description:"In the member list",onEnable:()=>hm("platform-indicator",e=>o(_,{noop:!0},o(Pm,{user:e.user,small:!0}))),onDisable:()=>ym("platform-indicator")},badges:{description:"In user profiles, as badges",onEnable:()=>Am(QS),onDisable:()=>Nm(QS)},messages:{description:"Inside messages",onEnable:()=>bm("platform-indicator",e=>o(_,{noop:!0},o(Pm,{user:e.message?.author,wantTopMargin:!0}))),onDisable:()=>Tm("platform-indicator")}},Im=y({name:"PlatformIndicators",description:"Adds platform indicators (Desktop, Mobile, Web...) to users",authors:[d.kemo,d.TheSun,d.Nuckyz,d.Ven],dependencies:["MessageDecorationsAPI","MemberListDecoratorsAPI"],start(){let e=E.plugins.PlatformIndicators,{displayMode:t}=e;t&&(t!=="both"?e[t]=!0:(e.list=!0,e.badges=!0),e.messages=!0,delete e.displayMode),Object.entries(Mm).forEach(([n,r])=>{e[n]&&r.onEnable()})},stop(){Object.entries(Mm).forEach(([e,t])=>{t.onDisable()})},patches:[{find:".Masks.STATUS_ONLINE_MOBILE",predicate:()=>E.plugins.PlatformIndicators.colorMobileIndicator,replacement:[{match:/\.STATUS_TYPING;switch(?=.+?(if\(\i\)return \i\.\i\.Masks\.STATUS_ONLINE_MOBILE))/,replace:".STATUS_TYPING;$1;switch"},{match:/switch\(\i\)\{case \i\.\i\.ONLINE:(if\(\i\)return\{[^}]+\})/,replace:"$1;$&"}]},{find:".AVATAR_STATUS_MOBILE_16;",predicate:()=>E.plugins.PlatformIndicators.colorMobileIndicator,replacement:[{match:/\i===\i\.\i\.ONLINE&&(?=.{0,70}\.AVATAR_STATUS_MOBILE_16;)/,replace:""},{match:/(?<=\(\i\.status,)(\i)(?=,(\i),\i\))/,replace:(e,t,n)=>`${n}?"online":${t}`},{match:/(?<=\i&&!\i)&&\i===\i\.\i\.ONLINE/,replace:""}]},{find:"}isMobileOnline(",predicate:()=>E.plugins.PlatformIndicators.colorMobileIndicator,replacement:{match:/(?<=\i\[\i\.\i\.MOBILE\])===\i\.\i\.ONLINE/,replace:"!= null"}}],options:{...Object.fromEntries(Object.entries(Mm).map(([e,t])=>[e,{type:3,description:`Show indicators ${t.description.toLowerCase()}`,restartNeeded:!0,default:!0}])),colorMobileIndicator:{type:3,description:"Whether to make the mobile indicator match the color of the user status.",default:!0,restartNeeded:!0}}})});function ZA(e){let{isEmpty:t,attachments:n}=e.type,r=Pe.getChannelId(),i=He([ki],()=>eb(r));if(e.type.analyticsName!=="normal")return null;let s=n&&tb.getUploads(r,0).length>0;return!(!t&&i?.length>0)&&!s?null:o(V,{text:"Preview Message"},c=>o(R,{...c,onClick:async()=>ue(r,{content:eb(r),author:W.getCurrentUser(),attachments:s?await YA(r):void 0}),size:"",look:Kt.BLANK,innerClassName:vt.button,style:{padding:"0 2px",height:"100%"}},o("div",{className:vt.buttonWrapper},o("img",{width:24,height:24,src:"https://discord.com/assets/4c5a77a89716352686f590a6f014770c.svg"}))))}var tb,eb,KA,YA,Cm,nb=g(()=>{"use strict";a();Qt();le();P();w();j();A();tb=I("getUploads"),eb=e=>ki.getDraft(e,0),KA=e=>new Promise(t=>{let n=new Image;n.onload=()=>t({width:n.width,height:n.height}),n.onerror=()=>t(null),n.src=e}),YA=async e=>await Promise.all(tb.getUploads(e,0).map(async t=>{let{isImage:n,filename:r,spoiler:i,item:{file:s}}=t,l=URL.createObjectURL(s),c={id:Vi(),filename:i?"SPOILER_"+r:r,content_type:void 0,size:await t.getSize(),spoiler:i,url:l+"#",proxy_url:l+"#"};if(n){let u=await KA(l);if(!u)return c;c.width=u.width,c.height=u.height}return c}));Cm=y({name:"PreviewMessage",description:"Lets you preview your message before sending it.",authors:[d.Aria],patches:[{find:"ChannelTextAreaButtons",replacement:{match:/(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/,replace:"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()"}}],chatBarIcon:_.wrap(ZA,{noop:!0})})});var ob=g(()=>{});function km(){return o(O.Fragment,null,o(S.FormTitle,{tag:"h3"},"More Information"),o(S.FormText,null,"To add your own pronouns, visit"," ",o(st,{href:"https://pronoundb.org"},"pronoundb.org")),o(S.FormDivider,null),o(S.FormText,null,"The two pronoun formats are lowercase and capitalized. Example:",o("ul",null,o("li",null,"Lowercase: they/them"),o("li",null,"Capitalized: They/Them")),'Text like "Ask me my pronouns" or "Any pronouns" will always be capitalized. ',o("br",null),o("br",null),"You can also configure whether or not to display pronouns for the current user (since you probably already know them)"))}var rb=g(()=>{"use strict";a();lo();A()});var po,yl=g(()=>{"use strict";a();$();w();vl();po=D({pronounsFormat:{type:4,description:"The format for pronouns to appear in chat",options:[{label:"Lowercase",value:"LOWERCASE",default:!0},{label:"Capitalized",value:"CAPITALIZED"}]},pronounSource:{type:4,description:"Where to source pronouns from",options:[{label:"Prefer PronounDB, fall back to Discord",value:0,default:!0},{label:"Prefer Discord, fall back to PronounDB (might lead to inconsistency between pronouns in chat and profile)",value:1}]},showSelf:{type:3,description:"Enable or disable showing pronouns for the current user",default:!0},showInMessages:{type:3,description:"Show in messages",default:!0},showInProfile:{type:3,description:"Show in profile",default:!0}})});var Sl,ib=g(()=>{"use strict";a();Sl={hh:"He/Him",hi:"He/It",hs:"He/She",ht:"He/They",ih:"It/Him",ii:"It/Its",is:"It/She",it:"It/They",shh:"She/He",sh:"She/Her",si:"She/It",st:"She/They",th:"They/He",ti:"They/It",ts:"They/She",tt:"They/Them",any:"Any pronouns",other:"Other pronouns",ask:"Ask me my pronouns",avoid:"Avoid pronouns, use my name",unspecified:"Unspecified"}});function JA(e,t=!1){let n=nn.getUserProfile(e)?.pronouns;return t?n:nn.getGuildMemberProfile(e,Vr()?.guild_id)?.pronouns||n}function bl(e,t=!1){let n=JA(e,t)?.trim().replace(QA," "),[r]=rt(()=>VA(e),{fallbackValue:lb(e),onError:i=>console.error("Fetching pronouns failed: ",i)});return po.store.pronounSource===1&&n?[n,"Discord"]:r&&r!=="unspecified"?[tN(r),"PronounDB"]:[n,"Discord"]}function ab(e,t=!1){let n=bl(e,t);return!po.store.showInProfile||!po.store.showSelf&&e===W.getCurrentUser().id?sb:n}function lb(e){let t=Rm[e];return t&&t!=="unspecified"?t:t||null}function VA(e){return new Promise(t=>{let n=lb(e);if(n)return t(n);if(e in pi)return pi[e].push(t);pi[e]=[t],XA()})}async function eN(e){let t=new URLSearchParams;t.append("platform","discord"),t.append("ids",e.join(","));try{return await(await fetch("https://pronoundb.org/api/v1/lookup-bulk?"+t.toString(),{method:"GET",headers:{Accept:"application/json","X-PronounDB-Source":gc}})).json().then(r=>(Object.assign(Rm,r),r))}catch(n){console.error("PronounDB fetching failed: ",n);let r=Object.fromEntries(e.map(i=>[i,"unspecified"]));return Object.assign(Rm,r),r}}function tN(e){let{pronounsFormat:t}=E.plugins.PronounDB;return t==="CAPITALIZED"?Sl[e]:t==="LOWERCASE"&&["any","ask","avoid","other"].includes(e)?Sl[e]:Sl[e].toLowerCase()}var sb,Rm,pi,XA,QA,vl=g(()=>{"use strict";a();$();P();zr();bt();Qe();A();yl();ib();sb=[null,""],Rm={},pi={},XA=yn(async()=>{let e=Object.keys(pi),t=await eN(e);for(let n of e)pi[n]?.forEach(r=>r(t[n])),delete pi[n]});QA=/\n+/g});function cb(e){return!(!po.store.showInMessages||e.author.bot||e.author.system||e.type===nN||!po.store.showSelf&&e.author.id===W.getCurrentUser().id)}function oN({message:e}){let[t]=bl(e.author.id);return t?o("span",{className:oe(Tl.timestampInline,Tl.timestamp)},"\u2022 ",t):null}var Tl,nN,ub,pb,rN,db=g(()=>{"use strict";a();le();Re();j();A();vl();yl();Tl=I("timestampInline"),nN=24;ub=_.wrap(({message:e})=>cb(e)?o(oN,{message:e}):null,{noop:!0}),pb=_.wrap(({message:e})=>cb(e)?o(rN,{message:e}):null,{noop:!0});rN=_.wrap(({message:e})=>{let[t]=bl(e.author.id);return t?o("span",{className:oe(Tl.timestampInline,Tl.timestamp,"vc-pronoundb-compact")},"\u2022 ",t):null},{noop:!0})});var mb,Lm,fb=g(()=>{"use strict";a();ob();P();w();rb();db();vl();yl();mb={match:/text:(.{0,10}.Messages\.USER_PROFILE_PRONOUNS)(?=,)/,replace:'$& + (typeof vcPronounSource !== "undefined" ? ` (${vcPronounSource})` : "")'},Lm=y({name:"PronounDB",authors:[d.Tyman,d.TheKodeToad,d.Ven],description:"Adds pronouns to user messages using pronoundb",patches:[{find:"showCommunicationDisabledStyles",replacement:{match:/("span",{id:\i,className:\i,children:\i}\))/,replace:"$1, $self.CompactPronounsChatComponentWrapper(arguments[0])"}},{find:"showCommunicationDisabledStyles",replacement:{match:/(?<=return\s*\(0,\i\.jsxs?\)\(.+!\i&&)(\(0,\i.jsxs?\)\(.+?\{.+?\}\))/,replace:"[$1, $self.PronounsChatComponentWrapper(arguments[0])]"}},{find:".userTagNoNickname",replacement:[{match:/{user:(\i),[^}]*,pronouns:(\i),[^}]*}=\i;/,replace:"$&let vcPronounSource;[$2,vcPronounSource]=$self.useProfilePronouns($1.id);"},mb]},{find:".nameTagSmall)",replacement:[{match:/\.getName\(\i\);(?<=displayProfile.{0,200})/,replace:"$&const [vcPronounce,vcPronounSource]=$self.useProfilePronouns(arguments[0].user.id,true);if(arguments[0].displayProfile&&vcPronounce)arguments[0].displayProfile.pronouns=vcPronounce;"},mb]}],settings:po,settingsAboutComponent:km,PronounsChatComponentWrapper:ub,CompactPronounsChatComponentWrapper:pb,useProfilePronouns:ab})});var Em,gb=g(()=>{"use strict";a();Ir();P();bt();w();A();Em=y({name:"QuickMention",authors:[d.kemo],description:"Adds a quick mention button to the message actions bar",dependencies:["MessagePopoverAPI"],start(){Bn("QuickMention",e=>{let t=Q.getChannel(e.channel_id);return Ce.can(Se.SEND_MESSAGES,t)?{label:"Quick Mention",icon:this.Icon,message:e,channel:t,onClick:()=>so(`<@${e.author.id}> `)}:null})},stop(){Fn("QuickMention")},Icon:()=>o("svg",{className:"icon",height:"24",width:"24",viewBox:"0 0 24 24",fill:"currentColor"},o("path",{d:"M12 2C6.486 2 2 6.486 2 12C2 17.515 6.486 22 12 22C14.039 22 15.993 21.398 17.652 20.259L16.521 18.611C15.195 19.519 13.633 20 12 20C7.589 20 4 16.411 4 12C4 7.589 7.589 4 12 4C16.411 4 20 7.589 20 12V12.782C20 14.17 19.402 15 18.4 15L18.398 15.018C18.338 15.005 18.273 15 18.209 15H18C17.437 15 16.6 14.182 16.6 13.631V12C16.6 9.464 14.537 7.4 12 7.4C9.463 7.4 7.4 9.463 7.4 12C7.4 14.537 9.463 16.6 12 16.6C13.234 16.6 14.35 16.106 15.177 15.313C15.826 16.269 16.93 17 18 17L18.002 16.981C18.064 16.994 18.129 17 18.195 17H18.4C20.552 17 22 15.306 22 12.782V12C22 6.486 17.514 2 12 2ZM12 14.599C10.566 14.599 9.4 13.433 9.4 11.999C9.4 10.565 10.566 9.399 12 9.399C13.434 9.399 14.6 10.565 14.6 11.999C14.6 13.433 13.434 14.599 12 14.599Z"}))})});function wb(e,t){let n=e.findIndex(r=>r.id===t);return n===-1?n:e.length-n-1}function vb({channelId:e,messageId:t,_isQuickEdit:n}){if(n)return;let r=W.getCurrentUser().id,i=An.getMessages(e)._array.filter(s=>s.author.id===r);wl=wb(i,t)}function Sb({message:e,_isQuickReply:t}){t||(xl=wb(An.getMessages(e.channel_id)._array,e.id))}function bb(e){let t=e.key==="ArrowUp";!t&&e.key!=="ArrowDown"||!sN(e)||aN(e)||(e.shiftKey?uN(t):cN(t))}function Mb(e,t){let n=document.getElementById("message-content-"+t);if(!n)return;let r=Math.max(document.documentElement.clientHeight,window.innerHeight),i=n.getBoundingClientRect();(i.bottom<200||i.top-r>=-200)&&iN.jumpToMessage({channelId:e,messageId:t,flash:!1,jumpType:"INSTANT"})}function Pb(e,t){let n=An.getMessages(Pe.getChannelId())._array;if(!t){let l=W.getCurrentUser().id;n=n.filter(c=>c.author.id===l)}let r=l=>e?Math.min(n.length-1,l+1):Math.max(-1,l-1),i=l=>{do l=r(l);while(l!==-1&&n[n.length-l-1]?.deleted===!0);return l},s;return t?xl=s=i(xl):wl=s=i(wl),s===-1?void 0:n[n.length-s-1]}function lN(e){let{enabled:t,userList:n,shouldPingListed:r}=E.plugins.NoReplyMention,i=!t||r===n.includes(e.author.id);switch(xb.store.shouldMention){case 2:return i;case 0:return!1;default:return!0}}function cN(e){let t=Q.getChannel(Pe.getChannelId());if(t.guild_id&&!Ce.can(Se.SEND_MESSAGES,t))return;let n=Pb(e,!0);if(!n)return void F.dispatch({type:"DELETE_PENDING_REPLY",channelId:Pe.getChannelId()});let r=Q.getChannel(n.channel_id),i=W.getCurrentUser().id;F.dispatch({type:"CREATE_PENDING_REPLY",channel:r,message:n,shouldMention:lN(n),showMentionToggle:r.guild_id!==null&&n.author.id!==i,_isQuickReply:!0}),Mb(r.id,n.id)}function uN(e){let t=Q.getChannel(Pe.getChannelId());if(t.guild_id&&!Ce.can(Se.SEND_MESSAGES,t))return;let n=Pb(e,!1);if(!n)return F.dispatch({type:"MESSAGE_END_EDIT",channelId:Pe.getChannelId()});F.dispatch({type:"MESSAGE_START_EDIT",channelId:n.channel_id,messageId:n.id,content:n.content,_isQuickEdit:!0}),Mb(n.channel_id,n.id)}var iN,Tb,xl,wl,xb,Dm,hb,yb,sN,aN,Ib=g(()=>{"use strict";a();$();P();w();j();A();iN=I("jumpToMessage"),Tb=navigator.platform.includes("Mac"),xl=-1,wl=-1,xb=D({shouldMention:{type:4,description:"Ping reply by default",options:[{label:"Follow NoReplyMention",value:2,default:!0},{label:"Enabled",value:1},{label:"Disabled",value:0}]}}),Dm=y({name:"QuickReply",authors:[d.obscurity,d.Ven,d.pylix],description:"Reply to (ctrl + up/down) and edit (ctrl + shift + up/down) messages via keybinds",settings:xb,start(){F.subscribe("DELETE_PENDING_REPLY",hb),F.subscribe("MESSAGE_END_EDIT",yb),F.subscribe("MESSAGE_START_EDIT",vb),F.subscribe("CREATE_PENDING_REPLY",Sb),document.addEventListener("keydown",bb)},stop(){F.unsubscribe("DELETE_PENDING_REPLY",hb),F.unsubscribe("MESSAGE_END_EDIT",yb),F.unsubscribe("MESSAGE_START_EDIT",vb),F.unsubscribe("CREATE_PENDING_REPLY",Sb),document.removeEventListener("keydown",bb)}}),hb=()=>xl=-1,yb=()=>wl=-1;sN=e=>Tb?e.metaKey:e.ctrlKey,aN=e=>e.altKey||!Tb&&e.metaKey});var Om,pN,_m,Ab=g(()=>{"use strict";a();P();w();pN="https://raw.githubusercontent.com/facebook/react/17.0.2/scripts/error-codes/codes.json",_m=y({name:"ReactErrorDecoder",description:'Replaces "Minifed React Error" with the actual error.',authors:[d.Cyn],patches:[{find:'"https://reactjs.org/docs/error-decoder.html?invariant="',replacement:{match:/(function .\(.\)){(for\(var .="https:\/\/reactjs\.org\/docs\/error-decoder\.html\?invariant="\+.,.=1;.`${t}{var decoded=Vencord.Plugins.plugins.ReactErrorDecoder.decodeError.apply(null, arguments);if(decoded)return decoded;${n}}`}}],async start(){Om=await fetch(pN).then(e=>e.json()).catch(e=>console.error(`[ReactErrorDecoder] Failed to fetch React error codes -`,e))},stop(){Om=void 0},decodeError(e,...t){let n=0;return Om?.[e]?.replace(/%s/g,()=>{let r=t[n];return n++,r})}})});var Fm={};Be(Fm,{ServerListRenderPosition:()=>Ml,addServerListElement:()=>Is,removeServerListElement:()=>As,renderAll:()=>gN});function Bm(e){return e===0?mN:fN}function Is(e,t){Bm(e).add(t)}function As(e,t){Bm(e).delete(t)}var dN,Ml,mN,fN,gN,Pl=g(()=>{"use strict";a();Ze();dN=new ie("ServerListAPI"),Ml=(n=>(n[n.Above=0]="Above",n[n.In=1]="In",n))(Ml||{}),mN=new Set,fN=new Set;gN=e=>{let t=[];for(let n of Bm(e))try{t.unshift(n())}catch(r){dN.error("Failed to render server list element:",r)}return t}});function hN(){let e=[];Object.values(Te.getGuilds()).forEach(t=>{Ur.getChannels(t.id).SELECTABLE.forEach(n=>{!ar.hasUnread(n.channel.id)||e.push({channelId:n.channel.id,messageId:ar.lastMessageId(n.channel.id),readStateType:0})})}),F.dispatch({type:"BULK_ACK",context:"APP",channels:e})}var yN,Um,Nb=g(()=>{"use strict";a();Pl();P();w();A();yN=()=>o(R,{onClick:hN,size:R.Sizes.MIN,color:R.Colors.BRAND,style:{marginTop:"2px",marginBottom:"8px",marginLeft:"9px"}},"Read all"),Um=y({name:"ReadAllNotificationsButton",description:"Read all server notifications with a single button click!",authors:[d.kemo],dependencies:["ServerListAPI"],renderReadAllButton:()=>o(yN,null),start(){Is(0,this.renderReadAllButton)},stop(){As(0,this.renderReadAllButton)}})});var en,Il=g(()=>{"use strict";a();$();w();en=D({notices:{type:3,description:"Also show a notice at the top of your screen when removed (use this if you don't want to miss any notifications).",default:!1},offlineRemovals:{type:3,description:"Notify you when starting discord if you were removed while offline.",default:!0},friends:{type:3,description:"Notify when a friend removes you",default:!0},friendRequestCancels:{type:3,description:"Notify when a friend request is cancelled",default:!0},servers:{type:3,description:"Notify when removed from a server",default:!0},groups:{type:3,description:"Notify when removed from a group chat",default:!0}})});var $m=g(()=>{"use strict";a()});async function bN(){Gt.delMany(["relationship-notifier-guilds","relationship-notifier-groups","relationship-notifier-friends"])}async function Gm(){await bN();let[e,t,n]=await Gt.getMany([Cb(),kb(),Rb()]);if(await Promise.all([Nl(),Cl(),Ns()]),en.store.offlineRemovals){if(en.store.groups&&t?.size)for(let[r,i]of t)mi.has(r)||mo(`You are no longer in the group ${i.name}.`,i.iconURL);if(en.store.servers&&e?.size)for(let[r,i]of e)di.has(r)||mo(`You are no longer in the server ${i.name}.`,i.iconURL);if(en.store.friends&&n?.friends.length)for(let r of n.friends){if(Nr.friends.includes(r))continue;let i=await Rt.getUser(r).catch(()=>{});i&&mo(`You are no longer friends with ${ao(i)}.`,i.getAvatarURL(void 0,void 0,!1),()=>_n(i.id))}if(en.store.friendRequestCancels&&n?.requests?.length)for(let r of n.requests){if(Nr.requests.includes(r)||[1,2,4].includes(nt.getRelationshipType(r)))continue;let i=await Rt.getUser(r).catch(()=>{});i&&mo(`Friend request from ${ao(i)} has been revoked.`,i.getAvatarURL(void 0,void 0,!1),()=>_n(i.id))}}}function mo(e,t,n){en.store.notices&&Al.showNotice(e,"OK",()=>Al.popNotice()),Ie({title:"Relationship Notifier",body:e,icon:t,onClick:n})}function Lb(e){return di.get(e)}function Hm(e){di.delete(e),Nl()}async function Nl(){di.clear();let e=W.getCurrentUser().id;for(let[t,{name:n,icon:r}]of Object.entries(Te.getGuilds()))ke.isMember(t,e)&&di.set(t,{id:t,name:n,iconURL:r&&`https://cdn.discordapp.com/icons/${t}/${r}.png`});await Gt.set(Cb(),di)}function Eb(e){return mi.get(e)}function zm(e){mi.delete(e),Cl()}async function Cl(){mi.clear();for(let{type:e,id:t,name:n,rawRecipients:r,icon:i}of Q.getSortedPrivateChannels())e===3&&mi.set(t,{id:t,name:n||r.map(s=>s.username).join(", "),iconURL:i&&`https://cdn.discordapp.com/channel-icons/${t}/${i}.png`});await Gt.set(kb(),mi)}async function Ns(){Nr.friends=[],Nr.requests=[];let e=nt.getRelationships();for(let t in e)switch(e[t]){case 1:Nr.friends.push(t);break;case 3:Nr.requests.push(t);break}await Gt.set(Rb(),Nr)}var di,mi,Nr,Cb,kb,Rb,jm=g(()=>{"use strict";a();as();Ao();bt();A();Il();$m();di=new Map,mi=new Map,Nr={friends:[],requests:[]},Cb=()=>`relationship-notifier-guilds-${W.getCurrentUser().id}`,kb=()=>`relationship-notifier-groups-${W.getCurrentUser().id}`,Rb=()=>`relationship-notifier-friends-${W.getCurrentUser().id}`});async function Bb({relationship:{type:e,id:t}}){if(Wm===t){Wm=void 0;return}let n=await Rt.getUser(t).catch(()=>null);if(!!n)switch(e){case 1:en.store.friends&&mo(`${ao(n)} removed you as a friend.`,n.getAvatarURL(void 0,void 0,!1),()=>_n(n.id));break;case 3:en.store.friendRequestCancels&&mo(`A friend request from ${ao(n)} has been removed.`,n.getAvatarURL(void 0,void 0,!1),()=>_n(n.id));break}}function Fb({guild:{id:e,unavailable:t}}){if(!en.store.servers||t)return;if(qm===e){Hm(e),qm=void 0;return}let n=Lb(e);n&&(Hm(e),mo(`You were removed from the server ${n.name}.`,n.iconURL))}function Ub({channel:{id:e,type:t}}){if(!en.store.groups||t!==3)return;if(Km===e){zm(e),Km=void 0;return}let n=Eb(e);n&&(zm(e),mo(`You were removed from the group ${n.name}.`,n.iconURL))}var Wm,qm,Km,Db,Ob,_b,$b=g(()=>{"use strict";a();bt();A();Il();$m();jm();Db=e=>Wm=e,Ob=e=>qm=e,_b=e=>Km=e});var Ym,Gb=g(()=>{"use strict";a();P();w();$b();Il();jm();Ym=y({name:"RelationshipNotifier",description:"Notifies you when a friend, group chat, or server removes you.",authors:[d.nick],settings:en,patches:[{find:"removeRelationship:(",replacement:{match:/(removeRelationship:\((\i),\i,\i\)=>)/,replace:"$1($self.removeFriend($2),0)||"}},{find:"async leaveGuild(",replacement:{match:/(leaveGuild\((\i)\){)/,replace:"$1$self.removeGuild($2);"}},{find:"},closePrivateChannel(",replacement:{match:/(closePrivateChannel\((\i)\){)/,replace:"$1$self.removeGroup($2);"}}],flux:{GUILD_CREATE:Nl,GUILD_DELETE:Fb,CHANNEL_CREATE:Cl,CHANNEL_DELETE:Ub,RELATIONSHIP_ADD:Ns,RELATIONSHIP_UPDATE:Ns,RELATIONSHIP_REMOVE(e){Bb(e),Ns()},CONNECTION_OPEN:Gm},async start(){setTimeout(()=>{Gm()},5e3)},removeFriend:Db,removeGroup:_b,removeGuild:Ob})});var TN,xN,Zm,Hb=g(()=>{"use strict";a();P();w();j();TN=I("spoilerContent"),xN=I("messagesWrapper","messages"),Zm=y({name:"RevealAllSpoilers",description:"Reveal all spoilers in a message by Ctrl-clicking a spoiler, or in the chat with Ctrl+Shift-click",authors:[d.whqwert],patches:[{find:".removeObscurity=",replacement:{match:/(?<=\.removeObscurity=(\i)=>{)/,replace:(e,t)=>`$self.reveal(${t});`}}],reveal(e){let{ctrlKey:t,shiftKey:n,target:r}=e;if(!t)return;let{spoilerContent:i,hidden:s}=TN,{messagesWrapper:l}=xN,c=n?document.querySelector(`div.${l}`):r.parentElement;for(let u of c.querySelectorAll(`span.${i}.${s}`))u.click()}})});function zb(e,t){open(t+encodeURIComponent(e),"_blank")}var kl,jb,Xm,Wb=g(()=>{"use strict";a();Pt();Lt();$t();P();w();A();kl={Google:"https://lens.google.com/uploadbyurl?url=",Yandex:"https://yandex.com/images/search?rpt=imageview&url=",SauceNAO:"https://saucenao.com/search.php?url=",IQDB:"https://iqdb.org/?url=",TinEye:"https://www.tineye.com/search?url=",ImgOps:"https://imgops.com/start?url="};jb=(e,t)=>()=>{if(!t)return;let{reverseImageSearchType:n,itemHref:r,itemSrc:i}=t;if(!n||n!=="img")return;let s=r??i,l=mt("copy-link",e);l&&l.push(o(G.MenuItem,{label:"Search Image",key:"search-image",id:"search-image"},Object.keys(kl).map((c,u)=>{let p="search-image-"+c;return o(G.MenuItem,{key:p,id:p,label:o(ge,{style:{alignItems:"center",gap:"0.5em"}},o("img",{style:{borderRadius:u>=3?"50%":void 0},"aria-hidden":"true",height:16,width:16,src:new URL("/favicon.ico",kl[c]).toString().replace("lens.","")}),c),action:()=>zb(s,kl[c])})}),o(G.MenuItem,{key:"search-image-all",id:"search-image-all",label:o(ge,{style:{alignItems:"center",gap:"0.5em"}},o(Xi,{height:16,width:16}),"All"),action:()=>Object.values(kl).forEach(c=>zb(s,c))})))},Xm=y({name:"ReverseImageSearch",description:"Adds ImageSearch to image context menus",authors:[d.Ven,d.Nuckyz],tags:["ImageUtilities"],patches:[{find:".Messages.MESSAGE_ACTIONS_MENU_LABEL",replacement:{match:/favoriteableType:\i,(?<=(\i)\.getAttribute\("data-type"\).+?)/,replace:(e,t)=>`${e}reverseImageSearchType:${t}.getAttribute("data-role"),`}}],start(){ce("message",jb)},stop(){de("message",jb)}})});var Cs,Jm,qb=g(()=>{"use strict";a();$();P();w();A();Cs=D({chatMentions:{type:3,default:!0,description:"Show role colors in chat mentions (including in the message box)",restartNeeded:!0},memberList:{type:3,default:!0,description:"Show role colors in member list role headers",restartNeeded:!0},voiceUsers:{type:3,default:!0,description:"Show role colors in the voice chat user list",restartNeeded:!0}}),Jm=y({name:"RoleColorEverywhere",authors:[d.KingFish,d.lewisakura,d.AutumnVN],description:"Adds the top role color anywhere possible",patches:[{find:"CLYDE_AI_MENTION_COLOR:null,",replacement:[{match:/user:(\i),channel:(\i).{0,400}?"@"\.concat\(.+?\)/,replace:"$&,color:$self.getUserColor($1?.id,{channelId:$2?.id})"}],predicate:()=>Cs.store.chatMentions},{find:".userTooltip,children",replacement:[{match:/let\{id:(\i),guildId:(\i)[^}]*\}.*?\.default,{(?=children)/,replace:"$&color:$self.getUserColor($1,{guildId:$2}),"}],predicate:()=>Cs.store.chatMentions},{find:'tutorialId:"whos-online',replacement:[{match:/\i.roleIcon,\.\.\.\i/,replace:"$&,color:$self.roleGroupColor(arguments[0])"},{match:/null,\i," — ",\i\]/,replace:"null,$self.roleGroupColor(arguments[0])]"}],predicate:()=>Cs.store.memberList},{find:"renderPrioritySpeaker",replacement:[{match:/renderName\(\).{0,100}speaking:.{50,100}jsx.{5,10}{/,replace:"$&...$self.getVoiceProps(this.props),"}],predicate:()=>Cs.store.voiceUsers}],settings:Cs,getColor(e,{channelId:t,guildId:n}){return(n??=Q.getChannel(t)?.guild_id)?ke.getMember(n,e)?.colorString??null:null},getUserColor(e,t){let n=this.getColor(e,t);return n&&parseInt(n.slice(1),16)},roleGroupColor({id:e,count:t,title:n,guildId:r,label:i}){let l=Te.getGuild(r)?.roles[e];return o("span",{style:{color:l?.colorString,fontWeight:"unset",letterSpacing:".05em"}},n??i," \u2014 ",t)},getVoiceProps({user:{id:e},guildId:t}){return{style:{color:this.getColor(e,{guildId:t})}}}})});var Kb,Yb,Qm,Zb=g(()=>{"use strict";a();Pt();$t();P();w();j();A();Kb=I("replyToMessage"),Yb=(e,{message:t})=>()=>{if(Pe.getChannelId()!==t.channel_id)return;let n=Q.getChannel(t?.channel_id);if(!n||n.guild_id&&!Ce.can(Se.SEND_MESSAGES,n))return;let r=mt("pin",e);if(r&&!r.some(s=>s?.props?.id==="reply")){let s=r.findIndex(l=>l?.props.id==="pin");return r.splice(s+1,0,o(G.MenuItem,{id:"reply",label:ot.Messages.MESSAGE_ACTION_REPLY,icon:hu,action:l=>Kb.replyToMessage(n,t,l)}))}let i=mt("mark-unread",e);if(i&&!i.some(s=>s?.props?.id==="reply"))return i.unshift(o(G.MenuItem,{id:"reply",label:ot.Messages.MESSAGE_ACTION_REPLY,icon:hu,action:s=>Kb.replyToMessage(n,t,s)}))},Qm=y({name:"SearchReply",description:"Adds a reply button to search results",authors:[d.Aria],start(){ce("message",Yb)},stop(){de("message",Yb)}})});var Vm,Xb=g(()=>{"use strict";a();P();w();Vm=y({name:"SecretRingToneEnabler",description:"Always play the secret version of the discord ringtone (except during special ringtone events)",authors:[d.AndrewDLO,d.FieryFlames],patches:[{find:'call_ringing_beat"',replacement:{match:/500===\i\.random\(1,1e3\)/,replace:"true"}}]})});var Jb=g(()=>{});function Qb(e){let t=e.slice(1,-1).replace(/(\d)(AM|PM)$/i,"$1 $2"),n=new Date(`${new Date().toDateString()} ${t}`).getTime()/1e3;return isNaN(n)?e:(Date.now()/1e3>n&&(n+=86400),``)}function MN({rootProps:e,close:t}){let[n,r]=J(),[i,s]=J(""),l=Math.round((new Date(n).getTime()||Date.now())/1e3),c=(m,h)=>``,[u,p]=Nt(()=>{let m=c(l,i);return[m,Fe.parse(m)]},[l,i]);return o(ze,{...e},o(lt,{className:ks("modal-header")},o(S.FormTitle,{tag:"h2"},"Timestamp Picker"),o(an,{onClick:t})),o(et,{className:ks("modal-content")},o("input",{type:"datetime-local",value:n,onChange:m=>r(m.currentTarget.value),style:{colorScheme:Uo()===2?"light":"dark"}}),o(S.FormTitle,null,"Timestamp Format"),o(Pn,{options:wN.map(m=>({label:m,value:m})),isSelected:m=>m===i,select:m=>s(m),serialize:m=>m,renderOptionLabel:m=>o("div",{className:ks("format-label")},Fe.parse(c(l,m.value))),renderOptionValue:()=>p}),o(S.FormTitle,{className:q.bottom8},"Preview"),o(S.FormText,{className:ks("preview-text")},p," (",u,")")),o(_t,null,o(R,{onClick:()=>{so(u+" "),t()}},"Insert")))}var wN,ks,ef,Vb=g(()=>{"use strict";a();Jb();Yn();Je();P();bt();at();dt();w();A();wN=["","t","T","d","D","f","F","R"],ks=Ue("vc-st-");ef=y({name:"SendTimestamps",description:"Send timestamps easily via chat box button & text shortcuts. Read the extended description!",authors:[d.Ven,d.Tyler],dependencies:["MessageEventsAPI"],patches:[{find:"ChannelTextAreaButtons",replacement:{match:/(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/,replace:"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()"}}],start(){this.listener=Ht((e,t)=>{t.content=t.content.replace(/`\d{1,2}:\d{2} ?(?:AM|PM)?`/gi,Qb)})},stop(){zt(this.listener)},chatBarIcon(e){return e.type.analyticsName!=="normal"?null:o(V,{text:"Insert Timestamp"},({onMouseEnter:t,onMouseLeave:n})=>o("div",{style:{display:"flex"}},o(R,{"aria-haspopup":"dialog","aria-label":"Insert Timestamp",size:"",look:Kt.BLANK,onMouseEnter:t,onMouseLeave:n,innerClassName:vt.button,onClick:()=>{let r=je(i=>o(MN,{rootProps:i,close:()=>Vn(r)}))},className:ks("button")},o("div",{className:vt.buttonWrapper},o("svg",{"aria-hidden":"true",role:"img",width:"24",height:"24",viewBox:"0 0 24 24"},o("g",{fill:"none","fill-rule":"evenodd"},o("path",{fill:"currentColor",d:"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7v-5z"}),o("rect",{width:"24",height:"24"})))))))},settingsAboutComponent(){let e=["12:00","3:51","17:59","24:00","12:00 AM","0:13PM"].map(t=>`\`${t}\``);return o(f,null,o(S.FormText,null,"To quickly send send time only timestamps, include timestamps formatted as `HH:MM` (including the backticks!) in your message"),o(S.FormText,null,"See below for examples. If you need anything more specific, use the Date button in the chat bar!"),o(S.FormText,null,"Examples:",o("ul",null,e.map(t=>o("li",{key:t},o("code",null,t)," ","->"," ",Fe.parse(Qb(t)))))))}})});function PN(){return nT=Po(),o("span",{id:"vc-friendcount",style:{display:"inline-block",width:"100%",fontSize:"12px",fontWeight:"600",color:"var(--header-secondary)",textTransform:"uppercase",textAlign:"center"}},nf," online")}function IN(){return oT=Po(),o("span",{id:"vc-guildcount",style:{display:"inline-block",width:"100%",fontSize:"12px",fontWeight:"600",color:"var(--header-secondary)",textTransform:"uppercase",textAlign:"center"}},tT," servers")}function eT(){nf=0;let e=nt.getRelationships();for(let t of Object.keys(e))e[t]===1&&Hn.getStatus(t)!=="offline"&&(nf+=1);nT?.()}function tf(){tT=Te.getGuildCount(),oT?.()}var nf,tT,nT,oT,of,rT=g(()=>{"use strict";a();Pl();$();le();P();Qe();w();A();nf=0,tT=0;of=y({name:"ServerListIndicators",description:"Add online friend count or server count in the server list",authors:[d.dzshn],dependencies:["ServerListAPI"],options:{mode:{description:"mode",type:4,options:[{label:"Only online friend count",value:2,default:!0},{label:"Only server count",value:1},{label:"Both server and online friend counts",value:3}]}},renderIndicator:()=>{let{mode:e}=E.plugins.ServerListIndicators;return o(_,{noop:!0},o("div",{style:{marginBottom:"4px"}},!!(e&2)&&o(PN,null),!!(e&1)&&o(IN,null)))},flux:{PRESENCE_UPDATES:eT,GUILD_CREATE:tf,GUILD_DELETE:tf},start(){Is(0,this.renderIndicator),eT(),tf()},stop(){As(0,this.renderIndicator)}})});var iT=g(()=>{});function lT(e){je(t=>o(ze,{...t,size:"medium"},o(NN,{guild:e})))}function aT(e){return o(Gn,{timestamp:mn(e)})}function NN({guild:e}){let[t,n]=J(),[r,i]=J();De(()=>{Ll.friends=!1,Ll.blocked=!1},[]);let[s,l]=J(0),c=e.banner&&Rl.getGuildBannerURL({id:e.id,banner:e.banner},!0).replace(/\?size=\d+$/,"?size=1024"),u=e.icon&&Rl.getGuildIconURL({id:e.id,icon:e.icon,canAnimate:!0,size:512});return o("div",{className:tn("root")},c&&s===0&&o("img",{className:tn("banner"),src:c,alt:"",onClick:()=>On(c)}),o("div",{className:tn("header")},e.icon?o("img",{src:u,alt:"",onClick:()=>On(u)}):o("div",{"aria-hidden":!0,className:oe(sT.childWrapper,sT.acronym)},e.acronym),o("div",{className:tn("name-and-description")},o(S.FormTitle,{tag:"h5",className:tn("name")},e.name),e.description&&o(S.FormText,null,e.description))),o(In,{type:"top",look:"brand",className:tn("tab-bar"),selectedItem:s,onItemSelect:l},o(In.Item,{className:tn("tab",{selected:s===0}),id:0},"Server Info"),o(In.Item,{className:tn("tab",{selected:s===1}),id:1},"Friends",t!==void 0?` (${t})`:""),o(In.Item,{className:tn("tab",{selected:s===2}),id:2},"Blocked Users",r!==void 0?` (${r})`:"")),o("div",{className:tn("tab-content")},s===0&&o(kN,{guild:e}),s===1&&o(RN,{guild:e,setCount:n}),s===2&&o(LN,{guild:e,setCount:i})))}function CN(e,t){let n=ke.getMember(e,t.id)?.avatar,r=n?Rl.getGuildMemberAvatarURLSimple({userId:t.id,avatar:n,guildId:e,canAnimate:!0},!0):Rl.getUserAvatarURL(t,!0);return o("div",{className:tn("owner")},o("img",{src:r,alt:"",onClick:()=>On(r)}),Fe.parse(`<@${t.id}>`))}function kN({guild:e}){let[t]=rt(()=>Rt.getUser(e.ownerId),{deps:[e.ownerId],fallbackValue:null}),n={"Server Owner":t?CN(e.id,t):"Loading...","Created At":aT(zn.extractTimestamp(e.id)),"Joined At":e.joinedAt?aT(e.joinedAt.getTime()):"-","Vanity Link":e.vanityURLCode?o("a",null,`discord.gg/${e.vanityURLCode}`):"-","Preferred Locale":e.preferredLocale||"-","Verification Level":["None","Low","Medium","High","Highest"][e.verificationLevel]||"?","Nitro Boosts":`${e.premiumSubscriberCount??0} (Level ${e.premiumTier??0})`,Channels:Ur.getChannels(e.id)?.count-1||"?",Roles:Object.keys(e.roles).length-1};return o("div",{className:tn("info")},Object.entries(n).map(([r,i])=>o("div",{className:tn("server-info-pair"),key:r},o(S.FormTitle,{tag:"h5"},r),typeof i=="string"?o("span",null,i):i)))}function RN({guild:e,setCount:t}){return cT("friends",e,nt.getFriendIDs(),t)}function LN({guild:e,setCount:t}){let n=Object.keys(nt.getRelationships()).filter(r=>nt.isBlocked(r));return cT("blocked",e,n,t)}function cT(e,t,n,r){let i=[],s=[];for(let l of n)ke.isMember(t.id,l)?s.push(l):i.push(l);return He([ke],()=>ke.getMemberIds(t.id),null,(l,c)=>l.length===c.length),De(()=>{!Ll[e]&&i.length&&(Ll[e]=!0,F.dispatch({type:"GUILD_MEMBERS_REQUEST",guildIds:[t.id],userIds:i}))},[]),De(()=>r(s.length),[s.length]),o(Er,{fade:!0,className:tn("scroller")},s.map(l=>o(AN,{user:W.getUser(l),status:Hn.getStatus(l)||"offline",onSelect:()=>_n(l),onContextMenu:()=>{}})))}var Rl,sT,AN,tn,Ll,uT=g(()=>{"use strict";a();iT();Je();bt();Re();dt();Qe();j();A();Rl=I("getGuildBannerURL"),sT=I("icon","acronym","childWrapper"),AN=ac("FriendRow"),tn=Ue("vc-gp-");Ll={friends:!1,blocked:!1}});var pT,rf,dT=g(()=>{"use strict";a();Pt();P();w();A();uT();pT=(e,{guild:t})=>()=>{mt("privacy",e)?.push(o(G.MenuItem,{id:"vc-server-profile",label:"Server Info",action:()=>lT(t)}))},rf=y({name:"ServerProfile",description:"Allows you to view info about a server by right clicking it in the server list",authors:[d.Ven,d.Nuckyz],tags:["guild","info"],start(){ce(["guild-context","guild-header-popout"],pT)},stop(){de(["guild-context","guild-header-popout"],pT)}})});var mT=g(()=>{});var fT,gT=g(()=>{a();fT=`/* eslint-disable simple-header/header */ +`,classNames:{},dom:null});Bd="src/plugins/noMosaic/styles.css"});var Fd,Ud,XS=g(()=>{"use strict";a();$();Ve();P();M();ZS();Fd=D({inlineVideo:{description:"Play videos without carousel modal",type:3,default:!0,restartNeeded:!0},mediaLayoutType:{description:"Choose media layout type",type:4,restartNeeded:!0,options:[{label:"STATIC, render loading image but image isn't resposive, no problem unless discord window width is too small",value:"STATIC",default:!0},{label:"RESPONSIVE, image is responsive but not render loading image, cause messages shift when loaded",value:"RESPONSIVE"}]}}),Ud=y({name:"NoMosaic",authors:[p.AutumnVN],description:"Removes Discord new image mosaic",tags:["image","mosaic","media"],settings:Fd,patches:[{find:".oneByTwoLayoutThreeGrid",replacement:[{match:/mediaLayoutType:\i\.\i\.MOSAIC/,replace:"mediaLayoutType:$self.mediaLayoutType()"},{match:/null!==\(\i=\i\.get\(\i\)\)&&void 0!==\i\?\i:"INVALID"/,replace:'"INVALID"'}]},{find:"renderAttachments(",predicate:()=>Fd.store.inlineVideo,replacement:{match:/url:(\i)\.url\}\);return /,replace:"$&$1.content_type?.startsWith('image/')&&"}},{find:"Messages.REMOVE_ATTACHMENT_TOOLTIP_TEXT",replacement:{match:/\i===\i\.\i\.MOSAIC/,replace:"true"}}],mediaLayoutType(){return Fd.store.mediaLayoutType},start(){St(Bd)},stop(){$t(Bd)}})});var iA,Ss,$d,JS=g(()=>{"use strict";a();$();P();M();j();iA=A("getMessageRequestsCount"),Ss=D({hideFriendRequestsCount:{type:3,description:"Hide incoming friend requests count",default:!0,restartNeeded:!0},hideMessageRequestsCount:{type:3,description:"Hide message requests count",default:!0,restartNeeded:!0},hidePremiumOffersCount:{type:3,description:"Hide nitro offers count",default:!0,restartNeeded:!0}}),$d=y({name:"NoPendingCount",description:"Removes the ping count of incoming friend requests, message requests, and nitro offers.",authors:[p.amia],settings:Ss,patches:[{find:"getPendingCount(){",predicate:()=>Ss.store.hideFriendRequestsCount,replacement:{match:/(?<=getPendingCount\(\)\{)/,replace:"return 0;"}},{find:"getMessageRequestsCount(){",predicate:()=>Ss.store.hideMessageRequestsCount,replacement:{match:/(?<=getMessageRequestsCount\(\)\{)/,replace:"return 0;"}},{find:".getSpamChannelsCount(),",predicate:()=>Ss.store.hideMessageRequestsCount,replacement:{match:/(?<=getSpamChannelsCount\(\),\i=)\i\.getMessageRequestsCount\(\)/,replace:"$self.getRealMessageRequestCount()"}},{find:"showProgressBadge:",predicate:()=>Ss.store.hidePremiumOffersCount,replacement:{match:/(?<=\{unviewedTrialCount:(\i),unviewedDiscountCount:(\i)\}.{0,200}\i=)\1\+\2/,replace:"0"}}],getRealMessageRequestCount(){return iA.getMessageRequestChannelIds().size}})});var Gd,QS=g(()=>{"use strict";a();P();M();Gd=y({name:"NoProfileThemes",description:"Completely removes Nitro profile themes",authors:[p.TheKodeToad],patches:[{find:".NITRO_BANNER,",replacement:{match:/=(?=\i\.\i\.isPremiumAtLeast\(null==(\i))/,replace:"=(arguments[0]?.bannerSrc||$1?.banner)&&"}},{find:".avatarPositionPremiumNoBanner,default:",replacement:{match:/\.avatarPositionPremiumNoBanner(?=,default:\i\.(\i))/,replace:".$1"}},{find:"hasThemeColors(){",replacement:{match:/get canUsePremiumProfileCustomization\(\){return /,replace:"$&false &&"}}]})});var ul,Hd,VS=g(()=>{"use strict";a();$();P();M();ul=D({userList:{description:"List of users to allow or exempt pings for (separated by commas or spaces)",type:0,default:"1234567890123445,1234567890123445"},shouldPingListed:{description:"Behaviour",type:4,options:[{label:"Do not ping the listed users",value:!1},{label:"Only ping the listed users",value:!0,default:!0}]},inverseShiftReply:{description:"Invert Discord's shift replying behaviour (enable to make shift reply mention user)",type:3,default:!1}}),Hd=y({name:"NoReplyMention",description:"Disables reply pings by default",authors:[p.DustyAngel47,p.axyie,p.pylix,p.outfoxxed],settings:ul,shouldMention(e,t){let n=ul.store.userList.includes(e.author.id),r=ul.store.shouldPingListed?n:!n;return ul.store.inverseShiftReply?t!==r:!t&&r},patches:[{find:',"Message")}function',replacement:{match:/:(\i),shouldMention:!(\i)\.shiftKey/,replace:":$1,shouldMention:$self.shouldMention($1,$2.shiftKey)"}}]})});var zd,e0=g(()=>{"use strict";a();P();M();zd=y({name:"NoScreensharePreview",description:"Disables screenshare previews from being sent.",authors:[p.Nuckyz],patches:[{find:'"ApplicationStreamPreviewUploadManager"',replacement:{match:/await \i\.\i\.(makeChunkedRequest\(|post\(\{url:)\i\.\i\.STREAM_PREVIEW.+?\}\)/g,replace:"0"}}]})});var jd,t0=g(()=>{"use strict";a();P();M();jd=y({name:"NoTypingAnimation",authors:[p.AutumnVN],description:"Disables the CPU-intensive typing dots animation",patches:[{find:"dotCycle",replacement:{match:/document.hasFocus\(\)/,replace:"false"}}]})});var Wd,n0=g(()=>{"use strict";a();P();M();Wd=y({name:"NoUnblockToJump",description:"Allows you to jump to messages of blocked users without unblocking them",authors:[p.dzshn],patches:[{find:'.id,"Search Results"',replacement:{match:/if\(.{1,10}\)(.{1,10}\.show\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/,replace:"if(false)$1"}},{find:"renderJumpButton()",replacement:{match:/if\(.{1,10}\)(.{1,10}\.show\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/,replace:"if(false)$1"}},{find:"flash:!0,returnMessageId",replacement:{match:/.\?(.{1,10}\.show\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/,replace:"false?$1"}}]})});var qd,o0=g(()=>{"use strict";a();P();M();qd=y({name:"NormalizeMessageLinks",description:"Strip canary/ptb from message links",authors:[p.bb010g],patches:[{find:".Messages.COPY_MESSAGE_LINK,",replacement:{match:/\.concat\(location\.host\)/,replace:".concat($self.normalizeHost(location.host))"}}],normalizeHost(e){return e.replace(/(^|\b)(canary\.|ptb\.)(discord.com)$/,"$1$3")}})});var Kd,r0=g(()=>{"use strict";a();P();M();Kd=y({name:"NSFWGateBypass",description:"Allows you to access NSFW channels without setting/verifying your age",authors:[p.Commandtechno],patches:[{find:".nsfwAllowed=null",replacement:{match:/(\w+)\.nsfwAllowed=/,replace:"$1.nsfwAllowed=true;"}}]})});var bs,Yd,i0=g(()=>{"use strict";a();$();P();M();I();bs=D({channelToAffect:{type:4,description:"Select the type of DM for the plugin to affect",options:[{label:"Both",value:"both_dms",default:!0},{label:"User DMs",value:"user_dm"},{label:"Group DMs",value:"group_dm"}]},allowMentions:{type:3,description:"Receive audio pings for @mentions",default:!1},allowEveryone:{type:3,description:"Receive audio pings for @everyone and @here in group DMs",default:!1}}),Yd=y({name:"OnePingPerDM",description:"If unread messages are sent by a user in DMs multiple times, you'll only receive one audio ping. Read the messages to reset the limit",authors:[p.ProffDea],settings:bs,patches:[{find:".getDesktopType()===",replacement:[{match:/(\i\.\i\.getDesktopType\(\)===\i\.\i\.NEVER)\)/,replace:"$&if(!$self.isPrivateChannelRead(arguments[0]?.message))return;else "},{match:/sound:(\i\?\i:void 0,volume:\i,onClick)/,replace:"sound:!$self.isPrivateChannelRead(arguments[0]?.message)?undefined:$1"}]}],isPrivateChannelRead(e){let t=Q.getChannel(e.channel_id)?.type;return t!==1&&t!==3||t===1&&bs.store.channelToAffect==="group_dm"||t===3&&bs.store.channelToAffect==="user_dm"||bs.store.allowMentions&&e.mentions.some(n=>n.id===W.getCurrentUser().id)||bs.store.allowEveryone&&e.mention_everyone?!0:ar.getOldestUnreadMessageId(e.channel_id)===e.id}})});var Zd,s0=g(()=>{"use strict";a();P();M();Zd=y({name:"oneko",description:"cat follow mouse (real)",authors:[p.Ven,p.adryd],start(){fetch("https://raw.githubusercontent.com/adryd325/oneko.js/5977144dce83e4d71af1de005d16e38eebeb7b72/oneko.js").then(e=>e.text()).then(e=>e.replace("./oneko.gif","https://raw.githubusercontent.com/adryd325/oneko.js/14bab15a755d0e35cd4ae19c931d96d306f99f42/oneko.gif")).then(eval)},stop(){clearInterval(window.onekoInterval),delete window.onekoInterval,document.getElementById("oneko")?.remove()}})});var sA,aA,lA,cA,Ar,uA,Xd,a0=g(()=>{"use strict";a();$();P();M();I();sA=/^https:\/\/(spotify\.link|s\.team)\/.+$/,aA=/^https:\/\/open\.spotify\.com\/(track|album|artist|playlist|user|episode)\/(.+)(?:\?.+?)?$/,lA=/^https:\/\/(steamcommunity\.com|(?:help|store)\.steampowered\.com)\/.+$/,cA=/^https:\/\/store\.epicgames\.com\/(.+)$/,Ar=D({spotify:{type:3,description:"Open Spotify links in the Spotify app",default:!0},steam:{type:3,description:"Open Steam links in the Steam app",default:!0},epic:{type:3,description:"Open Epic Games links in the Epic Games Launcher",default:!0}}),uA=VencordNative.pluginHelpers.OpenInApp,Xd=y({name:"OpenInApp",description:"Open Spotify, Steam and Epic Games URLs in their respective apps instead of your browser",authors:[p.Ven],settings:Ar,patches:[{find:"trackAnnouncementMessageLinkClicked({",replacement:{match:/(?<=handleClick:function\(\)\{return (\i)\}.+?)function \1\(.+?\)\{/,replace:"async $& if(await $self.handleLink(...arguments)) return;"}},{find:"WEB_OPEN(",predicate:()=>Ar.store.spotify,replacement:{match:/\i\.\i\.isProtocolRegistered\(\)(.{0,100})window.open/g,replace:"true$1VencordNative.native.openExternal"}},{find:".CONNECTED_ACCOUNT_VIEWED,",replacement:{match:/(?<=href:\i,onClick:\i=>\{)(?=.{0,10}\i=(\i)\.type,.{0,100}CONNECTED_ACCOUNT_VIEWED)/,replace:"$self.handleAccountView(arguments[0],$1.type,$1.id);"}}],async handleLink(e,t){if(!e)return!1;let n=e.href;sA.test(n)&&(t?.preventDefault(),n=await uA.resolveRedirect(n));e:{if(!Ar.store.spotify)break e;let r=aA.exec(n);if(!r)break e;let[,i,s]=r;return VencordNative.native.openExternal(`spotify:${i}:${s}`),t?.preventDefault(),!0}e:{if(!Ar.store.steam||!lA.test(n))break e;return VencordNative.native.openExternal(`steam://openurl/${n}`),t?.preventDefault(),yn("Opened link in Steam",ee.Type.SUCCESS),!0}e:{if(!Ar.store.epic)break e;let r=cA.exec(n);if(!r)break e;return VencordNative.native.openExternal(`com.epicgames.launcher://store/${r[1]}`),t?.preventDefault(),!0}return t?.defaultPrevented?(window.open(n,"_blank"),!0):!1},handleAccountView(e,t,n){t==="spotify"&&Ar.store.spotify?(VencordNative.native.openExternal(`spotify:user:${n}`),e.preventDefault()):t==="steam"&&Ar.store.steam&&(VencordNative.native.openExternal(`steam://openurl/https://steamcommunity.com/profiles/${n}`),yn("Opened link in Steam",ee.Type.SUCCESS),e.preventDefault())}})});function c0(e){B.dispatch({type:"POGGERMODE_SETTINGS_UPDATE",settings:{enabled:e,settingsVisible:e}})}function u0(e){let t={screenshakeEnabledLocations:{0:!0,1:!0,2:!0},shakeIntensity:1,confettiSize:16,confettiCount:5,combosRequiredCount:1};switch(e){case 0:{Object.assign(t,{screenshakeEnabledLocations:{0:!0,1:!1,2:!1},combosRequiredCount:5});break}case 1:{Object.assign(t,{confettiSize:12,confettiCount:8});break}case 2:{Object.assign(t,{shakeIntensity:20,confettiSize:25,confettiCount:15});break}}B.dispatch({type:"POGGERMODE_SETTINGS_UPDATE",settings:t})}var l0,Jd,p0=g(()=>{"use strict";a();$();P();M();I();l0=D({superIntensePartyMode:{description:"Party intensity",type:4,options:[{label:"Normal",value:0,default:!0},{label:"Better",value:1},{label:"Project X",value:2}],restartNeeded:!1,onChange:u0}}),Jd=y({name:"Party mode \u{1F389}",description:"Allows you to use party mode cause the party never ends \u2728",authors:[p.UwUDev],settings:l0,start(){c0(!0),u0(l0.store.superIntensePartyMode)},stop(){c0(!1)}})});var Qd,Vd,d0=g(()=>{"use strict";a();$();P();M();Qd=D({lockout:{type:3,default:!0,description:`Bypass the permission lockout prevention ("Pretty sure you don't want to do this")`,restartNeeded:!0},onboarding:{type:3,default:!0,description:'Bypass the onboarding requirements ("Making this change will make your server incompatible [...]")',restartNeeded:!0}}),Vd=y({name:"PermissionFreeWill",description:"Disables the client-side restrictions for channel permission management.",authors:[p.lewisakura],patches:[{find:".showPermissionLockoutModal(",replacement:[{match:/case"DENY":.{0,50}if\((?=\i\.\i\.can)/,replace:"$&true||"}],predicate:()=>Qd.store.lockout},{find:".ONBOARDING_CHANNEL_THRESHOLD_WARNING",replacement:[{match:/(?<=(?:isDefaultChannelThresholdMetAfterDelete|checkDefaultChannelThresholdMetAfterChannelPermissionDeny):function\(\)\{)return \i(?=\})/g,replace:"return () => true"}],predicate:()=>Qd.store.onboarding}],settings:Qd})});var m0=g(()=>{});function pA(e){return ao(e.toLowerCase().split("_"))}function pl(e){return e=f0[e]||e,Ct.Messages[e]||pA(e)}function g0(e){e==="USE_APPLICATION_COMMANDS"?e="USE_APPLICATION_COMMANDS_GUILD":e==="SEND_VOICE_MESSAGES"?e="SEND_VOICE_MESSAGE_GUILD":e!=="STREAM"&&(e=f0[e]||e);let t=Ct.Messages[`ROLE_PERMISSIONS_${e}_DESCRIPTION`];return t?.hasMarkdown?$e.parse(t.message):typeof t=="string"?t:""}function dl({roles:e,id:t},n){return[...n.roles,t].map(r=>e[r]).sort((r,i)=>i.position-r.position)}function h0(e){switch(Zo.store.permissionsSortOrder){case 0:return e.sort((t,n)=>n.position-t.position);case 1:return e.sort((t,n)=>t.position-n.position);default:return e}}function ml(e,t){let n=we.getGuild(t);return e.sort((r,i)=>{if(r.type!==0||i.type!==0)return 0;let s=n.roles[r.id];return n.roles[i.id].position-s.position})}var qt,f0,Ts=g(()=>{"use strict";a();Ve();lo();I();ws();xs();qt=Ge("vc-permviewer-");f0={MANAGE_GUILD:"MANAGE_SERVER",MANAGE_GUILD_EXPRESSIONS:"MANAGE_EXPRESSIONS",CREATE_GUILD_EXPRESSIONS:"CREATE_EXPRESSIONS",MODERATE_MEMBERS:"MODERATE_MEMBER",STREAM:"VIDEO",SEND_VOICE_MESSAGES:"ROLE_PERMISSIONS_SEND_VOICE_MESSAGE"}});function em(){return o("svg",{height:"24",width:"24",viewBox:"0 0 24 24"},o("title",null,"Denied"),o("path",{fill:"var(--status-danger)",d:"M18.4 4L12 10.4L5.6 4L4 5.6L10.4 12L4 18.4L5.6 20L12 13.6L18.4 20L20 18.4L13.6 12L20 5.6L18.4 4Z"}))}function tm(){return o("svg",{height:"24",width:"24",viewBox:"0 0 24 24"},o("title",null,"Allowed"),o("path",{fill:"var(--text-positive)",d:"M8.99991 16.17L4.82991 12L3.40991 13.41L8.99991 19L20.9999 7.00003L19.5899 5.59003L8.99991 16.17ZZ"}))}function v0(){return o("svg",{height:"24",width:"24",viewBox:"0 0 16 16"},o("g",null,o("title",null,"Not overwritten"),o("polygon",{fill:"var(--text-normal)",points:"12 2.32 10.513 2 4 13.68 5.487 14"})))}var S0=g(()=>{"use strict";a()});function mA(e,t,n){return Ke(r=>o(hA,{modalProps:r,permissions:e,guild:t,header:n}))}function fA({permissions:e,guild:t,modalProps:n,header:r}){e.sort((c,u)=>c.type-u.type),We([Le],()=>Le.getMemberIds(t.id),null,(c,u)=>c.length===u.length),_e(()=>{let c=e.filter(u=>u.type===1&&!Le.isMember(t.id,u.id)).map(({id:u})=>u);B.dispatch({type:"GUILD_MEMBERS_REQUEST",guildIds:[t.id],userIds:c})},[]);let[i,s]=J(0),l=e[i];return o(qe,{...n,size:"large"},o(at,null,o(oe,{className:qt("perms-title"),variant:"heading-lg/semibold"},r," permissions:"),o(cn,{onClick:n.onClose})),o(tt,null,!l&&o("div",{className:qt("perms-no-perms")},o(oe,{variant:"heading-lg/normal"},"No permissions to display!")),l&&o("div",{className:qt("perms-container")},o("div",{className:qt("perms-list")},e.map((c,u)=>{let d=W.getUser(c.id??""),m=t.roles[c.id??""];return o("button",{className:qt("perms-list-item-btn"),onClick:()=>s(u)},o("div",{className:qt("perms-list-item",{"perms-list-item-active":i===u}),onContextMenu:h=>{Zo.store.unsafeViewAsRole&&c.type===0&&gn.open(h,()=>o(gA,{guild:t,roleId:c.id,onClose:n.onClose}))}},(c.type===0||c.type===2)&&o("span",{className:qt("perms-role-circle"),style:{backgroundColor:m?.colorString??"var(--primary-300)"}}),c.type===1&&d!==void 0&&o("img",{className:qt("perms-user-img"),src:d.getAvatarURL(void 0,void 0,!1)}),o(oe,{variant:"text-md/normal"},c.type===0?m?.name??"Unknown Role":c.type===1?(d&&po(d))??"Unknown User":o(ye,{style:{gap:"0.2em",justifyItems:"center"}},"@owner",o(hy,{height:18,width:18,"aria-hidden":"true"})))))})),o("div",{className:qt("perms-perms")},Object.entries(Te).map(([c,u])=>o("div",{className:qt("perms-perms-item")},o("div",{className:qt("perms-perms-item-icon")},(()=>{let{permissions:d,overwriteAllow:m,overwriteDeny:h}=l;return d?(d&u)===u?tm():em():m&&(m&u)===u?tm():h&&(h&u)===u?em():v0()})()),o(oe,{variant:"text-md/normal"},pl(c)),o(V,{text:g0(c)||"No Description"},d=>o(Aa,{...d}))))))))}function gA({guild:e,roleId:t,onClose:n}){return o(U.Menu,{navId:qt("role-context-menu"),onClose:gn.close,"aria-label":"Role Options"},o(U.MenuItem,{id:"vc-pw-view-as-role",label:"View As Role",action:()=>{let r=e.roles[t];!r||(n(),B.dispatch({type:"IMPERSONATE_UPDATE",guildId:e.id,data:{type:"ROLES",roles:{[t]:r}}}))}}))}var hA,ui,xs=g(()=>{"use strict";a();le();Dt();Ht();It();dt();I();ws();Ts();S0();hA=_.wrap(fA),ui=mA});var b0=g(()=>{});function om({children:e,onMoreClick:t,buttons:n,moreTooltipText:r,defaultState:i=!1,onDropDownClick:s,headerText:l}){let[c,u]=J(i);return o(f,null,o("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"}},o(oe,{tag:"h2",variant:"eyebrow",style:{color:"var(--header-primary)",display:"inline"}},l),o("div",{className:nm("center-flex")},n??null,t&&o(V,{text:r},d=>o("button",{...d,className:nm("btn"),onClick:t},o("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},o("path",{fill:"var(--text-normal)",d:"M7 12.001C7 10.8964 6.10457 10.001 5 10.001C3.89543 10.001 3 10.8964 3 12.001C3 13.1055 3.89543 14.001 5 14.001C6.10457 14.001 7 13.1055 7 12.001ZM14 12.001C14 10.8964 13.1046 10.001 12 10.001C10.8954 10.001 10 10.8964 10 12.001C10 13.1055 10.8954 14.001 12 14.001C13.1046 14.001 14 13.1055 14 12.001ZM19 10.001C20.1046 10.001 21 10.8964 21 12.001C21 13.1055 20.1046 14.001 19 14.001C17.8954 14.001 17 13.1055 17 12.001C17 10.8964 17.8954 10.001 19 10.001Z"})))),o(V,{text:c?"Hide "+l:"Show "+l},d=>o("button",{...d,className:nm("btn"),onClick:()=>{u(m=>!m),s?.(c)}},o("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:c?"scale(1 -1)":"scale(1 1)"},o("path",{fill:"var(--text-normal)",d:"M16.59 8.59003L12 13.17L7.41 8.59003L6 10L12 16L18 10L16.59 8.59003Z"})))))),c&&e)}var nm,T0=g(()=>{"use strict";a();Ve();I();b0();nm=Ge("vc-expandableheader-")});function vA({guild:e,guildMember:t}){let n=Zo.use(["permissionsSortOrder"]),[r,i]=Nt(()=>{let w=[],b=dl(e,t),x=b.map(N=>({type:0,...N}));if(e.ownerId===t.userId){x.push({type:2,permissions:Object.values(Te).reduce((k,F)=>k|F,0n)});let N=Ct.Messages.GUILD_OWNER||"Server Owner";w.push({permission:N,roleColor:"var(--primary-300)",rolePosition:1/0})}h0(b);for(let[N,k]of Object.entries(Te))for(let{permissions:F,colorString:G,position:K,name:q}of b)if((F&k)===k){w.push({permission:pl(N),roleColor:G||"var(--primary-300)",rolePosition:K});break}return w.sort((N,k)=>k.rolePosition-N.rolePosition),[x,w]},[n.permissionsSortOrder]),{root:s,role:l,roleRemoveButton:c,roleNameOverflow:u,roles:d,rolePill:m,rolePillBorder:h,roleCircle:v,roleName:T}=yA;return o(om,{headerText:"Permissions",moreTooltipText:"Role Details",onMoreClick:()=>ui(r,e,t.nick||W.getUser(t.userId).username),defaultState:Zo.store.defaultPermissionsDropdownState,buttons:[o(V,{text:`Sorting by ${n.permissionsSortOrder===0?"Highest Role":"Lowest Role"}`},w=>o("button",{...w,className:qt("userperms-sortorder-btn"),onClick:()=>{n.permissionsSortOrder=n.permissionsSortOrder===0?1:0}},o("svg",{width:"20",height:"20",viewBox:"0 96 960 960",transform:n.permissionsSortOrder===0?"scale(1 1)":"scale(1 -1)"},o("path",{fill:"var(--text-normal)",d:"M440 896V409L216 633l-56-57 320-320 320 320-56 57-224-224v487h-80Z"}))))]},i.length>0&&o("div",{className:re(s,d)},i.map(({permission:w,roleColor:b})=>o("div",{className:re(l,m,h)},o("div",{className:c},o("span",{className:v,style:{backgroundColor:b}})),o("div",{className:T},o(oe,{className:u,variant:"text-xs/medium"},w))))))}var yA,x0,w0=g(()=>{"use strict";a();le();T0();Zt();Be();j();I();ws();Ts();xs();yA=Qe(()=>{let e=rc(ce.byProps("roles","rolePill","rolePillBorder"),ce.byProps("roleCircle","dotBorderBase","dotBorderColor"),ce.byProps("roleNameOverflow","root","roleName","roleRemoveButton"));return Object.assign({},...e)});x0=_.wrap(vA,{noop:!0})});function rm(e,t,n){return n===0&&!Le.isMember(e,t)?null:o(U.MenuItem,{id:"perm-viewer-permissions",label:"Permissions",action:()=>{let r=we.getGuild(e),i,s;switch(n){case 0:{let l=Le.getMember(e,t);i=dl(r,l).map(c=>({type:0,...c})),r.ownerId===t&&i.push({type:2,permissions:Object.values(Te).reduce((c,u)=>c|u,0n)}),s=l.nick??W.getUser(l.userId).username;break}case 1:{let l=Q.getChannel(t);i=ml(Object.values(l.permissionOverwrites).map(({id:c,allow:u,deny:d,type:m})=>({type:m,id:c,overwriteAllow:u,overwriteDeny:d})),e),s=l.name;break}default:{i=Object.values(r.roles).map(l=>({type:0,...l})),s=r.name;break}}ui(i,r,s)}})}function im(e,t){return(n,r)=>()=>{if(!r||t===0&&!r.user||t===2&&!r.guild)return n;let i=mt(e,n),s=(()=>{switch(t){case 0:return rm(r.guildId,r.user.id,t);case 1:return rm(r.guild.id,r.channel.id,t);case 2:return rm(r.guild.id);default:return null}})();s!=null&&(i?i.push(s):e==="roles"&&r.guildId&&n.splice(-1,0,o(U.MenuGroup,null,s)))}}var Zo,sm,ws=g(()=>{"use strict";a();m0();Mt();$();P();M();I();xs();w0();Ts();Zo=D({permissionsSortOrder:{description:"The sort method used for defining which role grants an user a certain permission",type:4,options:[{label:"Highest Role",value:0,default:!0},{label:"Lowest Role",value:1}]},defaultPermissionsDropdownState:{description:"Whether the permissions dropdown on user popouts should be open by default",type:3,default:!1}});sm=y({name:"PermissionsViewer",description:"View the permissions a user or channel has, and the roles of a server",authors:[p.Nuckyz,p.Ven],settings:Zo,patches:[{find:".popularApplicationCommandIds,",replacement:{match:/showBorder:.{0,60}}\),(?<=guild:(\i),guildMember:(\i),.+?)/,replace:(e,t,n)=>`${e}$self.UserPermissions(${t},${n}),`}}],UserPermissions:(e,t)=>!!t&&o(x0,{guild:e,guildMember:t}),userContextMenuPatch:im("roles",0),channelContextMenuPatch:im(["mute-channel","unmute-channel"],1),guildContextMenuPatch:im("privacy",2),start(){ue("user-context",this.userContextMenuPatch),ue("channel-context",this.channelContextMenuPatch),ue(["guild-context","guild-header-popout"],this.guildContextMenuPatch)},stop(){fe("user-context",this.userContextMenuPatch),fe("channel-context",this.channelContextMenuPatch),fe(["guild-context","guild-header-popout"],this.guildContextMenuPatch)}})});function P0(e){let t=e instanceof File,n=t?URL.createObjectURL(e):e;return new Promise((r,i)=>{let s=new Image;s.onload=()=>{t&&URL.revokeObjectURL(n),r(s)},s.onerror=(l,c,u,d,m)=>i(m||l),s.crossOrigin="Anonymous",s.src=n})}async function wA(e,t,n){for(let r of e)switch(r.name){case"image":let i=xA.getUploads(t.channel.id,M0)[0];if(i){if(!i.isImage)throw"Upload is not an image";return i.item.file}break;case"url":return r.value;case"user":try{return(await Et.getUser(r.value)).getAvatarURL(n?void 0:t.guild?.id,2048).replace(/\?size=\d+$/,"?size=2048")}catch(s){throw console.error(`[petpet] Failed to fetch user +`,s),"Failed to fetch user. Check the console for more info."}}return null}var pi,M0,SA,bA,fl,TA,xA,am,I0=g(()=>{"use strict";a();tn();P();Zt();M();j();I();pi=zs(Op()),M0=0,SA=20,bA=128,fl=10,TA=Ao(()=>Promise.all(Array.from({length:fl},(e,t)=>P0(`https://raw.githubusercontent.com/VenPlugs/petpet/main/frames/pet${t}.gif`)))),xA=A("getUploads");am=y({name:"petpet",description:"Adds a /petpet slash command to create headpet gifs from any image",authors:[p.Ven],dependencies:["CommandsAPI"],commands:[{inputType:0,name:"petpet",description:"Create a petpet gif. You can only specify one of the image options",options:[{name:"delay",description:"The delay between each frame. Defaults to 20.",type:4},{name:"resolution",description:"Resolution for the gif. Defaults to 120. If you enter an insane number and it freezes Discord that's your fault.",type:4},{name:"image",description:"Image attachment to use",type:11},{name:"url",description:"URL to fetch image from",type:3},{name:"user",description:"User whose avatar to use as image",type:6},{name:"no-server-pfp",description:"Use the normal avatar instead of the server specific one when using the 'user' option",type:5}],execute:async(e,t)=>{let n=await TA(),r=rt(e,"no-server-pfp",!1);try{var i=await wA(e,t,r);if(!i)throw"No Image specified!"}catch(v){pe(t.channel.id,{content:String(v)});return}let s=await P0(i),l=rt(e,"delay",SA),c=rt(e,"resolution",bA),u=(0,pi.GIFEncoder)(),d=document.createElement("canvas");d.width=d.height=c;let m=d.getContext("2d");for(let v=0;vLi.promptToUpload([h],t.channel,M0),10)}}]})});var A0=g(()=>{});var N0,lm,C0=g(()=>{"use strict";a();A0();$();le();P();M();I();N0=D({loop:{description:"Whether to make the PiP video loop or not",type:3,default:!0,restartNeeded:!1}}),lm=y({name:"PictureInPicture",description:"Adds picture in picture to videos (next to the Download button)",authors:[p.Lumap],settings:N0,patches:[{find:".nonMediaAttachment]",replacement:{match:/\.nonMediaAttachment\]:!(\i).{0,10}children:\[(\S)/,replace:"$&,$1&&$2&&$self.renderPiPButton(),"}}],renderPiPButton:_.wrap(()=>o(V,{text:"Toggle Picture in Picture"},e=>o("div",{...e,className:"vc-pip-button",role:"button",style:{cursor:"pointer",paddingTop:"4px",paddingLeft:"4px",paddingRight:"4px"},onClick:t=>{let n=t.currentTarget.parentNode.parentNode.querySelector("video"),r=document.body.appendChild(n.cloneNode(!0));r.loop=N0.store.loop,r.style.display="none",r.onleavepictureinpicture=()=>r.remove();function i(){r.currentTime=n.currentTime,r.requestPictureInPicture(),n.pause(),r.play()}r.readyState===4?i():r.onloadedmetadata=i}},o("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24"},o("path",{fill:"currentColor",d:"M21 3a1 1 0 0 1 1 1v7h-2V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h18zm0 10a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1h8zm-1 2h-6v4h6v-4z"})))),{noop:!0})})});function L0(){return lt(["plugins.PinDMs.pinnedDMs"]),gl()}function di(e){return gl().has(e)}function E0(e){let t=gl();t.delete(e)||t.add(e),R0([...t])}function um(){return gl(),Ms.store.pinOrder===0?MA.getPrivateChannelIds().filter(di):Qn}function D0(e){return um()[e]}function pm(e,t){let n=k0(),r=n.indexOf(e),i=r+t;[n[r],n[i]]=[n[i],n[r]],R0(n)}var Ms,MA,Qn,cm,k0,R0,PA,gl,dm=g(()=>{"use strict";a();$();M();j();Ms=D({pinOrder:{type:4,description:"Which order should pinned DMs be displayed in?",options:[{label:"Most recent message",value:0,default:!0},{label:"Custom (right click channels to reorder)",value:1}]}}),MA=Ie("PrivateChannelSortStore"),k0=()=>(L.plugins.PinDMs.pinnedDMs||void 0)?.split(","),R0=e=>{cm=void 0,L.plugins.PinDMs.pinnedDMs=e.join(",")},PA=()=>(Qn=k0()??[],cm=new Set(Qn)),gl=()=>cm??PA()});function O0(e){let t=di(e),n=t&&Ms.store.pinOrder===1;return o(f,null,o(U.MenuItem,{id:"pin-dm",label:t?"Unpin DM":"Pin DM",action:()=>E0(e)}),n&&Qn[0]!==e&&o(U.MenuItem,{id:"move-pin-up",label:"Move Pin Up",action:()=>pm(e,-1)}),n&&Qn[Qn.length-1]!==e&&o(U.MenuItem,{id:"move-pin-down",label:"Move Pin Down",action:()=>pm(e,1)}))}function F0(){ue("gdm-context",_0),ue("user-context",B0)}function U0(){fe("gdm-context",_0),fe("user-context",B0)}var _0,B0,$0=g(()=>{"use strict";a();Mt();I();dm();_0=(e,t)=>()=>{let n=mt("leave-channel",e);n&&n.unshift(O0(t.channel.id))},B0=(e,t)=>()=>{let n=mt("close-dm",e);if(n){let r=n.findIndex(i=>i?.props?.id==="close-dm");n.splice(r,0,O0(t.channel.id))}}});var mm,G0=g(()=>{"use strict";a();P();M();$0();dm();mm=y({name:"PinDMs",description:"Allows you to pin private channels to the top of your DM list. To pin/unpin or reorder pins, right click DMs",authors:[p.Ven,p.Strencher],settings:Ms,start:F0,stop:U0,usePinCount(e){let t=L0();return e.length?[t.size]:[]},getChannel(e,t){return e[D0(t)]},isPinned:di,getSnapshot:um,getScrollOffset(e,t,n,r,i){return di(e)?t*(Qn.indexOf(e)+r)+n:(t+n)*2+t*Qn.length+i},patches:[{find:".privateChannelsHeaderContainer,",replacement:[{match:/(?<=\i,{channels:\i,)privateChannelIds:(\i),/,replace:"privateChannelIds:$1.filter(c=>!$self.isPinned(c)),pinCount:$self.usePinCount($1),"},{match:/(?<=renderRow:this\.renderRow,)sections:\[\i,/,replace:"$&...this.props.pinCount??[],"},{match:/children:(\i\.\i\.Messages.DIRECT_MESSAGES)(?<=renderSection=(\i)=>{.+?)/,replace:"children:$2.section===1?'Pinned DMs':$1"},{match:/(?<=renderDM=\((\i),(\i)\)=>{.*?this.state,\i=\i\[\i\],\i=)((\i)\[\i\]);/,replace:"$1===1?$self.getChannel($4,$2):$3;"},{match:/===\i\.DMS&&0/,replace:"-1$&"},{match:/(?<=scrollTo\(\{to:\i\}\):\(\i\+=)(\d+)\*\(.+?(?=,)/,replace:"$self.getScrollOffset(arguments[0],$1,this.props.padding,this.state.preRenderedChildren,$&)"}]},{find:".Routes.APPLICATION_STORE&&",replacement:{match:/(?<=\i=__OVERLAY__\?\i:\[\.\.\.\i\(\),\.\.\.)\i/,replace:"$self.getSnapshot().concat($&.filter(c=>!$self.isPinned(c)))"}},{find:".getFlattenedGuildIds()],",replacement:{match:/(?<=\i===\i\.ME\?)\i\.\i\.getPrivateChannelIds\(\)/,replace:"$self.getSnapshot().concat($&.filter(c=>!$self.isPinned(c)))"}}]})});var fm,H0=g(()=>{"use strict";a();P();M();fm=y({name:"PlainFolderIcon",description:"Doesn't show the small guild icons in folders",authors:[p.botato],patches:[{find:".expandedFolderIconWrapper",replacement:[{match:/\(\w\|\|\w\)&&(\(.{0,40}\(.{1,3}\.animated)/,replace:"$1"}]}]})});var ym={};Ue(ym,{__getDecorators:()=>IA,addDecorator:()=>gm,decorators:()=>hl,removeDecorator:()=>hm});function gm(e,t,n){hl.set(e,{decorator:t,onlyIn:n})}function hm(e){hl.delete(e)}function IA(e){let t=!!e.guildId;return Array.from(hl.values(),n=>{let{decorator:r,onlyIn:i}=n;return!i||i==="guilds"&&t||i==="dms"&&!t?r(e):null})}var hl,vm=g(()=>{"use strict";a();hl=new Map});var Tm={};Ue(Tm,{__addDecorationsToMessage:()=>AA,addDecoration:()=>Sm,decorations:()=>yl,removeDecoration:()=>bm});function Sm(e,t){yl.set(e,t)}function bm(e){yl.delete(e)}function AA(e){return[...yl.values()].map(t=>t(e))}var yl,xm=g(()=>{"use strict";a();yl=new Map});function vl(e,t){return({color:n,tooltip:r,small:i})=>o(V,{text:r},s=>o("svg",{...s,height:(t?.height??20)-(i?3:0),width:(t?.width??20)-(i?3:0),viewBox:t?.viewBox??"0 0 24 24",fill:n},o("path",{d:e})))}var NA,z0,CA,kA,RA,Mm,j0,wm,Pm,W0=g(()=>{"use strict";a();la();vm();xm();$();le();P();M();j();I();NA=Ie("SessionsStore");z0={desktop:vl("M4 2.5c-1.103 0-2 .897-2 2v11c0 1.104.897 2 2 2h7v2H7v2h10v-2h-4v-2h7c1.103 0 2-.896 2-2v-11c0-1.103-.897-2-2-2H4Zm16 2v9H4v-9h16Z"),web:vl("M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2Zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93Zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39Z"),mobile:vl("M 187 0 L 813 0 C 916.277 0 1000 83.723 1000 187 L 1000 1313 C 1000 1416.277 916.277 1500 813 1500 L 187 1500 C 83.723 1500 0 1416.277 0 1313 L 0 187 C 0 83.723 83.723 0 187 0 Z M 125 1000 L 875 1000 L 875 250 L 125 250 Z M 500 1125 C 430.964 1125 375 1180.964 375 1250 C 375 1319.036 430.964 1375 500 1375 C 569.036 1375 625 1319.036 625 1250 C 625 1180.964 569.036 1125 500 1125 Z",{viewBox:"0 0 1000 1500",height:17,width:17}),console:vl("M14.8 2.7 9 3.1V47h3.3c1.7 0 6.2.3 10 .7l6.7.6V2l-4.2.2c-2.4.1-6.9.3-10 .5zm1.8 6.4c1 1.7-1.3 3.6-2.7 2.2C12.7 10.1 13.5 8 15 8c.5 0 1.2.5 1.6 1.1zM16 33c0 6-.4 10-1 10s-1-4-1-10 .4-10 1-10 1 4 1 10zm15-8v23.3l3.8-.7c2-.3 4.7-.6 6-.6H43V3h-2.2c-1.3 0-4-.3-6-.6L31 1.7V25z",{viewBox:"0 0 50 50"})},CA=A("getStatusColor","StatusTypes"),kA=({platform:e,status:t,small:n})=>{let r=e[0].toUpperCase()+e.slice(1),i=z0[e]??z0.desktop;return o(i,{color:`var(--${CA.getStatusColor(t)}`,tooltip:r,small:n})},RA=e=>zn.getState()?.clientStatuses?.[e],Mm=({user:e,wantMargin:t=!0,wantTopMargin:n=!1,small:r=!1})=>{if(!e||e.bot)return null;if(e.id===W.getCurrentUser().id){let l=NA.getSessions();if(typeof l!="object")return null;let c=Object.values(l).sort(({status:m},{status:h})=>m===h?0:m==="online"?1:h==="online"?-1:m==="idle"?1:h==="idle"?-1:0),u=Object.values(c).reduce((m,h)=>(h.clientInfo.client!=="unknown"&&(m[h.clientInfo.client]=h.status),m),{}),{clientStatuses:d}=zn.getState();d[W.getCurrentUser().id]=u}let i=zn.getState()?.clientStatuses?.[e.id];if(!i)return null;let s=Object.entries(i).map(([l,c])=>o(kA,{key:l,platform:l,status:c,small:r}));return s.length?o("span",{className:"vc-platform-indicator",style:{display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:t?4:0,verticalAlign:"top",position:"relative",top:n?2:0,padding:t?0:1,gap:2}},s):null},j0={component:e=>o(Mm,{...e,wantMargin:!1}),position:0,shouldShow:e=>!!Object.keys(RA(e.user.id)??{}).length,key:"indicator"},wm={list:{description:"In the member list",onEnable:()=>gm("platform-indicator",e=>o(_,{noop:!0},o(Mm,{user:e.user,small:!0}))),onDisable:()=>hm("platform-indicator")},badges:{description:"In user profiles, as badges",onEnable:()=>Im(j0),onDisable:()=>Am(j0)},messages:{description:"Inside messages",onEnable:()=>Sm("platform-indicator",e=>o(_,{noop:!0},o(Mm,{user:e.message?.author,wantTopMargin:!0}))),onDisable:()=>bm("platform-indicator")}},Pm=y({name:"PlatformIndicators",description:"Adds platform indicators (Desktop, Mobile, Web...) to users",authors:[p.kemo,p.TheSun,p.Nuckyz,p.Ven],dependencies:["MessageDecorationsAPI","MemberListDecoratorsAPI"],start(){let e=L.plugins.PlatformIndicators,{displayMode:t}=e;t&&(t!=="both"?e[t]=!0:(e.list=!0,e.badges=!0),e.messages=!0,delete e.displayMode),Object.entries(wm).forEach(([n,r])=>{e[n]&&r.onEnable()})},stop(){Object.entries(wm).forEach(([e,t])=>{t.onDisable()})},patches:[{find:".Masks.STATUS_ONLINE_MOBILE",predicate:()=>L.plugins.PlatformIndicators.colorMobileIndicator,replacement:[{match:/\.STATUS_TYPING;switch(?=.+?(if\(\i\)return \i\.\i\.Masks\.STATUS_ONLINE_MOBILE))/,replace:".STATUS_TYPING;$1;switch"},{match:/switch\(\i\)\{case \i\.\i\.ONLINE:(if\(\i\)return\{[^}]+\})/,replace:"$1;$&"}]},{find:".AVATAR_STATUS_MOBILE_16;",predicate:()=>L.plugins.PlatformIndicators.colorMobileIndicator,replacement:[{match:/\i===\i\.\i\.ONLINE&&(?=.{0,70}\.AVATAR_STATUS_MOBILE_16;)/,replace:""},{match:/(?<=\(\i\.status,)(\i)(?=,(\i),\i\))/,replace:(e,t,n)=>`${n}?"online":${t}`},{match:/(?<=\i&&!\i)&&\i===\i\.\i\.ONLINE/,replace:""}]},{find:"}isMobileOnline(",predicate:()=>L.plugins.PlatformIndicators.colorMobileIndicator,replacement:{match:/(?<=\i\[\i\.\i\.MOBILE\])===\i\.\i\.ONLINE/,replace:"!= null"}}],options:{...Object.fromEntries(Object.entries(wm).map(([e,t])=>[e,{type:3,description:`Show indicators ${t.description.toLowerCase()}`,restartNeeded:!0,default:!0}])),colorMobileIndicator:{type:3,description:"Whether to make the mobile indicator match the color of the user status.",default:!0,restartNeeded:!0}}})});function DA(e){let{isEmpty:t,attachments:n}=e.type,r=Ae.getChannelId(),i=We([Ri],()=>q0(r));if(e.type.analyticsName!=="normal")return null;let s=n&&K0.getUploads(r,0).length>0;return!(!t&&i?.length>0)&&!s?null:o(V,{text:"Preview Message"},c=>o(E,{...c,onClick:async()=>pe(r,{content:q0(r),author:W.getCurrentUser(),attachments:s?await EA(r):void 0}),size:"",look:Xt.BLANK,innerClassName:vt.button,style:{padding:"0 2px",height:"100%"}},o("div",{className:vt.buttonWrapper},o("img",{width:24,height:24,src:"https://discord.com/assets/4c5a77a89716352686f590a6f014770c.svg"}))))}var K0,q0,LA,EA,Nm,Y0=g(()=>{"use strict";a();tn();le();P();M();j();I();K0=A("getUploads"),q0=e=>Ri.getDraft(e,0),LA=e=>new Promise(t=>{let n=new Image;n.onload=()=>t({width:n.width,height:n.height}),n.onerror=()=>t(null),n.src=e}),EA=async e=>await Promise.all(K0.getUploads(e,0).map(async t=>{let{isImage:n,filename:r,spoiler:i,item:{file:s}}=t,l=URL.createObjectURL(s),c={id:es(),filename:i?"SPOILER_"+r:r,content_type:void 0,size:await t.getSize(),spoiler:i,url:l+"#",proxy_url:l+"#"};if(n){let u=await LA(l);if(!u)return c;c.width=u.width,c.height=u.height}return c}));Nm=y({name:"PreviewMessage",description:"Lets you preview your message before sending it.",authors:[p.Aria],patches:[{find:"ChannelTextAreaButtons",replacement:{match:/(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/,replace:"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()"}}],chatBarIcon:_.wrap(DA,{noop:!0})})});var Z0=g(()=>{});function Cm(){return o(O.Fragment,null,o(S.FormTitle,{tag:"h3"},"More Information"),o(S.FormText,null,"To add your own pronouns, visit"," ",o(it,{href:"https://pronoundb.org"},"pronoundb.org")),o(S.FormDivider,null),o(S.FormText,null,"The two pronoun formats are lowercase and capitalized. Example:",o("ul",null,o("li",null,"Lowercase: they/them"),o("li",null,"Capitalized: They/Them")),'Text like "Ask me my pronouns" or "Any pronouns" will always be capitalized. ',o("br",null),o("br",null),"You can also configure whether or not to display pronouns for the current user (since you probably already know them)"))}var X0=g(()=>{"use strict";a();mo();I()});var yo,Sl=g(()=>{"use strict";a();$();M();bl();yo=D({pronounsFormat:{type:4,description:"The format for pronouns to appear in chat",options:[{label:"Lowercase",value:"LOWERCASE",default:!0},{label:"Capitalized",value:"CAPITALIZED"}]},pronounSource:{type:4,description:"Where to source pronouns from",options:[{label:"Prefer PronounDB, fall back to Discord",value:0,default:!0},{label:"Prefer Discord, fall back to PronounDB (might lead to inconsistency between pronouns in chat and profile)",value:1}]},showSelf:{type:3,description:"Enable or disable showing pronouns for the current user",default:!0},showInMessages:{type:3,description:"Show in messages",default:!0},showInProfile:{type:3,description:"Show in profile",default:!0}})});var Tl,J0=g(()=>{"use strict";a();Tl={hh:"He/Him",hi:"He/It",hs:"He/She",ht:"He/They",ih:"It/Him",ii:"It/Its",is:"It/She",it:"It/They",shh:"She/He",sh:"She/Her",si:"She/It",st:"She/They",th:"They/He",ti:"They/It",ts:"They/She",tt:"They/Them",any:"Any pronouns",other:"Other pronouns",ask:"Ask me my pronouns",avoid:"Avoid pronouns, use my name",unspecified:"Unspecified"}});function _A(e,t=!1){let n=rn.getUserProfile(e)?.pronouns;return t?n:rn.getGuildMemberProfile(e,ti()?.guild_id)?.pronouns||n}function xl(e,t=!1){let n=_A(e,t)?.trim().replace(BA," "),[r]=ot(()=>FA(e),{fallbackValue:eb(e),onError:i=>console.error("Fetching pronouns failed: ",i)});return yo.store.pronounSource===1&&n?[n,"Discord"]:r&&r!=="unspecified"?[$A(r),"PronounDB"]:[n,"Discord"]}function V0(e,t=!1){let n=xl(e,t);return!yo.store.showInProfile||!yo.store.showSelf&&e===W.getCurrentUser().id?Q0:n}function eb(e){let t=km[e];return t&&t!=="unspecified"?t:t||null}function FA(e){return new Promise(t=>{let n=eb(e);if(n)return t(n);if(e in mi)return mi[e].push(t);mi[e]=[t],OA()})}async function UA(e){let t=new URLSearchParams;t.append("platform","discord"),t.append("ids",e.join(","));try{return await(await fetch("https://pronoundb.org/api/v1/lookup-bulk?"+t.toString(),{method:"GET",headers:{Accept:"application/json","X-PronounDB-Source":mc}})).json().then(r=>(Object.assign(km,r),r))}catch(n){console.error("PronounDB fetching failed: ",n);let r=Object.fromEntries(e.map(i=>[i,"unspecified"]));return Object.assign(km,r),r}}function $A(e){let{pronounsFormat:t}=L.plugins.PronounDB;return t==="CAPITALIZED"?Tl[e]:t==="LOWERCASE"&&["any","ask","avoid","other"].includes(e)?Tl[e]:Tl[e].toLowerCase()}var Q0,km,mi,OA,BA,bl=g(()=>{"use strict";a();$();P();Wr();It();Oe();I();Sl();J0();Q0=[null,""],km={},mi={},OA=bn(async()=>{let e=Object.keys(mi),t=await UA(e);for(let n of e)mi[n]?.forEach(r=>r(t[n])),delete mi[n]});BA=/\n+/g});function tb(e){return!(!yo.store.showInMessages||e.author.bot||e.author.system||e.type===GA||!yo.store.showSelf&&e.author.id===W.getCurrentUser().id)}function HA({message:e}){let[t]=xl(e.author.id);return t?o("span",{className:re(wl.timestampInline,wl.timestamp)},"\u2022 ",t):null}var wl,GA,nb,ob,zA,rb=g(()=>{"use strict";a();le();Be();j();I();bl();Sl();wl=A("timestampInline"),GA=24;nb=_.wrap(({message:e})=>tb(e)?o(HA,{message:e}):null,{noop:!0}),ob=_.wrap(({message:e})=>tb(e)?o(zA,{message:e}):null,{noop:!0});zA=_.wrap(({message:e})=>{let[t]=xl(e.author.id);return t?o("span",{className:re(wl.timestampInline,wl.timestamp,"vc-pronoundb-compact")},"\u2022 ",t):null},{noop:!0})});var ib,Rm,sb=g(()=>{"use strict";a();Z0();P();M();X0();rb();bl();Sl();ib={match:/text:(.{0,10}.Messages\.USER_PROFILE_PRONOUNS)(?=,)/,replace:'$& + (typeof vcPronounSource !== "undefined" ? ` (${vcPronounSource})` : "")'},Rm=y({name:"PronounDB",authors:[p.Tyman,p.TheKodeToad,p.Ven],description:"Adds pronouns to user messages using pronoundb",patches:[{find:"showCommunicationDisabledStyles",replacement:{match:/("span",{id:\i,className:\i,children:\i}\))/,replace:"$1, $self.CompactPronounsChatComponentWrapper(arguments[0])"}},{find:"showCommunicationDisabledStyles",replacement:{match:/(?<=return\s*\(0,\i\.jsxs?\)\(.+!\i&&)(\(0,\i.jsxs?\)\(.+?\{.+?\}\))/,replace:"[$1, $self.PronounsChatComponentWrapper(arguments[0])]"}},{find:".userTagNoNickname",replacement:[{match:/{user:(\i),[^}]*,pronouns:(\i),[^}]*}=\i;/,replace:"$&let vcPronounSource;[$2,vcPronounSource]=$self.useProfilePronouns($1.id);"},ib]},{find:".nameTagSmall)",replacement:[{match:/\.getName\(\i\);(?<=displayProfile.{0,200})/,replace:"$&const [vcPronounce,vcPronounSource]=$self.useProfilePronouns(arguments[0].user.id,true);if(arguments[0].displayProfile&&vcPronounce)arguments[0].displayProfile.pronouns=vcPronounce;"},ib]}],settings:yo,settingsAboutComponent:Cm,PronounsChatComponentWrapper:nb,CompactPronounsChatComponentWrapper:ob,useProfilePronouns:V0})});var Lm,ab=g(()=>{"use strict";a();Ir();P();It();M();I();Lm=y({name:"QuickMention",authors:[p.kemo],description:"Adds a quick mention button to the message actions bar",dependencies:["MessagePopoverAPI"],start(){Un("QuickMention",e=>{let t=Q.getChannel(e.channel_id);return Re.can(Te.SEND_MESSAGES,t)?{label:"Quick Mention",icon:this.Icon,message:e,channel:t,onClick:()=>uo(`<@${e.author.id}> `)}:null})},stop(){$n("QuickMention")},Icon:()=>o("svg",{className:"icon",height:"24",width:"24",viewBox:"0 0 24 24",fill:"currentColor"},o("path",{d:"M12 2C6.486 2 2 6.486 2 12C2 17.515 6.486 22 12 22C14.039 22 15.993 21.398 17.652 20.259L16.521 18.611C15.195 19.519 13.633 20 12 20C7.589 20 4 16.411 4 12C4 7.589 7.589 4 12 4C16.411 4 20 7.589 20 12V12.782C20 14.17 19.402 15 18.4 15L18.398 15.018C18.338 15.005 18.273 15 18.209 15H18C17.437 15 16.6 14.182 16.6 13.631V12C16.6 9.464 14.537 7.4 12 7.4C9.463 7.4 7.4 9.463 7.4 12C7.4 14.537 9.463 16.6 12 16.6C13.234 16.6 14.35 16.106 15.177 15.313C15.826 16.269 16.93 17 18 17L18.002 16.981C18.064 16.994 18.129 17 18.195 17H18.4C20.552 17 22 15.306 22 12.782V12C22 6.486 17.514 2 12 2ZM12 14.599C10.566 14.599 9.4 13.433 9.4 11.999C9.4 10.565 10.566 9.399 12 9.399C13.434 9.399 14.6 10.565 14.6 11.999C14.6 13.433 13.434 14.599 12 14.599Z"}))})});function gb(e,t){let n=e.findIndex(r=>r.id===t);return n===-1?n:e.length-n-1}function ub({channelId:e,messageId:t,_isQuickEdit:n}){if(n)return;let r=W.getCurrentUser().id,i=Cn.getMessages(e)._array.filter(s=>s.author.id===r);Pl=gb(i,t)}function pb({message:e,_isQuickReply:t}){t||(Ml=gb(Cn.getMessages(e.channel_id)._array,e.id))}function db(e){let t=e.key==="ArrowUp";!t&&e.key!=="ArrowDown"||!WA(e)||qA(e)||(e.shiftKey?ZA(t):YA(t))}function hb(e,t){let n=document.getElementById("message-content-"+t);if(!n)return;let r=Math.max(document.documentElement.clientHeight,window.innerHeight),i=n.getBoundingClientRect();(i.bottom<200||i.top-r>=-200)&&jA.jumpToMessage({channelId:e,messageId:t,flash:!1,jumpType:"INSTANT"})}function yb(e,t){let n=Cn.getMessages(Ae.getChannelId())._array;if(!t){let l=W.getCurrentUser().id;n=n.filter(c=>c.author.id===l)}let r=l=>e?Math.min(n.length-1,l+1):Math.max(-1,l-1),i=l=>{do l=r(l);while(l!==-1&&n[n.length-l-1]?.deleted===!0);return l},s;return t?Ml=s=i(Ml):Pl=s=i(Pl),s===-1?void 0:n[n.length-s-1]}function KA(e){let{enabled:t,userList:n,shouldPingListed:r}=L.plugins.NoReplyMention,i=!t||r===n.includes(e.author.id);switch(fb.store.shouldMention){case 2:return i;case 0:return!1;default:return!0}}function YA(e){let t=Q.getChannel(Ae.getChannelId());if(t.guild_id&&!Re.can(Te.SEND_MESSAGES,t))return;let n=yb(e,!0);if(!n)return void B.dispatch({type:"DELETE_PENDING_REPLY",channelId:Ae.getChannelId()});let r=Q.getChannel(n.channel_id),i=W.getCurrentUser().id;B.dispatch({type:"CREATE_PENDING_REPLY",channel:r,message:n,shouldMention:KA(n),showMentionToggle:r.guild_id!==null&&n.author.id!==i,_isQuickReply:!0}),hb(r.id,n.id)}function ZA(e){let t=Q.getChannel(Ae.getChannelId());if(t.guild_id&&!Re.can(Te.SEND_MESSAGES,t))return;let n=yb(e,!1);if(!n)return B.dispatch({type:"MESSAGE_END_EDIT",channelId:Ae.getChannelId()});B.dispatch({type:"MESSAGE_START_EDIT",channelId:n.channel_id,messageId:n.id,content:n.content,_isQuickEdit:!0}),hb(n.channel_id,n.id)}var jA,mb,Ml,Pl,fb,Em,lb,cb,WA,qA,vb=g(()=>{"use strict";a();$();P();M();j();I();jA=A("jumpToMessage"),mb=navigator.platform.includes("Mac"),Ml=-1,Pl=-1,fb=D({shouldMention:{type:4,description:"Ping reply by default",options:[{label:"Follow NoReplyMention",value:2,default:!0},{label:"Enabled",value:1},{label:"Disabled",value:0}]}}),Em=y({name:"QuickReply",authors:[p.obscurity,p.Ven,p.pylix],description:"Reply to (ctrl + up/down) and edit (ctrl + shift + up/down) messages via keybinds",settings:fb,start(){B.subscribe("DELETE_PENDING_REPLY",lb),B.subscribe("MESSAGE_END_EDIT",cb),B.subscribe("MESSAGE_START_EDIT",ub),B.subscribe("CREATE_PENDING_REPLY",pb),document.addEventListener("keydown",db)},stop(){B.unsubscribe("DELETE_PENDING_REPLY",lb),B.unsubscribe("MESSAGE_END_EDIT",cb),B.unsubscribe("MESSAGE_START_EDIT",ub),B.unsubscribe("CREATE_PENDING_REPLY",pb),document.removeEventListener("keydown",db)}}),lb=()=>Ml=-1,cb=()=>Pl=-1;WA=e=>mb?e.metaKey:e.ctrlKey,qA=e=>e.altKey||!mb&&e.metaKey});var Dm,XA,Om,Sb=g(()=>{"use strict";a();P();M();XA="https://raw.githubusercontent.com/facebook/react/17.0.2/scripts/error-codes/codes.json",Om=y({name:"ReactErrorDecoder",description:'Replaces "Minifed React Error" with the actual error.',authors:[p.Cyn],patches:[{find:'"https://reactjs.org/docs/error-decoder.html?invariant="',replacement:{match:/(function .\(.\)){(for\(var .="https:\/\/reactjs\.org\/docs\/error-decoder\.html\?invariant="\+.,.=1;.`${t}{var decoded=Vencord.Plugins.plugins.ReactErrorDecoder.decodeError.apply(null, arguments);if(decoded)return decoded;${n}}`}}],async start(){Dm=await fetch(XA).then(e=>e.json()).catch(e=>console.error(`[ReactErrorDecoder] Failed to fetch React error codes +`,e))},stop(){Dm=void 0},decodeError(e,...t){let n=0;return Dm?.[e]?.replace(/%s/g,()=>{let r=t[n];return n++,r})}})});var Bm={};Ue(Bm,{ServerListRenderPosition:()=>Il,addServerListElement:()=>Ps,removeServerListElement:()=>Is,renderAll:()=>eN});function _m(e){return e===0?QA:VA}function Ps(e,t){_m(e).add(t)}function Is(e,t){_m(e).delete(t)}var JA,Il,QA,VA,eN,Al=g(()=>{"use strict";a();Je();JA=new ie("ServerListAPI"),Il=(n=>(n[n.Above=0]="Above",n[n.In=1]="In",n))(Il||{}),QA=new Set,VA=new Set;eN=e=>{let t=[];for(let n of _m(e))try{t.unshift(n())}catch(r){JA.error("Failed to render server list element:",r)}return t}});function tN(){let e=[];Object.values(we.getGuilds()).forEach(t=>{$r.getChannels(t.id).SELECTABLE.forEach(n=>{!ar.hasUnread(n.channel.id)||e.push({channelId:n.channel.id,messageId:ar.lastMessageId(n.channel.id),readStateType:0})})}),B.dispatch({type:"BULK_ACK",context:"APP",channels:e})}var nN,Fm,bb=g(()=>{"use strict";a();Al();P();M();I();nN=()=>o(E,{onClick:tN,size:E.Sizes.MIN,color:E.Colors.BRAND,style:{marginTop:"2px",marginBottom:"8px",marginLeft:"9px"}},"Read all"),Fm=y({name:"ReadAllNotificationsButton",description:"Read all server notifications with a single button click!",authors:[p.kemo],dependencies:["ServerListAPI"],renderReadAllButton:()=>o(nN,null),start(){Ps(0,this.renderReadAllButton)},stop(){Is(0,this.renderReadAllButton)}})});var nn,Nl=g(()=>{"use strict";a();$();M();nn=D({notices:{type:3,description:"Also show a notice at the top of your screen when removed (use this if you don't want to miss any notifications).",default:!1},offlineRemovals:{type:3,description:"Notify you when starting discord if you were removed while offline.",default:!0},friends:{type:3,description:"Notify when a friend removes you",default:!0},friendRequestCancels:{type:3,description:"Notify when a friend request is cancelled",default:!0},servers:{type:3,description:"Notify when removed from a server",default:!0},groups:{type:3,description:"Notify when removed from a group chat",default:!0}})});var Um=g(()=>{"use strict";a()});async function iN(){zt.delMany(["relationship-notifier-guilds","relationship-notifier-groups","relationship-notifier-friends"])}async function $m(){await iN();let[e,t,n]=await zt.getMany([Tb(),xb(),wb()]);if(await Promise.all([kl(),Rl(),As()]),nn.store.offlineRemovals){if(nn.store.groups&&t?.size)for(let[r,i]of t)gi.has(r)||vo(`You are no longer in the group ${i.name}.`,i.iconURL);if(nn.store.servers&&e?.size)for(let[r,i]of e)fi.has(r)||vo(`You are no longer in the server ${i.name}.`,i.iconURL);if(nn.store.friends&&n?.friends.length)for(let r of n.friends){if(Nr.friends.includes(r))continue;let i=await Et.getUser(r).catch(()=>{});i&&vo(`You are no longer friends with ${po(i)}.`,i.getAvatarURL(void 0,void 0,!1),()=>Fn(i.id))}if(nn.store.friendRequestCancels&&n?.requests?.length)for(let r of n.requests){if(Nr.requests.includes(r)||[1,2,4].includes(nt.getRelationshipType(r)))continue;let i=await Et.getUser(r).catch(()=>{});i&&vo(`Friend request from ${po(i)} has been revoked.`,i.getAvatarURL(void 0,void 0,!1),()=>Fn(i.id))}}}function vo(e,t,n){nn.store.notices&&Cl.showNotice(e,"OK",()=>Cl.popNotice()),Ne({title:"Relationship Notifier",body:e,icon:t,onClick:n})}function Mb(e){return fi.get(e)}function Gm(e){fi.delete(e),kl()}async function kl(){fi.clear();let e=W.getCurrentUser().id;for(let[t,{name:n,icon:r}]of Object.entries(we.getGuilds()))Le.isMember(t,e)&&fi.set(t,{id:t,name:n,iconURL:r&&`https://cdn.discordapp.com/icons/${t}/${r}.png`});await zt.set(Tb(),fi)}function Pb(e){return gi.get(e)}function Hm(e){gi.delete(e),Rl()}async function Rl(){gi.clear();for(let{type:e,id:t,name:n,rawRecipients:r,icon:i}of Q.getSortedPrivateChannels())e===3&&gi.set(t,{id:t,name:n||r.map(s=>s.username).join(", "),iconURL:i&&`https://cdn.discordapp.com/channel-icons/${t}/${i}.png`});await zt.set(xb(),gi)}async function As(){Nr.friends=[],Nr.requests=[];let e=nt.getRelationships();for(let t in e)switch(e[t]){case 1:Nr.friends.push(t);break;case 3:Nr.requests.push(t);break}await zt.set(wb(),Nr)}var fi,gi,Nr,Tb,xb,wb,zm=g(()=>{"use strict";a();ss();ko();It();I();Nl();Um();fi=new Map,gi=new Map,Nr={friends:[],requests:[]},Tb=()=>`relationship-notifier-guilds-${W.getCurrentUser().id}`,xb=()=>`relationship-notifier-groups-${W.getCurrentUser().id}`,wb=()=>`relationship-notifier-friends-${W.getCurrentUser().id}`});async function Cb({relationship:{type:e,id:t}}){if(jm===t){jm=void 0;return}let n=await Et.getUser(t).catch(()=>null);if(!!n)switch(e){case 1:nn.store.friends&&vo(`${po(n)} removed you as a friend.`,n.getAvatarURL(void 0,void 0,!1),()=>Fn(n.id));break;case 3:nn.store.friendRequestCancels&&vo(`A friend request from ${po(n)} has been removed.`,n.getAvatarURL(void 0,void 0,!1),()=>Fn(n.id));break}}function kb({guild:{id:e,unavailable:t}}){if(!nn.store.servers||t)return;if(Wm===e){Gm(e),Wm=void 0;return}let n=Mb(e);n&&(Gm(e),vo(`You were removed from the server ${n.name}.`,n.iconURL))}function Rb({channel:{id:e,type:t}}){if(!nn.store.groups||t!==3)return;if(qm===e){Hm(e),qm=void 0;return}let n=Pb(e);n&&(Hm(e),vo(`You were removed from the group ${n.name}.`,n.iconURL))}var jm,Wm,qm,Ib,Ab,Nb,Lb=g(()=>{"use strict";a();It();I();Nl();Um();zm();Ib=e=>jm=e,Ab=e=>Wm=e,Nb=e=>qm=e});var Km,Eb=g(()=>{"use strict";a();P();M();Lb();Nl();zm();Km=y({name:"RelationshipNotifier",description:"Notifies you when a friend, group chat, or server removes you.",authors:[p.nick],settings:nn,patches:[{find:"removeRelationship:(",replacement:{match:/(removeRelationship:\((\i),\i,\i\)=>)/,replace:"$1($self.removeFriend($2),0)||"}},{find:"async leaveGuild(",replacement:{match:/(leaveGuild\((\i)\){)/,replace:"$1$self.removeGuild($2);"}},{find:"},closePrivateChannel(",replacement:{match:/(closePrivateChannel\((\i)\){)/,replace:"$1$self.removeGroup($2);"}}],flux:{GUILD_CREATE:kl,GUILD_DELETE:kb,CHANNEL_CREATE:Rl,CHANNEL_DELETE:Rb,RELATIONSHIP_ADD:As,RELATIONSHIP_UPDATE:As,RELATIONSHIP_REMOVE(e){Cb(e),As()},CONNECTION_OPEN:$m},async start(){setTimeout(()=>{$m()},5e3)},removeFriend:Ib,removeGroup:Nb,removeGuild:Ab})});var sN,aN,Ym,Db=g(()=>{"use strict";a();P();M();j();sN=A("spoilerContent"),aN=A("messagesWrapper","messages"),Ym=y({name:"RevealAllSpoilers",description:"Reveal all spoilers in a message by Ctrl-clicking a spoiler, or in the chat with Ctrl+Shift-click",authors:[p.whqwert],patches:[{find:".removeObscurity=",replacement:{match:/(?<=\.removeObscurity=(\i)=>{)/,replace:(e,t)=>`$self.reveal(${t});`}}],reveal(e){let{ctrlKey:t,shiftKey:n,target:r}=e;if(!t)return;let{spoilerContent:i,hidden:s}=sN,{messagesWrapper:l}=aN,c=n?document.querySelector(`div.${l}`):r.parentElement;for(let u of c.querySelectorAll(`span.${i}.${s}`))u.click()}})});function Ob(e,t){open(t+encodeURIComponent(e),"_blank")}var Ll,_b,Zm,Bb=g(()=>{"use strict";a();Mt();Dt();Ht();P();M();I();Ll={Google:"https://lens.google.com/uploadbyurl?url=",Yandex:"https://yandex.com/images/search?rpt=imageview&url=",SauceNAO:"https://saucenao.com/search.php?url=",IQDB:"https://iqdb.org/?url=",TinEye:"https://www.tineye.com/search?url=",ImgOps:"https://imgops.com/start?url="};_b=(e,t)=>()=>{if(!t)return;let{reverseImageSearchType:n,itemHref:r,itemSrc:i}=t;if(!n||n!=="img")return;let s=r??i,l=mt("copy-link",e);l&&l.push(o(U.MenuItem,{label:"Search Image",key:"search-image",id:"search-image"},Object.keys(Ll).map((c,u)=>{let d="search-image-"+c;return o(U.MenuItem,{key:d,id:d,label:o(ye,{style:{alignItems:"center",gap:"0.5em"}},o("img",{style:{borderRadius:u>=3?"50%":void 0},"aria-hidden":"true",height:16,width:16,src:new URL("/favicon.ico",Ll[c]).toString().replace("lens.","")}),c),action:()=>Ob(s,Ll[c])})}),o(U.MenuItem,{key:"search-image-all",id:"search-image-all",label:o(ye,{style:{alignItems:"center",gap:"0.5em"}},o(Ji,{height:16,width:16}),"All"),action:()=>Object.values(Ll).forEach(c=>Ob(s,c))})))},Zm=y({name:"ReverseImageSearch",description:"Adds ImageSearch to image context menus",authors:[p.Ven,p.Nuckyz],tags:["ImageUtilities"],patches:[{find:".Messages.MESSAGE_ACTIONS_MENU_LABEL",replacement:{match:/favoriteableType:\i,(?<=(\i)\.getAttribute\("data-type"\).+?)/,replace:(e,t)=>`${e}reverseImageSearchType:${t}.getAttribute("data-role"),`}}],start(){ue("message",_b)},stop(){fe("message",_b)}})});var Ns,Xm,Fb=g(()=>{"use strict";a();$();P();M();I();Ns=D({chatMentions:{type:3,default:!0,description:"Show role colors in chat mentions (including in the message box)",restartNeeded:!0},memberList:{type:3,default:!0,description:"Show role colors in member list role headers",restartNeeded:!0},voiceUsers:{type:3,default:!0,description:"Show role colors in the voice chat user list",restartNeeded:!0}}),Xm=y({name:"RoleColorEverywhere",authors:[p.KingFish,p.lewisakura,p.AutumnVN],description:"Adds the top role color anywhere possible",patches:[{find:"CLYDE_AI_MENTION_COLOR:null,",replacement:[{match:/user:(\i),channel:(\i).{0,400}?"@"\.concat\(.+?\)/,replace:"$&,color:$self.getUserColor($1?.id,{channelId:$2?.id})"}],predicate:()=>Ns.store.chatMentions},{find:".userTooltip,children",replacement:[{match:/let\{id:(\i),guildId:(\i)[^}]*\}.*?\.default,{(?=children)/,replace:"$&color:$self.getUserColor($1,{guildId:$2}),"}],predicate:()=>Ns.store.chatMentions},{find:'tutorialId:"whos-online',replacement:[{match:/\i.roleIcon,\.\.\.\i/,replace:"$&,color:$self.roleGroupColor(arguments[0])"},{match:/null,\i," — ",\i\]/,replace:"null,$self.roleGroupColor(arguments[0])]"}],predicate:()=>Ns.store.memberList},{find:"renderPrioritySpeaker",replacement:[{match:/renderName\(\).{0,100}speaking:.{50,100}jsx.{5,10}{/,replace:"$&...$self.getVoiceProps(this.props),"}],predicate:()=>Ns.store.voiceUsers}],settings:Ns,getColor(e,{channelId:t,guildId:n}){return(n??=Q.getChannel(t)?.guild_id)?Le.getMember(n,e)?.colorString??null:null},getUserColor(e,t){let n=this.getColor(e,t);return n&&parseInt(n.slice(1),16)},roleGroupColor({id:e,count:t,title:n,guildId:r,label:i}){let l=we.getGuild(r)?.roles[e];return o("span",{style:{color:l?.colorString,fontWeight:"unset",letterSpacing:".05em"}},n??i," \u2014 ",t)},getVoiceProps({user:{id:e},guildId:t}){return{style:{color:this.getColor(e,{guildId:t})}}}})});var Ub,$b,Jm,Gb=g(()=>{"use strict";a();Mt();Ht();P();M();j();I();Ub=A("replyToMessage"),$b=(e,{message:t})=>()=>{if(Ae.getChannelId()!==t.channel_id)return;let n=Q.getChannel(t?.channel_id);if(!n||n.guild_id&&!Re.can(Te.SEND_MESSAGES,n))return;let r=mt("pin",e);if(r&&!r.some(s=>s?.props?.id==="reply")){let s=r.findIndex(l=>l?.props.id==="pin");return r.splice(s+1,0,o(U.MenuItem,{id:"reply",label:Ct.Messages.MESSAGE_ACTION_REPLY,icon:fu,action:l=>Ub.replyToMessage(n,t,l)}))}let i=mt("mark-unread",e);if(i&&!i.some(s=>s?.props?.id==="reply"))return i.unshift(o(U.MenuItem,{id:"reply",label:Ct.Messages.MESSAGE_ACTION_REPLY,icon:fu,action:s=>Ub.replyToMessage(n,t,s)}))},Jm=y({name:"SearchReply",description:"Adds a reply button to search results",authors:[p.Aria],start(){ue("message",$b)},stop(){fe("message",$b)}})});var Qm,Hb=g(()=>{"use strict";a();P();M();Qm=y({name:"SecretRingToneEnabler",description:"Always play the secret version of the discord ringtone (except during special ringtone events)",authors:[p.AndrewDLO,p.FieryFlames],patches:[{find:'call_ringing_beat"',replacement:{match:/500===\i\.random\(1,1e3\)/,replace:"true"}}]})});var zb=g(()=>{});function jb(e){let t=e.slice(1,-1).replace(/(\d)(AM|PM)$/i,"$1 $2"),n=new Date(`${new Date().toDateString()} ${t}`).getTime()/1e3;return isNaN(n)?e:(Date.now()/1e3>n&&(n+=86400),``)}function cN({rootProps:e,close:t}){let[n,r]=J(),[i,s]=J(""),l=Math.round((new Date(n).getTime()||Date.now())/1e3),c=(m,h)=>``,[u,d]=Nt(()=>{let m=c(l,i);return[m,$e.parse(m)]},[l,i]);return o(qe,{...e},o(at,{className:Cs("modal-header")},o(S.FormTitle,{tag:"h2"},"Timestamp Picker"),o(cn,{onClick:t})),o(tt,{className:Cs("modal-content")},o("input",{type:"datetime-local",value:n,onChange:m=>r(m.currentTarget.value),style:{colorScheme:ni()===2?"light":"dark"}}),o(S.FormTitle,null,"Timestamp Format"),o(An,{options:lN.map(m=>({label:m,value:m})),isSelected:m=>m===i,select:m=>s(m),serialize:m=>m,renderOptionLabel:m=>o("div",{className:Cs("format-label")},$e.parse(c(l,m.value))),renderOptionValue:()=>d}),o(S.FormTitle,{className:Y.bottom8},"Preview"),o(S.FormText,{className:Cs("preview-text")},d," (",u,")")),o(Ft,null,o(E,{onClick:()=>{uo(u+" "),t()}},"Insert")))}var lN,Cs,Vm,Wb=g(()=>{"use strict";a();zb();Xn();Ve();P();It();ct();dt();M();I();lN=["","t","T","d","D","f","F","R"],Cs=Ge("vc-st-");Vm=y({name:"SendTimestamps",description:"Send timestamps easily via chat box button & text shortcuts. Read the extended description!",authors:[p.Ven,p.Tyler],dependencies:["MessageEventsAPI"],patches:[{find:"ChannelTextAreaButtons",replacement:{match:/(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/,replace:"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()"}}],start(){this.listener=jt((e,t)=>{t.content=t.content.replace(/`\d{1,2}:\d{2} ?(?:AM|PM)?`/gi,jb)})},stop(){Wt(this.listener)},chatBarIcon(e){return e.type.analyticsName!=="normal"?null:o(V,{text:"Insert Timestamp"},({onMouseEnter:t,onMouseLeave:n})=>o("div",{style:{display:"flex"}},o(E,{"aria-haspopup":"dialog","aria-label":"Insert Timestamp",size:"",look:Xt.BLANK,onMouseEnter:t,onMouseLeave:n,innerClassName:vt.button,onClick:()=>{let r=Ke(i=>o(cN,{rootProps:i,close:()=>oo(r)}))},className:Cs("button")},o("div",{className:vt.buttonWrapper},o("svg",{"aria-hidden":"true",role:"img",width:"24",height:"24",viewBox:"0 0 24 24"},o("g",{fill:"none","fill-rule":"evenodd"},o("path",{fill:"currentColor",d:"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7v-5z"}),o("rect",{width:"24",height:"24"})))))))},settingsAboutComponent(){let e=["12:00","3:51","17:59","24:00","12:00 AM","0:13PM"].map(t=>`\`${t}\``);return o(f,null,o(S.FormText,null,"To quickly send send time only timestamps, include timestamps formatted as `HH:MM` (including the backticks!) in your message"),o(S.FormText,null,"See below for examples. If you need anything more specific, use the Date button in the chat bar!"),o(S.FormText,null,"Examples:",o("ul",null,e.map(t=>o("li",{key:t},o("code",null,t)," ","->"," ",$e.parse(jb(t)))))))}})});function uN(){return Yb=qn(),o("span",{id:"vc-friendcount",style:{display:"inline-block",width:"100%",fontSize:"12px",fontWeight:"600",color:"var(--header-secondary)",textTransform:"uppercase",textAlign:"center"}},tf," online")}function pN(){return Zb=qn(),o("span",{id:"vc-guildcount",style:{display:"inline-block",width:"100%",fontSize:"12px",fontWeight:"600",color:"var(--header-secondary)",textTransform:"uppercase",textAlign:"center"}},Kb," servers")}function qb(){tf=0;let e=nt.getRelationships();for(let t of Object.keys(e))e[t]===1&&zn.getStatus(t)!=="offline"&&(tf+=1);Yb?.()}function ef(){Kb=we.getGuildCount(),Zb?.()}var tf,Kb,Yb,Zb,nf,Xb=g(()=>{"use strict";a();Al();$();le();P();Oe();M();I();tf=0,Kb=0;nf=y({name:"ServerListIndicators",description:"Add online friend count or server count in the server list",authors:[p.dzshn],dependencies:["ServerListAPI"],options:{mode:{description:"mode",type:4,options:[{label:"Only online friend count",value:2,default:!0},{label:"Only server count",value:1},{label:"Both server and online friend counts",value:3}]}},renderIndicator:()=>{let{mode:e}=L.plugins.ServerListIndicators;return o(_,{noop:!0},o("div",{style:{marginBottom:"4px"}},!!(e&2)&&o(uN,null),!!(e&1)&&o(pN,null)))},flux:{PRESENCE_UPDATES:qb,GUILD_CREATE:ef,GUILD_DELETE:ef},start(){Ps(0,this.renderIndicator),qb(),ef()},stop(){Is(0,this.renderIndicator)}})});var Jb=g(()=>{});function eT(e){Ke(t=>o(qe,{...t,size:"medium"},o(mN,{guild:e})))}function Vb(e){return o(Hn,{timestamp:hn(e)})}function mN({guild:e}){let[t,n]=J(),[r,i]=J();_e(()=>{Dl.friends=!1,Dl.blocked=!1},[]);let[s,l]=J(0),c=e.banner&&El.getGuildBannerURL({id:e.id,banner:e.banner},!0).replace(/\?size=\d+$/,"?size=1024"),u=e.icon&&El.getGuildIconURL({id:e.id,icon:e.icon,canAnimate:!0,size:512});return o("div",{className:on("root")},c&&s===0&&o("img",{className:on("banner"),src:c,alt:"",onClick:()=>Bn(c)}),o("div",{className:on("header")},e.icon?o("img",{src:u,alt:"",onClick:()=>Bn(u)}):o("div",{"aria-hidden":!0,className:re(Qb.childWrapper,Qb.acronym)},e.acronym),o("div",{className:on("name-and-description")},o(S.FormTitle,{tag:"h5",className:on("name")},e.name),e.description&&o(S.FormText,null,e.description))),o(Nn,{type:"top",look:"brand",className:on("tab-bar"),selectedItem:s,onItemSelect:l},o(Nn.Item,{className:on("tab",{selected:s===0}),id:0},"Server Info"),o(Nn.Item,{className:on("tab",{selected:s===1}),id:1},"Friends",t!==void 0?` (${t})`:""),o(Nn.Item,{className:on("tab",{selected:s===2}),id:2},"Blocked Users",r!==void 0?` (${r})`:"")),o("div",{className:on("tab-content")},s===0&&o(gN,{guild:e}),s===1&&o(hN,{guild:e,setCount:n}),s===2&&o(yN,{guild:e,setCount:i})))}function fN(e,t){let n=Le.getMember(e,t.id)?.avatar,r=n?El.getGuildMemberAvatarURLSimple({userId:t.id,avatar:n,guildId:e,canAnimate:!0},!0):El.getUserAvatarURL(t,!0);return o("div",{className:on("owner")},o("img",{src:r,alt:"",onClick:()=>Bn(r)}),$e.parse(`<@${t.id}>`))}function gN({guild:e}){let[t]=ot(()=>Et.getUser(e.ownerId),{deps:[e.ownerId],fallbackValue:null}),n={"Server Owner":t?fN(e.id,t):"Loading...","Created At":Vb(jn.extractTimestamp(e.id)),"Joined At":e.joinedAt?Vb(e.joinedAt.getTime()):"-","Vanity Link":e.vanityURLCode?o("a",null,`discord.gg/${e.vanityURLCode}`):"-","Preferred Locale":e.preferredLocale||"-","Verification Level":["None","Low","Medium","High","Highest"][e.verificationLevel]||"?","Nitro Boosts":`${e.premiumSubscriberCount??0} (Level ${e.premiumTier??0})`,Channels:$r.getChannels(e.id)?.count-1||"?",Roles:Object.keys(e.roles).length-1};return o("div",{className:on("info")},Object.entries(n).map(([r,i])=>o("div",{className:on("server-info-pair"),key:r},o(S.FormTitle,{tag:"h5"},r),typeof i=="string"?o("span",null,i):i)))}function hN({guild:e,setCount:t}){return tT("friends",e,nt.getFriendIDs(),t)}function yN({guild:e,setCount:t}){let n=Object.keys(nt.getRelationships()).filter(r=>nt.isBlocked(r));return tT("blocked",e,n,t)}function tT(e,t,n,r){let i=[],s=[];for(let l of n)Le.isMember(t.id,l)?s.push(l):i.push(l);return We([Le],()=>Le.getMemberIds(t.id),null,(l,c)=>l.length===c.length),_e(()=>{!Dl[e]&&i.length&&(Dl[e]=!0,B.dispatch({type:"GUILD_MEMBERS_REQUEST",guildIds:[t.id],userIds:i}))},[]),_e(()=>r(s.length),[s.length]),o(Dr,{fade:!0,className:on("scroller")},s.map(l=>o(dN,{user:W.getUser(l),status:zn.getStatus(l)||"offline",onSelect:()=>Fn(l),onContextMenu:()=>{}})))}var El,Qb,dN,on,Dl,nT=g(()=>{"use strict";a();Jb();Ve();It();Be();dt();Oe();j();I();El=A("getGuildBannerURL"),Qb=A("icon","acronym","childWrapper"),dN=me(()=>yt("FriendRow").FriendRow),on=Ge("vc-gp-");Dl={friends:!1,blocked:!1}});var oT,of,rT=g(()=>{"use strict";a();Mt();P();M();I();nT();oT=(e,{guild:t})=>()=>{mt("privacy",e)?.push(o(U.MenuItem,{id:"vc-server-profile",label:"Server Info",action:()=>eT(t)}))},of=y({name:"ServerProfile",description:"Allows you to view info about a server by right clicking it in the server list",authors:[p.Ven,p.Nuckyz],tags:["guild","info"],start(){ue(["guild-context","guild-header-popout"],oT)},stop(){fe(["guild-context","guild-header-popout"],oT)}})});var iT=g(()=>{});var sT,aT=g(()=>{a();sT=`/* eslint-disable simple-header/header */ import React from "react"; const handleClick = async () => @@ -152,14 +145,14 @@ export const Example: React.FC<{

{\`Shigg\${real ? \`ies\${shigged === 0x1B ? "t" : ""}\` : "y"}\`}

; -`});var yT=or((nZ,sf)=>{"use strict";a();var EN=Object.prototype.hasOwnProperty,Wt="~";function Rs(){}Object.create&&(Rs.prototype=Object.create(null),new Rs().__proto__||(Wt=!1));function DN(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function hT(e,t,n,r,i){if(typeof n!="function")throw new TypeError("The listener must be a function");var s=new DN(n,r||e,i),l=Wt?Wt+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function El(e,t){--e._eventsCount===0?e._events=new Rs:delete e._events[t]}function Et(){this._events=new Rs,this._eventsCount=0}Et.prototype.eventNames=function(){var t=[],n,r;if(this._eventsCount===0)return t;for(r in n=this._events)EN.call(n,r)&&t.push(Wt?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(n)):t};Et.prototype.listeners=function(t){var n=Wt?Wt+t:t,r=this._events[n];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,l=new Array(s);i{"use strict";a();Object.defineProperty(fi,"__esModule",{value:!0});fi.Channel=fi.ChannelPort=void 0;var ON=yT(),Dl="vapIpc",af=Symbol.for("vapIpc.edgeCreate"),lf=class{_pipes=new Map;_listeners=new Map;_createListenerMap(){return new Map}_emit(t,n,...r){for(let[i,s]of this._listeners.entries()){if(i===t)continue;let l=s.get(n);l&&l(...r)}}createPipe(t){let n=this.getPipe(t);if(n)return n;let r=this._createListenerMap();this._listeners.set(t,r);let i={emit:this._emit.bind(this,t),listen:(s,l)=>void r.set(s,l)};return this._pipes.set(t,i),i}getPipe(t){return this._pipes.get(t)??null}};fi.ChannelPort=lf;var cf=class{id;_edges=new Map;_callbacks=new Map;_callers=new Map;_edgePipes=new Map;_pipes=[];_emitter=new ON.EventEmitter;_logger;_destroyed=!1;constructor(t){this.id=t}addPipe(t){t.listen(`${Dl}:handshake`,n=>{this._handleHandshake(t,n)}),t.listen(`${Dl}:message`,n=>{this._handleMessage(t,n)}),this._pipes.push(t),this._logger?.log(`Adding pipe to channel "${this.id}"`)}setLogger(t){this._logger=t}_handleHandshake(t,n){if(this.id===n.id)return;this._logger?.log(`\u{1F91D} "${n.id}" -> "${this.id}" (edges: [${n.channelIds.join(", ")}])`);let r=this._edges.get(n.id);if(r){let i=n.channelIds.filter(s=>!r?.channelIds.includes(s));if(i.includes(this.id)&&i.splice(i.indexOf(this.id),1),!i.length)return;this._edges.set(n.id,{...n,channelIds:[...r.channelIds,...i]})}else{let i=[...n.channelIds].filter(s=>s!==this.id);this._edges.set(n.id,{...n,channelIds:i}),this._edgePipes.set(n.id,t)}this._emitter.emit(af,n),this.handshakeAll()}_handleMessage(t,n){if(n.proxiedBy===this.id)return;if(n.destination!==this.id)return this._emitMessage({...n,proxiedBy:this.id});if(!n.nonce)return void this._emitter.emit(n.name,n.data);let r=this._callbacks.get(n.nonce);if(r)return void r(n.data);let i=this._callers.get(n.name);if(i){i(n.data).catch(s=>(console.error(s),new Error(s?.message??`${s}`))).then(s=>{this._emitMessage({name:n.name,source:this.id,destination:n.source,data:s,nonce:n.nonce})});return}}_emitHandshake(t){let n=this.getEdge();t.emit(`${Dl}:handshake`,n)}_emitMessage(t){let n=this.findEdgeId(t.destination);if(!n)return;this._edgePipes.get(n)?.emit(`${Dl}:message`,t)}getEdge(){let t=[...this._edges.keys(),...[...this._edges.values()].map(n=>n.channelIds).flat()].filter((n,r,i)=>i.indexOf(n)===r);return{id:this.id,channelIds:t}}findEdgeId(t){for(let n of this._edges.values())if(n.id===t||n.channelIds.includes(t))return n.id;return null}waitForEdge(t){let n=this.findEdgeId(t);return n?Promise.resolve(n):new Promise(r=>{let i=s=>{(s.id===t||s.channelIds.includes(t))&&(this._emitter.off(af,i),r(s.id))};this._emitter.on(af,i)})}createNonce(){return Math.random().toString(16).slice(2)}send(t){this._emitMessage({...t,source:this.id})}call(t,n={timeout:1e4}){let r=this.createNonce(),i=new Promise((s,l)=>{let c=setTimeout(()=>{this._callbacks.delete(r),l(new Error("Call timed out"))},n.timeout);this._callbacks.set(r,u=>{this._callbacks.delete(r),clearTimeout(c),n.signal?.aborted?n.signal.reason instanceof Error&&l(n.signal.reason):u instanceof Error?l(u):s(u)})});return this._emitMessage({...t,source:this.id,nonce:r}),i}on(t,n){return this._emitter.on(t,n),this}off(t,n){return this._emitter.off(t,n),this}once(t,n){this._emitter.once(t,n)}onCall(t,n){this._callers.set(t,async(...r)=>await n(...r))}removeCaller(){}handshakeAll(){this._pipes.forEach(t=>this._emitHandshake(t))}destroy(){this._emitter.removeAllListeners(),this._callbacks.clear(),this._callers.clear(),this._edgePipes.clear(),this._pipes=[],this._destroyed=!0}};fi.Channel=cf});var mf=or(gi=>{"use strict";a();Object.defineProperty(gi,"__esModule",{value:!0});gi.RemoteClient=gi.RemoteHost=void 0;var pf=class{channel;constructor(t,n){this.channel=t;for(let[r,i]of Object.entries(n))t.onCall(r,async s=>await i(...s));t.handshakeAll()}};gi.RemoteHost=pf;var df=class{hostName;channel;constructor(t,n){this.hostName=t,this.channel=n}async connect(){await this.channel.waitForEdge(this.hostName)}run(t,...n){return this.channel.call({name:t,destination:this.hostName,data:n})}};gi.RemoteClient=df});var bT=or(hi=>{"use strict";a();Object.defineProperty(hi,"__esModule",{value:!0});hi.WorkerClient=hi.createWorkerHost=void 0;var vT=uf(),ST=mf(),_N=(e,t)=>{let n=new vT.Channel(e);return n.addPipe({emit:(r,i)=>postMessage({event:r,data:i}),listen:(r,i)=>addEventListener("message",({data:s})=>{s.event===r&&i(s.data)})}),new ST.RemoteHost(n,t)};hi.createWorkerHost=_N;var ff=class extends ST.RemoteClient{workerOpts;worker;workerListeners=[];url;constructor(t,n,r,i={}){let s=new vT.Channel(t);if(super(n,s),this.workerOpts=i,r instanceof Blob){let l=new Blob([r],{type:"text/javascript"});this.url=URL.createObjectURL(l)}else this.url=r}async init(){let t=this.worker=new Worker(this.url,this.workerOpts);this.channel.addPipe({emit:(n,r)=>t.postMessage({event:n,data:r}),listen:(n,r)=>{let i=s=>{let{event:l,data:c}=s.data;l===n&&r(c)};this.workerListeners.push(i),t.addEventListener("message",i)}}),await this.connect()}destroy(){if(this.worker){for(let t of this.workerListeners)this.worker.removeEventListener("message",t);this.worker.terminate()}this.channel.destroy(),this.url.startsWith("blob:")&&URL.revokeObjectURL(this.url)}};hi.WorkerClient=ff});var TT=or(fo=>{"use strict";a();var BN=fo&&fo.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),gf=fo&&fo.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&BN(t,e,n)};Object.defineProperty(fo,"__esModule",{value:!0});gf(uf(),fo);gf(mf(),fo);gf(bT(),fo)});function yf(e){Ol.id!==e.id&&(Object.assign(Ol,e),hf.forEach(t=>t(e)))}var Ol,hf,xT,vf=g(()=>{"use strict";a();A();Ol={id:null,theme:null},hf=new Set,xT=()=>{let[,e]=O.useState(Ol);return O.useEffect(()=>(hf.add(e),()=>void hf.delete(e)),[]),Ol}});function Cr(e){if(Object.prototype.hasOwnProperty.call(yi,e))return yi[e];let t=Object.values(yi).find(n=>n.aliases?.includes(e));return t?(HN.set(e,t),t):null}var FN,UN,wT,$N,GN,yi,MT,PT,HN,_l=g(()=>{"use strict";a();FN="Vap0r1ze/vapcord",UN="88a7032a59cca40da170926651b08201ea3b965a",wT=`https://raw.githubusercontent.com/${FN}/${UN}/assets/shiki-codeblocks`,$N=e=>`${wT}/${e}`,GN=`${wT}/languages.json`,yi={},MT=async()=>{let e=await fetch(GN).then(n=>n.json()),t=Object.fromEntries(e.map(n=>[n.id,{...n,grammarUrl:$N(n.fileName)}]));Object.assign(yi,t)},PT=e=>e.grammar?Promise.resolve(e.grammar):fetch(e.grammarUrl).then(t=>t.json()),HN=new Map});var zN,jN,Ge,go,Sf=g(()=>{"use strict";a();zN="shikijs/shiki",jN="0b28ad8ccfbf2615f2d9d38ea8255416b8ac3043",Ge=e=>`https://raw.githubusercontent.com/${zN}/${jN}/packages/shiki/themes/${e}.json`,go={DarkPlus:Ge("dark-plus"),MaterialCandy:"https://raw.githubusercontent.com/millsp/material-candy/master/material-candy.json",DraculaSoft:Ge("dracula-soft"),Dracula:Ge("dracula"),GithubDarkDimmed:Ge("github-dark-dimmed"),GithubDark:Ge("github-dark"),GithubLight:Ge("github-light"),LightPlus:Ge("light-plus"),MaterialDarker:Ge("material-darker"),MaterialDefault:Ge("material-default"),MaterialLighter:Ge("material-lighter"),MaterialOcean:Ge("material-ocean"),MaterialPalenight:Ge("material-palenight"),MinDark:Ge("min-dark"),MinLight:Ge("min-light"),Monokai:Ge("monokai"),Nord:Ge("nord"),OneDarkPro:Ge("one-dark-pro"),Poimandres:Ge("poimandres"),RosePineDawn:Ge("rose-pine-dawn"),RosePineMoon:Ge("rose-pine-moon"),RosePine:Ge("rose-pine"),SlackDark:Ge("slack-dark"),SlackOchin:Ge("slack-ochin"),SolarizedDark:Ge("solarized-dark"),SolarizedLight:Ge("solarized-light"),VitesseDark:Ge("vitesse-dark"),VitesseLight:Ge("vitesse-light"),CssVariables:Ge("css-variables")}});var AT,bf,IT,he,Ls=g(()=>{"use strict";a();za();AT=js(TT());vf();_l();Sf();bf=Object.values(go),he={client:null,currentTheme:null,currentThemeUrl:null,timeoutMs:1e4,languages:yi,themes:go,loadedThemes:new Set,loadedLangs:new Set,clientPromise:new Promise(e=>IT=e),init:async e=>{let t=await fetch(b1).then(i=>i.blob()),n=he.client=new AT.WorkerClient("shiki-client","shiki-host",t,{name:"ShikiWorker"});await n.init();let r=e||bf[0];await MT(),await n.run("setOnigasm",{wasm:T1}),await n.run("setHighlighter",{theme:r,langs:[]}),he.loadedThemes.add(r),await he._setTheme(r),IT(n)},_setTheme:async e=>{he.currentThemeUrl=e;let{themeData:t}=await he.client.run("getTheme",{theme:e});he.currentTheme=JSON.parse(t),yf({id:e,theme:he.currentTheme})},loadTheme:async e=>{let t=await he.clientPromise;he.loadedThemes.has(e)||(await t.run("loadTheme",{theme:e}),he.loadedThemes.add(e))},setTheme:async e=>{await he.clientPromise,e||=bf[0],he.loadedThemes.has(e)||await he.loadTheme(e),await he._setTheme(e)},loadLang:async e=>{let t=await he.clientPromise,n=Cr(e);!n||he.loadedLangs.has(n.id)||(await t.run("loadLanguage",{lang:{...n,grammar:n.grammar??await PT(n)}}),he.loadedLangs.add(n.id))},tokenizeCode:async(e,t)=>{let n=await he.clientPromise,r=Cr(t);return r?(he.loadedLangs.has(r.id)||await he.loadLang(r.id),await n.run("codeToThemedTokens",{code:e,lang:t,theme:he.currentThemeUrl??bf[0]})):[]},destroy(){he.currentTheme=null,he.currentThemeUrl=null,yf({id:null,theme:null}),he.client?.destroy()}}});var Es,Tf=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/shikiCodeblocks.desktop/devicon.css",{name:"src/plugins/shikiCodeblocks.desktop/devicon.css",source:`@import url("https://cdn.jsdelivr.net/gh/devicons/devicon@v2.10.1/devicon.min.css"); -`,classNames:{},dom:null});Es="src/plugins/shikiCodeblocks.desktop/devicon.css"});var Ds=g(()=>{"use strict";a()});var qN,Zo,xf=g(()=>{"use strict";a();$();Je();Re();ro();w();Ls();Sf();Tf();Ds();qN=Object.keys(go),Zo=D({theme:{type:4,description:"Default themes",options:qN.map(e=>({label:oo(vu(e)),value:go[e],default:go[e]===go.DarkPlus})),onChange:he.setTheme},customTheme:{type:0,description:"A link to a custom vscode theme",placeholder:go.MaterialCandy,onChange:e=>{he.setTheme(e||Zo.store.theme)}},tryHljs:{type:4,description:"Use the more lightweight default Discord highlighter and theme.",options:[{label:"Never",value:"NEVER"},{label:"Prefer Shiki instead of Highlight.js",value:"SECONDARY",default:!0},{label:"Prefer Highlight.js instead of Shiki",value:"PRIMARY"},{label:"Always",value:"ALWAYS"}]},useDevIcon:{type:4,description:"How to show language icons on codeblocks",options:[{label:"Disabled",value:"DISABLED"},{label:"Colorless",value:"GREYSCALE",default:!0},{label:"Colored",value:"COLOR"}],onChange:e=>{e==="DISABLED"?Ft(Es):St(Es)}},bgOpacity:{type:5,description:"Background opacity",markers:[0,20,40,60,80,100],default:100,componentProps:{stickToMarkers:!1,onValueRender:null}}},{theme:{disabled(){return!!this.store.customTheme}},customTheme:{isValid(e){if(!e)return!0;let t=hc(e);return t?t.pathname.endsWith(".json")?!0:"Must be a json file":"Must be a valid URL"}}})});function CT(e,t){let n=Zo.use(e),[r,i]=O.useState(!1),s={...n,...t},l=s.customTheme||s.theme;if(t){let c=he.currentThemeUrl&&l&&l!==he.currentThemeUrl,u=Object.keys(t).length===0;r&&(!c||u)&&i(!1),!r&&c&&(i(!0),he.setTheme(l))}return{...s,isThemeLoading:l!==he.currentThemeUrl}}var kT=g(()=>{"use strict";a();A();Ls();xf()});function RT(e){return e=e.slice(1),e.length<6&&(e=e.split("").map(t=>t+t).join("")),e.length===6&&(e+="ff"),e.length>6&&(e=e.slice(0,6)),e.split(/(..)/).filter(Boolean).map(t=>parseInt(t,16))}var LT=g(()=>{"use strict";a()});var Un,ET,Os=g(()=>{"use strict";a();Je();A();_l();Ds();Un=Ue("shiki-"),ET=({lang:e,tryHljs:t})=>{let n=e?lr?.getLanguage?.(e):null,i=(e?Cr(e):null)?.name;switch(t){case"ALWAYS":return!0;case"PRIMARY":return!!n||e==="";case"SECONDARY":return!i&&!!n;case"NEVER":return!1;default:return!1}}});function DT(e){let[t,n]=O.useState(!1);function r(i){Zt.copy(i),n(!0),setTimeout(()=>{n(!1)},e)}return[t,r]}var OT=g(()=>{"use strict";a();A()});function _T({content:e,...t}){let[n,r]=DT(1e3);return o("button",{...t,style:{...t.style,cursor:n?"default":void 0},onClick:()=>r(e)},n?"Copied!":"Copy")}var BT=g(()=>{"use strict";a();OT()});function FT({content:e,theme:t}){let n=[];return Zt.SUPPORTS_COPY&&n.push(o(_T,{content:e,className:Un("btn"),style:{backgroundColor:t.accentBgColor,color:t.accentFgColor}})),o("div",{className:Un("btns")},n)}var UT=g(()=>{"use strict";a();A();Os();BT()});var $T,GT=g(()=>{"use strict";a();A();Os();$T=({theme:e,useHljs:t,lang:n,content:r,tokens:i})=>{let s;if(t)try{let{value:c}=lr.highlight(n,r,!0);s=c.split(` -`).map((u,p)=>o("span",{key:p,dangerouslySetInnerHTML:{__html:u}}))}catch{s=r.split(` +`});var cT=rr((CY,rf)=>{"use strict";a();var vN=Object.prototype.hasOwnProperty,Kt="~";function ks(){}Object.create&&(ks.prototype=Object.create(null),new ks().__proto__||(Kt=!1));function SN(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function lT(e,t,n,r,i){if(typeof n!="function")throw new TypeError("The listener must be a function");var s=new SN(n,r||e,i),l=Kt?Kt+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function Ol(e,t){--e._eventsCount===0?e._events=new ks:delete e._events[t]}function Ot(){this._events=new ks,this._eventsCount=0}Ot.prototype.eventNames=function(){var t=[],n,r;if(this._eventsCount===0)return t;for(r in n=this._events)vN.call(n,r)&&t.push(Kt?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(n)):t};Ot.prototype.listeners=function(t){var n=Kt?Kt+t:t,r=this._events[n];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,l=new Array(s);i{"use strict";a();Object.defineProperty(hi,"__esModule",{value:!0});hi.Channel=hi.ChannelPort=void 0;var bN=cT(),_l="vapIpc",sf=Symbol.for("vapIpc.edgeCreate"),af=class{_pipes=new Map;_listeners=new Map;_createListenerMap(){return new Map}_emit(t,n,...r){for(let[i,s]of this._listeners.entries()){if(i===t)continue;let l=s.get(n);l&&l(...r)}}createPipe(t){let n=this.getPipe(t);if(n)return n;let r=this._createListenerMap();this._listeners.set(t,r);let i={emit:this._emit.bind(this,t),listen:(s,l)=>void r.set(s,l)};return this._pipes.set(t,i),i}getPipe(t){return this._pipes.get(t)??null}};hi.ChannelPort=af;var lf=class{id;_edges=new Map;_callbacks=new Map;_callers=new Map;_edgePipes=new Map;_pipes=[];_emitter=new bN.EventEmitter;_logger;_destroyed=!1;constructor(t){this.id=t}addPipe(t){t.listen(`${_l}:handshake`,n=>{this._handleHandshake(t,n)}),t.listen(`${_l}:message`,n=>{this._handleMessage(t,n)}),this._pipes.push(t),this._logger?.log(`Adding pipe to channel "${this.id}"`)}setLogger(t){this._logger=t}_handleHandshake(t,n){if(this.id===n.id)return;this._logger?.log(`\u{1F91D} "${n.id}" -> "${this.id}" (edges: [${n.channelIds.join(", ")}])`);let r=this._edges.get(n.id);if(r){let i=n.channelIds.filter(s=>!r?.channelIds.includes(s));if(i.includes(this.id)&&i.splice(i.indexOf(this.id),1),!i.length)return;this._edges.set(n.id,{...n,channelIds:[...r.channelIds,...i]})}else{let i=[...n.channelIds].filter(s=>s!==this.id);this._edges.set(n.id,{...n,channelIds:i}),this._edgePipes.set(n.id,t)}this._emitter.emit(sf,n),this.handshakeAll()}_handleMessage(t,n){if(n.proxiedBy===this.id)return;if(n.destination!==this.id)return this._emitMessage({...n,proxiedBy:this.id});if(!n.nonce)return void this._emitter.emit(n.name,n.data);let r=this._callbacks.get(n.nonce);if(r)return void r(n.data);let i=this._callers.get(n.name);if(i){i(n.data).catch(s=>(console.error(s),new Error(s?.message??`${s}`))).then(s=>{this._emitMessage({name:n.name,source:this.id,destination:n.source,data:s,nonce:n.nonce})});return}}_emitHandshake(t){let n=this.getEdge();t.emit(`${_l}:handshake`,n)}_emitMessage(t){let n=this.findEdgeId(t.destination);if(!n)return;this._edgePipes.get(n)?.emit(`${_l}:message`,t)}getEdge(){let t=[...this._edges.keys(),...[...this._edges.values()].map(n=>n.channelIds).flat()].filter((n,r,i)=>i.indexOf(n)===r);return{id:this.id,channelIds:t}}findEdgeId(t){for(let n of this._edges.values())if(n.id===t||n.channelIds.includes(t))return n.id;return null}waitForEdge(t){let n=this.findEdgeId(t);return n?Promise.resolve(n):new Promise(r=>{let i=s=>{(s.id===t||s.channelIds.includes(t))&&(this._emitter.off(sf,i),r(s.id))};this._emitter.on(sf,i)})}createNonce(){return Math.random().toString(16).slice(2)}send(t){this._emitMessage({...t,source:this.id})}call(t,n={timeout:1e4}){let r=this.createNonce(),i=new Promise((s,l)=>{let c=setTimeout(()=>{this._callbacks.delete(r),l(new Error("Call timed out"))},n.timeout);this._callbacks.set(r,u=>{this._callbacks.delete(r),clearTimeout(c),n.signal?.aborted?n.signal.reason instanceof Error&&l(n.signal.reason):u instanceof Error?l(u):s(u)})});return this._emitMessage({...t,source:this.id,nonce:r}),i}on(t,n){return this._emitter.on(t,n),this}off(t,n){return this._emitter.off(t,n),this}once(t,n){this._emitter.once(t,n)}onCall(t,n){this._callers.set(t,async(...r)=>await n(...r))}removeCaller(){}handshakeAll(){this._pipes.forEach(t=>this._emitHandshake(t))}destroy(){this._emitter.removeAllListeners(),this._callbacks.clear(),this._callers.clear(),this._edgePipes.clear(),this._pipes=[],this._destroyed=!0}};hi.Channel=lf});var df=rr(yi=>{"use strict";a();Object.defineProperty(yi,"__esModule",{value:!0});yi.RemoteClient=yi.RemoteHost=void 0;var uf=class{channel;constructor(t,n){this.channel=t;for(let[r,i]of Object.entries(n))t.onCall(r,async s=>await i(...s));t.handshakeAll()}};yi.RemoteHost=uf;var pf=class{hostName;channel;constructor(t,n){this.hostName=t,this.channel=n}async connect(){await this.channel.waitForEdge(this.hostName)}run(t,...n){return this.channel.call({name:t,destination:this.hostName,data:n})}};yi.RemoteClient=pf});var dT=rr(vi=>{"use strict";a();Object.defineProperty(vi,"__esModule",{value:!0});vi.WorkerClient=vi.createWorkerHost=void 0;var uT=cf(),pT=df(),TN=(e,t)=>{let n=new uT.Channel(e);return n.addPipe({emit:(r,i)=>postMessage({event:r,data:i}),listen:(r,i)=>addEventListener("message",({data:s})=>{s.event===r&&i(s.data)})}),new pT.RemoteHost(n,t)};vi.createWorkerHost=TN;var mf=class extends pT.RemoteClient{workerOpts;worker;workerListeners=[];url;constructor(t,n,r,i={}){let s=new uT.Channel(t);if(super(n,s),this.workerOpts=i,r instanceof Blob){let l=new Blob([r],{type:"text/javascript"});this.url=URL.createObjectURL(l)}else this.url=r}async init(){let t=this.worker=new Worker(this.url,this.workerOpts);this.channel.addPipe({emit:(n,r)=>t.postMessage({event:n,data:r}),listen:(n,r)=>{let i=s=>{let{event:l,data:c}=s.data;l===n&&r(c)};this.workerListeners.push(i),t.addEventListener("message",i)}}),await this.connect()}destroy(){if(this.worker){for(let t of this.workerListeners)this.worker.removeEventListener("message",t);this.worker.terminate()}this.channel.destroy(),this.url.startsWith("blob:")&&URL.revokeObjectURL(this.url)}};vi.WorkerClient=mf});var mT=rr(So=>{"use strict";a();var xN=So&&So.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),ff=So&&So.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&xN(t,e,n)};Object.defineProperty(So,"__esModule",{value:!0});ff(cf(),So);ff(df(),So);ff(dT(),So)});function hf(e){Bl.id!==e.id&&(Object.assign(Bl,e),gf.forEach(t=>t(e)))}var Bl,gf,fT,yf=g(()=>{"use strict";a();I();Bl={id:null,theme:null},gf=new Set,fT=()=>{let[,e]=O.useState(Bl);return O.useEffect(()=>(gf.add(e),()=>void gf.delete(e)),[]),Bl}});function Cr(e){if(Object.prototype.hasOwnProperty.call(Si,e))return Si[e];let t=Object.values(Si).find(n=>n.aliases?.includes(e));return t?(AN.set(e,t),t):null}var wN,MN,gT,PN,IN,Si,hT,yT,AN,Fl=g(()=>{"use strict";a();wN="Vap0r1ze/vapcord",MN="88a7032a59cca40da170926651b08201ea3b965a",gT=`https://raw.githubusercontent.com/${wN}/${MN}/assets/shiki-codeblocks`,PN=e=>`${gT}/${e}`,IN=`${gT}/languages.json`,Si={},hT=async()=>{let e=await fetch(IN).then(n=>n.json()),t=Object.fromEntries(e.map(n=>[n.id,{...n,grammarUrl:PN(n.fileName)}]));Object.assign(Si,t)},yT=e=>e.grammar?Promise.resolve(e.grammar):fetch(e.grammarUrl).then(t=>t.json()),AN=new Map});var NN,CN,je,bo,vf=g(()=>{"use strict";a();NN="shikijs/shiki",CN="0b28ad8ccfbf2615f2d9d38ea8255416b8ac3043",je=e=>`https://raw.githubusercontent.com/${NN}/${CN}/packages/shiki/themes/${e}.json`,bo={DarkPlus:je("dark-plus"),MaterialCandy:"https://raw.githubusercontent.com/millsp/material-candy/master/material-candy.json",DraculaSoft:je("dracula-soft"),Dracula:je("dracula"),GithubDarkDimmed:je("github-dark-dimmed"),GithubDark:je("github-dark"),GithubLight:je("github-light"),LightPlus:je("light-plus"),MaterialDarker:je("material-darker"),MaterialDefault:je("material-default"),MaterialLighter:je("material-lighter"),MaterialOcean:je("material-ocean"),MaterialPalenight:je("material-palenight"),MinDark:je("min-dark"),MinLight:je("min-light"),Monokai:je("monokai"),Nord:je("nord"),OneDarkPro:je("one-dark-pro"),Poimandres:je("poimandres"),RosePineDawn:je("rose-pine-dawn"),RosePineMoon:je("rose-pine-moon"),RosePine:je("rose-pine"),SlackDark:je("slack-dark"),SlackOchin:je("slack-ochin"),SolarizedDark:je("solarized-dark"),SolarizedLight:je("solarized-light"),VitesseDark:je("vitesse-dark"),VitesseLight:je("vitesse-light"),CssVariables:je("css-variables")}});var ST,Sf,vT,ve,Rs=g(()=>{"use strict";a();Wa();ST=zs(mT());yf();Fl();vf();Sf=Object.values(bo),ve={client:null,currentTheme:null,currentThemeUrl:null,timeoutMs:1e4,languages:Si,themes:bo,loadedThemes:new Set,loadedLangs:new Set,clientPromise:new Promise(e=>vT=e),init:async e=>{let t=await fetch(d1).then(i=>i.blob()),n=ve.client=new ST.WorkerClient("shiki-client","shiki-host",t,{name:"ShikiWorker"});await n.init();let r=e||Sf[0];await hT(),await n.run("setOnigasm",{wasm:m1}),await n.run("setHighlighter",{theme:r,langs:[]}),ve.loadedThemes.add(r),await ve._setTheme(r),vT(n)},_setTheme:async e=>{ve.currentThemeUrl=e;let{themeData:t}=await ve.client.run("getTheme",{theme:e});ve.currentTheme=JSON.parse(t),hf({id:e,theme:ve.currentTheme})},loadTheme:async e=>{let t=await ve.clientPromise;ve.loadedThemes.has(e)||(await t.run("loadTheme",{theme:e}),ve.loadedThemes.add(e))},setTheme:async e=>{await ve.clientPromise,e||=Sf[0],ve.loadedThemes.has(e)||await ve.loadTheme(e),await ve._setTheme(e)},loadLang:async e=>{let t=await ve.clientPromise,n=Cr(e);!n||ve.loadedLangs.has(n.id)||(await t.run("loadLanguage",{lang:{...n,grammar:n.grammar??await yT(n)}}),ve.loadedLangs.add(n.id))},tokenizeCode:async(e,t)=>{let n=await ve.clientPromise,r=Cr(t);return r?(ve.loadedLangs.has(r.id)||await ve.loadLang(r.id),await n.run("codeToThemedTokens",{code:e,lang:t,theme:ve.currentThemeUrl??Sf[0]})):[]},destroy(){ve.currentTheme=null,ve.currentThemeUrl=null,hf({id:null,theme:null}),ve.client?.destroy()}}});var Ls,bf=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/shikiCodeblocks.desktop/devicon.css",{name:"src/plugins/shikiCodeblocks.desktop/devicon.css",source:`@import url("https://cdn.jsdelivr.net/gh/devicons/devicon@v2.10.1/devicon.min.css"); +`,classNames:{},dom:null});Ls="src/plugins/shikiCodeblocks.desktop/devicon.css"});var Es=g(()=>{"use strict";a()});var RN,Xo,Tf=g(()=>{"use strict";a();$();Ve();Be();lo();M();Rs();vf();bf();Es();RN=Object.keys(bo),Xo=D({theme:{type:4,description:"Default themes",options:RN.map(e=>({label:ao(hu(e)),value:bo[e],default:bo[e]===bo.DarkPlus})),onChange:ve.setTheme},customTheme:{type:0,description:"A link to a custom vscode theme",placeholder:bo.MaterialCandy,onChange:e=>{ve.setTheme(e||Xo.store.theme)}},tryHljs:{type:4,description:"Use the more lightweight default Discord highlighter and theme.",options:[{label:"Never",value:"NEVER"},{label:"Prefer Shiki instead of Highlight.js",value:"SECONDARY",default:!0},{label:"Prefer Highlight.js instead of Shiki",value:"PRIMARY"},{label:"Always",value:"ALWAYS"}]},useDevIcon:{type:4,description:"How to show language icons on codeblocks",options:[{label:"Disabled",value:"DISABLED"},{label:"Colorless",value:"GREYSCALE",default:!0},{label:"Colored",value:"COLOR"}],onChange:e=>{e==="DISABLED"?$t(Ls):St(Ls)}},bgOpacity:{type:5,description:"Background opacity",markers:[0,20,40,60,80,100],default:100,componentProps:{stickToMarkers:!1,onValueRender:null}}},{theme:{disabled(){return!!this.store.customTheme}},customTheme:{isValid(e){if(!e)return!0;let t=fc(e);return t?t.pathname.endsWith(".json")?!0:"Must be a json file":"Must be a valid URL"}}})});function TT(e,t){let n=Xo.use(e),[r,i]=O.useState(!1),s={...n,...t},l=s.customTheme||s.theme;if(t){let c=ve.currentThemeUrl&&l&&l!==ve.currentThemeUrl,u=Object.keys(t).length===0;r&&(!c||u)&&i(!1),!r&&c&&(i(!0),ve.setTheme(l))}return{...s,isThemeLoading:l!==ve.currentThemeUrl}}var xT=g(()=>{"use strict";a();I();Rs();Tf()});function wT(e){return e=e.slice(1),e.length<6&&(e=e.split("").map(t=>t+t).join("")),e.length===6&&(e+="ff"),e.length>6&&(e=e.slice(0,6)),e.split(/(..)/).filter(Boolean).map(t=>parseInt(t,16))}var MT=g(()=>{"use strict";a()});var Gn,PT,Ds=g(()=>{"use strict";a();Ve();I();Fl();Es();Gn=Ge("shiki-"),PT=({lang:e,tryHljs:t})=>{let n=e?lr?.getLanguage?.(e):null,i=(e?Cr(e):null)?.name;switch(t){case"ALWAYS":return!0;case"PRIMARY":return!!n||e==="";case"SECONDARY":return!i&&!!n;case"NEVER":return!1;default:return!1}}});function IT(e){let[t,n]=O.useState(!1);function r(i){Qt.copy(i),n(!0),setTimeout(()=>{n(!1)},e)}return[t,r]}var AT=g(()=>{"use strict";a();I()});function NT({content:e,...t}){let[n,r]=IT(1e3);return o("button",{...t,style:{...t.style,cursor:n?"default":void 0},onClick:()=>r(e)},n?"Copied!":"Copy")}var CT=g(()=>{"use strict";a();AT()});function kT({content:e,theme:t}){let n=[];return Qt.SUPPORTS_COPY&&n.push(o(NT,{content:e,className:Gn("btn"),style:{backgroundColor:t.accentBgColor,color:t.accentFgColor}})),o("div",{className:Gn("btns")},n)}var RT=g(()=>{"use strict";a();I();Ds();CT()});var LT,ET=g(()=>{"use strict";a();I();Ds();LT=({theme:e,useHljs:t,lang:n,content:r,tokens:i})=>{let s;if(t)try{let{value:c}=lr.highlight(n,r,!0);s=c.split(` +`).map((u,d)=>o("span",{key:d,dangerouslySetInnerHTML:{__html:u}}))}catch{s=r.split(` `).map(c=>o("span",null,c))}else s=(i??r.split(` `).map(u=>[{color:e.plainColor,content:u}])).map(u=>u.length===0?o("span",null,` -`):o(f,null,u.map(({content:p,color:m,fontStyle:h},v)=>o("span",{key:v,style:{color:m,fontStyle:(h??0)&1?"italic":void 0,fontWeight:(h??0)&2?"bold":void 0,textDecoration:(h??0)&4?"underline":void 0}},p))));let l=s.map((c,u)=>o("tr",{key:u},o("td",{style:{color:e.plainColor}},u+1),o("td",null,c)));return o("table",{className:Un("table")},...l)}});function HT({langName:e,useDevIcon:t,shikiLang:n}){return e?o("div",{className:Un("lang")},t!=="DISABLED"&&n?.devicon&&o("i",{className:`${Un("devicon")} devicon-${n.devicon}${t==="COLOR"?" colored":""}`}),e):o(f,null)}var zT=g(()=>{"use strict";a();Ds();Os()});var Bl,KN,jT=g(()=>{"use strict";a();le();Qe();A();_l();Ls();kT();vf();LT();Os();UT();GT();zT();Bl=e=>o("pre",{className:Un("container")},o(_,null,o(KN,{...e}))),KN=({lang:e,content:t,isPreview:n,tempSettings:r})=>{let{tryHljs:i,useDevIcon:s,bgOpacity:l}=CT(["tryHljs","useDevIcon","bgOpacity"],r),{id:c,theme:u}=xT(),p=e?Cr(e):null,m=ET({lang:e,tryHljs:i}),[h,v]=vc(!0),[T]=rt(async()=>!p||m||!v?null:await he.tokenizeCode(t,e),{fallbackValue:null,deps:[e,t,c,v]}),M={plainColor:u?.fg||"var(--text-normal)",accentBgColor:u?.colors?.["statusBar.background"]||(m?"#7289da":"#007BC8"),accentFgColor:u?.colors?.["statusBar.foreground"]||"#FFF",backgroundColor:u?.colors?.["editor.background"]||"var(--background-secondary)"},b;return e&&(b=m?lr?.getLanguage?.(e)?.name:p?.name),o("div",{ref:h,className:Un("root",{plain:!b,preview:n}),style:{backgroundColor:m?M.backgroundColor:`rgba(${RT(M.backgroundColor).concat(l/100).join(", ")})`,color:M.plainColor}},o("code",null,o(HT,{langName:b,useDevIcon:s,shikiLang:p}),o($T,{theme:M,useHljs:m,lang:e,content:t,tokens:T}),!n&&o(FT,{content:t,theme:M})))}});var WT,qT,KT=g(()=>{"use strict";a();WT=new Map,qT=()=>{WT.forEach(e=>e.remove()),WT.clear()}});var wf,YT=g(()=>{"use strict";a();mT();Je();P();w();gT();Ls();jT();Tf();xf();Ds();KT();wf=y({name:"ShikiCodeblocks",description:"Brings vscode-style codeblocks into Discord, powered by Shiki",authors:[d.Vap],patches:[{find:"codeBlock:{react(",replacement:{match:/codeBlock:\{react\((\i),(\i),(\i)\)\{/,replace:"$&return $self.renderHighlighter($1,$2,$3);"}}],start:async()=>{Zo.store.useDevIcon!=="DISABLED"&&St(Es),await he.init(Zo.store.customTheme||Zo.store.theme)},stop:()=>{he.destroy(),qT()},settingsAboutComponent:({tempSettings:e})=>Bl({lang:"tsx",content:fT,isPreview:!0,tempSettings:e}),settings:Zo,shiki:he,createHighlighter:Bl,renderHighlighter:({lang:e,content:t})=>Bl({lang:e?.toLowerCase(),content:t,isPreview:!1})})});var Mf,ZT=g(()=>{"use strict";a();P();w();Mf=y({name:"ShowAllMessageButtons",description:"Always show all message buttons no matter if you are holding the shift key or not.",authors:[d.Nuckyz],patches:[{find:".Messages.MESSAGE_UTILITIES_A11Y_LABEL",replacement:{match:/isExpanded:\i&&(.+?),/,replace:"isExpanded:$1,"}}]})});var XT=g(()=>{});function QT(){let e=Ai(JT.colors.INTERACTIVE_MUTED).hex(),t=Ai(JT.colors.INTERACTIVE_ACTIVE).hex();return o(YN,{color:e,forcedIconColor:t,size:16,tooltipText:ot.Messages.CONNECTION_VERIFIED})}var JT,YN,VT=g(()=>{"use strict";a();j();A();JT=un(e=>e.colors?.INTERACTIVE_MUTED?.css),YN=Xe(".CONNECTIONS_ROLE_OFFICIAL_ICON_TOOLTIP")});function ex({id:e,theme:t}){let n=nn.getUserProfile(e);if(!n)return null;let r=n.connectedAccounts;return r?.length?o(ZN,null,o(re,{tag:"h2",variant:"eyebrow",style:{color:"var(--header-primary)"}},"Connections"),o(ge,{style:{marginTop:"8px",gap:VN(Fl.store.iconSpacing),flexWrap:"wrap"}},r.map(i=>o(nC,{connection:i,theme:t})))):null}function nC({connection:e,theme:t}){let n=JN.get(e.type),r=n.getPlatformUserUrl?.(e),i=o("img",{"aria-label":e.name,src:t==="light"?n.icon.lightSVG:n.icon.darkSVG,style:{width:Fl.store.iconSize,height:Fl.store.iconSize}}),s=r?Jr:hy;return o(V,{text:o("span",{className:"vc-sc-tooltip"},e.name,e.verified&&o(QT,null),o(s,{height:16,width:16})),key:e.id},l=>r?o("a",{...l,className:"vc-user-connection",href:r,target:"_blank",onClick:c=>{Vencord.Plugins.isPluginEnabled("OpenInApp")&&Vencord.Plugins.plugins.OpenInApp.handleLink(c.currentTarget,c)}},i):o("button",{...l,className:"vc-user-connection",onClick:()=>gn(e.name)},i))}var ZN,XN,JN,QN,VN,Fl,eC,tC,Pf,tx=g(()=>{"use strict";a();XT();$();le();Lt();$t();P();Re();w();j();A();VT();ZN=Xe(".lastSection","children:"),XN=Me("ThemeStore"),JN=I("isSupported","getByUrl"),QN=Pi(',"--profile-gradient-primary-color"'),VN=e=>(e??0)*2+4,Fl=D({iconSize:{type:1,description:"Icon size (px)",default:32},iconSpacing:{type:4,description:"Icon margin",default:1,options:[{label:"Compact",value:0},{label:"Cozy",value:1},{label:"Roomy",value:2}]}}),eC=_.wrap(({user:e,displayProfile:t})=>o(ex,{id:e.id,theme:QN(e,t).profileTheme})),tC=_.wrap(({id:e})=>o(ex,{id:e,theme:XN.theme}));Pf=y({name:"ShowConnections",description:"Show connected accounts in user popouts",authors:[d.TheKodeToad],patches:[{find:"{isUsingGuildBio:null!==(",replacement:{match:/,theme:\i\}\)(?=,.{0,150}setNote:)/,replace:"$&,$self.profilePopoutComponent({ user: arguments[0].user, displayProfile: arguments[0].displayProfile })"}},{find:'"Profile Panel: user cannot be undefined"',replacement:{match:/\(0,\i\.jsx\)\(\i\.\i,\{\}\).{0,100}setNote:(?=.+?channelId:(\i).id)/,replace:"$self.profilePanelComponent({ id: $1.recipients[0] }),$&"}}],settings:Fl,profilePopoutComponent:eC,profilePanelComponent:tC})});var nx=g(()=>{});function mC({channel:e}){let[t,n]=J(Xo.store.defaultAllowedUsersAndRolesDropdownState),[r,i]=J([]),{type:s,topic:l,lastMessageId:c,defaultForumLayout:u,lastPinTimestamp:p,defaultAutoArchiveDuration:m,availableTags:h,id:v,rateLimitPerUser:T,defaultThreadRateLimitPerUser:M,defaultSortOrder:b,defaultReactionEmoji:x,bitrate:N,rtcRegion:k,videoQualityMode:B,permissionOverwrites:U,guild_id:Y}=e;return De(()=>{let K=[],z=Te.getGuild(Y).ownerId;ke.getMember(Y,z)||K.push(z),Object.values(U).forEach(({type:L,id:X})=>{L===1&&!ke.getMember(Y,X)&&K.push(X)}),K.length>0&&F.dispatch({type:"GUILD_MEMBERS_REQUEST",guildIds:[Y],userIds:K}),E.plugins.PermissionsViewer.enabled&&i(pl(Object.values(U).map(L=>({type:L.type,id:L.id,overwriteAllow:L.allow,overwriteDeny:L.deny})),Y))},[v]),o("div",{className:ox.auto+" "+ox.customTheme+" "+oC.chatContent+" shc-lock-screen-outer-container"},o("div",{className:"shc-lock-screen-container"},o("img",{className:"shc-lock-screen-logo",src:dC}),o("div",{className:"shc-lock-screen-heading-container"},o(re,{variant:"heading-xxl/bold"},"This is a ",Ce.can(Se.VIEW_CHANNEL,e)?"locked":"hidden"," ",lC[s]," channel."),e.isNSFW()&&o(V,{text:"NSFW"},({onMouseLeave:K,onMouseEnter:z})=>o("svg",{onMouseLeave:K,onMouseEnter:z,className:"shc-lock-screen-heading-nsfw-icon",width:"32",height:"32",viewBox:"0 0 48 48","aria-hidden":!0,role:"img"},o("path",{fill:"currentColor",d:"M.7 43.05 24 2.85l23.3 40.2Zm23.55-6.25q.75 0 1.275-.525.525-.525.525-1.275 0-.75-.525-1.3t-1.275-.55q-.8 0-1.325.55-.525.55-.525 1.3t.55 1.275q.55.525 1.3.525Zm-1.85-6.1h3.65V19.4H22.4Z"})))),!e.isGuildVoice()&&!e.isGuildStageVoice()&&o(re,{variant:"text-lg/normal"},"You can not see the ",e.isForumChannel()?"posts":"messages"," of this channel.",e.isForumChannel()&&l&&l.length>0&&" However you may see its guidelines:"),e.isForumChannel()&&l&&l.length>0&&o("div",{className:"shc-lock-screen-topic-container"},Fe.parseTopic(l,!1,{channelId:v})),c&&o(re,{variant:"text-md/normal"},"Last ",e.isForumChannel()?"post":"message"," created:",o(Gn,{timestamp:mn(zn.extractTimestamp(c))})),p&&o(re,{variant:"text-md/normal"},"Last message pin: ",o(Gn,{timestamp:mn(p)})),(T??0)>0&&o(re,{variant:"text-md/normal"},"Slowmode: ",Ji(T,"seconds")),(M??0)>0&&o(re,{variant:"text-md/normal"},"Default thread slowmode: ",Ji(M,"seconds")),(e.isGuildVoice()||e.isGuildStageVoice())&&N!=null&&o(re,{variant:"text-md/normal"},"Bitrate: ",N," bits"),k!==void 0&&o(re,{variant:"text-md/normal"},"Region: ",k??"Automatic"),(e.isGuildVoice()||e.isGuildStageVoice())&&o(re,{variant:"text-md/normal"},"Video quality mode: ",pC[B??1]),(m??0)>0&&o(re,{variant:"text-md/normal"},"Default inactivity duration before archiving ",e.isForumChannel()?"posts":"threads",":"," "+Ji(m,"minutes")),u!=null&&o(re,{variant:"text-md/normal"},"Default layout: ",uC[u]),b!=null&&o(re,{variant:"text-md/normal"},"Default sort order: ",cC[b]),x!=null&&o("div",{className:"shc-lock-screen-default-emoji-container"},o(re,{variant:"text-md/normal"},"Default reaction emoji:"),Fe.defaultRules[x.emojiName?"emoji":"customEmoji"].react({name:x.emojiName?sC.convertSurrogateToName(x.emojiName):Nn.getCustomEmojiById(x.emojiId)?.name??"",emojiId:x.emojiId??void 0,surrogate:x.emojiName??void 0,src:x.emojiName?aC.getURL(x.emojiName):void 0},void 0,{key:"0"})),e.hasFlag(16)&&o(re,{variant:"text-md/normal"},"Posts on this forum require a tag to be set."),h&&h.length>0&&o("div",{className:"shc-lock-screen-tags-container"},o(re,{variant:"text-lg/bold"},"Available tags:"),o("div",{className:"shc-lock-screen-tags"},h.map(K=>o(iC,{tag:K})))),o("div",{className:"shc-lock-screen-allowed-users-and-roles-container"},o("div",{className:"shc-lock-screen-allowed-users-and-roles-container-title"},E.plugins.PermissionsViewer.enabled&&o(V,{text:"Permission Details"},({onMouseLeave:K,onMouseEnter:z})=>o("button",{onMouseLeave:K,onMouseEnter:z,className:"shc-lock-screen-allowed-users-and-roles-container-permdetails-btn",onClick:()=>li(r,Te.getGuild(e.guild_id),e.name)},o("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},o("path",{fill:"currentColor",d:"M7 12.001C7 10.8964 6.10457 10.001 5 10.001C3.89543 10.001 3 10.8964 3 12.001C3 13.1055 3.89543 14.001 5 14.001C6.10457 14.001 7 13.1055 7 12.001ZM14 12.001C14 10.8964 13.1046 10.001 12 10.001C10.8954 10.001 10 10.8964 10 12.001C10 13.1055 10.8954 14.001 12 14.001C13.1046 14.001 14 13.1055 14 12.001ZM19 10.001C20.1046 10.001 21 10.8964 21 12.001C21 13.1055 20.1046 14.001 19 14.001C17.8954 14.001 17 13.1055 17 12.001C17 10.8964 17.8954 10.001 19 10.001Z"})))),o(re,{variant:"text-lg/bold"},"Allowed users and roles:"),o(V,{text:t?"Hide Allowed Users and Roles":"View Allowed Users and Roles"},({onMouseLeave:K,onMouseEnter:z})=>o("button",{onMouseLeave:K,onMouseEnter:z,className:"shc-lock-screen-allowed-users-and-roles-container-toggle-btn",onClick:()=>n(L=>!L)},o("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:t?"scale(1 -1)":"scale(1 1)"},o("path",{fill:"currentColor",d:"M16.59 8.59003L12 13.17L7.41 8.59003L6 10L12 16L18 10L16.59 8.59003Z"}))))),t&&o(rC,{channel:e}))))}var ox,oC,rC,iC,sC,aC,lC,cC,uC,pC,dC,rx,ix=g(()=>{"use strict";a();$();le();ro();j();A();ws();xs();If();ox=I("auto","content","scrollerBase"),oC=I("chat","content","noChat","chatContent"),rC=Xe(".Messages.ROLE_REQUIRED_SINGLE_USER_MESSAGE"),iC=sc(e=>{if(typeof e!="function")return!1;let t=Function.prototype.toString.call(e);return t.includes(".Messages.FORUM_TAG_A11Y_FILTER_BY_TAG")&&!t.includes("increasedActivityPill")}),sC=I("convertSurrogateToName"),aC=I("getURL","getEmojiColors"),lC={[0]:"text",[5]:"announcement",[15]:"forum",[2]:"voice",[13]:"stage"},cC={[0]:"Latest activity",[1]:"Creation date"},uC={[0]:"Not set",[1]:"List view",[2]:"Gallery view"},pC={[1]:"Automatic",[2]:"720p"},dC="/assets/433e3ec4319a9d11b0cbe39342614982.svg";rx=_.wrap(mC)});var sx,Xo,Af,If=g(()=>{"use strict";a();nx();$();le();P();ps();w();j();A();ix();sx=I("channelEmoji","unread","icon"),Xo=D({hideUnreads:{description:"Hide Unreads",type:3,default:!0,restartNeeded:!0},showMode:{description:"The mode used to display hidden channels.",type:4,options:[{label:"Plain style with Lock Icon instead",value:0,default:!0},{label:"Muted style with hidden eye icon on the right",value:1}],restartNeeded:!0},defaultAllowedUsersAndRolesDropdownState:{description:"Whether the allowed users and roles dropdown on hidden channels should be open by default",type:3,default:!0}}),Af=y({name:"ShowHiddenChannels",description:"Show channels that you do not have access to view.",authors:[d.BigDuck,d.AverageReactEnjoyer,d.D3SOX,d.Ven,d.Nuckyz,d.Nickyux,d.dzshn],settings:Xo,patches:[{find:'"placeholder-channel-id"',replacement:[{match:/if\(!\i\.\i\.can\(\i\.\i\.VIEW_CHANNEL.+?{if\(this\.id===\i\).+?threadIds:\i}}/,replace:""},{match:/(?=!\(0,\i\.getHasImportantUnread\)\(this\.record\))/,replace:"$self.isHiddenChannel(this.record)||"},{match:/(activeJoinedRelevantThreads:.{0,50}VIEW_CHANNEL.+?renderLevel:(.+?),threadIds.+?renderLevel:).+?(?=,threadIds)/g,replace:(e,t,n)=>`${t}${n}`},{match:/(?<=getRenderLevel\(\i\){.+?return)!\i\.\i\.can\(\i\.\i\.VIEW_CHANNEL,this\.record\)\|\|/,replace:" "}]},{find:"VoiceChannel, transitionTo: Channel does not have a guildId",replacement:[{match:/(?<=getCurrentClientVoiceChannelId\((\i)\.guild_id\);return)/,replace:(e,t)=>`!$self.isHiddenChannel(${t})&&`},{match:/(?=&&\i\.\i\.selectVoiceChannel\((\i)\.id\))/,replace:(e,t)=>`&&!$self.isHiddenChannel(${t})`},{match:/!__OVERLAY__&&\((?<=selectVoiceChannel\((\i)\.id\).+?)/,replace:(e,t)=>`${e}$self.isHiddenChannel(${t},true)||`}]},{find:".MAX_STAGE_VOICE_USER_LIMIT})",replacement:{match:/!(\i)\.isRoleSubscriptionTemplatePreviewChannel\(\)/,replace:(e,t)=>`${e}&&!$self.isHiddenChannel(${t})`}},{find:"ChannelItemEditButton:function(){",replacement:[...["renderEditButton","renderInviteButton"].map(e=>({match:new RegExp(`(?<=${e}\\(\\){)`,"g"),replace:"if($self.isHiddenChannel(this.props.channel))return null;"}))]},{find:"VoiceChannel.renderPopout: There must always be something to render",all:!0,replacement:{match:/(?<=renderOpenChatButton=\(\)=>{)/,replace:"if($self.isHiddenChannel(this.props.channel))return null;"}},{find:".Messages.CHANNEL_TOOLTIP_DIRECTORY",predicate:()=>Xo.store.showMode===0,replacement:{match:/(?=switch\((\i)\.type\).{0,30}\.GUILD_ANNOUNCEMENT.{0,70}\(0,\i\.\i\))/,replace:(e,t)=>`if($self.isHiddenChannel(${t}))return $self.LockIcon;`}},{find:"UNREAD_IMPORTANT:",predicate:()=>Xo.store.showMode===1,replacement:[{match:/(?<={channel:(\i),name:\i,muted:(\i).+?;)/,replace:(e,t,n)=>`${n}=$self.isHiddenChannel(${t})?true:${n};`},{match:/\i\.children.+?:null(?<=,channel:(\i).+?)/,replace:(e,t)=>`${e},$self.isHiddenChannel(${t})?$self.HiddenChannelIcon():null`},{match:/(?<=\.wrapper:\i\.notInteractive,)(.+?)if\((\i)\)return (\i\.MUTED);/,replace:(e,t,n,r)=>`${n}?${r}:"",${t}if(${n})return "";`}]},{find:"UNREAD_IMPORTANT:",replacement:[{predicate:()=>Xo.store.hideUnreads===!1&&Xo.store.showMode===1,match:/\.LOCKED;if\((?<={channel:(\i).+?)/,replace:(e,t)=>`${e}!$self.isHiddenChannel(${t})&&`},{predicate:()=>Xo.store.hideUnreads===!0,match:/(?<={channel:(\i),name:\i,.+?unread:(\i).+?;)/,replace:(e,t,n)=>`${n}=$self.isHiddenChannel(${t})?false:${n};`}]},{find:'.displayName="ChannelListUnreadsStore"',replacement:{match:/(?<=if\(null==(\i))(?=.{0,160}?getHasImportantUnread\)\(\i\))/g,replace:(e,t)=>`||$self.isHiddenChannel(${t})`}},{find:"renderBottomUnread(){",replacement:{match:/(?=&&\(0,\i\.getHasImportantUnread\)\((\i\.record)\))/,replace:"&&!$self.isHiddenChannel($1)"}},{find:".useFlattenedChannelIdListWithThreads)",replacement:{match:/(?=&&\(0,\i\.getHasImportantUnread\)\((\i)\))/,replace:"&&!$self.isHiddenChannel($1)"}},{find:"Missing channel in Channel.renderHeaderToolbar",replacement:[{match:/(?<=renderHeaderToolbar=\(\)=>{.+?case \i\.\i\.GUILD_TEXT:)(?=.+?(\i\.push.{0,50}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/,replace:(e,t,n,r)=>`if(!${r}&&$self.isHiddenChannel(${n})){${t};break;}`},{match:/(?<=renderHeaderToolbar=\(\)=>{.+?case \i\.\i\.GUILD_MEDIA:)(?=.+?(\i\.push.{0,40}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/,replace:(e,t,n,r)=>`if(!${r}&&$self.isHiddenChannel(${n})){${t};break;}`},{match:/renderMobileToolbar=\(\)=>{.+?case \i\.\i\.GUILD_DIRECTORY:(?<=let{channel:(\i).+?)/,replace:(e,t)=>`${e}if($self.isHiddenChannel(${t}))break;`},{match:/(?<=renderHeaderBar=\(\)=>{.+?hideSearch:(\i)\.isDirectory\(\))/,replace:(e,t)=>`||$self.isHiddenChannel(${t})`},{match:/(?<=renderSidebar\(\){)/,replace:"if($self.isHiddenChannel(this.props.channel))return null;"},{match:/(?<=renderChat\(\){)/,replace:"if($self.isHiddenChannel(this.props.channel))return $self.HiddenChannelLockScreen(this.props.channel);"}]},{find:'"MessageManager"',replacement:{match:/"Skipping fetch because channelId is a static route"\);return}(?=.+?getChannel\((\i)\))/,replace:(e,t)=>`${e}if($self.isHiddenChannel({channelId:${t}}))return;`}},{find:'"alt+shift+down"',replacement:{match:/(?<=getChannel\(\i\);return null!=(\i))(?=.{0,150}?getHasImportantUnread\)\(\i\))/,replace:(e,t)=>`&&!$self.isHiddenChannel(${t})`}},{find:".APPLICATION_STORE&&null!=",replacement:{match:/(?<=getState\(\)\.channelId.{0,30}?\(0,\i\.\i\)\(\i\))(?=\.map\()/,replace:".filter(e=>!$self.isHiddenChannel(e))"}},{find:".Messages.ROLE_REQUIRED_SINGLE_USER_MESSAGE",replacement:[{match:/ADMINISTRATOR\)\|\|(?<=context:(\i)}.+?)(?=(.+?)VIEW_CHANNEL)/,replace:(e,t,n)=>`${e}!Vencord.Webpack.Common.PermissionStore.can(${Se.CONNECT}n,${t})?${n}CONNECT):`},{match:/permissionOverwrites\[.+?\i=(?<=context:(\i)}.+?)(?=(.+?)VIEW_CHANNEL)/,replace:(e,t,n)=>`${e}!Vencord.Webpack.Common.PermissionStore.can(${Se.CONNECT}n,${t})?${n}CONNECT):`},{match:/sortBy.{0,30}?\.filter\(\i=>(?<=channel:(\i).+?)/,replace:(e,t)=>`${e}$self.isHiddenChannel(${t})?true:`},{match:/computePermissionsForRoles.+?.value\(\)(?<=channel:(\i).+?)/,replace:(e,t)=>`${e}.reduce(...$self.makeAllowedRolesReduce(${t}.guild_id))`},{match:/MANAGE_ROLES.{0,90}?return(?=\(.+?(\(0,\i\.jsxs\)\("div",{className:\i\.members.+?guildId:(\i)\.guild_id.+?roleColor.+?\]}\)))/,replace:(e,t,n)=>(t=t.replace(xr(/(?<=users:\i)/),`,shcChannel:${n}`),t=t.replace(xr(/1!==\i\.length/),"true"),`${e} $self.isHiddenChannel(${n},true)?${t}:`)}]},{find:".avatars),children",replacement:[{match:/maxUsers:\i,users:\i.+?=(\i).+?;/,replace:(e,t)=>`${e}let{shcChannel}=${t};`},{match:/\i>0(?=&&.{0,60}renderPopout)/,replace:e=>`($self.isHiddenChannel(shcChannel,true)?true:${e})`},{match:/(?<=\.value\(\),(\i)=.+?length-)1(?=\]=.{0,60}renderPopout)/,replace:(e,t)=>`($self.isHiddenChannel(shcChannel,true)&&${t}<=0?0:1)`},{match:/(?<="\+",)(\i)\+1/,replace:(e,t)=>`$self.isHiddenChannel(shcChannel,true)&&${t}<=0?"":${e}`}]},{find:".Messages.CHANNEL_CALL_CURRENT_SPEAKER.format",replacement:[{match:/"more-options-popout"\)\),(?<=let{channel:(\i).+?inCall:(\i).+?)/,replace:(e,t,n)=>`${e}${n}||!$self.isHiddenChannel(${t},true)&&`},{match:/"popup".{0,100}?if\((?<=let{channel:(\i).+?inCall:(\i).+?)/,replace:(e,t,n)=>`${e}(${n}||!$self.isHiddenChannel(${t},true))&&`}]},{find:".Messages.EMBEDDED_ACTIVITIES_DEVELOPER_ACTIVITY_SHELF_FETCH_ERROR",replacement:[{match:/renderContent\(\i\){.+?this\.renderVoiceChannelEffects.+?children:/,replace:"$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)?$self.HiddenChannelLockScreen(this.props.channel):"},{match:/renderContent\(\i\){.+?disableGradients:/,replace:"$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)||"},{match:/(?:{|,)render(?!Header|ExternalHeader).{0,30}?:/g,replace:"$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)?()=>null:"},{match:/callContainer,(?<=\i\.callContainer,)/,replace:'$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)?"":'}]},{find:'"HasBeenInStageChannel"',replacement:[{match:/"124px".+?children:(?<=let \i,{channel:(\i).+?)(?=.{0,20}?}\)}function)/,replace:(e,t)=>`${e}$self.isHiddenChannel(${t})?$self.HiddenChannelLockScreen(${t}):`},{match:/render(?:BottomLeft|BottomCenter|BottomRight|ChatToasts):\(\)=>(?<=let \i,{channel:(\i).+?)/g,replace:(e,t)=>`${e}$self.isHiddenChannel(${t})?null:`},{match:/"124px".+?disableGradients:(?<=let \i,{channel:(\i).+?)/,replace:(e,t)=>`${e}$self.isHiddenChannel(${t})||`},{match:/"124px".+?style:(?<=let \i,{channel:(\i).+?)/,replace:(e,t)=>`${e}$self.isHiddenChannel(${t})?void 0:`}]},{find:".Messages.STAGE_FULL_MODERATOR_TITLE",replacement:[{match:/\(0,\i\.jsx\)\(\i\.\i\.Divider.+?}\)]}\)(?=.+?:(\i)\.guild_id)/,replace:(e,t)=>`$self.isHiddenChannel(${t})?null:(${e})`},{match:/"recents".+?&&(?=\(.+?channelId:(\i)\.id,showRequestToSpeakSidebar)/,replace:(e,t)=>`${e}!$self.isHiddenChannel(${t})&&`}]},{find:",queryStaticRouteChannels(",replacement:[{match:/(?<=queryChannels\(\i\){.+?getChannels\(\i)(?=\))/,replace:",true"},{match:/(?<=queryChannels\(\i\){.+?isGuildChannelType\)\((\i)\.type\))(?=&&!\i\.\i\.can\()/,replace:"&&!$self.isHiddenChannel($1)"}]},{find:'"^/guild-stages/(\\\\d+)(?:/)?(\\\\d+)?"',replacement:{match:/\i\.\i\.can\(\i\.\i\.VIEW_CHANNEL,\i\)/,replace:"true"}},{find:".shouldCloseDefaultModals",replacement:{match:/(?<=getChannel\(\i\);if\(null!=(\i))(?=.{0,100}?selectVoiceChannel)/,replace:(e,t)=>`&&!$self.isHiddenChannel(${t})`}},{find:'.displayName="GuildChannelStore"',replacement:[{match:/isChannelGated\(.+?\)(?=&&)/,replace:e=>`${e}&&false`},{match:/(?<=getChannels\(\i)(\){.+?)return (.+?)}/,replace:(e,t,n)=>`,shouldIncludeHidden${t}return $self.resolveGuildChannels(${n},shouldIncludeHidden??false);}`}]},{find:".Messages.FORM_LABEL_MUTED",replacement:{match:/(?<=getChannels\(\i)(?=\))/,replace:",true"}},{find:'.displayName="NowPlayingViewStore"',replacement:{match:/(getVoiceStateForUser.{0,150}?)&&\i\.\i\.canWithPartialContext.{0,20}VIEW_CHANNEL.+?}\)(?=\?)/,replace:"$1"}}],isHiddenChannel(e,t=!1){return!e||(e.channelId&&(e=Q.getChannel(e.channelId)),!e||e.isDM()||e.isGroupDM()||e.isMultiUserDM())?!1:!Ce.can(Se.VIEW_CHANNEL,e)||t&&!Ce.can(Se.CONNECT,e)},resolveGuildChannels(e,t){if(t)return e;let n={};for(let[r,i]of Object.entries(e)){if(!Array.isArray(i)){n[r]=i;continue}n[r]??=[];for(let s of i)(s.channel.id===null||!this.isHiddenChannel(s.channel))&&n[r].push(s)}return n},makeAllowedRolesReduce(e){return[(t,n,r,i)=>{if(r!==0)return t;let s=i.find(l=>l.id===e);return s?[s]:i},[]]},HiddenChannelLockScreen:e=>o(rx,{channel:e}),LockIcon:_.wrap(()=>o("svg",{className:sx.icon,height:"18",width:"20",viewBox:"0 0 24 24","aria-hidden":!0,role:"img"},o("path",{className:"shc-evenodd-fill-current-color",d:"M17 11V7C17 4.243 14.756 2 12 2C9.242 2 7 4.243 7 7V11C5.897 11 5 11.896 5 13V20C5 21.103 5.897 22 7 22H17C18.103 22 19 21.103 19 20V13C19 11.896 18.103 11 17 11ZM12 18C11.172 18 10.5 17.328 10.5 16.5C10.5 15.672 11.172 15 12 15C12.828 15 13.5 15.672 13.5 16.5C13.5 17.328 12.828 18 12 18ZM15 11H9V7C9 5.346 10.346 4 12 4C13.654 4 15 5.346 15 7V11Z"})),{noop:!0}),HiddenChannelIcon:_.wrap(()=>o(V,{text:"Hidden Channel"},({onMouseLeave:e,onMouseEnter:t})=>o("svg",{onMouseLeave:e,onMouseEnter:t,className:sx.icon+" shc-hidden-channel-icon",width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":!0,role:"img"},o("path",{className:"shc-evenodd-fill-current-color",d:"m19.8 22.6-4.2-4.15q-.875.275-1.762.413Q12.95 19 12 19q-3.775 0-6.725-2.087Q2.325 14.825 1 11.5q.525-1.325 1.325-2.463Q3.125 7.9 4.15 7L1.4 4.2l1.4-1.4 18.4 18.4ZM12 16q.275 0 .512-.025.238-.025.513-.1l-5.4-5.4q-.075.275-.1.513-.025.237-.025.512 0 1.875 1.312 3.188Q10.125 16 12 16Zm7.3.45-3.175-3.15q.175-.425.275-.862.1-.438.1-.938 0-1.875-1.312-3.188Q13.875 7 12 7q-.5 0-.938.1-.437.1-.862.3L7.65 4.85q1.025-.425 2.1-.638Q10.825 4 12 4q3.775 0 6.725 2.087Q21.675 8.175 23 11.5q-.575 1.475-1.512 2.738Q20.55 15.5 19.3 16.45Zm-4.625-4.6-3-3q.7-.125 1.288.112.587.238 1.012.688.425.45.613 1.038.187.587.087 1.162Z"}))),{noop:!0})})});var ax=g(()=>{});var _s,Nf,lx=g(()=>{"use strict";a();ax();$();P();w();_s=D({mode:{type:4,description:"How to display usernames and nicks",options:[{label:"Username then nickname",value:"user-nick",default:!0},{label:"Nickname then username",value:"nick-user"},{label:"Username only",value:"user"}]},displayNames:{type:3,description:"Use display names in place of usernames",default:!1},inReplies:{type:3,default:!1,description:"Also apply functionality to reply previews"}}),Nf=y({name:"ShowMeYourName",description:"Display usernames next to nicks, or no nicks at all",authors:[d.Rini,d.TheKodeToad],patches:[{find:".useCanSeeRemixBadge)",replacement:{match:/(?<=onContextMenu:\i,children:).*?\}/,replace:"$self.renderUsername(arguments[0])}"}}],settings:_s,renderUsername:({author:e,message:t,isRepliedMessage:n,withMentionPrefix:r,userOverride:i})=>{try{let s=i??t.author,{username:l}=s;_s.store.displayNames&&(l=s.globalName||l);let{nick:c}=e,u=r?"@":"";return l===c||n&&!_s.store.inReplies?u+c:_s.store.mode==="user-nick"?o(f,null,u,l," ",o("span",{className:"vc-smyn-suffix"},c)):_s.store.mode==="nick-user"?o(f,null,u,c," ",o("span",{className:"vc-smyn-suffix"},l)):u+l}catch{return e?.nick}}})});var Cf,cx=g(()=>{"use strict";a();P();w();Cf=y({name:"ShowTimeouts",description:"Display member timeout icons in chat regardless of permissions.",authors:[d.Dolfies],patches:[{find:"showCommunicationDisabledStyles",replacement:{match:/&&\i\.\i\.canManageUser\(\i\.\i\.MODERATE_MEMBERS,\i\.author,\i\)/,replace:""}}]})});function fC(e){let[t,n]=O.useState(kf);function r(i){Rf.store.persistState&&(kf=i),n(i)}return O.useEffect(()=>{let i=(s,l)=>{t&&(Rf.store.autoDisable&&r(!1),l.content.startsWith("@silent ")||(l.content="@silent "+l.content))};return Ht(i),()=>void zt(i)},[t]),e.type.analyticsName!=="normal"?null:o(V,{text:t?"Disable Silent Message":"Enable Silent Message"},i=>o("div",{style:{display:"flex"}},o(R,{...i,onClick:()=>r(!t),size:"",look:Kt.BLANK,innerClassName:vt.button,style:{padding:"0 6px"}},o("div",{className:vt.buttonWrapper},o("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},o("g",{fill:"currentColor"},o("path",{d:"M18 10.7101C15.1085 9.84957 13 7.17102 13 4C13 3.69264 13.0198 3.3899 13.0582 3.093C12.7147 3.03189 12.3611 3 12 3C8.686 3 6 5.686 6 9V14C6 15.657 4.656 17 3 17V18H21V17C19.344 17 18 15.657 18 14V10.7101ZM8.55493 19C9.24793 20.19 10.5239 21 11.9999 21C13.4759 21 14.7519 20.19 15.4449 19H8.55493Z"}),o("path",{d:"M18.2624 5.50209L21 2.5V1H16.0349V2.49791H18.476L16 5.61088V7H21V5.50209H18.2624Z"}),!t&&o("line",{x1:"22",y1:"2",x2:"2",y2:"22",stroke:"var(--red-500)","stroke-width":"2.5"})))))))}var kf,Rf,Lf,ux=g(()=>{"use strict";a();Yn();$();le();P();w();A();kf=!1,Rf=D({persistState:{type:3,description:"Whether to persist the state of the silent message toggle when changing channels",default:!1,onChange(e){e===!1&&(kf=!1)}},autoDisable:{type:3,description:"Automatically disable the silent message toggle again after sending one",default:!0}});Lf=y({name:"SilentMessageToggle",authors:[d.Nuckyz,d.CatNoir],description:"Adds a button to the chat bar to toggle sending a silent message.",dependencies:["MessageEventsAPI"],settings:Rf,patches:[{find:"ChannelTextAreaButtons",replacement:{match:/(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/,replace:"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()"}}],chatBarIcon:_.wrap(fC,{noop:!0})})});function gC(e){let{isEnabled:t}=ho.use(["isEnabled"]),n=()=>ho.store.isEnabled=!ho.store.isEnabled;return e.type.analyticsName!=="normal"?null:o(V,{text:t?"Disable Silent Typing":"Enable Silent Typing"},r=>o("div",{style:{display:"flex"}},o(R,{...r,onClick:n,size:"",look:Kt.BLANK,innerClassName:vt.button,style:{padding:"0 6px"}},o("div",{className:vt.buttonWrapper},o("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},o("path",{fill:"currentColor",d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}),t&&o("path",{d:"M13 432L590 48",stroke:"var(--red-500)","stroke-width":"72","stroke-linecap":"round"}))))))}var ho,Ef,px=g(()=>{"use strict";a();Qt();$();le();P();w();A();ho=D({showIcon:{type:3,default:!1,description:"Show an icon for toggling the plugin",restartNeeded:!0},isEnabled:{type:3,description:"Toggle functionality",default:!0}});Ef=y({name:"SilentTyping",authors:[d.Ven,d.Rini],description:"Hide that you are typing",patches:[{find:'.dispatch({type:"TYPING_START_LOCAL"',replacement:{match:/startTyping\(\i\){.+?},stop/,replace:"startTyping:$self.startTyping,stop"}},{find:"ChannelTextAreaButtons",predicate:()=>ho.store.showIcon,replacement:{match:/(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/,replace:"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()"}}],dependencies:["CommandsAPI"],settings:ho,commands:[{name:"silenttype",description:"Toggle whether you're hiding that you're typing or not.",inputType:0,options:[{name:"value",description:"whether to hide or not that you're typing (default is toggle)",required:!1,type:5}],execute:async(e,t)=>{ho.store.isEnabled=!!it(e,"value",!ho.store.isEnabled),ue(t.channel.id,{content:ho.store.isEnabled?"Silent typing enabled!":"Silent typing disabled!"})}}],async startTyping(e){ho.store.isEnabled||F.dispatch({type:"TYPING_START_LOCAL",channelId:e})},chatBarIcon:_.wrap(gC,{noop:!0})})});var Df,dx=g(()=>{"use strict";a();Lt();P();w();A();mx();Df=y({name:"SortFriendRequests",authors:[d.Megu],description:"Sorts friend requests by date of receipt",patches:[{find:"getRelationshipCounts(){",replacement:{match:/\.sortBy\(\i=>\i\.comparator\)/,replace:".sortBy((row) => $self.sortList(row))"}},{find:"RelationshipTypes.PENDING_INCOMING?",replacement:{predicate:()=>E.plugins.SortFriendRequests.showDates,match:/(user:(\i),.{10,50}),subText:(\i),(className:\i\.userInfo}\))/,replace:(e,t,n,r,i)=>`${t}, +`):o(f,null,u.map(({content:d,color:m,fontStyle:h},v)=>o("span",{key:v,style:{color:m,fontStyle:(h??0)&1?"italic":void 0,fontWeight:(h??0)&2?"bold":void 0,textDecoration:(h??0)&4?"underline":void 0}},d))));let l=s.map((c,u)=>o("tr",{key:u},o("td",{style:{color:e.plainColor}},u+1),o("td",null,c)));return o("table",{className:Gn("table")},...l)}});function DT({langName:e,useDevIcon:t,shikiLang:n}){return e?o("div",{className:Gn("lang")},t!=="DISABLED"&&n?.devicon&&o("i",{className:`${Gn("devicon")} devicon-${n.devicon}${t==="COLOR"?" colored":""}`}),e):o(f,null)}var OT=g(()=>{"use strict";a();Es();Ds()});var Ul,LN,_T=g(()=>{"use strict";a();le();Oe();I();Fl();Rs();xT();yf();MT();Ds();RT();ET();OT();Ul=e=>o("pre",{className:Gn("container")},o(_,null,o(LN,{...e}))),LN=({lang:e,content:t,isPreview:n,tempSettings:r})=>{let{tryHljs:i,useDevIcon:s,bgOpacity:l}=TT(["tryHljs","useDevIcon","bgOpacity"],r),{id:c,theme:u}=fT(),d=e?Cr(e):null,m=PT({lang:e,tryHljs:i}),[h,v]=hc(!0),[T]=ot(async()=>!d||m||!v?null:await ve.tokenizeCode(t,e),{fallbackValue:null,deps:[e,t,c,v]}),w={plainColor:u?.fg||"var(--text-normal)",accentBgColor:u?.colors?.["statusBar.background"]||(m?"#7289da":"#007BC8"),accentFgColor:u?.colors?.["statusBar.foreground"]||"#FFF",backgroundColor:u?.colors?.["editor.background"]||"var(--background-secondary)"},b;return e&&(b=m?lr?.getLanguage?.(e)?.name:d?.name),o("div",{ref:h,className:Gn("root",{plain:!b,preview:n}),style:{backgroundColor:m?w.backgroundColor:`rgba(${wT(w.backgroundColor).concat(l/100).join(", ")})`,color:w.plainColor}},o("code",null,o(DT,{langName:b,useDevIcon:s,shikiLang:d}),o(LT,{theme:w,useHljs:m,lang:e,content:t,tokens:T}),!n&&o(kT,{content:t,theme:w})))}});var BT,FT,UT=g(()=>{"use strict";a();BT=new Map,FT=()=>{BT.forEach(e=>e.remove()),BT.clear()}});var xf,$T=g(()=>{"use strict";a();iT();Ve();P();M();aT();Rs();_T();bf();Tf();Es();UT();xf=y({name:"ShikiCodeblocks",description:"Brings vscode-style codeblocks into Discord, powered by Shiki",authors:[p.Vap],patches:[{find:"codeBlock:{react(",replacement:{match:/codeBlock:\{react\((\i),(\i),(\i)\)\{/,replace:"$&return $self.renderHighlighter($1,$2,$3);"}}],start:async()=>{Xo.store.useDevIcon!=="DISABLED"&&St(Ls),await ve.init(Xo.store.customTheme||Xo.store.theme)},stop:()=>{ve.destroy(),FT()},settingsAboutComponent:({tempSettings:e})=>Ul({lang:"tsx",content:sT,isPreview:!0,tempSettings:e}),settings:Xo,shiki:ve,createHighlighter:Ul,renderHighlighter:({lang:e,content:t})=>Ul({lang:e,content:t,isPreview:!1})})});var wf,GT=g(()=>{"use strict";a();P();M();wf=y({name:"ShowAllMessageButtons",description:"Always show all message buttons no matter if you are holding the shift key or not.",authors:[p.Nuckyz],patches:[{find:".Messages.MESSAGE_UTILITIES_A11Y_LABEL",replacement:{match:/isExpanded:\i&&(.+?),/,replace:"isExpanded:$1,"}}]})});var HT=g(()=>{});function jT(){let e=Ni(zT.colors.INTERACTIVE_MUTED).hex(),t=Ni(zT.colors.INTERACTIVE_ACTIVE).hex();return o(EN,{color:e,forcedIconColor:t,size:16,tooltipText:Ct.Messages.CONNECTION_VERIFIED})}var zT,EN,WT=g(()=>{"use strict";a();Oe();j();I();zT=Lt(e=>e.colors?.INTERACTIVE_MUTED?.css),EN=me(()=>Bt(".CONNECTIONS_ROLE_OFFICIAL_ICON_TOOLTIP"))});function qT({id:e,theme:t}){let n=rn.getUserProfile(e);if(!n)return null;let r=n.connectedAccounts;return r?.length?o(DN,null,o(oe,{tag:"h2",variant:"eyebrow",style:{color:"var(--header-primary)"}},"Connections"),o(ye,{style:{marginTop:"8px",gap:FN($l.store.iconSpacing),flexWrap:"wrap"}},r.map(i=>o(GN,{connection:i,theme:t})))):null}function GN({connection:e,theme:t}){let n=_N.get(e.type),r=n.getPlatformUserUrl?.(e),i=o("img",{"aria-label":e.name,src:t==="light"?n.icon.lightSVG:n.icon.darkSVG,style:{width:$l.store.iconSize,height:$l.store.iconSize}}),s=r?Vr:gy;return o(V,{text:o("span",{className:"vc-sc-tooltip"},e.name,e.verified&&o(jT,null),o(s,{height:16,width:16})),key:e.id},l=>r?o("a",{...l,className:"vc-user-connection",href:r,target:"_blank",onClick:c=>{Vencord.Plugins.isPluginEnabled("OpenInApp")&&Vencord.Plugins.plugins.OpenInApp.handleLink(c.currentTarget,c)}},i):o("button",{...l,className:"vc-user-connection",onClick:()=>vn(e.name)},i))}var DN,ON,_N,BN,FN,$l,UN,$N,Mf,KT=g(()=>{"use strict";a();HT();$();le();Dt();Ht();P();Be();Oe();M();j();I();WT();DN=me(()=>Bt(".lastSection]:")),ON=Ie("ThemeStore"),_N=A("isSupported","getByUrl"),BN=to(',"--profile-gradient-primary-color"'),FN=e=>(e??0)*2+4,$l=D({iconSize:{type:1,description:"Icon size (px)",default:32},iconSpacing:{type:4,description:"Icon margin",default:1,options:[{label:"Compact",value:0},{label:"Cozy",value:1},{label:"Roomy",value:2}]}}),UN=_.wrap(({user:e,displayProfile:t})=>o(qT,{id:e.id,theme:BN(e,t).profileTheme})),$N=_.wrap(({id:e})=>o(qT,{id:e,theme:ON.theme}));Mf=y({name:"ShowConnections",description:"Show connected accounts in user popouts",authors:[p.TheKodeToad],patches:[{find:"{isUsingGuildBio:null!==(",replacement:{match:/,theme:\i\}\)(?=,.{0,150}setNote:)/,replace:"$&,$self.profilePopoutComponent({ user: arguments[0].user, displayProfile: arguments[0].displayProfile })"}},{find:'"Profile Panel: user cannot be undefined"',replacement:{match:/\(0,\i\.jsx\)\(\i\.\i,\{\}\).{0,100}setNote:(?=.+?channelId:(\i).id)/,replace:"$self.profilePanelComponent({ id: $1.recipients[0] }),$&"}}],settings:$l,profilePopoutComponent:UN,profilePanelComponent:$N})});var YT=g(()=>{});function QN({channel:e}){let[t,n]=J(Jo.store.defaultAllowedUsersAndRolesDropdownState),[r,i]=J([]),{type:s,topic:l,lastMessageId:c,defaultForumLayout:u,lastPinTimestamp:d,defaultAutoArchiveDuration:m,availableTags:h,id:v,rateLimitPerUser:T,defaultThreadRateLimitPerUser:w,defaultSortOrder:b,defaultReactionEmoji:x,bitrate:N,rtcRegion:k,videoQualityMode:F,permissionOverwrites:G,guild_id:K}=e;return _e(()=>{let q=[],z=we.getGuild(K).ownerId;Le.getMember(K,z)||q.push(z),Object.values(G).forEach(({type:R,id:X})=>{R===1&&!Le.getMember(K,X)&&q.push(X)}),q.length>0&&B.dispatch({type:"GUILD_MEMBERS_REQUEST",guildIds:[K],userIds:q}),L.plugins.PermissionsViewer.enabled&&i(ml(Object.values(G).map(R=>({type:R.type,id:R.id,overwriteAllow:R.allow,overwriteDeny:R.deny})),K))},[v]),o("div",{className:ZT.auto+" "+ZT.customTheme+" "+HN.chatContent+" shc-lock-screen-outer-container"},o("div",{className:"shc-lock-screen-container"},o("img",{className:"shc-lock-screen-logo",src:JN}),o("div",{className:"shc-lock-screen-heading-container"},o(oe,{variant:"heading-xxl/bold"},"This is a ",Re.can(Te.VIEW_CHANNEL,e)?"locked":"hidden"," ",KN[s]," channel."),e.isNSFW()&&o(V,{text:"NSFW"},({onMouseLeave:q,onMouseEnter:z})=>o("svg",{onMouseLeave:q,onMouseEnter:z,className:"shc-lock-screen-heading-nsfw-icon",width:"32",height:"32",viewBox:"0 0 48 48","aria-hidden":!0,role:"img"},o("path",{fill:"currentColor",d:"M.7 43.05 24 2.85l23.3 40.2Zm23.55-6.25q.75 0 1.275-.525.525-.525.525-1.275 0-.75-.525-1.3t-1.275-.55q-.8 0-1.325.55-.525.55-.525 1.3t.55 1.275q.55.525 1.3.525Zm-1.85-6.1h3.65V19.4H22.4Z"})))),!e.isGuildVoice()&&!e.isGuildStageVoice()&&o(oe,{variant:"text-lg/normal"},"You can not see the ",e.isForumChannel()?"posts":"messages"," of this channel.",e.isForumChannel()&&l&&l.length>0&&" However you may see its guidelines:"),e.isForumChannel()&&l&&l.length>0&&o("div",{className:"shc-lock-screen-topic-container"},$e.parseTopic(l,!1,{channelId:v})),c&&o(oe,{variant:"text-md/normal"},"Last ",e.isForumChannel()?"post":"message"," created:",o(Hn,{timestamp:hn(jn.extractTimestamp(c))})),d&&o(oe,{variant:"text-md/normal"},"Last message pin: ",o(Hn,{timestamp:hn(d)})),(T??0)>0&&o(oe,{variant:"text-md/normal"},"Slowmode: ",Qi(T,"seconds")),(w??0)>0&&o(oe,{variant:"text-md/normal"},"Default thread slowmode: ",Qi(w,"seconds")),(e.isGuildVoice()||e.isGuildStageVoice())&&N!=null&&o(oe,{variant:"text-md/normal"},"Bitrate: ",N," bits"),k!==void 0&&o(oe,{variant:"text-md/normal"},"Region: ",k??"Automatic"),(e.isGuildVoice()||e.isGuildStageVoice())&&o(oe,{variant:"text-md/normal"},"Video quality mode: ",XN[F??1]),(m??0)>0&&o(oe,{variant:"text-md/normal"},"Default inactivity duration before archiving ",e.isForumChannel()?"posts":"threads",":"," "+Qi(m,"minutes")),u!=null&&o(oe,{variant:"text-md/normal"},"Default layout: ",ZN[u]),b!=null&&o(oe,{variant:"text-md/normal"},"Default sort order: ",YN[b]),x!=null&&o("div",{className:"shc-lock-screen-default-emoji-container"},o(oe,{variant:"text-md/normal"},"Default reaction emoji:"),$e.defaultRules[x.emojiName?"emoji":"customEmoji"].react({name:x.emojiName?WN.convertSurrogateToName(x.emojiName):kn.getCustomEmojiById(x.emojiId)?.name??"",emojiId:x.emojiId??void 0,surrogate:x.emojiName??void 0,src:x.emojiName?qN.getURL(x.emojiName):void 0},void 0,{key:"0"})),e.hasFlag(16)&&o(oe,{variant:"text-md/normal"},"Posts on this forum require a tag to be set."),h&&h.length>0&&o("div",{className:"shc-lock-screen-tags-container"},o(oe,{variant:"text-lg/bold"},"Available tags:"),o("div",{className:"shc-lock-screen-tags"},h.map(q=>o(jN,{tag:q})))),o("div",{className:"shc-lock-screen-allowed-users-and-roles-container"},o("div",{className:"shc-lock-screen-allowed-users-and-roles-container-title"},L.plugins.PermissionsViewer.enabled&&o(V,{text:"Permission Details"},({onMouseLeave:q,onMouseEnter:z})=>o("button",{onMouseLeave:q,onMouseEnter:z,className:"shc-lock-screen-allowed-users-and-roles-container-permdetails-btn",onClick:()=>ui(r,we.getGuild(e.guild_id),e.name)},o("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},o("path",{fill:"currentColor",d:"M7 12.001C7 10.8964 6.10457 10.001 5 10.001C3.89543 10.001 3 10.8964 3 12.001C3 13.1055 3.89543 14.001 5 14.001C6.10457 14.001 7 13.1055 7 12.001ZM14 12.001C14 10.8964 13.1046 10.001 12 10.001C10.8954 10.001 10 10.8964 10 12.001C10 13.1055 10.8954 14.001 12 14.001C13.1046 14.001 14 13.1055 14 12.001ZM19 10.001C20.1046 10.001 21 10.8964 21 12.001C21 13.1055 20.1046 14.001 19 14.001C17.8954 14.001 17 13.1055 17 12.001C17 10.8964 17.8954 10.001 19 10.001Z"})))),o(oe,{variant:"text-lg/bold"},"Allowed users and roles:"),o(V,{text:t?"Hide Allowed Users and Roles":"View Allowed Users and Roles"},({onMouseLeave:q,onMouseEnter:z})=>o("button",{onMouseLeave:q,onMouseEnter:z,className:"shc-lock-screen-allowed-users-and-roles-container-toggle-btn",onClick:()=>n(R=>!R)},o("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:t?"scale(1 -1)":"scale(1 1)"},o("path",{fill:"currentColor",d:"M16.59 8.59003L12 13.17L7.41 8.59003L6 10L12 16L18 10L16.59 8.59003Z"}))))),t&&o(zN,{channel:e}))))}var ZT,HN,zN,jN,WN,qN,KN,YN,ZN,XN,JN,XT,JT=g(()=>{"use strict";a();$();le();Oe();lo();j();I();xs();Ts();Pf();ZT=A("auto","content","scrollerBase"),HN=A("chat","content","noChat","chatContent"),zN=me(()=>Bt(".Messages.ROLE_REQUIRED_SINGLE_USER_MESSAGE")),jN=me(()=>st(e=>{if(typeof e!="function")return!1;let t=Function.prototype.toString.call(e);return t.includes(".Messages.FORUM_TAG_A11Y_FILTER_BY_TAG")&&!t.includes("increasedActivityPill")})),WN=A("convertSurrogateToName"),qN=A("getURL","buildEmojiReactionColorsPlatformed"),KN={[0]:"text",[5]:"announcement",[15]:"forum",[2]:"voice",[13]:"stage"},YN={[0]:"Latest activity",[1]:"Creation date"},ZN={[0]:"Not set",[1]:"List view",[2]:"Gallery view"},XN={[1]:"Automatic",[2]:"720p"},JN="/assets/433e3ec4319a9d11b0cbe39342614982.svg";XT=_.wrap(QN)});var QT,Jo,If,Pf=g(()=>{"use strict";a();YT();$();le();P();cs();M();j();I();JT();QT=A("channelEmoji","unread","icon"),Jo=D({hideUnreads:{description:"Hide Unreads",type:3,default:!0,restartNeeded:!0},showMode:{description:"The mode used to display hidden channels.",type:4,options:[{label:"Plain style with Lock Icon instead",value:0,default:!0},{label:"Muted style with hidden eye icon on the right",value:1}],restartNeeded:!0},defaultAllowedUsersAndRolesDropdownState:{description:"Whether the allowed users and roles dropdown on hidden channels should be open by default",type:3,default:!0}}),If=y({name:"ShowHiddenChannels",description:"Show channels that you do not have access to view.",authors:[p.BigDuck,p.AverageReactEnjoyer,p.D3SOX,p.Ven,p.Nuckyz,p.Nickyux,p.dzshn],settings:Jo,patches:[{find:".CannotShow=",replacement:[{match:/if\(!\i\.\i\.can\(\i\.\i\.VIEW_CHANNEL.+?{if\(this\.id===\i\).+?threadIds:\i}}/,replace:""},{match:/(?=!1===\i.\i\.hasRelevantUnread\(this\.record\))/,replace:"$self.isHiddenChannel(this.record)||"},{match:/(?<=renderLevel:(\i\(this,\i\)\?\i\.Show:\i\.WouldShowIfUncollapsed).+?renderLevel:).+?(?=,)/,replace:(e,t)=>t},{match:/(?<=activeJoinedRelevantThreads.+?renderLevel:.+?,threadIds:\i\(this.record.+?renderLevel:)(\i)\..+?(?=,)/,replace:(e,t)=>`${t}.Show`},{match:/(?<=getRenderLevel\(\i\){.+?return)!\i\.\i\.can\(\i\.\i\.VIEW_CHANNEL,this\.record\)\|\|/,replace:" "}]},{find:"VoiceChannel, transitionTo: Channel does not have a guildId",replacement:[{match:/(?<=getCurrentClientVoiceChannelId\((\i)\.guild_id\);return)/,replace:(e,t)=>`!$self.isHiddenChannel(${t})&&`},{match:/(?=&&\i\.\i\.selectVoiceChannel\((\i)\.id\))/,replace:(e,t)=>`&&!$self.isHiddenChannel(${t})`},{match:/!__OVERLAY__&&\((?<=selectVoiceChannel\((\i)\.id\).+?)/,replace:(e,t)=>`${e}$self.isHiddenChannel(${t},true)||`}]},{find:".MAX_STAGE_VOICE_USER_LIMIT})",replacement:{match:/!(\i)\.isRoleSubscriptionTemplatePreviewChannel\(\)/,replace:(e,t)=>`${e}&&!$self.isHiddenChannel(${t})`}},{find:"ChannelItemEditButton:function(){",replacement:[...["renderEditButton","renderInviteButton"].map(e=>({match:new RegExp(`(?<=${e}\\(\\){)`,"g"),replace:"if($self.isHiddenChannel(this.props.channel))return null;"}))]},{find:"VoiceChannel.renderPopout: There must always be something to render",all:!0,replacement:{match:/(?<=renderOpenChatButton=\(\)=>{)/,replace:"if($self.isHiddenChannel(this.props.channel))return null;"}},{find:".Messages.CHANNEL_TOOLTIP_DIRECTORY",predicate:()=>Jo.store.showMode===0,replacement:{match:/(?=switch\((\i)\.type\).{0,30}\.GUILD_ANNOUNCEMENT.{0,70}\(0,\i\.\i\))/,replace:(e,t)=>`if($self.isHiddenChannel(${t}))return $self.LockIcon;`}},{find:".UNREAD_HIGHLIGHT",predicate:()=>Jo.store.showMode===1,replacement:[{match:/(?<={channel:(\i),name:\i,muted:(\i).+?;)/,replace:(e,t,n)=>`${n}=$self.isHiddenChannel(${t})?true:${n};`},{match:/\i\.children.+?:null(?<=,channel:(\i).+?)/,replace:(e,t)=>`${e},$self.isHiddenChannel(${t})?$self.HiddenChannelIcon():null`},{match:/(?<=\.wrapper:\i\.notInteractive,)(.+?)if\((\i)\)return (\i\.MUTED);/,replace:(e,t,n,r)=>`${n}?${r}:"",${t}if(${n})return "";`}]},{find:".UNREAD_HIGHLIGHT",replacement:[{predicate:()=>Jo.store.hideUnreads===!1&&Jo.store.showMode===1,match:/\.LOCKED;if\((?<={channel:(\i).+?)/,replace:(e,t)=>`${e}!$self.isHiddenChannel(${t})&&`},{predicate:()=>Jo.store.hideUnreads===!0,match:/(?<={channel:(\i),name:\i,.+?unread:(\i).+?;)/,replace:(e,t,n)=>`${n}=$self.isHiddenChannel(${t})?false:${n};`}]},{find:'.displayName="ChannelListUnreadsStore"',replacement:{match:/(?<=if\(null==(\i))(?=.{0,160}?hasRelevantUnread\(\i\))/g,replace:(e,t)=>`||$self.isHiddenChannel(${t})`}},{find:"renderBottomUnread(){",replacement:{match:/(?=&&\i\.\i\.hasRelevantUnread\((\i\.record)\))/,replace:"&&!$self.isHiddenChannel($1)"}},{find:".useFlattenedChannelIdListWithThreads)",replacement:{match:/(?=&&\i\.\i\.hasRelevantUnread\((\i)\))/,replace:"&&!$self.isHiddenChannel($1)"}},{find:"Missing channel in Channel.renderHeaderToolbar",replacement:[{match:/(?<=renderHeaderToolbar=\(\)=>{.+?case \i\.\i\.GUILD_TEXT:)(?=.+?(\i\.push.{0,50}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/,replace:(e,t,n,r)=>`if(!${r}&&$self.isHiddenChannel(${n})){${t};break;}`},{match:/(?<=renderHeaderToolbar=\(\)=>{.+?case \i\.\i\.GUILD_MEDIA:)(?=.+?(\i\.push.{0,40}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/,replace:(e,t,n,r)=>`if(!${r}&&$self.isHiddenChannel(${n})){${t};break;}`},{match:/renderMobileToolbar=\(\)=>{.+?case \i\.\i\.GUILD_DIRECTORY:(?<=let{channel:(\i).+?)/,replace:(e,t)=>`${e}if($self.isHiddenChannel(${t}))break;`},{match:/(?<=renderHeaderBar=\(\)=>{.+?hideSearch:(\i)\.isDirectory\(\))/,replace:(e,t)=>`||$self.isHiddenChannel(${t})`},{match:/(?<=renderSidebar\(\){)/,replace:"if($self.isHiddenChannel(this.props.channel))return null;"},{match:/(?<=renderChat\(\){)/,replace:"if($self.isHiddenChannel(this.props.channel))return $self.HiddenChannelLockScreen(this.props.channel);"}]},{find:'"MessageManager"',replacement:{match:/"Skipping fetch because channelId is a static route"\);return}(?=.+?getChannel\((\i)\))/,replace:(e,t)=>`${e}if($self.isHiddenChannel({channelId:${t}}))return;`}},{find:'"alt+shift+down"',replacement:{match:/(?<=getChannel\(\i\);return null!=(\i))(?=.{0,150}?hasRelevantUnread\(\i\))/,replace:(e,t)=>`&&!$self.isHiddenChannel(${t})`}},{find:".APPLICATION_STORE&&null!=",replacement:{match:/(?<=getState\(\)\.channelId.{0,30}?\(0,\i\.\i\)\(\i\))(?=\.map\()/,replace:".filter(e=>!$self.isHiddenChannel(e))"}},{find:".Messages.ROLE_REQUIRED_SINGLE_USER_MESSAGE",replacement:[{match:/ADMINISTRATOR\)\|\|(?<=context:(\i)}.+?)(?=(.+?)VIEW_CHANNEL)/,replace:(e,t,n)=>`${e}!Vencord.Webpack.Common.PermissionStore.can(${Te.CONNECT}n,${t})?${n}CONNECT):`},{match:/permissionOverwrites\[.+?\i=(?<=context:(\i)}.+?)(?=(.+?)VIEW_CHANNEL)/,replace:(e,t,n)=>`${e}!Vencord.Webpack.Common.PermissionStore.can(${Te.CONNECT}n,${t})?${n}CONNECT):`},{match:/sortBy.{0,30}?\.filter\(\i=>(?<=channel:(\i).+?)/,replace:(e,t)=>`${e}$self.isHiddenChannel(${t})?true:`},{match:/computePermissionsForRoles.+?.value\(\)(?<=channel:(\i).+?)/,replace:(e,t)=>`${e}.reduce(...$self.makeAllowedRolesReduce(${t}.guild_id))`},{match:/MANAGE_ROLES.{0,90}?return(?=\(.+?(\(0,\i\.jsxs\)\("div",{className:\i\.members.+?guildId:(\i)\.guild_id.+?roleColor.+?\]}\)))/,replace:(e,t,n)=>(t=t.replace(xr(/(?<=users:\i)/),`,shcChannel:${n}`),t=t.replace(xr(/1!==\i\.length/),"true"),`${e} $self.isHiddenChannel(${n},true)?${t}:`)}]},{find:".avatars),children",replacement:[{match:/maxUsers:\i,users:\i.+?=(\i).+?;/,replace:(e,t)=>`${e}let{shcChannel}=${t};`},{match:/\i>0(?=&&.{0,60}renderPopout)/,replace:e=>`($self.isHiddenChannel(shcChannel,true)?true:${e})`},{match:/(?<=\.value\(\),(\i)=.+?length-)1(?=\]=.{0,60}renderPopout)/,replace:(e,t)=>`($self.isHiddenChannel(shcChannel,true)&&${t}<=0?0:1)`},{match:/(?<="\+",)(\i)\+1/,replace:(e,t)=>`$self.isHiddenChannel(shcChannel,true)&&${t}<=0?"":${e}`}]},{find:".Messages.CHANNEL_CALL_CURRENT_SPEAKER.format",replacement:[{match:/"more-options-popout"\)\),(?<=let{channel:(\i).+?inCall:(\i).+?)/,replace:(e,t,n)=>`${e}${n}||!$self.isHiddenChannel(${t},true)&&`},{match:/"popup".{0,100}?if\((?<=let{channel:(\i).+?inCall:(\i).+?)/,replace:(e,t,n)=>`${e}(${n}||!$self.isHiddenChannel(${t},true))&&`}]},{find:".Messages.EMBEDDED_ACTIVITIES_DEVELOPER_ACTIVITY_SHELF_FETCH_ERROR",replacement:[{match:/renderContent\(\i\){.+?this\.renderVoiceChannelEffects.+?children:/,replace:"$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)?$self.HiddenChannelLockScreen(this.props.channel):"},{match:/renderContent\(\i\){.+?disableGradients:/,replace:"$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)||"},{match:/(?:{|,)render(?!Header|ExternalHeader).{0,30}?:/g,replace:"$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)?()=>null:"},{match:/callContainer,(?<=\i\.callContainer,)/,replace:'$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)?"":'}]},{find:'"HasBeenInStageChannel"',replacement:[{match:/"124px".+?children:(?<=let \i,{channel:(\i).+?)(?=.{0,20}?}\)}function)/,replace:(e,t)=>`${e}$self.isHiddenChannel(${t})?$self.HiddenChannelLockScreen(${t}):`},{match:/render(?:BottomLeft|BottomCenter|BottomRight|ChatToasts):\(\)=>(?<=let \i,{channel:(\i).+?)/g,replace:(e,t)=>`${e}$self.isHiddenChannel(${t})?null:`},{match:/"124px".+?disableGradients:(?<=let \i,{channel:(\i).+?)/,replace:(e,t)=>`${e}$self.isHiddenChannel(${t})||`},{match:/"124px".+?style:(?<=let \i,{channel:(\i).+?)/,replace:(e,t)=>`${e}$self.isHiddenChannel(${t})?void 0:`}]},{find:".Messages.STAGE_FULL_MODERATOR_TITLE",replacement:[{match:/\(0,\i\.jsx\)\(\i\.\i\.Divider.+?}\)]}\)(?=.+?:(\i)\.guild_id)/,replace:(e,t)=>`$self.isHiddenChannel(${t})?null:(${e})`},{match:/"recents".+?&&(?=\(.+?channelId:(\i)\.id,showRequestToSpeakSidebar)/,replace:(e,t)=>`${e}!$self.isHiddenChannel(${t})&&`}]},{find:",queryStaticRouteChannels(",replacement:[{match:/(?<=queryChannels\(\i\){.+?getChannels\(\i)(?=\))/,replace:",true"},{match:/(?<=queryChannels\(\i\){.+?isGuildChannelType\)\((\i)\.type\))(?=&&!\i\.\i\.can\()/,replace:"&&!$self.isHiddenChannel($1)"}]},{find:'"^/guild-stages/(\\\\d+)(?:/)?(\\\\d+)?"',replacement:{match:/\i\.\i\.can\(\i\.\i\.VIEW_CHANNEL,\i\)/,replace:"true"}},{find:".shouldCloseDefaultModals",replacement:{match:/(?<=getChannel\(\i\);if\(null!=(\i))(?=.{0,100}?selectVoiceChannel)/,replace:(e,t)=>`&&!$self.isHiddenChannel(${t})`}},{find:'.displayName="GuildChannelStore"',replacement:[{match:/isChannelGated\(.+?\)(?=&&)/,replace:e=>`${e}&&false`},{match:/(?<=getChannels\(\i)(\){.+?)return (.+?)}/,replace:(e,t,n)=>`,shouldIncludeHidden${t}return $self.resolveGuildChannels(${n},shouldIncludeHidden??false);}`}]},{find:".Messages.FORM_LABEL_MUTED",replacement:{match:/(?<=getChannels\(\i)(?=\))/,replace:",true"}},{find:'.displayName="NowPlayingViewStore"',replacement:{match:/(getVoiceStateForUser.{0,150}?)&&\i\.\i\.canWithPartialContext.{0,20}VIEW_CHANNEL.+?}\)(?=\?)/,replace:"$1"}}],isHiddenChannel(e,t=!1){return!e||(e.channelId&&(e=Q.getChannel(e.channelId)),!e||e.isDM()||e.isGroupDM()||e.isMultiUserDM())?!1:!Re.can(Te.VIEW_CHANNEL,e)||t&&!Re.can(Te.CONNECT,e)},resolveGuildChannels(e,t){if(t)return e;let n={};for(let[r,i]of Object.entries(e)){if(!Array.isArray(i)){n[r]=i;continue}n[r]??=[];for(let s of i)(s.channel.id===null||!this.isHiddenChannel(s.channel))&&n[r].push(s)}return n},makeAllowedRolesReduce(e){return[(t,n,r,i)=>{if(r!==0)return t;let s=i.find(l=>l.id===e);return s?[s]:i},[]]},HiddenChannelLockScreen:e=>o(XT,{channel:e}),LockIcon:_.wrap(()=>o("svg",{className:QT.icon,height:"18",width:"20",viewBox:"0 0 24 24","aria-hidden":!0,role:"img"},o("path",{className:"shc-evenodd-fill-current-color",d:"M17 11V7C17 4.243 14.756 2 12 2C9.242 2 7 4.243 7 7V11C5.897 11 5 11.896 5 13V20C5 21.103 5.897 22 7 22H17C18.103 22 19 21.103 19 20V13C19 11.896 18.103 11 17 11ZM12 18C11.172 18 10.5 17.328 10.5 16.5C10.5 15.672 11.172 15 12 15C12.828 15 13.5 15.672 13.5 16.5C13.5 17.328 12.828 18 12 18ZM15 11H9V7C9 5.346 10.346 4 12 4C13.654 4 15 5.346 15 7V11Z"})),{noop:!0}),HiddenChannelIcon:_.wrap(()=>o(V,{text:"Hidden Channel"},({onMouseLeave:e,onMouseEnter:t})=>o("svg",{onMouseLeave:e,onMouseEnter:t,className:QT.icon+" shc-hidden-channel-icon",width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":!0,role:"img"},o("path",{className:"shc-evenodd-fill-current-color",d:"m19.8 22.6-4.2-4.15q-.875.275-1.762.413Q12.95 19 12 19q-3.775 0-6.725-2.087Q2.325 14.825 1 11.5q.525-1.325 1.325-2.463Q3.125 7.9 4.15 7L1.4 4.2l1.4-1.4 18.4 18.4ZM12 16q.275 0 .512-.025.238-.025.513-.1l-5.4-5.4q-.075.275-.1.513-.025.237-.025.512 0 1.875 1.312 3.188Q10.125 16 12 16Zm7.3.45-3.175-3.15q.175-.425.275-.862.1-.438.1-.938 0-1.875-1.312-3.188Q13.875 7 12 7q-.5 0-.938.1-.437.1-.862.3L7.65 4.85q1.025-.425 2.1-.638Q10.825 4 12 4q3.775 0 6.725 2.087Q21.675 8.175 23 11.5q-.575 1.475-1.512 2.738Q20.55 15.5 19.3 16.45Zm-4.625-4.6-3-3q.7-.125 1.288.112.587.238 1.012.688.425.45.613 1.038.187.587.087 1.162Z"}))),{noop:!0})})});var VT=g(()=>{});var Os,Af,ex=g(()=>{"use strict";a();VT();$();P();M();Os=D({mode:{type:4,description:"How to display usernames and nicks",options:[{label:"Username then nickname",value:"user-nick",default:!0},{label:"Nickname then username",value:"nick-user"},{label:"Username only",value:"user"}]},displayNames:{type:3,description:"Use display names in place of usernames",default:!1},inReplies:{type:3,default:!1,description:"Also apply functionality to reply previews"}}),Af=y({name:"ShowMeYourName",description:"Display usernames next to nicks, or no nicks at all",authors:[p.Rini,p.TheKodeToad],patches:[{find:".useCanSeeRemixBadge)",replacement:{match:/(?<=onContextMenu:\i,children:).*?\}/,replace:"$self.renderUsername(arguments[0])}"}}],settings:Os,renderUsername:({author:e,message:t,isRepliedMessage:n,withMentionPrefix:r,userOverride:i})=>{try{let s=i??t.author,{username:l}=s;Os.store.displayNames&&(l=s.globalName||l);let{nick:c}=e,u=r?"@":"";return l===c||n&&!Os.store.inReplies?u+c:Os.store.mode==="user-nick"?o(f,null,u,l," ",o("span",{className:"vc-smyn-suffix"},c)):Os.store.mode==="nick-user"?o(f,null,u,c," ",o("span",{className:"vc-smyn-suffix"},l)):u+l}catch{return e?.nick}}})});var Nf,tx=g(()=>{"use strict";a();P();M();Nf=y({name:"ShowTimeouts",description:"Display member timeout icons in chat regardless of permissions.",authors:[p.Dolfies],patches:[{find:"showCommunicationDisabledStyles",replacement:{match:/&&\i\.\i\.canManageUser\(\i\.\i\.MODERATE_MEMBERS,\i\.author,\i\)/,replace:""}}]})});function VN(e){let[t,n]=O.useState(Cf);function r(i){kf.store.persistState&&(Cf=i),n(i)}return O.useEffect(()=>{let i=(s,l)=>{t&&(kf.store.autoDisable&&r(!1),l.content.startsWith("@silent ")||(l.content="@silent "+l.content))};return jt(i),()=>void Wt(i)},[t]),e.type.analyticsName!=="normal"?null:o(V,{text:t?"Disable Silent Message":"Enable Silent Message"},i=>o("div",{style:{display:"flex"}},o(E,{...i,onClick:()=>r(!t),size:"",look:Xt.BLANK,innerClassName:vt.button,style:{padding:"0 6px"}},o("div",{className:vt.buttonWrapper},o("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},o("g",{fill:"currentColor"},o("path",{d:"M18 10.7101C15.1085 9.84957 13 7.17102 13 4C13 3.69264 13.0198 3.3899 13.0582 3.093C12.7147 3.03189 12.3611 3 12 3C8.686 3 6 5.686 6 9V14C6 15.657 4.656 17 3 17V18H21V17C19.344 17 18 15.657 18 14V10.7101ZM8.55493 19C9.24793 20.19 10.5239 21 11.9999 21C13.4759 21 14.7519 20.19 15.4449 19H8.55493Z"}),o("path",{d:"M18.2624 5.50209L21 2.5V1H16.0349V2.49791H18.476L16 5.61088V7H21V5.50209H18.2624Z"}),!t&&o("line",{x1:"22",y1:"2",x2:"2",y2:"22",stroke:"var(--red-500)","stroke-width":"2.5"})))))))}var Cf,kf,Rf,nx=g(()=>{"use strict";a();Xn();$();le();P();M();I();Cf=!1,kf=D({persistState:{type:3,description:"Whether to persist the state of the silent message toggle when changing channels",default:!1,onChange(e){e===!1&&(Cf=!1)}},autoDisable:{type:3,description:"Automatically disable the silent message toggle again after sending one",default:!0}});Rf=y({name:"SilentMessageToggle",authors:[p.Nuckyz,p.CatNoir],description:"Adds a button to the chat bar to toggle sending a silent message.",dependencies:["MessageEventsAPI"],settings:kf,patches:[{find:"ChannelTextAreaButtons",replacement:{match:/(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/,replace:"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()"}}],chatBarIcon:_.wrap(VN,{noop:!0})})});function eC(e){let{isEnabled:t}=To.use(["isEnabled"]),n=()=>To.store.isEnabled=!To.store.isEnabled;return e.type.analyticsName!=="normal"?null:o(V,{text:t?"Disable Silent Typing":"Enable Silent Typing"},r=>o("div",{style:{display:"flex"}},o(E,{...r,onClick:n,size:"",look:Xt.BLANK,innerClassName:vt.button,style:{padding:"0 6px"}},o("div",{className:vt.buttonWrapper},o("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},o("path",{fill:"currentColor",d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}),t&&o("path",{d:"M13 432L590 48",stroke:"var(--red-500)","stroke-width":"72","stroke-linecap":"round"}))))))}var To,Lf,ox=g(()=>{"use strict";a();tn();$();le();P();M();I();To=D({showIcon:{type:3,default:!1,description:"Show an icon for toggling the plugin",restartNeeded:!0},isEnabled:{type:3,description:"Toggle functionality",default:!0}});Lf=y({name:"SilentTyping",authors:[p.Ven,p.Rini],description:"Hide that you are typing",patches:[{find:'.dispatch({type:"TYPING_START_LOCAL"',replacement:{match:/startTyping\(\i\){.+?},stop/,replace:"startTyping:$self.startTyping,stop"}},{find:"ChannelTextAreaButtons",predicate:()=>To.store.showIcon,replacement:{match:/(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/,replace:"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()"}}],dependencies:["CommandsAPI"],settings:To,commands:[{name:"silenttype",description:"Toggle whether you're hiding that you're typing or not.",inputType:0,options:[{name:"value",description:"whether to hide or not that you're typing (default is toggle)",required:!1,type:5}],execute:async(e,t)=>{To.store.isEnabled=!!rt(e,"value",!To.store.isEnabled),pe(t.channel.id,{content:To.store.isEnabled?"Silent typing enabled!":"Silent typing disabled!"})}}],async startTyping(e){To.store.isEnabled||B.dispatch({type:"TYPING_START_LOCAL",channelId:e})},chatBarIcon:_.wrap(eC,{noop:!0})})});var Ef,rx=g(()=>{"use strict";a();Dt();P();M();I();ix();Ef=y({name:"SortFriendRequests",authors:[p.Megu],description:"Sorts friend requests by date of receipt",patches:[{find:"getRelationshipCounts(){",replacement:{match:/\.sortBy\(\i=>\i\.comparator\)/,replace:".sortBy((row) => $self.sortList(row))"}},{find:"RelationshipTypes.PENDING_INCOMING?",replacement:{predicate:()=>L.plugins.SortFriendRequests.showDates,match:/(user:(\i),.{10,50}),subText:(\i),(className:\i\.userInfo}\))/,replace:(e,t,n,r,i)=>`${t}, subText: $self.makeSubtext(${r}, ${n}), - ${i}`}}],sortList(e){return e.type===3||e.type===4?-this.getSince(e.user):e.comparator},getSince(e){return new Date(nt.getSince(e.id))},makeSubtext(e,t){let n=this.getSince(t);return o(ge,{flexDirection:"row",style:{gap:0,flexWrap:"wrap",lineHeight:"0.9rem"}},o("span",null,e),!isNaN(n.getTime())&&o("span",null,"Received \u2014 ",n.toDateString()))},options:{showDates:{type:3,description:"Show dates on friend requests",default:!1,restartNeeded:!0}}})});var fx,gx=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/spotifyControls/hoverOnly.css",{name:"src/plugins/spotifyControls/hoverOnly.css",source:`.vc-spotify-button-row { + ${i}`}}],sortList(e){return e.type===3||e.type===4?-this.getSince(e.user):e.comparator},getSince(e){return new Date(nt.getSince(e.id))},makeSubtext(e,t){let n=this.getSince(t);return o(ye,{flexDirection:"row",style:{gap:0,flexWrap:"wrap",lineHeight:"0.9rem"}},o("span",null,e),!isNaN(n.getTime())&&o("span",null,"Received \u2014 ",n.toDateString()))},options:{showDates:{type:3,description:"Show dates on friend requests",default:!1,restartNeeded:!0}}})});var sx,ax=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/spotifyControls/hoverOnly.css",{name:"src/plugins/spotifyControls/hoverOnly.css",source:`.vc-spotify-button-row { height: 0; opacity: 0; pointer-events: none; @@ -175,17 +168,17 @@ export const Example: React.FC<{ /* only transition opacity on show to prevent clipping */ transition-property: height, opacity; } -`,classNames:{},dom:null});fx="src/plugins/spotifyControls/hoverOnly.css"});var hx=g(()=>{});var $e,yx=g(()=>{"use strict";a();$();wn();j();A();$e=yt(()=>{let{Store:e}=pc,t=I("getActiveSocketAndDevice"),n=I("SpotifyAPI"),r="https://api.spotify.com/v1/me/player";class i extends e{mPosition=0;start=0;track=null;device=null;isPlaying=!1;repeat="off";shuffle=!1;volume=0;isSettingPosition=!1;openExternal(c){let u=E.plugins.SpotifyControls.useSpotifyUris||Vencord.Plugins.isPluginEnabled("OpenInApp")?"spotify:"+c.replaceAll("/",(p,m)=>m===0?"":":"):"https://open.spotify.com"+c;VencordNative.native.openExternal(u)}get position(){let c=this.mPosition;return this.isPlaying&&(c+=Date.now()-this.start),c}set position(c){this.mPosition=c,this.start=Date.now()}prev(){this.req("post","/previous")}next(){this.req("post","/next")}setVolume(c){this.req("put","/volume",{query:{volume_percent:Math.round(c)}}).then(()=>{this.volume=c,this.emitChange()})}setPlaying(c){this.req("put",c?"/play":"/pause")}setRepeat(c){this.req("put","/repeat",{query:{state:c}})}setShuffle(c){this.req("put","/shuffle",{query:{state:c}}).then(()=>{this.shuffle=c,this.emitChange()})}seek(c){return this.isSettingPosition?Promise.resolve():(this.isSettingPosition=!0,this.req("put","/seek",{query:{position_ms:Math.round(c)}}).catch(u=>{console.error("[VencordSpotifyControls] Failed to seek",u),this.isSettingPosition=!1}))}req(c,u,p={}){this.device?.is_active&&((p.query??={}).device_id=this.device.id);let{socket:m}=t.getActiveSocketAndDevice();return n.SpotifyAPI[c](m.accountId,m.accessToken,{url:r+u,...p})}}let s=new i(F,{SPOTIFY_PLAYER_STATE(l){s.track=l.track,s.device=l.device??null,s.isPlaying=l.isPlaying??!1,s.volume=l.volumePercent??0,s.repeat=l.actual_repeat||"off",s.position=l.position??0,s.isSettingPosition=!1,s.emitChange()},SPOTIFY_SET_DEVICES({devices:l}){s.device=l.find(c=>c.is_active)??l[0]??null,s.emitChange()}});return s})});function Of(e){let t=e/1e3/60,n=Math.floor(t),r=Math.floor((t-n)*60);return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}function vi(e,t){return()=>o("svg",{className:oe(qe("button-icon"),qe(t)),height:"24",width:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-label":t,focusable:!1},o("path",{d:e}))}function Bs(e){return o("button",{className:qe("button"),...e},e.children)}function xC({name:e,path:t}){let n=`spotify-copy-${e}`,r=`spotify-open-${e}`;return o(G.Menu,{navId:`spotify-${e}-menu`,onClose:()=>F.dispatch({type:"CONTEXT_MENU_CLOSE"}),"aria-label":`Spotify ${e} Menu`},o(G.MenuItem,{key:n,id:n,label:`Copy ${e} Link`,action:()=>gn("https://open.spotify.com"+t),icon:Jr}),o(G.MenuItem,{key:r,id:r,label:`Open ${e} in Spotify`,action:()=>$e.openExternal(t),icon:Xi}))}function wC(e,t){return n=>dn.openContextMenu(n,()=>o(xC,{name:e,path:t}))}function MC(){let[e,t,n]=He([$e],()=>[$e.isPlaying,$e.shuffle,$e.repeat]),[r,i]=(()=>{switch(n){case"off":return["context","repeat-off"];case"context":return["track","repeat-context"];case"track":return["off","repeat-track"];default:throw new Error(`Invalid repeat state ${n}`)}})();return o(ge,{className:qe("button-row"),style:{gap:0}},o(Bs,{className:oe(qe("button"),qe(t?"shuffle-on":"shuffle-off")),onClick:()=>$e.setShuffle(!t)},o(TC,null)),o(Bs,{onClick:()=>$e.prev()},o(vC,null)),o(Bs,{onClick:()=>$e.setPlaying(!e)},e?o(yC,null):o(hC,null)),o(Bs,{onClick:()=>$e.next()},o(SC,null)),o(Bs,{className:oe(qe("button"),qe(i)),onClick:()=>$e.setRepeat(r),style:{position:"relative"}},n==="track"&&o("span",{className:qe("repeat-1")},"1"),o(bC,null)))}function IC(){let{duration:e}=$e.track,[t,n,r]=He([$e],()=>[$e.mPosition,$e.isSettingPosition,$e.isPlaying]),[i,s]=J(t);return De(()=>{if(r&&!n){s($e.position);let l=setInterval(()=>{s(c=>c+1e3)},1e3);return()=>clearInterval(l)}},[t,n,r]),o("div",{id:qe("progress-bar")},o(S.FormText,{variant:"text-xs/medium",className:qe("progress-time")+" "+qe("time-left"),"aria-label":"Progress"},Of(i)),o(G.MenuSliderControl,{minValue:0,maxValue:e,value:i,onChange:l=>{n||(s(l),PC(l))},renderValue:Of}),o(S.FormText,{variant:"text-xs/medium",className:qe("progress-time")+" "+qe("time-right"),"aria-label":"Total Duration"},Of(e)))}function AC({track:e}){let t=He([$e],()=>$e.volume);return o(G.Menu,{navId:"spotify-album-menu",onClose:()=>F.dispatch({type:"CONTEXT_MENU_CLOSE"}),"aria-label":"Spotify Album Menu"},o(G.MenuItem,{key:"open-album",id:"open-album",label:"Open Album",action:()=>$e.openExternal(`/album/${e.album.id}`),icon:Xi}),o(G.MenuItem,{key:"view-cover",id:"view-cover",label:"View Album Cover",action:()=>On(e.album.image.url),icon:vr}),o(G.MenuControlItem,{id:"spotify-volume",key:"spotify-volume",label:"Volume",control:(n,r)=>o(G.MenuSliderControl,{...n,ref:r,value:t,minValue:0,maxValue:100,onChange:yn(i=>$e.setVolume(i))})}))}function _f(e,t,n){return t?{role:"link",onClick:()=>$e.openExternal(n),onContextMenu:wC(e,n)}:{}}function NC({track:e}){let t=e?.album?.image,[n,r]=J(!1),i=o(f,null,t&&o("img",{id:qe("album-image"),src:t.url,alt:"Album Image",onClick:()=>r(!n),onContextMenu:s=>{dn.openContextMenu(s,()=>o(AC,{track:e}))}}));return n&&t?o("div",{id:qe("album-expanded-wrapper")},i):o("div",{id:qe("info-wrapper")},i,o("div",{id:qe("titles")},o(S.FormText,{variant:"text-sm/semibold",id:qe("song-title"),className:qe("ellipoverflow"),title:e.name,..._f("Song",e.id,`/track/${e.id}`)},e.name),e.artists.some(s=>s.name)&&o(S.FormText,{variant:"text-sm/normal",className:qe("ellipoverflow")},"by\xA0",e.artists.map((s,l)=>o(O.Fragment,{key:s.name},o("span",{className:qe("artist"),style:{fontSize:"inherit"},title:s.name,..._f("Artist",s.id,`/artist/${s.id}`)},s.name),l!==e.artists.length-1&&o("span",{className:qe("comma")},", ")))),e.album.name&&o(S.FormText,{variant:"text-sm/normal",className:qe("ellipoverflow")},"on\xA0",o("span",{id:qe("album-title"),className:qe("album"),style:{fontSize:"inherit"},title:e.album.name,..._f("Album",e.album.id,`/album/${e.album.id}`)},e.album.name))))}function vx(){let e=He([$e],()=>$e.track,null,(s,l)=>s?.id?s.id===l?.id:s?.name===l?.name),t=He([$e],()=>$e.device,null,(s,l)=>s?.id===l?.id),n=He([$e],()=>$e.isPlaying),[r,i]=J(!1);return O.useEffect(()=>{if(i(!1),!n){let s=setTimeout(()=>i(!0),3e5);return()=>clearTimeout(s)}},[n]),!e||!t?.is_active||r?null:o(_,{fallback:()=>o("div",{className:"vc-spotify-fallback"},o("p",null,"Failed to render Spotify Modal :("),o("p",null,"Check the console for errors"))},o("div",{id:qe("player")},o(NC,{track:e}),o(IC,null),o(MC,null)))}var qe,hC,yC,vC,SC,bC,TC,PC,Sx=g(()=>{"use strict";a();hx();le();Lt();$t();zr();bt();Re();A();yx();qe=e=>`vc-spotify-${e}`;hC=vi("M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18c.62-.39.62-1.29 0-1.69L9.54 5.98C8.87 5.55 8 6.03 8 6.82z","play"),yC=vi("M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z","pause"),vC=vi("M7 6c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1s-1-.45-1-1V7c0-.55.45-1 1-1zm3.66 6.82l5.77 4.07c.66.47 1.58-.01 1.58-.82V7.93c0-.81-.91-1.28-1.58-.82l-5.77 4.07c-.57.4-.57 1.24 0 1.64z","previous"),SC=vi("M7.58 16.89l5.77-4.07c.56-.4.56-1.24 0-1.63L7.58 7.11C6.91 6.65 6 7.12 6 7.93v8.14c0 .81.91 1.28 1.58.82zM16 7v10c0 .55.45 1 1 1s1-.45 1-1V7c0-.55-.45-1-1-1s-1 .45-1 1z","next"),bC=vi("M7 7h10v1.79c0 .45.54.67.85.35l2.79-2.79c.2-.2.2-.51 0-.71l-2.79-2.79c-.31-.31-.85-.09-.85.36V5H6c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1V7zm10 10H7v-1.79c0-.45-.54-.67-.85-.35l-2.79 2.79c-.2.2-.2.51 0 .71l2.79 2.79c.31.31.85.09.85-.36V19h11c.55 0 1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1v3z","repeat"),TC=vi("M10.59 9.17L6.12 4.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41l4.46 4.46 1.42-1.4zm4.76-4.32l1.19 1.19L4.7 17.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L17.96 7.46l1.19 1.19c.31.31.85.09.85-.36V4.5c0-.28-.22-.5-.5-.5h-3.79c-.45 0-.67.54-.36.85zm-.52 8.56l-1.41 1.41 3.13 3.13-1.2 1.2c-.31.31-.09.85.36.85h3.79c.28 0 .5-.22.5-.5v-3.79c0-.45-.54-.67-.85-.35l-1.19 1.19-3.13-3.14z","shuffle");PC=yn(e=>{$e.seek(e)})});function bx(e){(e?St:Ft)(fx)}var Bf,Tx=g(()=>{"use strict";a();$();Je();P();w();gx();Sx();Bf=y({name:"SpotifyControls",description:"Adds a Spotify player above the account panel",authors:[d.Ven,d.afn,d.KraXen72],options:{hoverControls:{description:"Show controls on hover",type:3,default:!1,onChange:e=>bx(e)},useSpotifyUris:{type:3,description:"Open Spotify URIs instead of Spotify URLs. Will only work if you have Spotify installed and might not work on all platforms",default:!1}},patches:[{find:"showTaglessAccountPanel:",replacement:{match:/return ?(.{0,30}\(.{1,3},\{[^}]+?,showTaglessAccountPanel:.+?\}\))/,replace:"return [$self.renderPlayer(),$1]"}},{find:".PLAYER_DEVICES",replacement:{match:/get:(\i)\.bind\(null,(\i\.\i)\.get\)/,replace:"post:$1.bind(null,$2.post),$&"}},{find:'repeat:"off"!==',replacement:{match:/repeat:"off"!==(.{1,3}),/,replace:"actual_repeat:$1,$&"}}],start:()=>bx(E.plugins.SpotifyControls.hoverControls),renderPlayer:()=>o(vx,null)})});var Ff,Uf,xx=g(()=>{"use strict";a();$();P();w();Ff=D({noSpotifyAutoPause:{description:"Disable Spotify auto-pause",type:3,default:!0,restartNeeded:!0},keepSpotifyActivityOnIdle:{description:"Keep Spotify activity playing when idling",type:3,default:!1,restartNeeded:!0}}),Uf=y({name:"SpotifyCrack",description:"Free listen along, no auto-pausing in voice chat, and allows activity to continue playing when idling",authors:[d.Cyn,d.Nuckyz],settings:Ff,patches:[{find:'dispatch({type:"SPOTIFY_PROFILE_UPDATE"',replacement:{match:/SPOTIFY_PROFILE_UPDATE.+?isPremium:(?="premium"===(\i)\.body\.product)/,replace:(e,t)=>`${e}(${t}.body.product="premium")&&`}},{find:'.displayName="SpotifyStore"',replacement:[{predicate:()=>Ff.store.noSpotifyAutoPause,match:/(?<=function \i\(\){)(?=.{0,200}SPOTIFY_AUTO_PAUSED\))/,replace:"return;"},{predicate:()=>Ff.store.keepSpotifyActivityOnIdle,match:/(?<=shouldShowActivity\(\){.{0,50})&&!\i\.\i\.isIdle\(\)/,replace:""}]}]})});function Gf(e,t){t={invalidEmojis:[],tts:!1,validNonShortcutEmojis:[],...t};let n=CC.getPendingReply(e);wx.sendMessage(e,t,void 0,wx.getSendMessageOptionsForReply(n)).then(()=>{n&&F.dispatch({type:"DELETE_PENDING_REPLY",channelId:e})})}var $f,wx,CC,Hf,Mx=g(()=>{"use strict";a();Qt();P();w();j();A();$f=I("getPlayerState"),wx=I("getSendMessageOptionsForReply","sendMessage"),CC=I("getPendingReply");Hf=y({name:"SpotifyShareCommands",description:"Share your current Spotify track, album or artist via slash command (/track, /album, /artist)",authors:[d.katlyn],dependencies:["CommandsAPI"],commands:[{name:"track",description:"Send your current Spotify track to chat",inputType:0,options:[],execute:(e,t)=>{let n=$f.getTrack();if(n===null){ue(t.channel.id,{content:"You're not listening to any music."});return}Gf(t.channel.id,{content:`https://open.spotify.com/track/${n.id}`})}},{name:"album",description:"Send your current Spotify album to chat",inputType:0,options:[],execute:(e,t)=>{let n=$f.getTrack();if(n===null){ue(t.channel.id,{content:"You're not listening to any music."});return}Gf(t.channel.id,{content:`https://open.spotify.com/album/${n.album.id}`})}},{name:"artist",description:"Send your current Spotify artist to chat",inputType:0,options:[],execute:(e,t)=>{let n=$f.getTrack();if(n===null){ue(t.channel.id,{content:"You're not listening to any music."});return}Gf(t.channel.id,{content:n.artists[0].external_urls.spotify})}}]})});var Px={};Be(Px,{default:()=>DC});function kC({emoji:e,prefix:t,log:n,delta:r,instance:i}){return o(O.Fragment,null,o("span",null,i.sinceStart.toFixed(3),"s"),o("span",null,i.sinceLast.toFixed(3),"s"),o("span",null,r?.toFixed(0)??""),o("span",null,o("pre",null,e," ",t??" ",n)))}function RC({title:e,logs:t,traceEnd:n}){let r=t.find(l=>l.timestamp)?.timestamp??0,i=r,s=t.map(l=>{let c=l.timestamp??i,u=(c-r)/1e3,p=(c-i)/1e3;return i=c,{sinceStart:u,sinceLast:p}});return o(S.FormSection,{title:e,tag:"h1"},o("code",null,n&&o("div",{style:{color:"var(--header-primary)",marginBottom:5,userSelect:"text"}},"Trace ended at: ",new Date(n).toTimeString()),o("div",{style:{color:"var(--header-primary)",display:"grid",gridTemplateColumns:"repeat(3, auto) 1fr",gap:"2px 10px",userSelect:"text"}},o("span",null,"Start"),o("span",null,"Interval"),o("span",null,"Delta"),o("span",{style:{marginBottom:5}},"Event"),Fs.logs.map((l,c)=>o(kC,{key:c,...l,instance:s[c]})))))}function LC({trace:e}){let t=e.split(` -`);return o(S.FormSection,{title:"Server Trace",tag:"h2"},o("code",null,o(ge,{flexDirection:"column",style:{color:"var(--header-primary)",gap:5,userSelect:"text"}},t.map(n=>o("span",null,n)))))}function EC(){if(!Fs?.logs)return o("div",null,"Loading...");let e=Fs.logGroups.find(t=>t.serverTrace)?.serverTrace;return o(O.Fragment,null,o(RC,{title:"Startup Timings",logs:Fs.logs,traceEnd:Fs.endTime_}),o("div",{style:{marginTop:5}},"\xA0"),e&&o(LC,{trace:e}))}var Fs,DC,Ix=g(()=>{"use strict";a();le();Lt();j();A();Fs=I("markWithDelta","markAndLog","markAt");DC=_.wrap(EC)});var zf,Ax=g(()=>{"use strict";a();P();Qe();w();zf=y({name:"StartupTimings",description:"Adds Startup Timings to the Settings menu",authors:[d.Megu],patches:[{find:"UserSettingsSections.PAYMENT_FLOW_MODAL_TEST_PAGE,",replacement:{match:/{section:\i\.UserSettingsSections\.PAYMENT_FLOW_MODAL_TEST_PAGE/,replace:'{section:"StartupTimings",label:"Startup Timings",element:$self.StartupTimingPage},$&'}}],StartupTimingPage:tt(()=>(Ix(),To(Px)).default)})});var jf,Wf,Nx=g(()=>{"use strict";a();$();P();w();jf=D({superReactByDefault:{type:3,description:"Reaction picker will default to Super Reactions",default:!0},unlimitedSuperReactionPlaying:{type:3,description:"Remove the limit on Super Reactions playing at once",default:!1},superReactionPlayingLimit:{description:"Max Super Reactions to play at once",type:5,default:20,markers:[5,10,20,40,60,80,100],stickToMarkers:!0}},{superReactionPlayingLimit:{disabled(){return this.store.unlimitedSuperReactionPlaying}}}),Wf=y({name:"SuperReactionTweaks",description:"Customize the limit of Super Reactions playing at once, and super react by default",authors:[d.FieryFlames,d.ant0n],patches:[{find:",BURST_REACTION_EFFECT_PLAY",replacement:{match:/(?<=BURST_REACTION_EFFECT_PLAY:\i=>{.{50,100})(\i\(\i,\i\))>=\d+/,replace:"!$self.shouldPlayBurstReaction($1)"}},{find:".hasAvailableBurstCurrency)",replacement:{match:/(?<=\.useBurstReactionsExperiment.{0,20})useState\(!1\)(?=.+?(\i===\i\.EmojiIntention.REACTION))/,replace:"useState($self.settings.store.superReactByDefault && $1)"}}],settings:jf,shouldPlayBurstReaction(e){return!!(jf.store.unlimitedSuperReactionPlaying||e<=jf.store.superReactionPlayingLimit)}})});function Ex(e){let t=e.match(/^(\/)?(.+?)(?:\/([gimsuy]*))?$/);return t?new RegExp(t[2],t[3]?.split("").filter((n,r,i)=>i.indexOf(n)===r).join("")??"g"):new RegExp(e)}function _C(e){try{return Ex(e),null}catch(t){return o("span",{style:{color:"var(--text-danger)"}},String(t))}}function qf({initialValue:e,onChange:t,placeholder:n}){let[r,i]=J(e);return o(Ve,{placeholder:n,value:r,onChange:i,spellCheck:!1,onBlur:()=>r!==e&&t(r)})}function Cx({title:e,rulesArray:t,rulesKey:n,update:r}){let i=e==="Using Regex";async function s(c){c!==t.length-1&&(t.splice(c,1),await Gt.set(n,t),r())}async function l(c,u,p){u===t.length-1&&t.push(Lx()),t[u][p]=c,t[u].find===""&&t[u].replace===""&&t[u].onlyIfIncludes===""&&u!==t.length-1&&t.splice(u,1),await Gt.set(n,t),r()}return o(f,null,o(S.FormTitle,{tag:"h4"},e),o(ge,{flexDirection:"column",style:{gap:"0.5em"}},t.map((c,u)=>o(O.Fragment,{key:`${c.find}-${u}`},o(ge,{flexDirection:"row",style:{gap:0}},o(ge,{flexDirection:"row",style:{flexGrow:1,gap:"0.5em"}},o(qf,{placeholder:"Find",initialValue:c.find,onChange:p=>l(p,u,"find")}),o(qf,{placeholder:"Replace",initialValue:c.replace,onChange:p=>l(p,u,"replace")}),o(qf,{placeholder:"Only if includes",initialValue:c.onlyIfIncludes,onChange:p=>l(p,u,"onlyIfIncludes")})),o(R,{size:R.Sizes.MIN,onClick:()=>s(u),style:{background:"none",color:"var(--status-danger)",...u===t.length-1?{visibility:"hidden",pointerEvents:"none"}:{}}},o(Ty,null))),i&&_C(c.find)))))}function BC(){let[e,t]=J("");return o(f,null,o(S.FormTitle,{tag:"h4"},"Test Rules"),o(Ve,{placeholder:"Type a message",onChange:t}),o(Ve,{placeholder:"Message with rules applied",editable:!1,value:Dx(e)}))}function Dx(e){if(e.length===0)return e;if($l)for(let t of $l)!t.find||!t.replace||t.onlyIfIncludes&&!e.includes(t.onlyIfIncludes)||(e=` ${e} `.replaceAll(t.find,t.replace.replaceAll("\\n",` -`)).replace(/^\s|\s$/g,""));if(Gl){for(let t of Gl)if(!(!t.find||!t.replace)&&!(t.onlyIfIncludes&&!e.includes(t.onlyIfIncludes)))try{let n=Ex(t.find);e=e.replace(n,t.replace.replaceAll("\\n",` -`))}catch{new ie("TextReplace").error(`Invalid regex: ${t.find}`)}}return e=e.trim(),e}var kx,Rx,Lx,Ul,$l,Gl,OC,FC,Kf,Ox=g(()=>{"use strict";a();as();Yn();$();Lt();$t();P();Ze();Qe();w();A();kx="TextReplace_rulesString",Rx="TextReplace_rulesRegex",Lx=()=>({find:"",replace:"",onlyIfIncludes:""}),Ul=()=>[Lx()],$l=Ul(),Gl=Ul(),OC=D({replace:{type:6,description:"",component:()=>{let e=Po();return o(f,null,o(Cx,{title:"Using String",rulesArray:$l,rulesKey:kx,update:e}),o(Cx,{title:"Using Regex",rulesArray:Gl,rulesKey:Rx,update:e}),o(BC,null))}}});FC="1102784112584040479",Kf=y({name:"TextReplace",description:"Replace text in your messages. You can find pre-made rules in the #textreplace-rules channel in Vencord's Server",authors:[d.AutumnVN,d.TheKodeToad],dependencies:["MessageEventsAPI"],settings:OC,async start(){$l=await Gt.get(kx)??Ul(),Gl=await Gt.get(Rx)??Ul(),this.preSend=Ht((e,t)=>{e!==FC&&(t.content=Dx(t.content))})},stop(){zt(this.preSend)}})});var Yf,_x=g(()=>{"use strict";a();P();w();A();Yf=y({name:"ThemeAttributes",description:"Adds data attributes to various elements for theming purposes",authors:[d.Ven],patches:[{find:".tabBarRef",replacement:{match:/style:this\.getStyle\(\),role:"tab"/,replace:"$&,'data-tab-id':this.props.id"}},{find:".messageListItem",replacement:{match:/\.messageListItem(?=,"aria)/,replace:"$&,...$self.getMessageProps(arguments[0])"}}],getMessageProps(e){let t=e.message?.author?.id;return{"data-author-id":t,"data-is-self":t&&t===W.getCurrentUser()?.id}}})});var Zf,Bx=g(()=>{"use strict";a();P();w();Zf=y({name:"TimeBarAllActivities",description:"Adds the Spotify time bar to all activities if they have start and end timestamps",authors:[d.obscurity],patches:[{find:"}renderTimeBar(",replacement:{match:/renderTimeBar\((.{1,3})\){.{0,50}?let/,replace:"renderTimeBar($1){let"}}]})});var Fx=g(()=>{});var Dt,Us=g(()=>{"use strict";a();$();w();Dt=D({receivedInput:{type:0,description:"Input language for received messages",default:"auto",hidden:!0},receivedOutput:{type:0,description:"Output language for received messages",default:"en",hidden:!0},sentInput:{type:0,description:"Input language for sent messages",default:"auto",hidden:!0},sentOutput:{type:0,description:"Output language for sent messages",default:"en",hidden:!0},autoTranslate:{type:3,description:"Automatically translate your messages before sending. You can also shift/right click the translate button to toggle this",default:!1}})});var Hl,Xf=g(()=>{"use strict";a();Hl={auto:"Detect language",af:"Afrikaans",sq:"Albanian",am:"Amharic",ar:"Arabic",hy:"Armenian",as:"Assamese",ay:"Aymara",az:"Azerbaijani",bm:"Bambara",eu:"Basque",be:"Belarusian",bn:"Bengali",bho:"Bhojpuri",bs:"Bosnian",bg:"Bulgarian",ca:"Catalan",ceb:"Cebuano",ny:"Chichewa","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)",co:"Corsican",hr:"Croatian",cs:"Czech",da:"Danish",dv:"Dhivehi",doi:"Dogri",nl:"Dutch",en:"English",eo:"Esperanto",et:"Estonian",ee:"Ewe",tl:"Filipino",fi:"Finnish",fr:"French",fy:"Frisian",gl:"Galician",ka:"Georgian",de:"German",el:"Greek",gn:"Guarani",gu:"Gujarati",ht:"Haitian Creole",ha:"Hausa",haw:"Hawaiian",iw:"Hebrew",hi:"Hindi",hmn:"Hmong",hu:"Hungarian",is:"Icelandic",ig:"Igbo",ilo:"Ilocano",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",jw:"Javanese",kn:"Kannada",kk:"Kazakh",km:"Khmer",rw:"Kinyarwanda",gom:"Konkani",ko:"Korean",kri:"Krio",ku:"Kurdish (Kurmanji)",ckb:"Kurdish (Sorani)",ky:"Kyrgyz",lo:"Lao",la:"Latin",lv:"Latvian",ln:"Lingala",lt:"Lithuanian",lg:"Luganda",lb:"Luxembourgish",mk:"Macedonian",mai:"Maithili",mg:"Malagasy",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi","mni-Mtei":"Meiteilon (Manipuri)",lus:"Mizo",mn:"Mongolian",my:"Myanmar (Burmese)",ne:"Nepali",no:"Norwegian",or:"Odia (Oriya)",om:"Oromo",ps:"Pashto",fa:"Persian",pl:"Polish",pt:"Portuguese",pa:"Punjabi",qu:"Quechua",ro:"Romanian",ru:"Russian",sm:"Samoan",sa:"Sanskrit",gd:"Scots Gaelic",nso:"Sepedi",sr:"Serbian",st:"Sesotho",sn:"Shona",sd:"Sindhi",si:"Sinhala",sk:"Slovak",sl:"Slovenian",so:"Somali",es:"Spanish",su:"Sundanese",sw:"Swahili",sv:"Swedish",tg:"Tajik",ta:"Tamil",tt:"Tatar",te:"Telugu",th:"Thai",ti:"Tigrinya",ts:"Tsonga",tr:"Turkish",tk:"Turkmen",ak:"Twi",uk:"Ukrainian",ur:"Urdu",ug:"Uyghur",uz:"Uzbek",vi:"Vietnamese",cy:"Welsh",xh:"Xhosa",yi:"Yiddish",yo:"Yoruba",zu:"Zulu"}});async function $s(e,t){let n=Dt.store[e+"Input"],r=Dt.store[e+"Output"],i="https://translate.googleapis.com/translate_a/single?"+new URLSearchParams({client:"gtx",sl:n,tl:r,dt:"t",dj:"1",source:"input",q:t}),s=await fetch(i);if(!s.ok)throw new Error(`Failed to translate "${t}" (${n} -> ${r}) -${s.status} ${s.statusText}`);let{src:l,sentences:c}=await s.json();return{src:l,text:c.map(u=>u?.trans).filter(Boolean).join("")}}var yo,Gs=g(()=>{"use strict";a();Je();Us();yo=Ue("vc-trans-")});function $C({settingsKey:e,includeAuto:t}){let n=Dt.use([e])[e],r=Nt(()=>{let i=Object.entries(Hl).map(([s,l])=>({value:s,label:l}));return t||i.shift(),i},[]);return o("section",{className:q.bottom16},o(S.FormTitle,{tag:"h3"},Dt.def[e].description),o(Vs,{options:r,value:r.find(i=>i.value===n),placeholder:"Select a language",maxVisibleItems:5,closeOnSelect:!0,onChange:i=>Dt.store[e]=i}))}function GC(){let e=Dt.use(["autoTranslate"]).autoTranslate;return o(pt,{value:e,onChange:t=>Dt.store.autoTranslate=t,note:Dt.def.autoTranslate.description,hideBorder:!0},"Auto Translate")}function Ux({rootProps:e}){return o(ze,{...e},o(lt,{className:yo("modal-header")},o(S.FormTitle,{tag:"h2"},"Translate"),o(an,{onClick:e.onClose})),o(et,{className:yo("modal-content")},UC.map(t=>o($C,{key:t,settingsKey:t,includeAuto:t.endsWith("Input")})),o(S.FormDivider,{className:q.bottom16}),o(GC,null)))}var UC,$x=g(()=>{"use strict";a();at();dt();A();Xf();Us();Gs();UC=["receivedInput","receivedOutput","sentInput","sentOutput"]});function Si({height:e=24,width:t=24,className:n}){return o("svg",{viewBox:"0 96 960 960",height:e,width:t,className:oe(yo("icon"),n)},o("path",{fill:"currentColor",d:"m475 976 181-480h82l186 480h-87l-41-126H604l-47 126h-82Zm151-196h142l-70-194h-2l-70 194Zm-466 76-55-55 204-204q-38-44-67.5-88.5T190 416h87q17 33 37.5 62.5T361 539q45-47 75-97.5T487 336H40v-80h280v-80h80v80h280v80H567q-22 69-58.5 135.5T419 598l98 99-30 81-127-122-200 200Z"}))}function Gx({slateProps:e}){let{autoTranslate:t}=Dt.use(["autoTranslate"]);if(e.type.analyticsName!=="normal")return null;let n=()=>Dt.store.autoTranslate=!t;return o(V,{text:"Open Translate Modal"},({onMouseEnter:r,onMouseLeave:i})=>o("div",{style:{display:"flex"}},o(R,{"aria-haspopup":"dialog","aria-label":"Open Translate Modal",size:"",look:Kt.BLANK,onMouseEnter:r,onMouseLeave:i,innerClassName:vt.button,onClick:s=>{if(s.shiftKey)return n();je(l=>o(Ux,{rootProps:l}))},onContextMenu:()=>n(),style:{padding:"0 4px"}},o("div",{className:vt.buttonWrapper},o(Si,{className:yo({"auto-translate":t})})))))}var Jf=g(()=>{"use strict";a();Re();dt();A();Us();$x();Gs()});function Vf(e,t){Qf.get(e)(t)}function HC({onDismiss:e}){return o("button",{onClick:e,className:yo("dismiss")},"Dismiss")}function Hx({message:e}){let[t,n]=J();return De(()=>{if(!e.vencordEmbeddedBy)return Qf.set(e.id,n),()=>void Qf.delete(e.id)},[]),t?o("span",{className:yo("accessory")},o(Si,{width:16,height:16}),Fe.parse(t.text)," ","(translated from ",Hl[t.src]??t.src," - ",o(HC,{onDismiss:()=>n(void 0)}),")"):null}var Qf,zx=g(()=>{"use strict";a();A();Xf();Jf();Gs();Qf=new Map});var jx,eg,Wx=g(()=>{"use strict";a();Fx();Pt();nl();Yn();Ir();le();P();w();A();Us();Jf();zx();Gs();jx=(e,{message:t})=>()=>{if(!t.content)return;let n=mt("copy-text",e);!n||n.splice(n.findIndex(r=>r?.props?.id==="copy-text")+1,0,o(G.MenuItem,{id:"vc-trans",label:"Translate",icon:Si,action:async()=>{let r=await $s("received",t.content);Vf(t.id,r)}}))},eg=y({name:"Translate",description:"Translate messages with Google Translate",authors:[d.Ven],dependencies:["MessageAccessoriesAPI","MessagePopoverAPI","MessageEventsAPI"],settings:Dt,translate:$s,patches:[{find:"ChannelTextAreaButtons",replacement:{match:/(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/,replace:"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()"}}],start(){Ss("vc-translation",e=>o(Hx,{message:e.message})),ce("message",jx),Bn("vc-translate",e=>e.content?{label:"Translate",icon:Si,message:e,channel:Q.getChannel(e.channel_id),onClick:async()=>{let t=await $s("received",e.content);Vf(e.id,t)}}:null),this.preSend=Ht(async(e,t)=>{!Dt.store.autoTranslate||!t.content||(t.content=(await $s("sent",t.content)).text)})},stop(){zt(this.preSend),de("message",jx),Fn("vc-translate"),vd("vc-translation")},chatBarIcon:e=>o(_,{noop:!0},o(Gx,{slateProps:e}))})});function tg({a:e,b:t,count:n}){return[o("strong",{key:"0"},e),", ",o("strong",{key:"1"},t),`, and ${n} others are typing...`]}var zl,zC,ng,og=g(()=>{"use strict";a();$();le();P();bt();w();A();zl=D({showAvatars:{type:3,default:!0,description:"Show avatars in the typing indicator"},showRoleColors:{type:3,default:!0,description:"Show role colors in the typing indicator"},alternativeFormatting:{type:3,default:!0,description:"Show a more useful message when several users are typing"}});zC=_.wrap(function({user:e,guildId:t}){return o("strong",{role:"button",onClick:()=>{_n(e.id)},style:{display:"grid",gridAutoFlow:"column",gap:"4px",color:zl.store.showRoleColors?ke.getMember(t,e.id)?.colorString:void 0,cursor:"pointer"}},zl.store.showAvatars&&o("div",{style:{marginTop:"4px"}},o(Or,{size:"SIZE_16",src:e.getAvatarURL(t,128)})),ke.getNick(t,e.id)||!t&&nt.getNickname(e.id)||e.globalName||e.username)},{noop:!0}),ng=y({name:"TypingTweaks",description:"Show avatars and role colours in the typing indicator",authors:[d.zt],patches:[{find:"getCooldownTextStyle",replacement:{match:/(?<=children:\[(\i)\.length>0.{0,200}?"aria-atomic":!0,children:)\i/,replace:"$self.mutateChildren(this.props, $1, $&), style: $self.TYPING_TEXT_STYLE"}},{find:"getCooldownTextStyle",replacement:{match:/(?<=map\(\i=>)\i\.\i\.getName\(\i,this\.props\.channel\.id,(\i)\)/,replace:"$1"}},{find:"getCooldownTextStyle",replacement:{match:/(?<=(\i)\.length\?\i.\i\.Messages.THREE_USERS_TYPING\.format\({\i:(\i),(?:\i:)?(\i),\i:\i}\):)\i\.\i\.Messages\.SEVERAL_USERS_TYPING/,replace:(e,t,n,r)=>`$self.buildSeveralUsers({ a: ${n}, b: ${r}, count: ${t}.length - 2 })`},predicate:()=>zl.store.alternativeFormatting}],settings:zl,TYPING_TEXT_STYLE:{display:"grid",gridAutoFlow:"column",gridGap:"0.25em"},buildSeveralUsers:tg,mutateChildren(e,t,n){if(!Array.isArray(n))return n;let r=0;return n.map(i=>i.type==="strong"?o(zC,{...e,user:t[r++]}):i)}})});function Jo(e,t){let n=W.getUser(t);return ke.getNick(e,t)??n.globalName??n.username}function qC({channelId:e}){let t=He([qx],()=>({...qx.getTypingUsers(e)}),null,(l,c)=>{let u=Object.keys(l),p=Object.keys(c);return u.length===p.length&&p.every(m=>l[m]!=null)}),n=Q.getChannel(e).guild_id;if(!rg.store.includeMutedChannels&&WC.isChannelMuted(n,e))return null;let r=W.getCurrentUser()?.id,i=Object.keys(t).filter(l=>l!==r&&!(nt.isBlocked(l)&&!rg.store.includeBlockedUsers)),s;switch(i.length){case 0:break;case 1:{s=ot.Messages.ONE_USER_TYPING.format({a:Jo(n,i[0])});break}case 2:{s=ot.Messages.TWO_USERS_TYPING.format({a:Jo(n,i[0]),b:Jo(n,i[1])});break}case 3:{s=ot.Messages.THREE_USERS_TYPING.format({a:Jo(n,i[0]),b:Jo(n,i[1]),c:Jo(n,i[2])});break}default:{s=E.plugins.TypingTweaks.enabled?tg({a:Jo(n,i[0]),b:Jo(n,i[1]),count:i.length-2}):ot.Messages.SEVERAL_USERS_TYPING;break}}return i.length>0?o(V,{text:s},l=>o("div",{...l,style:{marginLeft:6,height:16,display:"flex",alignItems:"center",zIndex:0,cursor:"pointer"}},o(jC,{dotRadius:3,themed:!0}))):null}var jC,qx,WC,rg,ig,Kx=g(()=>{"use strict";a();$();le();P();Qe();w();j();A();og();jC=tt(()=>Ot(t=>t.Dots&&!t.Menu)?.Dots),qx=Me("TypingStore"),WC=Me("UserGuildSettingsStore");rg=D({includeMutedChannels:{type:3,description:"Whether to show the typing indicator for muted channels.",default:!1},includeBlockedUsers:{type:3,description:"Whether to show the typing indicator for blocked users.",default:!1}}),ig=y({name:"TypingIndicator",description:"Adds an indicator if someone is typing on a channel.",authors:[d.Nuckyz,d.obscurity],settings:rg,patches:[{find:"UNREAD_IMPORTANT:",replacement:{match:/channel:(\i).{0,100}?channelEmoji,.{0,250}?\.children.{0,50}?:null/,replace:"$&,$self.TypingIndicator($1.id)"}},{find:"M11 9H4C2.89543 9 2 8.10457 2 7V1C2 0.447715 1.55228 0 1 0C0.447715 0 0 0.447715 0 1V7C0 9.20914 1.79086 11 4 11H11C11.5523 11 12 10.5523 12 10C12 9.44771 11.5523 9 11 9Z",replacement:{match:/mentionsCount:\i.+?null(?<=channel:(\i).+?)/,replace:"$&,$self.TypingIndicator($1.id)"}}],TypingIndicator:e=>o(_,{noop:!0},o(qC,{channelId:e}))})});var sg,Yx=g(()=>{"use strict";a();Yn();P();w();sg=y({name:"Unindent",description:"Trims leading indentation from codeblocks",authors:[d.Ven],dependencies:["MessageEventsAPI"],patches:[{find:"inQuote:",replacement:{match:/,content:([^,]+),inQuote/,replace:(e,t)=>`,content:Vencord.Plugins.plugins.Unindent.unindent(${t}),inQuote`}}],unindent(e){e=e.replace(/\t/g," ");let t=e.match(/^ *(?=\S)/gm)?.reduce((n,r)=>Math.min(n,r.length),1/0)??0;return t?e.replace(new RegExp(`^ {${t}}`,"gm"),""):e},unindentMsg(e){e.content=e.content.replace(/```(.|\n)*?```/g,t=>{let n=t.split(` +`,classNames:{},dom:null});sx="src/plugins/spotifyControls/hoverOnly.css"});var lx=g(()=>{});var ze,cx=g(()=>{"use strict";a();$();Zt();j();I();ze=Qe(()=>{let{Store:e}=cc,t=A("getActiveSocketAndDevice"),n=A("SpotifyAPI"),r="https://api.spotify.com/v1/me/player";class i extends e{mPosition=0;start=0;track=null;device=null;isPlaying=!1;repeat="off";shuffle=!1;volume=0;isSettingPosition=!1;openExternal(c){let u=L.plugins.SpotifyControls.useSpotifyUris||Vencord.Plugins.isPluginEnabled("OpenInApp")?"spotify:"+c.replaceAll("/",(d,m)=>m===0?"":":"):"https://open.spotify.com"+c;VencordNative.native.openExternal(u)}get position(){let c=this.mPosition;return this.isPlaying&&(c+=Date.now()-this.start),c}set position(c){this.mPosition=c,this.start=Date.now()}prev(){this.req("post","/previous")}next(){this.req("post","/next")}setVolume(c){this.req("put","/volume",{query:{volume_percent:Math.round(c)}}).then(()=>{this.volume=c,this.emitChange()})}setPlaying(c){this.req("put",c?"/play":"/pause")}setRepeat(c){this.req("put","/repeat",{query:{state:c}})}setShuffle(c){this.req("put","/shuffle",{query:{state:c}}).then(()=>{this.shuffle=c,this.emitChange()})}seek(c){return this.isSettingPosition?Promise.resolve():(this.isSettingPosition=!0,this.req("put","/seek",{query:{position_ms:Math.round(c)}}).catch(u=>{console.error("[VencordSpotifyControls] Failed to seek",u),this.isSettingPosition=!1}))}req(c,u,d={}){this.device?.is_active&&((d.query??={}).device_id=this.device.id);let{socket:m}=t.getActiveSocketAndDevice();return n.SpotifyAPI[c](m.accountId,m.accessToken,{url:r+u,...d})}}let s=new i(B,{SPOTIFY_PLAYER_STATE(l){s.track=l.track,s.device=l.device??null,s.isPlaying=l.isPlaying??!1,s.volume=l.volumePercent??0,s.repeat=l.actual_repeat||"off",s.position=l.position??0,s.isSettingPosition=!1,s.emitChange()},SPOTIFY_SET_DEVICES({devices:l}){s.device=l.find(c=>c.is_active)??l[0]??null,s.emitChange()}});return s})});function Df(e){let t=e/1e3/60,n=Math.floor(t),r=Math.floor((t-n)*60);return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}function bi(e,t){return()=>o("svg",{className:re(Ze("button-icon"),Ze(t)),height:"24",width:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-label":t,focusable:!1},o("path",{d:e}))}function _s(e){return o("button",{className:Ze("button"),...e},e.children)}function aC({name:e,path:t}){let n=`spotify-copy-${e}`,r=`spotify-open-${e}`;return o(U.Menu,{navId:`spotify-${e}-menu`,onClose:()=>B.dispatch({type:"CONTEXT_MENU_CLOSE"}),"aria-label":`Spotify ${e} Menu`},o(U.MenuItem,{key:n,id:n,label:`Copy ${e} Link`,action:()=>vn("https://open.spotify.com"+t),icon:Vr}),o(U.MenuItem,{key:r,id:r,label:`Open ${e} in Spotify`,action:()=>ze.openExternal(t),icon:Ji}))}function lC(e,t){return n=>gn.open(n,()=>o(aC,{name:e,path:t}))}function cC(){let[e,t,n]=We([ze],()=>[ze.isPlaying,ze.shuffle,ze.repeat]),[r,i]=(()=>{switch(n){case"off":return["context","repeat-off"];case"context":return["track","repeat-context"];case"track":return["off","repeat-track"];default:throw new Error(`Invalid repeat state ${n}`)}})();return o(ye,{className:Ze("button-row"),style:{gap:0}},o(_s,{className:re(Ze("button"),Ze(t?"shuffle-on":"shuffle-off")),onClick:()=>ze.setShuffle(!t)},o(sC,null)),o(_s,{onClick:()=>ze.prev()},o(oC,null)),o(_s,{onClick:()=>ze.setPlaying(!e)},e?o(nC,null):o(tC,null)),o(_s,{onClick:()=>ze.next()},o(rC,null)),o(_s,{className:re(Ze("button"),Ze(i)),onClick:()=>ze.setRepeat(r),style:{position:"relative"}},n==="track"&&o("span",{className:Ze("repeat-1")},"1"),o(iC,null)))}function pC(){let{duration:e}=ze.track,[t,n,r]=We([ze],()=>[ze.mPosition,ze.isSettingPosition,ze.isPlaying]),[i,s]=J(t);return _e(()=>{if(r&&!n){s(ze.position);let l=setInterval(()=>{s(c=>c+1e3)},1e3);return()=>clearInterval(l)}},[t,n,r]),o("div",{id:Ze("progress-bar")},o(S.FormText,{variant:"text-xs/medium",className:Ze("progress-time")+" "+Ze("time-left"),"aria-label":"Progress"},Df(i)),o(U.MenuSliderControl,{minValue:0,maxValue:e,value:i,onChange:l=>{n||(s(l),uC(l))},renderValue:Df}),o(S.FormText,{variant:"text-xs/medium",className:Ze("progress-time")+" "+Ze("time-right"),"aria-label":"Total Duration"},Df(e)))}function dC({track:e}){let t=We([ze],()=>ze.volume);return o(U.Menu,{navId:"spotify-album-menu",onClose:()=>B.dispatch({type:"CONTEXT_MENU_CLOSE"}),"aria-label":"Spotify Album Menu"},o(U.MenuItem,{key:"open-album",id:"open-album",label:"Open Album",action:()=>ze.openExternal(`/album/${e.album.id}`),icon:Ji}),o(U.MenuItem,{key:"view-cover",id:"view-cover",label:"View Album Cover",action:()=>Bn(e.album.image.url),icon:vr}),o(U.MenuControlItem,{id:"spotify-volume",key:"spotify-volume",label:"Volume",control:(n,r)=>o(U.MenuSliderControl,{...n,ref:r,value:t,minValue:0,maxValue:100,onChange:bn(i=>ze.setVolume(i))})}))}function Of(e,t,n){return t?{role:"link",onClick:()=>ze.openExternal(n),onContextMenu:lC(e,n)}:{}}function mC({track:e}){let t=e?.album?.image,[n,r]=J(!1),i=o(f,null,t&&o("img",{id:Ze("album-image"),src:t.url,alt:"Album Image",onClick:()=>r(!n),onContextMenu:s=>{gn.open(s,()=>o(dC,{track:e}))}}));return n&&t?o("div",{id:Ze("album-expanded-wrapper")},i):o("div",{id:Ze("info-wrapper")},i,o("div",{id:Ze("titles")},o(S.FormText,{variant:"text-sm/semibold",id:Ze("song-title"),className:Ze("ellipoverflow"),title:e.name,...Of("Song",e.id,`/track/${e.id}`)},e.name),e.artists.some(s=>s.name)&&o(S.FormText,{variant:"text-sm/normal",className:Ze("ellipoverflow")},"by\xA0",e.artists.map((s,l)=>o(O.Fragment,{key:s.name},o("span",{className:Ze("artist"),style:{fontSize:"inherit"},title:s.name,...Of("Artist",s.id,`/artist/${s.id}`)},s.name),l!==e.artists.length-1&&o("span",{className:Ze("comma")},", ")))),e.album.name&&o(S.FormText,{variant:"text-sm/normal",className:Ze("ellipoverflow")},"on\xA0",o("span",{id:Ze("album-title"),className:Ze("album"),style:{fontSize:"inherit"},title:e.album.name,...Of("Album",e.album.id,`/album/${e.album.id}`)},e.album.name))))}function ux(){let e=We([ze],()=>ze.track,null,(s,l)=>s?.id?s.id===l?.id:s?.name===l?.name),t=We([ze],()=>ze.device,null,(s,l)=>s?.id===l?.id),n=We([ze],()=>ze.isPlaying),[r,i]=J(!1);return O.useEffect(()=>{if(i(!1),!n){let s=setTimeout(()=>i(!0),3e5);return()=>clearTimeout(s)}},[n]),!e||!t?.is_active||r?null:o(_,{fallback:()=>o("div",{className:"vc-spotify-fallback"},o("p",null,"Failed to render Spotify Modal :("),o("p",null,"Check the console for errors"))},o("div",{id:Ze("player")},o(mC,{track:e}),o(pC,null),o(cC,null)))}var Ze,tC,nC,oC,rC,iC,sC,uC,px=g(()=>{"use strict";a();lx();le();Dt();Ht();Wr();It();Be();I();cx();Ze=e=>`vc-spotify-${e}`;tC=bi("M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18c.62-.39.62-1.29 0-1.69L9.54 5.98C8.87 5.55 8 6.03 8 6.82z","play"),nC=bi("M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z","pause"),oC=bi("M7 6c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1s-1-.45-1-1V7c0-.55.45-1 1-1zm3.66 6.82l5.77 4.07c.66.47 1.58-.01 1.58-.82V7.93c0-.81-.91-1.28-1.58-.82l-5.77 4.07c-.57.4-.57 1.24 0 1.64z","previous"),rC=bi("M7.58 16.89l5.77-4.07c.56-.4.56-1.24 0-1.63L7.58 7.11C6.91 6.65 6 7.12 6 7.93v8.14c0 .81.91 1.28 1.58.82zM16 7v10c0 .55.45 1 1 1s1-.45 1-1V7c0-.55-.45-1-1-1s-1 .45-1 1z","next"),iC=bi("M7 7h10v1.79c0 .45.54.67.85.35l2.79-2.79c.2-.2.2-.51 0-.71l-2.79-2.79c-.31-.31-.85-.09-.85.36V5H6c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1V7zm10 10H7v-1.79c0-.45-.54-.67-.85-.35l-2.79 2.79c-.2.2-.2.51 0 .71l2.79 2.79c.31.31.85.09.85-.36V19h11c.55 0 1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1v3z","repeat"),sC=bi("M10.59 9.17L6.12 4.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41l4.46 4.46 1.42-1.4zm4.76-4.32l1.19 1.19L4.7 17.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L17.96 7.46l1.19 1.19c.31.31.85.09.85-.36V4.5c0-.28-.22-.5-.5-.5h-3.79c-.45 0-.67.54-.36.85zm-.52 8.56l-1.41 1.41 3.13 3.13-1.2 1.2c-.31.31-.09.85.36.85h3.79c.28 0 .5-.22.5-.5v-3.79c0-.45-.54-.67-.85-.35l-1.19 1.19-3.13-3.14z","shuffle");uC=bn(e=>{ze.seek(e)})});function dx(e){(e?St:$t)(sx)}var _f,mx=g(()=>{"use strict";a();$();Ve();P();M();ax();px();_f=y({name:"SpotifyControls",description:"Adds a Spotify player above the account panel",authors:[p.Ven,p.afn,p.KraXen72],options:{hoverControls:{description:"Show controls on hover",type:3,default:!1,onChange:e=>dx(e)},useSpotifyUris:{type:3,description:"Open Spotify URIs instead of Spotify URLs. Will only work if you have Spotify installed and might not work on all platforms",default:!1}},patches:[{find:"showTaglessAccountPanel:",replacement:{match:/return ?(.{0,30}\(.{1,3},\{[^}]+?,showTaglessAccountPanel:.+?\}\))/,replace:"return [$self.renderPlayer(),$1]"}},{find:".PLAYER_DEVICES",replacement:{match:/get:(\i)\.bind\(null,(\i\.\i)\.get\)/,replace:"post:$1.bind(null,$2.post),$&"}},{find:'repeat:"off"!==',replacement:{match:/repeat:"off"!==(.{1,3}),/,replace:"actual_repeat:$1,$&"}}],start:()=>dx(L.plugins.SpotifyControls.hoverControls),renderPlayer:()=>o(ux,null)})});var Bf,Ff,fx=g(()=>{"use strict";a();$();P();M();Bf=D({noSpotifyAutoPause:{description:"Disable Spotify auto-pause",type:3,default:!0,restartNeeded:!0},keepSpotifyActivityOnIdle:{description:"Keep Spotify activity playing when idling",type:3,default:!1,restartNeeded:!0}}),Ff=y({name:"SpotifyCrack",description:"Free listen along, no auto-pausing in voice chat, and allows activity to continue playing when idling",authors:[p.Cyn,p.Nuckyz],settings:Bf,patches:[{find:'dispatch({type:"SPOTIFY_PROFILE_UPDATE"',replacement:{match:/SPOTIFY_PROFILE_UPDATE.+?isPremium:(?="premium"===(\i)\.body\.product)/,replace:(e,t)=>`${e}(${t}.body.product="premium")&&`}},{find:'.displayName="SpotifyStore"',replacement:[{predicate:()=>Bf.store.noSpotifyAutoPause,match:/(?<=function \i\(\){)(?=.{0,200}SPOTIFY_AUTO_PAUSED\))/,replace:"return;"},{predicate:()=>Bf.store.keepSpotifyActivityOnIdle,match:/(?<=shouldShowActivity\(\){.{0,50})&&!\i\.\i\.isIdle\(\)/,replace:""}]}]})});function $f(e,t){t={invalidEmojis:[],tts:!1,validNonShortcutEmojis:[],...t};let n=fC.getPendingReply(e);gx.sendMessage(e,t,void 0,gx.getSendMessageOptionsForReply(n)).then(()=>{n&&B.dispatch({type:"DELETE_PENDING_REPLY",channelId:e})})}var Uf,gx,fC,Gf,hx=g(()=>{"use strict";a();tn();P();M();j();I();Uf=A("getPlayerState"),gx=A("getSendMessageOptionsForReply","sendMessage"),fC=A("getPendingReply");Gf=y({name:"SpotifyShareCommands",description:"Share your current Spotify track, album or artist via slash command (/track, /album, /artist)",authors:[p.katlyn],dependencies:["CommandsAPI"],commands:[{name:"track",description:"Send your current Spotify track to chat",inputType:0,options:[],execute:(e,t)=>{let n=Uf.getTrack();if(n===null){pe(t.channel.id,{content:"You're not listening to any music."});return}$f(t.channel.id,{content:`https://open.spotify.com/track/${n.id}`})}},{name:"album",description:"Send your current Spotify album to chat",inputType:0,options:[],execute:(e,t)=>{let n=Uf.getTrack();if(n===null){pe(t.channel.id,{content:"You're not listening to any music."});return}$f(t.channel.id,{content:`https://open.spotify.com/album/${n.album.id}`})}},{name:"artist",description:"Send your current Spotify artist to chat",inputType:0,options:[],execute:(e,t)=>{let n=Uf.getTrack();if(n===null){pe(t.channel.id,{content:"You're not listening to any music."});return}$f(t.channel.id,{content:n.artists[0].external_urls.spotify})}}]})});var yx={};Ue(yx,{default:()=>SC});function gC({emoji:e,prefix:t,log:n,delta:r,instance:i}){return o(O.Fragment,null,o("span",null,i.sinceStart.toFixed(3),"s"),o("span",null,i.sinceLast.toFixed(3),"s"),o("span",null,r?.toFixed(0)??""),o("span",null,o("pre",null,e," ",t??" ",n)))}function hC({title:e,logs:t,traceEnd:n}){let r=t.find(l=>l.timestamp)?.timestamp??0,i=r,s=t.map(l=>{let c=l.timestamp??i,u=(c-r)/1e3,d=(c-i)/1e3;return i=c,{sinceStart:u,sinceLast:d}});return o(S.FormSection,{title:e,tag:"h1"},o("code",null,n&&o("div",{style:{color:"var(--header-primary)",marginBottom:5,userSelect:"text"}},"Trace ended at: ",new Date(n).toTimeString()),o("div",{style:{color:"var(--header-primary)",display:"grid",gridTemplateColumns:"repeat(3, auto) 1fr",gap:"2px 10px",userSelect:"text"}},o("span",null,"Start"),o("span",null,"Interval"),o("span",null,"Delta"),o("span",{style:{marginBottom:5}},"Event"),Bs.logs.map((l,c)=>o(gC,{key:c,...l,instance:s[c]})))))}function yC({trace:e}){let t=e.split(` +`);return o(S.FormSection,{title:"Server Trace",tag:"h2"},o("code",null,o(ye,{flexDirection:"column",style:{color:"var(--header-primary)",gap:5,userSelect:"text"}},t.map(n=>o("span",null,n)))))}function vC(){if(!Bs?.logs)return o("div",null,"Loading...");let e=Bs.logGroups.find(t=>t.serverTrace)?.serverTrace;return o(O.Fragment,null,o(hC,{title:"Startup Timings",logs:Bs.logs,traceEnd:Bs.endTime_}),o("div",{style:{marginTop:5}},"\xA0"),e&&o(yC,{trace:e}))}var Bs,SC,vx=g(()=>{"use strict";a();le();Dt();j();I();Bs=A("markWithDelta","markAndLog","markAt");SC=_.wrap(vC)});var Hf,Sx=g(()=>{"use strict";a();P();Oe();M();Hf=y({name:"StartupTimings",description:"Adds Startup Timings to the Settings menu",authors:[p.Megu],patches:[{find:"UserSettingsSections.PAYMENT_FLOW_MODAL_TEST_PAGE,",replacement:{match:/{section:\i\.UserSettingsSections\.PAYMENT_FLOW_MODAL_TEST_PAGE/,replace:'{section:"StartupTimings",label:"Startup Timings",element:$self.StartupTimingPage},$&'}}],StartupTimingPage:me(()=>(vx(),Io(yx)).default)})});var zf,jf,bx=g(()=>{"use strict";a();$();P();M();zf=D({superReactByDefault:{type:3,description:"Reaction picker will default to Super Reactions",default:!0},unlimitedSuperReactionPlaying:{type:3,description:"Remove the limit on Super Reactions playing at once",default:!1},superReactionPlayingLimit:{description:"Max Super Reactions to play at once",type:5,default:20,markers:[5,10,20,40,60,80,100],stickToMarkers:!0}},{superReactionPlayingLimit:{disabled(){return this.store.unlimitedSuperReactionPlaying}}}),jf=y({name:"SuperReactionTweaks",description:"Customize the limit of Super Reactions playing at once, and super react by default",authors:[p.FieryFlames,p.ant0n],patches:[{find:",BURST_REACTION_EFFECT_PLAY",replacement:{match:/(?<=BURST_REACTION_EFFECT_PLAY:\i=>{.{50,100})(\i\(\i,\i\))>=\d+/,replace:"!$self.shouldPlayBurstReaction($1)"}},{find:".hasAvailableBurstCurrency)",replacement:{match:/(?<=\.useBurstReactionsExperiment.{0,20})useState\(!1\)(?=.+?(\i===\i\.EmojiIntention.REACTION))/,replace:"useState($self.settings.store.superReactByDefault && $1)"}}],settings:zf,shouldPlayBurstReaction(e){return!!(zf.store.unlimitedSuperReactionPlaying||e<=zf.store.superReactionPlayingLimit)}})});function Px(e){let t=e.match(/^(\/)?(.+?)(?:\/([gimsuy]*))?$/);return t?new RegExp(t[2],t[3]?.split("").filter((n,r,i)=>i.indexOf(n)===r).join("")??"g"):new RegExp(e)}function TC(e){try{return Px(e),null}catch(t){return o("span",{style:{color:"var(--text-danger)"}},String(t))}}function Wf({initialValue:e,onChange:t,placeholder:n}){let[r,i]=J(e);return o(et,{placeholder:n,value:r,onChange:i,spellCheck:!1,onBlur:()=>r!==e&&t(r)})}function Tx({title:e,rulesArray:t,rulesKey:n,update:r}){let i=e==="Using Regex";async function s(c){c!==t.length-1&&(t.splice(c,1),await zt.set(n,t),r())}async function l(c,u,d){u===t.length-1&&t.push(Mx()),t[u][d]=c,t[u].find===""&&t[u].replace===""&&t[u].onlyIfIncludes===""&&u!==t.length-1&&t.splice(u,1),await zt.set(n,t),r()}return o(f,null,o(S.FormTitle,{tag:"h4"},e),o(ye,{flexDirection:"column",style:{gap:"0.5em"}},t.map((c,u)=>o(O.Fragment,{key:`${c.find}-${u}`},o(ye,{flexDirection:"row",style:{gap:0}},o(ye,{flexDirection:"row",style:{flexGrow:1,gap:"0.5em"}},o(Wf,{placeholder:"Find",initialValue:c.find,onChange:d=>l(d,u,"find")}),o(Wf,{placeholder:"Replace",initialValue:c.replace,onChange:d=>l(d,u,"replace")}),o(Wf,{placeholder:"Only if includes",initialValue:c.onlyIfIncludes,onChange:d=>l(d,u,"onlyIfIncludes")})),o(E,{size:E.Sizes.MIN,onClick:()=>s(u),style:{background:"none",color:"var(--status-danger)",...u===t.length-1?{visibility:"hidden",pointerEvents:"none"}:{}}},o(by,null))),i&&TC(c.find)))))}function xC(){let[e,t]=J("");return o(f,null,o(S.FormTitle,{tag:"h4"},"Test Rules"),o(et,{placeholder:"Type a message",onChange:t}),o(et,{placeholder:"Message with rules applied",editable:!1,value:Ix(e)}))}function Ix(e){if(e.length===0)return e;if(Hl)for(let t of Hl)!t.find||!t.replace||t.onlyIfIncludes&&!e.includes(t.onlyIfIncludes)||(e=` ${e} `.replaceAll(t.find,t.replace.replaceAll("\\n",` +`)).replace(/^\s|\s$/g,""));if(zl){for(let t of zl)if(!(!t.find||!t.replace)&&!(t.onlyIfIncludes&&!e.includes(t.onlyIfIncludes)))try{let n=Px(t.find);e=e.replace(n,t.replace.replaceAll("\\n",` +`))}catch{new ie("TextReplace").error(`Invalid regex: ${t.find}`)}}return e=e.trim(),e}var xx,wx,Mx,Gl,Hl,zl,bC,wC,qf,Ax=g(()=>{"use strict";a();ss();Xn();$();Dt();Ht();P();Je();Oe();M();I();xx="TextReplace_rulesString",wx="TextReplace_rulesRegex",Mx=()=>({find:"",replace:"",onlyIfIncludes:""}),Gl=()=>[Mx()],Hl=Gl(),zl=Gl(),bC=D({replace:{type:6,description:"",component:()=>{let e=qn();return o(f,null,o(Tx,{title:"Using String",rulesArray:Hl,rulesKey:xx,update:e}),o(Tx,{title:"Using Regex",rulesArray:zl,rulesKey:wx,update:e}),o(xC,null))}}});wC="1102784112584040479",qf=y({name:"TextReplace",description:"Replace text in your messages. You can find pre-made rules in the #textreplace-rules channel in Vencord's Server",authors:[p.AutumnVN,p.TheKodeToad],dependencies:["MessageEventsAPI"],settings:bC,async start(){Hl=await zt.get(xx)??Gl(),zl=await zt.get(wx)??Gl(),this.preSend=jt((e,t)=>{e!==wC&&(t.content=Ix(t.content))})},stop(){Wt(this.preSend)}})});var Kf,Nx=g(()=>{"use strict";a();P();M();I();Kf=y({name:"ThemeAttributes",description:"Adds data attributes to various elements for theming purposes",authors:[p.Ven],patches:[{find:".tabBarRef",replacement:{match:/style:this\.getStyle\(\),role:"tab"/,replace:"$&,'data-tab-id':this.props.id"}},{find:".messageListItem",replacement:{match:/\.messageListItem(?=,"aria)/,replace:"$&,...$self.getMessageProps(arguments[0])"}}],getMessageProps(e){let t=e.message?.author?.id;return{"data-author-id":t,"data-is-self":t&&t===W.getCurrentUser()?.id}}})});var Yf,Cx=g(()=>{"use strict";a();P();M();Yf=y({name:"TimeBarAllActivities",description:"Adds the Spotify time bar to all activities if they have start and end timestamps",authors:[p.obscurity],patches:[{find:"}renderTimeBar(",replacement:{match:/renderTimeBar\((.{1,3})\){.{0,50}?let/,replace:"renderTimeBar($1){let"}}]})});var kx=g(()=>{});var _t,Fs=g(()=>{"use strict";a();$();M();_t=D({receivedInput:{type:0,description:"Input language for received messages",default:"auto",hidden:!0},receivedOutput:{type:0,description:"Output language for received messages",default:"en",hidden:!0},sentInput:{type:0,description:"Input language for sent messages",default:"auto",hidden:!0},sentOutput:{type:0,description:"Output language for sent messages",default:"en",hidden:!0},autoTranslate:{type:3,description:"Automatically translate your messages before sending. You can also shift/right click the translate button to toggle this",default:!1}})});var jl,Zf=g(()=>{"use strict";a();jl={auto:"Detect language",af:"Afrikaans",sq:"Albanian",am:"Amharic",ar:"Arabic",hy:"Armenian",as:"Assamese",ay:"Aymara",az:"Azerbaijani",bm:"Bambara",eu:"Basque",be:"Belarusian",bn:"Bengali",bho:"Bhojpuri",bs:"Bosnian",bg:"Bulgarian",ca:"Catalan",ceb:"Cebuano",ny:"Chichewa","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)",co:"Corsican",hr:"Croatian",cs:"Czech",da:"Danish",dv:"Dhivehi",doi:"Dogri",nl:"Dutch",en:"English",eo:"Esperanto",et:"Estonian",ee:"Ewe",tl:"Filipino",fi:"Finnish",fr:"French",fy:"Frisian",gl:"Galician",ka:"Georgian",de:"German",el:"Greek",gn:"Guarani",gu:"Gujarati",ht:"Haitian Creole",ha:"Hausa",haw:"Hawaiian",iw:"Hebrew",hi:"Hindi",hmn:"Hmong",hu:"Hungarian",is:"Icelandic",ig:"Igbo",ilo:"Ilocano",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",jw:"Javanese",kn:"Kannada",kk:"Kazakh",km:"Khmer",rw:"Kinyarwanda",gom:"Konkani",ko:"Korean",kri:"Krio",ku:"Kurdish (Kurmanji)",ckb:"Kurdish (Sorani)",ky:"Kyrgyz",lo:"Lao",la:"Latin",lv:"Latvian",ln:"Lingala",lt:"Lithuanian",lg:"Luganda",lb:"Luxembourgish",mk:"Macedonian",mai:"Maithili",mg:"Malagasy",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi","mni-Mtei":"Meiteilon (Manipuri)",lus:"Mizo",mn:"Mongolian",my:"Myanmar (Burmese)",ne:"Nepali",no:"Norwegian",or:"Odia (Oriya)",om:"Oromo",ps:"Pashto",fa:"Persian",pl:"Polish",pt:"Portuguese",pa:"Punjabi",qu:"Quechua",ro:"Romanian",ru:"Russian",sm:"Samoan",sa:"Sanskrit",gd:"Scots Gaelic",nso:"Sepedi",sr:"Serbian",st:"Sesotho",sn:"Shona",sd:"Sindhi",si:"Sinhala",sk:"Slovak",sl:"Slovenian",so:"Somali",es:"Spanish",su:"Sundanese",sw:"Swahili",sv:"Swedish",tg:"Tajik",ta:"Tamil",tt:"Tatar",te:"Telugu",th:"Thai",ti:"Tigrinya",ts:"Tsonga",tr:"Turkish",tk:"Turkmen",ak:"Twi",uk:"Ukrainian",ur:"Urdu",ug:"Uyghur",uz:"Uzbek",vi:"Vietnamese",cy:"Welsh",xh:"Xhosa",yi:"Yiddish",yo:"Yoruba",zu:"Zulu"}});async function Us(e,t){let n=_t.store[e+"Input"],r=_t.store[e+"Output"],i="https://translate.googleapis.com/translate_a/single?"+new URLSearchParams({client:"gtx",sl:n,tl:r,dt:"t",dj:"1",source:"input",q:t}),s=await fetch(i);if(!s.ok)throw new Error(`Failed to translate "${t}" (${n} -> ${r}) +${s.status} ${s.statusText}`);let{src:l,sentences:c}=await s.json();return{src:l,text:c.map(u=>u?.trans).filter(Boolean).join("")}}var xo,$s=g(()=>{"use strict";a();Ve();Fs();xo=Ge("vc-trans-")});function PC({settingsKey:e,includeAuto:t}){let n=_t.use([e])[e],r=Nt(()=>{let i=Object.entries(jl).map(([s,l])=>({value:s,label:l}));return t||i.shift(),i},[]);return o("section",{className:Y.bottom16},o(S.FormTitle,{tag:"h3"},_t.def[e].description),o(ea,{options:r,value:r.find(i=>i.value===n),placeholder:"Select a language",maxVisibleItems:5,closeOnSelect:!0,onChange:i=>_t.store[e]=i}))}function IC(){let e=_t.use(["autoTranslate"]).autoTranslate;return o(pt,{value:e,onChange:t=>_t.store.autoTranslate=t,note:_t.def.autoTranslate.description,hideBorder:!0},"Auto Translate")}function Rx({rootProps:e}){return o(qe,{...e},o(at,{className:xo("modal-header")},o(S.FormTitle,{tag:"h2"},"Translate"),o(cn,{onClick:e.onClose})),o(tt,{className:xo("modal-content")},MC.map(t=>o(PC,{key:t,settingsKey:t,includeAuto:t.endsWith("Input")})),o(S.FormDivider,{className:Y.bottom16}),o(IC,null)))}var MC,Lx=g(()=>{"use strict";a();ct();dt();I();Zf();Fs();$s();MC=["receivedInput","receivedOutput","sentInput","sentOutput"]});function Ti({height:e=24,width:t=24,className:n}){return o("svg",{viewBox:"0 96 960 960",height:e,width:t,className:re(xo("icon"),n)},o("path",{fill:"currentColor",d:"m475 976 181-480h82l186 480h-87l-41-126H604l-47 126h-82Zm151-196h142l-70-194h-2l-70 194Zm-466 76-55-55 204-204q-38-44-67.5-88.5T190 416h87q17 33 37.5 62.5T361 539q45-47 75-97.5T487 336H40v-80h280v-80h80v80h280v80H567q-22 69-58.5 135.5T419 598l98 99-30 81-127-122-200 200Z"}))}function Ex({slateProps:e}){let{autoTranslate:t}=_t.use(["autoTranslate"]);if(e.type.analyticsName!=="normal")return null;let n=()=>_t.store.autoTranslate=!t;return o(V,{text:"Open Translate Modal"},({onMouseEnter:r,onMouseLeave:i})=>o("div",{style:{display:"flex"}},o(E,{"aria-haspopup":"dialog","aria-label":"Open Translate Modal",size:"",look:Xt.BLANK,onMouseEnter:r,onMouseLeave:i,innerClassName:vt.button,onClick:s=>{if(s.shiftKey)return n();Ke(l=>o(Rx,{rootProps:l}))},onContextMenu:()=>n(),style:{padding:"0 4px"}},o("div",{className:vt.buttonWrapper},o(Ti,{className:xo({"auto-translate":t})})))))}var Xf=g(()=>{"use strict";a();Be();dt();I();Fs();Lx();$s()});function Qf(e,t){Jf.get(e)(t)}function AC({onDismiss:e}){return o("button",{onClick:e,className:xo("dismiss")},"Dismiss")}function Dx({message:e}){let[t,n]=J();return _e(()=>{if(!e.vencordEmbeddedBy)return Jf.set(e.id,n),()=>void Jf.delete(e.id)},[]),t?o("span",{className:xo("accessory")},o(Ti,{width:16,height:16}),$e.parse(t.text)," ","(translated from ",jl[t.src]??t.src," - ",o(AC,{onDismiss:()=>n(void 0)}),")"):null}var Jf,Ox=g(()=>{"use strict";a();I();Zf();Xf();$s();Jf=new Map});var _x,Vf,Bx=g(()=>{"use strict";a();kx();Mt();rl();Xn();Ir();le();P();M();I();Fs();Xf();Ox();$s();_x=(e,{message:t})=>()=>{if(!t.content)return;let n=mt("copy-text",e);!n||n.splice(n.findIndex(r=>r?.props?.id==="copy-text")+1,0,o(U.MenuItem,{id:"vc-trans",label:"Translate",icon:Ti,action:async()=>{let r=await Us("received",t.content);Qf(t.id,r)}}))},Vf=y({name:"Translate",description:"Translate messages with Google Translate",authors:[p.Ven],dependencies:["MessageAccessoriesAPI","MessagePopoverAPI","MessageEventsAPI"],settings:_t,translate:Us,patches:[{find:"ChannelTextAreaButtons",replacement:{match:/(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/,replace:"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()"}}],start(){vs("vc-translation",e=>o(Dx,{message:e.message})),ue("message",_x),Un("vc-translate",e=>e.content?{label:"Translate",icon:Ti,message:e,channel:Q.getChannel(e.channel_id),onClick:async()=>{let t=await Us("received",e.content);Qf(e.id,t)}}:null),this.preSend=jt(async(e,t)=>{!_t.store.autoTranslate||!t.content||(t.content=(await Us("sent",t.content)).text)})},stop(){Wt(this.preSend),fe("message",_x),$n("vc-translate"),yd("vc-translation")},chatBarIcon:e=>o(_,{noop:!0},o(Ex,{slateProps:e}))})});function eg({a:e,b:t,count:n}){return[o("strong",{key:"0"},e),", ",o("strong",{key:"1"},t),`, and ${n} others are typing...`]}var Wl,NC,tg,ng=g(()=>{"use strict";a();$();le();P();It();M();I();Wl=D({showAvatars:{type:3,default:!0,description:"Show avatars in the typing indicator"},showRoleColors:{type:3,default:!0,description:"Show role colors in the typing indicator"},alternativeFormatting:{type:3,default:!0,description:"Show a more useful message when several users are typing"}});NC=_.wrap(function({user:e,guildId:t}){return o("strong",{role:"button",onClick:()=>{Fn(e.id)},style:{display:"grid",gridAutoFlow:"column",gap:"4px",color:Wl.store.showRoleColors?Le.getMember(t,e.id)?.colorString:void 0,cursor:"pointer"}},Wl.store.showAvatars&&o("div",{style:{marginTop:"4px"}},o(_r,{size:"SIZE_16",src:e.getAvatarURL(t,128)})),Le.getNick(t,e.id)||!t&&nt.getNickname(e.id)||e.globalName||e.username)},{noop:!0}),tg=y({name:"TypingTweaks",description:"Show avatars and role colours in the typing indicator",authors:[p.zt],patches:[{find:"getCooldownTextStyle",replacement:{match:/(?<=children:\[(\i)\.length>0.{0,200}?"aria-atomic":!0,children:)\i/,replace:"$self.mutateChildren(this.props, $1, $&), style: $self.TYPING_TEXT_STYLE"}},{find:"getCooldownTextStyle",replacement:{match:/(?<=map\(\i=>)\i\.\i\.getName\(\i,this\.props\.channel\.id,(\i)\)/,replace:"$1"}},{find:"getCooldownTextStyle",replacement:{match:/(?<=(\i)\.length\?\i.\i\.Messages.THREE_USERS_TYPING\.format\({\i:(\i),(?:\i:)?(\i),\i:\i}\):)\i\.\i\.Messages\.SEVERAL_USERS_TYPING/,replace:(e,t,n,r)=>`$self.buildSeveralUsers({ a: ${n}, b: ${r}, count: ${t}.length - 2 })`},predicate:()=>Wl.store.alternativeFormatting}],settings:Wl,TYPING_TEXT_STYLE:{display:"grid",gridAutoFlow:"column",gridGap:"0.25em"},buildSeveralUsers:eg,mutateChildren(e,t,n){if(!Array.isArray(n))return n;let r=0;return n.map(i=>i.type==="strong"?o(NC,{...e,user:t[r++]}):i)}})});function Qo(e,t){return Le.getNick(e,t)??W.getUser(t).username}function RC({channelId:e}){let t=We([Fx],()=>({...Fx.getTypingUsers(e)}),null,(l,c)=>{let u=Object.keys(l),d=Object.keys(c);return u.length===d.length&&JSON.stringify(u)===JSON.stringify(d)}),n=Q.getChannel(e).guild_id;if(!og.store.includeMutedChannels&&kC.isChannelMuted(n,e))return null;let r=W.getCurrentUser()?.id,i=Object.keys(t).filter(l=>l!==r&&!(nt.isBlocked(l)&&!og.store.includeBlockedUsers)),s;switch(i.length){case 0:break;case 1:{s=ql.Messages.ONE_USER_TYPING.format({a:Qo(n,i[0])});break}case 2:{s=ql.Messages.TWO_USERS_TYPING.format({a:Qo(n,i[0]),b:Qo(n,i[1])});break}case 3:{s=ql.Messages.THREE_USERS_TYPING.format({a:Qo(n,i[0]),b:Qo(n,i[1]),c:Qo(n,i[2])});break}default:{s=L.plugins.TypingTweaks.enabled?eg({a:Qo(n,i[0]),b:Qo(n,i[1]),count:i.length-2}):ql.Messages.SEVERAL_USERS_TYPING;break}}return i.length>0?o(V,{text:s},({onMouseLeave:l,onMouseEnter:c})=>o("div",{style:{marginLeft:6,height:16,display:"flex",alignItems:"center",zIndex:0,cursor:"pointer"},onMouseLeave:l,onMouseEnter:c},o(CC,{dotRadius:3,themed:!0}))):null}var CC,Fx,kC,ql,og,rg,Ux=g(()=>{"use strict";a();$();le();P();Oe();M();j();I();ng();CC=me(()=>st(t=>t.Dots&&!t.Menu)?.Dots),Fx=Ie("TypingStore"),kC=Ie("UserGuildSettingsStore"),ql=Lt(e=>e.Messages?.SEVERAL_USERS_TYPING);og=D({includeMutedChannels:{type:3,description:"Whether to show the typing indicator for muted channels.",default:!1},includeBlockedUsers:{type:3,description:"Whether to show the typing indicator for blocked users.",default:!1}}),rg=y({name:"TypingIndicator",description:"Adds an indicator if someone is typing on a channel.",authors:[p.Nuckyz,p.obscurity],settings:og,patches:[{find:".UNREAD_HIGHLIGHT",replacement:{match:/channel:(\i).{0,100}?channelEmoji,.{0,250}?\.children.{0,50}?:null/,replace:"$&,$self.TypingIndicator($1.id)"}}],TypingIndicator:e=>o(_,{noop:!0},o(RC,{channelId:e}))})});var ig,$x=g(()=>{"use strict";a();Xn();P();M();ig=y({name:"Unindent",description:"Trims leading indentation from codeblocks",authors:[p.Ven],dependencies:["MessageEventsAPI"],patches:[{find:"inQuote:",replacement:{match:/,content:([^,]+),inQuote/,replace:(e,t)=>`,content:Vencord.Plugins.plugins.Unindent.unindent(${t}),inQuote`}}],unindent(e){e=e.replace(/\t/g," ");let t=e.match(/^ *(?=\S)/gm)?.reduce((n,r)=>Math.min(n,r.length),1/0)??0;return t?e.replace(new RegExp(`^ {${t}}`,"gm"),""):e},unindentMsg(e){e.content=e.content.replace(/```(.|\n)*?```/g,t=>{let n=t.split(` `);if(n.length<2)return t;let r="";return n[n.length-1]==="```"&&(r=n.pop()),`${n[0]} ${this.unindent(n.slice(1).join(` `))} -${r}`})},start(){this.preSend=Ht((e,t)=>this.unindentMsg(t)),this.preEdit=br((e,t,n)=>this.unindentMsg(n))},stop(){zt(this.preSend),Tr(this.preEdit)}})});var ag,Zx,lg,Xx=g(()=>{"use strict";a();Pt();$t();P();w();A();ag=1<<2,Zx=(e,{channel:t,message:{author:n,embeds:r,flags:i,id:s}})=>()=>{let l=(i&ag)!==0;if(!l&&!r.length)return;let c=t.isPrivate()||!!(Ce.getChannelPermissions({id:t.id})&Se.EMBED_LINKS);if(n.id===W.getCurrentUser().id&&!c)return;let u=mt("delete",e),p=u?.findIndex(m=>m?.props?.id==="delete");!p||!u||u.splice(p-1,0,o(G.MenuItem,{id:"unsuppress-embeds",key:"unsuppress-embeds",label:l?"Unsuppress Embeds":"Suppress Embeds",color:l?void 0:"danger",icon:l?Aa:Na,action:()=>Mt.patch({url:`/channels/${t.id}/messages/${s}`,body:{flags:l?i&~ag:i|ag}})}))},lg=y({name:"UnsuppressEmbeds",authors:[d.rad,d.HypedDomi],description:"Allows you to unsuppress embeds in messages",start(){ce("message",Zx)},stop(){de("message",Zx)}})});var cg,Jx=g(()=>{"use strict";a();Qt();Ca();P();w();cg=y({name:"UrbanDictionary",description:"Search for a word on Urban Dictionary via /urban slash command",authors:[d.jewdev],dependencies:["CommandsAPI"],commands:[{name:"urban",description:"Returns the definition of a word from Urban Dictionary",inputType:0,options:[{type:3,name:"word",description:"The word to search for on Urban Dictionary",required:!0}],execute:async(e,t)=>{try{let n=encodeURIComponent(e[0].value),{list:[r]}=await(await fetch(`https://api.urbandictionary.com/v0/define?term=${n}`)).json();if(!r)return void ue(t.channel.id,{content:"No results found."});let i=s=>s.replaceAll(`\r +${r}`})},start(){this.preSend=jt((e,t)=>this.unindentMsg(t)),this.preEdit=br((e,t,n)=>this.unindentMsg(n))},stop(){Wt(this.preSend),Tr(this.preEdit)}})});var sg,Gx,ag,Hx=g(()=>{"use strict";a();Mt();Ht();P();M();I();sg=1<<2,Gx=(e,{channel:t,message:{author:n,embeds:r,flags:i,id:s}})=>()=>{let l=(i&sg)!==0;if(!l&&!r.length)return;let c=t.isPrivate()||!!(Re.getChannelPermissions({id:t.id})&Te.EMBED_LINKS);if(n.id===W.getCurrentUser().id&&!c)return;let u=mt("delete",e),d=u?.findIndex(m=>m?.props?.id==="delete");!d||!u||u.splice(d-1,0,o(U.MenuItem,{id:"unsuppress-embeds",key:"unsuppress-embeds",label:l?"Unsuppress Embeds":"Suppress Embeds",color:l?void 0:"danger",icon:l?Na:Ca,action:()=>wt.patch({url:`/channels/${t.id}/messages/${s}`,body:{flags:l?i&~sg:i|sg}})}))},ag=y({name:"UnsuppressEmbeds",authors:[p.rad,p.HypedDomi],description:"Allows you to unsuppress embeds in messages",start(){ue("message",Gx)},stop(){fe("message",Gx)}})});var lg,zx=g(()=>{"use strict";a();tn();ka();P();M();lg=y({name:"UrbanDictionary",description:"Search for a word on Urban Dictionary via /urban slash command",authors:[p.jewdev],dependencies:["CommandsAPI"],commands:[{name:"urban",description:"Returns the definition of a word from Urban Dictionary",inputType:0,options:[{type:3,name:"word",description:"The word to search for on Urban Dictionary",required:!0}],execute:async(e,t)=>{try{let n=encodeURIComponent(e[0].value),{list:[r]}=await(await fetch(`https://api.urbandictionary.com/v0/define?term=${n}`)).json();if(!r)return void pe(t.channel.id,{content:"No results found."});let i=s=>s.replaceAll(`\r `,` -`).replace(/([*>_`~\\])/gsi,"\\$1").replace(/\[(.+?)\]/g,(l,c)=>`[${c}](https://www.urbandictionary.com/define.php?term=${encodeURIComponent(c)} "Define '${c}' on Urban Dictionary")`).trim();return void ue(t.channel.id,{embeds:[{type:"rich",author:{name:`Uploaded by "${r.author}"`,url:`https://www.urbandictionary.com/author.php?author=${encodeURIComponent(r.author)}`},title:r.word,url:`https://www.urbandictionary.com/define.php?term=${encodeURIComponent(r.word)}`,description:i(r.definition),fields:[{name:"Example",value:i(r.example)},{name:"Want more definitions?",value:`Check out [more definitions](https://www.urbandictionary.com/define.php?term=${n} "Define "${e[0].value}" on Urban Dictionary") on Urban Dictionary.`}],color:16750848,footer:{text:`\u{1F44D} ${r.thumbs_up.toString()} | \u{1F44E} ${r.thumbs_down.toString()}`,icon_url:"https://www.urbandictionary.com/favicon.ico"},timestamp:new Date(r.written_on).toISOString()}]})}catch(n){ue(t.channel.id,{content:`Something went wrong: \`${n}\``})}}}]})});var Qx=g(()=>{});var KC,YC,ZC,Vx,e2=g(()=>{"use strict";a();Qx();j();A();KC=I("selectChannel","selectVoiceChannel"),YC=Pi(".lastSection","children:"),ZC=1n<<20n,Vx=({channel:e,label:t,showHeader:n})=>o(YC,null,n&&o(S.FormTitle,{className:"vc-uvs-header"},"In a voice channel"),o(R,{className:"vc-uvs-button",color:R.Colors.TRANSPARENT,size:R.Sizes.SMALL,onClick:()=>{Ce.can(ZC,e)?KC.selectVoiceChannel(e.id):ee.show({message:"Insufficient permissions to enter the channel.",id:"user-voice-show-insufficient-permissions",type:ee.Type.FAILURE,options:{position:ee.Position.BOTTOM}})}},t))});var XC,ug,t2,pg,n2=g(()=>{"use strict";a();$();le();P();w();j();A();e2();XC=Me("VoiceStateStore"),ug=D({showInUserProfileModal:{type:3,description:"Show a user's voice channel in their profile modal",default:!0},showVoiceChannelSectionHeader:{type:3,description:'Whether to show "IN A VOICE CHANNEL" above the join button',default:!0}}),t2=_.wrap(({user:e})=>{let{channelId:t}=XC.getVoiceStateForUser(e.id)??{};if(!t)return null;let n=Q.getChannel(t);if(!n)return null;let r=Te.getGuild(n.guild_id);if(!r)return null;let i=`${r.name} | ${n.name}`;return o(Vx,{channel:n,label:i,showHeader:ug.store.showVoiceChannelSectionHeader})}),pg=y({name:"UserVoiceShow",description:"Shows whether a User is currently in a voice channel somewhere in their profile",authors:[d.LordElias],settings:ug,patchModal({user:e}){return ug.store.showInUserProfileModal?o("div",{className:"vc-uvs-modal-margin"},o(t2,{user:e})):null},patchPopout:({user:e})=>{let t=e.id===W.getCurrentUser().id;return o("div",{className:t?"vc-uvs-popout-margin-self":""},o(t2,{user:e}))},patches:[{find:".lastEditedByContainer",replacement:{match:/\(0,\i\.jsx\)\(\i\.\i,{user:\i,setNote/,replace:"$self.patchPopout(arguments[0]),$&"}},{find:".USER_PROFILE_MODAL",replacement:{match:/\.body.+?displayProfile:\i}\),/,replace:"$&$self.patchModal(arguments[0]),"}}]})});var o2,r2=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/usrbg/index.css",{name:"src/plugins/usrbg/index.css",source:`:is([class*="userProfile"], [class*="userPopout"]) [class*="bannerPremium"] { +`).replace(/([*>_`~\\])/gsi,"\\$1").replace(/\[(.+?)\]/g,(l,c)=>`[${c}](https://www.urbandictionary.com/define.php?term=${encodeURIComponent(c)} "Define '${c}' on Urban Dictionary")`).trim();return void pe(t.channel.id,{embeds:[{type:"rich",author:{name:`Uploaded by "${r.author}"`,url:`https://www.urbandictionary.com/author.php?author=${encodeURIComponent(r.author)}`},title:r.word,url:`https://www.urbandictionary.com/define.php?term=${encodeURIComponent(r.word)}`,description:i(r.definition),fields:[{name:"Example",value:i(r.example)},{name:"Want more definitions?",value:`Check out [more definitions](https://www.urbandictionary.com/define.php?term=${n} "Define "${e[0].value}" on Urban Dictionary") on Urban Dictionary.`}],color:16750848,footer:{text:`\u{1F44D} ${r.thumbs_up.toString()} | \u{1F44E} ${r.thumbs_down.toString()}`,icon_url:"https://www.urbandictionary.com/favicon.ico"},timestamp:new Date(r.written_on).toISOString()}]})}catch(n){pe(t.channel.id,{content:`Something went wrong: \`${n}\``})}}}]})});var jx=g(()=>{});var LC,EC,DC,Wx,qx=g(()=>{"use strict";a();jx();j();I();LC=A("selectChannel","selectVoiceChannel"),EC=to(".lastSection","children:"),DC=1n<<20n,Wx=({channel:e,label:t,showHeader:n})=>o(EC,null,n&&o(S.FormTitle,{className:"vc-uvs-header"},"In a voice channel"),o(E,{className:"vc-uvs-button",color:E.Colors.TRANSPARENT,size:E.Sizes.SMALL,onClick:()=>{Re.can(DC,e)?LC.selectVoiceChannel(e.id):ee.show({message:"Insufficient permissions to enter the channel.",id:"user-voice-show-insufficient-permissions",type:ee.Type.FAILURE,options:{position:ee.Position.BOTTOM}})}},t))});var OC,cg,Kx,ug,Yx=g(()=>{"use strict";a();$();le();P();M();j();I();qx();OC=Ie("VoiceStateStore"),cg=D({showInUserProfileModal:{type:3,description:"Show a user's voice channel in their profile modal",default:!0},showVoiceChannelSectionHeader:{type:3,description:'Whether to show "IN A VOICE CHANNEL" above the join button',default:!0}}),Kx=_.wrap(({user:e})=>{let{channelId:t}=OC.getVoiceStateForUser(e.id)??{};if(!t)return null;let n=Q.getChannel(t);if(!n)return null;let r=we.getGuild(n.guild_id);if(!r)return null;let i=`${r.name} | ${n.name}`;return o(Wx,{channel:n,label:i,showHeader:cg.store.showVoiceChannelSectionHeader})}),ug=y({name:"UserVoiceShow",description:"Shows whether a User is currently in a voice channel somewhere in their profile",authors:[p.LordElias],settings:cg,patchModal({user:e}){return cg.store.showInUserProfileModal?o("div",{className:"vc-uvs-modal-margin"},o(Kx,{user:e})):null},patchPopout:({user:e})=>{let t=e.id===W.getCurrentUser().id;return o("div",{className:t?"vc-uvs-popout-margin-self":""},o(Kx,{user:e}))},patches:[{find:".lastEditedByContainer",replacement:{match:/\(0,\i\.jsx\)\(\i\.\i,{user:\i,setNote/,replace:"$self.patchPopout(arguments[0]),$&"}},{find:".USER_PROFILE_MODAL",replacement:{match:/\.body.+?displayProfile:\i}\),/,replace:"$&$self.patchModal(arguments[0]),"}}]})});var Zx,Xx=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/usrbg/index.css",{name:"src/plugins/usrbg/index.css",source:`:is([class*="userProfile"], [class*="userPopout"]) [class*="bannerPremium"] { background: center / cover no-repeat; } @@ -197,12 +190,12 @@ ${r}`})},start(){this.preSend=Ht((e,t)=>this.unindentMsg(t)),this.preEdit=br((e, [style*="background-image"] [class*="background_"] { background-color: transparent !important; } -`,classNames:{},dom:null});o2="src/plugins/usrbg/index.css"});var JC,vo,jl,dg,i2=g(()=>{"use strict";a();$();Je();lo();P();w();r2();JC="https://raw.githubusercontent.com/AutumnVN/usrbg/main/usrbg.json",vo={},jl=D({nitroFirst:{description:"Banner to use if both Nitro and USRBG banners are present",type:4,options:[{label:"Nitro banner",value:!0,default:!0},{label:"USRBG banner",value:!1}]},voiceBackground:{description:"Use USRBG banners as voice chat backgrounds",type:3,default:!0,restartNeeded:!0}}),dg=y({name:"USRBG",description:"Displays user banners from USRBG, allowing anyone to get a banner without Nitro",authors:[d.AutumnVN,d.pylix,d.TheKodeToad],settings:jl,patches:[{find:".NITRO_BANNER,",replacement:[{match:/(\i)\.premiumType/,replace:"$self.premiumHook($1)||$&"},{match:/(?<=function \i\((\i)\)\{)(?=var.{30,50},bannerSrc:)/,replace:"$1.bannerSrc=$self.useBannerHook($1);"},{match:/\?\(0,\i\.jsx\)\(\i,{type:\i,shown/,replace:"&&$self.shouldShowBadge(arguments[0])$&"}]},{find:'"data-selenium-video-tile":',predicate:()=>jl.store.voiceBackground,replacement:[{match:/(?<=function\((\i),\i\)\{)(?=let.{20,40},style:)/,replace:"$1.style=$self.voiceBackgroundHook($1);"}]}],data:vo,settingsAboutComponent:()=>o(st,{href:"https://github.com/AutumnVN/usrbg#how-to-request-your-own-usrbg-banner"},"CLICK HERE TO GET YOUR OWN BANNER"),voiceBackgroundHook({className:e,participantUserId:t}){if(e.includes("tile_")&&vo[t])return{backgroundImage:`url(${vo[t]})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}},useBannerHook({displayProfile:e,user:t}){if(!(e?.banner&&jl.store.nitroFirst)&&vo[t.id])return vo[t.id]},premiumHook({userId:e}){if(vo[e])return 2},shouldShowBadge({displayProfile:e,user:t}){return e?.banner&&(!vo[t.id]||jl.store.nitroFirst)},async start(){St(o2);let e=await fetch(JC);e.ok&&(vo=await e.json(),this.data=vo)}})});function QC({data:e,UserMention:t,RoleMention:n,parse:r,props:i}){let[s,l]=J(e.userId);if(s)return o(t,{className:"mention",userId:s,channelId:e.channelId,inlinePreview:i.noStyleAndInteraction,key:i.key});let c=r(e.content,i);return o(n,{...e,inlinePreview:i.formatInline},o("span",{onMouseEnter:()=>{let u=c?.[0]?.props?.children;if(typeof u!="string")return;let p=u.match(/<@!?(\d+)>/)?.[1];if(!p||Wl.has(p))return;if(W.getUser(p))return l(p);let m=()=>{Wl.add(p),s2.unshift(()=>Rt.getUser(p).then(()=>{l(p),Wl.delete(p)}).catch(h=>{h?.status===429&&(s2.unshift(()=>Mo(1e3).then(m)),Wl.delete(p))}).finally(()=>Mo(300)))};m()}},c))}var Wl,s2,mg,a2=g(()=>{"use strict";a();le();P();Re();jr();w();A();Wl=new Set,s2=new kn(5);mg=y({name:"ValidUser",description:"Fix mentions for unknown users showing up as '<@343383572805058560>' (hover over a mention to fix it)",authors:[d.Ven],tags:["MentionCacheFix"],patches:[{find:'className:"mention"',replacement:{match:/react(?=\(\i,\i,\i\).{0,50}return null==\i\?\(0,\i\.jsx\)\((\i\.\i),.+?jsx\)\((\i\.\i),\{className:"mention")/,replace:"react:(...args)=>$self.renderMention($1,$2,...args),originalReact"}}],renderMention(e,t,n,r,i){return o(_,{noop:!0},o(QC,{RoleMention:e,UserMention:t,data:n,parse:r,props:i}))}})});var fg,gg,l2=g(()=>{"use strict";a();P();w();A();fg={},gg=y({name:"VoiceChatDoubleClick",description:"Join voice chats via double click instead of single click",authors:[d.Ven,d.D3SOX],patches:[...[".handleVoiceStatusClick",".handleClickChat"].map(e=>({find:e,replacement:[{match:/onClick:\(\)=>\{this.handleClick\(\)/g,replace:"onClick:()=>{$self.schedule(()=>{this.handleClick()},this)"}]})),{find:".shouldCloseDefaultModals",replacement:{match:/onClick:(\i)(?=,.{0,30}className:"channelMention".+?(\i)\.inContent)/,replace:(e,t,n)=>`onClick:(vcDoubleClickEvt)=>$self.shouldRunOnClick(vcDoubleClickEvt,${n})&&${t}()`}}],shouldRunOnClick(e,{channelId:t}){let n=Q.getChannel(t);return!n||![2,13].includes(n.type)?!0:e.detail>=2},schedule(e,t){let n=t.props.channel.id;if(Pe.getVoiceChannelId()===n){e();return}let r=fg[n]??={timeout:void 0,i:0};clearTimeout(r.timeout),++r.i>=2?(e(),delete fg[n]):r.timeout=setTimeout(()=>{delete fg[n]},500)}})});function Kl(e,t=E.plugins.VcNarrator){if(!e)return;let n=new SpeechSynthesisUtterance(e),r=speechSynthesis.getVoices().find(i=>i.voiceURI===t.voice);!r&&(new ie("VcNarrator").error(`Voice "${t.voice}" not found. Resetting to default.`),r=speechSynthesis.getVoices().find(i=>i.default),t.voice=r?.voiceURI,!r)||(n.voice=r,n.volume=t.volume,n.rate=t.rate,speechSynthesis.speak(n))}function ql(e){let t=E.plugins.VcNarrator.latinOnly?/[^\p{Script=Latin}\p{Number}\p{Punctuation}\s]/gu:/[^\p{Letter}\p{Number}\p{Punctuation}\s]/gu;return e.normalize("NFKC").replace(t,"").replace(/_{2,}/g,"_").trim()}function Yl(e,t,n,r,i){return e.replaceAll("{{USER}}",ql(t)||(t?"Someone":"")).replaceAll("{{CHANNEL}}",ql(n)||"channel").replaceAll("{{DISPLAY_NAME}}",ql(r)||(r?"Someone":"")).replaceAll("{{NICKNAME}}",ql(i)||(i?"Someone":""))}function VC({channelId:e,oldChannelId:t},n){if(n&&e!==hg&&(t=hg,hg=e),e!==t){if(e)return[t?"move":"join",e];if(t)return["leave",t]}return["",""]}function ek(e,t){let n=Object.assign({},E.plugins.VcNarrator,e),r=W.getCurrentUser(),i=on.getGuildId();Kl(Yl(n[t+"Message"],r.username,"general",r.globalName??r.username,ke.getNick(i,r.id)??r.username),n)}var c2,hg,yg,u2=g(()=>{"use strict";a();$();Hr();P();Ze();at();ro();w();j();A();c2=I("getVoiceStatesForChannel","getCurrentClientVoiceChannelId");yg=y({name:"VcNarrator",description:"Announces when users join, leave, or move voice channels via narrator",authors:[d.Ven],flux:{VOICE_STATE_UPDATES({voiceStates:e}){let t=on.getGuildId(),n=Pe.getVoiceChannelId(),r=W.getCurrentUser().id;if(Q.getChannel(n)?.type!==13)for(let i of e){let{userId:s,channelId:l,oldChannelId:c}=i,u=s===r;if(!u&&(!n||l!==n&&c!==n))continue;let[p,m]=VC(i,u);if(!p)continue;let h=E.plugins.VcNarrator[p+"Message"],v=u&&!E.plugins.VcNarrator.sayOwnName?"":W.getUser(s).username,T=v&&(W.getUser(s).globalName??v),M=v&&(ke.getNick(t,s)??v),b=Q.getChannel(m).name;Kl(Yl(h,v,b,T,M))}},AUDIO_TOGGLE_SELF_MUTE(){let e=Pe.getVoiceChannelId(),t=c2.getVoiceStateForChannel(e);if(!t)return;let n=t.mute||t.selfMute?"unmute":"mute";Kl(Yl(E.plugins.VcNarrator[n+"Message"],"",Q.getChannel(e).name,"",""))},AUDIO_TOGGLE_SELF_DEAF(){let e=Pe.getVoiceChannelId(),t=c2.getVoiceStateForChannel(e);if(!t)return;let n=t.deaf||t.selfDeaf?"undeafen":"deafen";Kl(Yl(E.plugins.VcNarrator[n+"Message"],"",Q.getChannel(e).name,"",""))}},start(){if(typeof speechSynthesis>"u"||speechSynthesis.getVoices().length===0){new ie("VcNarrator").warn("SpeechSynthesis not supported or no Narrator voices found. Thus, this plugin will not work. Check my Settings for more info");return}},optionsCache:null,get options(){return this.optionsCache??={voice:{type:4,description:"Narrator Voice",options:window.speechSynthesis?.getVoices().map(e=>({label:e.name,value:e.voiceURI,default:e.default}))??[]},volume:{type:5,description:"Narrator Volume",default:1,markers:[0,.25,.5,.75,1],stickToMarkers:!1},rate:{type:5,description:"Narrator Speed",default:1,markers:[.1,.5,1,2,5,10],stickToMarkers:!1},sayOwnName:{description:"Say own name",type:3,default:!1},latinOnly:{description:"Strip non latin characters from names before saying them",type:3,default:!1},joinMessage:{type:0,description:"Join Message",default:"{{USER}} joined"},leaveMessage:{type:0,description:"Leave Message",default:"{{USER}} left"},moveMessage:{type:0,description:"Move Message",default:"{{USER}} moved to {{CHANNEL}}"},muteMessage:{type:0,description:"Mute Message (only self for now)",default:"{{USER}} Muted"},unmuteMessage:{type:0,description:"Unmute Message (only self for now)",default:"{{USER}} unmuted"},deafenMessage:{type:0,description:"Deafen Message (only self for now)",default:"{{USER}} deafened"},undeafenMessage:{type:0,description:"Undeafen Message (only self for now)",default:"{{USER}} undeafened"}}},settingsAboutComponent({tempSettings:e}){let[t,n]=Nt(()=>{let s=speechSynthesis.getVoices();return[s.length!==0,s.some(l=>l.lang.startsWith("en"))]},[]),r=Nt(()=>Object.keys(Vencord.Plugins.plugins.VcNarrator.options).filter(s=>s.endsWith("Message")).map(s=>s.slice(0,-7)),[]),i=null;if(t)n||(i=o(hn,null,"You don't have any English voices installed, so the narrator might sound weird"));else{let s="No narrator voices found. ";s+=navigator.platform?.toLowerCase().includes("linux")?"Install speech-dispatcher or espeak and run Discord with the --enable-speech-dispatcher flag":"Try installing some in the Narrator settings of your Operating System",i=o(hn,null,s)}return o(S.FormSection,null,o(S.FormText,null,"You can customise the spoken messages below. You can disable specific messages by setting them to nothing"),o(S.FormText,null,"The special placeholders ",o("code",null,"{{USER}}"),", ",o("code",null,"{{DISPLAY_NAME}}"),", ",o("code",null,"{{NICKNAME}}")," and ",o("code",null,"{{CHANNEL}}")," ","will be replaced with the user's name (nothing if it's yourself), the user's display name, the user's nickname on current server and the channel's name respectively"),n&&o(f,null,o(S.FormTitle,{className:q.top20,tag:"h3"},"Play Example Sounds"),o("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"1rem"},className:"vc-narrator-buttons"},r.map(s=>o(R,{key:s,onClick:()=>ek(e,s)},oo([s]))))),i)}})});var p2=g(()=>{});function nk(e){let t=[];for(let n of Object.values(Vencord.Plugins.plugins))n.toolboxActions&&t.push(o(G.MenuGroup,{label:n.name,key:`vc-toolbox-${n.name}`},Object.entries(n.toolboxActions).map(([r,i])=>{let s=`vc-toolbox-${n.name}-${r}`;return o(G.MenuItem,{id:s,key:s,label:r,action:i})})));return o(G.Menu,{navId:"vc-toolbox",onClose:e},o(G.MenuItem,{id:"vc-toolbox-notifications",label:"Open Notification Log",action:da}),o(G.MenuCheckboxItem,{id:"vc-toolbox-quickcss-toggle",checked:E.useQuickCss,label:"Enable QuickCSS",action:()=>{E.useQuickCss=!E.useQuickCss,e()}}),o(G.MenuItem,{id:"vc-toolbox-quickcss",label:"Open QuickCSS",action:()=>VencordNative.quickCss.openEditor()}),...t)}function ok(e){return o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 27 27",width:24,height:24},o("path",{fill:"currentColor",d:e?"M9 0h1v1h1v2h1v2h3V3h1V1h1V0h1v2h1v2h1v7h-1v-1h-3V9h1V6h-1v4h-3v1h1v-1h2v1h3v1h-1v1h-3v2h1v1h1v1h1v3h-1v4h-2v-1h-1v-4h-1v4h-1v1h-2v-4H9v-3h1v-1h1v-1h1v-2H9v-1H8v-1h3V6h-1v3h1v1H8v1H7V4h1V2h1M5 19h2v1h1v1h1v3H4v-1h2v-1H4v-2h1m15-1h2v1h1v2h-2v1h2v1h-5v-3h1v-1h1m4 3h4v1h-4":"M0 0h7v1H6v1H5v1H4v1H3v1H2v1h5v1H0V6h1V5h1V4h1V3h1V2h1V1H0m13 2h5v1h-1v1h-1v1h-1v1h3v1h-5V7h1V6h1V5h1V4h-3m8 5h1v5h1v-1h1v1h-1v1h1v-1h1v1h-1v3h-1v1h-2v1h-1v1h1v-1h2v-1h1v2h-1v1h-2v1h-1v-1h-1v1h-6v-1h-1v-1h-1v-2h1v1h2v1h3v1h1v-1h-1v-1h-3v-1h-4v-4h1v-2h1v-1h1v-1h1v2h1v1h1v-1h1v1h-1v1h2v-2h1v-2h1v-1h1M8 14h2v1H9v4h1v2h1v1h1v1h1v1h4v1h-6v-1H5v-1H4v-5h1v-1h1v-2h2m17 3h1v3h-1v1h-1v1h-1v2h-2v-2h2v-1h1v-1h1m1 0h1v3h-1v1h-2v-1h1v-1h1"}))}function rk(){let[e,t]=J(!1);return o(Ii,{position:"bottom",align:"right",animation:Ii.Animation.NONE,shouldShow:e,onRequestClose:()=>t(!1),renderPopout:()=>nk(()=>t(!1))},(n,{isShown:r})=>o(tk,{className:"vc-toolbox-btn",onClick:()=>t(i=>!i),tooltip:r?null:"Vencord Toolbox",icon:()=>ok(r),selected:r}))}function ik({children:e}){return e.splice(e.length-1,0,o(_,{noop:!0},o(rk,null))),o(f,null,e)}var tk,vg,d2=g(()=>{"use strict";a();p2();ma();$();le();P();Qe();w();j();A();tk=tt(()=>{let e=Ke.byCode(".HEADER_BAR_BADGE");return Ot(t=>t.Icon&&e(t.Icon)).Icon});vg=y({name:"VencordToolbox",description:"Adds a button next to the inbox button in the channel header that houses Vencord quick actions",authors:[d.Ven,d.AutumnVN],patches:[{find:"toolbar:function",replacement:{match:/(?<=toolbar:function.{0,100}\()\i.Fragment,/,replace:"$self.ToolboxFragmentWrapper,"}}],ToolboxFragmentWrapper:_.wrap(ik,{fallback:()=>o("p",{style:{color:"red"}},"Failed to render :(")})})});function Hs(e){let t=e.startsWith("/")?"png":Sg.store.format,n=new URL(e,window.location.href);n.searchParams.set("size",Sg.store.imgSize),n.pathname=n.pathname.replace(/\.(png|jpe?g|webp)$/,`.${t}`),e=n.toString(),n.searchParams.set("size","4096");let r=n.toString();On(e,{original:r,height:256})}var Zl,Sg,m2,f2,bg,g2=g(()=>{"use strict";a();Pt();$();$t();P();bt();w();j();A();Zl=I("getGuildBannerURL"),Sg=D({format:{type:4,description:"Choose the image format to use for non animated images. Animated images will always use .gif",options:[{label:"webp",value:"webp",default:!0},{label:"png",value:"png"},{label:"jpg",value:"jpg"}]},imgSize:{type:4,description:"The image size to use",options:["128","256","512","1024","2048","4096"].map(e=>({label:e,value:e,default:e==="1024"}))}});m2=(e,{user:t,guildId:n})=>()=>{if(!t)return;let r=ke.getMember(n,t.id)?.avatar||null;e.splice(-1,0,o(G.MenuGroup,null,o(G.MenuItem,{id:"view-avatar",label:"View Avatar",action:()=>Hs(Zl.getUserAvatarURL(t,!0)),icon:vr}),r&&o(G.MenuItem,{id:"view-server-avatar",label:"View Server Avatar",action:()=>Hs(Zl.getGuildMemberAvatarURLSimple({userId:t.id,avatar:r,guildId:n,canAnimate:!0},!0)),icon:vr})))},f2=(e,{guild:t})=>()=>{if(!t)return;let{id:n,icon:r,banner:i}=t;!i&&!r||e.splice(-1,0,o(G.MenuGroup,null,r?o(G.MenuItem,{id:"view-icon",label:"View Icon",action:()=>Hs(Zl.getGuildIconURL({id:n,icon:r,canAnimate:!0})),icon:vr}):null,i?o(G.MenuItem,{id:"view-banner",label:"View Banner",action:()=>Hs(Zl.getGuildBannerURL({id:n,banner:i},!0)),icon:vr}):null))},bg=y({name:"ViewIcons",authors:[d.Ven,d.TheKodeToad,d.Nuckyz],description:"Makes avatars and banners in user profiles clickable, and adds View Icon/Banner entries in the user and server context menu",tags:["ImageUtilities"],settings:Sg,openImage:Hs,start(){ce("user-context",m2),ce("guild-context",f2)},stop(){de("user-context",m2),de("guild-context",f2)},patches:[{find:"User Profile Modal - Context Menu",replacement:{match:/\{src:(\i)(?=,avatarDecoration)/,replace:"{src:$1,onClick:()=>$self.openImage($1)"}},{find:".NITRO_BANNER,",replacement:{match:/style:\{(?=backgroundImage:(\i&&\i)\?"url\("\.concat\((\i),)/,replace:'onClick:ev=>$1&&ev.target.style.backgroundImage&&$self.openImage($2),style:{cursor:$1?"pointer":void 0,'}},{find:".avatarPositionPanel",replacement:{match:/(?<=avatarWrapperNonUserBot.{0,50})onClick:(\i\|\|\i)\?void 0(?<=,avatarSrc:(\i).+?)/,replace:'style:($1)?{cursor:"pointer"}:{},onClick:$1?()=>{$self.openImage($2)}'}}]})});function Tg(e){return o("div",{className:sk.markup},Fe.defaultRules.codeBlock.react(e,null,{}))}var sk,h2=g(()=>{"use strict";a();j();A();sk=I("markup","codeContainer")});function ak(e){return Object.fromEntries(Object.entries(e).sort(([t],[n])=>t.localeCompare(n)))}function lk(e){let t=ak(JSON.parse(JSON.stringify(e)));for(let r of["email","phone","mfaEnabled","personalConnectionId"])delete t.author[r];let n=t;return delete n.editHistory,delete n.deleted,n.attachments?.forEach(r=>delete r.deleted),t}function S2(e,t,n){let r=je(i=>o(_,null,o(ze,{...i,size:"large"},o(lt,null,o(re,{variant:"heading-lg/semibold",style:{flexGrow:1}},"View Raw"),o(an,{onClick:()=>Vn(r)})),o(et,null,o("div",{style:{padding:"16px 0"}},!!n&&o(f,null,o(S.FormTitle,{tag:"h5"},"Content"),o(Tg,{content:n,lang:""}),o(S.FormDivider,{className:q.bottom20})),o(S.FormTitle,{tag:"h5"},t," Data"),o(Tg,{content:e,lang:"json"}))),o(_t,null,o(ge,{cellSpacing:10},o(R,{onClick:()=>gn(e,`${t} data copied to clipboard!`)},"Copy ",t," JSON"),!!n&&o(R,{onClick:()=>gn(n,"Content copied to clipboard!")},"Copy Raw Content"))))))}function y2(e){e=lk(e);let t=JSON.stringify(e,null,4);return S2(t,"Message",e.content)}function bi(e){return(n,r)=>()=>{if(e==="Guild"&&!r.guild||e==="User"&&!r.user)return;let i=n.at(-1);if(i?.key==="developer-actions"){let s=i.props;Array.isArray(s.children)||(s.children=[s.children]),{children:n}=s}n.splice(-1,0,o(G.MenuItem,{id:`vc-view-${e.toLowerCase()}-raw`,label:"View Raw",action:()=>S2(JSON.stringify(r[e.toLowerCase()],null,4),e),icon:v2}))}}var v2,Xl,xg,b2=g(()=>{"use strict";a();Pt();Ir();$();h2();le();Lt();P();at();Re();dt();w();A();v2=()=>o("svg",{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",width:"18",height:"18"},o("path",{d:"M12.9297 3.25007C12.7343 3.05261 12.4154 3.05226 12.2196 3.24928L11.5746 3.89824C11.3811 4.09297 11.3808 4.40733 11.5739 4.60245L16.5685 9.64824C16.7614 9.84309 16.7614 10.1569 16.5685 10.3517L11.5739 15.3975C11.3808 15.5927 11.3811 15.907 11.5746 16.1017L12.2196 16.7507C12.4154 16.9477 12.7343 16.9474 12.9297 16.7499L19.2604 10.3517C19.4532 10.1568 19.4532 9.84314 19.2604 9.64832L12.9297 3.25007Z"}),o("path",{d:"M8.42616 4.60245C8.6193 4.40733 8.61898 4.09297 8.42545 3.89824L7.78047 3.24928C7.58466 3.05226 7.26578 3.05261 7.07041 3.25007L0.739669 9.64832C0.5469 9.84314 0.546901 10.1568 0.739669 10.3517L7.07041 16.7499C7.26578 16.9474 7.58465 16.9477 7.78047 16.7507L8.42545 16.1017C8.61898 15.907 8.6193 15.5927 8.42616 15.3975L3.43155 10.3517C3.23869 10.1569 3.23869 9.84309 3.43155 9.64824L8.42616 4.60245Z"}));Xl=D({clickMethod:{description:"Change the button to view the raw content/data of any message.",type:4,options:[{label:"Left Click to view the raw content.",value:"Left",default:!0},{label:"Right click to view the raw content.",value:"Right"}]}});xg=y({name:"ViewRaw",description:"Copy and view the raw content/data of any message, channel or guild",authors:[d.KingFish,d.Ven,d.rad,d.ImLvna],dependencies:["MessagePopoverAPI"],settings:Xl,start(){Bn("ViewRaw",e=>{let t=()=>{Xl.store.clickMethod==="Right"?gn(e.content):y2(e)},n=i=>{Xl.store.clickMethod==="Left"?(i.preventDefault(),i.stopPropagation(),gn(e.content)):(i.preventDefault(),i.stopPropagation(),y2(e))};return{label:Xl.store.clickMethod==="Right"?"Copy Raw (Left Click) / View Raw (Right Click)":"View Raw (Left Click) / Copy Raw (Right Click)",icon:v2,message:e,channel:Q.getChannel(e.channel_id),onClick:t,onContextMenu:n}}),ce("guild-context",bi("Guild")),ce("channel-context",bi("Channel")),ce("user-context",bi("User"))},stop(){Fn("CopyRawMessage"),de("guild-context",bi("Guild")),de("channel-context",bi("Channel")),de("user-context",bi("User"))}})});var T2=g(()=>{});var Ti,Jl=g(()=>{"use strict";a();$();w();Ti=D({noiseSuppression:{type:3,description:"Noise Suppression",default:!0},echoCancellation:{type:3,description:"Echo Cancellation",default:!0}})});var Aoe,x2=g(()=>{"use strict";a();A();Jl();Aoe=VencordNative.pluginHelpers.VoiceMessages});var Qo,wg=g(()=>{"use strict";a();Je();Qo=Ue("vc-vmsg-")});var ck,w2,M2=g(()=>{"use strict";a();Qe();j();wg();ck=Xe("waveform:"),w2=({src:e,waveform:t,recording:n})=>{let r=Di({deps:[n]}),i=n?Math.floor(r/1e3):0,s=Math.floor(i/60)+":"+(i%60).toString().padStart(2,"0");return e&&!n?o(ck,{key:e,src:e,waveform:t}):o("div",{className:Qo("preview",n?"preview-recording":[])},o("div",{className:Qo("preview-indicator")}),o("div",{className:Qo("preview-time")},s),o("div",{className:Qo("preview-label")},n?"RECORDING":"----"))}});var P2,I2=g(()=>{"use strict";a();A();Jl();P2=({setAudioBlob:e,onRecordingChange:t})=>{let[n,r]=J(!1),[i,s]=J(!1),[l,c]=J(),[u,p]=J([]),m=v=>{r(v),t?.(v)};function h(){!n?navigator.mediaDevices.getUserMedia({audio:{echoCancellation:Ti.store.echoCancellation,noiseSuppression:Ti.store.noiseSuppression}}).then(T=>{let M=[];p(M);let b=new MediaRecorder(T);c(b),b.addEventListener("dataavailable",x=>{M.push(x.data)}),b.start(),m(!0)}):l&&(l.addEventListener("stop",()=>{e(new Blob(u,{type:"audio/ogg; codecs=opus"})),m(!1)}),l.stop())}return o(f,null,o(R,{onClick:h},n?"Stop":"Start"," recording"),o(R,{disabled:!n,onClick:()=>{s(!i),i?l?.resume():l?.pause()}},i?"Resume":"Pause"," recording"))}});function fk(e,t){let n=Pe.getChannelId(),r=dk.getPendingReply(n);r&&F.dispatch({type:"DELETE_PENDING_REPLY",channelId:n});let i=new uk.CloudUpload({file:new File([e],"voice-message.ogg",{type:"audio/ogg; codecs=opus"}),isClip:!1,isThumbnail:!1,platform:1},n,!1,0);i.on("complete",()=>{Mt.post({url:`/channels/${n}/messages`,body:{flags:1<<13,channel_id:n,content:"",nonce:zn.fromTimestamp(Date.now()),sticker_ids:[],type:0,attachments:[{id:"0",filename:i.filename,uploaded_filename:i.uploadedFilename,waveform:t.waveform,duration_secs:t.duration}],message_reference:r?pk.getSendMessageOptionsForReply(r)?.messageReference:null}})}),i.on("error",()=>fn("Failed to upload voice message",ee.Type.FAILURE)),i.upload()}function gk(){let[e,t]=J();return[e,r=>{e&&URL.revokeObjectURL(e),t(URL.createObjectURL(r))}]}function hk({modalProps:e}){let[t,n]=J(!1),[r,i]=J(),[s,l]=gk();De(()=>()=>{s&&URL.revokeObjectURL(s)},[s]);let[c]=rt(async()=>{if(!r)return A2;let p=await new AudioContext().decodeAudioData(await r.arrayBuffer()),m=p.getChannelData(0),h=new Uint8Array(cr.clamp(Math.floor(p.duration*10),Math.min(32,m.length),256)),v=Math.floor(m.length/h.length);for(let b=0;b{i(u),l(u)},onRecordingChange:n}),o(R,{onClick:async()=>{let u=await ba("audio/*");u&&(i(u),l(u))}},"Upload File")),o(S.FormTitle,null,"Preview"),o(w2,{src:s,waveform:c.waveform,recording:t})),o(_t,null,o(R,{disabled:!r,onClick:()=>{fk(r,c),e.onClose(),fn("Now sending voice message... Please be patient",ee.Type.MESSAGE)}},"Send")))}var uk,pk,dk,Mg,mk,Pg,A2,N2,C2=g(()=>{"use strict";a();T2();Pt();$t();P();dt();Qe();w();Ta();j();A();x2();Jl();wg();M2();I2();uk=I("CloudUpload"),pk=I("getSendMessageOptionsForReply","sendMessage"),dk=Me("PendingReplyStore"),Mg=I("optionName","optionIcon","optionLabel"),mk=P2,Pg=y({name:"VoiceMessages",description:"Allows you to send voice messages like on mobile. To do so, right click the upload button and click Send Voice Message",authors:[d.Ven,d.Vap,d.Nickyux],settings:Ti,start(){ce("channel-attach",N2)},stop(){de("channel-attach",N2)}}),A2={waveform:"AAAAAAAAAAAA",duration:1};N2=(e,t)=>()=>{t.channel.guild_id&&!(Ce.can(Se.SEND_VOICE_MESSAGES,t.channel)&&Ce.can(Se.SEND_MESSAGES,t.channel))||e.push(o(G.MenuItem,{id:"vc-send-vmsg",label:o("div",{className:Mg.optionLabel},o(Sy,{className:Mg.optionIcon,height:24,width:24}),o("div",{className:Mg.optionName},"Send voice message")),action:()=>je(n=>o(hk,{modalProps:n}))}))}});async function yk(e){let t=await fetch(e);if(t.status===200)return await t.blob()}var kr,Ig,k2=g(()=>{"use strict";a();$();P();w();Ta();j();A();kr=D({addBack:{type:3,description:"Add back the Discord context menus for images, links and the chat input bar",default:!0,restartNeeded:!0}}),Ig=y({name:"WebContextMenus",description:"Re-adds context menus missing in the web version of Discord: Links & Images (Copy/Open Link/Image), Text Area (Copy, Cut, Paste, SpellCheck)",authors:[d.Ven],enabledByDefault:!0,required:!0,settings:kr,start(){if(kr.store.addBack){let e=pn("contextMenuCallbackNative");window.removeEventListener("contextmenu",e.contextMenuCallbackWeb),window.addEventListener("contextmenu",e.contextMenuCallbackNative),this.changedListeners=!0}},stop(){if(this.changedListeners){let e=pn("contextMenuCallbackNative");window.removeEventListener("contextmenu",e.contextMenuCallbackNative),window.addEventListener("contextmenu",e.contextMenuCallbackWeb)}},patches:[{find:"open-native-link",replacement:[{match:/if\(!\i\.\i\|\|null==/,replace:"if(null=="},{match:/\i\.\i\.copy/,replace:"Vencord.Webpack.Common.Clipboard.copy"}]},{find:'id:"copy-image"',replacement:[{match:/!\i\.isPlatformEmbedded/,replace:"false"},{match:/return\s*?\[\i\.\i\.canCopyImage\(\)/,replace:"return [true"},{match:/(?<=COPY_IMAGE_MENU_ITEM,)action:/,replace:"action:()=>$self.copyImage(arguments[0]),oldAction:"},{match:/(?<=SAVE_IMAGE_MENU_ITEM,)action:/,replace:"action:()=>$self.saveImage(arguments[0]),oldAction:"}]},{find:'navId:"image-context"',predicate:()=>kr.store.addBack,replacement:{match:/return \i\.\i\?/,replace:"return true?"}},{find:'"interactionUsernameProfile"',predicate:()=>kr.store.addBack,replacement:{match:/if\((?="A"===\i\.tagName&&""!==\i\.textContent)/,replace:"if(false&&"}},{find:'getElementById("slate-toolbar"',predicate:()=>kr.store.addBack,replacement:{match:/(?<=handleContextMenu\(\i\)\{.{0,200}isPlatformEmbedded)\?/,replace:"||true?"}},{find:".SLASH_COMMAND_SUGGESTIONS_TOGGLED,{",predicate:()=>kr.store.addBack,replacement:[{match:/if\(!\i\.\i\)return null;/,replace:""},{match:/\b\i\.\i\.(copy|cut|paste)/g,replace:"$self.$1"}]},{find:'"add-to-dictionary"',predicate:()=>kr.store.addBack,replacement:{match:/let\{text:\i=""/,replace:"return [null,null];$&"}}],async copyImage(e){let t=new Image;t.onload=()=>{let n=document.createElement("canvas");n.width=t.naturalWidth,n.height=t.naturalHeight,n.getContext("2d").drawImage(t,0,0),n.toBlob(r=>{navigator.clipboard.write([new ClipboardItem({"image/png":r})])},"image/png")},t.crossOrigin="anonymous",t.src=e},async saveImage(e){let t=await yk(e);if(!t)return;let n=new URL(e).pathname.split("/").pop(),r=new File([t],n,{type:t.type});Sa(r)},copy(){let e=document.getSelection();!e||Zt.copy(e.toString())},cut(){this.copy(),wo.dispatch("INSERT_TEXT",{rawText:""})},async paste(){let e=(await navigator.clipboard.read())[0];if(!e)return;let t=new DataTransfer;for(let n of e.types)if(n==="image/png"){let r=new File([await e.getType(n)],"unknown.png",{type:n});t.items.add(r)}else if(n==="text/plain"){let r=await e.getType(n);t.setData(n,await r.text())}document.dispatchEvent(new ClipboardEvent("paste",{clipboardData:t}))}})});var Ag,Ng,R2=g(()=>{"use strict";a();P();w();j();A();Ag=I("JUMP_TO_GUILD","SERVER_NEXT"),Ng=y({name:"WebKeybinds",description:"Re-adds keybinds missing in the web version of Discord: ctrl+t, ctrl+shift+t, ctrl+tab, ctrl+shift+tab, ctrl+1-9, ctrl+,. Only works fully on Vesktop/ArmCord, not inside your browser",authors:[d.Ven],enabledByDefault:!0,onKey(e){if(e.ctrlKey||e.metaKey&&navigator.platform.includes("Mac"))switch(e.key){case"t":case"T":e.preventDefault(),e.shiftKey?(on.getGuildId()&&pr.transitionToGuild("@me"),wo.safeDispatch("TOGGLE_DM_CREATE")):F.dispatch({type:"QUICKSWITCHER_SHOW",query:"",queryMode:null});break;case",":e.preventDefault(),Qn.open("My Account");break;case"Tab":(e.shiftKey?Ag.SERVER_PREV:Ag.SERVER_NEXT).action(e);break;default:e.key>="1"&&e.key<="9"&&(e.preventDefault(),Ag.JUMP_TO_GUILD.action(e,`mod+${e.key}`));break}},start(){document.addEventListener("keydown",this.onKey)},stop(){document.removeEventListener("keydown",this.onKey)}})});function Tk(e,t,n){let r=t.name+(t.id?`:${t.id}`:"");return Mt.get({url:`/channels/${e.channel_id}/messages/${e.id}/reactions/${r}`,query:{limit:100,type:n},oldFormErrors:!0}).then(i=>F.dispatch({type:"MESSAGE_REACTION_ADD_USERS",channelId:e.channel_id,messageId:e.id,users:i.body,emoji:t,reactionType:n})).catch(console.error).finally(()=>Mo(250))}function xk(e,t,n){let r=`${e.id}:${t.name}:${t.id??""}:${n}`,i=L2[r]??={fetched:!1,users:{}};return i.fetched||(bk.unshift(()=>Tk(e,t,n)),i.fetched=!0),i.users}function wk(e){return function(n,r){return o(V,{text:e.slice(5).map(i=>i.username).join(", ")},({onMouseEnter:i,onMouseLeave:s})=>o("div",{className:Sk.moreUsers,onMouseEnter:i,onMouseLeave:s},"+",e.length-5))}}function Mk(e){e.stopPropagation()}var vk,Sk,bk,L2,Cg,E2=g(()=>{"use strict";a();le();P();Re();jr();Qe();w();j();A();vk=Xe("defaultRenderUser","showDefaultAvatarsForNullUsers"),Sk=I("moreUsers","emptyUser","avatarContainer","clickableAvatar"),bk=new kn;Cg=y({name:"WhoReacted",description:"Renders the avatars of users who reacted to a message",authors:[d.Ven,d.KannaDev],patches:[{find:",reactionRef:",replacement:{match:/(\i)\?null:\(0,\i\.jsx\)\(\i\.\i,{className:\i\.reactionCount,.*?}\),/,replace:"$&$1?null:$self.renderUsers(this.props),"}},{find:'.displayName="MessageReactionsStore";',replacement:{match:/(?<=CONNECTION_OPEN:function\(\){)(\i)={}/,replace:"$&;$self.reactions=$1"}}],renderUsers(e){return e.message.reactions.length>10?null:o(_,{noop:!0},o(this._renderUsers,{...e}))},_renderUsers({message:e,emoji:t,type:n}){let r=Po();O.useEffect(()=>{let l=c=>{c.messageId===e.id&&r()};return F.subscribe("MESSAGE_REACTION_ADD_USERS",l),()=>F.unsubscribe("MESSAGE_REACTION_ADD_USERS",l)},[e.id]);let i=xk(e,t,n),s=Object.values(i).filter(Boolean);for(let l of s)F.dispatch({type:"USER_UPDATE",user:l});return o("div",{style:{marginLeft:"0.5em",transform:"scale(0.9)"}},o("div",{onClick:Mk},o(vk,{users:s,guildId:Q.getChannel(e.channel_id)?.guild_id,renderIcon:!1,max:5,showDefaultAvatarsForNullUsers:!0,showUserPopout:!0,renderMoreUsers:wk(s)})))},set reactions(e){L2=e}})});var kg,D2=g(()=>{"use strict";a();Qt();P();w();kg=y({name:"Wikisearch",description:"Searches Wikipedia for your requested query. (/wikisearch)",authors:[d.Samu],dependencies:["CommandsAPI"],commands:[{name:"wikisearch",description:"Searches Wikipedia for your request.",inputType:0,options:[{name:"search",description:"Word to search for",type:3,required:!0}],execute:async(e,t)=>{let n=it(e,"search","");if(!n)return ue(t.channel.id,{content:"No word was defined!"});let r=new URLSearchParams({action:"query",format:"json",list:"search",formatversion:"2",origin:"*",srsearch:n}),i=await fetch("https://en.wikipedia.org/w/api.php?"+r).then(u=>u.json()).catch(u=>(console.log(u),ue(t.channel.id,{content:"There was an error. Check the console for more info"}),null));if(!i)return;if(!i.query?.search?.length)return console.log(i),ue(t.channel.id,{content:"No results given"});let s=await fetch(`https://en.wikipedia.org/w/api.php?action=query&format=json&prop=info%7Cdescription%7Cimages%7Cimageinfo%7Cpageimages&list=&meta=&indexpageids=1&pageids=${i.query.search[0].pageid}&formatversion=2&origin=*`).then(u=>u.json()).then(u=>u.query.pages[0]).catch(u=>(console.log(u),ue(t.channel.id,{content:"There was an error. Check the console for more info"}),null));if(!s)return;let l=s.thumbnail,c=l&&{url:l.source.replace(/(50px-)/ig,"1000px-"),height:l.height*100,width:l.width*100};ue(t.channel.id,{embeds:[{type:"rich",title:i.query.search[0].title,url:`https://wikipedia.org/w/index.php?curid=${i.query.search[0].pageid}`,color:"0x8663BE",description:i.query.search[0].snippet.replace(/( |<([^>]+)>)/ig,"").replace(/(")/ig,'"')+"...",image:c,footer:{text:"Powered by the Wikimedia API"}}]})}}]})});var Oe,gr=g(()=>{a();fh();gh();hh();yh();vh();Sh();bh();Th();xh();wh();Mh();Hu();uv();pv();dv();mv();hv();yv();Zu();Mv();Pv();Iv();Av();Dv();_v();Bv();Gv();qv();Kv();Yv();Xv();Jv();o1();i1();s1();d1();f1();g1();B1();H1();z1();q1();K1();Y1();Z1();J1();Q1();n0();i0();s0();u0();rd();Qa();x0();M0();A0();k0();E0();_0();j0();q0();K0();Y0();X0();J0();Q0();V0();eS();tS();nS();rS();iS();sS();aS();lS();cS();uS();pS();dS();mS();fS();gS();SS();bS();Ms();DS();BS();ZS();XS();VS();nb();fb();gb();Ib();Ab();Nb();Gb();Hb();Wb();qb();Zb();Xb();Vb();rT();dT();YT();ZT();tx();If();lx();cx();ux();px();dx();Tx();xx();Mx();Ax();Nx();Ox();_x();Bx();Wx();Kx();og();Yx();Xx();Jx();n2();i2();a2();l2();u2();d2();g2();b2();C2();k2();R2();E2();D2();Oe={[Pc.name]:Pc,[Ic.name]:Ic,[Ac.name]:Ac,[Nc.name]:Nc,[Cc.name]:Cc,[kc.name]:kc,[Rc.name]:Rc,[Lc.name]:Lc,[Ec.name]:Ec,[Dc.name]:Dc,[Oc.name]:Oc,[ss.name]:ss,[zu.name]:zu,[ju.name]:ju,[Wu.name]:Wu,[qu.name]:qu,[Ku.name]:Ku,[Yu.name]:Yu,[Qu.name]:Qu,[Vu.name]:Vu,[ep.name]:ep,[tp.name]:tp,[np.name]:np,[op.name]:op,[rp.name]:rp,[ip.name]:ip,[mp.name]:mp,[fp.name]:fp,[gp.name]:gp,[yp.name]:yp,[vp.name]:vp,[xp.name]:xp,[Mp.name]:Mp,[Pp.name]:Pp,[Ip.name]:Ip,[Np.name]:Np,[kp.name]:kp,[Rp.name]:Rp,[Up.name]:Up,[$p.name]:$p,[Gp.name]:Gp,[Hp.name]:Hp,[zp.name]:zp,[jp.name]:jp,[Wp.name]:Wp,[Kp.name]:Kp,[Yp.name]:Yp,[Xp.name]:Xp,[Qp.name]:Qp,[Vp.name]:Vp,[ed.name]:ed,[sd.name]:sd,[cd.name]:cd,[ud.name]:ud,[md.name]:md,[fd.name]:fd,[gd.name]:gd,[yd.name]:yd,[Td.name]:Td,[Md.name]:Md,[Pd.name]:Pd,[Id.name]:Id,[Ad.name]:Ad,[Cd.name]:Cd,[Ld.name]:Ld,[Ed.name]:Ed,[Dd.name]:Dd,[Od.name]:Od,[_d.name]:_d,[Bd.name]:Bd,[$d.name]:$d,[Gd.name]:Gd,[Hd.name]:Hd,[zd.name]:zd,[jd.name]:jd,[Wd.name]:Wd,[qd.name]:qd,[Kd.name]:Kd,[Yd.name]:Yd,[Zd.name]:Zd,[Xd.name]:Xd,[Jd.name]:Jd,[Qd.name]:Qd,[em.name]:em,[am.name]:am,[lm.name]:lm,[cm.name]:cm,[fm.name]:fm,[gm.name]:gm,[Im.name]:Im,[Cm.name]:Cm,[Lm.name]:Lm,[Em.name]:Em,[Dm.name]:Dm,[_m.name]:_m,[Um.name]:Um,[Ym.name]:Ym,[Zm.name]:Zm,[Xm.name]:Xm,[Jm.name]:Jm,[Qm.name]:Qm,[Vm.name]:Vm,[ef.name]:ef,[of.name]:of,[rf.name]:rf,[wf.name]:wf,[Mf.name]:Mf,[Pf.name]:Pf,[Af.name]:Af,[Nf.name]:Nf,[Cf.name]:Cf,[Lf.name]:Lf,[Ef.name]:Ef,[Df.name]:Df,[Bf.name]:Bf,[Uf.name]:Uf,[Hf.name]:Hf,[zf.name]:zf,[Wf.name]:Wf,[Kf.name]:Kf,[Yf.name]:Yf,[Zf.name]:Zf,[eg.name]:eg,[ig.name]:ig,[ng.name]:ng,[sg.name]:sg,[lg.name]:lg,[cg.name]:cg,[pg.name]:pg,[dg.name]:dg,[mg.name]:mg,[gg.name]:gg,[yg.name]:yg,[vg.name]:vg,[bg.name]:bg,[xg.name]:xg,[Pg.name]:Pg,[Ig.name]:Ig,[Ng.name]:Ng,[Cg.name]:Cg,[kg.name]:kg}});var Lg={};Be(Lg,{BadgePosition:()=>sa,_getBadges:()=>Pk,addBadge:()=>Am,removeBadge:()=>Nm});function Am(e){e.component&&=_.wrap(e.component,{noop:!0}),Rg.add(e)}function Nm(e){return Rg.delete(e)}function Pk(e){let t=[];for(let r of Rg)(!r.shouldShow||r.shouldShow(e))&&(r.position===0?t.unshift({...r,...e}):t.push({...r,...e}));let n=Oe.BadgeAPI.getDonorBadges(e.user.id);return n&&t.unshift(...n),t}var sa,Rg,aa=g(()=>{"use strict";a();le();gr();sa=(n=>(n[n.START=0]="START",n[n.END=1]="END",n))(sa||{}),Rg=new Set});var Eg={};Be(Eg,{Badges:()=>kk,Commands:()=>Ak,ContextMenu:()=>Bk,DataStore:()=>Gt,MemberListDecorators:()=>Ek,MessageAccessories:()=>Nk,MessageDecorations:()=>Lk,MessageEvents:()=>Ik,MessagePopover:()=>Ck,Notices:()=>Al,Notifications:()=>_k,ServerList:()=>Rk,Settings:()=>Dk,Styles:()=>Ok});var Ik,Al,Ak,Gt,Nk,Ck,kk,Rk,Lk,Ek,Dk,Ok,_k,Bk,as=g(()=>{"use strict";a();aa();Qt();Pt();Wn();Sm();nl();wm();Yn();Ir();Pa();Ao();Pl();$();Je();Ik=dp,Al=gu,Ak=wu,Gt=eo,Nk=Sd,Ck=Jp,kk=Lg,Rk=Fm,Lk=xm,Ek=vm,Dk=au,Ok=jc,_k=qc,Bk=Bc});function Fk(e,t,n){let r=t;if(t in e)return void n(e[r]);Object.defineProperty(e,t,{set(i){delete e[r],e[r]=i,n(i)},configurable:!0,enumerable:!1})}var O2=g(()=>{"use strict";a()});var Dg={};Be(Dg,{ChangeList:()=>os,Devs:()=>d,DevsById:()=>Gr,ImageModal:()=>xc,LazyComponent:()=>tt,Logger:()=>ie,Margins:()=>q,ModalCloseButton:()=>an,ModalContent:()=>et,ModalFooter:()=>_t,ModalHeader:()=>lt,ModalRoot:()=>ze,ModalSize:()=>Io,Modals:()=>Cn,NoopComponent:()=>sw,Queue:()=>kn,REACT_GLOBAL:()=>ow,SUPPORT_CHANNEL_ID:()=>na,Theme:()=>ns,VENCORD_USER_AGENT:()=>gc,WEBPACK_CHUNK:()=>jn,canonicalizeDescriptor:()=>hp,canonicalizeMatch:()=>xr,canonicalizeReplace:()=>Ba,canonicalizeReplacement:()=>us,checkIntersecting:()=>yc,classes:()=>oe,closeAllModals:()=>wc,closeModal:()=>Vn,copyWithToast:()=>gn,debounce:()=>yn,fetchUserProfile:()=>Nu,formatDuration:()=>Ji,getCurrentChannel:()=>Vr,getCurrentGuild:()=>Au,getTheme:()=>Uo,getUniqueUsername:()=>ao,gitHash:()=>sn,gitRemote:()=>ta,humanFriendlyJoin:()=>lM,identity:()=>oa,insertTextIntoChatInputBox:()=>so,isMobile:()=>iw,isNonNullish:()=>wp,isObject:()=>rw,isObjectEmpty:()=>Li,isPluginDev:()=>Ei,isTruthy:()=>Ua,localStorage:()=>mr,makeCodeblock:()=>Qi,makeLazy:()=>xo,mergeDefaults:()=>dr,onceDefined:()=>Fk,onlyOnce:()=>uu,openImageModal:()=>On,openModal:()=>je,openModalLazy:()=>_i,openPrivateChannel:()=>yM,openUserProfile:()=>_n,parseUrl:()=>hc,proxyLazy:()=>yt,sendMessage:()=>vM,sleep:()=>Mo,useAwaiter:()=>rt,useForceUpdater:()=>Po,useIntersection:()=>vc,useTimer:()=>Di,wordsFromCamel:()=>yu,wordsFromKebab:()=>tM,wordsFromPascal:()=>vu,wordsFromSnake:()=>eM,wordsFromTitle:()=>nM,wordsToCamel:()=>oM,wordsToKebab:()=>iM,wordsToPascal:()=>sM,wordsToSnake:()=>rM,wordsToTitle:()=>oo});var _2=g(()=>{"use strict";a();Ou();P();zr();bt();$a();wn();ca();Ze();at();Re();dt();O2();pu();ps();jr();Qe();ro();});var Bg={};Be(Bg,{toggle:()=>Og});function _g(e){let t=document.createElement("style");return t.id=e,document.documentElement.append(t),t}async function Uk(){let e=await VencordNative.themes.getSystemValues(),t=Object.entries(e).filter(([,n])=>n!=="#").map(([n,r])=>`--${n}: ${r};`).join("");_g("vencord-os-theme-values").textContent=`:root{${t}}`}async function Og(e){xi?xi.disabled=!e:e&&(xi=_g("vencord-custom-css"),VencordNative.quickCss.addChangeListener(t=>{xi.textContent=t,xi.disabled=!E.useQuickCss}),xi.textContent=await VencordNative.quickCss.get())}async function Ql(){B2??=_g("vencord-themes");let{themeLinks:e,enabledThemes:t}=E,n=[...e];{let r=t.map(i=>`vencord:///themes/${i}?v=${Date.now()}`);n.push(...r)}B2.textContent=n.map(r=>`@import url("${r.trim()}");`).join(` -`)}var xi,B2,Fg=g(()=>{"use strict";a();$();document.addEventListener("DOMContentLoaded",()=>{Uk(),Ql(),Og(E.useQuickCss),Wi("useQuickCss",Og),Wi("themeLinks",Ql),Wi("enabledThemes",Ql),VencordNative.quickCss.addThemeChangeListener(Ql)})});var Ug={};Be(Ug,{Common:()=>fc,_initWebpack:()=>Ys,_resolveReady:()=>Ks,addListener:()=>J2,cache:()=>Jn,extract:()=>Zs,filters:()=>Ke,find:()=>Ot,findAll:()=>rr,findBulk:()=>rc,findByCode:()=>jg,findByCodeLazy:()=>Pi,findByProps:()=>pn,findByPropsLazy:()=>I,findComponentByCode:()=>qg,findComponentByCodeLazy:()=>Xe,findComponentLazy:()=>sc,findExportedComponentLazy:()=>ac,findLazy:()=>un,findModuleId:()=>ic,findStore:()=>Wg,findStoreLazy:()=>Me,listeners:()=>oc,onceReady:()=>nc,removeListener:()=>Q2,search:()=>lc,subscriptions:()=>zg,waitFor:()=>ut,wreq:()=>Mn});var Vl=g(()=>{"use strict";a();A();j()});function U2(e){function t(n){try{$2(n[1])}catch(r){xn.error("Error in handlePush",r)}return t.$$vencordOriginal.call(e,n)}t.$$vencordOriginal=e.push,t.bind=(...n)=>t.$$vencordOriginal.bind(...n),Object.defineProperty(e,"push",{get:()=>t,set(n){t.$$vencordOriginal=n},configurable:!0})}function $2(e){let{subscriptions:t,listeners:n}=Vencord.Webpack,{patches:r}=Vencord.Plugins;for(let i in e){let s=e[i],l="0,"+s.toString().replaceAll(` -`,""),c=s,u=new Set,p=e[i]=function(m,h,v){try{s(m,h,v)}catch(M){if(s===c)throw M;return xn.error("Error in patched chunk",M),void c(m,h,v)}if(h=m.exports,!h)return;if(h===window){Object.defineProperty(v.c,i,{value:v.c[i],enumerable:!1,configurable:!0,writable:!0});return}let T=Number(i);for(let M of n)try{M(h,T)}catch(b){xn.error("Error in webpack listener",b)}for(let[M,b]of t)try{M(h)?(t.delete(M),b(h,T)):h.default&&M(h.default)&&(t.delete(M),b(h.default,T))}catch(x){xn.error("Error while firing callback for webpack chunk",x)}};p.toString=()=>s.toString(),p.original=c;for(let m=0;ml.replace(T,M));if(!(h.predicate&&!h.predicate())&&l.includes(h.find)){u.add(h.plugin);let T=s,M=l;for(let b of h.replacement){if(b.predicate&&!b.predicate())continue;let x=s,N=l;us(b,h.plugin);try{let k=v(b.match,b.replace);if(k===l){if(h.noWarn||xn.warn(`Patch by ${h.plugin} had no effect (Module id is ${i}): ${b.match}`),h.group){xn.warn(`Undoing patch ${h.find} by ${h.plugin} because replacement ${b.match} had no effect`),l=M,s=T,u.delete(h.plugin);break}}else l=k,s=(0,eval)(`// Webpack Module ${i} - Patched by ${[...u].join(", ")} -${k} -//# sourceURL=WebpackModule${i}`)}catch(k){if(xn.error(`Patch by ${h.plugin} errored (Module id is ${i}): ${b.match} -`,k),u.delete(h.plugin),h.group){xn.warn(`Undoing patch ${h.find} by ${h.plugin} because replacement ${b.match} errored`),l=M,s=T;break}l=N,s=x}}h.all||r.splice(m--,1)}}}}var F2,xn,G2=g(()=>{"use strict";a();P();Ze();ps();qs();Vl();xn=new ie("WebpackInterceptor","#8caaee");window[jn]?(xn.info(`Patching ${jn}.push (was already existent, likely from cache!)`),Ys(window[jn]),U2(window[jn])):(Object.defineProperty(window,jn,{get:()=>F2,set:e=>{e?.push&&(e.push.$$vencordOriginal||(xn.info(`Patching ${jn}.push`),U2(e)),Ys(e)&&(xn.info("Successfully initialised Vencord webpack"),delete window[jn],window[jn]=e)),F2=e},configurable:!0}),Object.defineProperty(Function.prototype,"m",{set(e){new Error().stack?.includes("discord.com")&&(xn.info("Found webpack module factory"),$2(e),delete Function.prototype.m),Object.defineProperty(this,"m",{value:e,configurable:!0})},configurable:!0}))});var Hk={};Be(Hk,{Api:()=>Eg,PlainSettings:()=>Kn,Plugins:()=>Uu,QuickCss:()=>Bg,Settings:()=>E,Updater:()=>cu,Util:()=>Dg,Webpack:()=>Ug});async function $k(){if(E.cloud.authenticated&&await It("Vencord_cloudSecret")===null){Ie({title:"Cloud Integrations",body:"We've noticed you have cloud integrations enabled in another client! Due to limitations, you will need to re-authenticate to continue using them. Click here to go to the settings page to do so!",color:"var(--yellow-360)",onClick:()=>Qn.open("VencordCloud")});return}E.cloud.settingsSync&&E.cloud.authenticated&&(mr.Vencord_settingsDirty?(await Kr(),delete mr.Vencord_settingsDirty):await xa(!1)&&Ie({title:"Cloud Settings",body:"Your settings have been updated! Click here to restart to fully apply changes!",color:"var(--green-360)",onClick:ln}))}async function Gk(){await nc,rs("WebpackReady"),$k();try{if(!await Zr())return;if(E.autoUpdate){await Xr(),E.autoUpdateNotification&&setTimeout(()=>Ie({title:"Vencord has been updated!",body:"Click here to restart",permanent:!0,noPersist:!0,onClick:ln}),1e4);return}E.notifyAboutUpdates&&setTimeout(()=>Ie({title:"A Vencord update is available!",body:"Click here to view the update",permanent:!0,noPersist:!0,onClick(){Qn.open("VencordUpdater")}}),1e4)}catch(e){hr.error("Failed to check for updates",e)}}var mx=g(()=>{a();as();Oa();_2();Fg();yr();Vl();Fg();G2();w();Wn();Ao();$();Oa();ca();Ro();ji();yr();Vl();A();rs("Init");Gk();document.addEventListener("DOMContentLoaded",()=>{rs("DOMContentLoaded")},{once:!0})});mx();return To(Hk);})(); +`,classNames:{},dom:null});Zx="src/plugins/usrbg/index.css"});var _C,wo,Kl,pg,Jx=g(()=>{"use strict";a();$();Ve();mo();P();M();Xx();_C="https://raw.githubusercontent.com/AutumnVN/usrbg/main/usrbg.json",wo={},Kl=D({nitroFirst:{description:"Banner to use if both Nitro and USRBG banners are present",type:4,options:[{label:"Nitro banner",value:!0,default:!0},{label:"USRBG banner",value:!1}]},voiceBackground:{description:"Use USRBG banners as voice chat backgrounds",type:3,default:!0,restartNeeded:!0}}),pg=y({name:"USRBG",description:"Displays user banners from USRBG, allowing anyone to get a banner without Nitro",authors:[p.AutumnVN,p.pylix,p.TheKodeToad],settings:Kl,patches:[{find:".NITRO_BANNER,",replacement:[{match:/(\i)\.premiumType/,replace:"$self.premiumHook($1)||$&"},{match:/(?<=function \i\((\i)\)\{)(?=var.{30,50},bannerSrc:)/,replace:"$1.bannerSrc=$self.useBannerHook($1);"},{match:/\?\(0,\i\.jsx\)\(\i,{type:\i,shown/,replace:"&&$self.shouldShowBadge(arguments[0])$&"}]},{find:'"data-selenium-video-tile":',predicate:()=>Kl.store.voiceBackground,replacement:[{match:/(?<=function\((\i),\i\)\{)(?=let.{20,40},style:)/,replace:"$1.style=$self.voiceBackgroundHook($1);"}]}],data:wo,settingsAboutComponent:()=>o(it,{href:"https://github.com/AutumnVN/usrbg#how-to-request-your-own-usrbg-banner"},"CLICK HERE TO GET YOUR OWN BANNER"),voiceBackgroundHook({className:e,participantUserId:t}){if(e.includes("tile_")&&wo[t])return{backgroundImage:`url(${wo[t]})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}},useBannerHook({displayProfile:e,user:t}){if(!(e?.banner&&Kl.store.nitroFirst)&&wo[t.id])return wo[t.id]},premiumHook({userId:e}){if(wo[e])return 2},shouldShowBadge({displayProfile:e,user:t}){return e?.banner&&(!wo[t.id]||Kl.store.nitroFirst)},async start(){St(Zx);let e=await fetch(_C);e.ok&&(wo=await e.json(),this.data=wo)}})});function BC({data:e,UserMention:t,RoleMention:n,parse:r,props:i}){let[s,l]=J(e.userId);if(s)return o(t,{className:"mention",userId:s,channelId:e.channelId,inlinePreview:i.noStyleAndInteraction,key:i.key});let c=r(e.content,i);return o(n,{...e,inlinePreview:i.formatInline},o("span",{onMouseEnter:()=>{let u=c?.[0]?.props?.children;if(typeof u!="string")return;let d=u.match(/<@!?(\d+)>/)?.[1];if(!d||Yl.has(d))return;if(W.getUser(d))return l(d);let m=()=>{Yl.add(d),Qx.unshift(()=>Et.getUser(d).then(()=>{l(d),Yl.delete(d)}).catch(h=>{h?.status===429&&(Qx.unshift(()=>No(1e3).then(m)),Yl.delete(d))}).finally(()=>No(300)))};m()}},c))}var Yl,Qx,dg,Vx=g(()=>{"use strict";a();le();P();Be();qr();M();I();Yl=new Set,Qx=new Ln(5);dg=y({name:"ValidUser",description:"Fix mentions for unknown users showing up as '<@343383572805058560>' (hover over a mention to fix it)",authors:[p.Ven],tags:["MentionCacheFix"],patches:[{find:'className:"mention"',replacement:{match:/react(?=\(\i,\i,\i\).{0,50}return null==\i\?\(0,\i\.jsx\)\((\i\.\i),.+?jsx\)\((\i\.\i),\{className:"mention")/,replace:"react:(...args)=>$self.renderMention($1,$2,...args),originalReact"}}],renderMention(e,t,n,r,i){return o(_,{noop:!0},o(BC,{RoleMention:e,UserMention:t,data:n,parse:r,props:i}))}})});var mg,fg,ew=g(()=>{"use strict";a();P();M();I();mg={},fg=y({name:"VoiceChatDoubleClick",description:"Join voice chats via double click instead of single click",authors:[p.Ven,p.D3SOX],patches:[...[".handleVoiceStatusClick",".handleClickChat"].map(e=>({find:e,replacement:[{match:/onClick:\(\)=>\{this.handleClick\(\)/g,replace:"onClick:()=>{$self.schedule(()=>{this.handleClick()},this)"}]})),{find:".shouldCloseDefaultModals",replacement:{match:/onClick:(\i)(?=,.{0,30}className:"channelMention".+?(\i)\.inContent)/,replace:(e,t,n)=>`onClick:(vcDoubleClickEvt)=>$self.shouldRunOnClick(vcDoubleClickEvt,${n})&&${t}()`}}],shouldRunOnClick(e,{channelId:t}){let n=Q.getChannel(t);return!n||![2,13].includes(n.type)?!0:e.detail>=2},schedule(e,t){let n=t.props.channel.id;if(Ae.getVoiceChannelId()===n){e();return}let r=mg[n]??={timeout:void 0,i:0};clearTimeout(r.timeout),++r.i>=2?(e(),delete mg[n]):r.timeout=setTimeout(()=>{delete mg[n]},500)}})});function Xl(e,t=L.plugins.VcNarrator){if(!e)return;let n=new SpeechSynthesisUtterance(e),r=speechSynthesis.getVoices().find(i=>i.voiceURI===t.voice);!r&&(new ie("VcNarrator").error(`Voice "${t.voice}" not found. Resetting to default.`),r=speechSynthesis.getVoices().find(i=>i.default),t.voice=r?.voiceURI,!r)||(n.voice=r,n.volume=t.volume,n.rate=t.rate,speechSynthesis.speak(n))}function Zl(e){let t=L.plugins.VcNarrator.latinOnly?/[^\p{Script=Latin}\p{Number}\p{Punctuation}\s]/gu:/[^\p{Letter}\p{Number}\p{Punctuation}\s]/gu;return e.normalize("NFKC").replace(t,"").replace(/_{2,}/g,"_").trim()}function Jl(e,t,n,r,i){return e.replaceAll("{{USER}}",Zl(t)||(t?"Someone":"")).replaceAll("{{CHANNEL}}",Zl(n)||"channel").replaceAll("{{DISPLAY_NAME}}",Zl(r)||(r?"Someone":"")).replaceAll("{{NICKNAME}}",Zl(i)||(i?"Someone":""))}function FC({channelId:e,oldChannelId:t},n){if(n&&e!==gg&&(t=gg,gg=e),e!==t){if(e)return[t?"move":"join",e];if(t)return["leave",t]}return["",""]}function UC(e,t){let n=Object.assign({},L.plugins.VcNarrator,e),r=W.getCurrentUser(),i=sn.getGuildId();Xl(Jl(n[t+"Message"],r.username,"general",r.globalName??r.username,Le.getNick(i,r.id)??r.username),n)}var tw,gg,hg,nw=g(()=>{"use strict";a();$();jr();P();Je();ct();lo();M();j();I();tw=A("getVoiceStatesForChannel","getCurrentClientVoiceChannelId");hg=y({name:"VcNarrator",description:"Announces when users join, leave, or move voice channels via narrator",authors:[p.Ven],flux:{VOICE_STATE_UPDATES({voiceStates:e}){let t=sn.getGuildId(),n=Ae.getVoiceChannelId(),r=W.getCurrentUser().id;if(Q.getChannel(n)?.type!==13)for(let i of e){let{userId:s,channelId:l,oldChannelId:c}=i,u=s===r;if(!u&&(!n||l!==n&&c!==n))continue;let[d,m]=FC(i,u);if(!d)continue;let h=L.plugins.VcNarrator[d+"Message"],v=u&&!L.plugins.VcNarrator.sayOwnName?"":W.getUser(s).username,T=v&&(W.getUser(s).globalName??v),w=v&&(Le.getNick(t,s)??v),b=Q.getChannel(m).name;Xl(Jl(h,v,b,T,w))}},AUDIO_TOGGLE_SELF_MUTE(){let e=Ae.getVoiceChannelId(),t=tw.getVoiceStateForChannel(e);if(!t)return;let n=t.mute||t.selfMute?"unmute":"mute";Xl(Jl(L.plugins.VcNarrator[n+"Message"],"",Q.getChannel(e).name,"",""))},AUDIO_TOGGLE_SELF_DEAF(){let e=Ae.getVoiceChannelId(),t=tw.getVoiceStateForChannel(e);if(!t)return;let n=t.deaf||t.selfDeaf?"undeafen":"deafen";Xl(Jl(L.plugins.VcNarrator[n+"Message"],"",Q.getChannel(e).name,"",""))}},start(){if(typeof speechSynthesis>"u"||speechSynthesis.getVoices().length===0){new ie("VcNarrator").warn("SpeechSynthesis not supported or no Narrator voices found. Thus, this plugin will not work. Check my Settings for more info");return}},optionsCache:null,get options(){return this.optionsCache??={voice:{type:4,description:"Narrator Voice",options:window.speechSynthesis?.getVoices().map(e=>({label:e.name,value:e.voiceURI,default:e.default}))??[]},volume:{type:5,description:"Narrator Volume",default:1,markers:[0,.25,.5,.75,1],stickToMarkers:!1},rate:{type:5,description:"Narrator Speed",default:1,markers:[.1,.5,1,2,5,10],stickToMarkers:!1},sayOwnName:{description:"Say own name",type:3,default:!1},latinOnly:{description:"Strip non latin characters from names before saying them",type:3,default:!1},joinMessage:{type:0,description:"Join Message",default:"{{USER}} joined"},leaveMessage:{type:0,description:"Leave Message",default:"{{USER}} left"},moveMessage:{type:0,description:"Move Message",default:"{{USER}} moved to {{CHANNEL}}"},muteMessage:{type:0,description:"Mute Message (only self for now)",default:"{{USER}} Muted"},unmuteMessage:{type:0,description:"Unmute Message (only self for now)",default:"{{USER}} unmuted"},deafenMessage:{type:0,description:"Deafen Message (only self for now)",default:"{{USER}} deafened"},undeafenMessage:{type:0,description:"Undeafen Message (only self for now)",default:"{{USER}} undeafened"}}},settingsAboutComponent({tempSettings:e}){let[t,n]=Nt(()=>{let s=speechSynthesis.getVoices();return[s.length!==0,s.some(l=>l.lang.startsWith("en"))]},[]),r=Nt(()=>Object.keys(Vencord.Plugins.plugins.VcNarrator.options).filter(s=>s.endsWith("Message")).map(s=>s.slice(0,-7)),[]),i=null;if(t)n||(i=o(Sn,null,"You don't have any English voices installed, so the narrator might sound weird"));else{let s="No narrator voices found. ";s+=navigator.platform?.toLowerCase().includes("linux")?"Install speech-dispatcher or espeak and run Discord with the --enable-speech-dispatcher flag":"Try installing some in the Narrator settings of your Operating System",i=o(Sn,null,s)}return o(S.FormSection,null,o(S.FormText,null,"You can customise the spoken messages below. You can disable specific messages by setting them to nothing"),o(S.FormText,null,"The special placeholders ",o("code",null,"{{USER}}"),", ",o("code",null,"{{DISPLAY_NAME}}"),", ",o("code",null,"{{NICKNAME}}")," and ",o("code",null,"{{CHANNEL}}")," ","will be replaced with the user's name (nothing if it's yourself), the user's display name, the user's nickname on current server and the channel's name respectively"),n&&o(f,null,o(S.FormTitle,{className:Y.top20,tag:"h3"},"Play Example Sounds"),o("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"1rem"},className:"vc-narrator-buttons"},r.map(s=>o(E,{key:s,onClick:()=>UC(e,s)},ao([s]))))),i)}})});var ow=g(()=>{});function GC(e){let t=[];for(let n of Object.values(Vencord.Plugins.plugins))n.toolboxActions&&t.push(o(U.MenuGroup,{label:n.name,key:`vc-toolbox-${n.name}`},Object.entries(n.toolboxActions).map(([r,i])=>{let s=`vc-toolbox-${n.name}-${r}`;return o(U.MenuItem,{id:s,key:s,label:r,action:i})})));return o(U.Menu,{navId:"vc-toolbox",onClose:e},o(U.MenuItem,{id:"vc-toolbox-notifications",label:"Open Notification Log",action:ma}),o(U.MenuCheckboxItem,{id:"vc-toolbox-quickcss-toggle",checked:L.useQuickCss,label:"Enable QuickCSS",action:()=>{L.useQuickCss=!L.useQuickCss,e()}}),o(U.MenuItem,{id:"vc-toolbox-quickcss",label:"Open QuickCSS",action:()=>VencordNative.quickCss.openEditor()}),...t)}function HC(e){return o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 27 27",width:24,height:24},o("path",{fill:"currentColor",d:e?"M9 0h1v1h1v2h1v2h3V3h1V1h1V0h1v2h1v2h1v7h-1v-1h-3V9h1V6h-1v4h-3v1h1v-1h2v1h3v1h-1v1h-3v2h1v1h1v1h1v3h-1v4h-2v-1h-1v-4h-1v4h-1v1h-2v-4H9v-3h1v-1h1v-1h1v-2H9v-1H8v-1h3V6h-1v3h1v1H8v1H7V4h1V2h1M5 19h2v1h1v1h1v3H4v-1h2v-1H4v-2h1m15-1h2v1h1v2h-2v1h2v1h-5v-3h1v-1h1m4 3h4v1h-4":"M0 0h7v1H6v1H5v1H4v1H3v1H2v1h5v1H0V6h1V5h1V4h1V3h1V2h1V1H0m13 2h5v1h-1v1h-1v1h-1v1h3v1h-5V7h1V6h1V5h1V4h-3m8 5h1v5h1v-1h1v1h-1v1h1v-1h1v1h-1v3h-1v1h-2v1h-1v1h1v-1h2v-1h1v2h-1v1h-2v1h-1v-1h-1v1h-6v-1h-1v-1h-1v-2h1v1h2v1h3v1h1v-1h-1v-1h-3v-1h-4v-4h1v-2h1v-1h1v-1h1v2h1v1h1v-1h1v1h-1v1h2v-2h1v-2h1v-1h1M8 14h2v1H9v4h1v2h1v1h1v1h1v1h4v1h-6v-1H5v-1H4v-5h1v-1h1v-2h2m17 3h1v3h-1v1h-1v1h-1v2h-2v-2h2v-1h1v-1h1m1 0h1v3h-1v1h-2v-1h1v-1h1"}))}function zC(){let[e,t]=J(!1);return o(Ai,{position:"bottom",align:"right",animation:Ai.Animation.NONE,shouldShow:e,onRequestClose:()=>t(!1),renderPopout:()=>GC(()=>t(!1))},(n,{isShown:r})=>o($C,{className:"vc-toolbox-btn",onClick:()=>t(i=>!i),tooltip:r?null:"Vencord Toolbox",icon:()=>HC(r),selected:r}))}function jC({children:e}){return e.splice(e.length-1,0,o(_,{noop:!0},o(zC,null))),o(f,null,e)}var $C,yg,rw=g(()=>{"use strict";a();ow();fa();$();le();P();Oe();M();j();I();$C=me(()=>{let e=ce.byCode(".HEADER_BAR_BADGE");return st(t=>t.Icon&&e(t.Icon)).Icon});yg=y({name:"VencordToolbox",description:"Adds a button next to the inbox button in the channel header that houses Vencord quick actions",authors:[p.Ven,p.AutumnVN],patches:[{find:"toolbar:function",replacement:{match:/(?<=toolbar:function.{0,100}\()\i.Fragment,/,replace:"$self.ToolboxFragmentWrapper,"}}],ToolboxFragmentWrapper:_.wrap(jC,{fallback:()=>o("p",{style:{color:"red"}},"Failed to render :(")})})});function Gs(e){let t=e.startsWith("/")?"png":vg.store.format,n=new URL(e,window.location.href);n.searchParams.set("size",vg.store.imgSize),n.pathname=n.pathname.replace(/\.(png|jpe?g|webp)$/,`.${t}`),e=n.toString(),n.searchParams.set("size","4096");let r=n.toString();Bn(e,{original:r,height:256})}var Ql,vg,iw,sw,Sg,aw=g(()=>{"use strict";a();Mt();$();Ht();P();It();M();j();I();Ql=A("getGuildBannerURL"),vg=D({format:{type:4,description:"Choose the image format to use for non animated images. Animated images will always use .gif",options:[{label:"webp",value:"webp",default:!0},{label:"png",value:"png"},{label:"jpg",value:"jpg"}]},imgSize:{type:4,description:"The image size to use",options:["128","256","512","1024","2048","4096"].map(e=>({label:e,value:e,default:e==="1024"}))}});iw=(e,{user:t,guildId:n})=>()=>{if(!t)return;let r=Le.getMember(n,t.id)?.avatar||null;e.splice(-1,0,o(U.MenuGroup,null,o(U.MenuItem,{id:"view-avatar",label:"View Avatar",action:()=>Gs(Ql.getUserAvatarURL(t,!0)),icon:vr}),r&&o(U.MenuItem,{id:"view-server-avatar",label:"View Server Avatar",action:()=>Gs(Ql.getGuildMemberAvatarURLSimple({userId:t.id,avatar:r,guildId:n,canAnimate:!0},!0)),icon:vr})))},sw=(e,{guild:t})=>()=>{if(!t)return;let{id:n,icon:r,banner:i}=t;!i&&!r||e.splice(-1,0,o(U.MenuGroup,null,r?o(U.MenuItem,{id:"view-icon",label:"View Icon",action:()=>Gs(Ql.getGuildIconURL({id:n,icon:r,canAnimate:!0})),icon:vr}):null,i?o(U.MenuItem,{id:"view-banner",label:"View Banner",action:()=>Gs(Ql.getGuildBannerURL({id:n,banner:i},!0)),icon:vr}):null))},Sg=y({name:"ViewIcons",authors:[p.Ven,p.TheKodeToad,p.Nuckyz],description:"Makes avatars and banners in user profiles clickable, and adds View Icon/Banner entries in the user and server context menu",tags:["ImageUtilities"],settings:vg,openImage:Gs,start(){ue("user-context",iw),ue("guild-context",sw)},stop(){fe("user-context",iw),fe("guild-context",sw)},patches:[{find:"User Profile Modal - Context Menu",replacement:{match:/\{src:(\i)(?=,avatarDecoration)/,replace:"{src:$1,onClick:()=>$self.openImage($1)"}},{find:".NITRO_BANNER,",replacement:{match:/style:\{(?=backgroundImage:(\i&&\i)\?"url\("\.concat\((\i),)/,replace:'onClick:ev=>$1&&ev.target.style.backgroundImage&&$self.openImage($2),style:{cursor:$1?"pointer":void 0,'}},{find:".avatarPositionPanel",replacement:{match:/(?<=avatarWrapperNonUserBot.{0,50})onClick:(\i\|\|\i)\?void 0(?<=,avatarSrc:(\i).+?)/,replace:'style:($1)?{cursor:"pointer"}:{},onClick:$1?()=>{$self.openImage($2)}'}}]})});function bg(e){return o("div",{className:WC.markup},$e.defaultRules.codeBlock.react(e,null,{}))}var WC,lw=g(()=>{"use strict";a();j();I();WC=A("markup","codeContainer")});function qC(e){return Object.fromEntries(Object.entries(e).sort(([t],[n])=>t.localeCompare(n)))}function KC(e){let t=qC(JSON.parse(JSON.stringify(e)));for(let r of["email","phone","mfaEnabled","personalConnectionId"])delete t.author[r];let n=t;return delete n.editHistory,delete n.deleted,n.attachments?.forEach(r=>delete r.deleted),t}function pw(e,t,n){let r=Ke(i=>o(_,null,o(qe,{...i,size:"large"},o(at,null,o(oe,{variant:"heading-lg/semibold",style:{flexGrow:1}},"View Raw"),o(cn,{onClick:()=>oo(r)})),o(tt,null,o("div",{style:{padding:"16px 0"}},!!n&&o(f,null,o(S.FormTitle,{tag:"h5"},"Content"),o(bg,{content:n,lang:""}),o(S.FormDivider,{className:Y.bottom20})),o(S.FormTitle,{tag:"h5"},t," Data"),o(bg,{content:e,lang:"json"}))),o(Ft,null,o(ye,{cellSpacing:10},o(E,{onClick:()=>vn(e,`${t} data copied to clipboard!`)},"Copy ",t," JSON"),!!n&&o(E,{onClick:()=>vn(n,"Content copied to clipboard!")},"Copy Raw Content"))))))}function cw(e){e=KC(e);let t=JSON.stringify(e,null,4);return pw(t,"Message",e.content)}function xi(e){return(n,r)=>()=>{if(e==="Guild"&&!r.guild||e==="User"&&!r.user)return;let i=n.at(-1);if(i?.key==="developer-actions"){let s=i.props;Array.isArray(s.children)||(s.children=[s.children]),{children:n}=s}n.splice(-1,0,o(U.MenuItem,{id:`vc-view-${e.toLowerCase()}-raw`,label:"View Raw",action:()=>pw(JSON.stringify(r[e.toLowerCase()],null,4),e),icon:uw}))}}var uw,Vl,Tg,dw=g(()=>{"use strict";a();Mt();Ir();$();lw();le();Dt();P();ct();Be();dt();M();I();uw=()=>o("svg",{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",width:"18",height:"18"},o("path",{d:"M12.9297 3.25007C12.7343 3.05261 12.4154 3.05226 12.2196 3.24928L11.5746 3.89824C11.3811 4.09297 11.3808 4.40733 11.5739 4.60245L16.5685 9.64824C16.7614 9.84309 16.7614 10.1569 16.5685 10.3517L11.5739 15.3975C11.3808 15.5927 11.3811 15.907 11.5746 16.1017L12.2196 16.7507C12.4154 16.9477 12.7343 16.9474 12.9297 16.7499L19.2604 10.3517C19.4532 10.1568 19.4532 9.84314 19.2604 9.64832L12.9297 3.25007Z"}),o("path",{d:"M8.42616 4.60245C8.6193 4.40733 8.61898 4.09297 8.42545 3.89824L7.78047 3.24928C7.58466 3.05226 7.26578 3.05261 7.07041 3.25007L0.739669 9.64832C0.5469 9.84314 0.546901 10.1568 0.739669 10.3517L7.07041 16.7499C7.26578 16.9474 7.58465 16.9477 7.78047 16.7507L8.42545 16.1017C8.61898 15.907 8.6193 15.5927 8.42616 15.3975L3.43155 10.3517C3.23869 10.1569 3.23869 9.84309 3.43155 9.64824L8.42616 4.60245Z"}));Vl=D({clickMethod:{description:"Change the button to view the raw content/data of any message.",type:4,options:[{label:"Left Click to view the raw content.",value:"Left",default:!0},{label:"Right click to view the raw content.",value:"Right"}]}});Tg=y({name:"ViewRaw",description:"Copy and view the raw content/data of any message, channel or guild",authors:[p.KingFish,p.Ven,p.rad,p.ImLvna],dependencies:["MessagePopoverAPI"],settings:Vl,start(){Un("ViewRaw",e=>{let t=()=>{Vl.store.clickMethod==="Right"?vn(e.content):cw(e)},n=i=>{Vl.store.clickMethod==="Left"?(i.preventDefault(),i.stopPropagation(),vn(e.content)):(i.preventDefault(),i.stopPropagation(),cw(e))};return{label:Vl.store.clickMethod==="Right"?"Copy Raw (Left Click) / View Raw (Right Click)":"View Raw (Left Click) / Copy Raw (Right Click)",icon:uw,message:e,channel:Q.getChannel(e.channel_id),onClick:t,onContextMenu:n}}),ue("guild-context",xi("Guild")),ue("channel-context",xi("Channel")),ue("user-context",xi("User"))},stop(){$n("CopyRawMessage"),fe("guild-context",xi("Guild")),fe("channel-context",xi("Channel")),fe("user-context",xi("User"))}})});var mw=g(()=>{});var wi,ec=g(()=>{"use strict";a();$();M();wi=D({noiseSuppression:{type:3,description:"Noise Suppression",default:!0},echoCancellation:{type:3,description:"Echo Cancellation",default:!0}})});var ooe,fw=g(()=>{"use strict";a();I();ec();ooe=VencordNative.pluginHelpers.VoiceMessages});var Vo,xg=g(()=>{"use strict";a();Ve();Vo=Ge("vc-vmsg-")});var YC,gw,hw=g(()=>{"use strict";a();Oe();j();xg();YC=me(()=>st(e=>e.type?.toString().includes("waveform:"))),gw=({src:e,waveform:t,recording:n})=>{let r=Oi({deps:[n]}),i=n?Math.floor(r/1e3):0,s=Math.floor(i/60)+":"+(i%60).toString().padStart(2,"0");return e&&!n?o(YC,{key:e,src:e,waveform:t}):o("div",{className:Vo("preview",n?"preview-recording":[])},o("div",{className:Vo("preview-indicator")}),o("div",{className:Vo("preview-time")},s),o("div",{className:Vo("preview-label")},n?"RECORDING":"----"))}});var yw,vw=g(()=>{"use strict";a();I();ec();yw=({setAudioBlob:e,onRecordingChange:t})=>{let[n,r]=J(!1),[i,s]=J(!1),[l,c]=J(),[u,d]=J([]),m=v=>{r(v),t?.(v)};function h(){!n?navigator.mediaDevices.getUserMedia({audio:{echoCancellation:wi.store.echoCancellation,noiseSuppression:wi.store.noiseSuppression}}).then(T=>{let w=[];d(w);let b=new MediaRecorder(T);c(b),b.addEventListener("dataavailable",x=>{w.push(x.data)}),b.start(),m(!0)}):l&&(l.addEventListener("stop",()=>{e(new Blob(u,{type:"audio/ogg; codecs=opus"})),m(!1)}),l.stop())}return o(f,null,o(E,{onClick:h},n?"Stop":"Start"," recording"),o(E,{disabled:!n,onClick:()=>{s(!i),i?l?.resume():l?.pause()}},i?"Resume":"Pause"," recording"))}});function VC(e,t){let n=Ae.getChannelId(),r=JC.getPendingReply(n);r&&B.dispatch({type:"DELETE_PENDING_REPLY",channelId:n});let i=new ZC.CloudUpload({file:new File([e],"voice-message.ogg",{type:"audio/ogg; codecs=opus"}),isClip:!1,isThumbnail:!1,platform:1},n,!1,0);i.on("complete",()=>{wt.post({url:`/channels/${n}/messages`,body:{flags:1<<13,channel_id:n,content:"",nonce:jn.fromTimestamp(Date.now()),sticker_ids:[],type:0,attachments:[{id:"0",filename:i.filename,uploaded_filename:i.uploadedFilename,waveform:t.waveform,duration_secs:t.duration}],message_reference:r?XC.getSendMessageOptionsForReply(r)?.messageReference:null}})}),i.on("error",()=>yn("Failed to upload voice message",ee.Type.FAILURE)),i.upload()}function ek(){let[e,t]=J();return[e,r=>{e&&URL.revokeObjectURL(e),t(URL.createObjectURL(r))}]}function tk({modalProps:e}){let[t,n]=J(!1),[r,i]=J(),[s,l]=ek();_e(()=>()=>{s&&URL.revokeObjectURL(s)},[s]);let[c]=ot(async()=>{if(!r)return Sw;let d=await new AudioContext().decodeAudioData(await r.arrayBuffer()),m=d.getChannelData(0),h=new Uint8Array(cr.clamp(Math.floor(d.duration*10),Math.min(32,m.length),256)),v=Math.floor(m.length/h.length);for(let b=0;b{i(u),l(u)},onRecordingChange:n}),o(E,{onClick:async()=>{let u=await Ta("audio/*");u&&(i(u),l(u))}},"Upload File")),o(S.FormTitle,null,"Preview"),o(gw,{src:s,waveform:c.waveform,recording:t})),o(Ft,null,o(E,{disabled:!r,onClick:()=>{VC(r,c),e.onClose(),yn("Now sending voice message... Please be patient",ee.Type.MESSAGE)}},"Send")))}var ZC,XC,JC,wg,QC,Mg,Sw,bw,Tw=g(()=>{"use strict";a();mw();Mt();Ht();P();dt();Oe();M();xa();j();I();fw();ec();xg();hw();vw();ZC=A("CloudUpload"),XC=A("getSendMessageOptionsForReply","sendMessage"),JC=Ie("PendingReplyStore"),wg=A("optionName","optionIcon","optionLabel"),QC=yw,Mg=y({name:"VoiceMessages",description:"Allows you to send voice messages like on mobile. To do so, right click the upload button and click Send Voice Message",authors:[p.Ven,p.Vap,p.Nickyux],settings:wi,start(){ue("channel-attach",bw)},stop(){fe("channel-attach",bw)}}),Sw={waveform:"AAAAAAAAAAAA",duration:1};bw=(e,t)=>()=>{t.channel.guild_id&&!(Re.can(Te.SEND_VOICE_MESSAGES,t.channel)&&Re.can(Te.SEND_MESSAGES,t.channel))||e.push(o(U.MenuItem,{id:"vc-send-vmsg",label:o("div",{className:wg.optionLabel},o(vy,{className:wg.optionIcon,height:24,width:24}),o("div",{className:wg.optionName},"Send voice message")),action:()=>Ke(n=>o(tk,{modalProps:n}))}))}});async function nk(e){let t=await fetch(e);if(t.status===200)return await t.blob()}var ok,kr,Pg,xw=g(()=>{"use strict";a();$();P();M();xa();j();I();ok=Lt(e=>e.emitter?._events?.INSERT_TEXT),kr=D({addBack:{type:3,description:"Add back the Discord context menus for images, links and the chat input bar",default:!0,restartNeeded:!0}}),Pg=y({name:"WebContextMenus",description:"Re-adds context menus missing in the web version of Discord: Links & Images (Copy/Open Link/Image), Text Area (Copy, Cut, Paste, SpellCheck)",authors:[p.Ven],enabledByDefault:!0,required:!0,settings:kr,start(){if(kr.store.addBack){let e=yt("contextMenuCallbackNative");window.removeEventListener("contextmenu",e.contextMenuCallbackWeb),window.addEventListener("contextmenu",e.contextMenuCallbackNative),this.changedListeners=!0}},stop(){if(this.changedListeners){let e=yt("contextMenuCallbackNative");window.removeEventListener("contextmenu",e.contextMenuCallbackNative),window.addEventListener("contextmenu",e.contextMenuCallbackWeb)}},patches:[{find:"open-native-link",replacement:[{match:/if\(!\i\.\i\|\|null==/,replace:"if(null=="},{match:/\i\.\i\.copy/,replace:"Vencord.Webpack.Common.Clipboard.copy"}]},{find:'id:"copy-image"',replacement:[{match:/!\i\.isPlatformEmbedded/,replace:"false"},{match:/return\s*?\[\i\.\i\.canCopyImage\(\)/,replace:"return [true"},{match:/(?<=COPY_IMAGE_MENU_ITEM,)action:/,replace:"action:()=>$self.copyImage(arguments[0]),oldAction:"},{match:/(?<=SAVE_IMAGE_MENU_ITEM,)action:/,replace:"action:()=>$self.saveImage(arguments[0]),oldAction:"}]},{find:'navId:"image-context"',predicate:()=>kr.store.addBack,replacement:{match:/return \i\.\i\?/,replace:"return true?"}},{find:'"interactionUsernameProfile"',predicate:()=>kr.store.addBack,replacement:{match:/if\((?="A"===\i\.tagName&&""!==\i\.textContent)/,replace:"if(false&&"}},{find:'getElementById("slate-toolbar"',predicate:()=>kr.store.addBack,replacement:{match:/(?<=handleContextMenu\(\i\)\{.{0,200}isPlatformEmbedded)\?/,replace:"||true?"}},{find:".SLASH_COMMAND_SUGGESTIONS_TOGGLED,{",predicate:()=>kr.store.addBack,replacement:[{match:/if\(!\i\.\i\)return null;/,replace:""},{match:/\b\i\.\i\.(copy|cut|paste)/g,replace:"$self.$1"}]},{find:'"add-to-dictionary"',predicate:()=>kr.store.addBack,replacement:{match:/let\{text:\i=""/,replace:"return [null,null];$&"}}],async copyImage(e){let t=new Image;t.onload=()=>{let n=document.createElement("canvas");n.width=t.naturalWidth,n.height=t.naturalHeight,n.getContext("2d").drawImage(t,0,0),n.toBlob(r=>{navigator.clipboard.write([new ClipboardItem({"image/png":r})])},"image/png")},t.crossOrigin="anonymous",t.src=e},async saveImage(e){let t=await nk(e);if(!t)return;let n=new URL(e).pathname.split("/").pop(),r=new File([t],n,{type:t.type});ba(r)},copy(){let e=document.getSelection();!e||Qt.copy(e.toString())},cut(){this.copy(),ok.dispatch("INSERT_TEXT",{rawText:""})},async paste(){let e=(await navigator.clipboard.read())[0];if(!e)return;let t=new DataTransfer;for(let n of e.types)if(n==="image/png"){let r=new File([await e.getType(n)],"unknown.png",{type:n});t.items.add(r)}else if(n==="text/plain"){let r=await e.getType(n);t.setData(n,await r.text())}document.dispatchEvent(new ClipboardEvent("paste",{clipboardData:t}))}})});var Ig,Ag,ww=g(()=>{"use strict";a();P();M();j();I();Ig=A("JUMP_TO_GUILD","SERVER_NEXT"),Ag=y({name:"WebKeybinds",description:"Re-adds keybinds missing in the web version of Discord: ctrl+t, ctrl+shift+t, ctrl+tab, ctrl+shift+tab, ctrl+1-9, ctrl+,. Only works fully on Vesktop/ArmCord, not inside your browser",authors:[p.Ven],enabledByDefault:!0,onKey(e){if(e.ctrlKey||e.metaKey&&navigator.platform.includes("Mac"))switch(e.key){case"t":case"T":e.preventDefault(),e.shiftKey?(sn.getGuildId()&&pr.transitionToGuild("@me"),Gr.safeDispatch("TOGGLE_DM_CREATE")):B.dispatch({type:"QUICKSWITCHER_SHOW",query:"",queryMode:null});break;case",":e.preventDefault(),no.open("My Account");break;case"Tab":(e.shiftKey?Ig.SERVER_PREV:Ig.SERVER_NEXT).action(e);break;default:e.key>="1"&&e.key<="9"&&(e.preventDefault(),Ig.JUMP_TO_GUILD.action(e,`mod+${e.key}`));break}},start(){document.addEventListener("keydown",this.onKey)},stop(){document.removeEventListener("keydown",this.onKey)}})});function ak(e,t,n){let r=t.name+(t.id?`:${t.id}`:"");return wt.get({url:`/channels/${e.channel_id}/messages/${e.id}/reactions/${r}`,query:{limit:100,type:n},oldFormErrors:!0}).then(i=>B.dispatch({type:"MESSAGE_REACTION_ADD_USERS",channelId:e.channel_id,messageId:e.id,users:i.body,emoji:t,reactionType:n})).catch(console.error).finally(()=>No(250))}function lk(e,t,n){let r=`${e.id}:${t.name}:${t.id??""}:${n}`,i=Mw[r]??={fetched:!1,users:{}};return i.fetched||(sk.unshift(()=>ak(e,t,n)),i.fetched=!0),i.users}function ck(e){return function(n,r){return o(V,{text:e.slice(5).map(i=>i.username).join(", ")},({onMouseEnter:i,onMouseLeave:s})=>o("div",{className:ik.moreUsers,onMouseEnter:i,onMouseLeave:s},"+",e.length-5))}}function uk(e){e.stopPropagation()}var rk,ik,sk,Mw,Ng,Pw=g(()=>{"use strict";a();le();P();Be();qr();Oe();M();j();I();rk=me(()=>Bt("defaultRenderUser","showDefaultAvatarsForNullUsers")),ik=A("moreUsers","emptyUser","avatarContainer","clickableAvatar"),sk=new Ln;Ng=y({name:"WhoReacted",description:"Renders the avatars of users who reacted to a message",authors:[p.Ven,p.KannaDev],patches:[{find:",reactionRef:",replacement:{match:/(\i)\?null:\(0,\i\.jsx\)\(\i\.\i,{className:\i\.reactionCount,.*?}\),/,replace:"$&$1?null:$self.renderUsers(this.props),"}},{find:'.displayName="MessageReactionsStore";',replacement:{match:/(?<=CONNECTION_OPEN:function\(\){)(\i)={}/,replace:"$&;$self.reactions=$1"}}],renderUsers(e){return e.message.reactions.length>10?null:o(_,{noop:!0},o(this._renderUsers,{...e}))},_renderUsers({message:e,emoji:t,type:n}){let r=qn();O.useEffect(()=>{let l=c=>{c.messageId===e.id&&r()};return B.subscribe("MESSAGE_REACTION_ADD_USERS",l),()=>B.unsubscribe("MESSAGE_REACTION_ADD_USERS",l)},[e.id]);let i=lk(e,t,n),s=Object.values(i).filter(Boolean);for(let l of s)B.dispatch({type:"USER_UPDATE",user:l});return o("div",{style:{marginLeft:"0.5em",transform:"scale(0.9)"}},o("div",{onClick:uk},o(rk,{users:s,guildId:Q.getChannel(e.channel_id)?.guild_id,renderIcon:!1,max:5,showDefaultAvatarsForNullUsers:!0,showUserPopout:!0,renderMoreUsers:ck(s)})))},set reactions(e){Mw=e}})});var Cg,Iw=g(()=>{"use strict";a();tn();P();M();Cg=y({name:"Wikisearch",description:"Searches Wikipedia for your requested query. (/wikisearch)",authors:[p.Samu],dependencies:["CommandsAPI"],commands:[{name:"wikisearch",description:"Searches Wikipedia for your request.",inputType:0,options:[{name:"search",description:"Word to search for",type:3,required:!0}],execute:async(e,t)=>{let n=rt(e,"search","");if(!n)return pe(t.channel.id,{content:"No word was defined!"});let r=new URLSearchParams({action:"query",format:"json",list:"search",formatversion:"2",origin:"*",srsearch:n}),i=await fetch("https://en.wikipedia.org/w/api.php?"+r).then(u=>u.json()).catch(u=>(console.log(u),pe(t.channel.id,{content:"There was an error. Check the console for more info"}),null));if(!i)return;if(!i.query?.search?.length)return console.log(i),pe(t.channel.id,{content:"No results given"});let s=await fetch(`https://en.wikipedia.org/w/api.php?action=query&format=json&prop=info%7Cdescription%7Cimages%7Cimageinfo%7Cpageimages&list=&meta=&indexpageids=1&pageids=${i.query.search[0].pageid}&formatversion=2&origin=*`).then(u=>u.json()).then(u=>u.query.pages[0]).catch(u=>(console.log(u),pe(t.channel.id,{content:"There was an error. Check the console for more info"}),null));if(!s)return;let l=s.thumbnail,c=l&&{url:l.source.replace(/(50px-)/ig,"1000px-"),height:l.height*100,width:l.width*100};pe(t.channel.id,{embeds:[{type:"rich",title:i.query.search[0].title,url:`https://wikipedia.org/w/index.php?curid=${i.query.search[0].pageid}`,color:"0x8663BE",description:i.query.search[0].snippet.replace(/( |<([^>]+)>)/ig,"").replace(/(")/ig,'"')+"...",image:c,footer:{text:"Powered by the Wikimedia API"}}]})}}]})});var He,gr=g(()=>{a();mh();fh();gh();hh();yh();vh();Sh();bh();Th();xh();wh();Gu();lv();cv();uv();pv();fv();gv();Yu();xv();wv();Mv();Pv();Lv();Dv();Ov();Uv();$v();Gv();zv();jv();Xv();Qv();Vv();i1();s1();a1();C1();D1();O1();F1();U1();$1();G1();z1();j1();Y1();J1();Q1();nS();od();el();fS();hS();SS();xS();PS();NS();_S();FS();US();$S();HS();zS();jS();WS();qS();KS();YS();XS();JS();QS();VS();e0();t0();n0();o0();r0();i0();s0();a0();p0();d0();ws();I0();C0();G0();H0();W0();Y0();sb();ab();vb();Sb();bb();Eb();Db();Bb();Fb();Gb();Hb();Wb();Xb();rT();$T();GT();KT();Pf();ex();tx();nx();ox();rx();mx();fx();hx();Sx();bx();Ax();Nx();Cx();Bx();Ux();ng();$x();Hx();zx();Yx();Jx();Vx();ew();nw();rw();aw();dw();Tw();xw();ww();Pw();Iw();He={[wc.name]:wc,[Mc.name]:Mc,[Pc.name]:Pc,[Ic.name]:Ic,[Ac.name]:Ac,[Nc.name]:Nc,[Cc.name]:Cc,[kc.name]:kc,[Rc.name]:Rc,[Lc.name]:Lc,[Ec.name]:Ec,[is.name]:is,[Hu.name]:Hu,[zu.name]:zu,[ju.name]:ju,[Wu.name]:Wu,[qu.name]:qu,[Ku.name]:Ku,[Ju.name]:Ju,[Qu.name]:Qu,[Vu.name]:Vu,[ep.name]:ep,[tp.name]:tp,[np.name]:np,[op.name]:op,[rp.name]:rp,[dp.name]:dp,[mp.name]:mp,[gp.name]:gp,[hp.name]:hp,[bp.name]:bp,[xp.name]:xp,[wp.name]:wp,[Mp.name]:Mp,[Ip.name]:Ip,[Cp.name]:Cp,[kp.name]:kp,[Fp.name]:Fp,[Up.name]:Up,[$p.name]:$p,[Gp.name]:Gp,[Hp.name]:Hp,[zp.name]:zp,[jp.name]:jp,[qp.name]:qp,[Kp.name]:Kp,[Zp.name]:Zp,[Jp.name]:Jp,[Qp.name]:Qp,[Vp.name]:Vp,[id.name]:id,[ld.name]:ld,[cd.name]:cd,[dd.name]:dd,[md.name]:md,[fd.name]:fd,[hd.name]:hd,[bd.name]:bd,[wd.name]:wd,[Md.name]:Md,[Pd.name]:Pd,[Id.name]:Id,[Nd.name]:Nd,[Rd.name]:Rd,[Ld.name]:Ld,[Ed.name]:Ed,[Dd.name]:Dd,[Od.name]:Od,[_d.name]:_d,[Ud.name]:Ud,[$d.name]:$d,[Gd.name]:Gd,[Hd.name]:Hd,[zd.name]:zd,[jd.name]:jd,[Wd.name]:Wd,[qd.name]:qd,[Kd.name]:Kd,[Yd.name]:Yd,[Zd.name]:Zd,[Xd.name]:Xd,[Jd.name]:Jd,[Vd.name]:Vd,[sm.name]:sm,[am.name]:am,[lm.name]:lm,[mm.name]:mm,[fm.name]:fm,[Pm.name]:Pm,[Nm.name]:Nm,[Rm.name]:Rm,[Lm.name]:Lm,[Em.name]:Em,[Om.name]:Om,[Fm.name]:Fm,[Km.name]:Km,[Ym.name]:Ym,[Zm.name]:Zm,[Xm.name]:Xm,[Jm.name]:Jm,[Qm.name]:Qm,[Vm.name]:Vm,[nf.name]:nf,[of.name]:of,[xf.name]:xf,[wf.name]:wf,[Mf.name]:Mf,[If.name]:If,[Af.name]:Af,[Nf.name]:Nf,[Rf.name]:Rf,[Lf.name]:Lf,[Ef.name]:Ef,[_f.name]:_f,[Ff.name]:Ff,[Gf.name]:Gf,[Hf.name]:Hf,[jf.name]:jf,[qf.name]:qf,[Kf.name]:Kf,[Yf.name]:Yf,[Vf.name]:Vf,[rg.name]:rg,[tg.name]:tg,[ig.name]:ig,[ag.name]:ag,[lg.name]:lg,[ug.name]:ug,[pg.name]:pg,[dg.name]:dg,[fg.name]:fg,[hg.name]:hg,[yg.name]:yg,[Sg.name]:Sg,[Tg.name]:Tg,[Mg.name]:Mg,[Pg.name]:Pg,[Ag.name]:Ag,[Ng.name]:Ng,[Cg.name]:Cg}});var Rg={};Ue(Rg,{BadgePosition:()=>aa,_getBadges:()=>pk,addBadge:()=>Im,removeBadge:()=>Am});function Im(e){e.component&&=_.wrap(e.component,{noop:!0}),kg.add(e)}function Am(e){return kg.delete(e)}function pk(e){let t=[];for(let r of kg)(!r.shouldShow||r.shouldShow(e))&&(r.position===0?t.unshift({...r,...e}):t.push({...r,...e}));let n=He.BadgeAPI.getDonorBadges(e.user.id);return n&&t.unshift(...n),t}var aa,kg,la=g(()=>{"use strict";a();le();gr();aa=(n=>(n[n.START=0]="START",n[n.END=1]="END",n))(aa||{}),kg=new Set});var Lg={};Ue(Lg,{Badges:()=>hk,Commands:()=>mk,ContextMenu:()=>wk,DataStore:()=>zt,MemberListDecorators:()=>Sk,MessageAccessories:()=>fk,MessageDecorations:()=>vk,MessageEvents:()=>dk,MessagePopover:()=>gk,Notices:()=>Cl,Notifications:()=>xk,ServerList:()=>yk,Settings:()=>bk,Styles:()=>Tk});var dk,Cl,mk,zt,fk,gk,hk,yk,vk,Sk,bk,Tk,xk,wk,ss=g(()=>{"use strict";a();la();tn();Mt();Kn();vm();rl();xm();Xn();Ir();Ia();ko();Al();$();Ve();dk=pp,Cl=mu,mk=Tu,zt=ro,fk=vd,gk=Xp,hk=Rg,yk=Bm,vk=Tm,Sk=ym,bk=iu,Tk=Hc,xk=jc,wk=Oc});function Mk(e,t,n){let r=t;if(t in e)return void n(e[r]);Object.defineProperty(e,t,{set(i){delete e[r],e[r]=i,n(i)},configurable:!0,enumerable:!1})}var Aw=g(()=>{"use strict";a()});var Eg={};Ue(Eg,{ChangeList:()=>os,Devs:()=>p,DevsById:()=>zr,ImageModal:()=>bc,LazyComponent:()=>me,Logger:()=>ie,Margins:()=>Y,ModalCloseButton:()=>cn,ModalContent:()=>tt,ModalFooter:()=>Ft,ModalHeader:()=>at,ModalRoot:()=>qe,ModalSize:()=>Co,Modals:()=>Rn,NoopComponent:()=>lh,Queue:()=>Ln,REACT_GLOBAL:()=>Zw,SUPPORT_CHANNEL_ID:()=>oa,Theme:()=>La,VENCORD_USER_AGENT:()=>mc,WEBPACK_CHUNK:()=>Wn,canonicalizeDescriptor:()=>fp,canonicalizeMatch:()=>xr,canonicalizeReplace:()=>Ua,canonicalizeReplacement:()=>ls,checkIntersecting:()=>gc,classes:()=>re,closeAllModals:()=>Tc,closeModal:()=>oo,copyWithToast:()=>vn,debounce:()=>bn,fetchUserProfile:()=>Iu,formatDuration:()=>Qi,getCurrentChannel:()=>ti,getCurrentGuild:()=>Pu,getTheme:()=>ni,getUniqueUsername:()=>po,gitHash:()=>ln,gitRemote:()=>na,humanFriendlyJoin:()=>V2,identity:()=>ra,insertTextIntoChatInputBox:()=>uo,isMobile:()=>Jw,isNonNullish:()=>Tp,isObject:()=>Xw,isObjectEmpty:()=>Ei,isPluginDev:()=>Di,isTruthy:()=>Ga,localStorage:()=>mr,makeCodeblock:()=>Vi,makeLazy:()=>Ao,mergeDefaults:()=>dr,onceDefined:()=>Mk,onlyOnce:()=>lu,openImageModal:()=>Bn,openModal:()=>Ke,openModalLazy:()=>Bi,openPrivateChannel:()=>lM,openUserProfile:()=>Fn,parseUrl:()=>fc,proxyLazy:()=>Qe,sendMessage:()=>cM,sleep:()=>No,useAwaiter:()=>ot,useForceUpdater:()=>qn,useIntersection:()=>hc,useTimer:()=>Oi,wordsFromCamel:()=>gu,wordsFromKebab:()=>q2,wordsFromPascal:()=>hu,wordsFromSnake:()=>W2,wordsFromTitle:()=>K2,wordsToCamel:()=>Y2,wordsToKebab:()=>X2,wordsToPascal:()=>J2,wordsToSnake:()=>Z2,wordsToTitle:()=>ao});var Nw=g(()=>{"use strict";a();Eu();P();Wr();It();Ha();Zt();ua();Je();ct();Be();dt();Aw();cu();cs();qr();Oe();lo();});var _g={};Ue(_g,{toggle:()=>Dg});function Og(e){let t=document.createElement("style");return t.id=e,document.documentElement.append(t),t}async function Pk(){let e=await VencordNative.themes.getSystemValues(),t=Object.entries(e).filter(([,n])=>n!=="#").map(([n,r])=>`--${n}: ${r};`).join("");Og("vencord-os-theme-values").textContent=`:root{${t}}`}async function Dg(e){Mi?Mi.disabled=!e:e&&(Mi=Og("vencord-custom-css"),VencordNative.quickCss.addChangeListener(t=>{Mi.textContent=t,Mi.disabled=!L.useQuickCss}),Mi.textContent=await VencordNative.quickCss.get())}async function tc(){Cw??=Og("vencord-themes");let{themeLinks:e,enabledThemes:t}=L,n=[...e];{let r=t.map(i=>`vencord:///themes/${i}?v=${Date.now()}`);n.push(...r)}Cw.textContent=n.map(r=>`@import url("${r.trim()}");`).join(` +`)}var Mi,Cw,Bg=g(()=>{"use strict";a();$();document.addEventListener("DOMContentLoaded",()=>{Pk(),tc(),Dg(L.useQuickCss),qi("useQuickCss",Dg),qi("themeLinks",tc),qi("enabledThemes",tc),VencordNative.quickCss.addThemeChangeListener(tc)})});var Fg={};Ue(Fg,{Common:()=>dc,_initWebpack:()=>Zs,_resolveReady:()=>Ks,addListener:()=>Hw,cache:()=>In,extract:()=>sc,filters:()=>ce,find:()=>st,findAll:()=>Er,findBulk:()=>rc,findByCode:()=>Bt,findByCodeLazy:()=>to,findByProps:()=>yt,findByPropsLazy:()=>A,findLazy:()=>Lt,findModuleId:()=>Hg,findStore:()=>jg,findStoreLazy:()=>Ie,listeners:()=>Ys,mapMangledModule:()=>zg,mapMangledModuleLazy:()=>fn,onceReady:()=>oc,removeListener:()=>zw,search:()=>ic,subscriptions:()=>Lr,waitFor:()=>ut,wreq:()=>mn});var nc=g(()=>{"use strict";a();I();j()});function Rw(e){function t(n){try{Lw(n[1])}catch(r){Vn.error("Error in handlePush",r)}return t.$$vencordOriginal.call(e,n)}t.$$vencordOriginal=e.push,t.bind=(...n)=>t.$$vencordOriginal.bind(...n),Object.defineProperty(e,"push",{get:()=>t,set(n){t.$$vencordOriginal=n},configurable:!0})}function Lw(e){let{subscriptions:t,listeners:n}=Vencord.Webpack,{patches:r}=Vencord.Plugins;for(let i in e){let s=e[i],l=s.toString().replaceAll(` +`,"");l.startsWith("function(")&&(l="0,"+l);let c=s,u=new Set,d=e[i]=function(m,h,v){try{s(m,h,v)}catch(w){if(s===c)throw w;return Vn.error("Error in patched chunk",w),void c(m,h,v)}if(h=m.exports,!h)return;if(h===window){Object.defineProperty(v.c,i,{value:v.c[i],enumerable:!1,configurable:!0,writable:!0});return}let T=Number(i);for(let w of n)try{w(h,T)}catch(b){Vn.error("Error in webpack listener",b)}for(let[w,b]of t)try{if(w(h))t.delete(w),b(h,T);else if(typeof h=="object"){h.default&&w(h.default)&&(t.delete(w),b(h.default,T));for(let x in h)x.length<=3&&h[x]&&w(h[x])&&(t.delete(w),b(h[x],T))}}catch(x){Vn.error("Error while firing callback for webpack chunk",x)}};try{d.toString=()=>s.toString(),d.original=c}catch{}for(let m=0;ml.replace(T,w));if(!(h.predicate&&!h.predicate())&&l.includes(h.find)){u.add(h.plugin);for(let T of h.replacement){if(T.predicate&&!T.predicate())continue;let w=s,b=l;ls(T,h.plugin);try{let x=v(T.match,T.replace);x===l&&!h.noWarn?((window.explosivePlugins??=new Set).add(h.plugin),Vn.warn(`Patch by ${h.plugin} had no effect (Module id is ${i}): ${T.match}`)):(l=x,s=(0,eval)(`// Webpack Module ${i} - Patched by ${[...u].join(", ")} +${x} +//# sourceURL=WebpackModule${i}`))}catch(x){Vn.error(`Patch by ${h.plugin} errored (Module id is ${i}): ${T.match} +`,x),l=b,s=w,u.delete(h.plugin)}}h.all||r.splice(m--,1)}}}}var kw,Vn,Ew=g(()=>{"use strict";a();P();Je();cs();qs();nc();Vn=new ie("WebpackInterceptor","#8caaee");window[Wn]?(Vn.info(`Patching ${Wn}.push (was already existent, likely from cache!)`),Zs(window[Wn]),Rw(window[Wn])):(Object.defineProperty(window,Wn,{get:()=>kw,set:e=>{e?.push&&(e.push.$$vencordOriginal||(Vn.info(`Patching ${Wn}.push`),Rw(e)),Zs(e)&&(Vn.info("Successfully initialised Vencord webpack"),delete window[Wn],window[Wn]=e)),kw=e},configurable:!0}),Object.defineProperty(Function.prototype,"m",{set(e){new Error().stack?.includes("discord.com")&&(Vn.info("Found webpack module factory"),Lw(e),delete Function.prototype.m),Object.defineProperty(this,"m",{value:e,configurable:!0})},configurable:!0}))});var Nk={};Ue(Nk,{Api:()=>Lg,PlainSettings:()=>Zn,Plugins:()=>Fu,QuickCss:()=>_g,Settings:()=>L,Updater:()=>au,Util:()=>Eg,Webpack:()=>Fg});async function Ik(){if(L.cloud.authenticated&&await Pt("Vencord_cloudSecret")===null){Ne({title:"Cloud Integrations",body:"We've noticed you have cloud integrations enabled in another client! Due to limitations, you will need to re-authenticate to continue using them. Click here to go to the settings page to do so!",color:"var(--yellow-360)",onClick:()=>no.open("VencordCloud")});return}L.cloud.settingsSync&&L.cloud.authenticated&&(mr.Vencord_settingsDirty?(await Zr(),delete mr.Vencord_settingsDirty):await wa(!1)&&Ne({title:"Cloud Settings",body:"Your settings have been updated! Click here to restart to fully apply changes!",color:"var(--green-360)",onClick:un}))}async function Ak(){await oc,_u(),Ik();try{if(!await Jr())return;if(L.autoUpdate){await Qr(),L.autoUpdateNotification&&setTimeout(()=>Ne({title:"Vencord has been updated!",body:"Click here to restart",permanent:!0,noPersist:!0,onClick:un}),1e4);return}L.notifyAboutUpdates&&setTimeout(()=>Ne({title:"A Vencord update is available!",body:"Click here to view the update",permanent:!0,noPersist:!0,onClick(){no.open("VencordUpdater")}}),1e4)}catch(e){hr.error("Failed to check for updates",e)}}var ix=g(()=>{a();ss();Ba();Nw();Bg();yr();nc();Bg();Ew();Kn();ko();$();Ba();ua();Do();Wi();yr();nc();I();Ak()});ix();return Io(Nk);})(); //# sourceURL=VencordDesktopRenderer //# sourceMappingURL=vencord://vencordDesktopRenderer.js.map /*! For license information please see vencordDesktopRenderer.js.LEGAL.txt */ diff --git a/VencordDesktop/vencordDist/vencordDesktopRenderer.js.map b/VencordDesktop/vencordDist/vencordDesktopRenderer.js.map index 9650cba..42d6740 100644 --- a/VencordDesktop/vencordDist/vencordDesktopRenderer.js.map +++ b/VencordDesktop/vencordDist/vencordDesktopRenderer.js.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../scripts/build/inject/react.mjs", "../src/utils/Logger.ts", "../src/utils/margins.ts", "../src/utils/lazy.ts", "../src/utils/lazyReact.tsx", "../src/debug/Tracer.ts", "../src/webpack/webpack.ts", "../src/webpack/common/classes.ts", "../src/webpack/common/internal.tsx", "../src/webpack/common/components.ts", "../src/webpack/common/menu.ts", "../src/webpack/common/react.ts", "../src/webpack/common/settingsStores.ts", "../src/webpack/common/stores.ts", "../src/webpack/common/types/components.d.ts", "../src/webpack/common/types/menu.d.ts", "../src/webpack/common/types/utils.d.ts", "../src/webpack/common/utils.ts", "../src/webpack/common/index.ts", "git-hash:~git-hash", "git-remote:~git-remote", "../src/utils/constants.ts", "../src/utils/misc.tsx", "../src/utils/react.tsx", "../src/components/ErrorCard.tsx", "../src/components/ErrorBoundary.tsx", "../src/components/Heart.tsx", "../src/components/DonateButton.tsx", "../src/components/Flex.tsx", "../src/utils/modal.tsx", "../src/utils/types.ts", "../src/plugins/_api/badges.tsx", "../src/plugins/_api/commands.ts", "../src/plugins/_api/contextMenu.ts", "../src/plugins/_api/memberListDecorators.ts", "../src/plugins/_api/messageAccessories.ts", "../src/plugins/_api/messageDecorations.ts", "../src/plugins/_api/messageEvents.ts", "../src/plugins/_api/messagePopover.ts", "../src/plugins/_api/notices.ts", "../src/plugins/_api/serverList.ts", "../src/plugins/_core/noTrack.ts", "../src/api/ContextMenu.ts", "../src/utils/debounce.ts", "../src/utils/localStorage.ts", "../src/utils/Queue.ts", "../src/api/Notifications/NotificationComponent.tsx", "../src/api/DataStore/index.ts", "../src/api/Styles.ts", "../node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/index.browser.js", "../src/api/Notifications/notificationLog.tsx", "../src/api/Notifications/Notifications.tsx", "../src/api/Notifications/index.ts", "../node_modules/.pnpm/fflate@0.7.4/node_modules/fflate/esm/browser.js", "../src/utils/cloud.tsx", "../src/utils/native.ts", "../src/utils/web.ts", "../src/utils/settingsSync.ts", "../src/api/Settings.ts", "../src/utils/updater.ts", "../src/components/handleComponentFailed.ts", "../src/utils/onlyOnce.ts", "../src/components/VencordSettings/shared.tsx", "../src/components/VencordSettings/VencordTab.tsx", "../src/api/Notices.ts", "../src/components/Icons.tsx", "../src/utils/text.ts", "../src/api/Commands/commandHelpers.ts", "../src/api/Commands/types.ts", "../src/api/Commands/index.ts", "../src/components/Badge.tsx", "../src/components/PluginSettings/components/SettingBooleanComponent.tsx", "../src/components/PluginSettings/components/SettingCustomComponent.tsx", "../src/components/PluginSettings/components/SettingNumericComponent.tsx", "../src/components/PluginSettings/components/SettingSelectComponent.tsx", "../src/components/PluginSettings/components/SettingSliderComponent.tsx", "../src/components/PluginSettings/components/SettingTextComponent.tsx", "../src/components/PluginSettings/components/index.ts", "../src/utils/discord.tsx", "../src/components/PluginSettings/ContributorModal.tsx", "../src/components/PluginSettings/PluginModal.tsx", "../src/components/Switch.tsx", "../src/components/VencordSettings/AddonCard.tsx", "../src/utils/ChangeList.ts", "../src/plugins/index.ts", "../src/components/PluginSettings/index.tsx", "../src/components/VencordSettings/PluginsTab.tsx", "../src/components/Link.tsx", "../src/components/VencordSettings/ThemesTab.tsx", "../src/components/VencordSettings/UpdaterTab.tsx", "../src/components/CheckedTextInput.tsx", "../src/components/VencordSettings/CloudTab.tsx", "../src/components/VencordSettings/BackupAndRestoreTab.tsx", "../src/plugins/_core/settings.tsx", "../src/plugins/_core/supportHelper.tsx", "../src/plugins/alwaysAnimate/index.ts", "../src/plugins/alwaysTrust/index.ts", "../src/plugins/anonymiseFileNames/index.ts", "../src/plugins/arRPC.web/index.tsx", "../src/plugins/banger/index.ts", "../src/plugins/betterFolders/FolderSideBar.tsx", "../src/plugins/betterFolders/index.tsx", "../src/plugins/betterGifAltText/index.ts", "../src/plugins/betterNotes/index.tsx", "../src/plugins/betterRoleDot/index.ts", "../src/plugins/betterUploadButton/index.ts", "../src/plugins/biggerStreamPreview/webpack/stores.ts", "../src/plugins/biggerStreamPreview/index.tsx", "../src/plugins/blurNsfw/index.ts", "../src/plugins/callTimer/index.tsx", "../src/api/MessageEvents.ts", "../src/plugins/clearURLs/defaultRules.ts", "../src/plugins/clearURLs/index.ts", "../src/plugins/clientTheme/index.tsx", "../src/plugins/colorSighted/index.ts", "../src/utils/patches.ts", "../src/plugins/consoleShortcuts/index.ts", "../src/plugins/copyUserURLs/index.tsx", "../src/plugins/crashHandler/index.ts", "../src/utils/guards.ts", "../src/plugins/customRPC/index.tsx", "../src/plugins/dearrow/index.tsx", "../src/plugins/disableDMCallIdle/index.ts", "../src/plugins/emoteCloner/index.tsx", "../src/plugins/experiments/index.tsx", "../src/plugins/f8break/index.ts", "../src/utils/web-metadata.ts", "../src/utils/apng-canvas.js", "../src/utils/dependencies.ts", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/index.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/constants.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/stream.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/lzwEncode.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/rgb-packing.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/pnnquant2.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/color.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/palettize.js", "../src/plugins/fakeNitro/index.ts", "../node_modules/.pnpm/virtual-merge@1.0.1/node_modules/virtual-merge/dist/index.mjs", "../src/plugins/fakeProfileThemes/index.tsx", "../src/plugins/favEmojiFirst/index.ts", "../src/plugins/favGifSearch/index.tsx", "../src/plugins/fixSpotifyEmbeds.desktop/index.ts", "../src/plugins/forceOwnerCrown/index.ts", "../src/plugins/friendInvites/index.ts", "managed-style:src/plugins/gameActivityToggle/style.css", "../src/plugins/gameActivityToggle/index.tsx", "../src/plugins/gifPaste/index.ts", "../src/plugins/greetStickerPicker/index.tsx", "../src/api/MessagePopover.ts", "../src/plugins/hideAttachments/index.tsx", "../src/plugins/iLoveSpam/index.ts", "../src/plugins/ignoreActivities/index.tsx", "../src/plugins/imageZoom/constants.ts", "../src/plugins/imageZoom/utils/waitFor.ts", "../src/plugins/imageZoom/components/Magnifier.tsx", "managed-style:src/plugins/imageZoom/styles.css", "../src/plugins/imageZoom/index.tsx", "../src/plugins/invisibleChat.desktop/components/DecryptionModal.tsx", "../src/plugins/invisibleChat.desktop/components/EncryptionModal.tsx", "../src/plugins/invisibleChat.desktop/index.tsx", "../src/plugins/keepCurrentChannel/index.ts", "../src/plugins/lastfm/index.tsx", "../src/plugins/loadingQuotes/index.ts", "../src/plugins/memberCount/index.tsx", "../src/plugins/messageClickActions/index.ts", "../src/api/MessageAccessories.ts", "../src/plugins/messageLinkEmbeds/index.tsx", "managed-style:src/plugins/messageLogger/deleteStyleOverlay.css", "managed-style:src/plugins/messageLogger/deleteStyleText.css", "../src/plugins/messageLogger/index.tsx", "../src/plugins/messageTags/index.ts", "../src/plugins/moreCommands/index.ts", "../src/plugins/moreKaomoji/index.ts", "../src/plugins/moreUserTags/index.tsx", "../src/plugins/moyai/index.ts", "../src/plugins/muteNewGuild/index.tsx", "../src/plugins/mutualGroupDMs/index.tsx", "../src/plugins/noBlockedMessages/index.ts", "../src/plugins/noDevtoolsWarning/index.ts", "../src/plugins/noF1/index.ts", "managed-style:src/plugins/noMosaic/styles.css", "../src/plugins/noMosaic/index.ts", "../src/plugins/noPendingCount/index.ts", "../src/plugins/noProfileThemes/index.ts", "../src/plugins/noReplyMention/index.tsx", "../src/plugins/noScreensharePreview/index.ts", "../src/plugins/noTypingAnimation/index.ts", "../src/plugins/noUnblockToJump/index.ts", "../src/plugins/normalizeMessageLinks/index.ts", "../src/plugins/nsfwGateBypass/index.ts", "../src/plugins/onePingPerDM/index.ts", "../src/plugins/oneko/index.ts", "../src/plugins/openInApp/index.ts", "../src/plugins/partyMode/index.ts", "../src/plugins/permissionFreeWill/index.ts", "../src/plugins/permissionsViewer/utils.ts", "../src/plugins/permissionsViewer/components/icons.tsx", "../src/plugins/permissionsViewer/components/RolesAndUsersPermissions.tsx", "../src/components/ExpandableHeader.tsx", "../src/plugins/permissionsViewer/components/UserPermissions.tsx", "../src/plugins/permissionsViewer/index.tsx", "../src/plugins/petpet/index.ts", "../src/plugins/pictureInPicture/index.tsx", "../src/plugins/pinDms/settings.ts", "../src/plugins/pinDms/contextMenus.tsx", "../src/plugins/pinDms/index.tsx", "../src/plugins/plainFolderIcon/index.ts", "../src/api/MemberListDecorators.ts", "../src/api/MessageDecorations.ts", "../src/plugins/platformIndicators/index.tsx", "../src/plugins/previewMessage/index.tsx", "../src/plugins/pronoundb/components/PronounsAboutComponent.tsx", "../src/plugins/pronoundb/settings.ts", "../src/plugins/pronoundb/types.ts", "../src/plugins/pronoundb/pronoundbUtils.ts", "../src/plugins/pronoundb/components/PronounsChatComponent.tsx", "../src/plugins/pronoundb/index.ts", "../src/plugins/quickMention/index.tsx", "../src/plugins/quickReply/index.ts", "../src/plugins/reactErrorDecoder/index.ts", "../src/api/ServerList.ts", "../src/plugins/readAllNotificationsButton/index.tsx", "../src/plugins/relationshipNotifier/settings.ts", "../src/plugins/relationshipNotifier/types.ts", "../src/plugins/relationshipNotifier/utils.ts", "../src/plugins/relationshipNotifier/functions.ts", "../src/plugins/relationshipNotifier/index.ts", "../src/plugins/revealAllSpoilers/index.ts", "../src/plugins/reverseImageSearch/index.tsx", "../src/plugins/roleColorEverywhere/index.tsx", "../src/plugins/searchReply/index.tsx", "../src/plugins/secretRingTone/index.ts", "../src/plugins/sendTimestamps/index.tsx", "../src/plugins/serverListIndicators/index.tsx", "../src/plugins/serverProfile/GuildProfileModal.tsx", "../src/plugins/serverProfile/index.tsx", "include-file:~fileContent/previewExample.tsx", "../node_modules/.pnpm/eventemitter3@4.0.7/node_modules/eventemitter3/index.js", "../node_modules/.pnpm/@vap+core@0.0.12/node_modules/@vap/core/ipc/channel.js", "../node_modules/.pnpm/@vap+core@0.0.12/node_modules/@vap/core/ipc/rpc.js", "../node_modules/.pnpm/@vap+core@0.0.12/node_modules/@vap/core/ipc/worker.js", "../node_modules/.pnpm/@vap+core@0.0.12/node_modules/@vap/core/ipc/index.js", "../src/plugins/shikiCodeblocks.desktop/hooks/useTheme.ts", "../src/plugins/shikiCodeblocks.desktop/api/languages.ts", "../src/plugins/shikiCodeblocks.desktop/api/themes.ts", "../src/plugins/shikiCodeblocks.desktop/api/shiki.ts", "managed-style:src/plugins/shikiCodeblocks.desktop/devicon.css", "../src/plugins/shikiCodeblocks.desktop/types.ts", "../src/plugins/shikiCodeblocks.desktop/settings.ts", "../src/plugins/shikiCodeblocks.desktop/hooks/useShikiSettings.ts", "../src/plugins/shikiCodeblocks.desktop/utils/color.ts", "../src/plugins/shikiCodeblocks.desktop/utils/misc.ts", "../src/plugins/shikiCodeblocks.desktop/hooks/useCopyCooldown.ts", "../src/plugins/shikiCodeblocks.desktop/components/CopyButton.tsx", "../src/plugins/shikiCodeblocks.desktop/components/ButtonRow.tsx", "../src/plugins/shikiCodeblocks.desktop/components/Code.tsx", "../src/plugins/shikiCodeblocks.desktop/components/Header.tsx", "../src/plugins/shikiCodeblocks.desktop/components/Highlighter.tsx", "../src/plugins/shikiCodeblocks.desktop/utils/createStyle.ts", "../src/plugins/shikiCodeblocks.desktop/index.ts", "../src/plugins/showAllMessageButtons/index.ts", "../src/plugins/showConnections/VerifiedIcon.tsx", "../src/plugins/showConnections/index.tsx", "../src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx", "../src/plugins/showHiddenChannels/index.tsx", "../src/plugins/showMeYourName/index.tsx", "../src/plugins/showTimeouts/index.ts", "../src/plugins/silentMessageToggle/index.tsx", "../src/plugins/silentTyping/index.tsx", "../src/plugins/sortFriendRequests/index.tsx", "managed-style:src/plugins/spotifyControls/hoverOnly.css", "../src/plugins/spotifyControls/SpotifyStore.ts", "../src/plugins/spotifyControls/PlayerComponent.tsx", "../src/plugins/spotifyControls/index.tsx", "../src/plugins/spotifyCrack/index.ts", "../src/plugins/spotifyShareCommands/index.ts", "../src/plugins/startupTimings/StartupTimingPage.tsx", "../src/plugins/startupTimings/index.tsx", "../src/plugins/superReactionTweaks/index.ts", "../src/plugins/textReplace/index.tsx", "../src/plugins/themeAttributes/index.ts", "../src/plugins/timeBarAllActivities/index.ts", "../src/plugins/translate/settings.ts", "../src/plugins/translate/languages.ts", "../src/plugins/translate/utils.ts", "../src/plugins/translate/TranslateModal.tsx", "../src/plugins/translate/TranslateIcon.tsx", "../src/plugins/translate/TranslationAccessory.tsx", "../src/plugins/translate/index.tsx", "../src/plugins/typingTweaks/index.tsx", "../src/plugins/typingIndicator/index.tsx", "../src/plugins/unindent/index.ts", "../src/plugins/unsuppressEmbeds/index.tsx", "../src/plugins/urbanDictionary/index.ts", "../src/plugins/userVoiceShow/components/VoiceChannelSection.tsx", "../src/plugins/userVoiceShow/index.tsx", "managed-style:src/plugins/usrbg/index.css", "../src/plugins/usrbg/index.tsx", "../src/plugins/validUser/index.tsx", "../src/plugins/vcDoubleClick/index.ts", "../src/plugins/vcNarrator/index.tsx", "../src/plugins/vencordToolbox/index.tsx", "../src/plugins/viewIcons/index.tsx", "../src/components/CodeBlock.tsx", "../src/plugins/viewRaw/index.tsx", "../src/plugins/voiceMessages/settings.ts", "../src/plugins/voiceMessages/DesktopRecorder.tsx", "../src/plugins/voiceMessages/utils.ts", "../src/plugins/voiceMessages/VoicePreview.tsx", "../src/plugins/voiceMessages/WebRecorder.tsx", "../src/plugins/voiceMessages/index.tsx", "../src/plugins/webContextMenus.web/index.ts", "../src/plugins/webKeybinds.web/index.ts", "../src/plugins/whoReacted/index.tsx", "../src/plugins/wikisearch/index.ts", "import-plugins:~plugins", "../src/api/Badges.ts", "../src/api/index.ts", "../src/utils/onceDefined.ts", "../src/utils/index.ts", "../src/utils/quickCss.ts", "../src/webpack/index.ts", "../src/webpack/patchWebpack.ts", "../src/Vencord.ts"], - "sourcesContent": ["/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const VencordFragment = /* #__PURE__*/ Symbol.for(\"react.fragment\");\nexport let VencordCreateElement =\n (...args) => (VencordCreateElement = Vencord.Webpack.Common.React.createElement)(...args);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport class Logger {\n /**\n * Returns the console format args for a title with the specified background colour and black text\n * @param color Background colour\n * @param title Text\n * @returns Array. Destructure this into {@link Logger}.errorCustomFmt or console.log\n *\n * @example logger.errorCustomFmt(...Logger.makeTitleElements(\"white\", \"Hello\"), \"World\");\n */\n static makeTitle(color: string, title: string): [string, ...string[]] {\n return [\"%c %c %s \", \"\", `background: ${color}; color: black; font-weight: bold; border-radius: 5px;`, title];\n }\n\n constructor(public name: string, public color: string = \"white\") { }\n\n private _log(level: \"log\" | \"error\" | \"warn\" | \"info\" | \"debug\", levelColor: string, args: any[], customFmt = \"\") {\n console[level](\n `%c Vencord %c %c ${this.name} ${customFmt}`,\n `background: ${levelColor}; color: black; font-weight: bold; border-radius: 5px;`,\n \"\",\n `background: ${this.color}; color: black; font-weight: bold; border-radius: 5px;`\n , ...args\n );\n }\n\n public log(...args: any[]) {\n this._log(\"log\", \"#a6d189\", args);\n }\n\n public info(...args: any[]) {\n this._log(\"info\", \"#a6d189\", args);\n }\n\n public error(...args: any[]) {\n this._log(\"error\", \"#e78284\", args);\n }\n\n public errorCustomFmt(fmt: string, ...args: any[]) {\n this._log(\"error\", \"#e78284\", args, fmt);\n }\n\n public warn(...args: any[]) {\n this._log(\"warn\", \"#e5c890\", args);\n }\n\n public debug(...args: any[]) {\n this._log(\"debug\", \"#eebebe\", args);\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nlet styleStr = \"\";\n\nexport const Margins: Record<`${\"top\" | \"bottom\" | \"left\" | \"right\"}${8 | 16 | 20}`, string> = {} as any;\n\nfor (const dir of [\"top\", \"bottom\", \"left\", \"right\"] as const) {\n for (const size of [8, 16, 20] as const) {\n const cl = `vc-m-${dir}-${size}`;\n Margins[`${dir}${size}`] = cl;\n styleStr += `.${cl}{margin-${dir}:${size}px;}`;\n }\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", () =>\n document.head.append(Object.assign(document.createElement(\"style\"), {\n textContent: styleStr,\n id: \"vencord-margins\"\n })), { once: true });\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function makeLazy(factory: () => T, attempts = 5): () => T {\n let tries = 0;\n let cache: T;\n return () => {\n if (!cache && attempts > tries++) {\n cache = factory();\n if (!cache && attempts === tries)\n console.error(\"Lazy factory failed:\", factory);\n }\n return cache;\n };\n}\n\n// Proxies demand that these properties be unmodified, so proxyLazy\n// will always return the function default for them.\nconst unconfigurable = [\"arguments\", \"caller\", \"prototype\"];\n\nconst handler: ProxyHandler = {};\n\nconst kGET = Symbol.for(\"vencord.lazy.get\");\nconst kCACHE = Symbol.for(\"vencord.lazy.cached\");\n\nfor (const method of [\n \"apply\",\n \"construct\",\n \"defineProperty\",\n \"deleteProperty\",\n \"getOwnPropertyDescriptor\",\n \"getPrototypeOf\",\n \"has\",\n \"isExtensible\",\n \"ownKeys\",\n \"preventExtensions\",\n \"set\",\n \"setPrototypeOf\"\n]) {\n handler[method] =\n (target: any, ...args: any[]) => Reflect[method](target[kGET](), ...args);\n}\n\nhandler.ownKeys = target => {\n const v = target[kGET]();\n const keys = Reflect.ownKeys(v);\n for (const key of unconfigurable) {\n if (!keys.includes(key)) keys.push(key);\n }\n return keys;\n};\n\nhandler.getOwnPropertyDescriptor = (target, p) => {\n if (typeof p === \"string\" && unconfigurable.includes(p))\n return Reflect.getOwnPropertyDescriptor(target, p);\n\n const descriptor = Reflect.getOwnPropertyDescriptor(target[kGET](), p);\n\n if (descriptor) Object.defineProperty(target, p, descriptor);\n return descriptor;\n};\n\n/**\n * Wraps the result of {@see makeLazy} in a Proxy you can consume as if it wasn't lazy.\n * On first property access, the lazy is evaluated\n * @param factory lazy factory\n * @param attempts how many times to try to evaluate the lazy before giving up\n * @returns Proxy\n *\n * Note that the example below exists already as an api, see {@link findByPropsLazy}\n * @example const mod = proxyLazy(() => findByProps(\"blah\")); console.log(mod.blah);\n */\nexport function proxyLazy(factory: () => T, attempts = 5, isChild = false): T {\n let isSameTick = true;\n if (!isChild)\n setTimeout(() => isSameTick = false, 0);\n\n let tries = 0;\n const proxyDummy = Object.assign(function () { }, {\n [kCACHE]: void 0 as T | undefined,\n [kGET]() {\n if (!proxyDummy[kCACHE] && attempts > tries++) {\n proxyDummy[kCACHE] = factory();\n if (!proxyDummy[kCACHE] && attempts === tries)\n console.error(\"Lazy factory failed:\", factory);\n }\n return proxyDummy[kCACHE];\n }\n });\n\n return new Proxy(proxyDummy, {\n ...handler,\n get(target, p, receiver) {\n // if we're still in the same tick, it means the lazy was immediately used.\n // thus, we lazy proxy the get access to make things like destructuring work as expected\n // meow here will also be a lazy\n // `const { meow } = findByPropsLazy(\"meow\");`\n if (!isChild && isSameTick)\n return proxyLazy(\n () => Reflect.get(target[kGET](), p, receiver),\n attempts,\n true\n );\n\n return Reflect.get(target[kGET](), p, receiver);\n }\n }) as any;\n}\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { makeLazy } from \"./lazy\";\n\nconst NoopComponent = () => null;\n\n/**\n * A lazy component. The factory method is called on first render.\n * @param factory Function returning a Component\n * @param attempts How many times to try to get the component before giving up\n * @returns Result of factory function\n */\nexport function LazyComponent(factory: () => React.ComponentType, attempts = 5) {\n const get = makeLazy(factory, attempts);\n return (props: T) => {\n const Component = get() ?? NoopComponent;\n return ;\n };\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Logger } from \"@utils/Logger\";\n\nif (IS_DEV) {\n var traces = {} as Record;\n var logger = new Logger(\"Tracer\", \"#FFD166\");\n}\n\nconst noop = function () { };\n\nexport const beginTrace = !IS_DEV ? noop :\n function beginTrace(name: string, ...args: any[]) {\n if (name in traces)\n throw new Error(`Trace ${name} already exists!`);\n\n traces[name] = [performance.now(), args];\n };\n\nexport const finishTrace = !IS_DEV ? noop : function finishTrace(name: string) {\n const end = performance.now();\n\n const [start, args] = traces[name];\n delete traces[name];\n\n logger.debug(`${name} took ${end - start}ms`, args);\n};\n\ntype Func = (...args: any[]) => any;\ntype TraceNameMapper = (...args: Parameters) => string;\n\nconst noopTracer =\n (name: string, f: F, mapper?: TraceNameMapper) => f;\n\nexport const traceFunction = !IS_DEV\n ? noopTracer\n : function traceFunction(name: string, f: F, mapper?: TraceNameMapper): F {\n return function (this: any, ...args: Parameters) {\n const traceName = mapper?.(...args) ?? name;\n\n beginTrace(traceName, ...arguments);\n try {\n return f.apply(this, args);\n } finally {\n finishTrace(traceName);\n }\n } as F;\n };\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { proxyLazy } from \"@utils/lazy\";\nimport { LazyComponent } from \"@utils/lazyReact\";\nimport { Logger } from \"@utils/Logger\";\nimport type { WebpackInstance } from \"discord-types/other\";\n\nimport { traceFunction } from \"../debug/Tracer\";\n\nconst logger = new Logger(\"Webpack\");\n\nexport let _resolveReady: () => void;\n/**\n * Fired once a gateway connection to Discord has been established.\n * This indicates that the core webpack modules have been initialised\n */\nexport const onceReady = new Promise(r => _resolveReady = r);\n\nexport let wreq: WebpackInstance;\nexport let cache: WebpackInstance[\"c\"];\n\nexport type FilterFn = (mod: any) => boolean;\n\nexport const filters = {\n byProps: (...props: string[]): FilterFn =>\n props.length === 1\n ? m => m[props[0]] !== void 0\n : m => props.every(p => m[p] !== void 0),\n\n byCode: (...code: string[]): FilterFn => m => {\n if (typeof m !== \"function\") return false;\n const s = Function.prototype.toString.call(m);\n for (const c of code) {\n if (!s.includes(c)) return false;\n }\n return true;\n },\n byStoreName: (name: string): FilterFn => m =>\n m.constructor?.displayName === name,\n\n componentByCode: (...code: string[]): FilterFn => {\n const filter = filters.byCode(...code);\n return m => {\n if (filter(m)) return true;\n if (!m.$$typeof) return false;\n if (m.type) return filter(m.type); // memos\n if (m.render) return filter(m.render); // forwardRefs\n return false;\n };\n }\n};\n\nexport const subscriptions = new Map();\nexport const listeners = new Set();\n\nexport type CallbackFn = (mod: any, id: number) => void;\n\nexport function _initWebpack(instance: typeof window.webpackChunkdiscord_app) {\n if (cache !== void 0) throw \"no.\";\n\n instance.push([[Symbol(\"Vencord\")], {}, r => wreq = r]);\n instance.pop();\n if (!wreq) return false;\n\n cache = wreq.c;\n return true;\n}\n\nif (IS_DEV && IS_DISCORD_DESKTOP) {\n var devToolsOpen = false;\n // At this point in time, DiscordNative has not been exposed yet, so setImmediate is needed\n setTimeout(() => {\n DiscordNative/* just to make sure */?.window.setDevtoolsCallbacks(() => devToolsOpen = true, () => devToolsOpen = false);\n }, 0);\n}\n\nfunction handleModuleNotFound(method: string, ...filter: unknown[]) {\n const err = new Error(`webpack.${method} found no module`);\n logger.error(err, \"Filter:\", filter);\n\n // Strict behaviour in DevBuilds to fail early and make sure the issue is found\n if (IS_DEV && !devToolsOpen)\n throw err;\n}\n\n/**\n * Find the first module that matches the filter\n */\nexport const find = traceFunction(\"find\", function find(filter: FilterFn, { isIndirect = false, isWaitFor = false }: { isIndirect?: boolean; isWaitFor?: boolean; } = {}) {\n if (typeof filter !== \"function\")\n throw new Error(\"Invalid filter. Expected a function got \" + typeof filter);\n\n for (const key in cache) {\n const mod = cache[key];\n if (!mod?.exports) continue;\n\n if (filter(mod.exports)) {\n return isWaitFor ? [mod.exports, Number(key)] : mod.exports;\n }\n\n if (mod.exports.default && filter(mod.exports.default)) {\n const found = mod.exports.default;\n return isWaitFor ? [found, Number(key)] : found;\n }\n }\n\n if (!isIndirect) {\n handleModuleNotFound(\"find\", filter);\n }\n\n return isWaitFor ? [null, null] : null;\n});\n\n/**\n * find but lazy\n */\nexport function findLazy(filter: FilterFn) {\n return proxyLazy(() => find(filter));\n}\n\nexport function findAll(filter: FilterFn) {\n if (typeof filter !== \"function\")\n throw new Error(\"Invalid filter. Expected a function got \" + typeof filter);\n\n const ret = [] as any[];\n for (const key in cache) {\n const mod = cache[key];\n if (!mod?.exports) continue;\n\n if (filter(mod.exports))\n ret.push(mod.exports);\n\n if (mod.exports.default && filter(mod.exports.default))\n ret.push(mod.exports.default);\n }\n\n return ret;\n}\n\n/**\n * Same as {@link find} but in bulk\n * @param filterFns Array of filters. Please note that this array will be modified in place, so if you still\n * need it afterwards, pass a copy.\n * @returns Array of results in the same order as the passed filters\n */\nexport const findBulk = traceFunction(\"findBulk\", function findBulk(...filterFns: FilterFn[]) {\n if (!Array.isArray(filterFns))\n throw new Error(\"Invalid filters. Expected function[] got \" + typeof filterFns);\n\n const { length } = filterFns;\n\n if (length === 0)\n throw new Error(\"Expected at least two filters.\");\n\n if (length === 1) {\n if (IS_DEV) {\n throw new Error(\"bulk called with only one filter. Use find\");\n }\n return find(filterFns[0]);\n }\n\n const filters = filterFns as Array;\n\n let found = 0;\n const results = Array(length);\n\n outer:\n for (const key in cache) {\n const mod = cache[key];\n if (!mod?.exports) continue;\n\n for (let j = 0; j < length; j++) {\n const filter = filters[j];\n // Already done\n if (filter === undefined) continue;\n\n if (filter(mod.exports)) {\n results[j] = mod.exports;\n filters[j] = undefined;\n if (++found === length) break outer;\n break;\n }\n\n if (mod.exports.default && filter(mod.exports.default)) {\n results[j] = mod.exports.default;\n filters[j] = undefined;\n if (++found === length) break outer;\n break;\n }\n }\n }\n\n if (found !== length) {\n const err = new Error(`Got ${length} filters, but only found ${found} modules!`);\n if (IS_DEV) {\n if (!devToolsOpen)\n // Strict behaviour in DevBuilds to fail early and make sure the issue is found\n throw err;\n } else {\n logger.warn(err);\n }\n }\n\n return results;\n});\n\n/**\n * Find the id of a module by its code\n * @param code Code\n * @returns number or null\n */\nexport const findModuleId = traceFunction(\"findModuleId\", function findModuleId(code: string) {\n for (const id in wreq.m) {\n if (wreq.m[id].toString().includes(code)) {\n return Number(id);\n }\n }\n\n const err = new Error(\"Didn't find module with code:\\n\" + code);\n if (IS_DEV) {\n if (!devToolsOpen)\n // Strict behaviour in DevBuilds to fail early and make sure the issue is found\n throw err;\n } else {\n logger.warn(err);\n }\n\n return null;\n});\n\n/**\n * Find the first module that has the specified properties\n */\nexport function findByProps(...props: string[]) {\n const res = find(filters.byProps(...props), { isIndirect: true });\n if (!res)\n handleModuleNotFound(\"findByProps\", ...props);\n return res;\n}\n\n/**\n * findByProps but lazy\n */\nexport function findByPropsLazy(...props: string[]) {\n return proxyLazy(() => findByProps(...props));\n}\n\n/**\n * Find a function by its code\n */\nexport function findByCode(...code: string[]) {\n const res = find(filters.byCode(...code), { isIndirect: true });\n if (!res)\n handleModuleNotFound(\"findByCode\", ...code);\n return res;\n}\n\n/**\n * findByCode but lazy\n */\nexport function findByCodeLazy(...code: string[]) {\n return proxyLazy(() => findByCode(...code));\n}\n\n/**\n * Find a store by its displayName\n */\nexport function findStore(name: string) {\n const res = find(filters.byStoreName(name), { isIndirect: true });\n if (!res)\n handleModuleNotFound(\"findStore\", name);\n return res;\n}\n\n/**\n * findStore but lazy\n */\nexport function findStoreLazy(name: string) {\n return proxyLazy(() => findStore(name));\n}\n\n/**\n * Finds the component which includes all the given code. Checks for plain components, memos and forwardRefs\n */\nexport function findComponentByCode(...code: string[]) {\n const res = find(filters.componentByCode(...code), { isIndirect: true });\n if (!res)\n handleModuleNotFound(\"findComponentByCode\", ...code);\n return res;\n}\n\n/**\n * Finds the first component that matches the filter, lazily.\n */\nexport function findComponentLazy(filter: FilterFn) {\n return LazyComponent(() => find(filter));\n}\n\n/**\n * Finds the first component that includes all the given code, lazily\n */\nexport function findComponentByCodeLazy(...code: string[]) {\n return LazyComponent(() => findComponentByCode(...code));\n}\n\n/**\n * Finds the first component that is exported by the first prop name, lazily\n */\nexport function findExportedComponentLazy(...props: string[]) {\n return LazyComponent(() => findByProps(...props)?.[props[0]]);\n}\n\n/**\n * Wait for a module that matches the provided filter to be registered,\n * then call the callback with the module as the first argument\n */\nexport function waitFor(filter: string | string[] | FilterFn, callback: CallbackFn) {\n if (typeof filter === \"string\")\n filter = filters.byProps(filter);\n else if (Array.isArray(filter))\n filter = filters.byProps(...filter);\n else if (typeof filter !== \"function\")\n throw new Error(\"filter must be a string, string[] or function, got \" + typeof filter);\n\n const [existing, id] = find(filter!, { isIndirect: true, isWaitFor: true });\n if (existing) return void callback(existing, id);\n\n subscriptions.set(filter, callback);\n}\n\nexport function addListener(callback: CallbackFn) {\n listeners.add(callback);\n}\n\nexport function removeListener(callback: CallbackFn) {\n listeners.delete(callback);\n}\n\n/**\n * Search modules by keyword. This searches the factory methods,\n * meaning you can search all sorts of things, displayName, methodName, strings somewhere in the code, etc\n * @param filters One or more strings or regexes\n * @returns Mapping of found modules\n */\nexport function search(...filters: Array) {\n const results = {} as Record;\n const factories = wreq.m;\n outer:\n for (const id in factories) {\n const factory = factories[id].original ?? factories[id];\n const str: string = factory.toString();\n for (const filter of filters) {\n if (typeof filter === \"string\" && !str.includes(filter)) continue outer;\n if (filter instanceof RegExp && !filter.test(str)) continue outer;\n }\n results[id] = factory;\n }\n\n return results;\n}\n\n/**\n * Extract a specific module by id into its own Source File. This has no effect on\n * the code, it is only useful to be able to look at a specific module without having\n * to view a massive file. extract then returns the extracted module so you can jump to it.\n * As mentioned above, note that this extracted module is not actually used,\n * so putting breakpoints or similar will have no effect.\n * @param id The id of the module to extract\n */\nexport function extract(id: number) {\n const mod = wreq.m[id] as Function;\n if (!mod) return null;\n\n const code = `\n// [EXTRACTED] WebpackModule${id}\n// WARNING: This module was extracted to be more easily readable.\n// This module is NOT ACTUALLY USED! This means putting breakpoints will have NO EFFECT!!\n\n0,${mod.toString()}\n//# sourceURL=ExtractedWebpackModule${id}\n`;\n const extracted = (0, eval)(code);\n return extracted as Function;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { findByPropsLazy, findLazy } from \"@webpack\";\n\nimport * as t from \"./types/classes\";\n\nexport const ModalImageClasses: t.ImageModalClasses = findLazy(m => m.image && m.modal && !m.applicationIcon);\nexport const ButtonWrapperClasses: t.ButtonWrapperClasses = findByPropsLazy(\"buttonWrapper\", \"buttonContent\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { LazyComponent } from \"@utils/react\";\n\n// eslint-disable-next-line path-alias/no-relative\nimport { FilterFn, filters, waitFor } from \"../webpack\";\n\nexport function waitForComponent = React.ComponentType & Record>(name: string, filter: FilterFn | string | string[]): T {\n let myValue: T = function () {\n throw new Error(`Vencord could not find the ${name} Component`);\n } as any;\n\n const lazyComponent = LazyComponent(() => myValue) as T;\n waitFor(filter, (v: any) => {\n myValue = v;\n Object.assign(lazyComponent, v);\n });\n\n return lazyComponent;\n}\n\nexport function waitForStore(name: string, cb: (v: any) => void) {\n waitFor(filters.byStoreName(name), cb);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n// eslint-disable-next-line path-alias/no-relative\nimport { filters, waitFor } from \"@webpack\";\n\nimport { waitForComponent } from \"./internal\";\nimport * as t from \"./types/components\";\n\nexport let Forms = {} as {\n FormTitle: t.FormTitle,\n FormSection: t.FormSection,\n FormDivider: t.FormDivider,\n FormText: t.FormText,\n};\n\nexport let Card: t.Card;\nexport let Button: t.Button;\nexport let Switch: t.Switch;\nexport let Tooltip: t.Tooltip;\nexport let TextInput: t.TextInput;\nexport let TextArea: t.TextArea;\nexport let Text: t.Text;\nexport let Select: t.Select;\nexport let SearchableSelect: t.SearchableSelect;\nexport let Slider: t.Slider;\nexport let ButtonLooks: t.ButtonLooks;\nexport let Popout: t.Popout;\nexport let Dialog: t.Dialog;\nexport let TabBar: any;\nexport let Paginator: t.Paginator;\nexport let ScrollerThin: t.ScrollerThin;\nexport let Clickable: t.Clickable;\nexport let Avatar: t.Avatar;\n// token lagger real\n/** css colour resolver stuff, no clue what exactly this does, just copied usage from Discord */\nexport let useToken: t.useToken;\n\nexport const MaskedLink = waitForComponent(\"MaskedLink\", m => m?.type?.toString().includes(\"MASKED_LINK)\"));\nexport const Timestamp = waitForComponent(\"Timestamp\", filters.byCode(\".Messages.MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL.format\"));\nexport const Flex = waitForComponent(\"Flex\", [\"Justify\", \"Align\", \"Wrap\"]);\n\nwaitFor([\"FormItem\", \"Button\"], m => {\n ({ useToken, Card, Button, FormSwitch: Switch, Tooltip, TextInput, TextArea, Text, Select, SearchableSelect, Slider, ButtonLooks, TabBar, Popout, Dialog, Paginator, ScrollerThin, Clickable, Avatar } = m);\n Forms = m;\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n// eslint-disable-next-line path-alias/no-relative\nimport { findByPropsLazy, waitFor } from \"../webpack\";\nimport type * as t from \"./types/menu\";\n\nexport let Menu = {} as t.Menu;\n\nwaitFor([\"MenuItem\", \"MenuSliderControl\"], m => Menu = m);\n\nexport const ContextMenuApi: t.ContextMenuApi = findByPropsLazy(\"closeContextMenu\", \"openContextMenu\");\n\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n// eslint-disable-next-line path-alias/no-relative\nimport { findByPropsLazy, waitFor } from \"../webpack\";\n\nexport let React: typeof import(\"react\");\nexport let useState: typeof React.useState;\nexport let useEffect: typeof React.useEffect;\nexport let useMemo: typeof React.useMemo;\nexport let useRef: typeof React.useRef;\nexport let useReducer: typeof React.useReducer;\nexport let useCallback: typeof React.useCallback;\n\nexport const ReactDOM: typeof import(\"react-dom\") & typeof import(\"react-dom/client\") = findByPropsLazy(\"createPortal\", \"render\");\n\nwaitFor(\"useState\", m => {\n React = m;\n ({ useEffect, useState, useMemo, useRef, useReducer, useCallback } = React);\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { findByPropsLazy } from \"@webpack\";\n\nexport const TextAndImagesSettingsStores = findByPropsLazy(\"MessageDisplayCompact\");\nexport const StatusSettingsStores = findByPropsLazy(\"ShowCurrentGame\");\n\nexport const UserSettingsActionCreators = findByPropsLazy(\"PreloadedUserSettingsActionCreators\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type * as Stores from \"discord-types/stores\";\n\n// eslint-disable-next-line path-alias/no-relative\nimport { findByPropsLazy } from \"../webpack\";\nimport { waitForStore } from \"./internal\";\nimport * as t from \"./types/stores\";\n\nexport const Flux: t.Flux = findByPropsLazy(\"connectStores\");\n\nexport type GenericStore = t.FluxStore & Record;\n\nexport enum DraftType {\n ChannelMessage = 0,\n ThreadSettings = 1,\n FirstThreadMessage = 2,\n ApplicationLauncherCommand = 3\n}\n\nexport let MessageStore: Omit & {\n getMessages(chanId: string): any;\n};\n\n// this is not actually a FluxStore\nexport const PrivateChannelsStore = findByPropsLazy(\"openPrivateChannel\");\nexport let PermissionStore: GenericStore;\nexport let GuildChannelStore: GenericStore;\nexport let ReadStateStore: GenericStore;\nexport let PresenceStore: GenericStore;\nexport let PoggerModeSettingsStore: GenericStore;\n\nexport let GuildStore: Stores.GuildStore & t.FluxStore;\nexport let UserStore: Stores.UserStore & t.FluxStore;\nexport let UserProfileStore: GenericStore;\nexport let SelectedChannelStore: Stores.SelectedChannelStore & t.FluxStore;\nexport let SelectedGuildStore: t.FluxStore & Record;\nexport let ChannelStore: Stores.ChannelStore & t.FluxStore;\nexport let GuildMemberStore: Stores.GuildMemberStore & t.FluxStore;\nexport let RelationshipStore: Stores.RelationshipStore & t.FluxStore & {\n /** Get the date (as a string) that the relationship was created */\n getSince(userId: string): string;\n};\n\nexport let EmojiStore: t.EmojiStore;\nexport let WindowStore: t.WindowStore;\nexport let DraftStore: t.DraftStore;\n\n/**\n * React hook that returns stateful data for one or more stores\n * You might need a custom comparator (4th argument) if your store data is an object\n *\n * @param stores The stores to listen to\n * @param mapper A function that returns the data you need\n * @param idk some thing, idk just pass null\n * @param isEqual A custom comparator for the data returned by mapper\n *\n * @example const user = useStateFromStores([UserStore], () => UserStore.getCurrentUser(), null, (old, current) => old.id === current.id);\n */\nexport const { useStateFromStores }: {\n useStateFromStores: (\n stores: t.FluxStore[],\n mapper: () => T,\n idk?: any,\n isEqual?: (old: T, newer: T) => boolean\n ) => T;\n}\n = findByPropsLazy(\"useStateFromStores\");\n\nwaitForStore(\"DraftStore\", s => DraftStore = s);\nwaitForStore(\"UserStore\", s => UserStore = s);\nwaitForStore(\"UserProfileStore\", m => UserProfileStore = m);\nwaitForStore(\"ChannelStore\", m => ChannelStore = m);\nwaitForStore(\"SelectedChannelStore\", m => SelectedChannelStore = m);\nwaitForStore(\"SelectedGuildStore\", m => SelectedGuildStore = m);\nwaitForStore(\"GuildStore\", m => GuildStore = m);\nwaitForStore(\"GuildMemberStore\", m => GuildMemberStore = m);\nwaitForStore(\"RelationshipStore\", m => RelationshipStore = m);\nwaitForStore(\"PermissionStore\", m => PermissionStore = m);\nwaitForStore(\"PresenceStore\", m => PresenceStore = m);\nwaitForStore(\"ReadStateStore\", m => ReadStateStore = m);\nwaitForStore(\"GuildChannelStore\", m => GuildChannelStore = m);\nwaitForStore(\"MessageStore\", m => MessageStore = m);\nwaitForStore(\"WindowStore\", m => WindowStore = m);\nwaitForStore(\"EmojiStore\", m => EmojiStore = m);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { Moment } from \"moment\";\nimport type { ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, KeyboardEvent, MouseEvent, PropsWithChildren, PropsWithRef, ReactNode, Ref } from \"react\";\n\nexport type TextVariant = \"heading-sm/normal\" | \"heading-sm/medium\" | \"heading-sm/semibold\" | \"heading-sm/bold\" | \"heading-md/normal\" | \"heading-md/medium\" | \"heading-md/semibold\" | \"heading-md/bold\" | \"heading-lg/normal\" | \"heading-lg/medium\" | \"heading-lg/semibold\" | \"heading-lg/bold\" | \"heading-xl/normal\" | \"heading-xl/medium\" | \"heading-xl/bold\" | \"heading-xxl/normal\" | \"heading-xxl/medium\" | \"heading-xxl/bold\" | \"eyebrow\" | \"heading-deprecated-14/normal\" | \"heading-deprecated-14/medium\" | \"heading-deprecated-14/bold\" | \"text-xxs/normal\" | \"text-xxs/medium\" | \"text-xxs/semibold\" | \"text-xxs/bold\" | \"text-xs/normal\" | \"text-xs/medium\" | \"text-xs/semibold\" | \"text-xs/bold\" | \"text-sm/normal\" | \"text-sm/medium\" | \"text-sm/semibold\" | \"text-sm/bold\" | \"text-md/normal\" | \"text-md/medium\" | \"text-md/semibold\" | \"text-md/bold\" | \"text-lg/normal\" | \"text-lg/medium\" | \"text-lg/semibold\" | \"text-lg/bold\" | \"display-sm\" | \"display-md\" | \"display-lg\" | \"code\";\nexport type FormTextTypes = Record<\"DEFAULT\" | \"INPUT_PLACEHOLDER\" | \"DESCRIPTION\" | \"LABEL_BOLD\" | \"LABEL_SELECTED\" | \"LABEL_DESCRIPTOR\" | \"ERROR\" | \"SUCCESS\", string>;\nexport type Heading = `h${1 | 2 | 3 | 4 | 5 | 6}`;\n\nexport type Margins = Record<\"marginTop16\" | \"marginTop8\" | \"marginBottom8\" | \"marginTop20\" | \"marginBottom20\", string>;\nexport type ButtonLooks = Record<\"FILLED\" | \"INVERTED\" | \"OUTLINED\" | \"LINK\" | \"BLANK\", string>;\n\nexport type TextProps = PropsWithChildren & {\n variant?: TextVariant;\n tag?: \"div\" | \"span\" | \"p\" | \"strong\" | Heading;\n selectable?: boolean;\n lineClamp?: number;\n}>;\n\nexport type Text = ComponentType;\n\nexport type FormTitle = ComponentType & PropsWithChildren<{\n /** default is h5 */\n tag?: Heading;\n faded?: boolean;\n disabled?: boolean;\n required?: boolean;\n error?: ReactNode;\n}>>;\n\nexport type FormSection = ComponentType>;\n\nexport type FormDivider = ComponentType<{\n className?: string;\n style?: CSSProperties;\n}>;\n\n\nexport type FormText = ComponentType & TextProps> & { Types: FormTextTypes; };\n\nexport type Tooltip = ComponentType<{\n text: ReactNode;\n children: FunctionComponent<{\n onClick(): void;\n onMouseEnter(): void;\n onMouseLeave(): void;\n onContextMenu(): void;\n onFocus(): void;\n onBlur(): void;\n \"aria-label\"?: string;\n }>;\n \"aria-label\"?: string;\n\n allowOverflow?: boolean;\n forceOpen?: boolean;\n hide?: boolean;\n hideOnClick?: boolean;\n shouldShow?: boolean;\n spacing?: number;\n\n /** Tooltip.Colors.BLACK */\n color?: string;\n /** TooltipPositions.TOP */\n position?: string;\n\n tooltipClassName?: string;\n tooltipContentClassName?: string;\n}> & {\n Colors: Record<\"BLACK\" | \"BRAND\" | \"CUSTOM\" | \"GREEN\" | \"GREY\" | \"PRIMARY\" | \"RED\" | \"YELLOW\", string>;\n};\n\nexport type TooltipPositions = Record<\"BOTTOM\" | \"CENTER\" | \"LEFT\" | \"RIGHT\" | \"TOP\" | \"WINDOW_CENTER\", string>;\n\nexport type Card = ComponentType & {\n editable?: boolean;\n outline?: boolean;\n /** Card.Types.PRIMARY */\n type?: string;\n}>> & {\n Types: Record<\"BRAND\" | \"CUSTOM\" | \"DANGER\" | \"PRIMARY\" | \"SUCCESS\" | \"WARNING\", string>;\n};\n\nexport type Button = ComponentType, \"size\"> & {\n /** Button.Looks.FILLED */\n look?: string;\n /** Button.Colors.BRAND */\n color?: string;\n /** Button.Sizes.MEDIUM */\n size?: string;\n /** Button.BorderColors.BLACK */\n borderColor?: string;\n\n wrapperClassName?: string;\n className?: string;\n innerClassName?: string;\n\n buttonRef?: Ref;\n focusProps?: any;\n\n submittingStartedLabel?: string;\n submittingFinishedLabel?: string;\n}>> & {\n BorderColors: Record<\"BLACK\" | \"BRAND\" | \"BRAND_NEW\" | \"GREEN\" | \"LINK\" | \"PRIMARY\" | \"RED\" | \"TRANSPARENT\" | \"WHITE\" | \"YELLOW\", string>;\n Colors: Record<\"BRAND\" | \"RED\" | \"GREEN\" | \"YELLOW\" | \"PRIMARY\" | \"LINK\" | \"WHITE\" | \"BLACK\" | \"TRANSPARENT\" | \"BRAND_NEW\" | \"CUSTOM\", string>;\n Hovers: Record<\"DEFAULT\" | \"BRAND\" | \"RED\" | \"GREEN\" | \"YELLOW\" | \"PRIMARY\" | \"LINK\" | \"WHITE\" | \"BLACK\" | \"TRANSPARENT\", string>;\n Looks: Record<\"FILLED\" | \"INVERTED\" | \"OUTLINED\" | \"LINK\" | \"BLANK\", string>;\n Sizes: Record<\"NONE\" | \"TINY\" | \"SMALL\" | \"MEDIUM\" | \"LARGE\" | \"XLARGE\" | \"MIN\" | \"MAX\" | \"ICON\", string>;\n\n Link: any;\n};\n\nexport type Switch = ComponentType>;\n\nexport type Timestamp = ComponentType>;\n\nexport type TextInput = ComponentType;\n prefixElement?: ReactNode;\n\n focusProps?: any;\n\n /** TextInput.Sizes.DEFAULT */\n size?: string;\n} & Omit, \"onChange\">>> & {\n Sizes: Record<\"DEFAULT\" | \"MINI\", string>;\n};\n\nexport type TextArea = ComponentType, \"onChange\"> & {\n onChange(v: string): void;\n}>>;\n\ninterface SelectOption {\n disabled?: boolean;\n value: any;\n label: string;\n key?: React.Key;\n default?: boolean;\n}\n\nexport type Select = ComponentType; // TODO\n\n /**\n * - 0 ~ Filled\n * - 1 ~ Custom\n */\n look?: 0 | 1;\n className?: string;\n popoutClassName?: string;\n popoutPosition?: \"top\" | \"left\" | \"right\" | \"bottom\" | \"center\" | \"window_center\";\n optionClassName?: string;\n\n autoFocus?: boolean;\n isDisabled?: boolean;\n clearable?: boolean;\n closeOnSelect?: boolean;\n hideIcon?: boolean;\n\n select(value: any): void;\n isSelected(value: any): boolean;\n serialize(value: any): string;\n clear?(): void;\n\n maxVisibleItems?: number;\n popoutWidth?: number;\n\n onClose?(): void;\n onOpen?(): void;\n\n renderOptionLabel?(option: SelectOption): ReactNode;\n /** discord stupid this gets all options instead of one yeah */\n renderOptionValue?(option: SelectOption[]): ReactNode;\n\n \"aria-label\"?: boolean;\n \"aria-labelledby\"?: boolean;\n}>>;\n\nexport type SearchableSelect = ComponentType; // TODO\n value?: SelectOption;\n\n /**\n * - 0 ~ Filled\n * - 1 ~ Custom\n */\n look?: 0 | 1;\n className?: string;\n popoutClassName?: string;\n wrapperClassName?: string;\n popoutPosition?: \"top\" | \"left\" | \"right\" | \"bottom\" | \"center\" | \"window_center\";\n optionClassName?: string;\n\n autoFocus?: boolean;\n isDisabled?: boolean;\n clearable?: boolean;\n closeOnSelect?: boolean;\n clearOnSelect?: boolean;\n multi?: boolean;\n\n onChange(value: any): void;\n onSearchChange?(value: string): void;\n\n onClose?(): void;\n onOpen?(): void;\n onBlur?(): void;\n\n renderOptionPrefix?(option: SelectOption): ReactNode;\n renderOptionSuffix?(option: SelectOption): ReactNode;\n\n filter?(option: SelectOption[], query: string): SelectOption[];\n\n centerCaret?: boolean;\n debounceTime?: number;\n maxVisibleItems?: number;\n popoutWidth?: number;\n\n \"aria-labelledby\"?: boolean;\n}>>;\n\nexport type Slider = ComponentType>;\n\n// TODO - type maybe idk probably not that useful other than the constants\nexport type Flex = ComponentType> & {\n Align: Record<\"START\" | \"END\" | \"CENTER\" | \"STRETCH\" | \"BASELINE\", string>;\n Direction: Record<\"VERTICAL\" | \"HORIZONTAL\" | \"HORIZONTAL_REVERSE\", string>;\n Justify: Record<\"START\" | \"END\" | \"CENTER\" | \"BETWEEN\" | \"AROUND\", string>;\n Wrap: Record<\"NO_WRAP\" | \"WRAP\" | \"WRAP_REVERSE\", string>;\n};\n\ndeclare enum PopoutAnimation {\n NONE = \"1\",\n TRANSLATE = \"2\",\n SCALE = \"3\",\n FADE = \"4\"\n}\n\nexport type Popout = ComponentType<{\n children(\n thing: {\n \"aria-controls\": string;\n \"aria-expanded\": boolean;\n onClick(event: MouseEvent): void;\n onKeyDown(event: KeyboardEvent): void;\n onMouseDown(event: MouseEvent): void;\n },\n data: {\n isShown: boolean;\n position: string;\n }\n ): ReactNode;\n shouldShow?: boolean;\n renderPopout(args: {\n closePopout(): void;\n isPositioned: boolean;\n nudge: number;\n position: string;\n setPopoutRef(ref: any): void;\n updatePosition(): void;\n }): ReactNode;\n\n onRequestOpen?(): void;\n onRequestClose?(): void;\n\n /** \"center\" and others */\n align?: string;\n /** Popout.Animation */\n animation?: PopoutAnimation;\n autoInvert?: boolean;\n nudgeAlignIntoViewport?: boolean;\n /** \"bottom\" and others */\n position?: string;\n positionKey?: string;\n spacing?: number;\n}> & {\n Animation: typeof PopoutAnimation;\n};\n\nexport type Dialog = ComponentType>;\n\ntype Resolve = (data: { theme: \"light\" | \"dark\", saturation: number; }) => {\n hex(): string;\n hsl(): string;\n int(): number;\n spring(): string;\n};\n\nexport type useToken = (color: {\n css: string;\n resolve: Resolve;\n}) => ReturnType;\n\nexport type Paginator = ComponentType<{\n currentPage: number;\n maxVisiblePages: number;\n pageSize: number;\n totalCount: number;\n\n onPageChange?(page: number): void;\n hideMaxPage?: boolean;\n}>;\n\nexport type MaskedLink = ComponentType>;\n\nexport type ScrollerThin = ComponentType>;\n\nexport type Clickable = ComponentType>;\n\nexport type Avatar = ComponentType>;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { ComponentType, CSSProperties, MouseEvent, PropsWithChildren, ReactNode, UIEvent } from \"react\";\n\ntype RC = ComponentType>>;\n\nexport interface Menu {\n Menu: RC<{\n navId: string;\n onClose(): void;\n className?: string;\n style?: CSSProperties;\n hideScroller?: boolean;\n onSelect?(): void;\n }>;\n MenuSeparator: ComponentType;\n MenuGroup: RC<{\n label?: string;\n }>;\n MenuItem: RC<{\n id: string;\n label: ReactNode;\n action?(e: MouseEvent): void;\n icon?: ComponentType;\n\n color?: string;\n render?: ComponentType;\n onChildrenScroll?: Function;\n childRowHeight?: number;\n listClassName?: string;\n disabled?: boolean;\n }>;\n MenuCheckboxItem: RC<{\n id: string;\n label: string;\n checked: boolean;\n action?(e: MouseEvent): void;\n disabled?: boolean;\n }>;\n MenuRadioItem: RC<{\n id: string;\n group: string;\n label: string;\n checked: boolean;\n action?(e: MouseEvent): void;\n disabled?: boolean;\n }>;\n MenuControlItem: RC<{\n id: string;\n interactive?: boolean;\n }>;\n MenuSliderControl: RC<{\n minValue: number,\n maxValue: number,\n value: number,\n onChange(value: number): void,\n renderValue?(value: number): string,\n }>;\n}\n\nexport interface ContextMenuApi {\n closeContextMenu(): void;\n openContextMenu(\n event: UIEvent,\n render?: Menu[\"Menu\"],\n options?: { enableSpellCheck?: boolean; },\n renderLazy?: () => Promise\n ): void;\n openContextMenuLazy(\n event: UIEvent,\n renderLazy?: () => Promise,\n options?: { enableSpellCheck?: boolean; }\n ): void;\n}\n\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { ReactNode } from \"react\";\n\nimport type { FluxEvents } from \"./fluxEvents\";\nimport { i18nMessages } from \"./i18nMessages\";\n\nexport { FluxEvents };\n\nexport interface FluxDispatcher {\n _actionHandlers: any;\n _subscriptions: any;\n dispatch(event: { [key: string]: unknown; type: FluxEvents; }): Promise;\n isDispatching(): boolean;\n subscribe(event: FluxEvents, callback: (data: any) => void): void;\n unsubscribe(event: FluxEvents, callback: (data: any) => void): void;\n wait(callback: () => void): void;\n}\n\nexport type Parser = Record<\n | \"parse\"\n | \"parseTopic\"\n | \"parseEmbedTitle\"\n | \"parseInlineReply\"\n | \"parseGuildVerificationFormRule\"\n | \"parseGuildEventDescription\"\n | \"parseAutoModerationSystemMessage\"\n | \"parseForumPostGuidelines\"\n | \"parseForumPostMostRecentMessage\",\n (content: string, inline?: boolean, state?: Record) => ReactNode[]\n> & Record<\"defaultRules\" | \"guildEventRules\", Record>>;\n\nexport interface Alerts {\n show(alert: {\n title: any;\n body: React.ReactNode;\n className?: string;\n confirmColor?: string;\n cancelText?: string;\n confirmText?: string;\n secondaryConfirmText?: string;\n onCancel?(): void;\n onConfirm?(): void;\n onConfirmSecondary?(): void;\n }): void;\n /** This is a noop, it does nothing. */\n close(): void;\n}\n\nexport interface SnowflakeUtils {\n fromTimestamp(timestamp: number): string;\n extractTimestamp(snowflake: string): number;\n age(snowflake: string): number;\n atPreviousMillisecond(snowflake: string): string;\n compare(snowflake1?: string, snowflake2?: string): number;\n}\n\ninterface RestRequestData {\n url: string;\n query?: Record;\n body?: Record;\n oldFormErrors?: boolean;\n retries?: number;\n}\n\nexport type RestAPI = Record<\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\", (data: RestRequestData) => Promise> & {\n V6OrEarlierAPIError: Error;\n V8APIError: Error;\n getAPIBaseURL(withVersion?: boolean): string;\n};\n\nexport type Permissions = \"CREATE_INSTANT_INVITE\"\n | \"KICK_MEMBERS\"\n | \"BAN_MEMBERS\"\n | \"ADMINISTRATOR\"\n | \"MANAGE_CHANNELS\"\n | \"MANAGE_GUILD\"\n | \"CHANGE_NICKNAME\"\n | \"MANAGE_NICKNAMES\"\n | \"MANAGE_ROLES\"\n | \"MANAGE_WEBHOOKS\"\n | \"MANAGE_GUILD_EXPRESSIONS\"\n | \"CREATE_GUILD_EXPRESSIONS\"\n | \"VIEW_AUDIT_LOG\"\n | \"VIEW_CHANNEL\"\n | \"VIEW_GUILD_ANALYTICS\"\n | \"VIEW_CREATOR_MONETIZATION_ANALYTICS\"\n | \"MODERATE_MEMBERS\"\n | \"SEND_MESSAGES\"\n | \"SEND_TTS_MESSAGES\"\n | \"MANAGE_MESSAGES\"\n | \"EMBED_LINKS\"\n | \"ATTACH_FILES\"\n | \"READ_MESSAGE_HISTORY\"\n | \"MENTION_EVERYONE\"\n | \"USE_EXTERNAL_EMOJIS\"\n | \"ADD_REACTIONS\"\n | \"USE_APPLICATION_COMMANDS\"\n | \"MANAGE_THREADS\"\n | \"CREATE_PUBLIC_THREADS\"\n | \"CREATE_PRIVATE_THREADS\"\n | \"USE_EXTERNAL_STICKERS\"\n | \"SEND_MESSAGES_IN_THREADS\"\n | \"SEND_VOICE_MESSAGES\"\n | \"CONNECT\"\n | \"SPEAK\"\n | \"MUTE_MEMBERS\"\n | \"DEAFEN_MEMBERS\"\n | \"MOVE_MEMBERS\"\n | \"USE_VAD\"\n | \"PRIORITY_SPEAKER\"\n | \"STREAM\"\n | \"USE_EMBEDDED_ACTIVITIES\"\n | \"USE_SOUNDBOARD\"\n | \"USE_EXTERNAL_SOUNDS\"\n | \"REQUEST_TO_SPEAK\"\n | \"MANAGE_EVENTS\"\n | \"CREATE_EVENTS\";\n\nexport type PermissionsBits = Record;\n\nexport interface Locale {\n name: string;\n value: string;\n localizedName: string;\n}\n\nexport interface LocaleInfo {\n code: string;\n enabled: boolean;\n name: string;\n englishName: string;\n postgresLang: string;\n}\n\nexport interface i18n {\n getAvailableLocales(): Locale[];\n getLanguages(): LocaleInfo[];\n getDefaultLocale(): string;\n getLocale(): string;\n getLocaleInfo(): LocaleInfo;\n setLocale(locale: string): void;\n\n loadPromise: Promise;\n\n Messages: Record;\n}\n\nexport interface Clipboard {\n copy(text: string): void;\n SUPPORTS_COPY: boolean;\n}\n\nexport interface NavigationRouter {\n back(): void;\n forward(): void;\n hasNavigated(): boolean;\n getHistory(): {\n action: string;\n length: 50;\n [key: string]: any;\n };\n transitionTo(path: string, ...args: unknown[]): void;\n transitionToGuild(guildId: string, ...args: unknown[]): void;\n replaceWith(...args: unknown[]): void;\n getLastRouteChangeSource(): any;\n getLastRouteChangeSourceLocationStack(): any;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { proxyLazy } from \"@utils/lazy\";\nimport type { Channel, User } from \"discord-types/general\";\n\n// eslint-disable-next-line path-alias/no-relative\nimport { _resolveReady, find, findByPropsLazy, findLazy, waitFor } from \"../webpack\";\nimport type * as t from \"./types/utils\";\n\nexport let FluxDispatcher: t.FluxDispatcher;\nexport let ComponentDispatch;\nwaitFor([\"ComponentDispatch\", \"ComponentDispatcher\"], m => ComponentDispatch = m.ComponentDispatch);\n\n\nexport const RestAPI: t.RestAPI = findByPropsLazy(\"getAPIBaseURL\", \"get\");\nexport const moment: typeof import(\"moment\") = findByPropsLazy(\"parseTwoDigitYear\");\n\nexport const hljs: typeof import(\"highlight.js\") = findByPropsLazy(\"highlight\", \"registerLanguage\");\n\nexport const lodash: typeof import(\"lodash\") = findByPropsLazy(\"debounce\", \"cloneDeep\");\n\nexport const i18n: t.i18n = findLazy(m => m.Messages?.[\"en-US\"]);\n\nexport let SnowflakeUtils: t.SnowflakeUtils;\nwaitFor([\"fromTimestamp\", \"extractTimestamp\"], m => SnowflakeUtils = m);\n\nexport let Parser: t.Parser;\nexport let Alerts: t.Alerts;\n\nconst ToastType = {\n MESSAGE: 0,\n SUCCESS: 1,\n FAILURE: 2,\n CUSTOM: 3\n};\nconst ToastPosition = {\n TOP: 0,\n BOTTOM: 1\n};\n\nexport const Toasts = {\n Type: ToastType,\n Position: ToastPosition,\n // what's less likely than getting 0 from Math.random()? Getting it twice in a row\n genId: () => (Math.random() || Math.random()).toString(36).slice(2),\n\n // hack to merge with the following interface, dunno if there's a better way\n ...{} as {\n show(data: {\n message: string,\n id: string,\n /**\n * Toasts.Type\n */\n type: number,\n options?: {\n /**\n * Toasts.Position\n */\n position?: number;\n component?: React.ReactNode,\n duration?: number;\n };\n }): void;\n pop(): void;\n }\n};\n\n/**\n * Show a simple toast. If you need more options, use Toasts.show manually\n */\nexport function showToast(message: string, type = ToastType.MESSAGE) {\n Toasts.show({\n id: Toasts.genId(),\n message,\n type\n });\n}\n\nexport const UserUtils = findByPropsLazy(\"getUser\", \"fetchCurrentUser\") as { getUser: (id: string) => Promise; };\nexport const UploadHandler = findByPropsLazy(\"showUploadFileSizeExceededError\", \"promptToUpload\") as {\n promptToUpload: (files: File[], channel: Channel, draftType: Number) => void;\n};\n\nexport const ApplicationAssetUtils = findByPropsLazy(\"fetchAssetIds\", \"getAssetImage\") as {\n fetchAssetIds: (applicationId: string, e: string[]) => Promise;\n};\n\nexport const Clipboard: t.Clipboard = findByPropsLazy(\"SUPPORTS_COPY\", \"copy\");\n\nexport const NavigationRouter: t.NavigationRouter = findByPropsLazy(\"transitionTo\", \"replaceWith\", \"transitionToGuild\");\n\nwaitFor([\"dispatch\", \"subscribe\"], m => {\n FluxDispatcher = m;\n const cb = () => {\n m.unsubscribe(\"CONNECTION_OPEN\", cb);\n _resolveReady();\n };\n m.subscribe(\"CONNECTION_OPEN\", cb);\n});\n\n\n// This is the same module but this is easier\nwaitFor(\"showToast\", m => {\n Toasts.show = m.showToast;\n Toasts.pop = m.popToast;\n});\n\nwaitFor([\"show\", \"close\"], m => Alerts = m);\nwaitFor(\"parseTopic\", m => Parser = m);\n\nexport let SettingsRouter: any;\nwaitFor([\"open\", \"saveAccountChanges\"], m => SettingsRouter = m);\n\nexport const PermissionsBits: t.PermissionsBits = proxyLazy(() => find(m => typeof m.Permissions?.ADMINISTRATOR === \"bigint\").Permissions);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport * from \"./classes\";\nexport * from \"./components\";\nexport * from \"./menu\";\nexport * from \"./react\";\nexport * from \"./settingsStores\";\nexport * from \"./stores\";\nexport * as ComponentTypes from \"./types/components.d\";\nexport * as MenuTypes from \"./types/menu.d\";\nexport * as UtilTypes from \"./types/utils.d\";\nexport * from \"./utils\";\n", "export default \"81fb7c6\"", "export default \"Vendicated/Vencord\"", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport gitHash from \"~git-hash\";\nimport gitRemote from \"~git-remote\";\n\nexport {\n gitHash,\n gitRemote\n};\n\nexport const WEBPACK_CHUNK = \"webpackChunkdiscord_app\";\nexport const REACT_GLOBAL = \"Vencord.Webpack.Common.React\";\nexport const VENCORD_USER_AGENT = `Vencord/${gitHash}${gitRemote ? ` (https://github.com/${gitRemote})` : \"\"}`;\nexport const SUPPORT_CHANNEL_ID = \"1026515880080842772\";\n\nexport interface Dev {\n name: string;\n id: bigint;\n badge?: boolean;\n}\n\n/**\n * If you made a plugin or substantial contribution, add yourself here.\n * This object is used for the plugin author list, as well as to add a contributor badge to your profile.\n * If you wish to stay fully anonymous, feel free to set ID to 0n.\n * If you are fine with attribution but don't want the badge, add badge: false\n */\nexport const Devs = /* #__PURE__*/ Object.freeze({\n Ven: {\n name: \"Vendicated\",\n id: 343383572805058560n\n },\n Arjix: {\n name: \"ArjixWasTaken\",\n id: 674710789138939916n\n },\n Cyn: {\n name: \"Cynosphere\",\n id: 150745989836308480n\n },\n Megu: {\n name: \"Megumin\",\n id: 545581357812678656n\n },\n botato: {\n name: \"botato\",\n id: 440990343899643943n\n },\n obscurity: {\n name: \"obscurity\",\n id: 336678828233588736n,\n },\n rushii: {\n name: \"rushii\",\n id: 295190422244950017n\n },\n Glitch: {\n name: \"Glitchy\",\n id: 269567451199569920n\n },\n Samu: {\n name: \"Samu\",\n id: 702973430449832038n,\n },\n Animal: {\n name: \"Animal\",\n id: 118437263754395652n\n },\n MaiKokain: {\n name: \"Mai\",\n id: 722647978577363026n\n },\n echo: {\n name: \"ECHO\",\n id: 712639419785412668n\n },\n katlyn: {\n name: \"katlyn\",\n id: 250322741406859265n\n },\n nea: {\n name: \"nea\",\n id: 310702108997320705n,\n },\n Nuckyz: {\n name: \"Nuckyz\",\n id: 235834946571337729n\n },\n D3SOX: {\n name: \"D3SOX\",\n id: 201052085641281538n\n },\n Nickyux: {\n name: \"Nickyux\",\n id: 427146305651998721n\n },\n mantikafasi: {\n name: \"mantikafasi\",\n id: 287555395151593473n\n },\n Xinto: {\n name: \"Xinto\",\n id: 423915768191647755n\n },\n JacobTm: {\n name: \"Jacob.Tm\",\n id: 302872992097107991n\n },\n DustyAngel47: {\n name: \"DustyAngel47\",\n id: 714583473804935238n\n },\n BanTheNons: {\n name: \"BanTheNons\",\n id: 460478012794863637n\n },\n BigDuck: {\n name: \"BigDuck\",\n id: 1024588272623681609n\n },\n AverageReactEnjoyer: {\n name: \"Average React Enjoyer\",\n id: 1004904120056029256n\n },\n adryd: {\n name: \"adryd\",\n id: 0n\n },\n Tyman: {\n name: \"Tyman\",\n id: 487443883127472129n\n },\n afn: {\n name: \"afn\",\n id: 420043923822608384n\n },\n KraXen72: {\n name: \"KraXen72\",\n id: 379304073515499530n\n },\n kemo: {\n name: \"kemo\",\n id: 299693897859465228n\n },\n dzshn: {\n name: \"dzshn\",\n id: 310449948011528192n\n },\n Ducko: {\n name: \"Ducko\",\n id: 506482395269169153n\n },\n jewdev: {\n name: \"jewdev\",\n id: 222369866529636353n\n },\n Luna: {\n name: \"Luny\",\n id: 821472922140803112n\n },\n Vap: {\n name: \"Vap0r1ze\",\n id: 454072114492866560n\n },\n KingFish: {\n name: \"King Fish\",\n id: 499400512559382538n\n },\n Commandtechno: {\n name: \"Commandtechno\",\n id: 296776625432035328n,\n },\n TheSun: {\n name: \"ActuallyTheSun\",\n id: 406028027768733696n\n },\n axyie: {\n name: \"'ax\",\n id: 273562710745284628n,\n },\n pointy: {\n name: \"pointy\",\n id: 99914384989519872n\n },\n SammCheese: {\n name: \"Samm-Cheese\",\n id: 372148345894076416n\n },\n zt: {\n name: \"zt\",\n id: 289556910426816513n\n },\n captain: {\n name: \"Captain\",\n id: 347366054806159360n\n },\n nick: {\n name: \"nick\",\n id: 347884694408265729n,\n badge: false\n },\n whqwert: {\n name: \"whqwert\",\n id: 586239091520176128n\n },\n lewisakura: {\n name: \"lewisakura\",\n id: 96269247411400704n\n },\n RuiNtD: {\n name: \"RuiNtD\",\n id: 157917665162297344n\n },\n hunt: {\n name: \"hunt-g\",\n id: 222800179697287168n\n },\n cloudburst: {\n name: \"cloudburst\",\n id: 892128204150685769n\n },\n Aria: {\n name: \"Syncxv\",\n id: 549244932213309442n,\n },\n TheKodeToad: {\n name: \"TheKodeToad\",\n id: 706152404072267788n\n },\n LordElias: {\n name: \"LordElias\",\n id: 319460781567639554n\n },\n juby: {\n name: \"Juby210\",\n id: 324622488644616195n\n },\n Alyxia: {\n name: \"Alyxia Sother\",\n id: 952185386350829688n\n },\n Remty: {\n name: \"Remty\",\n id: 335055032204656642n\n },\n skyevg: {\n name: \"skyevg\",\n id: 1090310844283363348n\n },\n Dziurwa: {\n name: \"Dziurwa\",\n id: 1001086404203389018n\n },\n F53: {\n name: \"F53\",\n id: 280411966126948353n\n },\n AutumnVN: {\n name: \"AutumnVN\",\n id: 393694671383166998n\n },\n pylix: {\n name: \"pylix\",\n id: 492949202121261067n\n },\n Tyler: {\n name: \"\\\\\\\\GGTyler\\\\\\\\\",\n id: 143117463788191746n\n },\n RyanCaoDev: {\n name: \"RyanCaoDev\",\n id: 952235800110694471n,\n },\n Strencher: {\n name: \"Strencher\",\n id: 415849376598982656n\n },\n FieryFlames: {\n name: \"Fiery\",\n id: 890228870559698955n\n },\n KannaDev: {\n name: \"Kanna\",\n id: 317728561106518019n\n },\n carince: {\n name: \"carince\",\n id: 818323528755314698n\n },\n PandaNinjas: {\n name: \"PandaNinjas\",\n id: 455128749071925248n\n },\n CatNoir: {\n name: \"CatNoir\",\n id: 260371016348336128n\n },\n outfoxxed: {\n name: \"outfoxxed\",\n id: 837425748435796060n\n },\n UwUDev: {\n name: \"UwU\",\n id: 691413039156690994n,\n },\n amia: {\n name: \"amia\",\n id: 142007603549962240n\n },\n phil: {\n name: \"phil\",\n id: 305288513941667851n\n },\n ImLvna: {\n name: \"Luna <3\",\n id: 799319081723232267n\n },\n rad: {\n name: \"rad\",\n id: 610945092504780823n\n },\n AndrewDLO: {\n name: \"Andrew-DLO\",\n id: 434135504792059917n\n },\n HypedDomi: {\n name: \"HypedDomi\",\n id: 354191516979429376n\n },\n Rini: {\n name: \"Rini\",\n id: 1079479184478441643n\n },\n castdrian: {\n name: \"castdrian\",\n id: 224617799434108928n\n },\n Arrow: {\n name: \"arrow\",\n id: 958158495302176778n\n },\n bb010g: {\n name: \"bb010g\",\n id: 72791153467990016n,\n },\n Lumap: {\n name: \"lumap\",\n id: 635383782576357407n\n },\n Dolfies: {\n name: \"Dolfies\",\n id: 852892297661906993n,\n },\n RuukuLada: {\n name: \"RuukuLada\",\n id: 119705748346241027n,\n },\n blahajZip: {\n name: \"blahaj.zip\",\n id: 683954422241427471n,\n },\n archeruwu: {\n name: \"archer_uwu\",\n id: 160068695383736320n\n },\n ProffDea: {\n name: \"ProffDea\",\n id: 609329952180928513n\n },\n ant0n: {\n name: \"ant0n\",\n id: 145224646868860928n\n },\n} satisfies Record);\n\n// iife so #__PURE__ works correctly\nexport const DevsById = /* #__PURE__*/ (() =>\n Object.freeze(Object.fromEntries(\n Object.entries(Devs)\n .filter(d => d[1].id !== 0n)\n .map(([_, v]) => [v.id, v] as const)\n ))\n)() as Record;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Clipboard, Toasts } from \"@webpack/common\";\n\nimport { DevsById } from \"./constants\";\n\n/**\n * Recursively merges defaults into an object and returns the same object\n * @param obj Object\n * @param defaults Defaults\n * @returns obj\n */\nexport function mergeDefaults(obj: T, defaults: T): T {\n for (const key in defaults) {\n const v = defaults[key];\n if (typeof v === \"object\" && !Array.isArray(v)) {\n obj[key] ??= {} as any;\n mergeDefaults(obj[key], v);\n } else {\n obj[key] ??= v;\n }\n }\n return obj;\n}\n\n/**\n * Calls .join(\" \") on the arguments\n * classes(\"one\", \"two\") => \"one two\"\n */\nexport function classes(...classes: Array) {\n return classes.filter(Boolean).join(\" \");\n}\n\n/**\n * Returns a promise that resolves after the specified amount of time\n */\nexport function sleep(ms: number): Promise {\n return new Promise(r => setTimeout(r, ms));\n}\n\nexport function copyWithToast(text: string, toastMessage = \"Copied to clipboard!\") {\n if (Clipboard.SUPPORTS_COPY) {\n Clipboard.copy(text);\n } else {\n toastMessage = \"Your browser does not support copying to clipboard\";\n }\n Toasts.show({\n message: toastMessage,\n id: Toasts.genId(),\n type: Toasts.Type.SUCCESS\n });\n}\n\n/**\n * Check if obj is a true object: of type \"object\" and not null or array\n */\nexport function isObject(obj: unknown): obj is object {\n return typeof obj === \"object\" && obj !== null && !Array.isArray(obj);\n}\n\n/**\n * Check if an object is empty or in other words has no own properties\n */\nexport function isObjectEmpty(obj: object) {\n for (const k in obj)\n if (Object.hasOwn(obj, k)) return false;\n\n return true;\n}\n\n/**\n * Returns null if value is not a URL, otherwise return URL object.\n * Avoids having to wrap url checks in a try/catch\n */\nexport function parseUrl(urlString: string): URL | null {\n try {\n return new URL(urlString);\n } catch {\n return null;\n }\n}\n\n/**\n * Checks whether an element is on screen\n */\nexport const checkIntersecting = (el: Element) => {\n const elementBox = el.getBoundingClientRect();\n const documentHeight = Math.max(document.documentElement.clientHeight, window.innerHeight);\n return !(elementBox.bottom < 0 || elementBox.top - documentHeight >= 0);\n};\n\nexport function identity(value: T): T {\n return value;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#mobile_tablet_or_desktop\n// \"In summary, we recommend looking for the string Mobi anywhere in the User Agent to detect a mobile device.\"\nexport const isMobile = navigator.userAgent.includes(\"Mobi\");\n\nexport const isPluginDev = (id: string) => Object.hasOwn(DevsById, id);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { React, useEffect, useMemo, useReducer, useState } from \"@webpack/common\";\n\nimport { checkIntersecting } from \"./misc\";\n\nexport * from \"./lazyReact\";\n\nexport const NoopComponent = () => null;\n\n/**\n * Check if an element is on screen\n * @param intersectOnly If `true`, will only update the state when the element comes into view\n * @returns [refCallback, isIntersecting]\n */\nexport const useIntersection = (intersectOnly = false): [\n refCallback: React.RefCallback,\n isIntersecting: boolean,\n] => {\n const observerRef = React.useRef(null);\n const [isIntersecting, setIntersecting] = useState(false);\n\n const refCallback = (element: Element | null) => {\n observerRef.current?.disconnect();\n observerRef.current = null;\n\n if (!element) return;\n\n if (checkIntersecting(element)) {\n setIntersecting(true);\n if (intersectOnly) return;\n }\n\n observerRef.current = new IntersectionObserver(entries => {\n for (const entry of entries) {\n if (entry.target !== element) continue;\n if (entry.isIntersecting && intersectOnly) {\n setIntersecting(true);\n observerRef.current?.disconnect();\n observerRef.current = null;\n } else {\n setIntersecting(entry.isIntersecting);\n }\n }\n });\n observerRef.current.observe(element);\n };\n\n return [refCallback, isIntersecting];\n};\n\ntype AwaiterRes = [T, any, boolean];\ninterface AwaiterOpts {\n fallbackValue: T;\n deps?: unknown[];\n onError?(e: any): void;\n onSuccess?(value: T): void;\n}\n/**\n * Await a promise\n * @param factory Factory\n * @param fallbackValue The fallback value that will be used until the promise resolved\n * @returns [value, error, isPending]\n */\nexport function useAwaiter(factory: () => Promise): AwaiterRes;\nexport function useAwaiter(factory: () => Promise, providedOpts: AwaiterOpts): AwaiterRes;\nexport function useAwaiter(factory: () => Promise, providedOpts?: AwaiterOpts): AwaiterRes {\n const opts: Required> = Object.assign({\n fallbackValue: null,\n deps: [],\n onError: null,\n }, providedOpts);\n const [state, setState] = useState({\n value: opts.fallbackValue,\n error: null,\n pending: true\n });\n\n useEffect(() => {\n let isAlive = true;\n if (!state.pending) setState({ ...state, pending: true });\n\n factory()\n .then(value => {\n if (!isAlive) return;\n setState({ value, error: null, pending: false });\n opts.onSuccess?.(value);\n })\n .catch(error => {\n if (!isAlive) return;\n setState({ value: null, error, pending: false });\n opts.onError?.(error);\n });\n\n return () => void (isAlive = false);\n }, opts.deps);\n\n return [state.value, state.error, state.pending];\n}\n\n/**\n * Returns a function that can be used to force rerender react components\n */\nexport function useForceUpdater(): () => void;\nexport function useForceUpdater(withDep: true): [unknown, () => void];\nexport function useForceUpdater(withDep?: true) {\n const r = useReducer(x => x + 1, 0);\n return withDep ? r : r[1];\n}\n\ninterface TimerOpts {\n interval?: number;\n deps?: unknown[];\n}\n\nexport function useTimer({ interval = 1000, deps = [] }: TimerOpts) {\n const [time, setTime] = useState(0);\n const start = useMemo(() => Date.now(), deps);\n\n useEffect(() => {\n const intervalId = setInterval(() => setTime(Date.now() - start), interval);\n\n return () => {\n setTime(0);\n clearInterval(intervalId);\n };\n }, deps);\n\n return time;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./ErrorCard.css\";\n\nimport { classes } from \"@utils/misc\";\nimport type { HTMLProps } from \"react\";\n\nexport function ErrorCard(props: React.PropsWithChildren>) {\n return (\n
\n {props.children}\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Logger } from \"@utils/Logger\";\nimport { Margins } from \"@utils/margins\";\nimport { LazyComponent } from \"@utils/react\";\nimport { React } from \"@webpack/common\";\n\nimport { ErrorCard } from \"./ErrorCard\";\n\ninterface Props {\n /** Render nothing if an error occurs */\n noop?: boolean;\n /** Fallback component to render if an error occurs */\n fallback?: React.ComponentType>;\n /** called when an error occurs. The props property is only available if using .wrap */\n onError?(data: { error: Error, errorInfo: React.ErrorInfo, props: T; }): void;\n /** Custom error message */\n message?: string;\n\n /** The props passed to the wrapped component. Only used by wrap */\n wrappedProps?: T;\n}\n\nconst color = \"#e78284\";\n\nconst logger = new Logger(\"React ErrorBoundary\", color);\n\nconst NO_ERROR = {};\n\n// We might want to import this in a place where React isn't ready yet.\n// Thus, wrap in a LazyComponent\nconst ErrorBoundary = LazyComponent(() => {\n return class ErrorBoundary extends React.PureComponent> {\n state = {\n error: NO_ERROR as any,\n stack: \"\",\n message: \"\"\n };\n\n static getDerivedStateFromError(error: any) {\n let stack = error?.stack ?? \"\";\n let message = error?.message || String(error);\n\n if (error instanceof Error && stack) {\n const eolIdx = stack.indexOf(\"\\n\");\n if (eolIdx !== -1) {\n message = stack.slice(0, eolIdx);\n stack = stack.slice(eolIdx + 1).replace(/https:\\/\\/\\S+\\/assets\\//g, \"\");\n }\n }\n\n return { error, stack, message };\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n this.props.onError?.({ error, errorInfo, props: this.props.wrappedProps });\n logger.error(\"A component threw an Error\\n\", error);\n logger.error(\"Component Stack\", errorInfo.componentStack);\n }\n\n render() {\n if (this.state.error === NO_ERROR) return this.props.children;\n\n if (this.props.noop) return null;\n\n if (this.props.fallback)\n return ;\n\n const msg = this.props.message || \"An error occurred while rendering this Component. More info can be found below and in your console.\";\n\n return (\n \n

Oh no!

\n

{msg}

\n \n {this.state.message}\n {!!this.state.stack && (\n
\n                                {this.state.stack}\n                            
\n )}\n
\n
\n );\n }\n };\n}) as\n React.ComponentType> & {\n wrap(Component: React.ComponentType, errorBoundaryProps?: Omit, \"wrappedProps\">): React.FunctionComponent;\n };\n\nErrorBoundary.wrap = (Component, errorBoundaryProps) => props => (\n \n \n \n);\n\nexport default ErrorBoundary;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function Heart() {\n return (\n \n \n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Button } from \"@webpack/common\";\n\nimport { Heart } from \"./Heart\";\n\nexport default function DonateButton(props: any) {\n return (\n VencordNative.native.openExternal(\"https://github.com/sponsors/Vendicated\")}\n >\n \n Donate\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { React } from \"@webpack/common\";\n\nexport function Flex(props: React.PropsWithChildren<{\n flexDirection?: React.CSSProperties[\"flexDirection\"];\n style?: React.CSSProperties;\n className?: string;\n} & React.HTMLProps>) {\n props.style ??= {};\n props.style.display = \"flex\";\n // TODO(ven): Remove me, what was I thinking??\n props.style.gap ??= \"1em\";\n props.style.flexDirection ||= props.flexDirection;\n delete props.flexDirection;\n return (\n
\n {props.children}\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { findByProps, findByPropsLazy } from \"@webpack\";\nimport type { ComponentType, PropsWithChildren, ReactNode, Ref } from \"react\";\n\nimport { LazyComponent } from \"./react\";\n\nexport const enum ModalSize {\n SMALL = \"small\",\n MEDIUM = \"medium\",\n LARGE = \"large\",\n DYNAMIC = \"dynamic\",\n}\n\nconst enum ModalTransitionState {\n ENTERING,\n ENTERED,\n EXITING,\n EXITED,\n HIDDEN,\n}\n\nexport interface ModalProps {\n transitionState: ModalTransitionState;\n onClose(): Promise;\n}\n\nexport interface ModalOptions {\n modalKey?: string;\n onCloseRequest?: (() => void);\n onCloseCallback?: (() => void);\n}\n\ntype RenderFunction = (props: ModalProps) => ReactNode;\n\nexport const Modals = findByPropsLazy(\"ModalRoot\", \"ModalCloseButton\") as {\n ModalRoot: ComponentType>;\n ModalHeader: ComponentType>;\n /** This also accepts Scroller props but good luck with that */\n ModalContent: ComponentType;\n [prop: string]: any;\n }>>;\n ModalFooter: ComponentType>;\n ModalCloseButton: ComponentType<{\n focusProps?: any;\n onClick(): void;\n withCircleBackground?: boolean;\n hideOnFullscreen?: boolean;\n className?: string;\n }>;\n};\n\nexport type ImageModal = ComponentType<{\n className?: string;\n src: string;\n placeholder: string;\n original: string;\n width?: number;\n height?: number;\n animated?: boolean;\n responsive?: boolean;\n renderLinkComponent(props: any): ReactNode;\n maxWidth?: number;\n maxHeight?: number;\n shouldAnimate?: boolean;\n onClose?(): void;\n shouldHideMediaOptions?: boolean;\n}>;\n\nexport const ImageModal = LazyComponent(() => findByProps(\"ImageModal\").ImageModal as ImageModal);\n\nexport const ModalRoot = LazyComponent(() => Modals.ModalRoot);\nexport const ModalHeader = LazyComponent(() => Modals.ModalHeader);\nexport const ModalContent = LazyComponent(() => Modals.ModalContent);\nexport const ModalFooter = LazyComponent(() => Modals.ModalFooter);\nexport const ModalCloseButton = LazyComponent(() => Modals.ModalCloseButton);\n\nconst ModalAPI = findByPropsLazy(\"openModalLazy\");\n\n/**\n * Wait for the render promise to resolve, then open a modal with it.\n * This is equivalent to render().then(openModal)\n * You should use the Modal components exported by this file\n */\nexport function openModalLazy(render: () => Promise, options?: ModalOptions & { contextKey?: string; }): Promise {\n return ModalAPI.openModalLazy(render, options);\n}\n\n/**\n * Open a Modal with the given render function.\n * You should use the Modal components exported by this file\n */\nexport function openModal(render: RenderFunction, options?: ModalOptions, contextKey?: string): string {\n return ModalAPI.openModal(render, options, contextKey);\n}\n\n/**\n * Close a modal by its key\n */\nexport function closeModal(modalKey: string, contextKey?: string): void {\n return ModalAPI.closeModal(modalKey, contextKey);\n}\n\n/**\n * Close all open modals\n */\nexport function closeAllModals(): void {\n return ModalAPI.closeAllModals();\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Command } from \"@api/Commands\";\nimport { FluxEvents } from \"@webpack/types\";\nimport { Promisable } from \"type-fest\";\n\n// exists to export default definePlugin({...})\nexport default function definePlugin

(p: P & Record) {\n return p;\n}\n\nexport type ReplaceFn = (match: string, ...groups: string[]) => string;\n\nexport interface PatchReplacement {\n match: string | RegExp;\n replace: string | ReplaceFn;\n predicate?(): boolean;\n}\n\nexport interface Patch {\n plugin: string;\n find: string;\n replacement: PatchReplacement | PatchReplacement[];\n /** Whether this patch should apply to multiple modules */\n all?: boolean;\n /** Do not warn if this patch did no changes */\n noWarn?: boolean;\n /** Only apply this set of replacements if all of them succeed. Use this if your replacements depend on each other */\n group?: boolean;\n predicate?(): boolean;\n}\n\nexport interface PluginAuthor {\n name: string;\n id: BigInt;\n}\n\nexport interface Plugin extends PluginDef {\n patches?: Patch[];\n started: boolean;\n isDependency?: boolean;\n}\n\nexport interface PluginDef {\n name: string;\n description: string;\n authors: PluginAuthor[];\n start?(): void;\n stop?(): void;\n patches?: Omit[];\n /**\n * List of commands. If you specify these, you must add CommandsAPI to dependencies\n */\n commands?: Command[];\n /**\n * A list of other plugins that your plugin depends on.\n * These will automatically be enabled and loaded before your plugin\n * Common examples are CommandsAPI, MessageEventsAPI...\n */\n dependencies?: string[],\n /**\n * Whether this plugin is required and forcefully enabled\n */\n required?: boolean;\n /**\n * Whether this plugin should be enabled by default, but can be disabled\n */\n enabledByDefault?: boolean;\n /**\n * When to call the start() method\n * @default StartAt.WebpackReady\n */\n startAt?: StartAt,\n /**\n * Optionally provide settings that the user can configure in the Plugins tab of settings.\n * @deprecated Use `settings` instead\n */\n // TODO: Remove when everything is migrated to `settings`\n options?: Record;\n /**\n * Optionally provide settings that the user can configure in the Plugins tab of settings.\n */\n settings?: DefinedSettings;\n /**\n * Check that this returns true before allowing a save to complete.\n * If a string is returned, show the error to the user.\n */\n beforeSave?(options: Record): Promisable;\n /**\n * Allows you to specify a custom Component that will be rendered in your\n * plugin's settings page\n */\n settingsAboutComponent?: React.ComponentType<{\n tempSettings?: Record;\n }>;\n /**\n * Allows you to subscribe to Flux events\n */\n flux?: {\n [E in FluxEvents]?: (event: any) => void;\n };\n /**\n * Allows you to add custom actions to the Vencord Toolbox.\n * The key will be used as text for the button\n */\n toolboxActions?: Record void>;\n\n tags?: string[];\n}\n\nexport const enum StartAt {\n /** Right away, as soon as Vencord initialised */\n Init = \"Init\",\n /** On the DOMContentLoaded event, so once the document is ready */\n DOMContentLoaded = \"DOMContentLoaded\",\n /** Once Discord's core webpack modules have finished loading, so as soon as things like react and flux are available */\n WebpackReady = \"WebpackReady\"\n}\n\nexport const enum OptionType {\n STRING,\n NUMBER,\n BIGINT,\n BOOLEAN,\n SELECT,\n SLIDER,\n COMPONENT,\n}\n\nexport type SettingsDefinition = Record;\nexport type SettingsChecks = {\n [K in keyof D]?: D[K] extends PluginSettingComponentDef ? IsDisabled> :\n (IsDisabled> & IsValid, DefinedSettings>);\n};\n\nexport type PluginSettingDef = (\n | PluginSettingStringDef\n | PluginSettingNumberDef\n | PluginSettingBooleanDef\n | PluginSettingSelectDef\n | PluginSettingSliderDef\n | PluginSettingComponentDef\n | PluginSettingBigIntDef\n) & PluginSettingCommon;\n\nexport interface PluginSettingCommon {\n description: string;\n placeholder?: string;\n onChange?(newValue: any): void;\n /**\n * Whether changing this setting requires a restart\n */\n restartNeeded?: boolean;\n componentProps?: Record;\n /**\n * Hide this setting from the settings UI\n */\n hidden?: boolean;\n /**\n * Set this if the setting only works on Browser or Desktop, not both\n */\n target?: \"WEB\" | \"DESKTOP\" | \"BOTH\";\n}\ninterface IsDisabled {\n /**\n * Checks if this setting should be disabled\n */\n disabled?(this: D): boolean;\n}\ninterface IsValid {\n /**\n * Prevents the user from saving settings if this is false or a string\n */\n isValid?(this: D, value: T): boolean | string;\n}\n\nexport interface PluginSettingStringDef {\n type: OptionType.STRING;\n default?: string;\n}\nexport interface PluginSettingNumberDef {\n type: OptionType.NUMBER;\n default?: number;\n}\nexport interface PluginSettingBigIntDef {\n type: OptionType.BIGINT;\n default?: BigInt;\n}\nexport interface PluginSettingBooleanDef {\n type: OptionType.BOOLEAN;\n default?: boolean;\n}\n\nexport interface PluginSettingSelectDef {\n type: OptionType.SELECT;\n options: readonly PluginSettingSelectOption[];\n}\nexport interface PluginSettingSelectOption {\n label: string;\n value: string | number | boolean;\n default?: boolean;\n}\n\nexport interface PluginSettingSliderDef {\n type: OptionType.SLIDER;\n /**\n * All the possible values in the slider. Needs at least two values.\n */\n markers: number[];\n /**\n * Default value to use\n */\n default: number;\n /**\n * If false, allow users to select values in-between your markers.\n */\n stickToMarkers?: boolean;\n}\n\ninterface IPluginOptionComponentProps {\n /**\n * Run this when the value changes.\n *\n * NOTE: The user will still need to click save to apply these changes.\n */\n setValue(newValue: any): void;\n /**\n * Set to true to prevent the user from saving.\n *\n * NOTE: This will not show the error to the user. It will only stop them saving.\n * Make sure to show the error in your component.\n */\n setError(error: boolean): void;\n /**\n * The options object\n */\n option: PluginSettingComponentDef;\n}\n\nexport interface PluginSettingComponentDef {\n type: OptionType.COMPONENT;\n component: (props: IPluginOptionComponentProps) => JSX.Element;\n}\n\n/** Maps a `PluginSettingDef` to its value type */\ntype PluginSettingType = O extends PluginSettingStringDef ? string :\n O extends PluginSettingNumberDef ? number :\n O extends PluginSettingBigIntDef ? BigInt :\n O extends PluginSettingBooleanDef ? boolean :\n O extends PluginSettingSelectDef ? O[\"options\"][number][\"value\"] :\n O extends PluginSettingSliderDef ? number :\n O extends PluginSettingComponentDef ? any :\n never;\ntype PluginSettingDefaultType = O extends PluginSettingSelectDef ? (\n O[\"options\"] extends { default?: boolean; }[] ? O[\"options\"][number][\"value\"] : undefined\n) : O extends { default: infer T; } ? T : undefined;\n\ntype SettingsStore = {\n [K in keyof D]: PluginSettingType | PluginSettingDefaultType;\n};\n\n/** An instance of defined plugin settings */\nexport interface DefinedSettings<\n Def extends SettingsDefinition = SettingsDefinition,\n Checks extends SettingsChecks = {},\n PrivateSettings extends object = {}\n> {\n /** Shorthand for `Vencord.Settings.plugins.PluginName`, but with typings */\n store: SettingsStore & PrivateSettings;\n /**\n * React hook for getting the settings for this plugin\n * @param filter optional filter to avoid rerenders for irrelevent settings\n */\n use>(filter?: F[]): Pick & PrivateSettings, F>;\n /** Definitions of each setting */\n def: Def;\n /** Setting methods with return values that could rely on other settings */\n checks: Checks;\n /**\n * Name of the plugin these settings belong to,\n * will be an empty string until plugin is initialized\n */\n pluginName: string;\n\n withPrivateSettings(): DefinedSettings;\n}\n\nexport type PartialExcept = Partial & Required>;\n\nexport type IpcRes = { ok: true; value: V; } | { ok: false, error: any; };\n\n/* -------------------------------------------- */\n/* Legacy Options Types */\n/* -------------------------------------------- */\n\nexport type PluginOptionBase = PluginSettingCommon & IsDisabled;\nexport type PluginOptionsItem =\n | PluginOptionString\n | PluginOptionNumber\n | PluginOptionBoolean\n | PluginOptionSelect\n | PluginOptionSlider\n | PluginOptionComponent;\nexport type PluginOptionString = PluginSettingStringDef & PluginSettingCommon & IsDisabled & IsValid;\nexport type PluginOptionNumber = (PluginSettingNumberDef | PluginSettingBigIntDef) & PluginSettingCommon & IsDisabled & IsValid;\nexport type PluginOptionBoolean = PluginSettingBooleanDef & PluginSettingCommon & IsDisabled & IsValid;\nexport type PluginOptionSelect = PluginSettingSelectDef & PluginSettingCommon & IsDisabled & IsValid;\nexport type PluginOptionSlider = PluginSettingSliderDef & PluginSettingCommon & IsDisabled & IsValid;\nexport type PluginOptionComponent = PluginSettingComponentDef & PluginSettingCommon;\n\nexport type PluginNative any>> = {\n [key in keyof PluginExports]:\n PluginExports[key] extends (event: Electron.IpcMainInvokeEvent, ...args: infer Args) => infer Return\n ? (...args: Args) => Return extends Promise ? Return : Promise\n : never;\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { BadgePosition, BadgeUserArgs, ProfileBadge } from \"@api/Badges\";\nimport DonateButton from \"@components/DonateButton\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { Heart } from \"@components/Heart\";\nimport { Devs } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport { Margins } from \"@utils/margins\";\nimport { isPluginDev } from \"@utils/misc\";\nimport { closeModal, Modals, openModal } from \"@utils/modal\";\nimport definePlugin from \"@utils/types\";\nimport { Forms, Toasts } from \"@webpack/common\";\n\nconst CONTRIBUTOR_BADGE = \"https://cdn.discordapp.com/attachments/1033680203433660458/1092089947126780035/favicon.png\";\n\nconst ContributorBadge: ProfileBadge = {\n description: \"Vencord Contributor\",\n image: CONTRIBUTOR_BADGE,\n position: BadgePosition.START,\n props: {\n style: {\n borderRadius: \"50%\",\n transform: \"scale(0.9)\" // The image is a bit too big compared to default badges\n }\n },\n shouldShow: ({ user }) => isPluginDev(user.id),\n link: \"https://github.com/Vendicated/Vencord\"\n};\n\nlet DonorBadges = {} as Record[]>;\n\nasync function loadBadges(noCache = false) {\n DonorBadges = {};\n\n const init = {} as RequestInit;\n if (noCache)\n init.cache = \"no-cache\";\n\n const badges = await fetch(\"https://gist.githubusercontent.com/Vendicated/51a3dd775f6920429ec6e9b735ca7f01/raw/badges.csv\", init)\n .then(r => r.text());\n\n const lines = badges.trim().split(\"\\n\");\n if (lines.shift() !== \"id,tooltip,image\") {\n new Logger(\"BadgeAPI\").error(\"Invalid badges.csv file!\");\n return;\n }\n\n for (const line of lines) {\n const [id, description, image] = line.split(\",\");\n (DonorBadges[id] ??= []).push({ image, description });\n }\n}\n\nexport default definePlugin({\n name: \"BadgeAPI\",\n description: \"API to add badges to users.\",\n authors: [Devs.Megu, Devs.Ven, Devs.TheSun],\n required: true,\n patches: [\n /* Patch the badge list component on user profiles */\n {\n find: \"Messages.PROFILE_USER_BADGES,role:\",\n replacement: [\n {\n match: /&&(\\i)\\.push\\(\\{id:\"premium\".+?\\}\\);/,\n replace: \"$&$1.unshift(...Vencord.Api.Badges._getBadges(arguments[0]));\",\n },\n {\n // alt: \"\", aria-hidden: false, src: originalSrc\n match: /alt:\" \",\"aria-hidden\":!0,src:(?=(\\i)\\.src)/,\n // ...badge.props, ..., src: badge.image ?? ...\n replace: \"...$1.props,$& $1.image??\"\n },\n // replace their component with ours if applicable\n {\n match: /(?<=text:(\\i)\\.description,spacing:12,)children:/,\n replace: \"children:$1.component ? () => $self.renderBadgeComponent($1) :\"\n },\n // conditionally override their onClick with badge.onClick if it exists\n {\n match: /href:(\\i)\\.link/,\n replace: \"...($1.onClick && { onClick: $1.onClick }),$&\"\n }\n ]\n }\n ],\n\n toolboxActions: {\n async \"Refetch Badges\"() {\n await loadBadges(true);\n Toasts.show({\n id: Toasts.genId(),\n message: \"Successfully refetched badges!\",\n type: Toasts.Type.SUCCESS\n });\n }\n },\n\n async start() {\n Vencord.Api.Badges.addBadge(ContributorBadge);\n await loadBadges();\n },\n\n renderBadgeComponent: ErrorBoundary.wrap((badge: ProfileBadge & BadgeUserArgs) => {\n const Component = badge.component!;\n return ;\n }, { noop: true }),\n\n\n getDonorBadges(userId: string) {\n return DonorBadges[userId]?.map(badge => ({\n ...badge,\n position: BadgePosition.START,\n props: {\n style: {\n borderRadius: \"50%\",\n transform: \"scale(0.9)\" // The image is a bit too big compared to default badges\n }\n },\n onClick() {\n const modalKey = openModal(props => (\n {\n closeModal(modalKey);\n VencordNative.native.openExternal(\"https://github.com/sponsors/Vendicated\");\n }}>\n \n \n \n \n \n Vencord Donor\n \n \n \n \n \n \n \n \n

\n \n This Badge is a special perk for Vencord Donors\n \n \n Please consider supporting the development of Vencord by becoming a donor. It would mean a lot!!\n \n
\n \n \n \n \n \n \n \n \n ));\n },\n }));\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"CommandsAPI\",\n authors: [Devs.Arjix],\n description: \"Api required by anything that uses commands\",\n patches: [\n // obtain BUILT_IN_COMMANDS instance\n {\n find: ',\"tenor\"',\n replacement: [\n {\n // Matches BUILT_IN_COMMANDS. This is not exported so this is\n // the only way. _init() just returns the same object to make the\n // patch simpler\n\n // textCommands = builtInCommands.filter(...)\n match: /(?<=\\w=)(\\w)(\\.filter\\(.{0,60}tenor)/,\n replace: \"Vencord.Api.Commands._init($1)$2\",\n }\n ],\n },\n // command error handling\n {\n find: \"Unexpected value for option\",\n replacement: {\n // return [2, cmd.execute(args, ctx)]\n match: /,(\\i)\\.execute\\((\\i),(\\i)\\)/,\n replace: (_, cmd, args, ctx) => `,Vencord.Api.Commands._handleCommand(${cmd}, ${args}, ${ctx})`\n }\n },\n // Show plugin name instead of \"Built-In\"\n {\n find: \".source,children\",\n replacement: {\n // ...children: p?.name\n match: /(?<=:(.{1,3})\\.displayDescription\\}.{0,200}\\.source,children:)[^}]+/,\n replace: \"$1.plugin||($&)\"\n }\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"ContextMenuAPI\",\n description: \"API for adding/removing items to/from context menus.\",\n authors: [Devs.Nuckyz, Devs.Ven],\n required: true,\n\n patches: [\n {\n find: \"\u266B (\u3064\uFF61\u25D5\u203F\u203F\u25D5\uFF61)\u3064 \u266A\",\n replacement: {\n match: /let{navId:/,\n replace: \"Vencord.Api.ContextMenu._patchContextMenu(arguments[0]);$&\"\n }\n },\n {\n find: \".Menu,{\",\n all: true,\n replacement: {\n match: /Menu,{(?<=\\.jsxs?\\)\\(\\i\\.Menu,{)/g,\n replace: \"$&contextMenuApiArguments:typeof arguments!=='undefined'?arguments:[],\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"MemberListDecoratorsAPI\",\n description: \"API to add decorators to member list (both in servers and DMs)\",\n authors: [Devs.TheSun, Devs.Ven],\n patches: [\n {\n find: \".lostPermission)\",\n replacement: [\n {\n match: /let\\{[^}]*lostPermissionTooltipText:\\i[^}]*\\}=(\\i),/,\n replace: \"$&vencordProps=$1,\"\n }, {\n match: /decorators:.{0,100}?children:\\[/,\n replace: \"$&...(typeof vencordProps=='undefined'?[]:Vencord.Api.MemberListDecorators.__getDecorators(vencordProps)),\"\n }\n ]\n },\n {\n find: \"PrivateChannel.renderAvatar\",\n replacement: {\n match: /decorators:(\\i\\.isSystemDM\\(\\))\\?(.+?):null/,\n replace: \"decorators:[...Vencord.Api.MemberListDecorators.__getDecorators(arguments[0]), $1?$2:null]\"\n }\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"MessageAccessoriesAPI\",\n description: \"API to add message accessories.\",\n authors: [Devs.Cyn],\n patches: [\n {\n find: \".Messages.REMOVE_ATTACHMENT_BODY\",\n replacement: {\n match: /(?<=.container\\)?,children:)(\\[.+?\\])/,\n replace: \"Vencord.Api.MessageAccessories._modifyAccessories($1,this.props)\",\n },\n },\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"MessageDecorationsAPI\",\n description: \"API to add decorations to messages\",\n authors: [Devs.TheSun],\n patches: [\n {\n find: '\"Message Username\"',\n replacement: {\n match: /\\.Messages\\.GUILD_COMMUNICATION_DISABLED_BOTTOM_SHEET_TITLE.+?}\\),\\i(?=\\])/,\n replace: \"$&,...Vencord.Api.MessageDecorations.__addDecorationsToMessage(arguments[0])\"\n }\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"MessageEventsAPI\",\n description: \"Api required by anything using message events.\",\n authors: [Devs.Arjix, Devs.hunt, Devs.Ven],\n patches: [\n {\n find: '\"MessageActionCreators\"',\n replacement: {\n match: /async editMessage\\(.+?\\)\\{/,\n replace: \"$&await Vencord.Api.MessageEvents._handlePreEdit(...arguments);\"\n }\n },\n {\n find: \".handleSendMessage=\",\n replacement: {\n // props.chatInputType...then((function(isMessageValid)... var parsedMessage = b.c.parse(channel,... var replyOptions = f.g.getSendMessageOptionsForReply(pendingReply);\n // Lookbehind: validateMessage)({openWarningPopout:..., type: i.props.chatInputType, content: t, stickers: r, ...}).then((function(isMessageValid)\n match: /(type:this\\.props\\.chatInputType.+?\\.then\\()(\\i=>\\{.+?let (\\i)=\\i\\.\\i\\.parse\\((\\i),.+?let (\\i)=\\i\\.\\i\\.getSendMessageOptionsForReply\\(\\i\\);)(?<=\\)\\(({.+?})\\)\\.then.+?)/,\n // props.chatInputType...then((async function(isMessageValid)... var replyOptions = f.g.getSendMessageOptionsForReply(pendingReply); if(await Vencord.api...) return { shoudClear:true, shouldRefocus:true };\n replace: (_, rest1, rest2, parsedMessage, channel, replyOptions, extra) => \"\" +\n `${rest1}async ${rest2}` +\n `if(await Vencord.Api.MessageEvents._handlePreSend(${channel}.id,${parsedMessage},${extra},${replyOptions}))` +\n \"return{shoudClear:true,shouldRefocus:true};\"\n }\n },\n {\n find: '(\"interactionUsernameProfile',\n replacement: {\n match: /let\\{id:\\i}=(\\i),{id:\\i}=(\\i);return \\i\\.useCallback\\((\\i)=>\\{/,\n replace: (m, message, channel, event) =>\n // the message param is shadowed by the event param, so need to alias them\n `const vcMsg=${message},vcChan=${channel};${m}Vencord.Api.MessageEvents._handleClick(vcMsg, vcChan, ${event});`\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"MessagePopoverAPI\",\n description: \"API to add buttons to message popovers.\",\n authors: [Devs.KingFish, Devs.Ven, Devs.Nuckyz],\n patches: [{\n find: \"Messages.MESSAGE_UTILITIES_A11Y_LABEL\",\n replacement: {\n // foo && !bar ? createElement(reactionStuffs)... createElement(blah,...makeElement(reply-other))\n match: /\\i&&!\\i\\?\\(0,\\i\\.jsxs?\\)\\(.{0,200}renderEmojiPicker:.{0,500}\\?(\\i)\\(\\{key:\"reply-other\"/,\n replace: (m, makeElement) => {\n const msg = m.match(/message:(.{1,3}),/)?.[1];\n if (!msg) throw new Error(\"Could not find message variable\");\n return `...Vencord.Api.MessagePopover._buildPopoverElements(${msg},${makeElement}),${m}`;\n }\n }\n }],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NoticesAPI\",\n description: \"Fixes notices being automatically dismissed\",\n authors: [Devs.Ven],\n required: true,\n patches: [\n {\n find: 'displayName=\"NoticeStore\"',\n replacement: [\n {\n match: /\\i=null;(?=.{0,80}getPremiumSubscription\\(\\))/g,\n replace: \"if(Vencord.Api.Notices.currentNotice)return false;$&\"\n },\n {\n match: /(?<=,NOTICE_DISMISS:function\\(\\i\\){)return null!=(\\i)/,\n replace: \"if($1.id==\\\"VencordNotice\\\")return($1=null,Vencord.Api.Notices.nextNotice(),true);$&\"\n }\n ]\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"ServerListAPI\",\n authors: [Devs.kemo],\n description: \"Api required for plugins that modify the server list\",\n patches: [\n {\n find: \"Messages.DISCODO_DISABLED\",\n replacement: {\n match: /(?<=Messages\\.DISCODO_DISABLED.+?return)(\\(.{0,75}?tutorialContainer.+?}\\))(?=}function)/,\n replace: \"[$1].concat(Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.Above))\"\n }\n },\n {\n find: \"Messages.SERVERS,children\",\n replacement: {\n match: /(?<=Messages\\.SERVERS,children:).+?default:return null\\}\\}\\)/,\n replace: \"Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.In).concat($&)\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NoTrack\",\n description: \"Disable Discord's tracking ('science'), metrics and Sentry crash reporting\",\n authors: [Devs.Cyn, Devs.Ven, Devs.Nuckyz, Devs.Arrow],\n required: true,\n patches: [\n {\n find: \"AnalyticsActionHandlers.handle\",\n replacement: {\n match: /^.+$/,\n replace: \"()=>{}\",\n },\n },\n {\n find: \"window.DiscordSentry=\",\n replacement: {\n match: /^.+$/,\n replace: \"()=>{}\",\n }\n },\n {\n find: \".METRICS,\",\n replacement: [\n {\n match: /this\\._intervalId=/,\n replace: \"this._intervalId=undefined&&\"\n },\n {\n match: /(increment\\(\\i\\){)/,\n replace: \"$1return;\"\n }\n ]\n },\n {\n find: \".installedLogHooks)\",\n replacement: {\n // if getDebugLogging() returns false, the hooks don't get installed.\n match: \"getDebugLogging(){\",\n replace: \"getDebugLogging(){return false;\"\n }\n },\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Logger } from \"@utils/Logger\";\nimport type { ReactElement } from \"react\";\n\ntype ContextMenuPatchCallbackReturn = (() => void) | void;\n/**\n * @param children The rendered context menu elements\n * @param args Any arguments passed into making the context menu, like the guild, channel, user or message for example\n * @returns A callback which is only ran once used to modify the context menu elements (Use to avoid duplicates)\n */\nexport type NavContextMenuPatchCallback = (children: Array, ...args: Array) => ContextMenuPatchCallbackReturn;\n/**\n * @param navId The navId of the context menu being patched\n * @param children The rendered context menu elements\n * @param args Any arguments passed into making the context menu, like the guild, channel, user or message for example\n * @returns A callback which is only ran once used to modify the context menu elements (Use to avoid duplicates)\n */\nexport type GlobalContextMenuPatchCallback = (navId: string, children: Array, ...args: Array) => ContextMenuPatchCallbackReturn;\n\nconst ContextMenuLogger = new Logger(\"ContextMenu\");\n\nexport const navPatches = new Map>();\nexport const globalPatches = new Set();\n\n/**\n * Add a context menu patch\n * @param navId The navId(s) for the context menu(s) to patch\n * @param patch The patch to be applied\n */\nexport function addContextMenuPatch(navId: string | Array, patch: NavContextMenuPatchCallback) {\n if (!Array.isArray(navId)) navId = [navId];\n for (const id of navId) {\n let contextMenuPatches = navPatches.get(id);\n if (!contextMenuPatches) {\n contextMenuPatches = new Set();\n navPatches.set(id, contextMenuPatches);\n }\n\n contextMenuPatches.add(patch);\n }\n}\n\n/**\n * Add a global context menu patch that fires the patch for all context menus\n * @param patch The patch to be applied\n */\nexport function addGlobalContextMenuPatch(patch: GlobalContextMenuPatchCallback) {\n globalPatches.add(patch);\n}\n\n/**\n * Remove a context menu patch\n * @param navId The navId(s) for the context menu(s) to remove the patch\n * @param patch The patch to be removed\n * @returns Whether the patch was successfully removed from the context menu(s)\n */\nexport function removeContextMenuPatch>(navId: T, patch: NavContextMenuPatchCallback): T extends string ? boolean : Array {\n const navIds = Array.isArray(navId) ? navId : [navId as string];\n\n const results = navIds.map(id => navPatches.get(id)?.delete(patch) ?? false);\n\n return (Array.isArray(navId) ? results : results[0]) as T extends string ? boolean : Array;\n}\n\n/**\n * Remove a global context menu patch\n * @param patch The patch to be removed\n * @returns Whether the patch was successfully removed\n */\nexport function removeGlobalContextMenuPatch(patch: GlobalContextMenuPatchCallback): boolean {\n return globalPatches.delete(patch);\n}\n\n/**\n * A helper function for finding the children array of a group nested inside a context menu based on the id(s) of its children\n * @param id The id of the child. If an array is specified, all ids will be tried\n * @param children The context menu children\n */\nexport function findGroupChildrenByChildId(id: string | string[], children: Array, _itemsArray?: Array): Array | null {\n for (const child of children) {\n if (child == null) continue;\n\n if (\n (Array.isArray(id) && id.some(id => child.props?.id === id))\n || child.props?.id === id\n ) return _itemsArray ?? null;\n\n let nextChildren = child.props?.children;\n if (nextChildren) {\n if (!Array.isArray(nextChildren)) {\n nextChildren = [nextChildren];\n child.props.children = nextChildren;\n }\n\n const found = findGroupChildrenByChildId(id, nextChildren, nextChildren);\n if (found !== null) return found;\n }\n }\n\n return null;\n}\n\ninterface ContextMenuProps {\n contextMenuApiArguments?: Array;\n navId: string;\n children: Array;\n \"aria-label\": string;\n onSelect: (() => void) | undefined;\n onClose: (callback: (...args: Array) => any) => void;\n}\n\nconst patchedMenus = new WeakSet();\n\nexport function _patchContextMenu(props: ContextMenuProps) {\n props.contextMenuApiArguments ??= [];\n const contextMenuPatches = navPatches.get(props.navId);\n\n if (!Array.isArray(props.children)) props.children = [props.children];\n\n if (contextMenuPatches) {\n for (const patch of contextMenuPatches) {\n try {\n const callback = patch(props.children, ...props.contextMenuApiArguments);\n if (!patchedMenus.has(props)) callback?.();\n } catch (err) {\n ContextMenuLogger.error(`Patch for ${props.navId} errored,`, err);\n }\n }\n }\n\n for (const patch of globalPatches) {\n try {\n const callback = patch(props.navId, props.children, ...props.contextMenuApiArguments);\n if (!patchedMenus.has(props)) callback?.();\n } catch (err) {\n ContextMenuLogger.error(\"Global patch errored,\", err);\n }\n }\n\n patchedMenus.add(props);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n/**\n * Returns a new function that will call the wrapped function\n * after the specified delay. If the function is called again\n * within the delay, the timer will be reset.\n * @param func The function to wrap\n * @param delay The delay in milliseconds\n */\nexport function debounce(func: T, delay = 300): T {\n let timeout: NodeJS.Timeout;\n return function (...args: any[]) {\n clearTimeout(timeout);\n timeout = setTimeout(() => { func(...args); }, delay);\n } as any;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const { localStorage } = window;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Promisable } from \"type-fest\";\n\n/**\n * A queue that can be used to run tasks consecutively.\n * Highly recommended for things like fetching data from Discord\n */\nexport class Queue {\n /**\n * @param maxSize The maximum amount of functions that can be queued at once.\n * If the queue is full, the oldest function will be removed.\n */\n constructor(public readonly maxSize = Infinity) { }\n\n private queue = [] as Array<() => Promisable>;\n\n private promise?: Promise;\n\n private next() {\n const func = this.queue.shift();\n if (func)\n this.promise = Promise.resolve()\n .then(func)\n .finally(() => this.next());\n else\n this.promise = undefined;\n }\n\n private run() {\n if (!this.promise)\n this.next();\n }\n\n /**\n * Append a task at the end of the queue. This task will be executed after all other tasks\n * If the queue exceeds the specified maxSize, the first task in queue will be removed.\n * @param func Task\n */\n push(func: () => Promisable) {\n if (this.size >= this.maxSize)\n this.queue.shift();\n\n this.queue.push(func);\n this.run();\n }\n\n /**\n * Prepend a task at the beginning of the queue. This task will be executed next\n * If the queue exceeds the specified maxSize, the last task in queue will be removed.\n * @param func Task\n */\n unshift(func: () => Promisable) {\n if (this.size >= this.maxSize)\n this.queue.pop();\n\n this.queue.unshift(func);\n this.run();\n }\n\n /**\n * The amount of tasks in the queue\n */\n get size() {\n return this.queue.length;\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport { useSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { classes } from \"@utils/misc\";\nimport { React, useEffect, useMemo, useState, useStateFromStores, WindowStore } from \"@webpack/common\";\n\nimport { NotificationData } from \"./Notifications\";\n\nexport default ErrorBoundary.wrap(function NotificationComponent({\n title,\n body,\n richBody,\n color,\n icon,\n onClick,\n onClose,\n image,\n permanent,\n className,\n dismissOnClick\n}: NotificationData & { className?: string; }) {\n const { timeout, position } = useSettings([\"notifications.timeout\", \"notifications.position\"]).notifications;\n const hasFocus = useStateFromStores([WindowStore], () => WindowStore.isFocused());\n\n const [isHover, setIsHover] = useState(false);\n const [elapsed, setElapsed] = useState(0);\n\n const start = useMemo(() => Date.now(), [timeout, isHover, hasFocus]);\n\n useEffect(() => {\n if (isHover || !hasFocus || timeout === 0 || permanent) return void setElapsed(0);\n\n const intervalId = setInterval(() => {\n const elapsed = Date.now() - start;\n if (elapsed >= timeout)\n onClose!();\n else\n setElapsed(elapsed);\n }, 10);\n\n return () => clearInterval(intervalId);\n }, [timeout, isHover, hasFocus]);\n\n const timeoutProgress = elapsed / timeout;\n\n return (\n {\n onClick?.();\n if (dismissOnClick !== false)\n onClose!();\n }}\n onContextMenu={e => {\n e.preventDefault();\n e.stopPropagation();\n onClose!();\n }}\n onMouseEnter={() => setIsHover(true)}\n onMouseLeave={() => setIsHover(false)}\n >\n
\n {icon && \"\"}\n
\n
\n

{title}

\n {\n e.preventDefault();\n e.stopPropagation();\n onClose!();\n }}\n >\n \n Dismiss Notification\n \n \n \n
\n
\n {richBody ??

{body}

}\n
\n
\n
\n {image && \"\"}\n {timeout !== 0 && !permanent && (\n \n )}\n \n );\n}, {\n onError: ({ props }) => props.onClose!()\n});\n", "/* eslint-disable simple-header/header */\n\n/*!\n * idb-keyval v6.2.0\n * Copyright 2016, Jake Archibald\n * Copyright 2022, Vendicated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function promisifyRequest(\n request: IDBRequest | IDBTransaction,\n): Promise {\n return new Promise((resolve, reject) => {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-ignore - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\n\nexport function createStore(dbName: string, storeName: string): UseStore {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const dbp = promisifyRequest(request);\n\n return (txMode, callback) =>\n dbp.then(db =>\n callback(db.transaction(storeName, txMode).objectStore(storeName)),\n );\n}\n\nexport type UseStore = (\n txMode: IDBTransactionMode,\n callback: (store: IDBObjectStore) => T | PromiseLike,\n) => Promise;\n\nlet defaultGetStoreFunc: UseStore | undefined;\n\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore(\"VencordData\", \"VencordStore\");\n }\n return defaultGetStoreFunc;\n}\n\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function get(\n key: IDBValidKey,\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readonly\", store => promisifyRequest(store.get(key)));\n}\n\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function set(\n key: IDBValidKey,\n value: any,\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readwrite\", store => {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic \u2013 if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function setMany(\n entries: [IDBValidKey, any][],\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readwrite\", store => {\n entries.forEach(entry => store.put(entry[1], entry[0]));\n return promisifyRequest(store.transaction);\n });\n}\n\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function getMany(\n keys: IDBValidKey[],\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readonly\", store =>\n Promise.all(keys.map(key => promisifyRequest(store.get(key)))),\n );\n}\n\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function update(\n key: IDBValidKey,\n updater: (oldValue: T | undefined) => T,\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\n \"readwrite\",\n store =>\n // Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise((resolve, reject) => {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n } catch (err) {\n reject(err);\n }\n };\n }),\n );\n}\n\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function del(\n key: IDBValidKey,\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readwrite\", store => {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function delMany(\n keys: IDBValidKey[],\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readwrite\", (store: IDBObjectStore) => {\n keys.forEach((key: IDBValidKey) => store.delete(key));\n return promisifyRequest(store.transaction);\n });\n}\n\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function clear(customStore = defaultGetStore()): Promise {\n return customStore(\"readwrite\", store => {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\n\nfunction eachCursor(\n store: IDBObjectStore,\n callback: (cursor: IDBCursorWithValue) => void,\n): Promise {\n store.openCursor().onsuccess = function () {\n if (!this.result) return;\n callback(this.result);\n this.result.continue();\n };\n return promisifyRequest(store.transaction);\n}\n\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function keys(\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readonly\", store => {\n // Fast path for modern browsers\n if (store.getAllKeys) {\n return promisifyRequest(\n store.getAllKeys() as unknown as IDBRequest,\n );\n }\n\n const items: KeyType[] = [];\n\n return eachCursor(store, cursor =>\n items.push(cursor.key as KeyType),\n ).then(() => items);\n });\n}\n\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function values(customStore = defaultGetStore()): Promise {\n return customStore(\"readonly\", store => {\n // Fast path for modern browsers\n if (store.getAll) {\n return promisifyRequest(store.getAll() as IDBRequest);\n }\n\n const items: T[] = [];\n\n return eachCursor(store, cursor => items.push(cursor.value as T)).then(\n () => items,\n );\n });\n}\n\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function entries(\n customStore = defaultGetStore(),\n): Promise<[KeyType, ValueType][]> {\n return customStore(\"readonly\", store => {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) {\n return Promise.all([\n promisifyRequest(\n store.getAllKeys() as unknown as IDBRequest,\n ),\n promisifyRequest(store.getAll() as IDBRequest),\n ]).then(([keys, values]) => keys.map((key, i) => [key, values[i]]));\n }\n\n const items: [KeyType, ValueType][] = [];\n\n return customStore(\"readonly\", store =>\n eachCursor(store, cursor =>\n items.push([cursor.key as KeyType, cursor.value]),\n ).then(() => items),\n );\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { MapValue } from \"type-fest/source/entry\";\n\nexport type Style = MapValue;\n\nexport const styleMap = window.VencordStyles ??= new Map();\n\nexport function requireStyle(name: string) {\n const style = styleMap.get(name);\n if (!style) throw new Error(`Style \"${name}\" does not exist`);\n return style;\n}\n\n/**\n * A style's name can be obtained from importing a stylesheet with `?managed` at the end of the import\n * @param name The name of the style\n * @returns `false` if the style was already enabled, `true` otherwise\n * @example\n * import pluginStyle from \"./plugin.css?managed\";\n *\n * // Inside some plugin method like \"start()\" or \"[option].onChange()\"\n * enableStyle(pluginStyle);\n */\nexport function enableStyle(name: string) {\n const style = requireStyle(name);\n\n if (style.dom?.isConnected)\n return false;\n\n if (!style.dom) {\n style.dom = document.createElement(\"style\");\n style.dom.dataset.vencordName = style.name;\n }\n compileStyle(style);\n\n document.head.appendChild(style.dom);\n return true;\n}\n\n/**\n * @param name The name of the style\n * @returns `false` if the style was already disabled, `true` otherwise\n * @see {@link enableStyle} for info on getting the name of an imported style\n */\nexport function disableStyle(name: string) {\n const style = requireStyle(name);\n if (!style.dom?.isConnected)\n return false;\n\n style.dom.remove();\n style.dom = null;\n return true;\n}\n\n/**\n * @param name The name of the style\n * @returns `true` in most cases, may return `false` in some edge cases\n * @see {@link enableStyle} for info on getting the name of an imported style\n */\nexport const toggleStyle = (name: string) => isStyleEnabled(name) ? disableStyle(name) : enableStyle(name);\n\n/**\n * @param name The name of the style\n * @returns Whether the style is enabled\n * @see {@link enableStyle} for info on getting the name of an imported style\n */\nexport const isStyleEnabled = (name: string) => requireStyle(name).dom?.isConnected ?? false;\n\n/**\n * Sets the variables of a style\n * ```ts\n * // -- plugin.ts --\n * import pluginStyle from \"./plugin.css?managed\";\n * import { setStyleVars } from \"@api/Styles\";\n * import { findByPropsLazy } from \"@webpack\";\n * const classNames = findByPropsLazy(\"thin\", \"scrollerBase\"); // { thin: \"thin-31rlnD scrollerBase-_bVAAt\", ... }\n *\n * // Inside some plugin method like \"start()\"\n * setStyleClassNames(pluginStyle, classNames);\n * enableStyle(pluginStyle);\n * ```\n * ```scss\n * // -- plugin.css --\n * .plugin-root [--thin]::-webkit-scrollbar { ... }\n * ```\n * ```scss\n * // -- final stylesheet --\n * .plugin-root .thin-31rlnD.scrollerBase-_bVAAt::-webkit-scrollbar { ... }\n * ```\n * @param name The name of the style\n * @param classNames An object where the keys are the variable names and the values are the variable values\n * @param recompile Whether to recompile the style after setting the variables, defaults to `true`\n * @see {@link enableStyle} for info on getting the name of an imported style\n */\nexport const setStyleClassNames = (name: string, classNames: Record, recompile = true) => {\n const style = requireStyle(name);\n style.classNames = classNames;\n if (recompile && isStyleEnabled(style.name))\n compileStyle(style);\n};\n\n/**\n * Updates the stylesheet after doing the following to the sourcecode:\n * - Interpolate style classnames\n * @param style **_Must_ be a style with a DOM element**\n * @see {@link setStyleClassNames} for more info on style classnames\n */\nexport const compileStyle = (style: Style) => {\n if (!style.dom) throw new Error(\"Style has no DOM element\");\n\n style.dom.textContent = style.source\n .replace(/\\[--(\\w+)\\]/g, (match, name) => {\n const className = style.classNames[name];\n return className ? classNameToSelector(className) : match;\n });\n};\n\n/**\n * @param name The classname\n * @param prefix A prefix to add each class, defaults to `\"\"`\n * @return A css selector for the classname\n * @example\n * classNameToSelector(\"foo bar\") // => \".foo.bar\"\n */\nexport const classNameToSelector = (name: string, prefix = \"\") => name.split(\" \").map(n => `.${prefix}${n}`).join(\"\");\n\ntype ClassNameFactoryArg = string | string[] | Record | false | null | undefined | 0 | \"\";\n/**\n * @param prefix The prefix to add to each class, defaults to `\"\"`\n * @returns A classname generator function\n * @example\n * const cl = classNameFactory(\"plugin-\");\n *\n * cl(\"base\", [\"item\", \"editable\"], { selected: null, disabled: true })\n * // => \"plugin-base plugin-item plugin-editable plugin-disabled\"\n */\nexport const classNameFactory = (prefix: string = \"\") => (...args: ClassNameFactoryArg[]) => {\n const classNames = new Set();\n for (const arg of args) {\n if (arg && typeof arg === \"string\") classNames.add(arg);\n else if (Array.isArray(arg)) arg.forEach(name => classNames.add(name));\n else if (arg && typeof arg === \"object\") Object.entries(arg).forEach(([name, value]) => value && classNames.add(name));\n }\n return Array.from(classNames, name => prefix + name).join(\" \");\n};\n", "export { urlAlphabet } from './url-alphabet/index.js'\nexport let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nexport let customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n let step = -~((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nexport let customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\nexport let nanoid = (size = 21) =>\n crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {\n byte &= 63\n if (byte < 36) {\n id += byte.toString(36)\n } else if (byte < 62) {\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte > 62) {\n id += '-'\n } else {\n id += '_'\n }\n return id\n }, '')\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport * as DataStore from \"@api/DataStore\";\nimport { Settings } from \"@api/Settings\";\nimport { classNameFactory } from \"@api/Styles\";\nimport { closeModal, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from \"@utils/modal\";\nimport { useAwaiter } from \"@utils/react\";\nimport { Alerts, Button, Forms, moment, React, Text, Timestamp, useEffect, useReducer, useState } from \"@webpack/common\";\nimport { nanoid } from \"nanoid\";\nimport type { DispatchWithoutAction } from \"react\";\n\nimport NotificationComponent from \"./NotificationComponent\";\nimport type { NotificationData } from \"./Notifications\";\n\ninterface PersistentNotificationData extends Pick {\n timestamp: number;\n id: string;\n}\n\nconst KEY = \"notification-log\";\n\nconst getLog = async () => {\n const log = await DataStore.get(KEY) as PersistentNotificationData[] | undefined;\n return log ?? [];\n};\n\nconst cl = classNameFactory(\"vc-notification-log-\");\nconst signals = new Set();\n\nexport async function persistNotification(notification: NotificationData) {\n if (notification.noPersist) return;\n\n const limit = Settings.notifications.logLimit;\n if (limit === 0) return;\n\n await DataStore.update(KEY, (old: PersistentNotificationData[] | undefined) => {\n const log = old ?? [];\n\n // Omit stuff we don't need\n const {\n onClick, onClose, richBody, permanent, noPersist, dismissOnClick,\n ...pureNotification\n } = notification;\n\n log.unshift({\n ...pureNotification,\n timestamp: Date.now(),\n id: nanoid()\n });\n\n if (log.length > limit && limit !== 200)\n log.length = limit;\n\n return log;\n });\n\n signals.forEach(x => x());\n}\n\nexport async function deleteNotification(timestamp: number) {\n const log = await getLog();\n const index = log.findIndex(x => x.timestamp === timestamp);\n if (index === -1) return;\n\n log.splice(index, 1);\n await DataStore.set(KEY, log);\n signals.forEach(x => x());\n}\n\nexport function useLogs() {\n const [signal, setSignal] = useReducer(x => x + 1, 0);\n\n useEffect(() => {\n signals.add(setSignal);\n return () => void signals.delete(setSignal);\n }, []);\n\n const [log, _, pending] = useAwaiter(getLog, {\n fallbackValue: [],\n deps: [signal]\n });\n\n return [log, pending] as const;\n}\n\nfunction NotificationEntry({ data }: { data: PersistentNotificationData; }) {\n const [removing, setRemoving] = useState(false);\n const ref = React.useRef(null);\n\n useEffect(() => {\n const div = ref.current!;\n\n const setHeight = () => {\n if (div.clientHeight === 0) return requestAnimationFrame(setHeight);\n div.style.height = `${div.clientHeight}px`;\n };\n\n setHeight();\n }, []);\n\n return (\n
\n {\n if (removing) return;\n setRemoving(true);\n\n setTimeout(() => deleteNotification(data.timestamp), 200);\n }}\n richBody={\n
\n {data.body}\n \n
\n }\n />\n
\n );\n}\n\nexport function NotificationLog({ log, pending }: { log: PersistentNotificationData[], pending: boolean; }) {\n if (!log.length && !pending)\n return (\n
\n
\n \n No notifications yet\n \n
\n );\n\n return (\n
\n {log.map(n => )}\n
\n );\n}\n\nfunction LogModal({ modalProps, close }: { modalProps: ModalProps; close(): void; }) {\n const [log, pending] = useLogs();\n\n return (\n \n \n Notification Log\n \n \n\n \n \n \n\n \n {\n Alerts.show({\n title: \"Are you sure?\",\n body: `This will permanently remove ${log.length} notification${log.length === 1 ? \"\" : \"s\"}. This action cannot be undone.`,\n async onConfirm() {\n await DataStore.set(KEY, []);\n signals.forEach(x => x());\n },\n confirmText: \"Do it!\",\n confirmColor: \"vc-notification-log-danger-btn\",\n cancelText: \"Nevermind\"\n });\n }}\n >\n Clear Notification Log\n \n \n \n );\n}\n\nexport function openNotificationLogModal() {\n const key = openModal(modalProps => (\n closeModal(key)}\n />\n ));\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { Queue } from \"@utils/Queue\";\nimport { ReactDOM } from \"@webpack/common\";\nimport type { ReactNode } from \"react\";\nimport type { Root } from \"react-dom/client\";\n\nimport NotificationComponent from \"./NotificationComponent\";\nimport { persistNotification } from \"./notificationLog\";\n\nconst NotificationQueue = new Queue();\n\nlet reactRoot: Root;\nlet id = 42;\n\nfunction getRoot() {\n if (!reactRoot) {\n const container = document.createElement(\"div\");\n container.id = \"vc-notification-container\";\n document.body.append(container);\n reactRoot = ReactDOM.createRoot(container);\n }\n return reactRoot;\n}\n\nexport interface NotificationData {\n title: string;\n body: string;\n /**\n * Same as body but can be a custom component.\n * Will be used over body if present.\n * Not supported on desktop notifications, those will fall back to body */\n richBody?: ReactNode;\n /** Small icon. This is for things like profile pictures and should be square */\n icon?: string;\n /** Large image. Optimally, this should be around 16x9 but it doesn't matter much. Desktop Notifications might not support this */\n image?: string;\n onClick?(): void;\n onClose?(): void;\n color?: string;\n /** Whether this notification should not have a timeout */\n permanent?: boolean;\n /** Whether this notification should not be persisted in the Notification Log */\n noPersist?: boolean;\n /** Whether this notification should be dismissed when clicked (defaults to true) */\n dismissOnClick?: boolean;\n}\n\nfunction _showNotification(notification: NotificationData, id: number) {\n const root = getRoot();\n return new Promise(resolve => {\n root.render(\n {\n notification.onClose?.();\n root.render(null);\n resolve();\n }} />,\n );\n });\n}\n\nfunction shouldBeNative() {\n if (typeof Notification === \"undefined\") return false;\n\n const { useNative } = Settings.notifications;\n if (useNative === \"always\") return true;\n if (useNative === \"not-focused\") return !document.hasFocus();\n return false;\n}\n\nexport async function requestPermission() {\n return (\n Notification.permission === \"granted\" ||\n (Notification.permission !== \"denied\" && (await Notification.requestPermission()) === \"granted\")\n );\n}\n\nexport async function showNotification(data: NotificationData) {\n persistNotification(data);\n\n if (shouldBeNative() && await requestPermission()) {\n const { title, body, icon, image, onClick = null, onClose = null } = data;\n const n = new Notification(title, {\n body,\n icon,\n image\n });\n n.onclick = onClick;\n n.onclose = onClose;\n } else {\n NotificationQueue.push(() => _showNotification(data, id++));\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport * from \"./Notifications\";\n", "// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\n// see fleb note\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new u32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return [b, r];\n};\nvar _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i) {\n if (cd[i])\n ++l[cd[i] - 1];\n }\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v.BYTES_PER_ELEMENT == 2 ? u16 : v.BYTES_PER_ELEMENT == 4 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e >= s) {\n // write final block\n w[pos >> 3] = lst;\n }\n pos = wfblk(w, pos + 1, dat.subarray(i, e));\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\\s+/g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k].buffer) {\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k, op = o;\n if (Array.isArray(val))\n op = mrg(o, val[1]), val = val[0];\n if (val instanceof u8)\n t[n] = [val, op];\n else {\n t[n += '/'] = [new u8(0), op];\n fltn(val, n, t, o);\n }\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != -1) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c < 0 ? -c - 2 : c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u, -1);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = lft = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport * as DataStore from \"@api/DataStore\";\nimport { showNotification } from \"@api/Notifications\";\nimport { Settings } from \"@api/Settings\";\nimport { findByProps } from \"@webpack\";\nimport { UserStore } from \"@webpack/common\";\n\nimport { Logger } from \"./Logger\";\nimport { openModal } from \"./modal\";\n\nexport const cloudLogger = new Logger(\"Cloud\", \"#39b7e0\");\nexport const getCloudUrl = () => new URL(Settings.cloud.url);\n\nconst cloudUrlOrigin = () => getCloudUrl().origin;\nconst getUserId = () => {\n const id = UserStore.getCurrentUser()?.id;\n if (!id) throw new Error(\"User not yet logged in\");\n return id;\n};\n\nexport async function getAuthorization() {\n const secrets = await DataStore.get>(\"Vencord_cloudSecret\") ?? {};\n\n const origin = cloudUrlOrigin();\n\n // we need to migrate from the old format here\n if (secrets[origin]) {\n await DataStore.update>(\"Vencord_cloudSecret\", secrets => {\n secrets ??= {};\n // use the current user ID\n secrets[`${origin}:${getUserId()}`] = secrets[origin];\n delete secrets[origin];\n return secrets;\n });\n\n // since this doesn't update the original object, we'll early return the existing authorization\n return secrets[origin];\n }\n\n return secrets[`${origin}:${getUserId()}`];\n}\n\nasync function setAuthorization(secret: string) {\n await DataStore.update>(\"Vencord_cloudSecret\", secrets => {\n secrets ??= {};\n secrets[`${cloudUrlOrigin()}:${getUserId()}`] = secret;\n return secrets;\n });\n}\n\nexport async function deauthorizeCloud() {\n await DataStore.update>(\"Vencord_cloudSecret\", secrets => {\n secrets ??= {};\n delete secrets[`${cloudUrlOrigin()}:${getUserId()}`];\n return secrets;\n });\n}\n\nexport async function authorizeCloud() {\n if (await getAuthorization() !== undefined) {\n Settings.cloud.authenticated = true;\n return;\n }\n\n try {\n const oauthConfiguration = await fetch(new URL(\"/v1/oauth/settings\", getCloudUrl()));\n var { clientId, redirectUri } = await oauthConfiguration.json();\n } catch {\n showNotification({\n title: \"Cloud Integration\",\n body: \"Setup failed (couldn't retrieve OAuth configuration).\"\n });\n Settings.cloud.authenticated = false;\n return;\n }\n\n const { OAuth2AuthorizeModal } = findByProps(\"OAuth2AuthorizeModal\");\n\n openModal((props: any) => {\n if (!location) {\n Settings.cloud.authenticated = false;\n return;\n }\n\n try {\n const res = await fetch(location, {\n headers: new Headers({ Accept: \"application/json\" })\n });\n const { secret } = await res.json();\n if (secret) {\n cloudLogger.info(\"Authorized with secret\");\n await setAuthorization(secret);\n showNotification({\n title: \"Cloud Integration\",\n body: \"Cloud integrations enabled!\"\n });\n Settings.cloud.authenticated = true;\n } else {\n showNotification({\n title: \"Cloud Integration\",\n body: \"Setup failed (no secret returned?).\"\n });\n Settings.cloud.authenticated = false;\n }\n } catch (e: any) {\n cloudLogger.error(\"Failed to authorize\", e);\n showNotification({\n title: \"Cloud Integration\",\n body: `Setup failed (${e.toString()}).`\n });\n Settings.cloud.authenticated = false;\n }\n }\n }\n />);\n}\n\nexport async function getCloudAuth() {\n const secret = await getAuthorization();\n\n return window.btoa(`${secret}:${getUserId()}`);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function relaunch() {\n if (IS_DISCORD_DESKTOP)\n window.DiscordNative.app.relaunch();\n else\n window.VesktopNative.app.relaunch();\n}\n\nexport function showItemInFolder(path: string) {\n if (IS_DISCORD_DESKTOP)\n window.DiscordNative.fileManager.showItemInFolder(path);\n else\n window.VesktopNative.fileManager.showItemInFolder(path);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n/**\n * Prompts the user to save a file to their system\n * @param file The file to save\n */\nexport function saveFile(file: File) {\n const a = document.createElement(\"a\");\n a.href = URL.createObjectURL(file);\n a.download = file.name;\n\n document.body.appendChild(a);\n a.click();\n setImmediate(() => {\n URL.revokeObjectURL(a.href);\n document.body.removeChild(a);\n });\n}\n\n/**\n * Prompts the user to choose a file from their system\n * @param mimeTypes A comma separated list of mime types to accept, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept#unique_file_type_specifiers\n * @returns A promise that resolves to the chosen file or null if the user cancels\n */\nexport function chooseFile(mimeTypes: string) {\n return new Promise(resolve => {\n const input = document.createElement(\"input\");\n input.type = \"file\";\n input.style.display = \"none\";\n input.accept = mimeTypes;\n input.onchange = async () => {\n resolve(input.files?.[0] ?? null);\n };\n\n document.body.appendChild(input);\n input.click();\n setImmediate(() => document.body.removeChild(input));\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { showNotification } from \"@api/Notifications\";\nimport { PlainSettings, Settings } from \"@api/Settings\";\nimport { Toasts } from \"@webpack/common\";\nimport { deflateSync, inflateSync } from \"fflate\";\n\nimport { getCloudAuth, getCloudUrl } from \"./cloud\";\nimport { Logger } from \"./Logger\";\nimport { relaunch } from \"./native\";\nimport { chooseFile, saveFile } from \"./web\";\n\nexport async function importSettings(data: string) {\n try {\n var parsed = JSON.parse(data);\n } catch (err) {\n console.log(data);\n throw new Error(\"Failed to parse JSON: \" + String(err));\n }\n\n if (\"settings\" in parsed && \"quickCss\" in parsed) {\n Object.assign(PlainSettings, parsed.settings);\n await VencordNative.settings.set(JSON.stringify(parsed.settings, null, 4));\n await VencordNative.quickCss.set(parsed.quickCss);\n } else\n throw new Error(\"Invalid Settings. Is this even a Vencord Settings file?\");\n}\n\nexport async function exportSettings({ minify }: { minify?: boolean; } = {}) {\n const settings = JSON.parse(VencordNative.settings.get());\n const quickCss = await VencordNative.quickCss.get();\n return JSON.stringify({ settings, quickCss }, null, minify ? undefined : 4);\n}\n\nexport async function downloadSettingsBackup() {\n const filename = \"vencord-settings-backup.json\";\n const backup = await exportSettings();\n const data = new TextEncoder().encode(backup);\n\n if (IS_DISCORD_DESKTOP) {\n DiscordNative.fileManager.saveWithDialog(data, filename);\n } else {\n saveFile(new File([data], filename, { type: \"application/json\" }));\n }\n}\n\nconst toast = (type: number, message: string) =>\n Toasts.show({\n type,\n message,\n id: Toasts.genId()\n });\n\nconst toastSuccess = () =>\n toast(Toasts.Type.SUCCESS, \"Settings successfully imported. Restart to apply changes!\");\n\nconst toastFailure = (err: any) =>\n toast(Toasts.Type.FAILURE, `Failed to import settings: ${String(err)}`);\n\nexport async function uploadSettingsBackup(showToast = true): Promise {\n if (IS_DISCORD_DESKTOP) {\n const [file] = await DiscordNative.fileManager.openFiles({\n filters: [\n { name: \"Vencord Settings Backup\", extensions: [\"json\"] },\n { name: \"all\", extensions: [\"*\"] }\n ]\n });\n\n if (file) {\n try {\n await importSettings(new TextDecoder().decode(file.data));\n if (showToast) toastSuccess();\n } catch (err) {\n new Logger(\"SettingsSync\").error(err);\n if (showToast) toastFailure(err);\n }\n }\n } else {\n const file = await chooseFile(\"application/json\");\n if (!file) return;\n\n const reader = new FileReader();\n reader.onload = async () => {\n try {\n await importSettings(reader.result as string);\n if (showToast) toastSuccess();\n } catch (err) {\n new Logger(\"SettingsSync\").error(err);\n if (showToast) toastFailure(err);\n }\n };\n reader.readAsText(file);\n }\n}\n\n// Cloud settings\nconst cloudSettingsLogger = new Logger(\"Cloud:Settings\", \"#39b7e0\");\n\nexport async function putCloudSettings(manual?: boolean) {\n const settings = await exportSettings({ minify: true });\n\n try {\n const res = await fetch(new URL(\"/v1/settings\", getCloudUrl()), {\n method: \"PUT\",\n headers: new Headers({\n Authorization: await getCloudAuth(),\n \"Content-Type\": \"application/octet-stream\"\n }),\n body: deflateSync(new TextEncoder().encode(settings))\n });\n\n if (!res.ok) {\n cloudSettingsLogger.error(`Failed to sync up, API returned ${res.status}`);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not synchronize settings to cloud (API returned ${res.status}).`,\n color: \"var(--red-360)\"\n });\n return;\n }\n\n const { written } = await res.json();\n PlainSettings.cloud.settingsSyncVersion = written;\n VencordNative.settings.set(JSON.stringify(PlainSettings, null, 4));\n\n cloudSettingsLogger.info(\"Settings uploaded to cloud successfully\");\n\n if (manual) {\n showNotification({\n title: \"Cloud Settings\",\n body: \"Synchronized settings to the cloud!\",\n noPersist: true,\n });\n }\n } catch (e: any) {\n cloudSettingsLogger.error(\"Failed to sync up\", e);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not synchronize settings to the cloud (${e.toString()}).`,\n color: \"var(--red-360)\"\n });\n }\n}\n\nexport async function getCloudSettings(shouldNotify = true, force = false) {\n try {\n const res = await fetch(new URL(\"/v1/settings\", getCloudUrl()), {\n method: \"GET\",\n headers: new Headers({\n Authorization: await getCloudAuth(),\n Accept: \"application/octet-stream\",\n \"If-None-Match\": Settings.cloud.settingsSyncVersion.toString()\n }),\n });\n\n if (res.status === 404) {\n cloudSettingsLogger.info(\"No settings on the cloud\");\n if (shouldNotify)\n showNotification({\n title: \"Cloud Settings\",\n body: \"There are no settings in the cloud.\",\n noPersist: true\n });\n return false;\n }\n\n if (res.status === 304) {\n cloudSettingsLogger.info(\"Settings up to date\");\n if (shouldNotify)\n showNotification({\n title: \"Cloud Settings\",\n body: \"Your settings are up to date.\",\n noPersist: true\n });\n return false;\n }\n\n if (!res.ok) {\n cloudSettingsLogger.error(`Failed to sync down, API returned ${res.status}`);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not synchronize settings from the cloud (API returned ${res.status}).`,\n color: \"var(--red-360)\"\n });\n return false;\n }\n\n const written = Number(res.headers.get(\"etag\")!);\n const localWritten = Settings.cloud.settingsSyncVersion;\n\n // don't need to check for written > localWritten because the server will return 304 due to if-none-match\n if (!force && written < localWritten) {\n if (shouldNotify)\n showNotification({\n title: \"Cloud Settings\",\n body: \"Your local settings are newer than the cloud ones.\",\n noPersist: true,\n });\n return;\n }\n\n const data = await res.arrayBuffer();\n\n const settings = new TextDecoder().decode(inflateSync(new Uint8Array(data)));\n await importSettings(settings);\n\n // sync with server timestamp instead of local one\n PlainSettings.cloud.settingsSyncVersion = written;\n VencordNative.settings.set(JSON.stringify(PlainSettings, null, 4));\n\n cloudSettingsLogger.info(\"Settings loaded from cloud successfully\");\n if (shouldNotify)\n showNotification({\n title: \"Cloud Settings\",\n body: \"Your settings have been updated! Click here to restart to fully apply changes!\",\n color: \"var(--green-360)\",\n onClick: IS_WEB ? () => location.reload() : relaunch,\n noPersist: true\n });\n\n return true;\n } catch (e: any) {\n cloudSettingsLogger.error(\"Failed to sync down\", e);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not synchronize settings from the cloud (${e.toString()}).`,\n color: \"var(--red-360)\"\n });\n\n return false;\n }\n}\n\nexport async function deleteCloudSettings() {\n try {\n const res = await fetch(new URL(\"/v1/settings\", getCloudUrl()), {\n method: \"DELETE\",\n headers: new Headers({\n Authorization: await getCloudAuth()\n }),\n });\n\n if (!res.ok) {\n cloudSettingsLogger.error(`Failed to delete, API returned ${res.status}`);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not delete settings (API returned ${res.status}).`,\n color: \"var(--red-360)\"\n });\n return;\n }\n\n cloudSettingsLogger.info(\"Settings deleted from cloud successfully\");\n showNotification({\n title: \"Cloud Settings\",\n body: \"Settings deleted from cloud!\",\n color: \"var(--green-360)\"\n });\n } catch (e: any) {\n cloudSettingsLogger.error(\"Failed to delete\", e);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not delete settings (${e.toString()}).`,\n color: \"var(--red-360)\"\n });\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { debounce } from \"@utils/debounce\";\nimport { localStorage } from \"@utils/localStorage\";\nimport { Logger } from \"@utils/Logger\";\nimport { mergeDefaults } from \"@utils/misc\";\nimport { putCloudSettings } from \"@utils/settingsSync\";\nimport { DefinedSettings, OptionType, SettingsChecks, SettingsDefinition } from \"@utils/types\";\nimport { React } from \"@webpack/common\";\n\nimport plugins from \"~plugins\";\n\nconst logger = new Logger(\"Settings\");\nexport interface Settings {\n notifyAboutUpdates: boolean;\n autoUpdate: boolean;\n autoUpdateNotification: boolean,\n useQuickCss: boolean;\n enableReactDevtools: boolean;\n themeLinks: string[];\n enabledThemes: string[];\n frameless: boolean;\n transparent: boolean;\n winCtrlQ: boolean;\n macosTranslucency: boolean;\n disableMinSize: boolean;\n winNativeTitleBar: boolean;\n plugins: {\n [plugin: string]: {\n enabled: boolean;\n [setting: string]: any;\n };\n };\n\n notifications: {\n timeout: number;\n position: \"top-right\" | \"bottom-right\";\n useNative: \"always\" | \"never\" | \"not-focused\";\n logLimit: number;\n };\n\n cloud: {\n authenticated: boolean;\n url: string;\n settingsSync: boolean;\n settingsSyncVersion: number;\n };\n}\n\nconst DefaultSettings: Settings = {\n notifyAboutUpdates: true,\n autoUpdate: false,\n autoUpdateNotification: true,\n useQuickCss: true,\n themeLinks: [],\n enabledThemes: [],\n enableReactDevtools: false,\n frameless: false,\n transparent: false,\n winCtrlQ: false,\n macosTranslucency: false,\n disableMinSize: false,\n winNativeTitleBar: false,\n plugins: {},\n\n notifications: {\n timeout: 5000,\n position: \"bottom-right\",\n useNative: \"not-focused\",\n logLimit: 50\n },\n\n cloud: {\n authenticated: false,\n url: \"https://api.vencord.dev/\",\n settingsSync: false,\n settingsSyncVersion: 0\n }\n};\n\ntry {\n var settings = JSON.parse(VencordNative.settings.get()) as Settings;\n mergeDefaults(settings, DefaultSettings);\n} catch (err) {\n var settings = mergeDefaults({} as Settings, DefaultSettings);\n logger.error(\"An error occurred while loading the settings. Corrupt settings file?\\n\", err);\n}\n\nconst saveSettingsOnFrequentAction = debounce(async () => {\n if (Settings.cloud.settingsSync && Settings.cloud.authenticated) {\n await putCloudSettings();\n delete localStorage.Vencord_settingsDirty;\n }\n}, 60_000);\n\ntype SubscriptionCallback = ((newValue: any, path: string) => void) & { _paths?: Array; };\nconst subscriptions = new Set();\n\nconst proxyCache = {} as Record;\n\n// Wraps the passed settings object in a Proxy to nicely handle change listeners and default values\nfunction makeProxy(settings: any, root = settings, path = \"\"): Settings {\n return proxyCache[path] ??= new Proxy(settings, {\n get(target, p: string) {\n const v = target[p];\n\n // using \"in\" is important in the following cases to properly handle falsy or nullish values\n if (!(p in target)) {\n // Return empty for plugins with no settings\n if (path === \"plugins\" && p in plugins)\n return target[p] = makeProxy({\n enabled: plugins[p].required ?? plugins[p].enabledByDefault ?? false\n }, root, `plugins.${p}`);\n\n // Since the property is not set, check if this is a plugin's setting and if so, try to resolve\n // the default value.\n if (path.startsWith(\"plugins.\")) {\n const plugin = path.slice(\"plugins.\".length);\n if (plugin in plugins) {\n const setting = plugins[plugin].options?.[p];\n if (!setting) return v;\n if (\"default\" in setting)\n // normal setting with a default value\n return (target[p] = setting.default);\n if (setting.type === OptionType.SELECT) {\n const def = setting.options.find(o => o.default);\n if (def)\n target[p] = def.value;\n return def?.value;\n }\n }\n }\n return v;\n }\n\n // Recursively proxy Objects with the updated property path\n if (typeof v === \"object\" && !Array.isArray(v) && v !== null)\n return makeProxy(v, root, `${path}${path && \".\"}${p}`);\n\n // primitive or similar, no need to proxy further\n return v;\n },\n\n set(target, p: string, v) {\n // avoid unnecessary updates to React Components and other listeners\n if (target[p] === v) return true;\n\n target[p] = v;\n // Call any listeners that are listening to a setting of this path\n const setPath = `${path}${path && \".\"}${p}`;\n delete proxyCache[setPath];\n for (const subscription of subscriptions) {\n if (!subscription._paths || subscription._paths.includes(setPath)) {\n subscription(v, setPath);\n }\n }\n // And don't forget to persist the settings!\n PlainSettings.cloud.settingsSyncVersion = Date.now();\n localStorage.Vencord_settingsDirty = true;\n saveSettingsOnFrequentAction();\n VencordNative.settings.set(JSON.stringify(root, null, 4));\n return true;\n }\n });\n}\n\n/**\n * Same as {@link Settings} but unproxied. You should treat this as readonly,\n * as modifying properties on this will not save to disk or call settings\n * listeners.\n * WARNING: default values specified in plugin.options will not be ensured here. In other words,\n * settings for which you specified a default value may be uninitialised. If you need proper\n * handling for default values, use {@link Settings}\n */\nexport const PlainSettings = settings;\n/**\n * A smart settings object. Altering props automagically saves\n * the updated settings to disk.\n * This recursively proxies objects. If you need the object non proxied, use {@link PlainSettings}\n */\nexport const Settings = makeProxy(settings);\n\n/**\n * Settings hook for React components. Returns a smart settings\n * object that automagically triggers a rerender if any properties\n * are altered\n * @param paths An optional list of paths to whitelist for rerenders\n * @returns Settings\n */\n// TODO: Representing paths as essentially \"string[].join('.')\" wont allow dots in paths, change to \"paths?: string[][]\" later\nexport function useSettings(paths?: UseSettings[]) {\n const [, forceUpdate] = React.useReducer(() => ({}), {});\n\n const onUpdate: SubscriptionCallback = paths\n ? (value, path) => paths.includes(path as UseSettings) && forceUpdate()\n : forceUpdate;\n\n React.useEffect(() => {\n subscriptions.add(onUpdate);\n return () => void subscriptions.delete(onUpdate);\n }, []);\n\n return Settings;\n}\n\n// Resolves a possibly nested prop in the form of \"some.nested.prop\" to type of T.some.nested.prop\ntype ResolvePropDeep = P extends \"\" ? T :\n P extends `${infer Pre}.${infer Suf}` ?\n Pre extends keyof T ? ResolvePropDeep : never : P extends keyof T ? T[P] : never;\n\n/**\n * Add a settings listener that will be invoked whenever the desired setting is updated\n * @param path Path to the setting that you want to watch, for example \"plugins.Unindent.enabled\" will fire your callback\n * whenever Unindent is toggled. Pass an empty string to get notified for all changes\n * @param onUpdate Callback function whenever a setting matching path is updated. It gets passed the new value and the path\n * to the updated setting. This path will be the same as your path argument, unless it was an empty string.\n *\n * @example addSettingsListener(\"\", (newValue, path) => console.log(`${path} is now ${newValue}`))\n * addSettingsListener(\"plugins.Unindent.enabled\", v => console.log(\"Unindent is now\", v ? \"enabled\" : \"disabled\"))\n */\nexport function addSettingsListener(path: Path, onUpdate: (newValue: Settings[Path], path: Path) => void): void;\nexport function addSettingsListener(path: Path, onUpdate: (newValue: Path extends \"\" ? any : ResolvePropDeep, path: Path extends \"\" ? string : Path) => void): void;\nexport function addSettingsListener(path: string, onUpdate: (newValue: any, path: string) => void) {\n if (path)\n ((onUpdate as SubscriptionCallback)._paths ??= []).push(path);\n subscriptions.add(onUpdate);\n}\n\nexport function migratePluginSettings(name: string, ...oldNames: string[]) {\n const { plugins } = settings;\n if (name in plugins) return;\n\n for (const oldName of oldNames) {\n if (oldName in plugins) {\n logger.info(`Migrating settings from old name ${oldName} to ${name}`);\n plugins[name] = plugins[oldName];\n delete plugins[oldName];\n VencordNative.settings.set(JSON.stringify(settings, null, 4));\n break;\n }\n }\n}\n\nexport function definePluginSettings<\n Def extends SettingsDefinition,\n Checks extends SettingsChecks,\n PrivateSettings extends object = {}\n>(def: Def, checks?: Checks) {\n const definedSettings: DefinedSettings = {\n get store() {\n if (!definedSettings.pluginName) throw new Error(\"Cannot access settings before plugin is initialized\");\n return Settings.plugins[definedSettings.pluginName] as any;\n },\n use: settings => useSettings(\n settings?.map(name => `plugins.${definedSettings.pluginName}.${name}`) as UseSettings[]\n ).plugins[definedSettings.pluginName] as any,\n def,\n checks: checks ?? {} as any,\n pluginName: \"\",\n\n withPrivateSettings() {\n return this as DefinedSettings;\n }\n };\n\n return definedSettings;\n}\n\ntype UseSettings = ResolveUseSettings[keyof T];\n\ntype ResolveUseSettings = {\n [Key in keyof T]:\n Key extends string\n ? T[Key] extends Record\n // @ts-ignore \"Type instantiation is excessively deep and possibly infinite\"\n ? UseSettings extends string ? `${Key}.${UseSettings}` : never\n : Key\n : never;\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport gitHash from \"~git-hash\";\n\nimport { Logger } from \"./Logger\";\nimport { relaunch } from \"./native\";\nimport { IpcRes } from \"./types\";\n\nexport const UpdateLogger = /* #__PURE__*/ new Logger(\"Updater\", \"white\");\nexport let isOutdated = false;\nexport let isNewer = false;\nexport let updateError: any;\nexport let changes: Record<\"hash\" | \"author\" | \"message\", string>[];\n\nasync function Unwrap(p: Promise>) {\n const res = await p;\n\n if (res.ok) return res.value;\n\n updateError = res.error;\n throw res.error;\n}\n\nexport async function checkForUpdates() {\n changes = await Unwrap(VencordNative.updater.getUpdates());\n if (changes.some(c => c.hash === gitHash)) {\n isNewer = true;\n return (isOutdated = false);\n }\n return (isOutdated = changes.length > 0);\n}\n\nexport async function update() {\n if (!isOutdated) return true;\n\n const res = await Unwrap(VencordNative.updater.update());\n\n if (res) {\n isOutdated = false;\n if (!await Unwrap(VencordNative.updater.rebuild()))\n throw new Error(\"The Build failed. Please try manually building the new update\");\n }\n\n return res;\n}\n\nexport const getRepo = () => Unwrap(VencordNative.updater.getRepo());\n\nexport async function maybePromptToUpdate(confirmMessage: string, checkForDev = false) {\n if (IS_WEB || IS_UPDATER_DISABLED) return;\n if (checkForDev && IS_DEV) return;\n\n try {\n const isOutdated = await checkForUpdates();\n if (isOutdated) {\n const wantsUpdate = confirm(confirmMessage);\n if (wantsUpdate && isNewer) return alert(\"Your local copy has more recent commits. Please stash or reset them.\");\n if (wantsUpdate) {\n await update();\n relaunch();\n }\n }\n } catch (err) {\n UpdateLogger.error(err);\n alert(\"That also failed :( Try updating or re-installing with the installer!\");\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { maybePromptToUpdate } from \"@utils/updater\";\n\nexport function handleComponentFailed() {\n maybePromptToUpdate(\n \"Uh Oh! Failed to render this Page.\" +\n \" However, there is an update available that might fix it.\" +\n \" Would you like to update and restart now?\"\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function onlyOnce(f: F): F {\n let called = false;\n let result: any;\n return function onlyOnceWrapper(this: unknown) {\n if (called) return result;\n\n called = true;\n\n return (result = f.apply(this, arguments));\n } as unknown as F;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./settingsStyles.css\";\nimport \"./themesStyles.css\";\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { handleComponentFailed } from \"@components/handleComponentFailed\";\nimport { Margins } from \"@utils/margins\";\nimport { onlyOnce } from \"@utils/onlyOnce\";\nimport { Forms, Text } from \"@webpack/common\";\nimport type { ComponentType, PropsWithChildren } from \"react\";\n\nexport function SettingsTab({ title, children }: PropsWithChildren<{ title: string; }>) {\n return (\n \n \n {title}\n \n\n {children}\n \n );\n}\n\nconst onError = onlyOnce(handleComponentFailed);\n\nexport function wrapTab(component: ComponentType, tab: string) {\n return ErrorBoundary.wrap(component, {\n message: `Failed to render the ${tab} tab. If this issue persists, try using the installer to reinstall!`,\n onError,\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { openNotificationLogModal } from \"@api/Notifications/notificationLog\";\nimport { Settings, useSettings } from \"@api/Settings\";\nimport { classNameFactory } from \"@api/Styles\";\nimport DonateButton from \"@components/DonateButton\";\nimport { ErrorCard } from \"@components/ErrorCard\";\nimport { Margins } from \"@utils/margins\";\nimport { identity } from \"@utils/misc\";\nimport { relaunch, showItemInFolder } from \"@utils/native\";\nimport { useAwaiter } from \"@utils/react\";\nimport { Button, Card, Forms, React, Select, Slider, Switch } from \"@webpack/common\";\n\nimport { SettingsTab, wrapTab } from \"./shared\";\n\nconst cl = classNameFactory(\"vc-settings-\");\n\nconst DEFAULT_DONATE_IMAGE = \"https://cdn.discordapp.com/emojis/1026533090627174460.png\";\nconst SHIGGY_DONATE_IMAGE = \"https://media.discordapp.net/stickers/1039992459209490513.png\";\n\ntype KeysOfType = {\n [K in keyof Object]: Object[K] extends Type ? K : never;\n}[keyof Object];\n\nfunction VencordSettings() {\n const [settingsDir, , settingsDirPending] = useAwaiter(VencordNative.settings.getSettingsDir, {\n fallbackValue: \"Loading...\"\n });\n const settings = useSettings();\n\n const donateImage = React.useMemo(() => Math.random() > 0.5 ? DEFAULT_DONATE_IMAGE : SHIGGY_DONATE_IMAGE, []);\n\n const isWindows = navigator.platform.toLowerCase().startsWith(\"win\");\n const isMac = navigator.platform.toLowerCase().startsWith(\"mac\");\n\n const Switches: Array;\n title: string;\n note: string;\n }> =\n [\n {\n key: \"useQuickCss\",\n title: \"Enable Custom CSS\",\n note: \"Loads your Custom CSS\"\n },\n !IS_WEB && {\n key: \"enableReactDevtools\",\n title: \"Enable React Developer Tools\",\n note: \"Requires a full restart\"\n },\n !IS_WEB && (!IS_DISCORD_DESKTOP || !isWindows ? {\n key: \"frameless\",\n title: \"Disable the window frame\",\n note: \"Requires a full restart\"\n } : {\n key: \"winNativeTitleBar\",\n title: \"Use Windows' native title bar instead of Discord's custom one\",\n note: \"Requires a full restart\"\n }),\n !IS_WEB && false /* This causes electron to freeze / white screen for some people */ && {\n key: \"transparent\",\n title: \"Enable window transparency\",\n note: \"Requires a full restart\"\n },\n !IS_WEB && isWindows && {\n key: \"winCtrlQ\",\n title: \"Register Ctrl+Q as shortcut to close Discord (Alternative to Alt+F4)\",\n note: \"Requires a full restart\"\n },\n IS_DISCORD_DESKTOP && {\n key: \"disableMinSize\",\n title: \"Disable minimum window size\",\n note: \"Requires a full restart\"\n },\n IS_DISCORD_DESKTOP && isMac && {\n key: \"macosTranslucency\",\n title: \"Enable translucent window\",\n note: \"Requires a full restart\"\n }\n ];\n\n return (\n \n \n \n \n \n {!IS_WEB && (\n \n Restart Client\n \n )}\n VencordNative.quickCss.openEditor()}\n size={Button.Sizes.SMALL}\n disabled={settingsDir === \"Loading...\"}>\n Open QuickCSS File\n \n {!IS_WEB && (\n showItemInFolder(settingsDir)}\n size={Button.Sizes.SMALL}\n disabled={settingsDirPending}>\n Open Settings Folder\n \n )}\n VencordNative.native.openExternal(\"https://github.com/Vendicated/Vencord\")}\n size={Button.Sizes.SMALL}\n disabled={settingsDirPending}>\n Open in GitHub\n \n \n \n \n\n \n\n \n \n Hint: You can change the position of this settings section in the settings of the \"Settings\" plugin!\n \n {Switches.map(s => s && (\n settings[s.key] = v}\n note={s.note}\n >\n {s.title}\n \n ))}\n \n\n\n {typeof Notification !== \"undefined\" && }\n \n );\n}\n\nfunction NotificationSection({ settings }: { settings: typeof Settings[\"notifications\"]; }) {\n return (\n <>\n Notification Style\n {settings.useNative !== \"never\" && Notification?.permission === \"denied\" && (\n \n Desktop Notification Permission denied\n You have denied Notification Permissions. Thus, Desktop notifications will not work!\n \n )}\n \n Some plugins may show you notifications. These come in two styles:\n
    \n
  • Vencord Notifications: These are in-app notifications
  • \n
  • Desktop Notifications: Native Desktop notifications (like when you get a ping)
  • \n
\n
\n >}\n closeOnSelect={true}\n select={v => settings.useNative = v}\n isSelected={v => v === settings.useNative}\n serialize={identity}\n />\n\n Notification Position\n >}\n select={v => settings.position = v}\n isSelected={v => v === settings.position}\n serialize={identity}\n />\n\n Notification Timeout\n Set to 0s to never automatically time out\n settings.timeout = v}\n onValueRender={v => (v / 1000).toFixed(2) + \"s\"}\n onMarkerRender={v => (v / 1000) + \"s\"}\n stickToMarkers={false}\n />\n\n Notification Log Limit\n \n The amount of notifications to save in the log until old ones are removed.\n Set to 0 to disable Notification log and \u221E to never automatically remove old Notifications\n \n settings.logLimit = v}\n onValueRender={v => v === 200 ? \"\u221E\" : v}\n onMarkerRender={v => v === 200 ? \"\u221E\" : v}\n />\n\n \n Open Notification Log\n \n \n );\n}\n\ninterface DonateCardProps {\n image: string;\n}\n\nfunction DonateCard({ image }: DonateCardProps) {\n return (\n \n
\n Support the Project\n Please consider supporting the development of Vencord by donating!\n \n
\n \n
\n );\n}\n\nexport default wrapTab(VencordSettings, \"Vencord Settings\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { waitFor } from \"@webpack\";\n\nlet NoticesModule: any;\nwaitFor(m => m.show && m.dismiss && !m.suppressAll, m => NoticesModule = m);\n\nexport const noticesQueue = [] as any[];\nexport let currentNotice: any = null;\n\nexport function popNotice() {\n NoticesModule.dismiss();\n}\n\nexport function nextNotice() {\n currentNotice = noticesQueue.shift();\n\n if (currentNotice) {\n NoticesModule.show(...currentNotice, \"VencordNotice\");\n }\n}\n\nexport function showNotice(message: string, buttonText: string, onOkClick: () => void) {\n noticesQueue.push([\"GENERIC\", message, buttonText, onOkClick]);\n if (!currentNotice) nextNotice();\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./iconStyles.css\";\n\nimport { classes } from \"@utils/misc\";\nimport { i18n } from \"@webpack/common\";\nimport type { PropsWithChildren, SVGProps } from \"react\";\n\ninterface BaseIconProps extends IconProps {\n viewBox: string;\n}\n\ninterface IconProps extends SVGProps {\n className?: string;\n height?: string | number;\n width?: string | number;\n}\n\nfunction Icon({ height = 24, width = 24, className, children, viewBox, ...svgProps }: PropsWithChildren) {\n return (\n \n {children}\n \n );\n}\n\n/**\n * Discord's link icon, as seen in the Message context menu \"Copy Message Link\" option\n */\nexport function LinkIcon({ height = 24, width = 24, className }: IconProps) {\n return (\n \n \n \n \n \n \n );\n}\n\n/**\n * Discord's copy icon, as seen in the user popout right of the username when clicking\n * your own username in the bottom left user panel\n */\nexport function CopyIcon(props: IconProps) {\n return (\n \n \n \n \n \n \n );\n}\n\n/**\n * Discord's open external icon, as seen in the user profile connections\n */\nexport function OpenExternalIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function ImageIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function InfoIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function OwnerCrownIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\n/**\n * Discord's screenshare icon, as seen in the connection panel\n */\nexport function ScreenshareIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function ImageVisible(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function ImageInvisible(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function Microphone(props: IconProps) {\n return (\n \n \n \n \n );\n}\n\nexport function CogWheel(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function ReplyIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function DeleteIcon(props: IconProps) {\n return (\n \n \n \n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { moment } from \"@webpack/common\";\n\n// Utils for readable text transformations eg: `toTitle(fromKebab())`\n\n// Case style to words\nexport const wordsFromCamel = (text: string) => text.split(/(?=[A-Z])/).map(w => w.toLowerCase());\nexport const wordsFromSnake = (text: string) => text.toLowerCase().split(\"_\");\nexport const wordsFromKebab = (text: string) => text.toLowerCase().split(\"-\");\nexport const wordsFromPascal = (text: string) => text.split(/(?=[A-Z])/).map(w => w.toLowerCase());\nexport const wordsFromTitle = (text: string) => text.toLowerCase().split(\" \");\n\n// Words to case style\nexport const wordsToCamel = (words: string[]) =>\n words.map((w, i) => (i ? w[0].toUpperCase() + w.slice(1) : w)).join(\"\");\nexport const wordsToSnake = (words: string[]) => words.join(\"_\").toUpperCase();\nexport const wordsToKebab = (words: string[]) => words.join(\"-\").toLowerCase();\nexport const wordsToPascal = (words: string[]) =>\n words.map(w => w[0].toUpperCase() + w.slice(1)).join(\"\");\nexport const wordsToTitle = (words: string[]) =>\n words.map(w => w[0].toUpperCase() + w.slice(1)).join(\" \");\n\nconst units = [\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\"] as const;\ntype Units = typeof units[number];\n\nfunction getUnitStr(unit: Units, isOne: boolean, short: boolean) {\n if (short === false) return isOne ? unit.slice(0, -1) : unit;\n\n return unit[0];\n}\n\n/**\n * Forms time into a human readable string link \"1 day, 2 hours, 3 minutes and 4 seconds\"\n * @param time The time on the specified unit\n * @param unit The unit the time is on\n * @param short Whether to use short units like \"d\" instead of \"days\"\n */\nexport function formatDuration(time: number, unit: Units, short: boolean = false) {\n const dur = moment.duration(time, unit);\n\n let unitsAmounts = units.map(unit => ({ amount: dur[unit](), unit }));\n\n let amountsToBeRemoved = 0;\n\n outer:\n for (let i = 0; i < unitsAmounts.length; i++) {\n if (unitsAmounts[i].amount === 0 || !(i + 1 < unitsAmounts.length)) continue;\n for (let v = i + 1; v < unitsAmounts.length; v++) {\n if (unitsAmounts[v].amount !== 0) continue outer;\n }\n\n amountsToBeRemoved = unitsAmounts.length - (i + 1);\n }\n unitsAmounts = amountsToBeRemoved === 0 ? unitsAmounts : unitsAmounts.slice(0, -amountsToBeRemoved);\n\n const daysAmountIndex = unitsAmounts.findIndex(({ unit }) => unit === \"days\");\n if (daysAmountIndex !== -1) {\n const daysAmount = unitsAmounts[daysAmountIndex];\n\n const daysMod = daysAmount.amount % 7;\n if (daysMod === 0) unitsAmounts.splice(daysAmountIndex, 1);\n else daysAmount.amount = daysMod;\n }\n\n let res: string = \"\";\n while (unitsAmounts.length) {\n const { amount, unit } = unitsAmounts.shift()!;\n\n if (res.length) res += unitsAmounts.length ? \", \" : \" and \";\n\n if (amount > 0 || res.length) {\n res += `${amount} ${getUnitStr(unit, amount === 1, short)}`;\n }\n }\n\n return res.length ? res : `0 ${getUnitStr(unit, false, short)}`;\n}\n\n/**\n * Join an array of strings in a human readable way (1, 2 and 3)\n * @param elements Elements\n */\nexport function humanFriendlyJoin(elements: string[]): string;\n/**\n * Join an array of strings in a human readable way (1, 2 and 3)\n * @param elements Elements\n * @param mapper Function that converts elements to a string\n */\nexport function humanFriendlyJoin(elements: T[], mapper: (e: T) => string): string;\nexport function humanFriendlyJoin(elements: any[], mapper: (e: any) => string = s => s): string {\n const { length } = elements;\n if (length === 0)\n return \"\";\n if (length === 1)\n return mapper(elements[0]);\n\n let s = \"\";\n\n for (let i = 0; i < length; i++) {\n s += mapper(elements[i]);\n if (length - i > 2)\n s += \", \";\n else if (length - i > 1)\n s += \" and \";\n }\n\n return s;\n}\n\n/**\n * Wrap the text in ``` with an optional language\n */\nexport function makeCodeblock(text: string, language?: string) {\n const chars = \"```\";\n return `${chars}${language || \"\"}\\n${text.replaceAll(\"```\", \"\\\\`\\\\`\\\\`\")}\\n${chars}`;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { mergeDefaults } from \"@utils/misc\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { SnowflakeUtils } from \"@webpack/common\";\nimport { Message } from \"discord-types/general\";\nimport type { PartialDeep } from \"type-fest\";\n\nimport { Argument } from \"./types\";\n\nconst MessageCreator = findByPropsLazy(\"createBotMessage\");\nconst MessageSender = findByPropsLazy(\"receiveMessage\");\n\nexport function generateId() {\n return `-${SnowflakeUtils.fromTimestamp(Date.now())}`;\n}\n\n/**\n * Send a message as Clyde\n * @param {string} channelId ID of channel to send message to\n * @param {Message} message Message to send\n * @returns {Message}\n */\nexport function sendBotMessage(channelId: string, message: PartialDeep): Message {\n const botMessage = MessageCreator.createBotMessage({ channelId, content: \"\", embeds: [] });\n\n MessageSender.receiveMessage(channelId, mergeDefaults(message, botMessage));\n\n return message as Message;\n}\n\n/**\n * Get the value of an option by name\n * @param args Arguments array (first argument passed to execute)\n * @param name Name of the argument\n * @param fallbackValue Fallback value in case this option wasn't passed\n * @returns Value\n */\nexport function findOption(args: Argument[], name: string): T & {} | undefined;\nexport function findOption(args: Argument[], name: string, fallbackValue: T): T & {};\nexport function findOption(args: Argument[], name: string, fallbackValue?: any) {\n return (args.find(a => a.name === name)?.value || fallbackValue) as any;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Channel, Guild } from \"discord-types/general\";\nimport { Promisable } from \"type-fest\";\n\nexport interface CommandContext {\n channel: Channel;\n guild?: Guild;\n}\n\nexport const enum ApplicationCommandOptionType {\n SUB_COMMAND = 1,\n SUB_COMMAND_GROUP = 2,\n STRING = 3,\n INTEGER = 4,\n BOOLEAN = 5,\n USER = 6,\n CHANNEL = 7,\n ROLE = 8,\n MENTIONABLE = 9,\n NUMBER = 10,\n ATTACHMENT = 11,\n}\n\nexport const enum ApplicationCommandInputType {\n BUILT_IN = 0,\n BUILT_IN_TEXT = 1,\n BUILT_IN_INTEGRATION = 2,\n BOT = 3,\n PLACEHOLDER = 4,\n}\n\nexport interface Option {\n name: string;\n displayName?: string;\n type: ApplicationCommandOptionType;\n description: string;\n displayDescription?: string;\n required?: boolean;\n options?: Option[];\n choices?: Array;\n}\n\nexport interface ChoicesOption {\n label: string;\n value: string;\n name: string;\n displayName?: string;\n}\n\nexport const enum ApplicationCommandType {\n CHAT_INPUT = 1,\n USER = 2,\n MESSAGE = 3,\n}\n\nexport interface CommandReturnValue {\n content: string;\n /** TODO: implement */\n cancel?: boolean;\n}\n\nexport interface Argument {\n type: ApplicationCommandOptionType;\n name: string;\n value: string;\n focused: undefined;\n options: Argument[];\n}\n\nexport interface Command {\n id?: string;\n applicationId?: string;\n type?: ApplicationCommandType;\n inputType?: ApplicationCommandInputType;\n plugin?: string;\n isVencordCommand?: boolean;\n\n name: string;\n displayName?: string;\n description: string;\n displayDescription?: string;\n\n options?: Option[];\n predicate?(ctx: CommandContext): boolean;\n\n execute(args: Argument[], ctx: CommandContext): Promisable;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { makeCodeblock } from \"@utils/text\";\n\nimport { sendBotMessage } from \"./commandHelpers\";\nimport { ApplicationCommandInputType, ApplicationCommandOptionType, ApplicationCommandType, Argument, Command, CommandContext, Option } from \"./types\";\n\nexport * from \"./commandHelpers\";\nexport * from \"./types\";\n\nexport let BUILT_IN: Command[];\nexport const commands = {} as Record;\n\n// hack for plugins being evaluated before we can grab these from webpack\nconst OptPlaceholder = Symbol(\"OptionalMessageOption\") as any as Option;\nconst ReqPlaceholder = Symbol(\"RequiredMessageOption\") as any as Option;\n/**\n * Optional message option named \"message\" you can use in commands.\n * Used in \"tableflip\" or \"shrug\"\n * @see {@link RequiredMessageOption}\n */\nexport let OptionalMessageOption: Option = OptPlaceholder;\n/**\n * Required message option named \"message\" you can use in commands.\n * Used in \"me\"\n * @see {@link OptionalMessageOption}\n */\nexport let RequiredMessageOption: Option = ReqPlaceholder;\n\nexport const _init = function (cmds: Command[]) {\n try {\n BUILT_IN = cmds;\n OptionalMessageOption = cmds.find(c => c.name === \"shrug\")!.options![0];\n RequiredMessageOption = cmds.find(c => c.name === \"me\")!.options![0];\n } catch (e) {\n console.error(\"Failed to load CommandsApi\");\n }\n return cmds;\n} as never;\n\nexport const _handleCommand = function (cmd: Command, args: Argument[], ctx: CommandContext) {\n if (!cmd.isVencordCommand)\n return cmd.execute(args, ctx);\n\n const handleError = (err: any) => {\n // TODO: cancel send if cmd.inputType === BUILT_IN_TEXT\n const msg = `An Error occurred while executing command \"${cmd.name}\"`;\n const reason = err instanceof Error ? err.stack || err.message : String(err);\n\n console.error(msg, err);\n sendBotMessage(ctx.channel.id, {\n content: `${msg}:\\n${makeCodeblock(reason)}`,\n author: {\n username: \"Vencord\"\n }\n });\n };\n\n try {\n const res = cmd.execute(args, ctx);\n return res instanceof Promise ? res.catch(handleError) : res;\n } catch (err) {\n return handleError(err);\n }\n} as never;\n\n\n/**\n * Prepare a Command Option for Discord by filling missing fields\n * @param opt\n */\nexport function prepareOption(opt: O): O {\n opt.displayName ||= opt.name;\n opt.displayDescription ||= opt.description;\n opt.options?.forEach((opt, i, opts) => {\n // See comment above Placeholders\n if (opt === OptPlaceholder) opts[i] = OptionalMessageOption;\n else if (opt === ReqPlaceholder) opts[i] = RequiredMessageOption;\n opt.choices?.forEach(x => x.displayName ||= x.name);\n\n prepareOption(opts[i]);\n });\n return opt;\n}\n\n// Yes, Discord registers individual commands for each subcommand\n// TODO: This probably doesn't support nested subcommands. If that is ever needed,\n// investigate\nfunction registerSubCommands(cmd: Command, plugin: string) {\n cmd.options?.forEach(o => {\n if (o.type !== ApplicationCommandOptionType.SUB_COMMAND)\n throw new Error(\"When specifying sub-command options, all options must be sub-commands.\");\n const subCmd = {\n ...cmd,\n ...o,\n type: ApplicationCommandType.CHAT_INPUT,\n name: `${cmd.name} ${o.name}`,\n id: `${o.name}-${cmd.id}`,\n displayName: `${cmd.name} ${o.name}`,\n subCommandPath: [{\n name: o.name,\n type: o.type,\n displayName: o.name\n }],\n rootCommand: cmd\n };\n registerCommand(subCmd as any, plugin);\n });\n}\n\nexport function registerCommand(command: C, plugin: string) {\n if (!BUILT_IN) {\n console.warn(\n \"[CommandsAPI]\",\n `Not registering ${command.name} as the CommandsAPI hasn't been initialised.`,\n \"Please restart to use commands\"\n );\n return;\n }\n\n if (BUILT_IN.some(c => c.name === command.name))\n throw new Error(`Command '${command.name}' already exists.`);\n\n command.isVencordCommand = true;\n command.id ??= `-${BUILT_IN.length + 1}`;\n command.applicationId ??= \"-1\"; // BUILT_IN;\n command.type ??= ApplicationCommandType.CHAT_INPUT;\n command.inputType ??= ApplicationCommandInputType.BUILT_IN_TEXT;\n command.plugin ||= plugin;\n\n prepareOption(command);\n\n if (command.options?.[0]?.type === ApplicationCommandOptionType.SUB_COMMAND) {\n registerSubCommands(command, plugin);\n return;\n }\n\n commands[command.name] = command;\n BUILT_IN.push(command);\n}\n\nexport function unregisterCommand(name: string) {\n const idx = BUILT_IN.findIndex(c => c.name === name);\n if (idx === -1)\n return false;\n\n BUILT_IN.splice(idx, 1);\n delete commands[name];\n\n return true;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function Badge({ text, color }): JSX.Element {\n return (\n
\n {text}\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { wordsFromCamel, wordsToTitle } from \"@utils/text\";\nimport { PluginOptionBoolean } from \"@utils/types\";\nimport { Forms, React, Switch } from \"@webpack/common\";\n\nimport { ISettingElementProps } from \".\";\n\nexport function SettingBooleanComponent({ option, pluginSettings, definedSettings, id, onChange, onError }: ISettingElementProps) {\n const def = pluginSettings[id] ?? option.default;\n\n const [state, setState] = React.useState(def ?? false);\n const [error, setError] = React.useState(null);\n\n React.useEffect(() => {\n onError(error !== null);\n }, [error]);\n\n function handleChange(newValue: boolean): void {\n const isValid = option.isValid?.call(definedSettings, newValue) ?? true;\n if (typeof isValid === \"string\") setError(isValid);\n else if (!isValid) setError(\"Invalid input provided.\");\n else {\n setError(null);\n setState(newValue);\n onChange(newValue);\n }\n }\n\n return (\n \n \n {wordsToTitle(wordsFromCamel(id))}\n \n {error && {error}}\n \n );\n}\n\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PluginOptionComponent } from \"@utils/types\";\n\nimport { ISettingElementProps } from \".\";\n\nexport function SettingCustomComponent({ option, onChange, onError }: ISettingElementProps) {\n return option.component({ setValue: onChange, setError: onError, option });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { OptionType, PluginOptionNumber } from \"@utils/types\";\nimport { Forms, React, TextInput } from \"@webpack/common\";\n\nimport { ISettingElementProps } from \".\";\n\nconst MAX_SAFE_NUMBER = BigInt(Number.MAX_SAFE_INTEGER);\n\nexport function SettingNumericComponent({ option, pluginSettings, definedSettings, id, onChange, onError }: ISettingElementProps) {\n function serialize(value: any) {\n if (option.type === OptionType.BIGINT) return BigInt(value);\n return Number(value);\n }\n\n const [state, setState] = React.useState(`${pluginSettings[id] ?? option.default ?? 0}`);\n const [error, setError] = React.useState(null);\n\n React.useEffect(() => {\n onError(error !== null);\n }, [error]);\n\n function handleChange(newValue) {\n const isValid = option.isValid?.call(definedSettings, newValue) ?? true;\n\n setError(null);\n if (typeof isValid === \"string\") setError(isValid);\n else if (!isValid) setError(\"Invalid input provided.\");\n\n if (option.type === OptionType.NUMBER && BigInt(newValue) >= MAX_SAFE_NUMBER) {\n setState(`${Number.MAX_SAFE_INTEGER}`);\n onChange(serialize(newValue));\n } else {\n setState(newValue);\n onChange(serialize(newValue));\n }\n }\n\n return (\n \n {option.description}\n \n {error && {error}}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PluginOptionSelect } from \"@utils/types\";\nimport { Forms, React, Select } from \"@webpack/common\";\n\nimport { ISettingElementProps } from \".\";\n\nexport function SettingSelectComponent({ option, pluginSettings, definedSettings, onChange, onError, id }: ISettingElementProps) {\n const def = pluginSettings[id] ?? option.options?.find(o => o.default)?.value;\n\n const [state, setState] = React.useState(def ?? null);\n const [error, setError] = React.useState(null);\n\n React.useEffect(() => {\n onError(error !== null);\n }, [error]);\n\n function handleChange(newValue) {\n const isValid = option.isValid?.call(definedSettings, newValue) ?? true;\n if (typeof isValid === \"string\") setError(isValid);\n else if (!isValid) setError(\"Invalid input provided.\");\n else {\n setError(null);\n setState(newValue);\n onChange(newValue);\n }\n }\n\n return (\n \n {option.description}\n v === state}\n serialize={v => String(v)}\n {...option.componentProps}\n />\n {error && {error}}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PluginOptionSlider } from \"@utils/types\";\nimport { Forms, React, Slider } from \"@webpack/common\";\n\nimport { ISettingElementProps } from \".\";\n\nexport function makeRange(start: number, end: number, step = 1) {\n const ranges: number[] = [];\n for (let value = start; value <= end; value += step) {\n ranges.push(Math.round(value * 100) / 100);\n }\n return ranges;\n}\n\nexport function SettingSliderComponent({ option, pluginSettings, definedSettings, id, onChange, onError }: ISettingElementProps) {\n const def = pluginSettings[id] ?? option.default;\n\n const [error, setError] = React.useState(null);\n\n React.useEffect(() => {\n onError(error !== null);\n }, [error]);\n\n function handleChange(newValue: number): void {\n const isValid = option.isValid?.call(definedSettings, newValue) ?? true;\n if (typeof isValid === \"string\") setError(isValid);\n else if (!isValid) setError(\"Invalid input provided.\");\n else {\n setError(null);\n onChange(newValue);\n }\n }\n\n return (\n \n {option.description}\n String(v.toFixed(2))}\n stickToMarkers={option.stickToMarkers ?? true}\n {...option.componentProps}\n />\n \n );\n}\n\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PluginOptionString } from \"@utils/types\";\nimport { Forms, React, TextInput } from \"@webpack/common\";\n\nimport { ISettingElementProps } from \".\";\n\nexport function SettingTextComponent({ option, pluginSettings, definedSettings, id, onChange, onError }: ISettingElementProps) {\n const [state, setState] = React.useState(pluginSettings[id] ?? option.default ?? null);\n const [error, setError] = React.useState(null);\n\n React.useEffect(() => {\n onError(error !== null);\n }, [error]);\n\n function handleChange(newValue) {\n const isValid = option.isValid?.call(definedSettings, newValue) ?? true;\n if (typeof isValid === \"string\") setError(isValid);\n else if (!isValid) setError(\"Invalid input provided.\");\n else setError(null);\n\n setState(newValue);\n onChange(newValue);\n }\n\n return (\n \n {option.description}\n \n {error && {error}}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { DefinedSettings, PluginOptionBase } from \"@utils/types\";\n\nexport interface ISettingElementProps {\n option: T;\n onChange(newValue: any): void;\n pluginSettings: {\n [setting: string]: any;\n enabled: boolean;\n };\n id: string;\n onError(hasError: boolean): void;\n definedSettings?: DefinedSettings;\n}\n\nexport * from \"../../Badge\";\nexport * from \"./SettingBooleanComponent\";\nexport * from \"./SettingCustomComponent\";\nexport * from \"./SettingNumericComponent\";\nexport * from \"./SettingSelectComponent\";\nexport * from \"./SettingSliderComponent\";\nexport * from \"./SettingTextComponent\";\n\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { MessageObject } from \"@api/MessageEvents\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ChannelStore, ComponentDispatch, FluxDispatcher, GuildStore, MaskedLink, ModalImageClasses, PrivateChannelsStore, RestAPI, SelectedChannelStore, SelectedGuildStore, UserProfileStore, UserSettingsActionCreators, UserUtils } from \"@webpack/common\";\nimport { Guild, Message, User } from \"discord-types/general\";\n\nimport { ImageModal, ModalRoot, ModalSize, openModal } from \"./modal\";\n\nconst MessageActions = findByPropsLazy(\"editMessage\", \"sendMessage\");\nconst UserProfileActions = findByPropsLazy(\"openUserProfileModal\", \"closeUserProfileModal\");\n\nexport function getCurrentChannel() {\n return ChannelStore.getChannel(SelectedChannelStore.getChannelId());\n}\n\nexport function getCurrentGuild(): Guild | undefined {\n return GuildStore.getGuild(getCurrentChannel()?.guild_id);\n}\n\nexport function openPrivateChannel(userId: string) {\n PrivateChannelsStore.openPrivateChannel(userId);\n}\n\nexport const enum Theme {\n Dark = 1,\n Light = 2\n}\n\nexport function getTheme(): Theme {\n return UserSettingsActionCreators.PreloadedUserSettingsActionCreators.getCurrentValue()?.appearance?.theme;\n}\n\nexport function insertTextIntoChatInputBox(text: string) {\n ComponentDispatch.dispatchToLastSubscribed(\"INSERT_TEXT\", {\n rawText: text,\n plainText: text\n });\n}\n\ninterface MessageExtra {\n messageReference: Message[\"messageReference\"];\n allowedMentions: {\n parse: string[];\n replied_user: boolean;\n };\n stickerIds: string[];\n}\n\nexport function sendMessage(\n channelId: string,\n data: Partial,\n waitForChannelReady?: boolean,\n extra?: Partial\n) {\n const messageData = {\n content: \"\",\n invalidEmojis: [],\n tts: false,\n validNonShortcutEmojis: [],\n ...data\n };\n\n return MessageActions.sendMessage(channelId, messageData, waitForChannelReady, extra);\n}\n\nexport function openImageModal(url: string, props?: Partial>): string {\n return openModal(modalProps => (\n \n }\n shouldHideMediaOptions={false}\n shouldAnimate\n {...props}\n />\n \n ));\n}\n\nexport async function openUserProfile(id: string) {\n const user = await UserUtils.getUser(id);\n if (!user) throw new Error(\"No such user: \" + id);\n\n const guildId = SelectedGuildStore.getGuildId();\n UserProfileActions.openUserProfileModal({\n userId: id,\n guildId,\n channelId: SelectedChannelStore.getChannelId(),\n analyticsLocation: {\n page: guildId ? \"Guild Channel\" : \"DM Channel\",\n section: \"Profile Popout\"\n }\n });\n}\n\ninterface FetchUserProfileOptions {\n friend_token?: string;\n connections_role_id?: string;\n guild_id?: string;\n with_mutual_guilds?: boolean;\n with_mutual_friends_count?: boolean;\n}\n\n/**\n * Fetch a user's profile\n */\nexport async function fetchUserProfile(id: string, options?: FetchUserProfileOptions) {\n const cached = UserProfileStore.getUserProfile(id);\n if (cached) return cached;\n\n FluxDispatcher.dispatch({ type: \"USER_PROFILE_FETCH_START\", userId: id });\n\n const { body } = await RestAPI.get({\n url: `/users/${id}/profile`,\n query: {\n with_mutual_guilds: false,\n with_mutual_friends_count: false,\n ...options\n },\n oldFormErrors: true,\n });\n\n FluxDispatcher.dispatch({ type: \"USER_UPDATE\", user: body.user });\n await FluxDispatcher.dispatch({ type: \"USER_PROFILE_FETCH_SUCCESS\", ...body });\n if (options?.guild_id && body.guild_member)\n FluxDispatcher.dispatch({ type: \"GUILD_MEMBER_PROFILE_UPDATE\", guildId: options.guild_id, guildMember: body.guild_member });\n\n return UserProfileStore.getUserProfile(id);\n}\n\n/**\n * Get the unique username for a user. Returns user.username for pomelo people, user.tag otherwise\n */\nexport function getUniqueUsername(user: User) {\n return user.discriminator === \"0\" ? user.username : user.tag;\n}\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport \"./contributorModal.css\";\n\nimport { useSettings } from \"@api/Settings\";\nimport { classNameFactory } from \"@api/Styles\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { DevsById } from \"@utils/constants\";\nimport { fetchUserProfile, getTheme, Theme } from \"@utils/discord\";\nimport { ModalContent, ModalRoot, openModal } from \"@utils/modal\";\nimport { Forms, MaskedLink, showToast, useEffect, useMemo, UserProfileStore, useStateFromStores } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\n\nimport Plugins from \"~plugins\";\n\nimport { PluginCard } from \".\";\n\nconst WebsiteIconDark = \"/assets/e1e96d89e192de1997f73730db26e94f.svg\";\nconst WebsiteIconLight = \"/assets/730f58bcfd5a57a5e22460c445a0c6cf.svg\";\nconst GithubIconLight = \"/assets/3ff98ad75ac94fa883af5ed62d17c459.svg\";\nconst GithubIconDark = \"/assets/6a853b4c87fce386cbfef4a2efbacb09.svg\";\n\nconst cl = classNameFactory(\"vc-author-modal-\");\n\nexport function openContributorModal(user: User) {\n openModal(modalProps =>\n \n \n \n \n \n \n \n );\n}\n\nfunction GithubIcon() {\n const src = getTheme() === Theme.Light ? GithubIconLight : GithubIconDark;\n return \"GitHub\";\n}\n\nfunction WebsiteIcon() {\n const src = getTheme() === Theme.Light ? WebsiteIconLight : WebsiteIconDark;\n return \"Website\";\n}\n\nfunction ContributorModal({ user }: { user: User; }) {\n useSettings();\n\n const profile = useStateFromStores([UserProfileStore], () => UserProfileStore.getUserProfile(user.id));\n\n useEffect(() => {\n if (!profile && !user.bot && user.id)\n fetchUserProfile(user.id);\n }, [user.id]);\n\n const githubName = profile?.connectedAccounts?.find(a => a.type === \"github\")?.name;\n const website = profile?.connectedAccounts?.find(a => a.type === \"domain\")?.name;\n\n const plugins = useMemo(() => {\n const allPlugins = Object.values(Plugins);\n const pluginsByAuthor = DevsById[user.id]\n ? allPlugins.filter(p => p.authors.includes(DevsById[user.id]))\n : allPlugins.filter(p => p.authors.some(a => a.name === user.username));\n\n return pluginsByAuthor\n .filter(p => !p.name.endsWith(\"API\"))\n .sort((a, b) => Number(a.required ?? false) - Number(b.required ?? false));\n }, [user.id, user.username]);\n\n return (\n <>\n
\n \n {user.username}\n\n
\n {website && (\n \n \n \n )}\n {githubName && (\n \n \n \n )}\n
\n
\n\n
\n {plugins.map(p =>\n showToast(\"Restart to apply changes!\")}\n />\n )}\n
\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { generateId } from \"@api/Commands\";\nimport { useSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { proxyLazy } from \"@utils/lazy\";\nimport { Margins } from \"@utils/margins\";\nimport { classes, isObjectEmpty } from \"@utils/misc\";\nimport { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize } from \"@utils/modal\";\nimport { OptionType, Plugin } from \"@utils/types\";\nimport { findByPropsLazy, findComponentByCodeLazy } from \"@webpack\";\nimport { Button, Clickable, FluxDispatcher, Forms, React, Text, Tooltip, UserStore, UserUtils } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\nimport { Constructor } from \"type-fest\";\n\nimport {\n ISettingElementProps,\n SettingBooleanComponent,\n SettingCustomComponent,\n SettingNumericComponent,\n SettingSelectComponent,\n SettingSliderComponent,\n SettingTextComponent\n} from \"./components\";\nimport { openContributorModal } from \"./ContributorModal\";\n\nconst UserSummaryItem = findComponentByCodeLazy(\"defaultRenderUser\", \"showDefaultAvatarsForNullUsers\");\nconst AvatarStyles = findByPropsLazy(\"moreUsers\", \"emptyUser\", \"avatarContainer\", \"clickableAvatar\");\nconst UserRecord: Constructor> = proxyLazy(() => UserStore.getCurrentUser().constructor) as any;\n\ninterface PluginModalProps extends ModalProps {\n plugin: Plugin;\n onRestartNeeded(): void;\n}\n\nfunction makeDummyUser(user: { username: string; id?: string; avatar?: string; }) {\n const newUser = new UserRecord({\n username: user.username,\n id: user.id ?? generateId(),\n avatar: user.avatar,\n /** To stop discord making unwanted requests... */\n bot: true,\n });\n FluxDispatcher.dispatch({\n type: \"USER_UPDATE\",\n user: newUser,\n });\n return newUser;\n}\n\nconst Components: Record>> = {\n [OptionType.STRING]: SettingTextComponent,\n [OptionType.NUMBER]: SettingNumericComponent,\n [OptionType.BIGINT]: SettingNumericComponent,\n [OptionType.BOOLEAN]: SettingBooleanComponent,\n [OptionType.SELECT]: SettingSelectComponent,\n [OptionType.SLIDER]: SettingSliderComponent,\n [OptionType.COMPONENT]: SettingCustomComponent\n};\n\nexport default function PluginModal({ plugin, onRestartNeeded, onClose, transitionState }: PluginModalProps) {\n const [authors, setAuthors] = React.useState[]>([]);\n\n const pluginSettings = useSettings().plugins[plugin.name];\n\n const [tempSettings, setTempSettings] = React.useState>({});\n\n const [errors, setErrors] = React.useState>({});\n const [saveError, setSaveError] = React.useState(null);\n\n const canSubmit = () => Object.values(errors).every(e => !e);\n\n const hasSettings = Boolean(pluginSettings && plugin.options && !isObjectEmpty(plugin.options));\n\n React.useEffect(() => {\n (async () => {\n for (const user of plugin.authors.slice(0, 6)) {\n const author = user.id\n ? await UserUtils.getUser(`${user.id}`)\n .catch(() => makeDummyUser({ username: user.name }))\n : makeDummyUser({ username: user.name });\n\n setAuthors(a => [...a, author]);\n }\n })();\n }, []);\n\n async function saveAndClose() {\n if (!plugin.options) {\n onClose();\n return;\n }\n\n if (plugin.beforeSave) {\n const result = await Promise.resolve(plugin.beforeSave(tempSettings));\n if (result !== true) {\n setSaveError(result);\n return;\n }\n }\n\n let restartNeeded = false;\n for (const [key, value] of Object.entries(tempSettings)) {\n const option = plugin.options[key];\n pluginSettings[key] = value;\n option?.onChange?.(value);\n if (option?.restartNeeded) restartNeeded = true;\n }\n if (restartNeeded) onRestartNeeded();\n onClose();\n }\n\n function renderSettings() {\n if (!hasSettings || !plugin.options) {\n return There are no settings for this plugin.;\n } else {\n const options = Object.entries(plugin.options).map(([key, setting]) => {\n if (setting.hidden) return null;\n\n function onChange(newValue: any) {\n setTempSettings(s => ({ ...s, [key]: newValue }));\n }\n\n function onError(hasError: boolean) {\n setErrors(e => ({ ...e, [key]: hasError }));\n }\n\n const Component = Components[setting.type];\n return (\n \n );\n });\n\n return {options};\n }\n }\n\n function renderMoreUsers(_label: string, count: number) {\n const sliceCount = plugin.authors.length - count;\n const sliceStart = plugin.authors.length - sliceCount;\n const sliceEnd = sliceStart + plugin.authors.length - count;\n\n return (\n u.name).join(\", \")}>\n {({ onMouseEnter, onMouseLeave }) => (\n \n +{sliceCount}\n
\n )}\n \n );\n }\n\n return (\n \n \n {plugin.name}\n \n \n \n \n About {plugin.name}\n {plugin.description}\n Authors\n
\n (\n openContributorModal(user)}\n >\n \n \n )}\n />\n
\n
\n {!!plugin.settingsAboutComponent && (\n
\n \n \n \n \n \n
\n )}\n \n Settings\n {renderSettings()}\n \n
\n {hasSettings && \n \n \n \n Cancel\n \n \n {({ onMouseEnter, onMouseLeave }) => (\n \n Save & Close\n \n )}\n \n \n {saveError && Error while saving: {saveError}}\n \n }\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./Switch.css\";\n\nimport { classes } from \"@utils/misc\";\nimport { findByPropsLazy } from \"@webpack\";\n\ninterface SwitchProps {\n checked: boolean;\n onChange: (checked: boolean) => void;\n disabled?: boolean;\n}\n\nconst SWITCH_ON = \"var(--green-360)\";\nconst SWITCH_OFF = \"var(--primary-400)\";\nconst SwitchClasses = findByPropsLazy(\"slider\", \"input\", \"container\");\n\nexport function Switch({ checked, onChange, disabled }: SwitchProps) {\n return (\n
\n
\n \n \n \n {checked ? (\n <>\n \n \n \n ) : (\n <>\n \n \n \n )}\n\n \n \n onChange(e.currentTarget.checked)}\n />\n
\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./addonCard.css\";\n\nimport { classNameFactory } from \"@api/Styles\";\nimport { Badge } from \"@components/Badge\";\nimport { Switch } from \"@components/Switch\";\nimport { Text } from \"@webpack/common\";\nimport type { MouseEventHandler, ReactNode } from \"react\";\n\nconst cl = classNameFactory(\"vc-addon-\");\n\ninterface Props {\n name: ReactNode;\n description: ReactNode;\n enabled: boolean;\n setEnabled: (enabled: boolean) => void;\n disabled?: boolean;\n isNew?: boolean;\n onMouseEnter?: MouseEventHandler;\n onMouseLeave?: MouseEventHandler;\n\n infoButton?: ReactNode;\n footer?: ReactNode;\n author?: ReactNode;\n}\n\nexport function AddonCard({ disabled, isNew, name, infoButton, footer, author, enabled, setEnabled, description, onMouseEnter, onMouseLeave }: Props) {\n return (\n \n
\n
\n \n {name}{isNew && }\n \n {!!author && (\n \n {author}\n \n )}\n
\n\n {infoButton}\n\n \n
\n\n {description}\n\n {footer}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport class ChangeList{\n private set = new Set();\n\n public get changeCount() {\n return this.set.size;\n }\n\n public get hasChanges() {\n return this.changeCount > 0;\n }\n\n public handleChange(item: T) {\n if (!this.set.delete(item))\n this.set.add(item);\n }\n\n public add(item: T) {\n return this.set.add(item);\n }\n\n public remove(item: T) {\n return this.set.delete(item);\n }\n\n public getChanges() {\n return this.set.values();\n }\n\n public map(mapper: (v: T, idx: number, arr: T[]) => R): R[] {\n return [...this.getChanges()].map(mapper);\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { registerCommand, unregisterCommand } from \"@api/Commands\";\nimport { Settings } from \"@api/Settings\";\nimport { Logger } from \"@utils/Logger\";\nimport { Patch, Plugin, StartAt } from \"@utils/types\";\nimport { FluxDispatcher } from \"@webpack/common\";\nimport { FluxEvents } from \"@webpack/types\";\n\nimport Plugins from \"~plugins\";\n\nimport { traceFunction } from \"../debug/Tracer\";\n\nconst logger = new Logger(\"PluginManager\", \"#a6d189\");\n\nexport const PMLogger = logger;\nexport const plugins = Plugins;\nexport const patches = [] as Patch[];\n\nconst settings = Settings.plugins;\n\nexport function isPluginEnabled(p: string) {\n return (\n Plugins[p]?.required ||\n Plugins[p]?.isDependency ||\n settings[p]?.enabled\n ) ?? false;\n}\n\nconst pluginsValues = Object.values(Plugins);\n\n// First roundtrip to mark and force enable dependencies (only for enabled plugins)\n//\n// FIXME: might need to revisit this if there's ever nested (dependencies of dependencies) dependencies since this only\n// goes for the top level and their children, but for now this works okay with the current API plugins\nfor (const p of pluginsValues) if (settings[p.name]?.enabled) {\n p.dependencies?.forEach(d => {\n const dep = Plugins[d];\n if (dep) {\n settings[d].enabled = true;\n dep.isDependency = true;\n }\n else {\n const error = new Error(`Plugin ${p.name} has unresolved dependency ${d}`);\n if (IS_DEV)\n throw error;\n logger.warn(error);\n }\n });\n}\n\nfor (const p of pluginsValues) {\n if (p.settings) {\n p.settings.pluginName = p.name;\n p.options ??= {};\n for (const [name, def] of Object.entries(p.settings.def)) {\n const checks = p.settings.checks?.[name];\n p.options[name] = { ...def, ...checks };\n }\n }\n\n if (p.patches && isPluginEnabled(p.name)) {\n for (const patch of p.patches) {\n patch.plugin = p.name;\n if (!Array.isArray(patch.replacement))\n patch.replacement = [patch.replacement];\n patches.push(patch);\n }\n }\n}\n\nexport const startAllPlugins = traceFunction(\"startAllPlugins\", function startAllPlugins(target: StartAt) {\n logger.info(`Starting plugins (stage ${target})`);\n for (const name in Plugins)\n if (isPluginEnabled(name)) {\n const p = Plugins[name];\n\n const startAt = p.startAt ?? StartAt.WebpackReady;\n if (startAt !== target) continue;\n\n startPlugin(Plugins[name]);\n }\n});\n\nexport function startDependenciesRecursive(p: Plugin) {\n let restartNeeded = false;\n const failures: string[] = [];\n p.dependencies?.forEach(dep => {\n if (!Settings.plugins[dep].enabled) {\n startDependenciesRecursive(Plugins[dep]);\n // If the plugin has patches, don't start the plugin, just enable it.\n Settings.plugins[dep].enabled = true;\n if (Plugins[dep].patches) {\n logger.warn(`Enabling dependency ${dep} requires restart.`);\n restartNeeded = true;\n return;\n }\n const result = startPlugin(Plugins[dep]);\n if (!result) failures.push(dep);\n }\n });\n return { restartNeeded, failures };\n}\n\nexport const startPlugin = traceFunction(\"startPlugin\", function startPlugin(p: Plugin) {\n const { name, commands, flux } = p;\n\n if (p.start) {\n logger.info(\"Starting plugin\", name);\n if (p.started) {\n logger.warn(`${name} already started`);\n return false;\n }\n try {\n p.start();\n p.started = true;\n } catch (e) {\n logger.error(`Failed to start ${name}\\n`, e);\n return false;\n }\n }\n\n if (commands?.length) {\n logger.info(\"Registering commands of plugin\", name);\n for (const cmd of commands) {\n try {\n registerCommand(cmd, name);\n } catch (e) {\n logger.error(`Failed to register command ${cmd.name}\\n`, e);\n return false;\n }\n }\n }\n\n if (flux) {\n for (const event in flux) {\n FluxDispatcher.subscribe(event as FluxEvents, flux[event]);\n }\n }\n\n return true;\n}, p => `startPlugin ${p.name}`);\n\nexport const stopPlugin = traceFunction(\"stopPlugin\", function stopPlugin(p: Plugin) {\n const { name, commands, flux } = p;\n if (p.stop) {\n logger.info(\"Stopping plugin\", name);\n if (!p.started) {\n logger.warn(`${name} already stopped`);\n return false;\n }\n try {\n p.stop();\n p.started = false;\n } catch (e) {\n logger.error(`Failed to stop ${name}\\n`, e);\n return false;\n }\n }\n\n if (commands?.length) {\n logger.info(\"Unregistering commands of plugin\", name);\n for (const cmd of commands) {\n try {\n unregisterCommand(cmd.name);\n } catch (e) {\n logger.error(`Failed to unregister command ${cmd.name}\\n`, e);\n return false;\n }\n }\n }\n\n if (flux) {\n for (const event in flux) {\n FluxDispatcher.unsubscribe(event as FluxEvents, flux[event]);\n }\n }\n\n return true;\n}, p => `stopPlugin ${p.name}`);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport * as DataStore from \"@api/DataStore\";\nimport { showNotice } from \"@api/Notices\";\nimport { Settings, useSettings } from \"@api/Settings\";\nimport { classNameFactory } from \"@api/Styles\";\nimport { CogWheel, InfoIcon } from \"@components/Icons\";\nimport PluginModal from \"@components/PluginSettings/PluginModal\";\nimport { AddonCard } from \"@components/VencordSettings/AddonCard\";\nimport { SettingsTab } from \"@components/VencordSettings/shared\";\nimport { ChangeList } from \"@utils/ChangeList\";\nimport { Logger } from \"@utils/Logger\";\nimport { Margins } from \"@utils/margins\";\nimport { classes, isObjectEmpty } from \"@utils/misc\";\nimport { openModalLazy } from \"@utils/modal\";\nimport { useAwaiter } from \"@utils/react\";\nimport { Plugin } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { Alerts, Button, Card, Forms, lodash, Parser, React, Select, Text, TextInput, Toasts, Tooltip } from \"@webpack/common\";\n\nimport Plugins from \"~plugins\";\n\nimport { startDependenciesRecursive, startPlugin, stopPlugin } from \"../../plugins\";\n\n\nconst cl = classNameFactory(\"vc-plugins-\");\nconst logger = new Logger(\"PluginSettings\", \"#a6d189\");\n\nconst InputStyles = findByPropsLazy(\"inputDefault\", \"inputWrapper\");\nconst ButtonClasses = findByPropsLazy(\"button\", \"disabled\", \"enabled\");\n\n\nfunction showErrorToast(message: string) {\n Toasts.show({\n message,\n type: Toasts.Type.FAILURE,\n id: Toasts.genId(),\n options: {\n position: Toasts.Position.BOTTOM\n }\n });\n}\n\nfunction ReloadRequiredCard({ required }: { required: boolean; }) {\n return (\n \n {required ? (\n <>\n Restart required!\n \n Restart now to apply new plugins and their settings\n \n \n \n ) : (\n <>\n Plugin Management\n Press the cog wheel or info icon to get more info on a plugin\n Plugins with a cog wheel have settings you can modify!\n \n )}\n \n );\n}\n\ninterface PluginCardProps extends React.HTMLProps {\n plugin: Plugin;\n disabled: boolean;\n onRestartNeeded(name: string): void;\n isNew?: boolean;\n}\n\nexport function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, onMouseLeave, isNew }: PluginCardProps) {\n const settings = Settings.plugins[plugin.name];\n\n const isEnabled = () => settings.enabled ?? false;\n\n function openModal() {\n openModalLazy(async () => {\n return modalProps => {\n return onRestartNeeded(plugin.name)} />;\n };\n });\n }\n\n function toggleEnabled() {\n const wasEnabled = isEnabled();\n\n // If we're enabling a plugin, make sure all deps are enabled recursively.\n if (!wasEnabled) {\n const { restartNeeded, failures } = startDependenciesRecursive(plugin);\n if (failures.length) {\n logger.error(`Failed to start dependencies for ${plugin.name}: ${failures.join(\", \")}`);\n showNotice(\"Failed to start dependencies: \" + failures.join(\", \"), \"Close\", () => null);\n return;\n } else if (restartNeeded) {\n // If any dependencies have patches, don't start the plugin yet.\n settings.enabled = true;\n onRestartNeeded(plugin.name);\n return;\n }\n }\n\n // if the plugin has patches, dont use stopPlugin/startPlugin. Wait for restart to apply changes.\n if (plugin.patches?.length) {\n settings.enabled = !wasEnabled;\n onRestartNeeded(plugin.name);\n return;\n }\n\n // If the plugin is enabled, but hasn't been started, then we can just toggle it off.\n if (wasEnabled && !plugin.started) {\n settings.enabled = !wasEnabled;\n return;\n }\n\n const result = wasEnabled ? stopPlugin(plugin) : startPlugin(plugin);\n\n if (!result) {\n settings.enabled = false;\n\n const msg = `Error while ${wasEnabled ? \"stopping\" : \"starting\"} plugin ${plugin.name}`;\n logger.error(msg);\n showErrorToast(msg);\n return;\n }\n\n settings.enabled = !wasEnabled;\n }\n\n return (\n openModal()} className={classes(ButtonClasses.button, cl(\"info-button\"))}>\n {plugin.options && !isObjectEmpty(plugin.options)\n ? \n : }\n \n }\n />\n );\n}\n\nconst enum SearchStatus {\n ALL,\n ENABLED,\n DISABLED,\n NEW\n}\n\nexport default function PluginSettings() {\n const settings = useSettings();\n const changes = React.useMemo(() => new ChangeList(), []);\n\n React.useEffect(() => {\n return () => void (changes.hasChanges && Alerts.show({\n title: \"Restart required\",\n body: (\n <>\n

The following plugins require a restart:

\n
{changes.map((s, i) => (\n <>\n {i > 0 && \", \"}\n {Parser.parse(\"`\" + s + \"`\")}\n \n ))}
\n \n ),\n confirmText: \"Restart now\",\n cancelText: \"Later!\",\n onConfirm: () => location.reload()\n }));\n }, []);\n\n const depMap = React.useMemo(() => {\n const o = {} as Record;\n for (const plugin in Plugins) {\n const deps = Plugins[plugin].dependencies;\n if (deps) {\n for (const dep of deps) {\n o[dep] ??= [];\n o[dep].push(plugin);\n }\n }\n }\n return o;\n }, []);\n\n const sortedPlugins = React.useMemo(() => Object.values(Plugins)\n .sort((a, b) => a.name.localeCompare(b.name)), []);\n\n const [searchValue, setSearchValue] = React.useState({ value: \"\", status: SearchStatus.ALL });\n\n const onSearch = (query: string) => setSearchValue(prev => ({ ...prev, value: query }));\n const onStatusChange = (status: SearchStatus) => setSearchValue(prev => ({ ...prev, status }));\n\n const pluginFilter = (plugin: typeof Plugins[keyof typeof Plugins]) => {\n const enabled = settings.plugins[plugin.name]?.enabled;\n if (enabled && searchValue.status === SearchStatus.DISABLED) return false;\n if (!enabled && searchValue.status === SearchStatus.ENABLED) return false;\n if (searchValue.status === SearchStatus.NEW && !newPlugins?.includes(plugin.name)) return false;\n if (!searchValue.value.length) return true;\n\n const v = searchValue.value.toLowerCase();\n return (\n plugin.name.toLowerCase().includes(v) ||\n plugin.description.toLowerCase().includes(v) ||\n plugin.tags?.some(t => t.toLowerCase().includes(v))\n );\n };\n\n const [newPlugins] = useAwaiter(() => DataStore.get(\"Vencord_existingPlugins\").then((cachedPlugins: Record | undefined) => {\n const now = Date.now() / 1000;\n const existingTimestamps: Record = {};\n const sortedPluginNames = Object.values(sortedPlugins).map(plugin => plugin.name);\n\n const newPlugins: string[] = [];\n for (const { name: p } of sortedPlugins) {\n const time = existingTimestamps[p] = cachedPlugins?.[p] ?? now;\n if ((time + 60 * 60 * 24 * 2) > now) {\n newPlugins.push(p);\n }\n }\n DataStore.set(\"Vencord_existingPlugins\", existingTimestamps);\n\n return lodash.isEqual(newPlugins, sortedPluginNames) ? [] : newPlugins;\n }));\n\n type P = JSX.Element | JSX.Element[];\n let plugins: P, requiredPlugins: P;\n if (sortedPlugins?.length) {\n plugins = [];\n requiredPlugins = [];\n\n for (const p of sortedPlugins) {\n if (!p.options && p.name.endsWith(\"API\") && searchValue.value !== \"API\")\n continue;\n\n if (!pluginFilter(p)) continue;\n\n const isRequired = p.required || depMap[p.name]?.some(d => settings.plugins[d].enabled);\n\n if (isRequired) {\n const tooltipText = p.required\n ? \"This plugin is required for Vencord to function.\"\n : makeDependencyList(depMap[p.name]?.filter(d => settings.plugins[d].enabled));\n\n requiredPlugins.push(\n \n {({ onMouseLeave, onMouseEnter }) => (\n changes.handleChange(name)}\n disabled={true}\n plugin={p}\n />\n )}\n \n );\n } else {\n plugins.push(\n changes.handleChange(name)}\n disabled={false}\n plugin={p}\n isNew={newPlugins?.includes(p.name)}\n key={p.name}\n />\n );\n }\n\n }\n } else {\n plugins = requiredPlugins = No plugins meet search criteria.;\n }\n\n return (\n \n \n\n \n Filters\n \n\n
\n \n
\n v === searchValue.status}\n closeOnSelect={true}\n />\n
\n
\n\n Plugins\n\n
\n {plugins}\n
\n\n \n\n \n Required Plugins\n \n
\n {requiredPlugins}\n
\n
\n );\n}\n\nfunction makeDependencyList(deps: string[]) {\n return (\n \n This plugin is required by:\n {deps.map((dep: string) => {dep})}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport PluginSettings from \"@components/PluginSettings\";\n\nimport { wrapTab } from \"./shared\";\n\nexport default wrapTab(PluginSettings, \"Plugins\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { React } from \"@webpack/common\";\n\ninterface Props extends React.DetailedHTMLProps, HTMLAnchorElement> {\n disabled?: boolean;\n}\n\nexport function Link(props: React.PropsWithChildren) {\n if (props.disabled) {\n props.style ??= {};\n props.style.pointerEvents = \"none\";\n props[\"aria-disabled\"] = true;\n }\n return (\n \n {props.children}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { useSettings } from \"@api/Settings\";\nimport { classNameFactory } from \"@api/Styles\";\nimport { Flex } from \"@components/Flex\";\nimport { DeleteIcon } from \"@components/Icons\";\nimport { Link } from \"@components/Link\";\nimport { Margins } from \"@utils/margins\";\nimport { classes } from \"@utils/misc\";\nimport { showItemInFolder } from \"@utils/native\";\nimport { useAwaiter } from \"@utils/react\";\nimport { findByPropsLazy, findLazy } from \"@webpack\";\nimport { Button, Card, FluxDispatcher, Forms, React, showToast, TabBar, TextArea, useEffect, useRef, useState } from \"@webpack/common\";\nimport { UserThemeHeader } from \"main/themes\";\nimport type { ComponentType, Ref, SyntheticEvent } from \"react\";\n\nimport { AddonCard } from \"./AddonCard\";\nimport { SettingsTab, wrapTab } from \"./shared\";\n\ntype FileInput = ComponentType<{\n ref: Ref;\n onChange: (e: SyntheticEvent) => void;\n multiple?: boolean;\n filters?: { name?: string; extensions: string[]; }[];\n}>;\n\nconst InviteActions = findByPropsLazy(\"resolveInvite\");\nconst FileInput: FileInput = findLazy(m => m.prototype?.activateUploadDialogue && m.prototype.setRef);\nconst TextAreaProps = findLazy(m => typeof m.textarea === \"string\");\n\nconst cl = classNameFactory(\"vc-settings-theme-\");\n\nfunction Validator({ link }: { link: string; }) {\n const [res, err, pending] = useAwaiter(() => fetch(link).then(res => {\n if (res.status > 300) throw `${res.status} ${res.statusText}`;\n const contentType = res.headers.get(\"Content-Type\");\n if (!contentType?.startsWith(\"text/css\") && !contentType?.startsWith(\"text/plain\"))\n throw \"Not a CSS file. Remember to use the raw link!\";\n\n return \"Okay!\";\n }));\n\n const text = pending\n ? \"Checking...\"\n : err\n ? `Error: ${err instanceof Error ? err.message : String(err)}`\n : \"Valid!\";\n\n return {text};\n}\n\nfunction Validators({ themeLinks }: { themeLinks: string[]; }) {\n if (!themeLinks.length) return null;\n\n return (\n <>\n Validator\n This section will tell you whether your themes can successfully be loaded\n
\n {themeLinks.map(link => (\n \n \n {link}\n \n \n \n ))}\n
\n \n );\n}\n\ninterface ThemeCardProps {\n theme: UserThemeHeader;\n enabled: boolean;\n onChange: (enabled: boolean) => void;\n onDelete: () => void;\n}\n\nfunction ThemeCard({ theme, enabled, onChange, onDelete }: ThemeCardProps) {\n return (\n \n \n \n )\n }\n footer={\n \n {!!theme.website && Website}\n {!!(theme.website && theme.invite) && \" \u2022 \"}\n {!!theme.invite && (\n {\n e.preventDefault();\n const { invite } = await InviteActions.resolveInvite(theme.invite, \"Desktop Modal\");\n if (!invite) return showToast(\"Invalid or expired invite\");\n\n FluxDispatcher.dispatch({\n type: \"INVITE_MODAL_OPEN\",\n invite,\n code: theme.invite,\n context: \"APP\"\n });\n }}\n >\n Discord Server\n \n )}\n \n }\n />\n );\n}\n\nenum ThemeTab {\n LOCAL,\n ONLINE\n}\n\nfunction ThemesTab() {\n const settings = useSettings([\"themeLinks\", \"enabledThemes\"]);\n\n const fileInputRef = useRef(null);\n const [currentTab, setCurrentTab] = useState(ThemeTab.LOCAL);\n const [themeText, setThemeText] = useState(settings.themeLinks.join(\"\\n\"));\n const [userThemes, setUserThemes] = useState(null);\n const [themeDir, , themeDirPending] = useAwaiter(VencordNative.themes.getThemesDir);\n\n useEffect(() => {\n refreshLocalThemes();\n }, []);\n\n async function refreshLocalThemes() {\n const themes = await VencordNative.themes.getThemesList();\n setUserThemes(themes);\n }\n\n // When a local theme is enabled/disabled, update the settings\n function onLocalThemeChange(fileName: string, value: boolean) {\n if (value) {\n if (settings.enabledThemes.includes(fileName)) return;\n settings.enabledThemes = [...settings.enabledThemes, fileName];\n } else {\n settings.enabledThemes = settings.enabledThemes.filter(f => f !== fileName);\n }\n }\n\n async function onFileUpload(e: SyntheticEvent) {\n e.stopPropagation();\n e.preventDefault();\n if (!e.currentTarget?.files?.length) return;\n const { files } = e.currentTarget;\n\n const uploads = Array.from(files, file => {\n const { name } = file;\n if (!name.endsWith(\".css\")) return;\n\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n VencordNative.themes.uploadTheme(name, reader.result as string)\n .then(resolve)\n .catch(reject);\n };\n reader.readAsText(file);\n });\n });\n\n await Promise.all(uploads);\n refreshLocalThemes();\n }\n\n function renderLocalThemes() {\n return (\n <>\n \n Find Themes:\n
\n \n BetterDiscord Themes\n \n GitHub\n
\n If using the BD site, click on \"Download\" and place the downloaded .theme.css file into your themes folder.\n
\n\n \n \n <>\n {IS_WEB ?\n (\n \n Upload Theme\n \n \n ) : (\n showItemInFolder(themeDir!)}\n size={Button.Sizes.SMALL}\n disabled={themeDirPending}\n >\n Open Themes Folder\n \n )}\n \n Load missing Themes\n \n VencordNative.quickCss.openEditor()}\n size={Button.Sizes.SMALL}\n >\n Edit QuickCSS\n \n \n \n\n
\n {userThemes?.map(theme => (\n onLocalThemeChange(theme.fileName, enabled)}\n onDelete={async () => {\n onLocalThemeChange(theme.fileName, false);\n await VencordNative.themes.deleteTheme(theme.fileName);\n refreshLocalThemes();\n }}\n theme={theme}\n />\n ))}\n
\n
\n \n );\n }\n\n // When the user leaves the online theme textbox, update the settings\n function onBlur() {\n settings.themeLinks = [...new Set(\n themeText\n .trim()\n .split(/\\n+/)\n .map(s => s.trim())\n .filter(Boolean)\n )];\n }\n\n function renderOnlineThemes() {\n return (\n <>\n \n Paste links to css files here\n One link per line\n Make sure to use direct links to files (raw or github.io)!\n \n\n \n \n \n \n \n );\n }\n\n return (\n \n \n \n Local Themes\n \n \n Online Themes\n \n \n\n {currentTab === ThemeTab.LOCAL && renderLocalThemes()}\n {currentTab === ThemeTab.ONLINE && renderOnlineThemes()}\n \n );\n}\n\nexport default wrapTab(ThemesTab, \"Themes\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { useSettings } from \"@api/Settings\";\nimport { ErrorCard } from \"@components/ErrorCard\";\nimport { Flex } from \"@components/Flex\";\nimport { Link } from \"@components/Link\";\nimport { Margins } from \"@utils/margins\";\nimport { classes } from \"@utils/misc\";\nimport { relaunch } from \"@utils/native\";\nimport { useAwaiter } from \"@utils/react\";\nimport { changes, checkForUpdates, getRepo, isNewer, update, updateError, UpdateLogger } from \"@utils/updater\";\nimport { Alerts, Button, Card, Forms, Parser, React, Switch, Toasts } from \"@webpack/common\";\n\nimport gitHash from \"~git-hash\";\n\nimport { SettingsTab, wrapTab } from \"./shared\";\n\nfunction withDispatcher(dispatcher: React.Dispatch>, action: () => any) {\n return async () => {\n dispatcher(true);\n try {\n await action();\n } catch (e: any) {\n UpdateLogger.error(\"Failed to update\", e);\n if (!e) {\n var err = \"An unknown error occurred (error is undefined).\\nPlease try again.\";\n } else if (e.code && e.cmd) {\n const { code, path, cmd, stderr } = e;\n\n if (code === \"ENOENT\")\n var err = `Command \\`${path}\\` not found.\\nPlease install it and try again`;\n else {\n var err = `An error occurred while running \\`${cmd}\\`:\\n`;\n err += stderr || `Code \\`${code}\\`. See the console for more info`;\n }\n\n } else {\n var err = \"An unknown error occurred. See the console for more info.\";\n }\n Alerts.show({\n title: \"Oops!\",\n body: (\n \n {err.split(\"\\n\").map(line =>
{Parser.parse(line)}
)}\n
\n )\n });\n }\n finally {\n dispatcher(false);\n }\n };\n}\n\ninterface CommonProps {\n repo: string;\n repoPending: boolean;\n}\n\nfunction HashLink({ repo, hash, disabled = false }: { repo: string, hash: string, disabled?: boolean; }) {\n return \n {hash}\n ;\n}\n\nfunction Changes({ updates, repo, repoPending }: CommonProps & { updates: typeof changes; }) {\n return (\n \n {updates.map(({ hash, author, message }) => (\n
\n \n {message} - {author}\n
\n ))}\n
\n );\n}\n\nfunction Updatable(props: CommonProps) {\n const [updates, setUpdates] = React.useState(changes);\n const [isChecking, setIsChecking] = React.useState(false);\n const [isUpdating, setIsUpdating] = React.useState(false);\n\n const isOutdated = (updates?.length ?? 0) > 0;\n\n return (\n <>\n {!updates && updateError ? (\n <>\n Failed to check updates. Check the console for more info\n \n

{updateError.stderr || updateError.stdout || \"An unknown error occurred\"}

\n
\n \n ) : (\n \n {isOutdated ? `There are ${updates.length} Updates` : \"Up to Date!\"}\n \n )}\n\n {isOutdated && }\n\n \n {isOutdated && {\n if (await update()) {\n setUpdates([]);\n await new Promise(r => {\n Alerts.show({\n title: \"Update Success!\",\n body: \"Successfully updated. Restart now to apply the changes?\",\n confirmText: \"Restart\",\n cancelText: \"Not now!\",\n onConfirm() {\n relaunch();\n r();\n },\n onCancel: r\n });\n });\n }\n })}\n >\n Update Now\n }\n {\n const outdated = await checkForUpdates();\n if (outdated) {\n setUpdates(changes);\n } else {\n setUpdates([]);\n Toasts.show({\n message: \"No updates found!\",\n id: Toasts.genId(),\n type: Toasts.Type.MESSAGE,\n options: {\n position: Toasts.Position.BOTTOM\n }\n });\n }\n })}\n >\n Check for Updates\n \n \n \n );\n}\n\nfunction Newer(props: CommonProps) {\n return (\n <>\n \n Your local copy has more recent commits. Please stash or reset them.\n \n \n \n );\n}\n\nfunction Updater() {\n const settings = useSettings([\"notifyAboutUpdates\", \"autoUpdate\", \"autoUpdateNotification\"]);\n\n const [repo, err, repoPending] = useAwaiter(getRepo, { fallbackValue: \"Loading...\" });\n\n React.useEffect(() => {\n if (err)\n UpdateLogger.error(\"Failed to retrieve repo\", err);\n }, [err]);\n\n const commonProps: CommonProps = {\n repo,\n repoPending\n };\n\n return (\n \n Updater Settings\n settings.notifyAboutUpdates = v}\n note=\"Shows a notification on startup\"\n disabled={settings.autoUpdate}\n >\n Get notified about new updates\n \n settings.autoUpdate = v}\n note=\"Automatically update Vencord without confirmation prompt\"\n >\n Automatically update\n \n settings.autoUpdateNotification = v}\n note=\"Shows a notification when Vencord automatically updates\"\n disabled={!settings.autoUpdate}\n >\n Get notified when an automatic update completes\n \n\n Repo\n\n \n {repoPending\n ? repo\n : err\n ? \"Failed to retrieve - check console\"\n : (\n \n {repo.split(\"/\").slice(-2).join(\"/\")}\n \n )\n }\n {\" \"}()\n \n\n \n\n Updates\n\n {isNewer ? : }\n \n );\n}\n\nexport default IS_UPDATER_DISABLED ? null : wrapTab(Updater, \"Updater\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { React, TextInput } from \"@webpack/common\";\n\n// TODO: Refactor settings to use this as well\ninterface TextInputProps {\n /**\n * WARNING: Changing this between renders will have no effect!\n */\n value: string;\n /**\n * This will only be called if the new value passed validate()\n */\n onChange(newValue: string): void;\n /**\n * Optionally validate the user input\n * Return true if the input is valid\n * Otherwise, return a string containing the reason for this input being invalid\n */\n validate(v: string): true | string;\n}\n\n/**\n * A very simple wrapper around Discord's TextInput that validates input and shows\n * the user an error message and only calls your onChange when the input is valid\n */\nexport function CheckedTextInput({ value: initialValue, onChange, validate }: TextInputProps) {\n const [value, setValue] = React.useState(initialValue);\n const [error, setError] = React.useState();\n\n function handleChange(v: string) {\n setValue(v);\n const res = validate(v);\n if (res === true) {\n setError(void 0);\n onChange(v);\n } else {\n setError(res);\n }\n }\n\n return (\n <>\n \n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { showNotification } from \"@api/Notifications\";\nimport { Settings, useSettings } from \"@api/Settings\";\nimport { CheckedTextInput } from \"@components/CheckedTextInput\";\nimport { Link } from \"@components/Link\";\nimport { authorizeCloud, cloudLogger, deauthorizeCloud, getCloudAuth, getCloudUrl } from \"@utils/cloud\";\nimport { Margins } from \"@utils/margins\";\nimport { deleteCloudSettings, getCloudSettings, putCloudSettings } from \"@utils/settingsSync\";\nimport { Alerts, Button, Forms, Switch, Tooltip } from \"@webpack/common\";\n\nimport { SettingsTab, wrapTab } from \"./shared\";\n\nfunction validateUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return \"Invalid URL\";\n }\n}\n\nasync function eraseAllData() {\n const res = await fetch(new URL(\"/v1/\", getCloudUrl()), {\n method: \"DELETE\",\n headers: new Headers({\n Authorization: await getCloudAuth()\n })\n });\n\n if (!res.ok) {\n cloudLogger.error(`Failed to erase data, API returned ${res.status}`);\n showNotification({\n title: \"Cloud Integrations\",\n body: `Could not erase all data (API returned ${res.status}), please contact support.`,\n color: \"var(--red-360)\"\n });\n return;\n }\n\n Settings.cloud.authenticated = false;\n await deauthorizeCloud();\n\n showNotification({\n title: \"Cloud Integrations\",\n body: \"Successfully erased all data.\",\n color: \"var(--green-360)\"\n });\n}\n\nfunction SettingsSyncSection() {\n const { cloud } = useSettings([\"cloud.authenticated\", \"cloud.settingsSync\"]);\n const sectionEnabled = cloud.authenticated && cloud.settingsSync;\n\n return (\n \n \n Synchronize your settings to the cloud. This allows easy synchronization across multiple devices with\n minimal effort.\n \n { cloud.settingsSync = v; }}\n >\n Settings Sync\n \n
\n putCloudSettings(true)}\n >Sync to Cloud\n \n {({ onMouseLeave, onMouseEnter }) => (\n getCloudSettings(true, true)}\n >Sync from Cloud\n )}\n \n deleteCloudSettings()}\n >Delete Cloud Settings\n
\n
\n );\n}\n\nfunction CloudTab() {\n const settings = useSettings([\"cloud.authenticated\", \"cloud.url\"]);\n\n return (\n \n \n \n Vencord comes with a cloud integration that adds goodies like settings sync across devices.\n It respects your privacy, and\n the source code is AGPL 3.0 licensed so you\n can host it yourself.\n \n { v && authorizeCloud(); if (!v) settings.cloud.authenticated = v; }}\n note=\"This will request authorization if you have not yet set up cloud integrations.\"\n >\n Enable Cloud Integrations\n \n Backend URL\n \n Which backend to use when using cloud integrations.\n \n { settings.cloud.url = v; settings.cloud.authenticated = false; deauthorizeCloud(); }}\n validate={validateUrl}\n />\n Alerts.show({\n title: \"Are you sure?\",\n body: \"Once your data is erased, we cannot recover it. There's no going back!\",\n onConfirm: eraseAllData,\n confirmText: \"Erase it!\",\n confirmColor: \"vc-cloud-erase-data-danger-btn\",\n cancelText: \"Nevermind\"\n })}\n >Erase All Data\n \n \n \n \n );\n}\n\nexport default wrapTab(CloudTab, \"Cloud\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Flex } from \"@components/Flex\";\nimport { Margins } from \"@utils/margins\";\nimport { classes } from \"@utils/misc\";\nimport { downloadSettingsBackup, uploadSettingsBackup } from \"@utils/settingsSync\";\nimport { Button, Card, Text } from \"@webpack/common\";\n\nimport { SettingsTab, wrapTab } from \"./shared\";\n\nfunction BackupRestoreTab() {\n return (\n \n \n \n Warning\n Importing a settings file will overwrite your current settings.\n \n \n \n You can import and export your Vencord settings as a JSON file.\n This allows you to easily transfer your settings to another device,\n or recover your settings after reinstalling Vencord or Discord.\n \n \n Settings Export contains:\n
    \n
  • — Custom QuickCSS
  • \n
  • — Theme Links
  • \n
  • — Plugin Settings
  • \n
\n
\n \n uploadSettingsBackup()}\n size={Button.Sizes.SMALL}\n >\n Import Settings\n \n \n Export Settings\n \n \n
\n );\n}\n\nexport default wrapTab(BackupRestoreTab, \"Backup & Restore\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and Megumin\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch } from \"@api/ContextMenu\";\nimport { Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { React, SettingsRouter } from \"@webpack/common\";\n\nimport gitHash from \"~git-hash\";\n\nexport default definePlugin({\n name: \"Settings\",\n description: \"Adds Settings UI and debug info\",\n authors: [Devs.Ven, Devs.Megu],\n required: true,\n\n start() {\n // The settings shortcuts in the user settings cog context menu\n // read the elements from a hardcoded map which for obvious reason\n // doesn't contain our sections. This patches the actions of our\n // sections to manually use SettingsRouter (which only works on desktop\n // but the context menu is usually not available on mobile anyway)\n addContextMenuPatch(\"user-settings-cog\", children => () => {\n const section = children.find(c => Array.isArray(c) && c.some(it => it?.props?.id === \"VencordSettings\")) as any;\n section?.forEach(c => {\n const id = c?.props?.id;\n if (id?.startsWith(\"Vencord\") || id?.startsWith(\"Vesktop\")) {\n c.props.action = () => SettingsRouter.open(id);\n }\n });\n });\n },\n\n patches: [{\n find: \".versionHash\",\n replacement: [\n {\n match: /\\[\\(0,.{1,3}\\.jsxs?\\)\\((.{1,10}),(\\{[^{}}]+\\{.{0,20}.versionHash,.+?\\})\\),\" \"/,\n replace: (m, component, props) => {\n props = props.replace(/children:\\[.+\\]/, \"\");\n return `${m},Vencord.Plugins.plugins.Settings.makeInfoElements(${component}, ${props})`;\n }\n }\n ]\n }, {\n find: \"Messages.ACTIVITY_SETTINGS\",\n replacement: {\n get match() {\n switch (Settings.plugins.Settings.settingsLocation) {\n case \"top\": return /\\{section:(\\i\\.\\i)\\.HEADER,\\s*label:(\\i)\\.\\i\\.Messages\\.USER_SETTINGS\\}/;\n case \"aboveNitro\": return /\\{section:(\\i\\.\\i)\\.HEADER,\\s*label:(\\i)\\.\\i\\.Messages\\.BILLING_SETTINGS\\}/;\n case \"belowNitro\": return /\\{section:(\\i\\.\\i)\\.HEADER,\\s*label:(\\i)\\.\\i\\.Messages\\.APP_SETTINGS\\}/;\n case \"belowActivity\": return /(?<=\\{section:(\\i\\.\\i)\\.DIVIDER},)\\{section:\"changelog\"/;\n case \"bottom\": return /\\{section:(\\i\\.\\i)\\.CUSTOM,\\s*element:.+?}/;\n case \"aboveActivity\":\n default:\n return /\\{section:(\\i\\.\\i)\\.HEADER,\\s*label:(\\i)\\.\\i\\.Messages\\.ACTIVITY_SETTINGS\\}/;\n }\n },\n replace: \"...$self.makeSettingsCategories($1),$&\"\n }\n }],\n\n customSections: [] as ((SectionTypes: Record) => any)[],\n\n makeSettingsCategories(SectionTypes: Record) {\n return [\n {\n section: SectionTypes.HEADER,\n label: \"Vencord\",\n className: \"vc-settings-header\"\n },\n {\n section: \"VencordSettings\",\n label: \"Vencord\",\n element: require(\"@components/VencordSettings/VencordTab\").default,\n className: \"vc-settings\"\n },\n {\n section: \"VencordPlugins\",\n label: \"Plugins\",\n element: require(\"@components/VencordSettings/PluginsTab\").default,\n className: \"vc-plugins\"\n },\n {\n section: \"VencordThemes\",\n label: \"Themes\",\n element: require(\"@components/VencordSettings/ThemesTab\").default,\n className: \"vc-themes\"\n },\n !IS_UPDATER_DISABLED && {\n section: \"VencordUpdater\",\n label: \"Updater\",\n element: require(\"@components/VencordSettings/UpdaterTab\").default,\n className: \"vc-updater\"\n },\n {\n section: \"VencordCloud\",\n label: \"Cloud\",\n element: require(\"@components/VencordSettings/CloudTab\").default,\n className: \"vc-cloud\"\n },\n {\n section: \"VencordSettingsSync\",\n label: \"Backup & Restore\",\n element: require(\"@components/VencordSettings/BackupAndRestoreTab\").default,\n className: \"vc-backup-restore\"\n },\n IS_DEV && {\n section: \"VencordPatchHelper\",\n label: \"Patch Helper\",\n element: require(\"@components/VencordSettings/PatchHelperTab\").default,\n className: \"vc-patch-helper\"\n },\n ...this.customSections.map(func => func(SectionTypes)),\n {\n section: SectionTypes.DIVIDER\n }\n ].filter(Boolean);\n },\n\n options: {\n settingsLocation: {\n type: OptionType.SELECT,\n description: \"Where to put the Vencord settings section\",\n options: [\n { label: \"At the very top\", value: \"top\" },\n { label: \"Above the Nitro section\", value: \"aboveNitro\" },\n { label: \"Below the Nitro section\", value: \"belowNitro\" },\n { label: \"Above Activity Settings\", value: \"aboveActivity\", default: true },\n { label: \"Below Activity Settings\", value: \"belowActivity\" },\n { label: \"At the very bottom\", value: \"bottom\" },\n ],\n restartNeeded: true\n },\n },\n\n get electronVersion() {\n return VencordNative.native.getVersions().electron || window.armcord?.electron || null;\n },\n\n get chromiumVersion() {\n try {\n return VencordNative.native.getVersions().chrome\n // @ts-ignore Typescript will add userAgentData IMMEDIATELY\n || navigator.userAgentData?.brands?.find(b => b.brand === \"Chromium\" || b.brand === \"Google Chrome\")?.version\n || null;\n } catch { // inb4 some stupid browser throws unsupported error for navigator.userAgentData, it's only in chromium\n return null;\n }\n },\n\n get additionalInfo() {\n if (IS_DEV) return \" (Dev)\";\n if (IS_WEB) return \" (Web)\";\n if (IS_VESKTOP) return ` (Vesktop v${VesktopNative.app.getVersion()})`;\n if (IS_STANDALONE) return \" (Standalone)\";\n return \"\";\n },\n\n makeInfoElements(Component: React.ComponentType, props: React.PropsWithChildren) {\n const { electronVersion, chromiumVersion, additionalInfo } = this;\n\n return (\n <>\n Vencord {gitHash}{additionalInfo}\n {electronVersion && Electron {electronVersion}}\n {chromiumVersion && Chromium {chromiumVersion}}\n \n );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { DataStore } from \"@api/index\";\nimport { Devs, SUPPORT_CHANNEL_ID } from \"@utils/constants\";\nimport { isPluginDev } from \"@utils/misc\";\nimport { makeCodeblock } from \"@utils/text\";\nimport definePlugin from \"@utils/types\";\nimport { isOutdated } from \"@utils/updater\";\nimport { Alerts, Forms, UserStore } from \"@webpack/common\";\n\nimport gitHash from \"~git-hash\";\nimport plugins from \"~plugins\";\n\nimport settings from \"./settings\";\n\nconst REMEMBER_DISMISS_KEY = \"Vencord-SupportHelper-Dismiss\";\n\nconst AllowedChannelIds = [\n SUPPORT_CHANNEL_ID,\n \"1024286218801926184\", // Vencord > #bot-spam\n \"1033680203433660458\", // Vencord > #v\n];\n\nexport default definePlugin({\n name: \"SupportHelper\",\n required: true,\n description: \"Helps us provide support to you\",\n authors: [Devs.Ven],\n dependencies: [\"CommandsAPI\"],\n\n commands: [{\n name: \"vencord-debug\",\n description: \"Send Vencord Debug info\",\n predicate: ctx => AllowedChannelIds.includes(ctx.channel.id),\n async execute() {\n const { RELEASE_CHANNEL } = window.GLOBAL_ENV;\n\n const client = (() => {\n if (IS_DISCORD_DESKTOP) return `Discord Desktop v${DiscordNative.app.getVersion()}`;\n if (IS_VESKTOP) return `Vesktop v${VesktopNative.app.getVersion()}`;\n if (\"armcord\" in window) return `ArmCord v${window.armcord.version}`;\n\n // @ts-expect-error\n const name = typeof unsafeWindow !== \"undefined\" ? \"UserScript\" : \"Web\";\n return `${name} (${navigator.userAgent})`;\n })();\n\n const isApiPlugin = (plugin: string) => plugin.endsWith(\"API\") || plugins[plugin].required;\n\n const enabledPlugins = Object.keys(plugins).filter(p => Vencord.Plugins.isPluginEnabled(p) && !isApiPlugin(p));\n const enabledApiPlugins = Object.keys(plugins).filter(p => Vencord.Plugins.isPluginEnabled(p) && isApiPlugin(p));\n\n const info = {\n Vencord: `v${VERSION} \u2022 ${gitHash}${settings.additionalInfo} - ${Intl.DateTimeFormat(\"en-GB\", { dateStyle: \"medium\" }).format(BUILD_TIMESTAMP)}`,\n \"Discord Branch\": RELEASE_CHANNEL,\n Client: client,\n Platform: window.navigator.platform,\n Outdated: isOutdated,\n OpenAsar: \"openasar\" in window,\n };\n\n if (IS_DISCORD_DESKTOP) {\n info[\"Last Crash Reason\"] = (await DiscordNative.processUtils.getLastCrash())?.rendererCrashReason ?? \"N/A\";\n }\n\n const debugInfo = `\n**Vencord Debug Info**\n>>> ${Object.entries(info).map(([k, v]) => `${k}: ${v}`).join(\"\\n\")}\n\nEnabled Plugins (${enabledPlugins.length + enabledApiPlugins.length}):\n${makeCodeblock(enabledPlugins.join(\", \") + \"\\n\\n\" + enabledApiPlugins.join(\", \"))}\n`;\n\n return {\n content: debugInfo.trim().replaceAll(\"```\\n\", \"```\")\n };\n }\n }],\n\n flux: {\n async CHANNEL_SELECT({ channelId }) {\n if (channelId !== SUPPORT_CHANNEL_ID) return;\n\n if (isPluginDev(UserStore.getCurrentUser().id)) return;\n\n if (isOutdated && gitHash !== await DataStore.get(REMEMBER_DISMISS_KEY)) {\n const rememberDismiss = () => DataStore.set(REMEMBER_DISMISS_KEY, gitHash);\n\n Alerts.show({\n title: \"Hold on!\",\n body:
\n You are using an outdated version of Vencord! Chances are, your issue is already fixed.\n \n Please first update using the Updater Page in Settings, or use the VencordInstaller (Update Vencord Button)\n to do so, in case you can't access the Updater page.\n \n
,\n onCancel: rememberDismiss,\n onConfirm: rememberDismiss\n });\n }\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"AlwaysAnimate\",\n description: \"Animates anything that can be animated\",\n authors: [Devs.FieryFlames],\n\n patches: [\n {\n find: \"canAnimate:\",\n all: true,\n // Some modules match the find but the replacement is returned untouched\n noWarn: true,\n replacement: {\n match: /canAnimate:.+?(?=([,}].*?\\)))/g,\n replace: (m, rest) => {\n const destructuringMatch = rest.match(/}=.+/);\n if (destructuringMatch == null) return \"canAnimate:!0\";\n return m;\n }\n }\n },\n {\n // Status emojis\n find: \".Messages.GUILD_OWNER,\",\n replacement: {\n match: /(?<=\\.activityEmoji,.+?animate:)\\i/,\n replace: \"!0\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"AlwaysTrust\",\n description: \"Removes the annoying untrusted domain and suspicious file popup\",\n authors: [Devs.zt],\n patches: [\n {\n find: \".displayName=\\\"MaskedLinkStore\\\"\",\n replacement: {\n match: /(?<=isTrustedDomain\\(\\i\\){)return \\i\\(\\i\\)/,\n replace: \"return true\"\n }\n },\n {\n find: \"isSuspiciousDownload:\",\n replacement: {\n match: /function \\i\\(\\i\\){(?=.{0,60}\\.parse\\(\\i\\))/,\n replace: \"$&return null;\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nconst enum Methods {\n Random,\n Consistent,\n Timestamp,\n}\n\nconst tarExtMatcher = /\\.tar\\.\\w+$/;\n\nexport default definePlugin({\n name: \"AnonymiseFileNames\",\n authors: [Devs.obscurity],\n description: \"Anonymise uploaded file names\",\n patches: [\n {\n find: \"instantBatchUpload:function\",\n replacement: {\n match: /uploadFiles:(.{1,2}),/,\n replace:\n \"uploadFiles:(...args)=>(args[0].uploads.forEach(f=>f.filename=$self.anonymise(f.filename)),$1(...args)),\",\n },\n },\n ],\n\n options: {\n method: {\n description: \"Anonymising method\",\n type: OptionType.SELECT,\n options: [\n { label: \"Random Characters\", value: Methods.Random, default: true },\n { label: \"Consistent\", value: Methods.Consistent },\n { label: \"Timestamp (4chan-like)\", value: Methods.Timestamp },\n ],\n },\n randomisedLength: {\n description: \"Random characters length\",\n type: OptionType.NUMBER,\n default: 7,\n disabled: () => Settings.plugins.AnonymiseFileNames.method !== Methods.Random,\n },\n consistent: {\n description: \"Consistent filename\",\n type: OptionType.STRING,\n default: \"image\",\n disabled: () => Settings.plugins.AnonymiseFileNames.method !== Methods.Consistent,\n },\n },\n\n anonymise(file: string) {\n let name = \"image\";\n const tarMatch = tarExtMatcher.exec(file);\n const extIdx = tarMatch?.index ?? file.lastIndexOf(\".\");\n const ext = extIdx !== -1 ? file.slice(extIdx) : \"\";\n\n switch (Settings.plugins.AnonymiseFileNames.method) {\n case Methods.Random:\n const chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n name = Array.from(\n { length: Settings.plugins.AnonymiseFileNames.randomisedLength },\n () => chars[Math.floor(Math.random() * chars.length)]\n ).join(\"\");\n break;\n case Methods.Consistent:\n name = Settings.plugins.AnonymiseFileNames.consistent;\n break;\n case Methods.Timestamp:\n // UNIX timestamp in nanos, i could not find a better dependency-less way\n name = `${Math.floor(Date.now() / 1000)}${Math.floor(window.performance.now())}`;\n break;\n }\n return name + ext;\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 OpenAsar\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { popNotice, showNotice } from \"@api/Notices\";\nimport { Link } from \"@components/Link\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ApplicationAssetUtils, FluxDispatcher, Forms, Toasts } from \"@webpack/common\";\n\nconst RpcUtils = findByPropsLazy(\"fetchApplicationsRPC\", \"getRemoteIconURL\");\n\nasync function lookupAsset(applicationId: string, key: string): Promise {\n return (await ApplicationAssetUtils.fetchAssetIds(applicationId, [key]))[0];\n}\n\nconst apps: any = {};\nasync function lookupApp(applicationId: string): Promise {\n const socket: any = {};\n await RpcUtils.fetchApplicationsRPC(socket, applicationId);\n return socket.application;\n}\n\nlet ws: WebSocket;\nexport default definePlugin({\n name: \"WebRichPresence (arRPC)\",\n description: \"Client plugin for arRPC to enable RPC on Discord Web (experimental)\",\n authors: [Devs.Ducko],\n\n settingsAboutComponent: () => (\n <>\n How to use arRPC\n \n Follow the instructions in the GitHub repo to get the server running, and then enable the plugin.\n \n \n ),\n\n async handleEvent(e: MessageEvent) {\n const data = JSON.parse(e.data);\n\n const { activity } = data;\n const assets = activity?.assets;\n\n if (assets?.large_image) assets.large_image = await lookupAsset(activity.application_id, assets.large_image);\n if (assets?.small_image) assets.small_image = await lookupAsset(activity.application_id, assets.small_image);\n\n if (activity) {\n const appId = activity.application_id;\n apps[appId] ||= await lookupApp(appId);\n\n const app = apps[appId];\n activity.name ||= app.name;\n }\n\n FluxDispatcher.dispatch({ type: \"LOCAL_ACTIVITY_UPDATE\", ...data });\n },\n\n async start() {\n // ArmCord comes with its own arRPC implementation, so this plugin just confuses users\n if (\"armcord\" in window) return;\n\n if (ws) ws.close();\n ws = new WebSocket(\"ws://127.0.0.1:1337\"); // try to open WebSocket\n\n ws.onmessage = this.handleEvent;\n\n const connectionSuccessful = await new Promise(res => setTimeout(() => res(ws.readyState === WebSocket.OPEN), 1000)); // check if open after 1s\n if (!connectionSuccessful) {\n showNotice(\"Failed to connect to arRPC, is it running?\", \"Retry\", () => { // show notice about failure to connect, with retry/ignore\n popNotice();\n this.start();\n });\n return;\n }\n\n Toasts.show({ // show toast on success\n message: \"Connected to arRPC\",\n type: Toasts.Type.SUCCESS,\n id: Toasts.genId(),\n options: {\n duration: 1000,\n position: Toasts.Position.BOTTOM\n }\n });\n },\n\n stop() {\n FluxDispatcher.dispatch({ type: \"LOCAL_ACTIVITY_UPDATE\", activity: null }); // clear status\n ws?.close(); // close WebSocket\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nexport default definePlugin({\n name: \"BANger\",\n description: \"Replaces the GIF in the ban dialogue with a custom one.\",\n authors: [Devs.Xinto, Devs.Glitch],\n patches: [\n {\n find: \"BAN_CONFIRM_TITLE.\",\n replacement: {\n match: /src:\\i\\(\"\\d+\"\\)/g,\n replace: \"src: Vencord.Settings.plugins.BANger.source\"\n }\n }\n ],\n options: {\n source: {\n description: \"Source to replace ban GIF with (Video or Gif)\",\n type: OptionType.STRING,\n default: \"https://i.imgur.com/wp5q52C.mp4\",\n restartNeeded: true,\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { findByPropsLazy, findComponentByCodeLazy, findStoreLazy } from \"@webpack\";\nimport { useStateFromStores } from \"@webpack/common\";\nimport type { CSSProperties } from \"react\";\n\nimport { ExpandedGuildFolderStore, settings } from \".\";\n\nconst ChannelRTCStore = findStoreLazy(\"ChannelRTCStore\");\nconst Animations = findByPropsLazy(\"a\", \"animated\", \"useTransition\");\nconst GuildsBar = findComponentByCodeLazy('(\"guildsnav\")');\n\nexport default ErrorBoundary.wrap(guildsBarProps => {\n const expandedFolders = useStateFromStores([ExpandedGuildFolderStore], () => ExpandedGuildFolderStore.getExpandedFolders());\n const isFullscreen = useStateFromStores([ChannelRTCStore], () => ChannelRTCStore.isFullscreenInContext());\n\n const Sidebar = (\n \n );\n\n const visible = !!expandedFolders.size;\n const guilds = document.querySelector(guildsBarProps.className.split(\" \").map(c => `.${c}`).join(\"\"));\n\n // We need to display none if we are in fullscreen. Yes this seems horrible doing with css, but it's literally how Discord does it.\n // Also display flex otherwise to fix scrolling\n const barStyle = {\n display: isFullscreen ? \"none\" : \"flex\",\n } as CSSProperties;\n\n if (!guilds || !settings.store.sidebarAnim) {\n return visible\n ?
{Sidebar}
\n : null;\n }\n\n return (\n \n {(animationStyle, show) =>\n show && (\n \n {Sidebar}\n \n )\n }\n \n );\n}, { noop: true });\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy, findStoreLazy } from \"@webpack\";\nimport { FluxDispatcher, i18n } from \"@webpack/common\";\n\nimport FolderSideBar from \"./FolderSideBar\";\n\nenum FolderIconDisplay {\n Never,\n Always,\n MoreThanOneFolderExpanded\n}\n\nconst { GuildsTree } = findByPropsLazy(\"GuildsTree\");\nconst SortedGuildStore = findStoreLazy(\"SortedGuildStore\");\nexport const ExpandedGuildFolderStore = findStoreLazy(\"ExpandedGuildFolderStore\");\nconst FolderUtils = findByPropsLazy(\"move\", \"toggleGuildFolderExpand\");\n\nlet lastGuildId = null as string | null;\nlet dispatchingFoldersClose = false;\n\nfunction getGuildFolder(id: string) {\n return SortedGuildStore.getGuildFolders().find(folder => folder.guildIds.includes(id));\n}\n\nfunction closeFolders() {\n for (const id of ExpandedGuildFolderStore.getExpandedFolders())\n FolderUtils.toggleGuildFolderExpand(id);\n}\n\nexport const settings = definePluginSettings({\n sidebar: {\n type: OptionType.BOOLEAN,\n description: \"Display servers from folder on dedicated sidebar\",\n restartNeeded: true,\n default: true\n },\n sidebarAnim: {\n type: OptionType.BOOLEAN,\n description: \"Animate opening the folder sidebar\",\n default: true\n },\n closeAllFolders: {\n type: OptionType.BOOLEAN,\n description: \"Close all folders when selecting a server not in a folder\",\n default: false\n },\n closeAllHomeButton: {\n type: OptionType.BOOLEAN,\n description: \"Close all folders when clicking on the home button\",\n restartNeeded: true,\n default: false\n },\n closeOthers: {\n type: OptionType.BOOLEAN,\n description: \"Close other folders when opening a folder\",\n default: false\n },\n forceOpen: {\n type: OptionType.BOOLEAN,\n description: \"Force a folder to open when switching to a server of that folder\",\n default: false\n },\n keepIcons: {\n type: OptionType.BOOLEAN,\n description: \"Keep showing guild icons in the primary guild bar folder when it's open in the BetterFolders sidebar\",\n restartNeeded: true,\n default: false\n },\n showFolderIcon: {\n type: OptionType.SELECT,\n description: \"Show the folder icon above the folder guilds in the BetterFolders sidebar\",\n options: [\n { label: \"Never\", value: FolderIconDisplay.Never },\n { label: \"Always\", value: FolderIconDisplay.Always, default: true },\n { label: \"When more than one folder is expanded\", value: FolderIconDisplay.MoreThanOneFolderExpanded }\n ],\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"BetterFolders\",\n description: \"Shows server folders on dedicated sidebar and adds folder related improvements\",\n authors: [Devs.juby, Devs.AutumnVN, Devs.Nuckyz],\n\n settings,\n\n patches: [\n {\n find: '(\"guildsnav\")',\n predicate: () => settings.store.sidebar,\n replacement: [\n // Create the isBetterFolders variable in the GuildsBar component\n {\n match: /(?<=let{disableAppDownload:\\i=\\i\\.isPlatformEmbedded,isOverlay:.+?)(?=}=\\i,)/,\n replace: \",isBetterFolders\"\n },\n // If we are rendering the Better Folders sidebar, we filter out guilds that are not in folders and unexpanded folders\n {\n match: /(useStateFromStoresArray\\).{0,25}let \\i)=(\\i\\.\\i.getGuildsTree\\(\\))/,\n replace: (_, rest, guildsTree) => `${rest}=$self.getGuildTree(!!arguments[0].isBetterFolders,${guildsTree},arguments[0].betterFoldersExpandedIds)`\n },\n // If we are rendering the Better Folders sidebar, we filter out everything but the servers and folders from the GuildsBar Guild List children\n {\n match: /lastTargetNode:\\i\\[\\i\\.length-1\\].+?Fragment.+?\\]}\\)\\]/,\n replace: \"$&.filter($self.makeGuildsBarGuildListFilter(!!arguments[0].isBetterFolders))\"\n },\n // If we are rendering the Better Folders sidebar, we filter out everything but the scroller for the guild list from the GuildsBar Tree children\n {\n match: /unreadMentionsIndicatorBottom,barClassName.+?}\\)\\]/,\n replace: \"$&.filter($self.makeGuildsBarTreeFilter(!!arguments[0].isBetterFolders))\"\n },\n // Export the isBetterFolders variable to the folders component\n {\n match: /(?<=\\.Messages\\.SERVERS.+?switch\\((\\i)\\.type\\){case \\i\\.\\i\\.FOLDER:.+?folderNode:\\i,)/,\n replace: 'isBetterFolders:typeof isBetterFolders!==\"undefined\"?isBetterFolders:false,'\n }\n ]\n },\n {\n // This is the parent folder component\n find: \".MAX_GUILD_FOLDER_NAME_LENGTH,\",\n predicate: () => settings.store.sidebar && settings.store.showFolderIcon !== FolderIconDisplay.Always,\n replacement: [\n {\n // Modify the expanded state to instead return the list of expanded folders\n match: /(useStateFromStores\\).{0,20}=>)(\\i\\.\\i)\\.isFolderExpanded\\(\\i\\)/,\n replace: (_, rest, ExpandedGuildFolderStore) => `${rest}${ExpandedGuildFolderStore}.getExpandedFolders()`,\n },\n {\n // Modify the expanded prop to use the boolean if the above patch fails, or check if the folder is expanded from the list if it succeeds\n // Also export the list of expanded folders to the child folder component if the patch above succeeds, else export undefined\n match: /(?<=folderNode:(\\i),expanded:)\\i(?=,)/,\n replace: (isExpandedOrExpandedIds, folderNote) => \"\"\n + `typeof ${isExpandedOrExpandedIds}===\"boolean\"?${isExpandedOrExpandedIds}:${isExpandedOrExpandedIds}.has(${folderNote}.id),`\n + `betterFoldersExpandedIds:${isExpandedOrExpandedIds} instanceof Set?${isExpandedOrExpandedIds}:void 0`\n }\n ]\n },\n {\n find: \".FOLDER_ITEM_GUILD_ICON_MARGIN);\",\n predicate: () => settings.store.sidebar,\n replacement: [\n // We use arguments[0] to access the isBetterFolders variable in this nested folder component (the parent exports all the props so we don't have to patch it)\n\n // If we are rendering the normal GuildsBar sidebar, we make Discord think the folder is always collapsed to show better icons (the mini guild icons) and avoid transitions\n {\n predicate: () => settings.store.keepIcons,\n match: /(?<=let{folderNode:\\i,setNodeRef:\\i,.+?expanded:(\\i),.+?;)(?=let)/,\n replace: (_, isExpanded) => `${isExpanded}=!!arguments[0].isBetterFolders&&${isExpanded};`\n },\n // Disable expanding and collapsing folders transition in the normal GuildsBar sidebar\n {\n predicate: () => !settings.store.keepIcons,\n match: /(?<=\\.Messages\\.SERVER_FOLDER_PLACEHOLDER.+?useTransition\\)\\()/,\n replace: \"!!arguments[0].isBetterFolders&&\"\n },\n // If we are rendering the normal GuildsBar sidebar, we avoid rendering guilds from folders that are expanded\n {\n predicate: () => !settings.store.keepIcons,\n match: /expandedFolderBackground,.+?,(?=\\i\\(\\(\\i,\\i,\\i\\)=>{let{key.{0,45}ul)(?<=selected:\\i,expanded:(\\i),.+?)/,\n replace: (m, isExpanded) => `${m}!arguments[0].isBetterFolders&&${isExpanded}?null:`\n },\n {\n // Decide if we should render the expanded folder background if we are rendering the Better Folders sidebar\n predicate: () => settings.store.showFolderIcon !== FolderIconDisplay.Always,\n match: /(?<=\\.wrapper,children:\\[)/,\n replace: \"$self.shouldShowFolderIconAndBackground(!!arguments[0].isBetterFolders,arguments[0].betterFoldersExpandedIds)&&\"\n },\n {\n // Decide if we should render the expanded folder icon if we are rendering the Better Folders sidebar\n predicate: () => settings.store.showFolderIcon !== FolderIconDisplay.Always,\n match: /(?<=\\.expandedFolderBackground.+?}\\),)(?=\\i,)/,\n replace: \"!$self.shouldShowFolderIconAndBackground(!!arguments[0].isBetterFolders,arguments[0].betterFoldersExpandedIds)?null:\"\n }\n ]\n },\n {\n find: \"APPLICATION_LIBRARY,render\",\n predicate: () => settings.store.sidebar,\n replacement: {\n // Render the Better Folders sidebar\n match: /(?<=({className:\\i\\.guilds,themeOverride:\\i})\\))/,\n replace: \",$self.FolderSideBar($1)\"\n }\n },\n {\n find: \".Messages.DISCODO_DISABLED\",\n predicate: () => settings.store.closeAllHomeButton,\n replacement: {\n // Close all folders when clicking the home button\n match: /(?<=onClick:\\(\\)=>{)(?=.{0,200}\"discodo\")/,\n replace: \"$self.closeFolders();\"\n }\n }\n ],\n\n flux: {\n CHANNEL_SELECT(data) {\n if (!settings.store.closeAllFolders && !settings.store.forceOpen)\n return;\n\n if (lastGuildId !== data.guildId) {\n lastGuildId = data.guildId;\n const guildFolder = getGuildFolder(data.guildId);\n\n if (guildFolder?.folderId) {\n if (settings.store.forceOpen && !ExpandedGuildFolderStore.isFolderExpanded(guildFolder.folderId)) {\n FolderUtils.toggleGuildFolderExpand(guildFolder.folderId);\n }\n } else if (settings.store.closeAllFolders) {\n closeFolders();\n }\n }\n },\n\n TOGGLE_GUILD_FOLDER_EXPAND(data) {\n if (settings.store.closeOthers && !dispatchingFoldersClose) {\n dispatchingFoldersClose = true;\n\n FluxDispatcher.wait(() => {\n const expandedFolders = ExpandedGuildFolderStore.getExpandedFolders();\n\n if (expandedFolders.size > 1) {\n for (const id of expandedFolders) if (id !== data.folderId)\n FolderUtils.toggleGuildFolderExpand(id);\n }\n\n dispatchingFoldersClose = false;\n });\n }\n }\n },\n\n getGuildTree(isBetterFolders: boolean, oldTree: any, expandedFolderIds?: Set) {\n if (!isBetterFolders || expandedFolderIds == null) return oldTree;\n\n const newTree = new GuildsTree();\n // Children is every folder and guild which is not in a folder, this filters out only the expanded folders\n newTree.root.children = oldTree.root.children.filter(guildOrFolder => expandedFolderIds.has(guildOrFolder.id));\n // Nodes is every folder and guild, even if it's in a folder, this filters out only the expanded folders and guilds inside them\n newTree.nodes = Object.fromEntries(\n Object.entries(oldTree.nodes)\n .filter(([_, guildOrFolder]: any[]) => expandedFolderIds.has(guildOrFolder.id) || expandedFolderIds.has(guildOrFolder.parentId))\n );\n\n return newTree;\n },\n\n makeGuildsBarGuildListFilter(isBetterFolders: boolean) {\n return child => {\n if (isBetterFolders) {\n return child?.props?.[\"aria-label\"] === i18n.Messages.SERVERS;\n }\n return true;\n };\n },\n\n makeGuildsBarTreeFilter(isBetterFolders: boolean) {\n return child => {\n if (isBetterFolders) {\n return \"onScroll\" in child.props;\n }\n return true;\n };\n },\n\n shouldShowFolderIconAndBackground(isBetterFolders: boolean, expandedFolderIds?: Set) {\n if (!isBetterFolders) return true;\n\n switch (settings.store.showFolderIcon) {\n case FolderIconDisplay.Never:\n return false;\n case FolderIconDisplay.Always:\n return true;\n case FolderIconDisplay.MoreThanOneFolderExpanded:\n return (expandedFolderIds?.size ?? 0) > 1;\n default:\n return true;\n }\n },\n\n FolderSideBar: guildsBarProps => ,\n\n closeFolders\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"BetterGifAltText\",\n authors: [Devs.Ven],\n description:\n \"Change GIF alt text from simply being 'GIF' to containing the gif tags / filename\",\n patches: [\n {\n find: \"onCloseImage=\",\n replacement: {\n match: /(return.{0,10}\\.jsx.{0,50}isWindowFocused)/,\n replace:\n \"$self.altify(e);$1\",\n },\n },\n {\n find: \".Messages.GIF,\",\n replacement: {\n match: /alt:(\\i)=(\\i\\.default\\.Messages\\.GIF)(?=,[^}]*\\}=(\\i))/,\n replace:\n // rename prop so we can always use default value\n \"alt_$$:$1=$self.altify($3)||$2\",\n },\n },\n ],\n\n altify(props: any) {\n props.alt ??= \"GIF\";\n if (props.alt !== \"GIF\") return props.alt;\n\n let url: string = props.original || props.src;\n try {\n url = decodeURI(url);\n } catch { }\n\n let name = url\n .slice(url.lastIndexOf(\"/\") + 1)\n .replace(/\\d/g, \"\") // strip numbers\n .replace(/.gif$/, \"\") // strip extension\n .split(/[,\\-_ ]+/g)\n .slice(0, 20)\n .join(\" \");\n if (name.length > 300) {\n name = name.slice(0, 300) + \"...\";\n }\n\n if (name) props.alt += ` - ${name}`;\n\n return props.alt;\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\n\nconst UserPopoutSectionCssClasses = findByPropsLazy(\"section\", \"lastSection\");\n\nexport default definePlugin({\n name: \"BetterNotesBox\",\n description: \"Hide notes or disable spellcheck (Configure in settings!!)\",\n authors: [Devs.Ven],\n\n patches: [\n {\n find: \"hideNote:\",\n all: true,\n // Some modules match the find but the replacement is returned untouched\n noWarn: true,\n predicate: () => Vencord.Settings.plugins.BetterNotesBox.hide,\n replacement: {\n match: /hideNote:.+?(?=([,}].*?\\)))/g,\n replace: (m, rest) => {\n const destructuringMatch = rest.match(/}=.+/);\n if (destructuringMatch == null) return \"hideNote:!0\";\n return m;\n }\n }\n },\n {\n find: \"Messages.NOTE_PLACEHOLDER\",\n replacement: {\n match: /\\.NOTE_PLACEHOLDER,/,\n replace: \"$&spellCheck:!Vencord.Settings.plugins.BetterNotesBox.noSpellCheck,\"\n }\n },\n {\n find: \".Messages.NOTE}\",\n replacement: {\n match: /(?<=return \\i\\?)null(?=:\\(0,\\i\\.jsxs)/,\n replace: \"$self.patchPadding(arguments[0])\"\n }\n }\n ],\n\n options: {\n hide: {\n type: OptionType.BOOLEAN,\n description: \"Hide notes\",\n default: false,\n restartNeeded: true\n },\n noSpellCheck: {\n type: OptionType.BOOLEAN,\n description: \"Disable spellcheck in notes\",\n disabled: () => Settings.plugins.BetterNotesBox.hide,\n default: false\n }\n },\n\n patchPadding(e: any) {\n if (!e.lastSection) return;\n return (\n
\n );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Clipboard, Toasts } from \"@webpack/common\";\n\nexport default definePlugin({\n name: \"BetterRoleDot\",\n authors: [Devs.Ven, Devs.AutumnVN],\n description:\n \"Copy role colour on RoleDot (accessibility setting) click. Also allows using both RoleDot and coloured names simultaneously\",\n\n patches: [\n {\n find: \".dotBorderBase\",\n replacement: {\n match: /,viewBox:\"0 0 20 20\"/,\n replace: \"$&,onClick:()=>$self.copyToClipBoard(arguments[0].color),style:{cursor:'pointer'}\",\n },\n },\n {\n find: '\"dot\"===',\n all: true,\n noWarn: true,\n predicate: () => Settings.plugins.BetterRoleDot.bothStyles,\n replacement: {\n match: /\"(?:username|dot)\"===\\i(?!\\.\\i)/g,\n replace: \"true\",\n },\n },\n\n {\n find: \".ADD_ROLE_A11Y_LABEL\",\n predicate: () => Settings.plugins.BetterRoleDot.copyRoleColorInProfilePopout && !Settings.plugins.BetterRoleDot.bothStyles,\n noWarn: true,\n replacement: {\n match: /\"dot\"===\\i/,\n replace: \"true\"\n }\n },\n {\n find: \".roleVerifiedIcon\",\n predicate: () => Settings.plugins.BetterRoleDot.copyRoleColorInProfilePopout && !Settings.plugins.BetterRoleDot.bothStyles,\n noWarn: true,\n replacement: {\n match: /\"dot\"===\\i/,\n replace: \"true\"\n }\n }\n ],\n\n options: {\n bothStyles: {\n type: OptionType.BOOLEAN,\n description: \"Show both role dot and coloured names\",\n restartNeeded: true,\n default: false,\n },\n copyRoleColorInProfilePopout: {\n type: OptionType.BOOLEAN,\n description: \"Allow click on role dot in profile popout to copy role color\",\n restartNeeded: true,\n default: false\n }\n },\n\n copyToClipBoard(color: string) {\n Clipboard.copy(color);\n Toasts.show({\n message: \"Copied to Clipboard!\",\n type: Toasts.Type.SUCCESS,\n id: Toasts.genId(),\n options: {\n duration: 1000,\n position: Toasts.Position.BOTTOM\n }\n });\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"BetterUploadButton\",\n authors: [Devs.obscurity, Devs.Ven],\n description: \"Upload with a single click, open menu with right click\",\n patches: [\n {\n find: \"Messages.CHAT_ATTACH_UPLOAD_OR_INVITE\",\n replacement: {\n // Discord merges multiple props here with Object.assign()\n // This patch passes a third object to it with which we override onClick and onContextMenu\n match: /CHAT_ATTACH_UPLOAD_OR_INVITE,onDoubleClick:(.+?:void 0),\\.\\.\\.(\\i),/,\n replace: \"$&onClick:$1,onContextMenu:$2.onClick,\",\n },\n },\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { findStoreLazy } from \"@webpack\";\n\nimport * as t from \"./types/stores\";\n\nexport const ApplicationStreamPreviewStore: t.ApplicationStreamPreviewStore = findStoreLazy(\"ApplicationStreamPreviewStore\");\nexport const ApplicationStreamingStore: t.ApplicationStreamingStore = findStoreLazy(\"ApplicationStreamingStore\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { ScreenshareIcon } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport { openImageModal } from \"@utils/discord\";\nimport definePlugin from \"@utils/types\";\nimport { Menu } from \"@webpack/common\";\nimport { Channel, User } from \"discord-types/general\";\n\nimport { ApplicationStreamingStore, ApplicationStreamPreviewStore } from \"./webpack/stores\";\nimport { ApplicationStream, Stream } from \"./webpack/types/stores\";\n\nexport interface UserContextProps {\n channel: Channel,\n channelSelected: boolean,\n className: string,\n config: { context: string; };\n context: string,\n onHeightUpdate: Function,\n position: string,\n target: HTMLElement,\n theme: string,\n user: User;\n}\n\nexport interface StreamContextProps {\n appContext: string,\n className: string,\n config: { context: string; };\n context: string,\n exitFullscreen: Function,\n onHeightUpdate: Function,\n position: string,\n target: HTMLElement,\n stream: Stream,\n theme: string,\n}\n\nexport const handleViewPreview = async ({ guildId, channelId, ownerId }: ApplicationStream | Stream) => {\n const previewUrl = await ApplicationStreamPreviewStore.getPreviewURL(guildId, channelId, ownerId);\n if (!previewUrl) return;\n\n openImageModal(previewUrl);\n};\n\nexport const addViewStreamContext: NavContextMenuPatchCallback = (children, { userId }: { userId: string | bigint; }) => () => {\n const stream = ApplicationStreamingStore.getAnyStreamForUser(userId);\n if (!stream) return;\n\n const streamPreviewItem = (\n stream && handleViewPreview(stream)}\n disabled={!stream}\n />\n );\n\n children.push(, streamPreviewItem);\n};\n\nexport const streamContextPatch: NavContextMenuPatchCallback = (children, { stream }: StreamContextProps) => {\n return addViewStreamContext(children, { userId: stream.ownerId });\n};\n\nexport const userContextPatch: NavContextMenuPatchCallback = (children, { user }: UserContextProps) => {\n return addViewStreamContext(children, { userId: user.id });\n};\n\nexport default definePlugin({\n name: \"BiggerStreamPreview\",\n description: \"This plugin allows you to enlarge stream previews\",\n authors: [Devs.phil],\n start: () => {\n addContextMenuPatch(\"user-context\", userContextPatch);\n addContextMenuPatch(\"stream-context\", streamContextPatch);\n },\n stop: () => {\n removeContextMenuPatch(\"user-context\", userContextPatch);\n removeContextMenuPatch(\"stream-context\", streamContextPatch);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nlet style: HTMLStyleElement;\n\nfunction setCss() {\n style.textContent = `\n .vc-nsfw-img [class^=imageWrapper] img,\n .vc-nsfw-img [class^=wrapperPaused] video {\n filter: blur(${Settings.plugins.BlurNSFW.blurAmount}px);\n transition: filter 0.2s;\n }\n .vc-nsfw-img [class^=imageWrapper]:hover img,\n .vc-nsfw-img [class^=wrapperPaused]:hover video {\n filter: unset;\n }\n `;\n}\n\nexport default definePlugin({\n name: \"BlurNSFW\",\n description: \"Blur attachments in NSFW channels until hovered\",\n authors: [Devs.Ven],\n\n patches: [\n {\n find: \".embedWrapper,embed\",\n replacement: [{\n match: /\\.embedWrapper/g,\n replace: \"$&+(this.props.channel.nsfw?' vc-nsfw-img':'')\"\n }]\n }\n ],\n\n options: {\n blurAmount: {\n type: OptionType.NUMBER,\n description: \"Blur Amount\",\n default: 10,\n onChange: setCss\n }\n },\n\n start() {\n style = document.createElement(\"style\");\n style.id = \"VcBlurNsfw\";\n document.head.appendChild(style);\n\n setCss();\n },\n\n stop() {\n style?.remove();\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { useTimer } from \"@utils/react\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { React } from \"@webpack/common\";\n\nfunction formatDuration(ms: number) {\n // here be dragons (moment fucking sucks)\n const human = Settings.plugins.CallTimer.format === \"human\";\n\n const format = (n: number) => human ? n : n.toString().padStart(2, \"0\");\n const unit = (s: string) => human ? s : \"\";\n const delim = human ? \" \" : \":\";\n\n // thx copilot\n const d = Math.floor(ms / 86400000);\n const h = Math.floor((ms % 86400000) / 3600000);\n const m = Math.floor(((ms % 86400000) % 3600000) / 60000);\n const s = Math.floor((((ms % 86400000) % 3600000) % 60000) / 1000);\n\n let res = \"\";\n if (d) res += `${d}d `;\n if (h || res) res += `${format(h)}${unit(\"h\")}${delim}`;\n if (m || res || !human) res += `${format(m)}${unit(\"m\")}${delim}`;\n res += `${format(s)}${unit(\"s\")}`;\n\n return res;\n}\n\nexport default definePlugin({\n name: \"CallTimer\",\n description: \"Adds a timer to vcs\",\n authors: [Devs.Ven],\n\n startTime: 0,\n interval: void 0 as NodeJS.Timeout | undefined,\n\n options: {\n format: {\n type: OptionType.SELECT,\n description: \"The timer format. This can be any valid moment.js format\",\n options: [\n {\n label: \"30d 23:00:42\",\n value: \"stopwatch\",\n default: true\n },\n {\n label: \"30d 23h 00m 42s\",\n value: \"human\"\n }\n ]\n }\n },\n\n patches: [{\n find: \"renderConnectionStatus(){\",\n replacement: {\n match: /(?<=renderConnectionStatus\\(\\)\\{.+\\.channel,children:)\\i/,\n replace: \"[$&, $self.renderTimer(this.props.channel.id)]\"\n }\n }],\n renderTimer(channelId: string) {\n return \n \n ;\n },\n\n Timer({ channelId }: { channelId: string; }) {\n const time = useTimer({\n deps: [channelId]\n });\n\n return

Connected for {formatDuration(time)}

;\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Logger } from \"@utils/Logger\";\nimport { MessageStore } from \"@webpack/common\";\nimport { CustomEmoji } from \"@webpack/types\";\nimport type { Channel, Message } from \"discord-types/general\";\nimport type { Promisable } from \"type-fest\";\n\nconst MessageEventsLogger = new Logger(\"MessageEvents\", \"#e5c890\");\n\nexport interface MessageObject {\n content: string,\n validNonShortcutEmojis: CustomEmoji[];\n invalidEmojis: any[];\n tts: boolean;\n}\n\nexport interface Upload {\n classification: string;\n currentSize: number;\n description: string | null;\n filename: string;\n id: string;\n isImage: boolean;\n isVideo: boolean;\n item: {\n file: File;\n platform: number;\n };\n loaded: number;\n mimeType: string;\n preCompressionSize: number;\n responseUrl: string;\n sensitive: boolean;\n showLargeMessageDialog: boolean;\n spoiler: boolean;\n status: \"NOT_STARTED\" | \"STARTED\" | \"UPLOADING\" | \"ERROR\" | \"COMPLETED\" | \"CANCELLED\";\n uniqueId: string;\n uploadedFilename: string;\n}\n\nexport interface MessageReplyOptions {\n messageReference: Message[\"messageReference\"];\n allowedMentions?: {\n parse: Array;\n repliedUser: boolean;\n };\n}\n\nexport interface MessageExtra {\n stickers?: string[];\n uploads?: Upload[];\n replyOptions: MessageReplyOptions;\n content: string;\n channel: Channel;\n type?: any;\n openWarningPopout: (props: any) => any;\n}\n\nexport type SendListener = (channelId: string, messageObj: MessageObject, extra: MessageExtra) => Promisable;\nexport type EditListener = (channelId: string, messageId: string, messageObj: MessageObject) => Promisable;\n\nconst sendListeners = new Set();\nconst editListeners = new Set();\n\nexport async function _handlePreSend(channelId: string, messageObj: MessageObject, extra: MessageExtra, replyOptions: MessageReplyOptions) {\n extra.replyOptions = replyOptions;\n for (const listener of sendListeners) {\n try {\n const result = await listener(channelId, messageObj, extra);\n if (result && result.cancel === true) {\n return true;\n }\n } catch (e) {\n MessageEventsLogger.error(\"MessageSendHandler: Listener encountered an unknown error\\n\", e);\n }\n }\n return false;\n}\n\nexport async function _handlePreEdit(channelId: string, messageId: string, messageObj: MessageObject) {\n for (const listener of editListeners) {\n try {\n await listener(channelId, messageId, messageObj);\n } catch (e) {\n MessageEventsLogger.error(\"MessageEditHandler: Listener encountered an unknown error\\n\", e);\n }\n }\n}\n\n/**\n * Note: This event fires off before a message is sent, allowing you to edit the message.\n */\nexport function addPreSendListener(listener: SendListener) {\n sendListeners.add(listener);\n return listener;\n}\n/**\n * Note: This event fires off before a message's edit is applied, allowing you to further edit the message.\n */\nexport function addPreEditListener(listener: EditListener) {\n editListeners.add(listener);\n return listener;\n}\nexport function removePreSendListener(listener: SendListener) {\n return sendListeners.delete(listener);\n}\nexport function removePreEditListener(listener: EditListener) {\n return editListeners.delete(listener);\n}\n\n\n// Message clicks\ntype ClickListener = (message: Message, channel: Channel, event: MouseEvent) => void;\n\nconst listeners = new Set();\n\nexport function _handleClick(message: Message, channel: Channel, event: MouseEvent) {\n // message object may be outdated, so (try to) fetch latest one\n message = MessageStore.getMessage(channel.id, message.id) ?? message;\n for (const listener of listeners) {\n try {\n listener(message, channel, event);\n } catch (e) {\n MessageEventsLogger.error(\"MessageClickHandler: Listener encountered an unknown error\\n\", e);\n }\n }\n}\n\nexport function addClickListener(listener: ClickListener) {\n listeners.add(listener);\n return listener;\n}\n\nexport function removeClickListener(listener: ClickListener) {\n return listeners.delete(listener);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const defaultRules = [\n \"action_object_map\",\n \"action_type_map\",\n \"action_ref_map\",\n \"spm@*.aliexpress.com\",\n \"scm@*.aliexpress.com\",\n \"aff_platform\",\n \"aff_trace_key\",\n \"algo_expid@*.aliexpress.*\",\n \"algo_pvid@*.aliexpress.*\",\n \"btsid\",\n \"ws_ab_test\",\n \"pd_rd_*@amazon.*\",\n \"_encoding@amazon.*\",\n \"psc@amazon.*\",\n \"tag@amazon.*\",\n \"ref_@amazon.*\",\n \"pf_rd_*@amazon.*\",\n \"pf@amazon.*\",\n \"crid@amazon.*\",\n \"keywords@amazon.*\",\n \"sprefix@amazon.*\",\n \"sr@amazon.*\",\n \"ie@amazon.*\",\n \"node@amazon.*\",\n \"qid@amazon.*\",\n \"callback@bilibili.com\",\n \"cvid@bing.com\",\n \"form@bing.com\",\n \"sk@bing.com\",\n \"sp@bing.com\",\n \"sc@bing.com\",\n \"qs@bing.com\",\n \"pq@bing.com\",\n \"sc_cid\",\n \"mkt_tok\",\n \"trk\",\n \"trkCampaign\",\n \"ga_*\",\n \"gclid\",\n \"gclsrc\",\n \"hmb_campaign\",\n \"hmb_medium\",\n \"hmb_source\",\n \"spReportId\",\n \"spJobID\",\n \"spUserID\",\n \"spMailingID\",\n \"itm_*\",\n \"s_cid\",\n \"elqTrackId\",\n \"elqTrack\",\n \"assetType\",\n \"assetId\",\n \"recipientId\",\n \"campaignId\",\n \"siteId\",\n \"mc_cid\",\n \"mc_eid\",\n \"pk_*\",\n \"sc_campaign\",\n \"sc_channel\",\n \"sc_content\",\n \"sc_medium\",\n \"sc_outcome\",\n \"sc_geo\",\n \"sc_country\",\n \"nr_email_referer\",\n \"vero_conv\",\n \"vero_id\",\n \"yclid\",\n \"_openstat\",\n \"mbid\",\n \"cmpid\",\n \"cid\",\n \"c_id\",\n \"campaign_id\",\n \"Campaign\",\n \"hash@ebay.*\",\n \"fb_action_ids\",\n \"fb_action_types\",\n \"fb_ref\",\n \"fb_source\",\n \"fbclid\",\n \"refsrc@facebook.com\",\n \"hrc@facebook.com\",\n \"gs_l\",\n \"gs_lcp@google.*\",\n \"ved@google.*\",\n \"ei@google.*\",\n \"sei@google.*\",\n \"gws_rd@google.*\",\n \"gs_gbg@google.*\",\n \"gs_mss@google.*\",\n \"gs_rn@google.*\",\n \"_hsenc\",\n \"_hsmi\",\n \"__hssc\",\n \"__hstc\",\n \"hsCtaTracking\",\n \"source@sourceforge.net\",\n \"position@sourceforge.net\",\n \"t@*.twitter.com\",\n \"s@*.twitter.com\",\n \"ref_*@*.twitter.com\",\n \"tt_medium\",\n \"tt_content\",\n \"lr@yandex.*\",\n \"redircnt@yandex.*\",\n \"feature@youtube.com\",\n \"kw@youtube.com\",\n \"si@youtube.com\",\n \"pp@youtube.com\",\n \"si@youtu.be\",\n \"wt_zmc\",\n \"utm_source\",\n \"utm_content\",\n \"utm_medium\",\n \"utm_campaign\",\n \"utm_term\",\n \"si@open.spotify.com\",\n \"igshid\",\n \"share_id@reddit.com\",\n];\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport {\n addPreEditListener,\n addPreSendListener,\n MessageObject,\n removePreEditListener,\n removePreSendListener\n} from \"@api/MessageEvents\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nimport { defaultRules } from \"./defaultRules\";\n\n// From lodash\nconst reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\nconst reHasRegExpChar = RegExp(reRegExpChar.source);\n\nexport default definePlugin({\n name: \"ClearURLs\",\n description: \"Removes tracking garbage from URLs\",\n authors: [Devs.adryd],\n dependencies: [\"MessageEventsAPI\"],\n\n escapeRegExp(str: string) {\n return (str && reHasRegExpChar.test(str))\n ? str.replace(reRegExpChar, \"\\\\$&\")\n : (str || \"\");\n },\n\n createRules() {\n // Can be extended upon once user configs are available\n // Eg. (useDefaultRules: boolean, customRules: Array[string])\n const rules = defaultRules;\n\n this.universalRules = new Set();\n this.rulesByHost = new Map();\n this.hostRules = new Map();\n\n for (const rule of rules) {\n const splitRule = rule.split(\"@\");\n const paramRule = new RegExp(\n \"^\" +\n this.escapeRegExp(splitRule[0]).replace(/\\\\\\*/, \".+?\") +\n \"$\"\n );\n\n if (!splitRule[1]) {\n this.universalRules.add(paramRule);\n continue;\n }\n const hostRule = new RegExp(\n \"^(www\\\\.)?\" +\n this.escapeRegExp(splitRule[1])\n .replace(/\\\\\\./, \"\\\\.\")\n .replace(/^\\\\\\*\\\\\\./, \"(.+?\\\\.)?\")\n .replace(/\\\\\\*/, \".+?\") +\n \"$\"\n );\n const hostRuleIndex = hostRule.toString();\n\n this.hostRules.set(hostRuleIndex, hostRule);\n if (this.rulesByHost.get(hostRuleIndex) == null) {\n this.rulesByHost.set(hostRuleIndex, new Set());\n }\n this.rulesByHost.get(hostRuleIndex).add(paramRule);\n }\n },\n\n removeParam(rule: string | RegExp, param: string, parent: URLSearchParams) {\n if (param === rule || rule instanceof RegExp && rule.test(param)) {\n parent.delete(param);\n }\n },\n\n replacer(match: string) {\n // Parse URL without throwing errors\n try {\n var url = new URL(match);\n } catch (error) {\n // Don't modify anything if we can't parse the URL\n return match;\n }\n\n // Cheap way to check if there are any search params\n if (url.searchParams.entries().next().done) {\n // If there are none, we don't need to modify anything\n return match;\n }\n\n // Check all universal rules\n this.universalRules.forEach(rule => {\n url.searchParams.forEach((_value, param, parent) => {\n this.removeParam(rule, param, parent);\n });\n });\n\n // Check rules for each hosts that match\n this.hostRules.forEach((regex, hostRuleName) => {\n if (!regex.test(url.hostname)) return;\n this.rulesByHost.get(hostRuleName).forEach(rule => {\n url.searchParams.forEach((_value, param, parent) => {\n this.removeParam(rule, param, parent);\n });\n });\n });\n\n return url.toString();\n },\n\n onSend(msg: MessageObject) {\n // Only run on messages that contain URLs\n if (msg.content.match(/http(s)?:\\/\\//)) {\n msg.content = msg.content.replace(\n /(https?:\\/\\/[^\\s<]+[^<.,:;\"'>)|\\]\\s])/g,\n match => this.replacer(match)\n );\n }\n },\n\n start() {\n this.createRules();\n this.preSend = addPreSendListener((_, msg) => this.onSend(msg));\n this.preEdit = addPreEditListener((_cid, _mid, msg) =>\n this.onSend(msg)\n );\n },\n\n stop() {\n removePreSendListener(this.preSend);\n removePreEditListener(this.preEdit);\n },\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport \"./clientTheme.css\";\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport { getTheme, Theme } from \"@utils/discord\";\nimport { Margins } from \"@utils/margins\";\nimport { classes } from \"@utils/misc\";\nimport definePlugin, { OptionType, StartAt } from \"@utils/types\";\nimport { findComponentByCodeLazy } from \"@webpack\";\nimport { Button, Forms } from \"@webpack/common\";\n\nconst ColorPicker = findComponentByCodeLazy(\".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR\");\n\nconst colorPresets = [\n \"#1E1514\", \"#172019\", \"#13171B\", \"#1C1C28\", \"#402D2D\",\n \"#3A483D\", \"#344242\", \"#313D4B\", \"#2D2F47\", \"#322B42\",\n \"#3C2E42\", \"#422938\"\n];\n\nfunction onPickColor(color: number) {\n const hexColor = color.toString(16).padStart(6, \"0\");\n\n settings.store.color = hexColor;\n updateColorVars(hexColor);\n}\n\nfunction ThemeSettings() {\n const lightnessWarning = hexToLightness(settings.store.color) > 45;\n const lightModeWarning = getTheme() === Theme.Light;\n\n return (\n
\n
\n
\n Theme Color\n Add a color to your Discord client theme\n
\n \n
\n {lightnessWarning || lightModeWarning\n ?
\n \n Your theme won't look good:\n {lightnessWarning && Selected color is very light}\n {lightModeWarning && Light mode isn't supported}\n
\n : null\n }\n
\n );\n}\n\nconst settings = definePluginSettings({\n color: {\n description: \"Color your Discord client theme will be based around. Light mode isn't supported\",\n type: OptionType.COMPONENT,\n default: \"313338\",\n component: () => \n },\n resetColor: {\n description: \"Reset Theme Color\",\n type: OptionType.COMPONENT,\n default: \"313338\",\n component: () => (\n \n )\n }\n});\n\nexport default definePlugin({\n name: \"ClientTheme\",\n authors: [Devs.F53, Devs.Nuckyz],\n description: \"Recreation of the old client theme experiment. Add a color to your Discord client theme\",\n settings,\n\n startAt: StartAt.DOMContentLoaded,\n start() {\n updateColorVars(settings.store.color);\n generateColorOffsets();\n },\n\n stop() {\n document.getElementById(\"clientThemeVars\")?.remove();\n document.getElementById(\"clientThemeOffsets\")?.remove();\n }\n});\n\nconst variableRegex = /(--primary-[5-9]\\d{2}-hsl):.*?(\\S*)%;/g;\n\nasync function generateColorOffsets() {\n\n const styleLinkNodes = document.querySelectorAll('link[rel=\"stylesheet\"]');\n const variableLightness = {} as Record;\n\n // Search all stylesheets for color variables\n for (const styleLinkNode of styleLinkNodes) {\n const cssLink = styleLinkNode.getAttribute(\"href\");\n if (!cssLink) continue;\n\n const res = await fetch(cssLink);\n const cssString = await res.text();\n\n // Get lightness values of --primary variables >=500\n let variableMatch = variableRegex.exec(cssString);\n while (variableMatch !== null) {\n const [, variable, lightness] = variableMatch;\n variableLightness[variable] = parseFloat(lightness);\n variableMatch = variableRegex.exec(cssString);\n }\n }\n\n // Generate offsets\n const lightnessOffsets = Object.entries(variableLightness)\n .map(([key, lightness]) => {\n const lightnessOffset = lightness - variableLightness[\"--primary-600-hsl\"];\n const plusOrMinus = lightnessOffset >= 0 ? \"+\" : \"-\";\n return `${key}: var(--theme-h) var(--theme-s) calc(var(--theme-l) ${plusOrMinus} ${Math.abs(lightnessOffset).toFixed(2)}%);`;\n })\n .join(\"\\n\");\n\n const style = document.createElement(\"style\");\n style.setAttribute(\"id\", \"clientThemeOffsets\");\n style.textContent = `:root:root {\n ${lightnessOffsets}\n }`;\n document.head.appendChild(style);\n}\n\nfunction updateColorVars(color: string) {\n const { hue, saturation, lightness } = hexToHSL(color);\n\n let style = document.getElementById(\"clientThemeVars\");\n if (!style) {\n style = document.createElement(\"style\");\n style.setAttribute(\"id\", \"clientThemeVars\");\n document.head.appendChild(style);\n }\n\n style.textContent = `:root {\n --theme-h: ${hue};\n --theme-s: ${saturation}%;\n --theme-l: ${lightness}%;\n }`;\n}\n\n// https://css-tricks.com/converting-color-spaces-in-javascript/\nfunction hexToHSL(hexCode: string) {\n // Hex => RGB normalized to 0-1\n const r = parseInt(hexCode.substring(0, 2), 16) / 255;\n const g = parseInt(hexCode.substring(2, 4), 16) / 255;\n const b = parseInt(hexCode.substring(4, 6), 16) / 255;\n\n // RGB => HSL\n const cMax = Math.max(r, g, b);\n const cMin = Math.min(r, g, b);\n const delta = cMax - cMin;\n\n let hue: number, saturation: number, lightness: number;\n\n lightness = (cMax + cMin) / 2;\n\n if (delta === 0) {\n // If r=g=b then the only thing that matters is lightness\n hue = 0;\n saturation = 0;\n } else {\n // Magic\n saturation = delta / (1 - Math.abs(2 * lightness - 1));\n\n if (cMax === r)\n hue = ((g - b) / delta) % 6;\n else if (cMax === g)\n hue = (b - r) / delta + 2;\n else\n hue = (r - g) / delta + 4;\n hue *= 60;\n if (hue < 0)\n hue += 360;\n }\n\n // Move saturation and lightness from 0-1 to 0-100\n saturation *= 100;\n lightness *= 100;\n\n return { hue, saturation, lightness };\n}\n\n// Minimized math just for lightness, lowers lag when changing colors\nfunction hexToLightness(hexCode: string) {\n // Hex => RGB normalized to 0-1\n const r = parseInt(hexCode.substring(0, 2), 16) / 255;\n const g = parseInt(hexCode.substring(2, 4), 16) / 255;\n const b = parseInt(hexCode.substring(4, 6), 16) / 255;\n\n const cMax = Math.max(r, g, b);\n const cMin = Math.min(r, g, b);\n\n const lightness = 100 * ((cMax + cMin) / 2);\n\n return lightness;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"ColorSighted\",\n description: \"Removes the colorblind-friendly icons from statuses, just like 2015-2017 Discord\",\n authors: [Devs.lewisakura],\n patches: [\n {\n find: \"Masks.STATUS_ONLINE\",\n replacement: {\n match: /Masks\\.STATUS_(?:IDLE|DND|STREAMING|OFFLINE)/g,\n replace: \"Masks.STATUS_ONLINE\"\n }\n },\n {\n find: \".AVATAR_STATUS_MOBILE_16;\",\n replacement: {\n match: /(?<=fromIsMobile:\\i=!0,.+?)status:(\\i)/,\n // Rename field to force it to always use \"online\"\n replace: 'status_$:$1=\"online\"'\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PatchReplacement, ReplaceFn } from \"./types\";\n\nexport function canonicalizeMatch(match: RegExp | string) {\n if (typeof match === \"string\") return match;\n const canonSource = match.source\n .replaceAll(\"\\\\i\", \"[A-Za-z_$][\\\\w$]*\");\n return new RegExp(canonSource, match.flags);\n}\n\nexport function canonicalizeReplace(replace: string | ReplaceFn, pluginName: string): string | ReplaceFn {\n const self = `Vencord.Plugins.plugins[${JSON.stringify(pluginName)}]`;\n\n if (typeof replace !== \"function\")\n return replace.replaceAll(\"$self\", self);\n\n return (...args) => replace(...args).replaceAll(\"$self\", self);\n}\n\nexport function canonicalizeDescriptor(descriptor: TypedPropertyDescriptor, canonicalize: (value: T) => T) {\n if (descriptor.get) {\n const original = descriptor.get;\n descriptor.get = function () {\n return canonicalize(original.call(this));\n };\n } else if (descriptor.value) {\n descriptor.value = canonicalize(descriptor.value);\n }\n return descriptor;\n}\n\nexport function canonicalizeReplacement(replacement: Pick, plugin: string) {\n const descriptors = Object.getOwnPropertyDescriptors(replacement);\n descriptors.match = canonicalizeDescriptor(descriptors.match, canonicalizeMatch);\n descriptors.replace = canonicalizeDescriptor(\n descriptors.replace,\n replace => canonicalizeReplace(replace, plugin),\n );\n Object.defineProperties(replacement, descriptors);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport { relaunch } from \"@utils/native\";\nimport { canonicalizeMatch, canonicalizeReplace, canonicalizeReplacement } from \"@utils/patches\";\nimport definePlugin from \"@utils/types\";\nimport * as Webpack from \"@webpack\";\nimport { extract, filters, findAll, search } from \"@webpack\";\nimport { React, ReactDOM } from \"@webpack/common\";\nimport type { ComponentType } from \"react\";\n\nconst WEB_ONLY = (f: string) => () => {\n throw new Error(`'${f}' is Discord Desktop only.`);\n};\n\nexport default definePlugin({\n name: \"ConsoleShortcuts\",\n description: \"Adds shorter Aliases for many things on the window. Run `shortcutList` for a list.\",\n authors: [Devs.Ven],\n\n getShortcuts() {\n function newFindWrapper(filterFactory: (...props: any[]) => Webpack.FilterFn) {\n const cache = new Map();\n\n return function (...filterProps: unknown[]) {\n const cacheKey = String(filterProps);\n if (cache.has(cacheKey)) return cache.get(cacheKey);\n\n const matches = findAll(filterFactory(...filterProps));\n\n const result = (() => {\n switch (matches.length) {\n case 0: return null;\n case 1: return matches[0];\n default:\n const uniqueMatches = [...new Set(matches)];\n if (uniqueMatches.length > 1)\n console.warn(`Warning: This filter matches ${matches.length} modules. Make it more specific!\\n`, uniqueMatches);\n\n return matches[0];\n }\n })();\n if (result && cacheKey) cache.set(cacheKey, result);\n return result;\n };\n }\n\n let fakeRenderWin: WeakRef | undefined;\n const find = newFindWrapper(f => f);\n return {\n ...Vencord.Webpack.Common,\n wp: Vencord.Webpack,\n wpc: Webpack.wreq.c,\n wreq: Webpack.wreq,\n wpsearch: search,\n wpex: extract,\n wpexs: (code: string) => extract(Webpack.findModuleId(code)!),\n find,\n findAll,\n findByProps: newFindWrapper(filters.byProps),\n findAllByProps: (...props: string[]) => findAll(filters.byProps(...props)),\n findByCode: newFindWrapper(filters.byCode),\n findAllByCode: (code: string) => findAll(filters.byCode(code)),\n findComponentByCode: newFindWrapper(filters.componentByCode),\n findAllComponentsByCode: (...code: string[]) => findAll(filters.componentByCode(...code)),\n findExportedComponent: (...props: string[]) => find(...props)[props[0]],\n findStore: newFindWrapper(filters.byStoreName),\n PluginsApi: Vencord.Plugins,\n plugins: Vencord.Plugins.plugins,\n Settings: Vencord.Settings,\n Api: Vencord.Api,\n reload: () => location.reload(),\n restart: IS_WEB ? WEB_ONLY(\"restart\") : relaunch,\n canonicalizeMatch,\n canonicalizeReplace,\n canonicalizeReplacement,\n fakeRender: (component: ComponentType, props: any) => {\n const prevWin = fakeRenderWin?.deref();\n const win = prevWin?.closed === false ? prevWin : window.open(\"about:blank\", \"Fake Render\", \"popup,width=500,height=500\")!;\n fakeRenderWin = new WeakRef(win);\n win.focus();\n\n const doc = win.document;\n doc.body.style.margin = \"1em\";\n\n if (!win.prepared) {\n win.prepared = true;\n\n [...document.querySelectorAll(\"style\"), ...document.querySelectorAll(\"link[rel=stylesheet]\")].forEach(s => {\n const n = s.cloneNode(true) as HTMLStyleElement | HTMLLinkElement;\n\n if (s.parentElement?.tagName === \"HEAD\")\n doc.head.append(n);\n else if (n.id?.startsWith(\"vencord-\") || n.id?.startsWith(\"vcd-\"))\n doc.documentElement.append(n);\n else\n doc.body.append(n);\n });\n }\n\n ReactDOM.render(React.createElement(component, props), doc.body.appendChild(document.createElement(\"div\")));\n }\n };\n },\n\n start() {\n const shortcuts = this.getShortcuts();\n window.shortcutList = shortcuts;\n for (const [key, val] of Object.entries(shortcuts))\n window[key] = val;\n },\n\n stop() {\n delete window.shortcutList;\n for (const key in this.getShortcuts())\n delete window[key];\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { LinkIcon } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { Clipboard, Menu } from \"@webpack/common\";\nimport type { Channel, User } from \"discord-types/general\";\n\ninterface UserContextProps {\n channel: Channel;\n guildId?: string;\n user: User;\n}\n\nconst UserContextMenuPatch: NavContextMenuPatchCallback = (children, { user }: UserContextProps) => () => {\n children.push(\n Clipboard.copy(``)}\n icon={LinkIcon}\n />\n );\n};\n\nexport default definePlugin({\n name: \"CopyUserURLs\",\n authors: [Devs.castdrian],\n description: \"Adds a 'Copy User URL' option to the user context menu.\",\n\n start() {\n addContextMenuPatch(\"user-context\", UserContextMenuPatch);\n },\n\n stop() {\n removeContextMenuPatch(\"user-context\", UserContextMenuPatch);\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { showNotification } from \"@api/Notifications\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport { closeAllModals } from \"@utils/modal\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { maybePromptToUpdate } from \"@utils/updater\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { FluxDispatcher, NavigationRouter } from \"@webpack/common\";\nimport type { ReactElement } from \"react\";\n\nconst CrashHandlerLogger = new Logger(\"CrashHandler\");\nconst ModalStack = findByPropsLazy(\"pushLazy\", \"popAll\");\n\nconst settings = definePluginSettings({\n attemptToPreventCrashes: {\n type: OptionType.BOOLEAN,\n description: \"Whether to attempt to prevent Discord crashes.\",\n default: true\n },\n attemptToNavigateToHome: {\n type: OptionType.BOOLEAN,\n description: \"Whether to attempt to navigate to the home when preventing Discord crashes.\",\n default: false\n }\n});\n\nlet crashCount: number = 0;\nlet lastCrashTimestamp: number = 0;\nlet shouldAttemptNextHandle = false;\n\nexport default definePlugin({\n name: \"CrashHandler\",\n description: \"Utility plugin for handling and possibly recovering from Crashes without a restart\",\n authors: [Devs.Nuckyz],\n enabledByDefault: true,\n\n settings,\n\n patches: [\n {\n find: \".Messages.ERRORS_UNEXPECTED_CRASH\",\n replacement: {\n match: /(?=this\\.setState\\()/,\n replace: \"$self.handleCrash(this)||\"\n }\n }\n ],\n\n handleCrash(_this: ReactElement & { forceUpdate: () => void; }) {\n if (Date.now() - lastCrashTimestamp <= 1_000 && !shouldAttemptNextHandle) return true;\n\n shouldAttemptNextHandle = false;\n\n if (++crashCount > 5) {\n try {\n showNotification({\n color: \"#eed202\",\n title: \"Discord has crashed!\",\n body: \"Awn :( Discord has crashed more than five times, not attempting to recover.\",\n noPersist: true,\n });\n } catch { }\n\n lastCrashTimestamp = Date.now();\n return false;\n }\n\n setTimeout(() => crashCount--, 60_000);\n\n try {\n if (crashCount === 1) maybePromptToUpdate(\"Uh oh, Discord has just crashed... but good news, there is a Vencord update available that might fix this issue! Would you like to update now?\", true);\n\n if (settings.store.attemptToPreventCrashes) {\n this.handlePreventCrash(_this);\n return true;\n }\n\n return false;\n } catch (err) {\n CrashHandlerLogger.error(\"Failed to handle crash\", err);\n return false;\n } finally {\n lastCrashTimestamp = Date.now();\n }\n },\n\n handlePreventCrash(_this: ReactElement & { forceUpdate: () => void; }) {\n if (Date.now() - lastCrashTimestamp >= 1_000) {\n try {\n showNotification({\n color: \"#eed202\",\n title: \"Discord has crashed!\",\n body: \"Attempting to recover...\",\n noPersist: true,\n });\n } catch { }\n }\n\n try {\n FluxDispatcher.dispatch({ type: \"CONTEXT_MENU_CLOSE\" });\n } catch (err) {\n CrashHandlerLogger.debug(\"Failed to close open context menu.\", err);\n }\n try {\n ModalStack?.popAll();\n } catch (err) {\n CrashHandlerLogger.debug(\"Failed to close old modals.\", err);\n }\n try {\n closeAllModals();\n } catch (err) {\n CrashHandlerLogger.debug(\"Failed to close all open modals.\", err);\n }\n try {\n FluxDispatcher.dispatch({ type: \"USER_PROFILE_MODAL_CLOSE\" });\n } catch (err) {\n CrashHandlerLogger.debug(\"Failed to close user popout.\", err);\n }\n try {\n FluxDispatcher.dispatch({ type: \"LAYER_POP_ALL\" });\n } catch (err) {\n CrashHandlerLogger.debug(\"Failed to pop all layers.\", err);\n }\n if (settings.store.attemptToNavigateToHome) {\n try {\n NavigationRouter.transitionTo(\"/channels/@me\");\n } catch (err) {\n CrashHandlerLogger.debug(\"Failed to navigate to home\", err);\n }\n }\n\n try {\n shouldAttemptNextHandle = true;\n _this.forceUpdate();\n } catch (err) {\n CrashHandlerLogger.debug(\"Failed to update crash handler component.\", err);\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function isTruthy(item: T): item is Exclude {\n return Boolean(item);\n}\n\nexport function isNonNullish(item: T): item is Exclude {\n return item != null;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings, Settings } from \"@api/Settings\";\nimport { Link } from \"@components/Link\";\nimport { Devs } from \"@utils/constants\";\nimport { isTruthy } from \"@utils/guards\";\nimport { useAwaiter } from \"@utils/react\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy, findComponentByCodeLazy } from \"@webpack\";\nimport { ApplicationAssetUtils, FluxDispatcher, Forms, GuildStore, React, SelectedChannelStore, SelectedGuildStore, UserStore } from \"@webpack/common\";\n\nconst ActivityComponent = findComponentByCodeLazy(\"onOpenGameProfile\");\nconst ActivityClassName = findByPropsLazy(\"activity\", \"buttonColor\");\nconst Colors = findByPropsLazy(\"profileColors\");\n\nasync function getApplicationAsset(key: string): Promise {\n if (/https?:\\/\\/(cdn|media)\\.discordapp\\.(com|net)\\/attachments\\//.test(key)) return \"mp:\" + key.replace(/https?:\\/\\/(cdn|media)\\.discordapp\\.(com|net)\\//, \"\");\n return (await ApplicationAssetUtils.fetchAssetIds(settings.store.appID!, [key]))[0];\n}\n\ninterface ActivityAssets {\n large_image?: string;\n large_text?: string;\n small_image?: string;\n small_text?: string;\n}\n\ninterface Activity {\n state?: string;\n details?: string;\n timestamps?: {\n start?: number;\n end?: number;\n };\n assets?: ActivityAssets;\n buttons?: Array;\n name: string;\n application_id: string;\n metadata?: {\n button_urls?: Array;\n };\n type: ActivityType;\n url?: string;\n flags: number;\n}\n\nconst enum ActivityType {\n PLAYING = 0,\n STREAMING = 1,\n LISTENING = 2,\n WATCHING = 3,\n COMPETING = 5\n}\n\nconst enum TimestampMode {\n NONE,\n NOW,\n TIME,\n CUSTOM,\n}\n\nconst settings = definePluginSettings({\n appID: {\n type: OptionType.STRING,\n description: \"Application ID (required)\",\n onChange: onChange,\n isValid: (value: string) => {\n if (!value) return \"Application ID is required.\";\n if (value && !/^\\d+$/.test(value)) return \"Application ID must be a number.\";\n return true;\n }\n },\n appName: {\n type: OptionType.STRING,\n description: \"Application name (required)\",\n onChange: onChange,\n isValid: (value: string) => {\n if (!value) return \"Application name is required.\";\n if (value.length > 128) return \"Application name must be not longer than 128 characters.\";\n return true;\n }\n },\n details: {\n type: OptionType.STRING,\n description: \"Details (line 1)\",\n onChange: onChange,\n isValid: (value: string) => {\n if (value && value.length > 128) return \"Details (line 1) must be not longer than 128 characters.\";\n return true;\n }\n },\n state: {\n type: OptionType.STRING,\n description: \"State (line 2)\",\n onChange: onChange,\n isValid: (value: string) => {\n if (value && value.length > 128) return \"State (line 2) must be not longer than 128 characters.\";\n return true;\n }\n },\n type: {\n type: OptionType.SELECT,\n description: \"Activity type\",\n onChange: onChange,\n options: [\n {\n label: \"Playing\",\n value: ActivityType.PLAYING,\n default: true\n },\n {\n label: \"Streaming\",\n value: ActivityType.STREAMING\n },\n {\n label: \"Listening\",\n value: ActivityType.LISTENING\n },\n {\n label: \"Watching\",\n value: ActivityType.WATCHING\n },\n {\n label: \"Competing\",\n value: ActivityType.COMPETING\n }\n ]\n },\n streamLink: {\n type: OptionType.STRING,\n description: \"Twitch.tv or Youtube.com link (only for Streaming activity type)\",\n onChange: onChange,\n disabled: isStreamLinkDisabled,\n isValid: isStreamLinkValid\n },\n timestampMode: {\n type: OptionType.SELECT,\n description: \"Timestamp mode\",\n onChange: onChange,\n options: [\n {\n label: \"None\",\n value: TimestampMode.NONE,\n default: true\n },\n {\n label: \"Since discord open\",\n value: TimestampMode.NOW\n },\n {\n label: \"Same as your current time\",\n value: TimestampMode.TIME\n },\n {\n label: \"Custom\",\n value: TimestampMode.CUSTOM\n }\n ]\n },\n startTime: {\n type: OptionType.NUMBER,\n description: \"Start timestamp (only for custom timestamp mode)\",\n onChange: onChange,\n disabled: isTimestampDisabled,\n isValid: (value: number) => {\n if (value && value < 0) return \"Start timestamp must be greater than 0.\";\n return true;\n }\n },\n endTime: {\n type: OptionType.NUMBER,\n description: \"End timestamp (only for custom timestamp mode)\",\n onChange: onChange,\n disabled: isTimestampDisabled,\n isValid: (value: number) => {\n if (value && value < 0) return \"End timestamp must be greater than 0.\";\n return true;\n }\n },\n imageBig: {\n type: OptionType.STRING,\n description: \"Big image key/link\",\n onChange: onChange,\n isValid: isImageKeyValid\n },\n imageBigTooltip: {\n type: OptionType.STRING,\n description: \"Big image tooltip\",\n onChange: onChange,\n isValid: (value: string) => {\n if (value && value.length > 128) return \"Big image tooltip must be not longer than 128 characters.\";\n return true;\n }\n },\n imageSmall: {\n type: OptionType.STRING,\n description: \"Small image key/link\",\n onChange: onChange,\n isValid: isImageKeyValid\n },\n imageSmallTooltip: {\n type: OptionType.STRING,\n description: \"Small image tooltip\",\n onChange: onChange,\n isValid: (value: string) => {\n if (value && value.length > 128) return \"Small image tooltip must be not longer than 128 characters.\";\n return true;\n }\n },\n buttonOneText: {\n type: OptionType.STRING,\n description: \"Button 1 text\",\n onChange: onChange,\n isValid: (value: string) => {\n if (value && value.length > 31) return \"Button 1 text must be not longer than 31 characters.\";\n return true;\n }\n },\n buttonOneURL: {\n type: OptionType.STRING,\n description: \"Button 1 URL\",\n onChange: onChange\n },\n buttonTwoText: {\n type: OptionType.STRING,\n description: \"Button 2 text\",\n onChange: onChange,\n isValid: (value: string) => {\n if (value && value.length > 31) return \"Button 2 text must be not longer than 31 characters.\";\n return true;\n }\n },\n buttonTwoURL: {\n type: OptionType.STRING,\n description: \"Button 2 URL\",\n onChange: onChange\n }\n});\n\nfunction onChange() {\n setRpc(true);\n if (Settings.plugins.CustomRPC.enabled) setRpc();\n}\n\nfunction isStreamLinkDisabled() {\n return settings.store.type !== ActivityType.STREAMING;\n}\n\nfunction isStreamLinkValid(value: string) {\n if (!isStreamLinkDisabled() && !/https?:\\/\\/(www\\.)?(twitch\\.tv|youtube\\.com)\\/\\w+/.test(value)) return \"Streaming link must be a valid URL.\";\n return true;\n}\n\nfunction isTimestampDisabled() {\n return settings.store.timestampMode !== TimestampMode.CUSTOM;\n}\n\nfunction isImageKeyValid(value: string) {\n if (/https?:\\/\\/(?!i\\.)?imgur\\.com\\//.test(value)) return \"Imgur link must be a direct link to the image. (e.g. https://i.imgur.com/...)\";\n if (/https?:\\/\\/(?!media\\.)?tenor\\.com\\//.test(value)) return \"Tenor link must be a direct link to the image. (e.g. https://media.tenor.com/...)\";\n return true;\n}\n\nasync function createActivity(): Promise {\n const {\n appID,\n appName,\n details,\n state,\n type,\n streamLink,\n startTime,\n endTime,\n imageBig,\n imageBigTooltip,\n imageSmall,\n imageSmallTooltip,\n buttonOneText,\n buttonOneURL,\n buttonTwoText,\n buttonTwoURL\n } = settings.store;\n\n if (!appName) return;\n\n const activity: Activity = {\n application_id: appID || \"0\",\n name: appName,\n state,\n details,\n type,\n flags: 1 << 0,\n };\n\n if (type === ActivityType.STREAMING) activity.url = streamLink;\n\n switch (settings.store.timestampMode) {\n case TimestampMode.NOW:\n activity.timestamps = {\n start: Math.floor(Date.now() / 1000)\n };\n break;\n case TimestampMode.TIME:\n activity.timestamps = {\n start: Math.floor(Date.now() / 1000) - (new Date().getHours() * 3600) - (new Date().getMinutes() * 60) - new Date().getSeconds()\n };\n break;\n case TimestampMode.CUSTOM:\n if (startTime || endTime) {\n activity.timestamps = {};\n if (startTime) activity.timestamps.start = startTime;\n if (endTime) activity.timestamps.end = endTime;\n }\n break;\n case TimestampMode.NONE:\n default:\n break;\n }\n\n if (buttonOneText) {\n activity.buttons = [\n buttonOneText,\n buttonTwoText\n ].filter(isTruthy);\n\n activity.metadata = {\n button_urls: [\n buttonOneURL,\n buttonTwoURL\n ].filter(isTruthy)\n };\n }\n\n if (imageBig) {\n activity.assets = {\n large_image: await getApplicationAsset(imageBig),\n large_text: imageBigTooltip || undefined\n };\n }\n\n if (imageSmall) {\n activity.assets = {\n ...activity.assets,\n small_image: await getApplicationAsset(imageSmall),\n small_text: imageSmallTooltip || undefined\n };\n }\n\n\n for (const k in activity) {\n if (k === \"type\") continue;\n const v = activity[k];\n if (!v || v.length === 0)\n delete activity[k];\n }\n\n return activity;\n}\n\nasync function setRpc(disable?: boolean) {\n const activity: Activity | undefined = await createActivity();\n\n FluxDispatcher.dispatch({\n type: \"LOCAL_ACTIVITY_UPDATE\",\n activity: !disable ? activity : null,\n socketId: \"CustomRPC\",\n });\n}\n\nexport default definePlugin({\n name: \"CustomRPC\",\n description: \"Allows you to set a custom rich presence.\",\n authors: [Devs.captain, Devs.AutumnVN],\n start: setRpc,\n stop: () => setRpc(true),\n settings,\n\n settingsAboutComponent: () => {\n const activity = useAwaiter(createActivity);\n return (\n <>\n \n Go to Discord Developer Portal to create an application and\n get the application ID.\n \n \n Upload images in the Rich Presence tab to get the image keys.\n \n \n If you want to use image link, download your image and reupload the image to Imgur and get the image link by right-clicking the image and select \"Copy image address\".\n \n \n
\n {activity[0] && }\n
\n \n );\n }\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport \"./styles.css\";\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport definePlugin from \"@utils/types\";\nimport { Tooltip } from \"@webpack/common\";\nimport type { Component } from \"react\";\n\ninterface Props {\n embed: {\n rawTitle: string;\n provider?: {\n name: string;\n };\n thumbnail: {\n proxyURL: string;\n };\n video: {\n url: string;\n };\n\n dearrow: {\n enabled: boolean;\n oldTitle?: string;\n oldThumb?: string;\n };\n };\n}\n\nconst embedUrlRe = /https:\\/\\/www\\.youtube\\.com\\/embed\\/([a-zA-Z0-9_-]{11})/;\n\nasync function embedDidMount(this: Component) {\n try {\n const { embed } = this.props;\n if (!embed || embed.dearrow || embed.provider?.name !== \"YouTube\" || !embed.video?.url) return;\n\n const videoId = embedUrlRe.exec(embed.video.url)?.[1];\n if (!videoId) return;\n\n const res = await fetch(`https://sponsor.ajay.app/api/branding?videoID=${videoId}`);\n if (!res.ok) return;\n\n const { titles, thumbnails } = await res.json();\n\n const hasTitle = titles[0]?.votes >= 0;\n const hasThumb = thumbnails[0]?.votes >= 0 && !thumbnails[0].original;\n\n if (!hasTitle && !hasThumb) return;\n\n embed.dearrow = {\n enabled: true\n };\n\n if (hasTitle) {\n embed.dearrow.oldTitle = embed.rawTitle;\n embed.rawTitle = titles[0].title;\n }\n\n if (hasThumb) {\n embed.dearrow.oldThumb = embed.thumbnail.proxyURL;\n embed.thumbnail.proxyURL = `https://dearrow-thumb.ajay.app/api/v1/getThumbnail?videoID=${videoId}&time=${thumbnails[0].timestamp}`;\n }\n\n this.forceUpdate();\n } catch (err) {\n new Logger(\"Dearrow\").error(\"Failed to dearrow embed\", err);\n }\n}\n\nfunction DearrowButton({ component }: { component: Component; }) {\n const { embed } = component.props;\n if (!embed?.dearrow) return null;\n\n return (\n \n {({ onMouseEnter, onMouseLeave }) => (\n {\n const { enabled, oldThumb, oldTitle } = embed.dearrow;\n embed.dearrow.enabled = !enabled;\n if (oldTitle) {\n embed.dearrow.oldTitle = embed.rawTitle;\n embed.rawTitle = oldTitle;\n }\n if (oldThumb) {\n embed.dearrow.oldThumb = embed.thumbnail.proxyURL;\n embed.thumbnail.proxyURL = oldThumb;\n }\n\n component.forceUpdate();\n }}\n >\n {/* Dearrow Icon, taken from https://dearrow.ajay.app/logo.svg (and optimised) */}\n \n \n \n \n \n\n \n )}\n \n );\n}\n\nexport default definePlugin({\n name: \"Dearrow\",\n description: \"Makes YouTube embed titles and thumbnails less sensationalist, powered by Dearrow\",\n authors: [Devs.Ven],\n\n embedDidMount,\n renderButton(component: Component) {\n return (\n \n \n \n );\n },\n\n patches: [{\n find: \"this.renderInlineMediaEmbed\",\n replacement: [\n // patch componentDidMount to replace embed thumbnail and title\n {\n match: /render\\(\\)\\{let\\{embed:/,\n replace: \"componentDidMount=$self.embedDidMount;$&\"\n },\n\n // add dearrow button\n {\n match: /children:\\[(?=null!=\\i\\?\\i\\.renderSuppressButton)/,\n replace: \"children:[$self.renderButton(this),\"\n }\n ]\n }],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"DisableDMCallIdle\",\n description: \"Disables automatically getting kicked from a DM voice call after 3 minutes.\",\n authors: [Devs.Nuckyz],\n patches: [\n {\n find: \".Messages.BOT_CALL_IDLE_DISCONNECT\",\n replacement: {\n match: /(?<=function \\i\\(\\){)(?=.{1,120}\\.Messages\\.BOT_CALL_IDLE_DISCONNECT)/,\n replace: \"return;\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { CheckedTextInput } from \"@components/CheckedTextInput\";\nimport { Devs } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport { Margins } from \"@utils/margins\";\nimport { ModalContent, ModalHeader, ModalRoot, openModalLazy } from \"@utils/modal\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy, findStoreLazy } from \"@webpack\";\nimport { EmojiStore, FluxDispatcher, Forms, GuildStore, Menu, PermissionsBits, PermissionStore, React, RestAPI, Toasts, Tooltip, UserStore } from \"@webpack/common\";\nimport { Promisable } from \"type-fest\";\n\nconst StickersStore = findStoreLazy(\"StickersStore\");\nconst EmojiManager = findByPropsLazy(\"fetchEmoji\", \"uploadEmoji\", \"deleteEmoji\");\n\ninterface Sticker {\n t: \"Sticker\";\n description: string;\n format_type: number;\n guild_id: string;\n id: string;\n name: string;\n tags: string;\n type: number;\n}\n\ninterface Emoji {\n t: \"Emoji\";\n id: string;\n name: string;\n isAnimated: boolean;\n}\n\ntype Data = Emoji | Sticker;\n\nconst StickerExt = [, \"png\", \"png\", \"json\", \"gif\"] as const;\n\nfunction getUrl(data: Data) {\n if (data.t === \"Emoji\")\n return `${location.protocol}//${window.GLOBAL_ENV.CDN_HOST}/emojis/${data.id}.${data.isAnimated ? \"gif\" : \"png\"}`;\n\n return `${location.origin}/stickers/${data.id}.${StickerExt[data.format_type]}`;\n}\n\nasync function fetchSticker(id: string) {\n const cached = StickersStore.getStickerById(id);\n if (cached) return cached;\n\n const { body } = await RestAPI.get({\n url: `/stickers/${id}`\n });\n\n FluxDispatcher.dispatch({\n type: \"STICKER_FETCH_SUCCESS\",\n sticker: body\n });\n\n return body as Sticker;\n}\n\nasync function cloneSticker(guildId: string, sticker: Sticker) {\n const data = new FormData();\n data.append(\"name\", sticker.name);\n data.append(\"tags\", sticker.tags);\n data.append(\"description\", sticker.description);\n data.append(\"file\", await fetchBlob(getUrl(sticker)));\n\n const { body } = await RestAPI.post({\n url: `/guilds/${guildId}/stickers`,\n body: data,\n });\n\n FluxDispatcher.dispatch({\n type: \"GUILD_STICKERS_CREATE_SUCCESS\",\n guildId,\n sticker: {\n ...body,\n user: UserStore.getCurrentUser()\n }\n });\n}\n\nasync function cloneEmoji(guildId: string, emoji: Emoji) {\n const data = await fetchBlob(getUrl(emoji));\n\n const dataUrl = await new Promise(resolve => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result as string);\n reader.readAsDataURL(data);\n });\n\n return EmojiManager.uploadEmoji({\n guildId,\n name: emoji.name.split(\"~\")[0],\n image: dataUrl\n });\n}\n\nfunction getGuildCandidates(data: Data) {\n const meId = UserStore.getCurrentUser().id;\n\n return Object.values(GuildStore.getGuilds()).filter(g => {\n const canCreate = g.ownerId === meId ||\n (PermissionStore.getGuildPermissions({ id: g.id }) & PermissionsBits.CREATE_GUILD_EXPRESSIONS) === PermissionsBits.CREATE_GUILD_EXPRESSIONS;\n if (!canCreate) return false;\n\n if (data.t === \"Sticker\") return true;\n\n const { isAnimated } = data as Emoji;\n\n const emojiSlots = g.getMaxEmojiSlots();\n const { emojis } = EmojiStore.getGuilds()[g.id];\n\n let count = 0;\n for (const emoji of emojis)\n if (emoji.animated === isAnimated) count++;\n return count < emojiSlots;\n }).sort((a, b) => a.name.localeCompare(b.name));\n}\n\nasync function fetchBlob(url: string) {\n const res = await fetch(url);\n if (!res.ok)\n throw new Error(`Failed to fetch ${url} - ${res.status}`);\n\n return res.blob();\n}\n\nasync function doClone(guildId: string, data: Sticker | Emoji) {\n try {\n if (data.t === \"Sticker\")\n await cloneSticker(guildId, data);\n else\n await cloneEmoji(guildId, data);\n\n Toasts.show({\n message: `Successfully cloned ${data.name} to ${GuildStore.getGuild(guildId)?.name ?? \"your server\"}!`,\n type: Toasts.Type.SUCCESS,\n id: Toasts.genId()\n });\n } catch (e: any) {\n let message = \"Something went wrong (check console!)\";\n try {\n message = JSON.parse(e.text).message;\n } catch { }\n\n new Logger(\"EmoteCloner\").error(\"Failed to clone\", data.name, \"to\", guildId, e);\n Toasts.show({\n message: \"Failed to clone: \" + message,\n type: Toasts.Type.FAILURE,\n id: Toasts.genId()\n });\n }\n}\n\nconst getFontSize = (s: string) => {\n // [18, 18, 16, 16, 14, 12, 10]\n const sizes = [20, 20, 18, 18, 16, 14, 12];\n return sizes[s.length] ?? 4;\n};\n\nconst nameValidator = /^\\w+$/i;\n\nfunction CloneModal({ data }: { data: Sticker | Emoji; }) {\n const [isCloning, setIsCloning] = React.useState(false);\n const [name, setName] = React.useState(data.name);\n\n const [x, invalidateMemo] = React.useReducer(x => x + 1, 0);\n\n const guilds = React.useMemo(() => getGuildCandidates(data), [data.id, x]);\n\n return (\n <>\n Custom Name\n {\n data.name = v;\n setName(v);\n }}\n validate={v =>\n (data.t === \"Emoji\" && v.length > 2 && v.length < 32 && nameValidator.test(v))\n || (data.t === \"Sticker\" && v.length > 2 && v.length < 30)\n || \"Name must be between 2 and 32 characters and only contain alphanumeric characters\"\n }\n />\n
\n {guilds.map(g => (\n \n {({ onMouseLeave, onMouseEnter }) => (\n {\n setIsCloning(true);\n doClone(g.id, data).finally(() => {\n invalidateMemo();\n setIsCloning(false);\n });\n }}\n >\n {g.icon ? (\n \n ) : (\n \n {g.acronym}\n \n )}\n
\n )}\n \n ))}\n \n \n );\n}\n\nfunction buildMenuItem(type: \"Emoji\" | \"Sticker\", fetchData: () => Promisable>) {\n return (\n \n openModalLazy(async () => {\n const res = await fetchData();\n const data = { t: type, ...res } as Sticker | Emoji;\n const url = getUrl(data);\n\n return modalProps => (\n \n \n \n Clone {data.name}\n \n \n \n \n \n );\n })\n }\n />\n );\n}\n\nfunction isGifUrl(url: string) {\n return new URL(url).pathname.endsWith(\".gif\");\n}\n\nconst messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) => () => {\n const { favoriteableId, itemHref, itemSrc, favoriteableType } = props ?? {};\n\n if (!favoriteableId) return;\n\n const menuItem = (() => {\n switch (favoriteableType) {\n case \"emoji\":\n const match = props.message.content.match(RegExp(`|https://cdn\\\\.discordapp\\\\.com/emojis/${favoriteableId}\\\\.`));\n if (!match) return;\n const name = match[1] ?? \"FakeNitroEmoji\";\n\n return buildMenuItem(\"Emoji\", () => ({\n id: favoriteableId,\n name,\n isAnimated: isGifUrl(itemHref ?? itemSrc)\n }));\n case \"sticker\":\n const sticker = props.message.stickerItems.find(s => s.id === favoriteableId);\n if (sticker?.format_type === 3 /* LOTTIE */) return;\n\n return buildMenuItem(\"Sticker\", () => fetchSticker(favoriteableId));\n }\n })();\n\n if (menuItem)\n findGroupChildrenByChildId(\"copy-link\", children)?.push(menuItem);\n};\n\nconst expressionPickerPatch: NavContextMenuPatchCallback = (children, props: { target: HTMLElement; }) => () => {\n const { id, name, type } = props?.target?.dataset ?? {};\n if (!id) return;\n\n if (type === \"emoji\" && name) {\n const firstChild = props.target.firstChild as HTMLImageElement;\n\n children.push(buildMenuItem(\"Emoji\", () => ({\n id,\n name,\n isAnimated: firstChild && isGifUrl(firstChild.src)\n })));\n } else if (type === \"sticker\" && !props.target.className?.includes(\"lottieCanvas\")) {\n children.push(buildMenuItem(\"Sticker\", () => fetchSticker(id)));\n }\n};\n\nexport default definePlugin({\n name: \"EmoteCloner\",\n description: \"Allows you to clone Emotes & Stickers to your own server (right click them)\",\n tags: [\"StickerCloner\"],\n authors: [Devs.Ven, Devs.Nuckyz],\n\n start() {\n addContextMenuPatch(\"message\", messageContextMenuPatch);\n addContextMenuPatch(\"expression-picker\", expressionPickerPatch);\n },\n\n stop() {\n removeContextMenuPatch(\"message\", messageContextMenuPatch);\n removeContextMenuPatch(\"expression-picker\", expressionPickerPatch);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { ErrorCard } from \"@components/ErrorCard\";\nimport { Devs } from \"@utils/constants\";\nimport { Margins } from \"@utils/margins\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { Forms, React } from \"@webpack/common\";\n\nconst KbdStyles = findByPropsLazy(\"key\", \"removeBuildOverride\");\n\nconst settings = definePluginSettings({\n enableIsStaff: {\n description: \"Enable isStaff\",\n type: OptionType.BOOLEAN,\n default: false,\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"Experiments\",\n description: \"Enable Access to Experiments in Discord!\",\n authors: [\n Devs.Megu,\n Devs.Ven,\n Devs.Nickyux,\n Devs.BanTheNons,\n Devs.Nuckyz\n ],\n settings,\n\n patches: [\n {\n find: \"Object.defineProperties(this,{isDeveloper\",\n replacement: {\n match: /(?<={isDeveloper:\\{[^}]+?,get:\\(\\)=>)\\i/,\n replace: \"true\"\n }\n },\n {\n find: 'type:\"user\",revision',\n replacement: {\n match: /!(\\i)&&\"CONNECTION_OPEN\".+?;/g,\n replace: \"$1=!0;\"\n }\n },\n {\n find: \".isStaff=()\",\n predicate: () => settings.store.enableIsStaff,\n replacement: [\n {\n match: /=>*?(\\i)\\.hasFlag\\((\\i\\.\\i)\\.STAFF\\)}/,\n replace: (_, user, flags) => `=>Vencord.Webpack.Common.UserStore.getCurrentUser()?.id===${user}.id||${user}.hasFlag(${flags}.STAFF)}`\n },\n {\n match: /hasFreePremium\\(\\){return this.isStaff\\(\\)\\s*?\\|\\|/,\n replace: \"hasFreePremium(){return \",\n }\n ]\n },\n {\n find: 'H1,title:\"Experiments\"',\n replacement: {\n match: 'title:\"Experiments\",children:[',\n replace: \"$&$self.WarningCard(),\"\n }\n }\n ],\n\n settingsAboutComponent: () => {\n const isMacOS = navigator.platform.includes(\"Mac\");\n const modKey = isMacOS ? \"cmd\" : \"ctrl\";\n const altKey = isMacOS ? \"opt\" : \"alt\";\n return (\n \n More Information\n \n You can enable client DevTools{\" \"}\n {modKey} +{\" \"}\n {altKey} +{\" \"}\n O{\" \"}\n after enabling isStaff below\n \n \n and then toggling Enable DevTools in the Developer Options tab in settings.\n \n \n );\n },\n\n WarningCard: ErrorBoundary.wrap(() => (\n \n Hold on!!\n\n \n Experiments are unreleased Discord features. They might not work, or even break your client or get your account disabled.\n \n\n \n Only use experiments if you know what you're doing. Vencord is not responsible for any damage caused by enabling experiments.\n \n \n ), { noop: true })\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"F8Break\",\n description: \"Pause the client when you press F8 with DevTools (+ breakpoints) open.\",\n authors: [Devs.lewisakura],\n\n start() {\n window.addEventListener(\"keydown\", this.event);\n },\n\n stop() {\n window.removeEventListener(\"keydown\", this.event);\n },\n\n event(e: KeyboardEvent) {\n if (e.code === \"F8\") {\n // Hi! You've just paused the client. Pressing F8 in DevTools or in the main window will unpause it again.\n // It's up to you on what to do, friend. Happy travels!\n debugger;\n }\n }\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nexport let EXTENSION_BASE_URL: string;\nexport let EXTENSION_VERSION: string;\n\nif (IS_EXTENSION) {\n const script = document.querySelector(\"#vencord-script\") as HTMLScriptElement;\n EXTENSION_BASE_URL = script.dataset.extensionBaseUrl!;\n EXTENSION_VERSION = script.dataset.version!;\n}\n", "/* eslint-disable */\n\nconst self = module.exports;\n/**\n * apng-canvas v2.1.2\n *\n * @copyright 2011-2019 David Mzareulyan\n * @link https://github.com/davidmz/apng-canvas\n * @license MIT\n */\n!(function i(o, a, s) {\n function u(n, t) {\n if (!a[n]) {\n if (!o[n]) {\n var e = \"function\" == typeof require && require;\n if (!t && e) return e(n, !0);\n if (c) return c(n, !0);\n throw new Error(\"Cannot find module '\" + n + \"'\");\n }\n var r = (a[n] = { exports: {} });\n o[n][0].call(\n r.exports,\n function (t) {\n var e = o[n][1][t];\n return u(e || t);\n },\n r,\n r.exports,\n i,\n o,\n a,\n s\n );\n }\n return a[n].exports;\n }\n for (\n var c = \"function\" == typeof require && require, t = 0;\n t < s.length;\n t++\n )\n u(s[t]);\n return u;\n})(\n {\n 1: [\n function (Y, n, r) {\n (function (G, q) {\n var t, e;\n (t = this),\n (e = function () {\n \"use strict\";\n function u(t) {\n return \"function\" == typeof t;\n }\n var n = Array.isArray\n ? Array.isArray\n : function (t) {\n return (\n \"[object Array]\" ===\n Object.prototype.toString.call(t)\n );\n },\n r = 0,\n e = void 0,\n i = void 0,\n a = function (t, e) {\n (l[r] = t),\n (l[r + 1] = e),\n 2 === (r += 2) && (i ? i(d) : g());\n };\n var t =\n \"undefined\" != typeof window\n ? window\n : void 0,\n o = t || {},\n s =\n o.MutationObserver ||\n o.WebKitMutationObserver,\n c =\n \"undefined\" == typeof self &&\n void 0 !== G &&\n \"[object process]\" === {}.toString.call(G),\n f =\n \"undefined\" != typeof Uint8ClampedArray &&\n \"undefined\" != typeof importScripts &&\n \"undefined\" != typeof MessageChannel;\n function h() {\n var t = setTimeout;\n return function () {\n return t(d, 1);\n };\n }\n var l = new Array(1e3);\n function d() {\n for (var t = 0; t < r; t += 2) {\n (0, l[t])(l[t + 1]),\n (l[t] = void 0),\n (l[t + 1] = void 0);\n }\n r = 0;\n }\n var p,\n v,\n A,\n m,\n g = void 0;\n function w(t, e) {\n var n = this,\n r = new this.constructor(b);\n void 0 === r[_] && j(r);\n var i = n._state;\n if (i) {\n var o = arguments[i - 1];\n a(function () {\n return L(i, r, o, n._result);\n });\n } else U(n, r, t, e);\n return r;\n }\n function y(t) {\n if (\n t &&\n \"object\" == typeof t &&\n t.constructor === this\n )\n return t;\n var e = new this(b);\n return T(e, t), e;\n }\n g = c\n ? function () {\n return G.nextTick(d);\n }\n : s\n ? ((v = 0),\n (A = new s(d)),\n (m = document.createTextNode(\"\")),\n A.observe(m, { characterData: !0 }),\n function () {\n m.data = v = ++v % 2;\n })\n : f\n ? (((p = new MessageChannel()).port1.onmessage =\n d),\n function () {\n return p.port2.postMessage(0);\n })\n : void 0 === t && \"function\" == typeof Y\n ? (function () {\n try {\n var t =\n Function(\"return this\")().require(\n \"vertx\"\n );\n return void 0 !==\n (e =\n t.runOnLoop || t.runOnContext)\n ? function () {\n e(d);\n }\n : h();\n } catch (t) {\n return h();\n }\n })()\n : h();\n var _ = Math.random().toString(36).substring(2);\n function b() { }\n var E = void 0,\n P = 1,\n x = 2;\n function N(t, r, i) {\n a(function (e) {\n var n = !1,\n t = (function (t, e, n, r) {\n try {\n t.call(e, n, r);\n } catch (t) {\n return t;\n }\n })(\n i,\n r,\n function (t) {\n n ||\n ((n = !0),\n r !== t\n ? T(e, t)\n : O(e, t));\n },\n function (t) {\n n || ((n = !0), R(e, t));\n },\n e._label\n );\n !n && t && ((n = !0), R(e, t));\n }, t);\n }\n function C(t, e, n) {\n e.constructor === t.constructor &&\n n === w &&\n e.constructor.resolve === y\n ? (function (e, t) {\n t._state === P\n ? O(e, t._result)\n : t._state === x\n ? R(e, t._result)\n : U(\n t,\n void 0,\n function (t) {\n return T(e, t);\n },\n function (t) {\n return R(e, t);\n }\n );\n })(t, e)\n : void 0 === n\n ? O(t, e)\n : u(n)\n ? N(t, e, n)\n : O(t, e);\n }\n function T(e, t) {\n if (e === t)\n R(\n e,\n new TypeError(\n \"You cannot resolve a promise with itself\"\n )\n );\n else if (\n (function (t) {\n var e = typeof t;\n return (\n null !== t &&\n (\"object\" == e || \"function\" == e)\n );\n })(t)\n ) {\n var n = void 0;\n try {\n n = t.then;\n } catch (t) {\n return void R(e, t);\n }\n C(e, t, n);\n } else O(e, t);\n }\n function B(t) {\n t._onerror && t._onerror(t._result), I(t);\n }\n function O(t, e) {\n t._state === E &&\n ((t._result = e),\n (t._state = P),\n 0 !== t._subscribers.length && a(I, t));\n }\n function R(t, e) {\n t._state === E &&\n ((t._state = x), (t._result = e), a(B, t));\n }\n function U(t, e, n, r) {\n var i = t._subscribers,\n o = i.length;\n (t._onerror = null),\n (i[o] = e),\n (i[o + P] = n),\n (i[o + x] = r),\n 0 === o && t._state && a(I, t);\n }\n function I(t) {\n var e = t._subscribers,\n n = t._state;\n if (0 !== e.length) {\n for (\n var r = void 0,\n i = void 0,\n o = t._result,\n a = 0;\n a < e.length;\n a += 3\n )\n (r = e[a]),\n (i = e[a + n]),\n r ? L(n, r, i, o) : i(o);\n t._subscribers.length = 0;\n }\n }\n function L(t, e, n, r) {\n var i = u(n),\n o = void 0,\n a = void 0,\n s = !0;\n if (i) {\n try {\n o = n(r);\n } catch (t) {\n (s = !1), (a = t);\n }\n if (e === o)\n return void R(\n e,\n new TypeError(\n \"A promises callback cannot return that same promise.\"\n )\n );\n } else o = r;\n e._state !== E ||\n (i && s\n ? T(e, o)\n : !1 === s\n ? R(e, a)\n : t === P\n ? O(e, o)\n : t === x && R(e, o));\n }\n var D = 0;\n function j(t) {\n (t[_] = D++),\n (t._state = void 0),\n (t._result = void 0),\n (t._subscribers = []);\n }\n var k =\n ((F.prototype._enumerate = function (t) {\n for (\n var e = 0;\n this._state === E && e < t.length;\n e++\n )\n this._eachEntry(t[e], e);\n }),\n (F.prototype._eachEntry = function (e, t) {\n var n = this._instanceConstructor,\n r = n.resolve;\n if (r === y) {\n var i = void 0,\n o = void 0,\n a = !1;\n try {\n i = e.then;\n } catch (t) {\n (a = !0), (o = t);\n }\n if (i === w && e._state !== E)\n this._settledAt(\n e._state,\n t,\n e._result\n );\n else if (\"function\" != typeof i)\n this._remaining--,\n (this._result[t] = e);\n else if (n === S) {\n var s = new n(b);\n a ? R(s, o) : C(s, e, i),\n this._willSettleAt(s, t);\n } else\n this._willSettleAt(\n new n(function (t) {\n return t(e);\n }),\n t\n );\n } else this._willSettleAt(r(e), t);\n }),\n (F.prototype._settledAt = function (t, e, n) {\n var r = this.promise;\n r._state === E &&\n (this._remaining--,\n t === x\n ? R(r, n)\n : (this._result[e] = n)),\n 0 === this._remaining &&\n O(r, this._result);\n }),\n (F.prototype._willSettleAt = function (t, e) {\n var n = this;\n U(\n t,\n void 0,\n function (t) {\n return n._settledAt(P, e, t);\n },\n function (t) {\n return n._settledAt(x, e, t);\n }\n );\n }),\n F);\n function F(t, e) {\n (this._instanceConstructor = t),\n (this.promise = new t(b)),\n this.promise[_] || j(this.promise),\n n(e)\n ? ((this.length = e.length),\n (this._remaining = e.length),\n (this._result = new Array(\n this.length\n )),\n 0 === this.length\n ? O(this.promise, this._result)\n : ((this.length =\n this.length || 0),\n this._enumerate(e),\n 0 === this._remaining &&\n O(\n this.promise,\n this._result\n )))\n : R(\n this.promise,\n new Error(\n \"Array Methods must be provided an Array\"\n )\n );\n }\n var S =\n ((M.prototype.catch = function (t) {\n return this.then(null, t);\n }),\n (M.prototype.finally = function (e) {\n var n = this.constructor;\n return u(e)\n ? this.then(\n function (t) {\n return n\n .resolve(e())\n .then(function () {\n return t;\n });\n },\n function (t) {\n return n\n .resolve(e())\n .then(function () {\n throw t;\n });\n }\n )\n : this.then(e, e);\n }),\n M);\n function M(t) {\n (this[_] = D++),\n (this._result = this._state = void 0),\n (this._subscribers = []),\n b !== t &&\n (\"function\" != typeof t &&\n (function () {\n throw new TypeError(\n \"You must pass a resolver function as the first argument to the promise constructor\"\n );\n })(),\n this instanceof M\n ? (function (e, t) {\n try {\n t(\n function (t) {\n T(e, t);\n },\n function (t) {\n R(e, t);\n }\n );\n } catch (t) {\n R(e, t);\n }\n })(this, t)\n : (function () {\n throw new TypeError(\n \"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\"\n );\n })());\n }\n return (\n (S.prototype.then = w),\n (S.all = function (t) {\n return new k(this, t).promise;\n }),\n (S.race = function (i) {\n var o = this;\n return n(i)\n ? new o(function (t, e) {\n for (\n var n = i.length, r = 0;\n r < n;\n r++\n )\n o.resolve(i[r]).then(t, e);\n })\n : new o(function (t, e) {\n return e(\n new TypeError(\n \"You must pass an array to race.\"\n )\n );\n });\n }),\n (S.resolve = y),\n (S.reject = function (t) {\n var e = new this(b);\n return R(e, t), e;\n }),\n (S._setScheduler = function (t) {\n i = t;\n }),\n (S._setAsap = function (t) {\n a = t;\n }),\n (S._asap = a),\n (S.polyfill = function () {\n var t = void 0;\n if (void 0 !== q) t = q;\n else if (\"undefined\" != typeof self)\n t = self;\n else\n try {\n t = Function(\"return this\")();\n } catch (t) {\n throw new Error(\n \"polyfill failed because global object is unavailable in this environment\"\n );\n }\n var e = t.Promise;\n if (e) {\n var n = null;\n try {\n n = Object.prototype.toString.call(\n e.resolve()\n );\n } catch (t) { }\n if (\"[object Promise]\" === n && !e.cast)\n return;\n }\n t.Promise = S;\n }),\n (S.Promise = S)\n );\n }),\n \"object\" == typeof r && void 0 !== n\n ? (n.exports = e())\n : \"function\" == typeof define && define.amd\n ? define(e)\n : (t.ES6Promise = e());\n }).call(\n this,\n Y(\"VCmEsw\"),\n \"undefined\" != typeof self\n ? self\n : \"undefined\" != typeof window\n ? window\n : {}\n );\n },\n { VCmEsw: 2 },\n ],\n 2: [\n function (t, e, n) {\n var r = (e.exports = {});\n function i() { }\n (r.nextTick = (function () {\n var t = \"undefined\" != typeof window && window.setImmediate,\n e =\n \"undefined\" != typeof window &&\n window.postMessage &&\n window.addEventListener;\n if (t)\n return function (t) {\n return window.setImmediate(t);\n };\n if (e) {\n var n = [];\n return (\n window.addEventListener(\n \"message\",\n function (t) {\n var e = t.source;\n (e !== window && null !== e) ||\n \"process-tick\" !== t.data ||\n (t.stopPropagation(),\n 0 < n.length && n.shift()());\n },\n !0\n ),\n function (t) {\n n.push(t),\n window.postMessage(\"process-tick\", \"*\");\n }\n );\n }\n return function (t) {\n setTimeout(t, 0);\n };\n })()),\n (r.title = \"browser\"),\n (r.browser = !0),\n (r.env = {}),\n (r.argv = []),\n (r.on = i),\n (r.addListener = i),\n (r.once = i),\n (r.off = i),\n (r.removeListener = i),\n (r.removeAllListeners = i),\n (r.emit = i),\n (r.binding = function (t) {\n throw new Error(\"process.binding is not supported\");\n }),\n (r.cwd = function () {\n return \"/\";\n }),\n (r.chdir = function (t) {\n throw new Error(\"process.chdir is not supported\");\n });\n },\n {},\n ],\n 3: [\n function (t, e, n) {\n \"use strict\";\n e.exports = function () {\n (this.width = 0),\n (this.height = 0),\n (this.numPlays = 0),\n (this.playTime = 0),\n (this.frames = []),\n (this.play = function () {\n s ||\n u ||\n (this.rewind(),\n (s = !0),\n requestAnimationFrame(e));\n }),\n (this.rewind = function () {\n (o = i = 0), (a = null), (u = s = !1);\n }),\n (this.addContext = function (t) {\n if (0 < c.length) {\n var e = c[0].getImageData(\n 0,\n 0,\n this.width,\n this.height\n );\n t.putImageData(e, 0, 0);\n }\n c.push(t), (t._apng_animation = this);\n }),\n (this.removeContext = function (t) {\n var e = c.indexOf(t);\n -1 !== e &&\n (c.splice(e, 1),\n 0 === c.length && this.rewind(),\n \"_apng_animation\" in t &&\n delete t._apng_animation);\n }),\n (this.isPlayed = function () {\n return s;\n }),\n (this.isFinished = function () {\n return u;\n });\n var r = this,\n i = 0,\n o = 0,\n a = null,\n s = !1,\n u = !1,\n c = [],\n e = function (t) {\n for (; s && i <= t;) n(t);\n s && requestAnimationFrame(e);\n },\n n = function (t) {\n var e = o++ % r.frames.length,\n n = r.frames[e];\n if (\n 0 == r.numPlays ||\n o / r.frames.length <= r.numPlays\n ) {\n for (\n 0 == e &&\n (c.forEach(function (t) {\n t.clearRect(\n 0,\n 0,\n r.width,\n r.height\n );\n }),\n (a = null),\n 2 == n.disposeOp && (n.disposeOp = 1)),\n a && 1 == a.disposeOp\n ? c.forEach(function (t) {\n t.clearRect(\n a.left,\n a.top,\n a.width,\n a.height\n );\n })\n : a &&\n 2 == a.disposeOp &&\n c.forEach(function (t) {\n t.putImageData(\n a.iData,\n a.left,\n a.top\n );\n }),\n (a = n).iData = null,\n 2 == a.disposeOp &&\n (a.iData = c[0].getImageData(\n n.left,\n n.top,\n n.width,\n n.height\n )),\n 0 == n.blendOp &&\n c.forEach(function (t) {\n t.clearRect(\n n.left,\n n.top,\n n.width,\n n.height\n );\n }),\n c.forEach(function (t) {\n t.drawImage(n.img, n.left, n.top);\n }),\n 0 == i && (i = t);\n t > i + r.playTime;\n\n )\n i += r.playTime;\n i += n.delay;\n } else u = !(s = !1);\n };\n };\n },\n {},\n ],\n 4: [\n function (t, e, n) {\n \"use strict\";\n for (var a = new Uint32Array(256), r = 0; r < 256; r++) {\n for (var i = r, o = 0; o < 8; o++)\n i = 1 & i ? 3988292384 ^ (i >>> 1) : i >>> 1;\n a[r] = i;\n }\n e.exports = function (t, e, n) {\n for (\n var r = -1,\n i = (e = e || 0),\n o = e + (n = n || t.length - e);\n i < o;\n i++\n )\n r = (r >>> 8) ^ a[255 & (r ^ t[i])];\n return -1 ^ r;\n };\n },\n {},\n ],\n 5: [\n function (a, t, e) {\n (function (t) {\n \"use strict\";\n var e = a(\"./support-test\"),\n n = a(\"./parser\"),\n r = a(\"./loader\"),\n i = (t.APNG = {});\n (i.checkNativeFeatures = e.checkNativeFeatures),\n (i.ifNeeded = e.ifNeeded),\n (i.parseBuffer = function (t) {\n return n(t);\n });\n var o = {};\n (i.parseURL = function (t) {\n return t in o || (o[t] = r(t).then(n)), o[t];\n }),\n (i.animateContext = function (t, e) {\n return i.parseURL(t).then(function (t) {\n return t.addContext(e), t.play(), t;\n });\n }),\n (i.animateImage = function (s) {\n return (\n s.setAttribute(\"data-is-apng\", \"progress\"),\n i.parseURL(s.src).then(\n function (t) {\n s.setAttribute(\"data-is-apng\", \"yes\");\n var e =\n document.createElement(\"canvas\");\n (e.width = t.width),\n (e.height = t.height),\n Array.prototype.slice\n .call(s.attributes)\n .forEach(function (t) {\n -1 ==\n [\n \"alt\",\n \"src\",\n \"usemap\",\n \"ismap\",\n \"data-is-apng\",\n \"width\",\n \"height\",\n ].indexOf(t.nodeName) &&\n e.setAttributeNode(\n t.cloneNode(!1)\n );\n }),\n e.setAttribute(\n \"data-apng-src\",\n s.src\n ),\n \"\" != s.alt &&\n e.appendChild(\n document.createTextNode(\n s.alt\n )\n );\n var n = \"\",\n r = \"\",\n i = 0,\n o = \"\";\n \"\" != s.style.width &&\n \"auto\" != s.style.width\n ? (n = s.style.width)\n : s.hasAttribute(\"width\") &&\n (n =\n s.getAttribute(\"width\") +\n \"px\"),\n \"\" != s.style.height &&\n \"auto\" != s.style.height\n ? (r = s.style.height)\n : s.hasAttribute(\"height\") &&\n (r =\n s.getAttribute(\"height\") +\n \"px\"),\n \"\" != n &&\n \"\" == r &&\n ((i = parseFloat(n)),\n (o = n.match(/\\D+$/)[0]),\n (r =\n Math.round(\n (e.height * i) / e.width\n ) + o)),\n \"\" != r &&\n \"\" == n &&\n ((i = parseFloat(r)),\n (o = r.match(/\\D+$/)[0]),\n (n =\n Math.round(\n (e.width * i) / e.height\n ) + o)),\n (e.style.width = n),\n (e.style.height = r);\n var a = s.parentNode;\n a.insertBefore(e, s),\n a.removeChild(s),\n t.addContext(e.getContext(\"2d\")),\n t.play();\n },\n function () {\n s.setAttribute(\"data-is-apng\", \"no\");\n }\n )\n );\n }),\n (i.releaseCanvas = function (t) {\n var e = t.getContext(\"2d\");\n \"_apng_animation\" in e &&\n e._apng_animation.removeContext(e);\n });\n }).call(\n this,\n \"undefined\" != typeof self\n ? self\n : \"undefined\" != typeof window\n ? window\n : {}\n );\n },\n { \"./loader\": 6, \"./parser\": 7, \"./support-test\": 8 },\n ],\n 6: [\n function (t, e, n) {\n \"use strict\";\n var i = i || t(\"es6-promise\").Promise;\n e.exports = function (r) {\n return new i(function (t, e) {\n var n = new XMLHttpRequest();\n n.open(\"GET\", r),\n (n.responseType = \"arraybuffer\"),\n (n.onload = function () {\n 200 == this.status ? t(this.response) : e(this);\n }),\n n.send();\n });\n };\n },\n { \"es6-promise\": 1 },\n ],\n 7: [\n function (t, e, n) {\n \"use strict\";\n var r = r || t(\"es6-promise\").Promise,\n m = t(\"./animation\"),\n o = t(\"./crc32\"),\n g = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]);\n e.exports = function (t) {\n var A = new Uint8Array(t);\n return new r(function (t, e) {\n for (var n = 0; n < g.length; n++)\n if (g[n] != A[n])\n return void e(\n \"Not a PNG file (invalid file signature)\"\n );\n var r = !1;\n if (\n (w(A, function (t) {\n return \"acTL\" != t || !(r = !0);\n }),\n r)\n ) {\n var a = [],\n s = [],\n u = null,\n c = null,\n f = new m();\n if (\n (w(A, function (t, e, n, r) {\n switch (t) {\n case \"IHDR\":\n (u = e.subarray(n + 8, n + 8 + r)),\n (f.width = y(e, n + 8)),\n (f.height = y(e, n + 12));\n break;\n case \"acTL\":\n f.numPlays = y(e, n + 8 + 4);\n break;\n case \"fcTL\":\n c && f.frames.push(c),\n ((c = {}).width = y(\n e,\n n + 8 + 4\n )),\n (c.height = y(e, n + 8 + 8)),\n (c.left = y(e, n + 8 + 12)),\n (c.top = y(e, n + 8 + 16));\n var i = _(e, n + 8 + 20),\n o = _(e, n + 8 + 22);\n 0 == o && (o = 100),\n (c.delay = (1e3 * i) / o),\n c.delay <= 10 &&\n (c.delay = 100),\n (f.playTime += c.delay),\n (c.disposeOp = b(\n e,\n n + 8 + 24\n )),\n (c.blendOp = b(e, n + 8 + 25)),\n (c.dataParts = []);\n break;\n case \"fdAT\":\n c &&\n c.dataParts.push(\n e.subarray(\n n + 8 + 4,\n n + 8 + r\n )\n );\n break;\n case \"IDAT\":\n c &&\n c.dataParts.push(\n e.subarray(n + 8, n + 8 + r)\n );\n break;\n case \"IEND\":\n s.push(E(e, n, 12 + r));\n break;\n default:\n a.push(E(e, n, 12 + r));\n }\n }),\n c && f.frames.push(c),\n 0 != f.frames.length)\n )\n for (\n var i = 0,\n o = new Blob(a),\n h = new Blob(s),\n l = 0;\n l < f.frames.length;\n l++\n ) {\n c = f.frames[l];\n var d = [];\n d.push(g),\n u.set(P(c.width), 0),\n u.set(P(c.height), 4),\n d.push(x(\"IHDR\", u)),\n d.push(o);\n for (var p = 0; p < c.dataParts.length; p++)\n d.push(x(\"IDAT\", c.dataParts[p]));\n d.push(h);\n var v = URL.createObjectURL(\n new Blob(d, { type: \"image/png\" })\n );\n delete c.dataParts,\n (d = null),\n (c.img = document.createElement(\"img\")),\n (c.img.onload = function () {\n URL.revokeObjectURL(this.src),\n ++i == f.frames.length && t(f);\n }),\n (c.img.onerror = function () {\n e(\"Image creation error\");\n }),\n (c.img.src = v);\n }\n else e(\"Not an animated PNG\");\n } else e(\"Not an animated PNG\");\n });\n };\n var w = function (t, e) {\n var n = 8;\n do {\n var r = y(t, n),\n i = a(t, n + 4, 4),\n o = e(i, t, n, r);\n n += 12 + r;\n } while (!1 !== o && \"IEND\" != i && n < t.length);\n },\n y = function (t, e) {\n var n = 0;\n n += (t[0 + e] << 24) >>> 0;\n for (var r = 1; r < 4; r++)\n n += t[r + e] << (8 * (3 - r));\n return n;\n },\n _ = function (t, e) {\n for (var n = 0, r = 0; r < 2; r++)\n n += t[r + e] << (8 * (1 - r));\n return n;\n },\n b = function (t, e) {\n return t[e];\n },\n E = function (t, e, n) {\n var r = new Uint8Array(n);\n return r.set(t.subarray(e, e + n)), r;\n },\n a = function (t, e, n) {\n var r = Array.prototype.slice.call(\n t.subarray(e, e + n)\n );\n return String.fromCharCode.apply(String, r);\n },\n P = function (t) {\n return [\n (t >>> 24) & 255,\n (t >>> 16) & 255,\n (t >>> 8) & 255,\n 255 & t,\n ];\n },\n x = function (t, e) {\n var n = t.length + e.length,\n r = new Uint8Array(new ArrayBuffer(n + 8));\n r.set(P(e.length), 0),\n r.set(\n (function (t) {\n for (var e = [], n = 0; n < t.length; n++)\n e.push(t.charCodeAt(n));\n return e;\n })(t),\n 4\n ),\n r.set(e, 8);\n var i = o(r, 4, n);\n return r.set(P(i), n + 4), r;\n };\n },\n { \"./animation\": 3, \"./crc32\": 4, \"es6-promise\": 1 },\n ],\n 8: [\n function (o, a, t) {\n (function (t) {\n \"use strict\";\n var e,\n n,\n r = r || o(\"es6-promise\").Promise,\n i =\n ((e = function (e) {\n var n = document.createElement(\"canvas\"),\n r = {\n TypedArrays: \"ArrayBuffer\" in t,\n BlobURLs: \"URL\" in t,\n requestAnimationFrame:\n \"requestAnimationFrame\" in t,\n pageProtocol:\n \"http:\" == location.protocol ||\n \"https:\" == location.protocol,\n canvas:\n \"getContext\" in\n document.createElement(\"canvas\"),\n APNG: !1,\n };\n if (r.canvas) {\n var i = new Image();\n (i.onload = function () {\n var t = n.getContext(\"2d\");\n t.drawImage(i, 0, 0),\n (r.APNG =\n 0 ===\n t.getImageData(0, 0, 1, 1)\n .data[3]),\n e(r);\n }),\n (i.src =\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACGFjVEwAAAABAAAAAcMq2TYAAAANSURBVAiZY2BgYPgPAAEEAQB9ssjfAAAAGmZjVEwAAAAAAAAAAQAAAAEAAAAAAAAAAAD6A+gBAbNU+2sAAAARZmRBVAAAAAEImWNgYGBgAAAABQAB6MzFdgAAAABJRU5ErkJggg==\");\n } else e(r);\n }),\n (n = null),\n function (t) {\n return (n = n || new r(e)), t && n.then(t), n;\n });\n a.exports = {\n checkNativeFeatures: i,\n ifNeeded: function (r) {\n return (\n void 0 === r && (r = !1),\n i().then(function (t) {\n if (t.APNG && !r) reject();\n else {\n var e = !0;\n for (var n in t)\n t.hasOwnProperty(n) &&\n \"APNG\" != n &&\n (e = e && t[n]);\n }\n })\n );\n },\n };\n }).call(\n this,\n \"undefined\" != typeof self\n ? self\n : \"undefined\" != typeof window\n ? window\n : {}\n );\n },\n { \"es6-promise\": 1 },\n ],\n },\n {},\n [5]\n);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { makeLazy } from \"./lazy\";\nimport { EXTENSION_BASE_URL } from \"./web-metadata\";\n\n/*\n Add dynamically loaded dependencies for plugins here.\n */\n\n// needed to parse APNGs in the nitroBypass plugin\nexport const importApngJs = makeLazy(() => {\n return require(\"./apng-canvas\").APNG as { parseURL(url: string): Promise; };\n});\n\n// https://wiki.mozilla.org/APNG_Specification#.60fcTL.60:_The_Frame_Control_Chunk\nexport const enum ApngDisposeOp {\n /**\n * no disposal is done on this frame before rendering the next; the contents of the output buffer are left as is.\n */\n NONE,\n /**\n * the frame's region of the output buffer is to be cleared to fully transparent black before rendering the next frame.\n */\n BACKGROUND,\n /**\n * the frame's region of the output buffer is to be reverted to the previous contents before rendering the next frame.\n */\n PREVIOUS\n}\n\n// TODO: Might need to somehow implement this\nexport const enum ApngBlendOp {\n SOURCE,\n OVER\n}\nexport interface ApngFrame {\n left: number;\n top: number;\n width: number;\n height: number;\n img: HTMLImageElement;\n delay: number;\n blendOp: ApngBlendOp;\n disposeOp: ApngDisposeOp;\n}\n\nexport interface ApngFrameData {\n width: number;\n height: number;\n frames: ApngFrame[];\n playTime: number;\n}\n\n// On web (extensions), use extension uri as basepath (load files from extension)\n// On desktop (electron), load from cdn\nexport const rnnoiseDist = IS_EXTENSION\n ? new URL(\"/third-party/rnnoise\", EXTENSION_BASE_URL).toString()\n : \"https://unpkg.com/@sapphi-red/web-noise-suppressor@0.3.3/dist\";\nexport const rnnoiseWasmSrc = (simd = false) => `${rnnoiseDist}/rnnoise${simd ? \"_simd\" : \"\"}.wasm`;\nexport const rnnoiseWorkletSrc = `${rnnoiseDist}/rnnoise/workletProcessor.js`;\n\n\n// The below code is only used on the Desktop (electron) build of Vencord.\n// Browser (extension) builds do not contain these remote imports.\n\nexport const shikiWorkerSrc = `https://unpkg.com/@vap/shiki-worker@0.0.8/dist/${IS_DEV ? \"index.js\" : \"index.min.js\"}`;\nexport const shikiOnigasmSrc = \"https://unpkg.com/@vap/shiki@0.10.3/dist/onig.wasm\";\n\n// @ts-expect-error\nexport const getStegCloak = /* #__PURE__*/ makeLazy(() => import(\"https://unpkg.com/stegcloak-dist@1.0.0/index.js\"));\n", "import constants from \"./constants.js\";\nimport lzwEncode from \"./lzwEncode.js\";\nimport createStream from \"./stream.js\";\nimport quantize from \"./pnnquant2.js\";\n\nimport {\n prequantize,\n applyPalette,\n nearestColorIndex,\n nearestColor,\n nearestColorIndexWithDistance,\n snapColorsToPalette,\n} from \"./palettize.js\";\n\nfunction GIFEncoder(opt = {}) {\n const { initialCapacity = 4096, auto = true } = opt;\n\n // Stream all encoded data into this buffer\n const stream = createStream(initialCapacity);\n\n // Shared array data across all frames\n const HSIZE = 5003; // 80% occupancy\n const accum = new Uint8Array(256);\n const htab = new Int32Array(HSIZE);\n const codetab = new Int32Array(HSIZE);\n\n let hasInit = false;\n\n return {\n reset() {\n stream.reset();\n hasInit = false;\n },\n finish() {\n stream.writeByte(constants.trailer);\n },\n bytes() {\n return stream.bytes();\n },\n bytesView() {\n return stream.bytesView();\n },\n get buffer() {\n return stream.buffer;\n },\n get stream() {\n return stream;\n },\n writeHeader,\n writeFrame(index, width, height, opts = {}) {\n const {\n transparent = false,\n transparentIndex = 0x00,\n delay = 0,\n palette = null,\n repeat = 0, // -1=once, 0=forever, >0=count\n colorDepth = 8,\n dispose = -1,\n } = opts;\n\n let first = false;\n if (auto) {\n // In 'auto' mode, the first time we write a frame\n // we will write LSD/GCT/EXT\n if (!hasInit) {\n // have not yet init, we can consider this our first frame\n first = true;\n // in 'auto' mode, we also encode a header on first frame\n // this is different than manual mode where you must encode\n // header yoursef (or perhaps not write header altogether)\n writeHeader();\n hasInit = true;\n }\n } else {\n // in manual mode, the first frame is determined by the options only\n first = Boolean(opts.first);\n }\n\n width = Math.max(0, Math.floor(width));\n height = Math.max(0, Math.floor(height));\n\n // Write pre-frame details such as repeat count and global palette\n if (first) {\n if (!palette) {\n throw new Error(\"First frame must include a { palette } option\");\n }\n encodeLogicalScreenDescriptor(\n stream,\n width,\n height,\n palette,\n colorDepth\n );\n encodeColorTable(stream, palette);\n if (repeat >= 0) {\n encodeNetscapeExt(stream, repeat);\n }\n }\n\n const delayTime = Math.round(delay / 10);\n encodeGraphicControlExt(\n stream,\n dispose,\n delayTime,\n transparent,\n transparentIndex\n );\n\n const useLocalColorTable = Boolean(palette) && !first;\n encodeImageDescriptor(\n stream,\n width,\n height,\n useLocalColorTable ? palette : null\n );\n if (useLocalColorTable) encodeColorTable(stream, palette);\n encodePixels(\n stream,\n index,\n width,\n height,\n colorDepth,\n accum,\n htab,\n codetab\n );\n },\n };\n\n function writeHeader() {\n writeUTFBytes(stream, \"GIF89a\");\n }\n}\n\nfunction encodeGraphicControlExt(\n stream,\n dispose,\n delay,\n transparent,\n transparentIndex\n) {\n stream.writeByte(0x21); // extension introducer\n stream.writeByte(0xf9); // GCE label\n stream.writeByte(4); // data block size\n\n if (transparentIndex < 0) {\n transparentIndex = 0x00;\n transparent = false;\n }\n\n var transp, disp;\n if (!transparent) {\n transp = 0;\n disp = 0; // dispose = no action\n } else {\n transp = 1;\n disp = 2; // force clear if using transparent color\n }\n\n if (dispose >= 0) {\n disp = dispose & 7; // user override\n }\n\n disp <<= 2;\n\n const userInput = 0;\n\n // packed fields\n stream.writeByte(\n 0 | // 1:3 reserved\n disp | // 4:6 disposal\n userInput | // 7 user input - 0 = none\n transp // 8 transparency flag\n );\n\n writeUInt16(stream, delay); // delay x 1/100 sec\n stream.writeByte(transparentIndex || 0x00); // transparent color index\n stream.writeByte(0); // block terminator\n}\n\nfunction encodeLogicalScreenDescriptor(\n stream,\n width,\n height,\n palette,\n colorDepth = 8\n) {\n const globalColorTableFlag = 1;\n const sortFlag = 0;\n const globalColorTableSize = colorTableSize(palette.length) - 1;\n const fields =\n (globalColorTableFlag << 7) |\n ((colorDepth - 1) << 4) |\n (sortFlag << 3) |\n globalColorTableSize;\n const backgroundColorIndex = 0;\n const pixelAspectRatio = 0;\n writeUInt16(stream, width);\n writeUInt16(stream, height);\n stream.writeBytes([fields, backgroundColorIndex, pixelAspectRatio]);\n}\n\nfunction encodeNetscapeExt(stream, repeat) {\n stream.writeByte(0x21); // extension introducer\n stream.writeByte(0xff); // app extension label\n stream.writeByte(11); // block size\n writeUTFBytes(stream, \"NETSCAPE2.0\"); // app id + auth code\n stream.writeByte(3); // sub-block size\n stream.writeByte(1); // loop sub-block id\n writeUInt16(stream, repeat); // loop count (extra iterations, 0=repeat forever)\n stream.writeByte(0); // block terminator\n}\n\nfunction encodeColorTable(stream, palette) {\n const colorTableLength = 1 << colorTableSize(palette.length);\n for (let i = 0; i < colorTableLength; i++) {\n let color = [0, 0, 0];\n if (i < palette.length) {\n color = palette[i];\n }\n stream.writeByte(color[0]);\n stream.writeByte(color[1]);\n stream.writeByte(color[2]);\n }\n}\n\nfunction encodeImageDescriptor(stream, width, height, localPalette) {\n stream.writeByte(0x2c); // image separator\n\n writeUInt16(stream, 0); // x position\n writeUInt16(stream, 0); // y position\n writeUInt16(stream, width); // image size\n writeUInt16(stream, height);\n\n if (localPalette) {\n const interlace = 0;\n const sorted = 0;\n const palSize = colorTableSize(localPalette.length) - 1;\n // local palette\n stream.writeByte(\n 0x80 | // 1 local color table 1=yes\n interlace | // 2 interlace - 0=no\n sorted | // 3 sorted - 0=no\n 0 | // 4-5 reserved\n palSize // 6-8 size of color table\n );\n } else {\n // global palette\n stream.writeByte(0);\n }\n}\n\nfunction encodePixels(\n stream,\n index,\n width,\n height,\n colorDepth = 8,\n accum,\n htab,\n codetab\n) {\n lzwEncode(width, height, index, colorDepth, stream, accum, htab, codetab);\n}\n\n// Utilities\n\nfunction writeUInt16(stream, short) {\n stream.writeByte(short & 0xff);\n stream.writeByte((short >> 8) & 0xff);\n}\n\nfunction writeUTFBytes(stream, text) {\n for (var i = 0; i < text.length; i++) {\n stream.writeByte(text.charCodeAt(i));\n }\n}\n\nfunction colorTableSize(length) {\n return Math.max(Math.ceil(Math.log2(length)), 1);\n}\n\nexport {\n GIFEncoder,\n quantize,\n prequantize,\n applyPalette,\n nearestColorIndex,\n nearestColor,\n nearestColorIndexWithDistance,\n snapColorsToPalette,\n};\n\nexport default GIFEncoder;\n", "export default {\n signature: \"GIF\",\n version: \"89a\",\n trailer: 0x3B,\n extensionIntroducer: 0x21,\n applicationExtensionLabel: 0xFF,\n graphicControlExtensionLabel: 0xF9,\n imageSeparator: 0x2C,\n // Header\n signatureSize: 3,\n versionSize: 3,\n globalColorTableFlagMask: 0b10000000,\n colorResolutionMask: 0b01110000,\n sortFlagMask: 0b00001000,\n globalColorTableSizeMask: 0b00000111,\n // Application extension\n applicationIdentifierSize: 8,\n applicationAuthCodeSize: 3,\n // Graphic control extension\n disposalMethodMask: 0b00011100,\n userInputFlagMask: 0b00000010,\n transparentColorFlagMask: 0b00000001,\n // Image descriptor\n localColorTableFlagMask: 0b10000000,\n interlaceFlagMask: 0b01000000,\n idSortFlagMask: 0b00100000,\n localColorTableSizeMask: 0b00000111\n}\n", "export default function createStream(initialCapacity = 256) {\n let cursor = 0;\n let contents = new Uint8Array(initialCapacity);\n\n return {\n get buffer() {\n return contents.buffer;\n },\n reset() {\n cursor = 0;\n },\n bytesView() {\n return contents.subarray(0, cursor);\n },\n bytes() {\n return contents.slice(0, cursor);\n },\n writeByte(byte) {\n expand(cursor + 1);\n contents[cursor] = byte;\n cursor++;\n },\n writeBytes(data, offset = 0, byteLength = data.length) {\n expand(cursor + byteLength);\n for (let i = 0; i < byteLength; i++) {\n contents[cursor++] = data[i + offset];\n }\n },\n writeBytesView(data, offset = 0, byteLength = data.byteLength) {\n expand(cursor + byteLength);\n contents.set(data.subarray(offset, offset + byteLength), cursor);\n cursor += byteLength;\n },\n };\n\n function expand(newCapacity) {\n var prevCapacity = contents.length;\n if (prevCapacity >= newCapacity) return; // No need to expand, the storage was already large enough.\n // Don't expand strictly to the given requested limit if it's only a very small increase, but instead geometrically grow capacity.\n // For small filesizes (<1MB), perform size*2 geometric increase, but for large sizes, do a much more conservative size*1.125 increase to\n // avoid overshooting the allocation cap by a very large margin.\n var CAPACITY_DOUBLING_MAX = 1024 * 1024;\n newCapacity = Math.max(\n newCapacity,\n (prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2.0 : 1.125)) >>>\n 0\n );\n if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256); // At minimum allocate 256b for each file when expanding.\n const oldContents = contents;\n contents = new Uint8Array(newCapacity); // Allocate new storage.\n if (cursor > 0) contents.set(oldContents.subarray(0, cursor), 0);\n }\n}\n", "/*\n LZWEncoder.js\n Authors\n Kevin Weiner (original Java version - kweiner@fmsware.com)\n Thibault Imbert (AS3 version - bytearray.org)\n Johan Nordberg (JS version - code@johan-nordberg.com)\n Acknowledgements\n GIFCOMPR.C - GIF Image compression routines\n Lempel-Ziv compression based on 'compress'. GIF modifications by\n David Rowley (mgardi@watdcsu.waterloo.edu)\n GIF Image compression - modified 'compress'\n Based on: compress.c - File compression ala IEEE Computer, June 1984.\n By Authors: Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas)\n Jim McKie (decvax!mcvax!jim)\n Steve Davies (decvax!vax135!petsd!peora!srd)\n Ken Turkowski (decvax!decwrl!turtlevax!ken)\n James A. Woods (decvax!ihnp4!ames!jaw)\n Joe Orost (decvax!vax135!petsd!joe)\n Matt DesLauriers (@mattdesl - V8/JS optimizations)\n Mathieu Henri (@p01 - JS optimization)\n*/\n\nimport createStream from \"./stream.js\";\n\nconst EOF = -1;\nconst BITS = 12;\nconst DEFAULT_HSIZE = 5003; // 80% occupancy\nconst MASKS = [\n 0x0000,\n 0x0001,\n 0x0003,\n 0x0007,\n 0x000f,\n 0x001f,\n 0x003f,\n 0x007f,\n 0x00ff,\n 0x01ff,\n 0x03ff,\n 0x07ff,\n 0x0fff,\n 0x1fff,\n 0x3fff,\n 0x7fff,\n 0xffff,\n];\n\nfunction lzwEncode(\n width,\n height,\n pixels,\n colorDepth,\n outStream = createStream(512),\n accum = new Uint8Array(256),\n htab = new Int32Array(DEFAULT_HSIZE),\n codetab = new Int32Array(DEFAULT_HSIZE)\n) {\n const hsize = htab.length;\n const initCodeSize = Math.max(2, colorDepth);\n\n accum.fill(0);\n codetab.fill(0);\n htab.fill(-1);\n\n let cur_accum = 0;\n let cur_bits = 0;\n\n // Algorithm: use open addressing double hashing (no chaining) on the\n // prefix code / next character combination. We do a variant of Knuth's\n // algorithm D (vol. 3, sec. 6.4) along with G. Knott's relatively-prime\n // secondary probe. Here, the modular division first probe is gives way\n // to a faster exclusive-or manipulation. Also do block compression with\n // an adaptive reset, whereby the code table is cleared when the compression\n // ratio decreases, but after the table fills. The variable-length output\n // codes are re-sized at this point, and a special CLEAR code is generated\n // for the decompressor. Late addition: construct the table according to\n // file size for noticeable speed improvement on small files. Please direct\n // questions about this implementation to ames!jaw.\n\n // compress and write the pixel data\n const init_bits = initCodeSize + 1;\n\n // Set up the globals: g_init_bits - initial number of bits\n const g_init_bits = init_bits;\n\n // Set up the necessary values\n\n // block compression parameters -- after all codes are used up,\n // and compression rate changes, start over.\n let clear_flg = false;\n let n_bits = g_init_bits;\n let maxcode = (1 << n_bits) - 1;\n\n const ClearCode = 1 << (init_bits - 1);\n const EOFCode = ClearCode + 1;\n let free_ent = ClearCode + 2;\n let a_count = 0; // clear packet\n\n let ent = pixels[0];\n\n let hshift = 0;\n for (let fcode = hsize; fcode < 65536; fcode *= 2) {\n ++hshift;\n }\n hshift = 8 - hshift; // set hash code range bound\n\n outStream.writeByte(initCodeSize); // write \"initial code size\" byte\n\n output(ClearCode);\n\n const length = pixels.length;\n for (let idx = 1; idx < length; idx++) {\n next_block: {\n const c = pixels[idx];\n const fcode = (c << BITS) + ent;\n let i = (c << hshift) ^ ent; // xor hashing\n if (htab[i] === fcode) {\n ent = codetab[i];\n break next_block;\n }\n\n const disp = i === 0 ? 1 : hsize - i; // secondary hash (after G. Knott)\n while (htab[i] >= 0) {\n // non-empty slot\n i -= disp;\n if (i < 0) i += hsize;\n if (htab[i] === fcode) {\n ent = codetab[i];\n break next_block;\n }\n }\n output(ent);\n ent = c;\n if (free_ent < 1 << BITS) {\n codetab[i] = free_ent++; // code -> hashtable\n htab[i] = fcode;\n } else {\n // Clear out the hash table\n // table clear for block compress\n htab.fill(-1);\n free_ent = ClearCode + 2;\n clear_flg = true;\n output(ClearCode);\n }\n }\n }\n\n // Put out the final code.\n output(ent);\n output(EOFCode);\n\n outStream.writeByte(0); // write block terminator\n return outStream.bytesView();\n\n function output(code) {\n cur_accum &= MASKS[cur_bits];\n\n if (cur_bits > 0) cur_accum |= code << cur_bits;\n else cur_accum = code;\n\n cur_bits += n_bits;\n\n while (cur_bits >= 8) {\n // Add a character to the end of the current packet, and if it is 254\n // characters, flush the packet to disk.\n accum[a_count++] = cur_accum & 0xff;\n if (a_count >= 254) {\n outStream.writeByte(a_count);\n outStream.writeBytesView(accum, 0, a_count);\n a_count = 0;\n }\n cur_accum >>= 8;\n cur_bits -= 8;\n }\n\n // If the next entry is going to be too big for the code size,\n // then increase it, if possible.\n if (free_ent > maxcode || clear_flg) {\n if (clear_flg) {\n n_bits = g_init_bits;\n maxcode = (1 << n_bits) - 1;\n clear_flg = false;\n } else {\n ++n_bits;\n maxcode = n_bits === BITS ? (1 << n_bits) : (1 << n_bits) - 1;\n }\n }\n\n if (code == EOFCode) {\n // At EOF, write the rest of the buffer.\n while (cur_bits > 0) {\n // Add a character to the end of the current packet, and if it is 254\n // characters, flush the packet to disk.\n accum[a_count++] = cur_accum & 0xff;\n if (a_count >= 254) {\n outStream.writeByte(a_count);\n outStream.writeBytesView(accum, 0, a_count);\n a_count = 0;\n }\n cur_accum >>= 8;\n cur_bits -= 8;\n }\n // Flush the packet to disk, and reset the accumulator\n if (a_count > 0) {\n outStream.writeByte(a_count);\n outStream.writeBytesView(accum, 0, a_count);\n a_count = 0;\n }\n }\n }\n}\n\nexport default lzwEncode;\n", "export function uint32_to_rgba(color) {\n var a = (color >> 24) & 0xff;\n var b = (color >> 16) & 0xff;\n var g = (color >> 8) & 0xff;\n var r = color & 0xff;\n return [r, g, b, a];\n}\n\nexport function rgba_to_uint32(r, g, b, a) {\n return (a << 24) | (b << 16) | (g << 8) | r;\n}\n\nexport function rgb888_to_rgb565(r, g, b) {\n return ((r << 8) & 0xf800) | ((g << 2) & 0x03e0) | (b >> 3);\n}\n\nexport function rgba8888_to_rgba4444(r, g, b, a) {\n return (r >> 4) | (g & 0xf0) | ((b & 0xf0) << 4) | ((a & 0xf0) << 8);\n}\n\nexport function rgb888_to_rgb444(r, g, b) {\n return ((r >> 4) << 8) | (g & 0xf0) | (b >> 4);\n}\n\n// Alternative 565 ?\n// return ((r & 0xf8) << 8) + ((g & 0xfc) << 3) + (b >> 3);\n\n// Alternative 4444 ?\n// ((a & 0xf0) << 8) | ((r & 0xf0) << 4) | (g & 0xf0) | (b >> 4);\n", "// Modified from:\n// https://github.com/mcychan/PnnQuant.js/blob/master/src/pnnquant.js\n\n/* Fast pairwise nearest neighbor based algorithm for multilevel thresholding\nCopyright (C) 2004-2019 Mark Tyler and Dmitry Groshev\nCopyright (c) 2018-2021 Miller Cy Chan\n* error measure; time used is proportional to number of bins squared - WJ */\n\nimport {\n rgb888_to_rgb565,\n rgb888_to_rgb444,\n rgba8888_to_rgba4444,\n} from \"./rgb-packing.js\";\n\nfunction clamp(value, min, max) {\n return value < min ? min : value > max ? max : value;\n}\n\nfunction sqr(value) {\n return value * value;\n}\n\nfunction find_nn(bins, idx, hasAlpha) {\n var nn = 0;\n var err = 1e100;\n\n const bin1 = bins[idx];\n const n1 = bin1.cnt;\n const wa = bin1.ac;\n const wr = bin1.rc;\n const wg = bin1.gc;\n const wb = bin1.bc;\n for (var i = bin1.fw; i != 0; i = bins[i].fw) {\n const bin = bins[i];\n const n2 = bin.cnt;\n const nerr2 = (n1 * n2) / (n1 + n2);\n if (nerr2 >= err) continue;\n\n var nerr = 0;\n if (hasAlpha) {\n nerr += nerr2 * sqr(bin.ac - wa);\n if (nerr >= err) continue;\n }\n\n nerr += nerr2 * sqr(bin.rc - wr);\n if (nerr >= err) continue;\n\n nerr += nerr2 * sqr(bin.gc - wg);\n if (nerr >= err) continue;\n\n nerr += nerr2 * sqr(bin.bc - wb);\n if (nerr >= err) continue;\n err = nerr;\n nn = i;\n }\n bin1.err = err;\n bin1.nn = nn;\n}\n\nfunction create_bin() {\n return {\n ac: 0,\n rc: 0,\n gc: 0,\n bc: 0,\n cnt: 0,\n nn: 0,\n fw: 0,\n bk: 0,\n tm: 0,\n mtm: 0,\n err: 0,\n };\n}\n\nfunction bin_add_rgb(bin, r, g, b) {\n bin.rc += r;\n bin.gc += g;\n bin.bc += b;\n bin.cnt++;\n}\n\nfunction create_bin_list(data, format) {\n const bincount = format === \"rgb444\" ? 4096 : 65536;\n const bins = new Array(bincount);\n const size = data.length;\n\n /* Build histogram */\n // Note: Instead of introducing branching/conditions\n // within a very hot per-pixel iteration, we just duplicate the code\n // for each new condition\n if (format === \"rgba4444\") {\n for (let i = 0; i < size; ++i) {\n const color = data[i];\n const a = (color >> 24) & 0xff;\n const b = (color >> 16) & 0xff;\n const g = (color >> 8) & 0xff;\n const r = color & 0xff;\n\n // reduce to rgb4444 16-bit uint\n const index = rgba8888_to_rgba4444(r, g, b, a);\n let bin = index in bins ? bins[index] : (bins[index] = create_bin());\n bin.rc += r;\n bin.gc += g;\n bin.bc += b;\n bin.ac += a;\n bin.cnt++;\n }\n }\n \n else if (format === \"rgb444\") {\n for (let i = 0; i < size; ++i) {\n const color = data[i];\n const b = (color >> 16) & 0xff;\n const g = (color >> 8) & 0xff;\n const r = color & 0xff;\n\n // reduce to rgb444 12-bit uint\n const index = rgb888_to_rgb444(r, g, b);\n let bin = index in bins ? bins[index] : (bins[index] = create_bin());\n bin.rc += r;\n bin.gc += g;\n bin.bc += b;\n bin.cnt++;\n }\n } else {\n for (let i = 0; i < size; ++i) {\n const color = data[i];\n const b = (color >> 16) & 0xff;\n const g = (color >> 8) & 0xff;\n const r = color & 0xff;\n\n // reduce to rgb565 16-bit uint\n const index = rgb888_to_rgb565(r, g, b);\n let bin = index in bins ? bins[index] : (bins[index] = create_bin());\n bin.rc += r;\n bin.gc += g;\n bin.bc += b;\n bin.cnt++;\n }\n }\n return bins;\n}\n\nexport default function quantize(rgba, maxColors, opts = {}) {\n const {\n format = \"rgb565\",\n clearAlpha = true,\n clearAlphaColor = 0x00,\n clearAlphaThreshold = 0,\n oneBitAlpha = false,\n } = opts;\n\n if (!rgba || !rgba.buffer) {\n throw new Error('quantize() expected RGBA Uint8Array data');\n }\n if (!(rgba instanceof Uint8Array) && !(rgba instanceof Uint8ClampedArray)) {\n throw new Error('quantize() expected RGBA Uint8Array data');\n }\n \n const data = new Uint32Array(rgba.buffer);\n\n let useSqrt = opts.useSqrt !== false;\n\n // format can be:\n // rgb565 (default)\n // rgb444\n // rgba4444\n\n const hasAlpha = format === \"rgba4444\";\n const bins = create_bin_list(data, format);\n const bincount = bins.length;\n const bincountMinusOne = bincount - 1;\n const heap = new Uint32Array(bincount + 1);\n\n /* Cluster nonempty bins at one end of array */\n var maxbins = 0;\n for (var i = 0; i < bincount; ++i) {\n const bin = bins[i];\n if (bin != null) {\n var d = 1.0 / bin.cnt;\n if (hasAlpha) bin.ac *= d;\n bin.rc *= d;\n bin.gc *= d;\n bin.bc *= d;\n bins[maxbins++] = bin;\n }\n }\n\n if (sqr(maxColors) / maxbins < 0.022) {\n useSqrt = false;\n }\n\n var i = 0;\n for (; i < maxbins - 1; ++i) {\n bins[i].fw = i + 1;\n bins[i + 1].bk = i;\n if (useSqrt) bins[i].cnt = Math.sqrt(bins[i].cnt);\n }\n if (useSqrt) bins[i].cnt = Math.sqrt(bins[i].cnt);\n\n var h, l, l2;\n /* Initialize nearest neighbors and build heap of them */\n for (i = 0; i < maxbins; ++i) {\n find_nn(bins, i, false);\n /* Push slot on heap */\n var err = bins[i].err;\n for (l = ++heap[0]; l > 1; l = l2) {\n l2 = l >> 1;\n if (bins[(h = heap[l2])].err <= err) break;\n heap[l] = h;\n }\n heap[l] = i;\n }\n\n /* Merge bins which increase error the least */\n var extbins = maxbins - maxColors;\n for (i = 0; i < extbins; ) {\n var tb;\n /* Use heap to find which bins to merge */\n for (;;) {\n var b1 = heap[1];\n tb = bins[b1]; /* One with least error */\n /* Is stored error up to date? */\n if (tb.tm >= tb.mtm && bins[tb.nn].mtm <= tb.tm) break;\n if (tb.mtm == bincountMinusOne)\n /* Deleted node */ b1 = heap[1] = heap[heap[0]--];\n /* Too old error value */ else {\n find_nn(bins, b1, false);\n tb.tm = i;\n }\n /* Push slot down */\n var err = bins[b1].err;\n for (l = 1; (l2 = l + l) <= heap[0]; l = l2) {\n if (l2 < heap[0] && bins[heap[l2]].err > bins[heap[l2 + 1]].err) l2++;\n if (err <= bins[(h = heap[l2])].err) break;\n heap[l] = h;\n }\n heap[l] = b1;\n }\n\n /* Do a merge */\n var nb = bins[tb.nn];\n var n1 = tb.cnt;\n var n2 = nb.cnt;\n var d = 1.0 / (n1 + n2);\n if (hasAlpha) tb.ac = d * (n1 * tb.ac + n2 * nb.ac);\n tb.rc = d * (n1 * tb.rc + n2 * nb.rc);\n tb.gc = d * (n1 * tb.gc + n2 * nb.gc);\n tb.bc = d * (n1 * tb.bc + n2 * nb.bc);\n tb.cnt += nb.cnt;\n tb.mtm = ++i;\n\n /* Unchain deleted bin */\n bins[nb.bk].fw = nb.fw;\n bins[nb.fw].bk = nb.bk;\n nb.mtm = bincountMinusOne;\n }\n\n // let palette = new Uint32Array(maxColors);\n let palette = [];\n\n /* Fill palette */\n var k = 0;\n for (i = 0; ; ++k) {\n let r = clamp(Math.round(bins[i].rc), 0, 0xff);\n let g = clamp(Math.round(bins[i].gc), 0, 0xff);\n let b = clamp(Math.round(bins[i].bc), 0, 0xff);\n\n let a = 0xff;\n if (hasAlpha) {\n a = clamp(Math.round(bins[i].ac), 0, 0xff);\n if (oneBitAlpha) {\n const threshold = typeof oneBitAlpha === \"number\" ? oneBitAlpha : 127;\n a = a <= threshold ? 0x00 : 0xff;\n }\n if (clearAlpha && a <= clearAlphaThreshold) {\n r = g = b = clearAlphaColor;\n a = 0x00;\n }\n }\n\n const color = hasAlpha ? [r, g, b, a] : [r, g, b];\n const exists = existsInPalette(palette, color);\n if (!exists) palette.push(color);\n if ((i = bins[i].fw) == 0) break;\n }\n\n return palette;\n}\n\nfunction existsInPalette(palette, color) {\n for (let i = 0; i < palette.length; i++) {\n const p = palette[i];\n let matchesRGB =\n p[0] === color[0] && p[1] === color[1] && p[2] === color[2];\n let matchesAlpha =\n p.length >= 4 && color.length >= 4 ? p[3] === color[3] : true;\n if (matchesRGB && matchesAlpha) return true;\n }\n return false;\n}\n\n// TODO: Further 'clean' palette by merging nearly-identical colors?\n", "function rgb2y(r, g, b) {\n return r * 0.29889531 + g * 0.58662247 + b * 0.11448223;\n}\nfunction rgb2i(r, g, b) {\n return r * 0.59597799 - g * 0.2741761 - b * 0.32180189;\n}\nfunction rgb2q(r, g, b) {\n return r * 0.21147017 - g * 0.52261711 + b * 0.31114694;\n}\n\nexport function colorDifferenceYIQSquared(yiqA, yiqB) {\n const y = yiqA[0] - yiqB[0];\n const i = yiqA[1] - yiqB[1];\n const q = yiqA[2] - yiqB[2];\n const a = alpha(yiqA) - alpha(yiqB);\n return y * y * 0.5053 + i * i * 0.299 + q * q * 0.1957 + a * a;\n}\n\nfunction alpha(array) {\n return array[3] != null ? array[3] : 0xff;\n}\n\nexport function colorDifferenceYIQ(yiqA, yiqB) {\n return Math.sqrt(colorDifferenceYIQSquared(yiqA, yiqB));\n}\n\nexport function colorDifferenceRGBToYIQSquared(rgb1, rgb2) {\n const [r1, g1, b1] = rgb1;\n const [r2, g2, b2] = rgb2;\n const y = rgb2y(r1, g1, b1) - rgb2y(r2, g2, b2),\n i = rgb2i(r1, g1, b1) - rgb2i(r2, g2, b2),\n q = rgb2q(r1, g1, b1) - rgb2q(r2, g2, b2);\n const a = alpha(rgb1) - alpha(rgb2);\n return y * y * 0.5053 + i * i * 0.299 + q * q * 0.1957 + a * a;\n}\n\nexport function colorDifferenceRGBToYIQ(rgb1, rgb2) {\n return Math.sqrt(colorDifferenceRGBToYIQSquared(rgb1, rgb2));\n}\n\nexport function euclideanDistanceSquared(a, b) {\n var sum = 0;\n var n;\n for (n = 0; n < a.length; n++) {\n const dx = a[n] - b[n];\n sum += dx * dx;\n }\n return sum;\n}\n\nexport function euclideanDistance(a, b) {\n return Math.sqrt(euclideanDistanceSquared(a, b));\n}\n", "import {\n rgb888_to_rgb444,\n rgb888_to_rgb565,\n rgba8888_to_rgba4444,\n} from \"./rgb-packing.js\";\n\nimport { euclideanDistanceSquared } from \"./color.js\";\n\nfunction roundStep(byte, step) {\n return step > 1 ? Math.round(byte / step) * step : byte;\n}\n\nexport function prequantize(\n rgba,\n { roundRGB = 5, roundAlpha = 10, oneBitAlpha = null } = {}\n) {\n const data = new Uint32Array(rgba.buffer);\n for (let i = 0; i < data.length; i++) {\n const color = data[i];\n let a = (color >> 24) & 0xff;\n let b = (color >> 16) & 0xff;\n let g = (color >> 8) & 0xff;\n let r = color & 0xff;\n\n a = roundStep(a, roundAlpha);\n if (oneBitAlpha) {\n const threshold = typeof oneBitAlpha === \"number\" ? oneBitAlpha : 127;\n a = a <= threshold ? 0x00 : 0xff;\n }\n r = roundStep(r, roundRGB);\n g = roundStep(g, roundRGB);\n b = roundStep(b, roundRGB);\n\n data[i] = (a << 24) | (b << 16) | (g << 8) | (r << 0);\n }\n}\n\nexport function applyPalette(rgba, palette, format = \"rgb565\") {\n if (!rgba || !rgba.buffer) {\n throw new Error('quantize() expected RGBA Uint8Array data');\n }\n if (!(rgba instanceof Uint8Array) && !(rgba instanceof Uint8ClampedArray)) {\n throw new Error('quantize() expected RGBA Uint8Array data');\n }\n if (palette.length > 256) {\n throw new Error('applyPalette() only works with 256 colors or less');\n }\n\n const data = new Uint32Array(rgba.buffer);\n const length = data.length;\n const bincount = format === \"rgb444\" ? 4096 : 65536;\n const index = new Uint8Array(length);\n const cache = new Array(bincount);\n const hasAlpha = format === \"rgba4444\";\n\n // Some duplicate code below due to very hot code path\n // Introducing branching/conditions shows some significant impact\n if (format === \"rgba4444\") {\n for (let i = 0; i < length; i++) {\n const color = data[i];\n const a = (color >> 24) & 0xff;\n const b = (color >> 16) & 0xff;\n const g = (color >> 8) & 0xff;\n const r = color & 0xff;\n const key = rgba8888_to_rgba4444(r, g, b, a);\n const idx = key in cache ? cache[key] : (cache[key] = nearestColorIndexRGBA(r, g, b, a, palette));\n index[i] = idx;\n }\n } else {\n const rgb888_to_key = format === \"rgb444\" ? rgb888_to_rgb444 : rgb888_to_rgb565;\n for (let i = 0; i < length; i++) {\n const color = data[i];\n const b = (color >> 16) & 0xff;\n const g = (color >> 8) & 0xff;\n const r = color & 0xff;\n const key = rgb888_to_key(r, g, b);\n const idx = key in cache ? cache[key] : (cache[key] = nearestColorIndexRGB(r, g, b, palette));\n index[i] = idx;\n }\n }\n\n return index;\n}\n\nfunction nearestColorIndexRGBA(r, g, b, a, palette) {\n let k = 0;\n let mindist = 1e100;\n for (let i = 0; i < palette.length; i++) {\n const px2 = palette[i];\n const a2 = px2[3];\n let curdist = sqr(a2 - a);\n if (curdist > mindist) continue;\n const r2 = px2[0];\n curdist += sqr(r2 - r);\n if (curdist > mindist) continue;\n const g2 = px2[1];\n curdist += sqr(g2 - g);\n if (curdist > mindist) continue;\n const b2 = px2[2];\n curdist += sqr(b2 - b);\n if (curdist > mindist) continue;\n mindist = curdist;\n k = i;\n }\n return k;\n}\n\nfunction nearestColorIndexRGB(r, g, b, palette) {\n let k = 0;\n let mindist = 1e100;\n for (let i = 0; i < palette.length; i++) {\n const px2 = palette[i];\n const r2 = px2[0];\n let curdist = sqr(r2 - r);\n if (curdist > mindist) continue;\n const g2 = px2[1];\n curdist += sqr(g2 - g);\n if (curdist > mindist) continue;\n const b2 = px2[2];\n curdist += sqr(b2 - b);\n if (curdist > mindist) continue;\n mindist = curdist;\n k = i;\n }\n return k;\n}\n\nexport function snapColorsToPalette(palette, knownColors, threshold = 5) {\n if (!palette.length || !knownColors.length) return;\n\n const paletteRGB = palette.map((p) => p.slice(0, 3));\n const thresholdSq = threshold * threshold;\n const dim = palette[0].length;\n for (let i = 0; i < knownColors.length; i++) {\n let color = knownColors[i];\n if (color.length < dim) {\n // palette is RGBA, known is RGB\n color = [color[0], color[1], color[2], 0xff];\n } else if (color.length > dim) {\n // palette is RGB, known is RGBA\n color = color.slice(0, 3);\n } else {\n // make sure we always copy known colors\n color = color.slice();\n }\n const r = nearestColorIndexWithDistance(\n paletteRGB,\n color.slice(0, 3),\n euclideanDistanceSquared\n );\n const idx = r[0];\n const distanceSq = r[1];\n if (distanceSq > 0 && distanceSq <= thresholdSq) {\n palette[idx] = color;\n }\n }\n}\n\nfunction sqr(a) {\n return a * a;\n}\n\nexport function nearestColorIndex(\n colors,\n pixel,\n distanceFn = euclideanDistanceSquared\n) {\n let minDist = Infinity;\n let minDistIndex = -1;\n for (let j = 0; j < colors.length; j++) {\n const paletteColor = colors[j];\n const dist = distanceFn(pixel, paletteColor);\n if (dist < minDist) {\n minDist = dist;\n minDistIndex = j;\n }\n }\n return minDistIndex;\n}\n\nexport function nearestColorIndexWithDistance(\n colors,\n pixel,\n distanceFn = euclideanDistanceSquared\n) {\n let minDist = Infinity;\n let minDistIndex = -1;\n for (let j = 0; j < colors.length; j++) {\n const paletteColor = colors[j];\n const dist = distanceFn(pixel, paletteColor);\n if (dist < minDist) {\n minDist = dist;\n minDistIndex = j;\n }\n }\n return [minDistIndex, minDist];\n}\n\nexport function nearestColor(\n colors,\n pixel,\n distanceFn = euclideanDistanceSquared\n) {\n return colors[nearestColorIndex(colors, pixel, distanceFn)];\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addPreEditListener, addPreSendListener, removePreEditListener, removePreSendListener } from \"@api/MessageEvents\";\nimport { definePluginSettings, Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport { ApngBlendOp, ApngDisposeOp, importApngJs } from \"@utils/dependencies\";\nimport { getCurrentGuild } from \"@utils/discord\";\nimport { proxyLazy } from \"@utils/lazy\";\nimport { Logger } from \"@utils/Logger\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy, findStoreLazy } from \"@webpack\";\nimport { ChannelStore, EmojiStore, FluxDispatcher, lodash, Parser, PermissionStore, UploadHandler, UserSettingsActionCreators, UserStore } from \"@webpack/common\";\nimport type { Message } from \"discord-types/general\";\nimport { applyPalette, GIFEncoder, quantize } from \"gifenc\";\nimport type { ReactElement, ReactNode } from \"react\";\n\nconst DRAFT_TYPE = 0;\nconst StickerStore = findStoreLazy(\"StickersStore\") as {\n getPremiumPacks(): StickerPack[];\n getAllGuildStickers(): Map;\n getStickerById(id: string): Sticker | undefined;\n};\n\nconst UserSettingsProtoStore = findStoreLazy(\"UserSettingsProtoStore\");\nconst ProtoUtils = findByPropsLazy(\"BINARY_READ_OPTIONS\");\n\nfunction searchProtoClassField(localName: string, protoClass: any) {\n const field = protoClass?.fields?.find((field: any) => field.localName === localName);\n if (!field) return;\n\n const fieldGetter = Object.values(field).find(value => typeof value === \"function\") as any;\n return fieldGetter?.();\n}\n\nconst PreloadedUserSettingsActionCreators = proxyLazy(() => UserSettingsActionCreators.PreloadedUserSettingsActionCreators);\nconst AppearanceSettingsActionCreators = proxyLazy(() => searchProtoClassField(\"appearance\", PreloadedUserSettingsActionCreators.ProtoClass));\nconst ClientThemeSettingsActionsCreators = proxyLazy(() => searchProtoClassField(\"clientThemeSettings\", AppearanceSettingsActionCreators));\n\nconst USE_EXTERNAL_EMOJIS = 1n << 18n;\nconst USE_EXTERNAL_STICKERS = 1n << 37n;\n\nconst enum EmojiIntentions {\n REACTION = 0,\n STATUS = 1,\n COMMUNITY_CONTENT = 2,\n CHAT = 3,\n GUILD_STICKER_RELATED_EMOJI = 4,\n GUILD_ROLE_BENEFIT_EMOJI = 5,\n COMMUNITY_CONTENT_ONLY = 6,\n SOUNDBOARD = 7\n}\n\nconst enum StickerType {\n PNG = 1,\n APNG = 2,\n LOTTIE = 3,\n // don't think you can even have gif stickers but the docs have it\n GIF = 4\n}\n\ninterface BaseSticker {\n available: boolean;\n description: string;\n format_type: number;\n id: string;\n name: string;\n tags: string;\n type: number;\n}\ninterface GuildSticker extends BaseSticker {\n guild_id: string;\n}\ninterface DiscordSticker extends BaseSticker {\n pack_id: string;\n}\ntype Sticker = GuildSticker | DiscordSticker;\n\ninterface StickerPack {\n id: string;\n name: string;\n sku_id: string;\n description: string;\n cover_sticker_id: string;\n banner_asset_id: string;\n stickers: Sticker[];\n}\n\nconst enum FakeNoticeType {\n Sticker,\n Emoji\n}\n\nconst fakeNitroEmojiRegex = /\\/emojis\\/(\\d+?)\\.(png|webp|gif)/;\nconst fakeNitroStickerRegex = /\\/stickers\\/(\\d+?)\\./;\nconst fakeNitroGifStickerRegex = /\\/attachments\\/\\d+?\\/\\d+?\\/(\\d+?)\\.gif/;\n\nconst settings = definePluginSettings({\n enableEmojiBypass: {\n description: \"Allow sending fake emojis\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n },\n emojiSize: {\n description: \"Size of the emojis when sending\",\n type: OptionType.SLIDER,\n default: 48,\n markers: [32, 48, 64, 128, 160, 256, 512]\n },\n transformEmojis: {\n description: \"Whether to transform fake emojis into real ones\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n },\n enableStickerBypass: {\n description: \"Allow sending fake stickers\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n },\n stickerSize: {\n description: \"Size of the stickers when sending\",\n type: OptionType.SLIDER,\n default: 160,\n markers: [32, 64, 128, 160, 256, 512]\n },\n transformStickers: {\n description: \"Whether to transform fake stickers into real ones\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n },\n transformCompoundSentence: {\n description: \"Whether to transform fake stickers and emojis in compound sentences (sentences with more content than just the fake emoji or sticker link)\",\n type: OptionType.BOOLEAN,\n default: false\n },\n enableStreamQualityBypass: {\n description: \"Allow streaming in nitro quality\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"FakeNitro\",\n authors: [Devs.Arjix, Devs.D3SOX, Devs.Ven, Devs.obscurity, Devs.captain, Devs.Nuckyz, Devs.AutumnVN],\n description: \"Allows you to stream in nitro quality, send fake emojis/stickers and use client themes.\",\n dependencies: [\"MessageEventsAPI\"],\n\n settings,\n\n patches: [\n {\n find: \".PREMIUM_LOCKED;\",\n predicate: () => settings.store.enableEmojiBypass,\n replacement: [\n {\n // Create a variable for the intention of listing the emoji\n match: /(?<=,intention:(\\i).+?;)/,\n replace: (_, intention) => `let fakeNitroIntention=${intention};`\n },\n {\n // Send the intention of listing the emoji to the nitro permission check functions\n match: /\\.(?:canUseEmojisEverywhere|canUseAnimatedEmojis)\\(\\i(?=\\))/g,\n replace: '$&,typeof fakeNitroIntention!==\"undefined\"?fakeNitroIntention:void 0'\n },\n {\n // Disallow the emoji if the intention doesn't allow it\n match: /(&&!\\i&&)!(\\i)(?=\\)return \\i\\.\\i\\.DISALLOW_EXTERNAL;)/,\n replace: (_, rest, canUseExternal) => `${rest}(!${canUseExternal}&&(typeof fakeNitroIntention===\"undefined\"||![${EmojiIntentions.CHAT},${EmojiIntentions.GUILD_STICKER_RELATED_EMOJI}].includes(fakeNitroIntention)))`\n },\n {\n // Make the emoji always available if the intention allows it\n match: /if\\(!\\i\\.available/,\n replace: m => `${m}&&(typeof fakeNitroIntention===\"undefined\"||![${EmojiIntentions.CHAT},${EmojiIntentions.GUILD_STICKER_RELATED_EMOJI}].includes(fakeNitroIntention))`\n }\n ]\n },\n // Allow emojis and animated emojis to be sent everywhere\n {\n find: \"canUseAnimatedEmojis:function\",\n predicate: () => settings.store.enableEmojiBypass,\n replacement: {\n match: /((?:canUseEmojisEverywhere|canUseAnimatedEmojis):function\\(\\i)\\){(.+?\\))(?=})/g,\n replace: (_, rest, premiumCheck) => `${rest},fakeNitroIntention){${premiumCheck}||fakeNitroIntention==null||[${EmojiIntentions.CHAT},${EmojiIntentions.GUILD_STICKER_RELATED_EMOJI}].includes(fakeNitroIntention)`\n }\n },\n // Allow stickers to be sent everywhere\n {\n find: \"canUseCustomStickersEverywhere:function\",\n predicate: () => settings.store.enableStickerBypass,\n replacement: {\n match: /canUseCustomStickersEverywhere:function\\(\\i\\){/,\n replace: \"$&return true;\"\n },\n },\n // Make stickers always available\n {\n find: \"\\\"SENDABLE\\\"\",\n predicate: () => settings.store.enableStickerBypass,\n replacement: {\n match: /(\\w+)\\.available\\?/,\n replace: \"true?\"\n }\n },\n // Allow streaming with high quality\n {\n find: \"canUseHighVideoUploadQuality:function\",\n predicate: () => settings.store.enableStreamQualityBypass,\n replacement: [\n \"canUseHighVideoUploadQuality\",\n \"canStreamQuality\",\n ].map(func => {\n return {\n match: new RegExp(`${func}:function\\\\(\\\\i(?:,\\\\i)?\\\\){`, \"g\"),\n replace: \"$&return true;\"\n };\n })\n },\n // Remove boost requirements to stream with high quality\n {\n find: \"STREAM_FPS_OPTION.format\",\n predicate: () => settings.store.enableStreamQualityBypass,\n replacement: {\n match: /guildPremiumTier:\\i\\.\\i\\.TIER_\\d,?/g,\n replace: \"\"\n }\n },\n // Allow client themes to be changeable\n {\n find: \"canUseClientThemes:function\",\n replacement: {\n match: /canUseClientThemes:function\\(\\i\\){/,\n replace: \"$&return true;\"\n }\n },\n {\n find: '.displayName=\"UserSettingsProtoStore\"',\n replacement: [\n {\n // Overwrite incoming connection settings proto with our local settings\n match: /CONNECTION_OPEN:function\\((\\i)\\){/,\n replace: (m, props) => `${m}$self.handleProtoChange(${props}.userSettingsProto,${props}.user);`\n },\n {\n // Overwrite non local proto changes with our local settings\n match: /let{settings:/,\n replace: \"arguments[0].local||$self.handleProtoChange(arguments[0].settings.proto);$&\"\n }\n ]\n },\n // Call our function to handle changing the gradient theme when selecting a new one\n {\n find: \",updateTheme(\",\n replacement: {\n match: /(function \\i\\(\\i\\){let{backgroundGradientPresetId:(\\i).+?)(\\i\\.\\i\\.updateAsync.+?theme=(.+?),.+?},\\i\\))/,\n replace: (_, rest, backgroundGradientPresetId, originalCall, theme) => `${rest}$self.handleGradientThemeSelect(${backgroundGradientPresetId},${theme},()=>${originalCall});`\n }\n },\n {\n find: '[\"strong\",\"em\",\"u\",\"text\",\"inlineCode\",\"s\",\"spoiler\"]',\n replacement: [\n {\n // Call our function to decide whether the emoji link should be kept or not\n predicate: () => settings.store.transformEmojis,\n match: /1!==(\\i)\\.length\\|\\|1!==\\i\\.length/,\n replace: (m, content) => `${m}||$self.shouldKeepEmojiLink(${content}[0])`\n },\n {\n // Patch the rendered message content to add fake nitro emojis or remove sticker links\n predicate: () => settings.store.transformEmojis || settings.store.transformStickers,\n match: /(?=return{hasSpoilerEmbeds:\\i,content:(\\i)})/,\n replace: (_, content) => `${content}=$self.patchFakeNitroEmojisOrRemoveStickersLinks(${content},arguments[2]?.formatInline);`\n }\n ]\n },\n {\n find: \"renderEmbeds(\",\n replacement: [\n {\n // Call our function to decide whether the embed should be ignored or not\n predicate: () => settings.store.transformEmojis || settings.store.transformStickers,\n match: /(renderEmbeds\\((\\i)\\){)(.+?embeds\\.map\\((\\i)=>{)/,\n replace: (_, rest1, message, rest2, embed) => `${rest1}const fakeNitroMessage=${message};${rest2}if($self.shouldIgnoreEmbed(${embed},fakeNitroMessage))return null;`\n },\n {\n // Patch the stickers array to add fake nitro stickers\n predicate: () => settings.store.transformStickers,\n match: /(?<=renderStickersAccessories\\((\\i)\\){let (\\i)=\\(0,\\i\\.\\i\\)\\(\\i\\).+?;)/,\n replace: (_, message, stickers) => `${stickers}=$self.patchFakeNitroStickers(${stickers},${message});`\n },\n {\n // Filter attachments to remove fake nitro stickers or emojis\n predicate: () => settings.store.transformStickers,\n match: /renderAttachments\\(\\i\\){let{attachments:(\\i).+?;/,\n replace: (m, attachments) => `${m}${attachments}=$self.filterAttachments(${attachments});`\n }\n ]\n },\n {\n find: \".Messages.STICKER_POPOUT_UNJOINED_PRIVATE_GUILD_DESCRIPTION.format\",\n predicate: () => settings.store.transformStickers,\n replacement: [\n {\n // Export the renderable sticker to be used in the fake nitro sticker notice\n match: /let{renderableSticker:(\\i).{0,250}isGuildSticker.+?channel:\\i,/,\n replace: (m, renderableSticker) => `${m}fakeNitroRenderableSticker:${renderableSticker},`\n },\n {\n // Add the fake nitro sticker notice\n match: /(let \\i,{sticker:\\i,channel:\\i,closePopout:\\i.+?}=(\\i).+?;)(.+?description:)(\\i)(?=,sticker:\\i)/,\n replace: (_, rest, props, rest2, reactNode) => `${rest}let{fakeNitroRenderableSticker}=${props};${rest2}$self.addFakeNotice(${FakeNoticeType.Sticker},${reactNode},!!fakeNitroRenderableSticker?.fake)`\n }\n ]\n },\n {\n find: \".EMOJI_UPSELL_POPOUT_MORE_EMOJIS_OPENED,\",\n predicate: () => settings.store.transformEmojis,\n replacement: {\n // Export the emoji node to be used in the fake nitro emoji notice\n match: /isDiscoverable:\\i,shouldHideRoleSubscriptionCTA:\\i,(?<={node:(\\i),.+?)/,\n replace: (m, node) => `${m}fakeNitroNode:${node},`\n }\n },\n {\n find: \".Messages.EMOJI_POPOUT_UNJOINED_DISCOVERABLE_GUILD_DESCRIPTION\",\n predicate: () => settings.store.transformEmojis,\n replacement: {\n // Add the fake nitro emoji notice\n match: /(?<=isDiscoverable:\\i,emojiComesFromCurrentGuild:\\i,.+?}=(\\i).+?;)(.+?return )(.{0,1000}\\.Messages\\.EMOJI_POPOUT_UNJOINED_DISCOVERABLE_GUILD_DESCRIPTION.+?)(?=},)/,\n replace: (_, props, rest, reactNode) => `let{fakeNitroNode}=${props};${rest}$self.addFakeNotice(${FakeNoticeType.Emoji},${reactNode},!!fakeNitroNode?.fake)`\n }\n },\n // Allow using custom app icons\n {\n find: \"canUsePremiumAppIcons:function\",\n replacement: {\n match: /canUsePremiumAppIcons:function\\(\\i\\){/,\n replace: \"$&return true;\"\n }\n },\n // Separate patch for allowing using custom app icons\n {\n find: \"location:\\\"AppIconHome\\\"\",\n replacement: {\n match: /\\i\\.\\i\\.isPremium\\(\\i\\.\\i\\.getCurrentUser\\(\\)\\)/,\n replace: \"true\"\n }\n }\n ],\n\n get guildId() {\n return getCurrentGuild()?.id;\n },\n\n get canUseEmotes() {\n return (UserStore.getCurrentUser().premiumType ?? 0) > 0;\n },\n\n get canUseStickers() {\n return (UserStore.getCurrentUser().premiumType ?? 0) > 1;\n },\n\n handleProtoChange(proto: any, user: any) {\n if (proto == null || typeof proto === \"string\" || !UserSettingsProtoStore || !PreloadedUserSettingsActionCreators || !AppearanceSettingsActionCreators || !ClientThemeSettingsActionsCreators) return;\n\n const premiumType: number = user?.premium_type ?? UserStore?.getCurrentUser()?.premiumType ?? 0;\n\n if (premiumType !== 2) {\n proto.appearance ??= AppearanceSettingsActionCreators.create();\n\n if (UserSettingsProtoStore.settings.appearance?.theme != null) {\n const appearanceSettingsDummy = AppearanceSettingsActionCreators.create({\n theme: UserSettingsProtoStore.settings.appearance.theme\n });\n\n proto.appearance.theme = appearanceSettingsDummy.theme;\n }\n\n if (UserSettingsProtoStore.settings.appearance?.clientThemeSettings?.backgroundGradientPresetId?.value != null) {\n const clientThemeSettingsDummy = ClientThemeSettingsActionsCreators.create({\n backgroundGradientPresetId: {\n value: UserSettingsProtoStore.settings.appearance.clientThemeSettings.backgroundGradientPresetId.value\n }\n });\n\n proto.appearance.clientThemeSettings ??= clientThemeSettingsDummy;\n proto.appearance.clientThemeSettings.backgroundGradientPresetId = clientThemeSettingsDummy.backgroundGradientPresetId;\n }\n }\n },\n\n handleGradientThemeSelect(backgroundGradientPresetId: number | undefined, theme: number, original: () => void) {\n const premiumType = UserStore?.getCurrentUser()?.premiumType ?? 0;\n if (premiumType === 2 || backgroundGradientPresetId == null) return original();\n\n if (!PreloadedUserSettingsActionCreators || !AppearanceSettingsActionCreators || !ClientThemeSettingsActionsCreators || !ProtoUtils) return;\n\n const currentAppearanceSettings = PreloadedUserSettingsActionCreators.getCurrentValue().appearance;\n\n const newAppearanceProto = currentAppearanceSettings != null\n ? AppearanceSettingsActionCreators.fromBinary(AppearanceSettingsActionCreators.toBinary(currentAppearanceSettings), ProtoUtils.BINARY_READ_OPTIONS)\n : AppearanceSettingsActionCreators.create();\n\n newAppearanceProto.theme = theme;\n\n const clientThemeSettingsDummy = ClientThemeSettingsActionsCreators.create({\n backgroundGradientPresetId: {\n value: backgroundGradientPresetId\n }\n });\n\n newAppearanceProto.clientThemeSettings ??= clientThemeSettingsDummy;\n newAppearanceProto.clientThemeSettings.backgroundGradientPresetId = clientThemeSettingsDummy.backgroundGradientPresetId;\n\n const proto = PreloadedUserSettingsActionCreators.ProtoClass.create();\n proto.appearance = newAppearanceProto;\n\n FluxDispatcher.dispatch({\n type: \"USER_SETTINGS_PROTO_UPDATE\",\n local: true,\n partial: true,\n settings: {\n type: 1,\n proto\n }\n });\n },\n\n trimContent(content: Array) {\n const firstContent = content[0];\n if (typeof firstContent === \"string\") content[0] = firstContent.trimStart();\n if (content[0] === \"\") content.shift();\n\n const lastIndex = content.length - 1;\n const lastContent = content[lastIndex];\n if (typeof lastContent === \"string\") content[lastIndex] = lastContent.trimEnd();\n if (content[lastIndex] === \"\") content.pop();\n },\n\n clearEmptyArrayItems(array: Array) {\n return array.filter(item => item != null);\n },\n\n ensureChildrenIsArray(child: ReactElement) {\n if (!Array.isArray(child.props.children)) child.props.children = [child.props.children];\n },\n\n patchFakeNitroEmojisOrRemoveStickersLinks(content: Array, inline: boolean) {\n // If content has more than one child or it's a single ReactElement like a header or list\n if ((content.length > 1 || typeof content[0]?.type === \"string\") && !settings.store.transformCompoundSentence) return content;\n\n let nextIndex = content.length;\n\n const transformLinkChild = (child: ReactElement) => {\n if (settings.store.transformEmojis) {\n const fakeNitroMatch = child.props.href.match(fakeNitroEmojiRegex);\n if (fakeNitroMatch) {\n let url: URL | null = null;\n try {\n url = new URL(child.props.href);\n } catch { }\n\n const emojiName = EmojiStore.getCustomEmojiById(fakeNitroMatch[1])?.name ?? url?.searchParams.get(\"name\") ?? \"FakeNitroEmoji\";\n\n return Parser.defaultRules.customEmoji.react({\n jumboable: !inline && content.length === 1 && typeof content[0].type !== \"string\",\n animated: fakeNitroMatch[2] === \"gif\",\n emojiId: fakeNitroMatch[1],\n name: emojiName,\n fake: true\n }, void 0, { key: String(nextIndex++) });\n }\n }\n\n if (settings.store.transformStickers) {\n if (fakeNitroStickerRegex.test(child.props.href)) return null;\n\n const gifMatch = child.props.href.match(fakeNitroGifStickerRegex);\n if (gifMatch) {\n // There is no way to differentiate a regular gif attachment from a fake nitro animated sticker, so we check if the StickerStore contains the id of the fake sticker\n if (StickerStore.getStickerById(gifMatch[1])) return null;\n }\n }\n\n return child;\n };\n\n const transformChild = (child: ReactElement) => {\n if (child?.props?.trusted != null) return transformLinkChild(child);\n if (child?.props?.children != null) {\n if (!Array.isArray(child.props.children)) {\n child.props.children = modifyChild(child.props.children);\n return child;\n }\n\n child.props.children = modifyChildren(child.props.children);\n if (child.props.children.length === 0) return null;\n return child;\n }\n\n return child;\n };\n\n const modifyChild = (child: ReactElement) => {\n const newChild = transformChild(child);\n\n if (newChild?.type === \"ul\" || newChild?.type === \"ol\") {\n this.ensureChildrenIsArray(newChild);\n if (newChild.props.children.length === 0) return null;\n\n let listHasAnItem = false;\n for (const [index, child] of newChild.props.children.entries()) {\n if (child == null) {\n delete newChild.props.children[index];\n continue;\n }\n\n this.ensureChildrenIsArray(child);\n if (child.props.children.length > 0) listHasAnItem = true;\n else delete newChild.props.children[index];\n }\n\n if (!listHasAnItem) return null;\n\n newChild.props.children = this.clearEmptyArrayItems(newChild.props.children);\n }\n\n return newChild;\n };\n\n const modifyChildren = (children: Array) => {\n for (const [index, child] of children.entries()) children[index] = modifyChild(child);\n\n children = this.clearEmptyArrayItems(children);\n this.trimContent(children);\n\n return children;\n };\n\n try {\n return modifyChildren(lodash.cloneDeep(content));\n } catch (err) {\n new Logger(\"FakeNitro\").error(err);\n return content;\n }\n },\n\n patchFakeNitroStickers(stickers: Array, message: Message) {\n const itemsToMaybePush: Array = [];\n\n const contentItems = message.content.split(/\\s/);\n if (settings.store.transformCompoundSentence) itemsToMaybePush.push(...contentItems);\n else if (contentItems.length === 1) itemsToMaybePush.push(contentItems[0]);\n\n itemsToMaybePush.push(...message.attachments.filter(attachment => attachment.content_type === \"image/gif\").map(attachment => attachment.url));\n\n for (const item of itemsToMaybePush) {\n if (!settings.store.transformCompoundSentence && !item.startsWith(\"http\")) continue;\n\n const imgMatch = item.match(fakeNitroStickerRegex);\n if (imgMatch) {\n let url: URL | null = null;\n try {\n url = new URL(item);\n } catch { }\n\n const stickerName = StickerStore.getStickerById(imgMatch[1])?.name ?? url?.searchParams.get(\"name\") ?? \"FakeNitroSticker\";\n stickers.push({\n format_type: 1,\n id: imgMatch[1],\n name: stickerName,\n fake: true\n });\n\n continue;\n }\n\n const gifMatch = item.match(fakeNitroGifStickerRegex);\n if (gifMatch) {\n if (!StickerStore.getStickerById(gifMatch[1])) continue;\n\n const stickerName = StickerStore.getStickerById(gifMatch[1])?.name ?? \"FakeNitroSticker\";\n stickers.push({\n format_type: 2,\n id: gifMatch[1],\n name: stickerName,\n fake: true\n });\n }\n }\n\n return stickers;\n },\n\n shouldIgnoreEmbed(embed: Message[\"embeds\"][number], message: Message) {\n const contentItems = message.content.split(/\\s/);\n if (contentItems.length > 1 && !settings.store.transformCompoundSentence) return false;\n\n switch (embed.type) {\n case \"image\": {\n if (\n !settings.store.transformCompoundSentence\n && !contentItems.includes(embed.url!)\n && !contentItems.includes(embed.image?.proxyURL!)\n ) return false;\n\n if (settings.store.transformEmojis) {\n if (fakeNitroEmojiRegex.test(embed.url!)) return true;\n }\n\n if (settings.store.transformStickers) {\n if (fakeNitroStickerRegex.test(embed.url!)) return true;\n\n const gifMatch = embed.url!.match(fakeNitroGifStickerRegex);\n if (gifMatch) {\n // There is no way to differentiate a regular gif attachment from a fake nitro animated sticker, so we check if the StickerStore contains the id of the fake sticker\n if (StickerStore.getStickerById(gifMatch[1])) return true;\n }\n }\n\n break;\n }\n }\n\n return false;\n },\n\n filterAttachments(attachments: Message[\"attachments\"]) {\n return attachments.filter(attachment => {\n if (attachment.content_type !== \"image/gif\") return true;\n\n const match = attachment.url.match(fakeNitroGifStickerRegex);\n if (match) {\n // There is no way to differentiate a regular gif attachment from a fake nitro animated sticker, so we check if the StickerStore contains the id of the fake sticker\n if (StickerStore.getStickerById(match[1])) return false;\n }\n\n return true;\n });\n },\n\n shouldKeepEmojiLink(link: any) {\n return link.target && fakeNitroEmojiRegex.test(link.target);\n },\n\n addFakeNotice(type: FakeNoticeType, node: Array, fake: boolean) {\n if (!fake) return node;\n\n node = Array.isArray(node) ? node : [node];\n\n switch (type) {\n case FakeNoticeType.Sticker: {\n node.push(\" This is a FakeNitro sticker and renders like a real sticker only for you. Appears as a link to non-plugin users.\");\n\n return node;\n }\n case FakeNoticeType.Emoji: {\n node.push(\" This is a FakeNitro emoji and renders like a real emoji only for you. Appears as a link to non-plugin users.\");\n\n return node;\n }\n }\n },\n\n hasPermissionToUseExternalEmojis(channelId: string): boolean {\n const channel = ChannelStore.getChannel(channelId);\n\n if (!channel || channel.isDM() || channel.isGroupDM() || channel.isMultiUserDM()) return true;\n\n return PermissionStore.can(USE_EXTERNAL_EMOJIS, channel);\n },\n\n hasPermissionToUseExternalStickers(channelId: string) {\n const channel = ChannelStore.getChannel(channelId);\n\n if (!channel || channel.isDM() || channel.isGroupDM() || channel.isMultiUserDM()) return true;\n\n return PermissionStore.can(USE_EXTERNAL_STICKERS, channel);\n },\n\n getStickerLink(stickerId: string) {\n return `https://media.discordapp.net/stickers/${stickerId}.png?size=${Settings.plugins.FakeNitro.stickerSize}`;\n },\n\n async sendAnimatedSticker(stickerLink: string, stickerId: string, channelId: string) {\n const { parseURL } = importApngJs();\n\n const { frames, width, height } = await parseURL(stickerLink);\n\n const gif = GIFEncoder();\n const resolution = Settings.plugins.FakeNitro.stickerSize;\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = resolution;\n canvas.height = resolution;\n\n const ctx = canvas.getContext(\"2d\", {\n willReadFrequently: true\n })!;\n\n const scale = resolution / Math.max(width, height);\n ctx.scale(scale, scale);\n\n let previousFrameData: ImageData;\n\n for (const frame of frames) {\n const { left, top, width, height, img, delay, blendOp, disposeOp } = frame;\n\n previousFrameData = ctx.getImageData(left, top, width, height);\n\n if (blendOp === ApngBlendOp.SOURCE) {\n ctx.clearRect(left, top, width, height);\n }\n\n ctx.drawImage(img, left, top, width, height);\n\n const { data } = ctx.getImageData(0, 0, resolution, resolution);\n\n const palette = quantize(data, 256);\n const index = applyPalette(data, palette);\n\n gif.writeFrame(index, resolution, resolution, {\n transparent: true,\n palette,\n delay\n });\n\n if (disposeOp === ApngDisposeOp.BACKGROUND) {\n ctx.clearRect(left, top, width, height);\n } else if (disposeOp === ApngDisposeOp.PREVIOUS) {\n ctx.putImageData(previousFrameData, left, top);\n }\n }\n\n gif.finish();\n\n const file = new File([gif.bytesView()], `${stickerId}.gif`, { type: \"image/gif\" });\n UploadHandler.promptToUpload([file], ChannelStore.getChannel(channelId), DRAFT_TYPE);\n },\n\n start() {\n const s = settings.store;\n\n if (!s.enableEmojiBypass && !s.enableStickerBypass) {\n return;\n }\n\n function getWordBoundary(origStr: string, offset: number) {\n return (!origStr[offset] || /\\s/.test(origStr[offset])) ? \"\" : \" \";\n }\n\n this.preSend = addPreSendListener((channelId, messageObj, extra) => {\n const { guildId } = this;\n\n stickerBypass: {\n if (!s.enableStickerBypass)\n break stickerBypass;\n\n const sticker = StickerStore.getStickerById(extra.stickers?.[0]!);\n if (!sticker)\n break stickerBypass;\n\n // Discord Stickers are now free yayyy!! :D\n if (\"pack_id\" in sticker)\n break stickerBypass;\n\n const canUseStickers = this.canUseStickers && this.hasPermissionToUseExternalStickers(channelId);\n if (sticker.available !== false && (canUseStickers || sticker.guild_id === guildId))\n break stickerBypass;\n\n const link = this.getStickerLink(sticker.id);\n if (sticker.format_type === StickerType.APNG) {\n this.sendAnimatedSticker(link, sticker.id, channelId);\n return { cancel: true };\n } else {\n extra.stickers!.length = 0;\n messageObj.content += ` ${link}&name=${encodeURIComponent(sticker.name)}`;\n }\n }\n\n if (s.enableEmojiBypass) {\n const canUseEmotes = this.canUseEmotes && this.hasPermissionToUseExternalEmojis(channelId);\n\n for (const emoji of messageObj.validNonShortcutEmojis) {\n if (!emoji.require_colons) continue;\n if (emoji.available !== false && canUseEmotes) continue;\n if (emoji.guildId === guildId && !emoji.animated) continue;\n\n const emojiString = `<${emoji.animated ? \"a\" : \"\"}:${emoji.originalName || emoji.name}:${emoji.id}>`;\n const url = emoji.url.replace(/\\?size=\\d+/, \"?\" + new URLSearchParams({\n size: Settings.plugins.FakeNitro.emojiSize,\n name: encodeURIComponent(emoji.name)\n }));\n messageObj.content = messageObj.content.replace(emojiString, (match, offset, origStr) => {\n return `${getWordBoundary(origStr, offset - 1)}${url}${getWordBoundary(origStr, offset + match.length)}`;\n });\n }\n }\n\n return { cancel: false };\n });\n\n this.preEdit = addPreEditListener((channelId, __, messageObj) => {\n if (!s.enableEmojiBypass) return;\n\n const canUseEmotes = this.canUseEmotes && this.hasPermissionToUseExternalEmojis(channelId);\n\n const { guildId } = this;\n\n messageObj.content = messageObj.content.replace(/(?/ig, (emojiStr, emojiId, offset, origStr) => {\n const emoji = EmojiStore.getCustomEmojiById(emojiId);\n if (emoji == null) return emojiStr;\n if (!emoji.require_colons) return emojiStr;\n if (emoji.available !== false && canUseEmotes) return emojiStr;\n if (emoji.guildId === guildId && !emoji.animated) return emojiStr;\n\n const url = emoji.url.replace(/\\?size=\\d+/, \"?\" + new URLSearchParams({\n size: Settings.plugins.FakeNitro.emojiSize,\n name: encodeURIComponent(emoji.name)\n }));\n return `${getWordBoundary(origStr, offset - 1)}${url}${getWordBoundary(origStr, offset + emojiStr.length)}`;\n });\n });\n },\n\n stop() {\n removePreSendListener(this.preSend);\n removePreEditListener(this.preEdit);\n }\n});\n", "\"use strict\";\n/*!\n * virtual-merge\n * Copyright (c) 2023 Vendicated\n * SPDX-License-Identifier: MIT\n */\nfunction virtualMerge(...objects) {\n const fallback = {};\n function findObjectByProp(prop) {\n for (let i = objects.length - 1; i >= 0; i--) {\n if (prop in objects[i])\n return objects[i];\n }\n return fallback;\n }\n const handler = {\n ownKeys() {\n return objects.reduce((acc, obj) => {\n acc.push(...Reflect.ownKeys(obj));\n return acc;\n }, Reflect.ownKeys(fallback));\n }\n };\n for (const method of [\"defineProperty\", \"deleteProperty\", \"get\", \"getOwnPropertyDescriptor\", \"has\", \"set\"]) {\n handler[method] = function(_, ...args) {\n return Reflect[method](findObjectByProp(args[0]), ...args);\n };\n }\n return new Proxy(fallback, handler);\n}\nexport default virtualMerge;\nif (typeof module !== \"undefined\")\n module.exports = virtualMerge;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n// This plugin is a port from Alyxia's Vendetta plugin\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { Margins } from \"@utils/margins\";\nimport { copyWithToast } from \"@utils/misc\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Button, Forms } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\nimport virtualMerge from \"virtual-merge\";\n\ninterface UserProfile extends User {\n themeColors?: Array;\n}\n\ninterface Colors {\n primary: number;\n accent: number;\n}\n\nfunction encode(primary: number, accent: number): string {\n const message = `[#${primary.toString(16).padStart(6, \"0\")},#${accent.toString(16).padStart(6, \"0\")}]`;\n const padding = \"\";\n const encoded = Array.from(message)\n .map(x => x.codePointAt(0))\n .filter(x => x! >= 0x20 && x! <= 0x7f)\n .map(x => String.fromCodePoint(x! + 0xe0000))\n .join(\"\");\n\n return (padding || \"\") + \" \" + encoded;\n}\n\n// Courtesy of Cynthia.\nfunction decode(bio: string): Array | null {\n if (bio == null) return null;\n\n const colorString = bio.match(\n /\\u{e005b}\\u{e0023}([\\u{e0061}-\\u{e0066}\\u{e0041}-\\u{e0046}\\u{e0030}-\\u{e0039}]+?)\\u{e002c}\\u{e0023}([\\u{e0061}-\\u{e0066}\\u{e0041}-\\u{e0046}\\u{e0030}-\\u{e0039}]+?)\\u{e005d}/u,\n );\n if (colorString != null) {\n const parsed = [...colorString[0]]\n .map(x => String.fromCodePoint(x.codePointAt(0)! - 0xe0000))\n .join(\"\");\n const colors = parsed\n .substring(1, parsed.length - 1)\n .split(\",\")\n .map(x => parseInt(x.replace(\"#\", \"0x\"), 16));\n\n return colors;\n } else {\n return null;\n }\n}\n\nconst settings = definePluginSettings({\n nitroFirst: {\n description: \"Default color source if both are present\",\n type: OptionType.SELECT,\n options: [\n { label: \"Nitro colors\", value: true, default: true },\n { label: \"Fake colors\", value: false },\n ]\n }\n});\n\nexport default definePlugin({\n name: \"FakeProfileThemes\",\n description: \"Allows profile theming by hiding the colors in your bio thanks to invisible 3y3 encoding\",\n authors: [Devs.Alyxia, Devs.Remty],\n patches: [\n {\n find: \"UserProfileStore\",\n replacement: {\n match: /(?<=getUserProfile\\(\\i\\){return )(\\i\\[\\i\\])/,\n replace: \"$self.colorDecodeHook($1)\"\n }\n }, {\n find: \".USER_SETTINGS_PROFILE_THEME_ACCENT\",\n replacement: {\n match: /RESET_PROFILE_THEME}\\)(?<=color:(\\i),.{0,500}?color:(\\i),.{0,500}?)/,\n replace: \"$&,$self.addCopy3y3Button({primary:$1,accent:$2})\"\n }\n }\n ],\n settingsAboutComponent: () => (\n \n Usage\n \n After enabling this plugin, you will see custom colors in the profiles of other people using compatible plugins.
\n To set your own colors:\n
    \n
  • \u2022 go to your profile settings
  • \n
  • \u2022 choose your own colors in the Nitro preview
  • \n
  • \u2022 click the \"Copy 3y3\" button
  • \n
  • \u2022 paste the invisible text anywhere in your bio
  • \n

\n Please note: if you are using a theme which hides nitro ads, you should disable it temporarily to set colors.\n
\n
),\n settings,\n colorDecodeHook(user: UserProfile) {\n if (user) {\n // don't replace colors if already set with nitro\n if (settings.store.nitroFirst && user.themeColors) return user;\n const colors = decode(user.bio);\n if (colors) {\n return virtualMerge(user, {\n premiumType: 2,\n themeColors: colors\n });\n }\n }\n return user;\n },\n addCopy3y3Button: ErrorBoundary.wrap(function ({ primary, accent }: Colors) {\n return {\n const colorString = encode(primary, accent);\n copyWithToast(colorString);\n }}\n color={Button.Colors.PRIMARY}\n size={Button.Sizes.XLARGE}\n className={Margins.left16}\n >Copy 3y3\n ;\n }, { noop: true }),\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { EmojiStore } from \"@webpack/common\";\nimport { Emoji } from \"@webpack/types\";\n\ninterface EmojiAutocompleteState {\n query?: {\n type: string;\n typeInfo: {\n sentinel: string;\n };\n results: {\n emojis: Emoji[] & { sliceTo?: number; };\n };\n };\n}\n\nexport default definePlugin({\n name: \"FavoriteEmojiFirst\",\n authors: [Devs.Aria, Devs.Ven],\n description: \"Puts your favorite emoji first in the emoji autocomplete.\",\n patches: [\n {\n find: \"renderResults({results:\",\n replacement: [\n {\n // https://regex101.com/r/N7kpLM/1\n match: /let \\i=.{1,100}renderResults\\({results:(\\i)\\.query\\.results,/,\n replace: \"$self.sortEmojis($1);$&\"\n },\n ],\n },\n\n {\n find: \"MAX_AUTOCOMPLETE_RESULTS+\",\n replacement: [\n // set maxCount to Infinity so our sortEmojis callback gets the entire list, not just the first 10\n // and remove Discord's emojiResult slice, storing the endIndex on the array for us to use later\n {\n // https://regex101.com/r/x2mobQ/1\n // searchEmojis(...,maxCount: stuff) ... endEmojis = emojis.slice(0, maxCount - gifResults.length)\n match: /,maxCount:(\\i)(.{1,500}\\i)=(\\i)\\.slice\\(0,(\\i-\\i\\.length)\\)/,\n // ,maxCount:Infinity ... endEmojis = (emojis.sliceTo = n, emojis)\n replace: \",maxCount:Infinity$2=($3.sliceTo = $4, $3)\"\n }\n ]\n }\n ],\n\n sortEmojis({ query }: EmojiAutocompleteState) {\n if (\n query?.type !== \"EMOJIS_AND_STICKERS\"\n || query.typeInfo?.sentinel !== \":\"\n || !query.results?.emojis?.length\n ) return;\n\n const emojiContext = EmojiStore.getDisambiguatedEmojiContext();\n\n query.results.emojis = query.results.emojis.sort((a, b) => {\n const aIsFavorite = emojiContext.isFavoriteEmojiWithoutFetchingLatest(a);\n const bIsFavorite = emojiContext.isFavoriteEmojiWithoutFetchingLatest(b);\n\n if (aIsFavorite && !bIsFavorite) return -1;\n\n if (!aIsFavorite && bIsFavorite) return 1;\n\n return 0;\n }).slice(0, query.results.emojis.sliceTo ?? 10);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { useCallback, useEffect, useRef, useState } from \"@webpack/common\";\n\ninterface SearchBarComponentProps {\n ref?: React.MutableRefObject;\n autoFocus: boolean;\n className: string;\n size: string;\n onChange: (query: string) => void;\n onClear: () => void;\n query: string;\n placeholder: string;\n}\n\ntype TSearchBarComponent =\n React.FC & { Sizes: Record<\"SMALL\" | \"MEDIUM\" | \"LARGE\", string>; };\n\ninterface Gif {\n format: number;\n src: string;\n width: number;\n height: number;\n order: number;\n url: string;\n}\n\ninterface Instance {\n dead?: boolean;\n state: {\n resultType?: string;\n };\n props: {\n favCopy: Gif[],\n\n favorites: Gif[],\n },\n forceUpdate: () => void;\n}\n\n\nconst containerClasses: { searchBar: string; } = findByPropsLazy(\"searchBar\", \"searchBarFullRow\");\n\nexport const settings = definePluginSettings({\n searchOption: {\n type: OptionType.SELECT,\n description: \"The part of the url you want to search\",\n options: [\n {\n label: \"Entire Url\",\n value: \"url\"\n },\n {\n label: \"Path Only (/somegif.gif)\",\n value: \"path\"\n },\n {\n label: \"Host & Path (tenor.com somgif.gif)\",\n value: \"hostandpath\",\n default: true\n }\n ] as const\n }\n});\n\nexport default definePlugin({\n name: \"FavoriteGifSearch\",\n authors: [Devs.Aria],\n description: \"Adds a search bar to favorite gifs.\",\n\n patches: [\n {\n find: \"renderHeaderContent()\",\n replacement: [\n {\n // https://regex101.com/r/07gpzP/1\n // ($1 renderHeaderContent=function { ... switch (x) ... case FAVORITES:return) ($2) ($3 case default:return r.jsx(($), {...props}))\n match: /(renderHeaderContent\\(\\).{1,150}FAVORITES:return)(.{1,150});(case.{1,200}default:return\\(0,\\i\\.jsx\\)\\((?\\i\\..{1,10}),)/,\n replace: \"$1 this.state.resultType === 'Favorites' ? $self.renderSearchBar(this, $) : $2;$3\"\n },\n {\n // to persist filtered favorites when component re-renders.\n // when resizing the window the component rerenders and we loose the filtered favorites and have to type in the search bar to get them again\n match: /(,suggestions:\\i,favorites:)(\\i),/,\n replace: \"$1$self.getFav($2),favCopy:$2,\"\n }\n\n ]\n }\n ],\n\n settings,\n\n getTargetString,\n\n instance: null as Instance | null,\n renderSearchBar(instance: Instance, SearchBarComponent: TSearchBarComponent) {\n this.instance = instance;\n return (\n \n \n \n );\n },\n\n getFav(favorites: Gif[]) {\n if (!this.instance || this.instance.dead) return favorites;\n const { favorites: filteredFavorites } = this.instance.props;\n\n return filteredFavorites != null && filteredFavorites?.length !== favorites.length ? filteredFavorites : favorites;\n\n }\n});\n\n\nfunction SearchBar({ instance, SearchBarComponent }: { instance: Instance; SearchBarComponent: TSearchBarComponent; }) {\n const [query, setQuery] = useState(\"\");\n const ref = useRef<{ containerRef?: React.MutableRefObject; } | null>(null);\n\n const onChange = useCallback((searchQuery: string) => {\n setQuery(searchQuery);\n const { props } = instance;\n\n // return early\n if (searchQuery === \"\") {\n props.favorites = props.favCopy;\n instance.forceUpdate();\n return;\n }\n\n\n // scroll back to top\n ref.current?.containerRef?.current\n .closest(\"#gif-picker-tab-panel\")\n ?.querySelector(\"[class|=\\\"content\\\"]\")\n ?.firstElementChild?.scrollTo(0, 0);\n\n\n const result =\n props.favCopy\n .map(gif => ({\n score: fuzzySearch(searchQuery.toLowerCase(), getTargetString(gif.url ?? gif.src).replace(/(%20|[_-])/g, \" \").toLowerCase()),\n gif,\n }))\n .filter(m => m.score != null) as { score: number; gif: Gif; }[];\n\n result.sort((a, b) => b.score - a.score);\n props.favorites = result.map(e => e.gif);\n\n instance.forceUpdate();\n }, [instance.state]);\n\n useEffect(() => {\n return () => {\n instance.dead = true;\n };\n }, []);\n\n return (\n {\n setQuery(\"\");\n if (instance.props.favCopy != null) {\n instance.props.favorites = instance.props.favCopy;\n instance.forceUpdate();\n }\n }}\n query={query}\n placeholder=\"Search Favorite Gifs\"\n />\n );\n}\n\n\n\nexport function getTargetString(urlStr: string) {\n const url = new URL(urlStr);\n switch (settings.store.searchOption) {\n case \"url\":\n return url.href;\n case \"path\":\n if (url.host === \"media.discordapp.net\" || url.host === \"tenor.com\")\n // /attachments/899763415290097664/1095711736461537381/attachment-1.gif -> attachment-1.gif\n // /view/some-gif-hi-24248063 -> some-gif-hi-24248063\n return url.pathname.split(\"/\").at(-1) ?? url.pathname;\n return url.pathname;\n case \"hostandpath\":\n if (url.host === \"media.discordapp.net\" || url.host === \"tenor.com\")\n return `${url.host} ${url.pathname.split(\"/\").at(-1) ?? url.pathname}`;\n return `${url.host} ${url.pathname}`;\n\n default:\n return \"\";\n }\n}\n\nfunction fuzzySearch(searchQuery: string, searchString: string) {\n let searchIndex = 0;\n let score = 0;\n\n for (let i = 0; i < searchString.length; i++) {\n if (searchString[i] === searchQuery[searchIndex]) {\n score++;\n searchIndex++;\n } else {\n score--;\n }\n\n if (searchIndex === searchQuery.length) {\n return score;\n }\n }\n\n return null;\n}\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { makeRange } from \"@components/PluginSettings/components\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\n// The entire code of this plugin can be found in ipcPlugins\nexport default definePlugin({\n name: \"FixSpotifyEmbeds\",\n description: \"Fixes spotify embeds being incredibly loud by letting you customise the volume\",\n authors: [Devs.Ven],\n settings: definePluginSettings({\n volume: {\n type: OptionType.SLIDER,\n description: \"The volume % to set for spotify embeds. Anything above 10% is veeeery loud\",\n markers: makeRange(0, 100, 10),\n stickToMarkers: false,\n default: 10\n }\n })\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { GuildStore } from \"@webpack/common\";\nimport { Channel, User } from \"discord-types/general\";\n\nexport default definePlugin({\n name: \"ForceOwnerCrown\",\n description: \"Force the owner crown next to usernames even if the server is large.\",\n authors: [Devs.D3SOX, Devs.Nickyux],\n patches: [\n {\n find: \"AVATAR_DECORATION_PADDING:\",\n replacement: {\n match: /,isOwner:(\\i),/,\n replace: \",_isOwner:$1=$self.isGuildOwner(e),\"\n }\n }\n ],\n isGuildOwner(props: { user: User, channel: Channel, isOwner: boolean, guildId?: string; }) {\n if (!props?.user?.id) return props.isOwner;\n if (props.channel?.type === 3 /* GROUP_DM */)\n return props.isOwner;\n\n // guild id is in props twice, fallback if the first is undefined\n const guildId = props.guildId ?? props.channel?.guild_id;\n const userId = props.user.id;\n\n return GuildStore.getGuild(guildId)?.ownerId === userId;\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from \"@api/Commands\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { RestAPI, UserStore } from \"@webpack/common\";\n\nconst FriendInvites = findByPropsLazy(\"createFriendInvite\");\nconst { uuid4 } = findByPropsLazy(\"uuid4\");\n\nexport default definePlugin({\n name: \"FriendInvites\",\n description: \"Create and manage friend invite links via slash commands (/create friend invite, /view friend invites, /revoke friend invites).\",\n authors: [Devs.afn, Devs.Dziurwa],\n dependencies: [\"CommandsAPI\"],\n commands: [\n {\n name: \"create friend invite\",\n description: \"Generates a friend invite link.\",\n inputType: ApplicationCommandInputType.BOT,\n options: [{\n name: \"Uses\",\n description: \"How many uses?\",\n choices: [\n { label: \"1\", name: \"1\", value: \"1\" },\n { label: \"5\", name: \"5\", value: \"5\" }\n ],\n required: false,\n type: ApplicationCommandOptionType.INTEGER\n }],\n\n execute: async (args, ctx) => {\n const uses = findOption(args, \"Uses\", 5);\n\n if (uses === 1 && !UserStore.getCurrentUser().phone)\n return sendBotMessage(ctx.channel.id, {\n content: \"You need to have a phone number connected to your account to create a friend invite with 1 use!\"\n });\n\n let invite: any;\n if (uses === 1) {\n const random = uuid4();\n const { body: { invite_suggestions } } = await RestAPI.post({\n url: \"/friend-finder/find-friends\",\n body: {\n modified_contacts: {\n [random]: [1, \"\", \"\"]\n },\n phone_contact_methods_count: 1\n }\n });\n invite = await FriendInvites.createFriendInvite({\n code: invite_suggestions[0][3],\n recipient_phone_number_or_email: random,\n contact_visibility: 1,\n filter_visibilities: [],\n filtered_invite_suggestions_index: 1\n });\n } else {\n invite = await FriendInvites.createFriendInvite();\n }\n\n sendBotMessage(ctx.channel.id, {\n content: `\n discord.gg/${invite.code} \u00B7\n Expires: \u00B7\n Max uses: \\`${invite.max_uses}\\`\n `.trim().replace(/\\s+/g, \" \")\n });\n }\n },\n {\n name: \"view friend invites\",\n description: \"View a list of all generated friend invites.\",\n inputType: ApplicationCommandInputType.BOT,\n execute: async (_, ctx) => {\n const invites = await FriendInvites.getAllFriendInvites();\n const friendInviteList = invites.map(i =>\n `\n _discord.gg/${i.code}_ \u00B7\n Expires: \u00B7\n Times used: \\`${i.uses}/${i.max_uses}\\`\n `.trim().replace(/\\s+/g, \" \")\n );\n\n sendBotMessage(ctx.channel.id, {\n content: friendInviteList.join(\"\\n\") || \"You have no active friend invites!\"\n });\n },\n },\n {\n name: \"revoke friend invites\",\n description: \"Revokes all generated friend invites.\",\n inputType: ApplicationCommandInputType.BOT,\n execute: async (_, ctx) => {\n await FriendInvites.revokeFriendInvites();\n\n sendBotMessage(ctx.channel.id, {\n content: \"All friend invites have been revoked.\"\n });\n },\n },\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n(window.VencordStyles ??= new Map()).set(\"src/plugins/gameActivityToggle/style.css\", {\n name: \"src/plugins/gameActivityToggle/style.css\",\n source: \"[class*=\\\"withTagAsButton\\\"] {\\n min-width: 88px !important;\\n}\\n\",\n classNames: {},\n dom: null,\n});\n\nexport default \"src/plugins/gameActivityToggle/style.css\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { disableStyle, enableStyle } from \"@api/Styles\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findComponentByCodeLazy } from \"@webpack\";\nimport { StatusSettingsStores } from \"@webpack/common\";\n\nimport style from \"./style.css?managed\";\n\nconst Button = findComponentByCodeLazy(\"Button.Sizes.NONE,disabled:\");\n\nfunction makeIcon(showCurrentGame?: boolean) {\n return function () {\n return (\n \n \n {!showCurrentGame && <>\n \n \n \n \n \n }\n \n );\n };\n}\n\nfunction GameActivityToggleButton() {\n const showCurrentGame = StatusSettingsStores.ShowCurrentGame.useSetting();\n\n return (\n StatusSettingsStores.ShowCurrentGame.updateSetting(old => !old)}\n />\n );\n}\n\nexport default definePlugin({\n name: \"GameActivityToggle\",\n description: \"Adds a button next to the mic and deafen button to toggle game activity.\",\n authors: [Devs.Nuckyz, Devs.RuukuLada],\n\n patches: [\n {\n find: \".Messages.ACCOUNT_SPEAKING_WHILE_MUTED\",\n replacement: {\n match: /this\\.renderNameZone\\(\\).+?children:\\[/,\n replace: \"$&$self.GameActivityToggleButton(),\"\n }\n }\n ],\n\n GameActivityToggleButton: ErrorBoundary.wrap(GameActivityToggleButton, { noop: true }),\n\n start() {\n enableStyle(style);\n },\n\n stop() {\n disableStyle(style);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport { insertTextIntoChatInputBox } from \"@utils/discord\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\n\nconst { closeExpressionPicker } = findByPropsLazy(\"closeExpressionPicker\");\n\nexport default definePlugin({\n name: \"GifPaste\",\n description: \"Makes picking a gif in the gif picker insert a link into the chatbox instead of instantly sending it\",\n authors: [Devs.Ven],\n\n patches: [{\n find: \".handleSelectGIF=\",\n replacement: {\n match: /\\.handleSelectGIF=(\\i)=>\\{/,\n replace: \".handleSelectGIF=$1=>{if (!this.props.className) return $self.handleSelect($1);\"\n }\n }],\n\n handleSelect(gif?: { url: string; }) {\n if (gif) {\n insertTextIntoChatInputBox(gif.url + \" \");\n closeExpressionPicker();\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ContextMenuApi, FluxDispatcher, Menu } from \"@webpack/common\";\nimport { Channel, Message } from \"discord-types/general\";\n\ninterface Sticker {\n id: string;\n format_type: number;\n description: string;\n name: string;\n}\n\nenum GreetMode {\n Greet = \"Greet\",\n NormalMessage = \"Message\"\n}\n\nconst settings = definePluginSettings({\n greetMode: {\n type: OptionType.SELECT,\n options: [\n { label: \"Greet (you can only greet 3 times)\", value: GreetMode.Greet, default: true },\n { label: \"Normal Message (you can greet spam)\", value: GreetMode.NormalMessage }\n ],\n description: \"Choose the greet mode\"\n }\n}).withPrivateSettings<{\n multiGreetChoices?: string[];\n unholyMultiGreetEnabled?: boolean;\n}>();\n\nconst MessageActions = findByPropsLazy(\"sendGreetMessage\");\nconst { WELCOME_STICKERS } = findByPropsLazy(\"WELCOME_STICKERS\");\n\nfunction greet(channel: Channel, message: Message, stickers: string[]) {\n const options = MessageActions.getSendMessageOptionsForReply({\n channel,\n message,\n shouldMention: true,\n showMentionToggle: true\n });\n\n if (settings.store.greetMode === GreetMode.NormalMessage || stickers.length > 1) {\n options.stickerIds = stickers;\n const msg = {\n content: \"\",\n tts: false,\n invalidEmojis: [],\n validNonShortcutEmojis: []\n };\n\n MessageActions._sendMessage(channel.id, msg, options);\n } else {\n MessageActions.sendGreetMessage(channel.id, stickers[0], options);\n }\n}\n\n\nfunction GreetMenu({ channel, message }: { message: Message, channel: Channel; }) {\n const s = settings.use([\"greetMode\", \"multiGreetChoices\"]);\n const { greetMode, multiGreetChoices = [] } = s;\n\n return (\n FluxDispatcher.dispatch({ type: \"CONTEXT_MENU_CLOSE\" })}\n aria-label=\"Greet Sticker Picker\"\n >\n \n {Object.values(GreetMode).map(mode => (\n s.greetMode = mode}\n />\n ))}\n \n\n \n\n \n {WELCOME_STICKERS.map(sticker => (\n greet(channel, message, [sticker.id])}\n />\n ))}\n \n\n {!settings.store.unholyMultiGreetEnabled ? null : (\n <>\n \n\n \n {WELCOME_STICKERS.map(sticker => {\n const checked = multiGreetChoices.some(s => s === sticker.id);\n\n return (\n = 3}\n action={() => {\n s.multiGreetChoices = checked\n ? multiGreetChoices.filter(s => s !== sticker.id)\n : [...multiGreetChoices, sticker.id];\n }}\n />\n );\n })}\n\n \n greet(channel, message, multiGreetChoices!)}\n disabled={multiGreetChoices.length === 0}\n />\n\n \n \n )}\n \n );\n}\n\nexport default definePlugin({\n name: \"GreetStickerPicker\",\n description: \"Allows you to use any greet sticker instead of only the random one by right-clicking the 'Wave to say hi!' button\",\n authors: [Devs.Ven],\n\n settings,\n\n patches: [\n {\n find: \"Messages.WELCOME_CTA_LABEL\",\n replacement: {\n match: /innerClassName:\\i\\.welcomeCTAButton,(?<={channel:\\i,message:\\i}=(\\i).{0,400}?)/,\n replace: \"$&onContextMenu:(vcEvent)=>$self.pickSticker(vcEvent, $1),\"\n }\n }\n ],\n\n pickSticker(\n event: React.UIEvent,\n props: {\n channel: Channel,\n message: Message;\n }\n ) {\n if (!(props.message as any).deleted)\n ContextMenuApi.openContextMenu(event, () => );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Logger } from \"@utils/Logger\";\nimport { Channel, Message } from \"discord-types/general\";\nimport type { MouseEventHandler } from \"react\";\n\nconst logger = new Logger(\"MessagePopover\");\n\nexport interface ButtonItem {\n key?: string,\n label: string,\n icon: React.ComponentType,\n message: Message,\n channel: Channel,\n onClick?: MouseEventHandler,\n onContextMenu?: MouseEventHandler;\n}\n\nexport type getButtonItem = (message: Message) => ButtonItem | null;\n\nexport const buttons = new Map();\n\nexport function addButton(\n identifier: string,\n item: getButtonItem,\n) {\n buttons.set(identifier, item);\n}\n\nexport function removeButton(identifier: string) {\n buttons.delete(identifier);\n}\n\nexport function _buildPopoverElements(\n msg: Message,\n makeButton: (item: ButtonItem) => React.ComponentType\n) {\n const items = [] as React.ComponentType[];\n\n for (const [identifier, getItem] of buttons.entries()) {\n try {\n const item = getItem(msg);\n if (item) {\n item.key ??= identifier;\n items.push(makeButton(item));\n }\n } catch (err) {\n logger.error(`[${identifier}]`, err);\n }\n }\n\n return items;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { get, set } from \"@api/DataStore\";\nimport { addButton, removeButton } from \"@api/MessagePopover\";\nimport { ImageInvisible, ImageVisible } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { ChannelStore } from \"@webpack/common\";\n\nlet style: HTMLStyleElement;\n\nconst KEY = \"HideAttachments_HiddenIds\";\n\nlet hiddenMessages: Set = new Set();\nconst getHiddenMessages = () => get(KEY).then(set => {\n hiddenMessages = set ?? new Set();\n return hiddenMessages;\n});\nconst saveHiddenMessages = (ids: Set) => set(KEY, ids);\n\nexport default definePlugin({\n name: \"HideAttachments\",\n description: \"Hide attachments and Embeds for individual messages via hover button\",\n authors: [Devs.Ven],\n dependencies: [\"MessagePopoverAPI\"],\n\n async start() {\n style = document.createElement(\"style\");\n style.id = \"VencordHideAttachments\";\n document.head.appendChild(style);\n\n await getHiddenMessages();\n await this.buildCss();\n\n addButton(\"HideAttachments\", msg => {\n if (!msg.attachments.length && !msg.embeds.length && !msg.stickerItems.length) return null;\n\n const isHidden = hiddenMessages.has(msg.id);\n\n return {\n label: isHidden ? \"Show Attachments\" : \"Hide Attachments\",\n icon: isHidden ? ImageVisible : ImageInvisible,\n message: msg,\n channel: ChannelStore.getChannel(msg.channel_id),\n onClick: () => this.toggleHide(msg.id)\n };\n });\n },\n\n stop() {\n style.remove();\n hiddenMessages.clear();\n removeButton(\"HideAttachments\");\n },\n\n async buildCss() {\n const elements = [...hiddenMessages].map(id => `#message-accessories-${id}`).join(\",\");\n style.textContent = `\n :is(${elements}) :is([class*=\"embedWrapper\"], [class*=\"clickableSticker\"]) {\n /* important is not necessary, but add it to make sure bad themes won't break it */\n display: none !important;\n }\n :is(${elements})::after {\n content: \"Attachments hidden\";\n color: var(--text-muted);\n font-size: 80%;\n }\n `;\n },\n\n async toggleHide(id: string) {\n const ids = await getHiddenMessages();\n if (!ids.delete(id))\n ids.add(id);\n\n await saveHiddenMessages(ids);\n await this.buildCss();\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"iLoveSpam\",\n description: \"Do not hide messages from 'likely spammers'\",\n authors: [Devs.botato, Devs.Animal],\n patches: [\n {\n find: \"hasFlag:{writable\",\n replacement: {\n match: /if\\((\\i)<=(?:1<<30|1073741824)\\)return/,\n replace: \"if($1===(1<<20))return false;$&\",\n },\n },\n ],\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport * as DataStore from \"@api/DataStore\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findStoreLazy } from \"@webpack\";\nimport { StatusSettingsStores, Tooltip } from \"webpack/common\";\n\nconst enum ActivitiesTypes {\n Game,\n Embedded\n}\n\ninterface IgnoredActivity {\n id: string;\n name: string;\n type: ActivitiesTypes;\n}\n\nconst RunningGameStore = findStoreLazy(\"RunningGameStore\");\n\nfunction ToggleIcon(activity: IgnoredActivity, tooltipText: string, path: string, fill: string) {\n return (\n \n {tooltipProps => (\n handleActivityToggle(e, activity)}\n style={{ all: \"unset\", cursor: \"pointer\", display: \"flex\", justifyContent: \"center\", alignItems: \"center\" }}\n >\n \n \n \n \n )}\n \n );\n}\n\nconst ToggleIconOn = (activity: IgnoredActivity, fill: string) => ToggleIcon(activity, \"Disable Activity\", \"M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z\", fill);\nconst ToggleIconOff = (activity: IgnoredActivity, fill: string) => ToggleIcon(activity, \"Enable Activity\", \"m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z\", fill);\n\nfunction ToggleActivityComponent(activity: IgnoredActivity, isPlaying = false) {\n const s = settings.use([\"ignoredActivities\"]);\n const { ignoredActivities = [] } = s;\n\n if (ignoredActivities.some(act => act.id === activity.id)) return ToggleIconOff(activity, \"var(--status-danger)\");\n return ToggleIconOn(activity, isPlaying ? \"var(--green-300)\" : \"var(--primary-400)\");\n}\n\nfunction handleActivityToggle(e: React.MouseEvent, activity: IgnoredActivity) {\n e.stopPropagation();\n\n const ignoredActivityIndex = getIgnoredActivities().findIndex(act => act.id === activity.id);\n if (ignoredActivityIndex === -1) settings.store.ignoredActivities = getIgnoredActivities().concat(activity);\n else settings.store.ignoredActivities = getIgnoredActivities().filter((_, index) => index !== ignoredActivityIndex);\n\n // Trigger activities recalculation\n StatusSettingsStores.ShowCurrentGame.updateSetting(old => old);\n}\n\nconst settings = definePluginSettings({}).withPrivateSettings<{\n ignoredActivities: IgnoredActivity[];\n}>();\n\nfunction getIgnoredActivities() {\n return settings.store.ignoredActivities ??= [];\n}\n\nexport default definePlugin({\n name: \"IgnoreActivities\",\n authors: [Devs.Nuckyz],\n description: \"Ignore activities from showing up on your status ONLY. You can configure which ones are ignored from the Registered Games and Activities tabs.\",\n\n settings,\n\n patches: [\n {\n find: '.displayName=\"LocalActivityStore\"',\n replacement: [\n {\n match: /HANG_STATUS.+?(?=!\\i\\(\\i,\\i\\)&&)(?<=(\\i)\\.push.+?)/,\n replace: (m, activities) => `${m}${activities}=${activities}.filter($self.isActivityNotIgnored);`\n }\n ]\n },\n {\n find: \".Messages.SETTINGS_GAMES_TOGGLE_OVERLAY\",\n replacement: {\n match: /\\.Messages\\.SETTINGS_GAMES_TOGGLE_OVERLAY.+?}\\(\\),(?<={overlay:\\i,.+?=(\\i),.+?)(?=!(\\i))/,\n replace: (m, props, nowPlaying) => `${m}$self.renderToggleGameActivityButton(${props},${nowPlaying}),`\n }\n },\n {\n find: \".activityTitleText,variant\",\n replacement: {\n match: /(?<=\\i\\.activityTitleText.+?children:(\\i)\\.name.*?}\\),)/,\n replace: (_, props) => `$self.renderToggleActivityButton(${props}),`\n },\n },\n {\n find: \".activityCardDetails,children\",\n replacement: {\n match: /(?<=\\i\\.activityCardDetails.+?children:(\\i\\.application)\\.name.*?}\\),)/,\n replace: (_, props) => `$self.renderToggleActivityButton(${props}),`\n }\n }\n ],\n\n async start() {\n const oldIgnoredActivitiesData = await DataStore.get>(\"IgnoreActivities_ignoredActivities\");\n\n if (oldIgnoredActivitiesData != null) {\n settings.store.ignoredActivities = Array.from(oldIgnoredActivitiesData.values())\n .map(activity => ({ ...activity, name: \"Unknown Name\" }));\n\n DataStore.del(\"IgnoreActivities_ignoredActivities\");\n }\n\n if (getIgnoredActivities().length !== 0) {\n const gamesSeen = RunningGameStore.getGamesSeen() as { id?: string; exePath: string; }[];\n\n for (const [index, ignoredActivity] of getIgnoredActivities().entries()) {\n if (ignoredActivity.type !== ActivitiesTypes.Game) continue;\n\n if (!gamesSeen.some(game => game.id === ignoredActivity.id || game.exePath === ignoredActivity.id)) {\n getIgnoredActivities().splice(index, 1);\n }\n }\n }\n },\n\n isActivityNotIgnored(props: { type: number; application_id?: string; name?: string; }) {\n if (props.type === 0 || props.type === 3) {\n if (props.application_id != null) return !getIgnoredActivities().some(activity => activity.id === props.application_id);\n else {\n const exePath = RunningGameStore.getRunningGames().find(game => game.name === props.name)?.exePath;\n if (exePath) return !getIgnoredActivities().some(activity => activity.id === exePath);\n }\n }\n return true;\n },\n\n renderToggleGameActivityButton(props: { id?: string; name: string, exePath: string; }, nowPlaying: boolean) {\n return (\n \n
\n {ToggleActivityComponent({ id: props.id ?? props.exePath, name: props.name, type: ActivitiesTypes.Game }, nowPlaying)}\n
\n
\n );\n },\n\n renderToggleActivityButton(props: { id: string; name: string; }) {\n return (\n \n {ToggleActivityComponent({ id: props.id, name: props.name, type: ActivitiesTypes.Embedded })}\n \n );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const ELEMENT_ID = \"vc-imgzoom-magnify-modal\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function waitFor(condition: () => boolean, cb: () => void) {\n if (condition()) cb();\n else requestAnimationFrame(() => waitFor(condition, cb));\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { classNameFactory } from \"@api/Styles\";\nimport { FluxDispatcher, React, useRef, useState } from \"@webpack/common\";\n\nimport { ELEMENT_ID } from \"../constants\";\nimport { settings } from \"../index\";\nimport { waitFor } from \"../utils/waitFor\";\n\ninterface Vec2 {\n x: number,\n y: number;\n}\n\nexport interface MagnifierProps {\n zoom: number;\n size: number,\n instance: any;\n}\n\nconst cl = classNameFactory(\"vc-imgzoom-\");\n\nexport const Magnifier: React.FC = ({ instance, size: initialSize, zoom: initalZoom }) => {\n const [ready, setReady] = useState(false);\n\n const [lensPosition, setLensPosition] = useState({ x: 0, y: 0 });\n const [imagePosition, setImagePosition] = useState({ x: 0, y: 0 });\n const [opacity, setOpacity] = useState(0);\n\n const isShiftDown = useRef(false);\n\n const zoom = useRef(initalZoom);\n const size = useRef(initialSize);\n\n const element = useRef(null);\n const currentVideoElementRef = useRef(null);\n const originalVideoElementRef = useRef(null);\n const imageRef = useRef(null);\n\n // since we accessing document im gonna use useLayoutEffect\n React.useLayoutEffect(() => {\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Shift\") {\n isShiftDown.current = true;\n }\n };\n const onKeyUp = (e: KeyboardEvent) => {\n if (e.key === \"Shift\") {\n isShiftDown.current = false;\n }\n };\n const syncVideos = () => {\n currentVideoElementRef.current!.currentTime = originalVideoElementRef.current!.currentTime;\n };\n\n const updateMousePosition = (e: MouseEvent) => {\n if (instance.state.mouseOver && instance.state.mouseDown) {\n const offset = size.current / 2;\n const pos = { x: e.pageX, y: e.pageY };\n const x = -((pos.x - element.current!.getBoundingClientRect().left) * zoom.current - offset);\n const y = -((pos.y - element.current!.getBoundingClientRect().top) * zoom.current - offset);\n setLensPosition({ x: e.x - offset, y: e.y - offset });\n setImagePosition({ x, y });\n setOpacity(1);\n } else {\n setOpacity(0);\n }\n\n };\n\n const onMouseDown = (e: MouseEvent) => {\n if (instance.state.mouseOver && e.button === 0 /* left click */) {\n zoom.current = settings.store.zoom;\n size.current = settings.store.size;\n\n // close context menu if open\n if (document.getElementById(\"image-context\")) {\n FluxDispatcher.dispatch({ type: \"CONTEXT_MENU_CLOSE\" });\n }\n\n updateMousePosition(e);\n setOpacity(1);\n }\n };\n\n const onMouseUp = () => {\n setOpacity(0);\n if (settings.store.saveZoomValues) {\n settings.store.zoom = zoom.current;\n settings.store.size = size.current;\n }\n };\n\n const onWheel = async (e: WheelEvent) => {\n if (instance.state.mouseOver && instance.state.mouseDown && !isShiftDown.current) {\n const val = zoom.current + ((e.deltaY / 100) * (settings.store.invertScroll ? -1 : 1)) * settings.store.zoomSpeed;\n zoom.current = val <= 1 ? 1 : val;\n updateMousePosition(e);\n }\n if (instance.state.mouseOver && instance.state.mouseDown && isShiftDown.current) {\n const val = size.current + (e.deltaY * (settings.store.invertScroll ? -1 : 1)) * settings.store.zoomSpeed;\n size.current = val <= 50 ? 50 : val;\n updateMousePosition(e);\n }\n };\n\n waitFor(() => instance.state.readyState === \"READY\", () => {\n const elem = document.getElementById(ELEMENT_ID) as HTMLDivElement;\n element.current = elem;\n elem.firstElementChild!.setAttribute(\"draggable\", \"false\");\n if (instance.props.animated) {\n originalVideoElementRef.current = elem!.querySelector(\"video\")!;\n originalVideoElementRef.current.addEventListener(\"timeupdate\", syncVideos);\n setReady(true);\n } else {\n setReady(true);\n }\n });\n document.addEventListener(\"keydown\", onKeyDown);\n document.addEventListener(\"keyup\", onKeyUp);\n document.addEventListener(\"mousemove\", updateMousePosition);\n document.addEventListener(\"mousedown\", onMouseDown);\n document.addEventListener(\"mouseup\", onMouseUp);\n document.addEventListener(\"wheel\", onWheel);\n return () => {\n document.removeEventListener(\"keydown\", onKeyDown);\n document.removeEventListener(\"keyup\", onKeyUp);\n document.removeEventListener(\"mousemove\", updateMousePosition);\n document.removeEventListener(\"mousedown\", onMouseDown);\n document.removeEventListener(\"mouseup\", onMouseUp);\n document.removeEventListener(\"wheel\", onWheel);\n\n if (settings.store.saveZoomValues) {\n settings.store.zoom = zoom.current;\n settings.store.size = size.current;\n }\n };\n }, []);\n\n if (!ready) return null;\n\n const box = element.current!.getBoundingClientRect();\n\n return (\n \n {instance.props.animated ?\n (\n \n ) : (\n \n )}\n \n );\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n(window.VencordStyles ??= new Map()).set(\"src/plugins/imageZoom/styles.css\", {\n name: \"src/plugins/imageZoom/styles.css\",\n source: \".vc-imgzoom-lens {\\n position: absolute;\\n inset: 0;\\n z-index: 9999;\\n border: 2px solid grey;\\n border-radius: 50%;\\n overflow: hidden;\\n cursor: none;\\n box-shadow: inset 0 0 10px 2px grey;\\n filter: drop-shadow(0 0 2px grey);\\n pointer-events: none;\\n}\\n\\n.vc-imgzoom-square {\\n border-radius: 0;\\n}\\n\\n.vc-imgzoom-nearest-neighbor>img {\\n image-rendering: pixelated;\\n\\n /* https://googlechrome.github.io/samples/image-rendering-pixelated/index.html */\\n}\\n\\n/* make the carousel take up less space so we can click the backdrop and exit out of it */\\n[class*=\\\"modalCarouselWrapper_\\\"] {\\n top: 0 !important;\\n}\\n\\n[class*=\\\"carouselModal_\\\"] {\\n height: 0 !important;\\n}\\n\",\n classNames: {},\n dom: null,\n});\n\nexport default \"src/plugins/imageZoom/styles.css\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport { disableStyle, enableStyle } from \"@api/Styles\";\nimport { makeRange } from \"@components/PluginSettings/components\";\nimport { Devs } from \"@utils/constants\";\nimport { debounce } from \"@utils/debounce\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { ContextMenuApi, Menu, React, ReactDOM } from \"@webpack/common\";\nimport type { Root } from \"react-dom/client\";\n\nimport { Magnifier, MagnifierProps } from \"./components/Magnifier\";\nimport { ELEMENT_ID } from \"./constants\";\nimport styles from \"./styles.css?managed\";\n\nexport const settings = definePluginSettings({\n saveZoomValues: {\n type: OptionType.BOOLEAN,\n description: \"Whether to save zoom and lens size values\",\n default: true,\n },\n\n invertScroll: {\n type: OptionType.BOOLEAN,\n description: \"Invert scroll\",\n default: true,\n },\n\n nearestNeighbour: {\n type: OptionType.BOOLEAN,\n description: \"Use Nearest Neighbour Interpolation when scaling images\",\n default: false,\n },\n\n square: {\n type: OptionType.BOOLEAN,\n description: \"Make the lens square\",\n default: false,\n },\n\n zoom: {\n description: \"Zoom of the lens\",\n type: OptionType.SLIDER,\n markers: makeRange(1, 50, 4),\n default: 2,\n stickToMarkers: false,\n },\n size: {\n description: \"Radius / Size of the lens\",\n type: OptionType.SLIDER,\n markers: makeRange(50, 1000, 50),\n default: 100,\n stickToMarkers: false,\n },\n\n zoomSpeed: {\n description: \"How fast the zoom / lens size changes\",\n type: OptionType.SLIDER,\n markers: makeRange(0.1, 5, 0.2),\n default: 0.5,\n stickToMarkers: false,\n },\n});\n\n\nconst imageContextMenuPatch: NavContextMenuPatchCallback = children => () => {\n children.push(\n \n {\n settings.store.square = !settings.store.square;\n ContextMenuApi.closeContextMenu();\n }}\n />\n {\n settings.store.nearestNeighbour = !settings.store.nearestNeighbour;\n ContextMenuApi.closeContextMenu();\n }}\n />\n (\n settings.store.zoom = value, 100)}\n />\n )}\n />\n (\n settings.store.size = value, 100)}\n />\n )}\n />\n (\n settings.store.zoomSpeed = value, 100)}\n renderValue={(value: number) => `${value.toFixed(3)}x`}\n />\n )}\n />\n \n );\n};\n\nexport default definePlugin({\n name: \"ImageZoom\",\n description: \"Lets you zoom in to images and gifs. Use scroll wheel to zoom in and shift + scroll wheel to increase lens radius / size\",\n authors: [Devs.Aria],\n tags: [\"ImageUtilities\"],\n\n patches: [\n {\n find: \"Messages.OPEN_IN_BROWSER\",\n replacement: {\n // there are 2 image thingies. one for carosuel and one for the single image.\n // so thats why i added global flag.\n // also idk if this patch is good, should it be more specific?\n // https://regex101.com/r/xfvNvV/1\n match: /return.{1,200}\\.wrapper.{1,200}src:\\i,/g,\n replace: `$&id: '${ELEMENT_ID}',`\n }\n },\n\n {\n find: \"handleImageLoad=\",\n replacement: [\n {\n match: /showThumbhashPlaceholder:\\i,/,\n replace: \"...$self.makeProps(this),$&\"\n },\n\n {\n match: /componentDidMount\\(\\){/,\n replace: \"$&$self.renderMagnifier(this);\",\n },\n\n {\n match: /componentWillUnmount\\(\\){/,\n replace: \"$&$self.unMountMagnifier();\"\n }\n ]\n },\n {\n find: \".carouselModal\",\n replacement: {\n match: /(?<=\\.carouselModal.{0,100}onClick:)\\i,/,\n replace: \"()=>{},\"\n }\n }\n ],\n\n settings,\n\n // to stop from rendering twice /shrug\n currentMagnifierElement: null as React.FunctionComponentElement | null,\n element: null as HTMLDivElement | null,\n\n Magnifier,\n root: null as Root | null,\n makeProps(instance) {\n return {\n onMouseOver: () => this.onMouseOver(instance),\n onMouseOut: () => this.onMouseOut(instance),\n onMouseDown: (e: React.MouseEvent) => this.onMouseDown(e, instance),\n onMouseUp: () => this.onMouseUp(instance),\n id: instance.props.id,\n };\n },\n\n renderMagnifier(instance) {\n if (instance.props.id === ELEMENT_ID) {\n if (!this.currentMagnifierElement) {\n this.currentMagnifierElement = ;\n this.root = ReactDOM.createRoot(this.element!);\n this.root.render(this.currentMagnifierElement);\n }\n }\n },\n\n unMountMagnifier() {\n this.root?.unmount();\n this.currentMagnifierElement = null;\n this.root = null;\n },\n\n onMouseOver(instance) {\n instance.setState((state: any) => ({ ...state, mouseOver: true }));\n },\n onMouseOut(instance) {\n instance.setState((state: any) => ({ ...state, mouseOver: false }));\n },\n onMouseDown(e: React.MouseEvent, instance) {\n if (e.button === 0 /* left */)\n instance.setState((state: any) => ({ ...state, mouseDown: true }));\n },\n onMouseUp(instance) {\n instance.setState((state: any) => ({ ...state, mouseDown: false }));\n },\n\n start() {\n enableStyle(styles);\n addContextMenuPatch(\"image-context\", imageContextMenuPatch);\n this.element = document.createElement(\"div\");\n this.element.classList.add(\"MagnifierContainer\");\n document.body.appendChild(this.element);\n },\n\n stop() {\n disableStyle(styles);\n // so componenetWillUnMount gets called if Magnifier component is still alive\n this.root && this.root.unmount();\n this.element?.remove();\n removeContextMenuPatch(\"image-context\", imageContextMenuPatch);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport {\n ModalContent,\n ModalFooter,\n ModalHeader,\n ModalRoot,\n openModal,\n} from \"@utils/modal\";\nimport { Button, Forms, React, TextInput } from \"@webpack/common\";\n\nimport { decrypt } from \"../index\";\n\nexport function DecModal(props: any) {\n const encryptedMessage: string = props?.message?.content;\n const [password, setPassword] = React.useState(\"password\");\n\n return (\n \n \n Decrypt Message\n \n\n \n Message with Encryption\n \n Password\n \n \n\n \n {\n const toSend = decrypt(encryptedMessage, password, true);\n if (!toSend || !props?.message) return;\n // @ts-expect-error\n Vencord.Plugins.plugins.InvisibleChat.buildEmbed(props?.message, toSend);\n props.onClose();\n }}>\n Decrypt\n \n \n Cancel\n \n \n \n );\n}\n\nexport function buildDecModal(msg: any): any {\n openModal((props: any) => );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { insertTextIntoChatInputBox } from \"@utils/discord\";\nimport {\n ModalContent,\n ModalFooter,\n ModalHeader,\n ModalProps,\n ModalRoot,\n openModal,\n} from \"@utils/modal\";\nimport { Button, Forms, React, Switch, TextInput } from \"@webpack/common\";\n\nimport { encrypt } from \"../index\";\n\nfunction EncModal(props: ModalProps) {\n const [secret, setSecret] = React.useState(\"\");\n const [cover, setCover] = React.useState(\"\");\n const [password, setPassword] = React.useState(\"password\");\n const [noCover, setNoCover] = React.useState(false);\n\n const isValid = secret && (noCover || (cover && cover.trim().split(\" \").length > 1));\n\n return (\n \n \n Encrypt Message\n \n\n \n Secret\n {\n setSecret(e);\n }}\n />\n Cover (2 or more Words!!)\n {\n setCover(e);\n }}\n />\n Password\n {\n setPassword(e);\n }}\n />\n {\n setNoCover(e);\n }}\n >\n Don't use a Cover\n \n \n\n \n {\n if (!isValid) return;\n const encrypted = encrypt(secret, password, noCover ? \"d d\" : cover);\n const toSend = noCover ? encrypted.replaceAll(\"d\", \"\") : encrypted;\n if (!toSend) return;\n\n insertTextIntoChatInputBox(toSend);\n\n props.onClose();\n }}\n >\n Send\n \n {\n props.onClose();\n }}\n >\n Cancel\n \n \n \n );\n}\n\nexport function buildEncModal(): any {\n openModal(props => );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addButton, removeButton } from \"@api/MessagePopover\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { getStegCloak } from \"@utils/dependencies\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Button, ButtonLooks, ButtonWrapperClasses, ChannelStore, FluxDispatcher, RestAPI, Tooltip } from \"@webpack/common\";\nimport { Message } from \"discord-types/general\";\n\nimport { buildDecModal } from \"./components/DecryptionModal\";\nimport { buildEncModal } from \"./components/EncryptionModal\";\n\nlet steggo: any;\n\nfunction PopOverIcon() {\n return (\n\n \n \n \n );\n}\n\n\nfunction Indicator() {\n return (\n \n\n );\n\n}\n\nfunction ChatBarIcon(chatBoxProps: {\n type: {\n analyticsName: string;\n };\n}) {\n if (chatBoxProps.type.analyticsName !== \"normal\") return null;\n\n return (\n \n {({ onMouseEnter, onMouseLeave }) => (\n // size=\"\" = Button.Sizes.NONE\n /*\n many themes set \"> button\" to display: none, as the gift button is\n the only directly descending button (all the other elements are divs.)\n Thus, wrap in a div here to avoid getting hidden by that.\n flex is for some reason necessary as otherwise the button goes flying off\n */\n
\n buildEncModal()}\n style={{ padding: \"0 2px\", scale: \"0.9\" }}\n >\n
\n \n \n \n
\n \n
\n )\n }\n
\n );\n}\n\nconst settings = definePluginSettings({\n savedPasswords: {\n type: OptionType.STRING,\n default: \"password, Password\",\n description: \"Saved Passwords (Seperated with a , )\"\n }\n});\n\nexport default definePlugin({\n name: \"InvisibleChat\",\n description: \"Encrypt your Messages in a non-suspicious way!\",\n authors: [Devs.SammCheese],\n dependencies: [\"MessagePopoverAPI\"],\n patches: [\n {\n // Indicator\n find: \".Messages.MESSAGE_EDITED,\",\n replacement: {\n match: /let\\{className:\\i,message:\\i[^}]*\\}=(\\i)/,\n replace: \"try {$1 && $self.INV_REGEX.test($1.message.content) ? $1.content.push($self.indicator()) : null } catch {};$&\"\n }\n },\n {\n find: \"ChannelTextAreaButtons\",\n replacement: {\n match: /(\\i)\\.push.{1,30}disabled:(\\i),.{1,20}\\},\"gift\"\\)\\)/,\n replace: \"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()\",\n }\n },\n ],\n\n EMBED_API_URL: \"https://embed.sammcheese.net\",\n INV_REGEX: new RegExp(/( \\u200c|\\u200d |[\\u2060-\\u2064])[^\\u200b]/),\n URL_REGEX: new RegExp(\n /(http(s)?:\\/\\/.)?(www\\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/,\n ),\n settings,\n async start() {\n const { default: StegCloak } = await getStegCloak();\n steggo = new StegCloak(true, false);\n\n addButton(\"invDecrypt\", message => {\n return this.INV_REGEX.test(message?.content)\n ? {\n label: \"Decrypt Message\",\n icon: this.popOverIcon,\n message: message,\n channel: ChannelStore.getChannel(message.channel_id),\n onClick: async () => {\n await iteratePasswords(message).then((res: string | false) => {\n if (res) return void this.buildEmbed(message, res);\n return void buildDecModal({ message });\n });\n }\n }\n : null;\n });\n },\n\n stop() {\n removeButton(\"invDecrypt\");\n },\n\n // Gets the Embed of a Link\n async getEmbed(url: URL): Promise {\n const { body } = await RestAPI.post({\n url: \"/unfurler/embed-urls\",\n body: {\n urls: [url]\n }\n });\n return await body.embeds[0];\n },\n\n async buildEmbed(message: any, revealed: string): Promise {\n const urlCheck = revealed.match(this.URL_REGEX);\n\n message.embeds.push({\n type: \"rich\",\n title: \"Decrypted Message\",\n color: \"0x45f5f5\",\n description: revealed,\n footer: {\n text: \"Made with \u2764\uFE0F by c0dine and Sammy!\",\n },\n });\n\n if (urlCheck?.length) {\n const embed = await this.getEmbed(new URL(urlCheck[0]));\n if (embed)\n message.embeds.push(embed);\n }\n\n this.updateMessage(message);\n },\n\n updateMessage: (message: any) => {\n FluxDispatcher.dispatch({\n type: \"MESSAGE_UPDATE\",\n message,\n });\n },\n\n chatBarIcon: ErrorBoundary.wrap(ChatBarIcon, { noop: true }),\n popOverIcon: () => ,\n indicator: ErrorBoundary.wrap(Indicator, { noop: true })\n});\n\nexport function encrypt(secret: string, password: string, cover: string): string {\n return steggo.hide(secret + \"\\u200b\", password, cover);\n}\n\nexport function decrypt(encrypted: string, password: string, removeIndicator: boolean): string {\n const decrypted = steggo.reveal(encrypted, password);\n return removeIndicator ? decrypted.replace(\"\\u200b\", \"\") : decrypted;\n}\n\nexport function isCorrectPassword(result: string): boolean {\n return result.endsWith(\"\\u200b\");\n}\n\nexport async function iteratePasswords(message: Message): Promise {\n const passwords = settings.store.savedPasswords.split(\",\").map(s => s.trim());\n\n if (!message?.content || !passwords?.length) return false;\n\n let { content } = message;\n\n // we use an extra variable so we dont have to edit the message content directly\n if (/^\\W/.test(message.content)) content = `d ${message.content}d`;\n\n for (let i = 0; i < passwords.length; i++) {\n const result = decrypt(content, passwords[i], false);\n if (isCorrectPassword(result)) {\n return result;\n }\n }\n\n return false;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport * as DataStore from \"@api/DataStore\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { ChannelStore, NavigationRouter, SelectedChannelStore, SelectedGuildStore } from \"@webpack/common\";\n\nexport interface LogoutEvent {\n type: \"LOGOUT\";\n isSwitchingAccount: boolean;\n}\n\ninterface ChannelSelectEvent {\n type: \"CHANNEL_SELECT\";\n channelId: string | null;\n guildId: string | null;\n}\n\ninterface PreviousChannel {\n guildId: string | null;\n channelId: string | null;\n}\n\nlet isSwitchingAccount = false;\nlet previousCache: PreviousChannel | undefined;\n\nfunction attemptToNavigateToChannel(guildId: string | null, channelId: string) {\n if (!ChannelStore.hasChannel(channelId)) return;\n NavigationRouter.transitionTo(`/channels/${guildId ?? \"@me\"}/${channelId}`);\n}\n\nexport default definePlugin({\n name: \"KeepCurrentChannel\",\n description: \"Attempt to navigate to the channel you were in before switching accounts or loading Discord.\",\n authors: [Devs.Nuckyz],\n\n flux: {\n LOGOUT(e: LogoutEvent) {\n ({ isSwitchingAccount } = e);\n },\n\n CONNECTION_OPEN() {\n if (!isSwitchingAccount) return;\n isSwitchingAccount = false;\n\n if (previousCache?.channelId)\n attemptToNavigateToChannel(previousCache.guildId, previousCache.channelId);\n },\n\n async CHANNEL_SELECT({ guildId, channelId }: ChannelSelectEvent) {\n if (isSwitchingAccount) return;\n\n previousCache = {\n guildId,\n channelId\n };\n await DataStore.set(\"KeepCurrentChannel_previousData\", previousCache);\n }\n },\n\n async start() {\n previousCache = await DataStore.get(\"KeepCurrentChannel_previousData\");\n if (!previousCache) {\n previousCache = {\n guildId: SelectedGuildStore.getGuildId(),\n channelId: SelectedChannelStore.getChannelId() ?? null\n };\n\n await DataStore.set(\"KeepCurrentChannel_previousData\", previousCache);\n } else if (previousCache.channelId) {\n attemptToNavigateToChannel(previousCache.guildId, previousCache.channelId);\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Sofia Lima\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Link } from \"@components/Link\";\nimport { Devs } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ApplicationAssetUtils, FluxDispatcher, Forms } from \"@webpack/common\";\n\ninterface ActivityAssets {\n large_image?: string;\n large_text?: string;\n small_image?: string;\n small_text?: string;\n}\n\n\ninterface ActivityButton {\n label: string;\n url: string;\n}\n\ninterface Activity {\n state: string;\n details?: string;\n timestamps?: {\n start?: number;\n };\n assets?: ActivityAssets;\n buttons?: Array;\n name: string;\n application_id: string;\n metadata?: {\n button_urls?: Array;\n };\n type: number;\n flags: number;\n}\n\ninterface TrackData {\n name: string;\n album: string;\n artist: string;\n url: string;\n imageUrl?: string;\n}\n\n// only relevant enum values\nconst enum ActivityType {\n PLAYING = 0,\n LISTENING = 2,\n}\n\nconst enum ActivityFlag {\n INSTANCE = 1 << 0,\n}\n\nconst enum NameFormat {\n StatusName = \"status-name\",\n ArtistFirst = \"artist-first\",\n SongFirst = \"song-first\",\n ArtistOnly = \"artist\",\n SongOnly = \"song\"\n}\n\nconst applicationId = \"1108588077900898414\";\nconst placeholderId = \"2a96cbd8b46e442fc41c2b86b821562f\";\n\nconst logger = new Logger(\"LastFMRichPresence\");\n\nconst presenceStore = findByPropsLazy(\"getLocalPresence\");\n\nasync function getApplicationAsset(key: string): Promise {\n return (await ApplicationAssetUtils.fetchAssetIds(applicationId, [key]))[0];\n}\n\nfunction setActivity(activity: Activity | null) {\n FluxDispatcher.dispatch({\n type: \"LOCAL_ACTIVITY_UPDATE\",\n activity,\n socketId: \"LastFM\",\n });\n}\n\nconst settings = definePluginSettings({\n username: {\n description: \"last.fm username\",\n type: OptionType.STRING,\n },\n apiKey: {\n description: \"last.fm api key\",\n type: OptionType.STRING,\n },\n shareUsername: {\n description: \"show link to last.fm profile\",\n type: OptionType.BOOLEAN,\n default: false,\n },\n hideWithSpotify: {\n description: \"hide last.fm presence if spotify is running\",\n type: OptionType.BOOLEAN,\n default: true,\n },\n statusName: {\n description: \"custom status text\",\n type: OptionType.STRING,\n default: \"some music\",\n },\n nameFormat: {\n description: \"Show name of song and artist in status name\",\n type: OptionType.SELECT,\n options: [\n {\n label: \"Use custom status name\",\n value: NameFormat.StatusName,\n default: true\n },\n {\n label: \"Use format 'artist - song'\",\n value: NameFormat.ArtistFirst\n },\n {\n label: \"Use format 'song - artist'\",\n value: NameFormat.SongFirst\n },\n {\n label: \"Use artist name only\",\n value: NameFormat.ArtistOnly\n },\n {\n label: \"Use song name only\",\n value: NameFormat.SongOnly\n }\n ],\n },\n useListeningStatus: {\n description: 'show \"Listening to\" status instead of \"Playing\"',\n type: OptionType.BOOLEAN,\n default: false,\n },\n missingArt: {\n description: \"When album or album art is missing\",\n type: OptionType.SELECT,\n options: [\n {\n label: \"Use large Last.fm logo\",\n value: \"lastfmLogo\",\n default: true\n },\n {\n label: \"Use generic placeholder\",\n value: \"placeholder\"\n }\n ],\n },\n});\n\nexport default definePlugin({\n name: \"LastFMRichPresence\",\n description: \"Little plugin for Last.fm rich presence\",\n authors: [Devs.dzshn, Devs.RuiNtD, Devs.blahajZip, Devs.archeruwu],\n\n settingsAboutComponent: () => (\n <>\n How to get an API key\n \n An API key is required to fetch your current track. To get one, you can\n visit this page and\n fill in the following information:

\n\n Application name: Discord Rich Presence
\n Application description: (personal use)

\n\n And copy the API key (not the shared secret!)\n
\n \n ),\n\n settings,\n\n start() {\n this.updatePresence();\n this.updateInterval = setInterval(() => { this.updatePresence(); }, 16000);\n },\n\n stop() {\n clearInterval(this.updateInterval);\n },\n\n async fetchTrackData(): Promise {\n if (!settings.store.username || !settings.store.apiKey)\n return null;\n\n try {\n const params = new URLSearchParams({\n method: \"user.getrecenttracks\",\n api_key: settings.store.apiKey,\n user: settings.store.username,\n limit: \"1\",\n format: \"json\"\n });\n\n const res = await fetch(`https://ws.audioscrobbler.com/2.0/?${params}`);\n if (!res.ok) throw `${res.status} ${res.statusText}`;\n\n const json = await res.json();\n if (json.error) {\n logger.error(\"Error from Last.fm API\", `${json.error}: ${json.message}`);\n return null;\n }\n\n const trackData = json.recenttracks?.track[0];\n\n if (!trackData?.[\"@attr\"]?.nowplaying)\n return null;\n\n // why does the json api have xml structure\n return {\n name: trackData.name || \"Unknown\",\n album: trackData.album[\"#text\"],\n artist: trackData.artist[\"#text\"] || \"Unknown\",\n url: trackData.url,\n imageUrl: trackData.image?.find((x: any) => x.size === \"large\")?.[\"#text\"]\n };\n } catch (e) {\n logger.error(\"Failed to query Last.fm API\", e);\n // will clear the rich presence if API fails\n return null;\n }\n },\n\n async updatePresence() {\n setActivity(await this.getActivity());\n },\n\n getLargeImage(track: TrackData): string | undefined {\n if (track.imageUrl && !track.imageUrl.includes(placeholderId))\n return track.imageUrl;\n\n if (settings.store.missingArt === \"placeholder\")\n return \"placeholder\";\n },\n\n async getActivity(): Promise {\n if (settings.store.hideWithSpotify) {\n for (const activity of presenceStore.getActivities()) {\n if (activity.type === ActivityType.LISTENING && activity.application_id !== applicationId) {\n // there is already music status because of Spotify or richerCider (probably more)\n return null;\n }\n }\n }\n\n const trackData = await this.fetchTrackData();\n if (!trackData) return null;\n\n const largeImage = this.getLargeImage(trackData);\n const assets: ActivityAssets = largeImage ?\n {\n large_image: await getApplicationAsset(largeImage),\n large_text: trackData.album || undefined,\n small_image: await getApplicationAsset(\"lastfm-small\"),\n small_text: \"Last.fm\",\n } : {\n large_image: await getApplicationAsset(\"lastfm-large\"),\n large_text: trackData.album || undefined,\n };\n\n const buttons: ActivityButton[] = [\n {\n label: \"View Song\",\n url: trackData.url,\n },\n ];\n\n if (settings.store.shareUsername)\n buttons.push({\n label: \"Last.fm Profile\",\n url: `https://www.last.fm/user/${settings.store.username}`,\n });\n\n const statusName = (() => {\n switch (settings.store.nameFormat) {\n case NameFormat.ArtistFirst:\n return trackData.artist + \" - \" + trackData.name;\n case NameFormat.SongFirst:\n return trackData.name + \" - \" + trackData.artist;\n case NameFormat.ArtistOnly:\n return trackData.artist;\n case NameFormat.SongOnly:\n return trackData.name;\n default:\n return settings.store.statusName;\n }\n })();\n\n return {\n application_id: applicationId,\n name: statusName,\n\n details: trackData.name,\n state: trackData.artist,\n assets,\n\n buttons: buttons.map(v => v.label),\n metadata: {\n button_urls: buttons.map(v => v.url),\n },\n\n type: settings.store.useListeningStatus ? ActivityType.LISTENING : ActivityType.PLAYING,\n flags: ActivityFlag.INSTANCE,\n };\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\n// These are Xor encrypted to prevent you from spoiling yourself when you read the source code.\n// don't worry about it :P\nconst quotes = [\n \"Eyrokac\",\n \"Rdcg$l`'k|~n\",\n 'H`tf$d&iajo+d`{\"',\n \"Sucqplh`(Eclhualva()&\",\n \"Lncgmka'8KNMDC,shpanf'`x./,\",\n \"Ioqweijnfn*IeuvfvAotkfxo./,\",\n 'Hd{#cp\\x7Ft$)nbd!{lq%mig~*\\x7Fh`v#mk&sm{gx nd#idjb(a\\x7Ffao\"bja&amdkge!Rlo\u00ECkhf)hyedfjjb*\\'^hzdrdmm$lu\\'|ao+mnqw$fijxh~bbmg#Tjm\u00EEefd+fnp#lpkffz5',\n \"h\",\n \"sijklm&cam*rot\\\"hjjq'|ak\\x7F xmv#wc'ep*mawmvvlrb(|ynr>\\\"Aqq&cgg-\\x7F ugoh%rom)e\\x7Fhdpp%$\",\n 'Tnfb}\"u\\'~`nno!kp$vvhfzeyee\"a}%Tfam*Xh`fls%Jboldos-\"lj`&hn)~ce!`jcbct|)gdbhnf$wikm$zgaxkmc%afely+og\"144?\\'ign+iu%p$qisiefr gpfa$',\n \"Ndtfv%ahfgk+ghtf$|ir(|z' Oguaw&`ggdj mgw$|ir(me|n\",\n \"(!\u0363\u00B3$\u0359\u0290'\u0369\u00B9#\",\n \"(\uFF88\u25D7\u30ED\u25D1,\uFF8F-2\uFF6C\uFF95\u272C\",\n \"Ynw#hjil(ze+psgwp|&sgmkr!\",\n \"Tikmolh`(fl+a!dvjk\\x7F'y|e\\x7Fe/,-\",\n \"3/3750?5><9>885:7\",\n \"mdmt\",\n \"Wdn`khc+(oxbeof\",\n 'Ig\"zkp*\\'g{*xolglj`&~g|*gowg/$mgt(Eclm`.#ticf{l*xed\"wl`&Kangj igbhqn\\'d`dn `v#lqrw{3%$bhv-h|)kangj_imwhlhb',\n \"Tscmw%Tnoa~x\",\n \"I\u2018f#npus(ec`e!vl$lhsm{`ncu\\\"ekw&f(defeov-$Rnf|)sdu\u2018pf$wcam{ceg!vl$du'D`d~x-\\\"jw%oi(okht-\\\"DJP)Kag\u007Fs,!mq$du'A\u2010|n sg`akrkq)~jkdl#pj&diefbnf\\\"jp)&@F\\\\*{ltq#Hlhrp'\",\n \"Ynw$v`&cg`dl fml`%rhlhs*\",\n \"Dnl$p%qhz{s' hv$w%hh|aceg!;#gpvt(fl+cndea`&dg|fon&v#wjjqm(\",\n \"\\ud83d)pft`gs(ec`e!13$qojmz#\",\n \"a!njcmr'ide~nu\\\"lb%rheoedldpz$lu'gbkr\",\n \"dn\\\"zkp&kg\u007Fo4\",\n \"hnpqkw\",\n \"sn\\\"fau\u007F\",\n \"Sn\\\"tmqnh}}*musvkaw&flf&+ldv$w%lr{}*aulr#vlao|)cetn\\\"jp$\",\n \"Dxkmc%ot(hhxomwwai\u007F'{hln\",\n \"hd{#}js&(pe~'sg#gprb(3#\\\"\",\n \"hd{b${\",\n \"<;vqkijbq33271:56<3799?24944:\",\n \"Thof$lu'ofdn,!qsefc'az*bnrcma+&Om{o+iu\\\"`khct$)bnrd\\\"bcdoi&\",\n \"snofplkb{)c\u007F'r\\\"lod\u007F'|f*aurv#cpno`abchijklmno\",\n \"Wdn`khc'|f*eghl{%\"\n];\n\nconst settings = definePluginSettings({\n replaceEvents: {\n description: \"Replace Event Quotes too\",\n type: OptionType.BOOLEAN,\n default: true\n }\n});\n\nexport default definePlugin({\n name: \"LoadingQuotes\",\n description: \"Replace Discords loading quotes\",\n authors: [Devs.Ven, Devs.KraXen72],\n\n settings,\n\n patches: [\n {\n find: \".LOADING_DID_YOU_KNOW}\",\n replacement: [\n {\n match: /\\._loadingText=function\\(\\)\\{/,\n replace: \"$&return $self.quote;\",\n },\n {\n match: /\\._eventLoadingText=function\\(\\)\\{/,\n replace: \"$&return $self.quote;\",\n predicate: () => settings.store.replaceEvents\n }\n ],\n },\n ],\n\n xor(quote: string) {\n const key = \"read if cute\";\n const codes = Array.from(quote, (s, i) => s.charCodeAt(0) ^ (i % key.length));\n return String.fromCharCode(...codes);\n },\n\n get quote() {\n return this.xor(quotes[Math.floor(Math.random() * quotes.length)]);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { Devs } from \"@utils/constants\";\nimport { getCurrentChannel } from \"@utils/discord\";\nimport definePlugin from \"@utils/types\";\nimport { findStoreLazy } from \"@webpack\";\nimport { SelectedChannelStore, Tooltip, useStateFromStores } from \"@webpack/common\";\nimport { FluxStore } from \"@webpack/types\";\n\nconst GuildMemberCountStore = findStoreLazy(\"GuildMemberCountStore\") as FluxStore & { getMemberCount(guildId: string): number | null; };\nconst ChannelMemberStore = findStoreLazy(\"ChannelMemberStore\") as FluxStore & {\n getProps(guildId: string, channelId: string): { groups: { count: number; id: string; }[]; };\n};\n\nconst sharedIntlNumberFormat = new Intl.NumberFormat();\nconst numberFormat = (value: number) => sharedIntlNumberFormat.format(value);\n\nfunction MemberCount() {\n const { id: channelId, guild_id: guildId } = useStateFromStores([SelectedChannelStore], () => getCurrentChannel());\n const { groups } = useStateFromStores(\n [ChannelMemberStore],\n () => ChannelMemberStore.getProps(guildId, channelId)\n );\n const total = useStateFromStores(\n [GuildMemberCountStore],\n () => GuildMemberCountStore.getMemberCount(guildId)\n );\n\n if (total == null)\n return null;\n\n const online =\n (groups.length === 1 && groups[0].id === \"unknown\")\n ? 0\n : groups.reduce((count, curr) => count + (curr.id === \"offline\" ? 0 : curr.count), 0);\n\n return (\n \n \n {props => (\n
\n \n {numberFormat(online)}\n
\n )}\n
\n \n {props => (\n
\n \n {numberFormat(total)}\n
\n )}\n
\n
\n );\n}\n\nexport default definePlugin({\n name: \"MemberCount\",\n description: \"Shows the amount of online & total members in the server member list\",\n authors: [Devs.Ven, Devs.Commandtechno],\n\n patches: [{\n find: \"{isSidebarVisible:\",\n replacement: {\n match: /(?<=let\\{className:(\\i),.+?children):\\[(\\i\\.useMemo[^}]+\"aria-multiselectable\")/,\n replace: \":[$1?.startsWith('members')?$self.render():null,$2\"\n }\n }],\n\n render: ErrorBoundary.wrap(MemberCount, { noop: true })\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addClickListener, removeClickListener } from \"@api/MessageEvents\";\nimport { definePluginSettings, Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { FluxDispatcher, PermissionsBits, PermissionStore, UserStore } from \"@webpack/common\";\n\nlet isDeletePressed = false;\nconst keydown = (e: KeyboardEvent) => e.key === \"Backspace\" && (isDeletePressed = true);\nconst keyup = (e: KeyboardEvent) => e.key === \"Backspace\" && (isDeletePressed = false);\n\n\nconst settings = definePluginSettings({\n enableDeleteOnClick: {\n type: OptionType.BOOLEAN,\n description: \"Enable delete on click while holding backspace\",\n default: true\n },\n enableDoubleClickToEdit: {\n type: OptionType.BOOLEAN,\n description: \"Enable double click to edit\",\n default: true\n },\n enableDoubleClickToReply: {\n type: OptionType.BOOLEAN,\n description: \"Enable double click to reply\",\n default: true\n },\n requireModifier: {\n type: OptionType.BOOLEAN,\n description: \"Only do double click actions when shift/ctrl is held\",\n default: false\n }\n});\n\nexport default definePlugin({\n name: \"MessageClickActions\",\n description: \"Hold Backspace and click to delete, double click to edit/reply\",\n authors: [Devs.Ven],\n dependencies: [\"MessageEventsAPI\"],\n\n settings,\n\n start() {\n const MessageActions = findByPropsLazy(\"deleteMessage\", \"startEditMessage\");\n const EditStore = findByPropsLazy(\"isEditing\", \"isEditingAny\");\n\n document.addEventListener(\"keydown\", keydown);\n document.addEventListener(\"keyup\", keyup);\n\n this.onClick = addClickListener((msg: any, channel, event) => {\n const isMe = msg.author.id === UserStore.getCurrentUser().id;\n if (!isDeletePressed) {\n if (event.detail < 2) return;\n if (settings.store.requireModifier && !event.ctrlKey && !event.shiftKey) return;\n if (channel.guild_id && !PermissionStore.can(PermissionsBits.SEND_MESSAGES, channel)) return;\n\n if (isMe) {\n if (!settings.store.enableDoubleClickToEdit || EditStore.isEditing(channel.id, msg.id)) return;\n\n MessageActions.startEditMessage(channel.id, msg.id, msg.content);\n event.preventDefault();\n } else {\n if (!settings.store.enableDoubleClickToReply) return;\n\n FluxDispatcher.dispatch({\n type: \"CREATE_PENDING_REPLY\",\n channel,\n message: msg,\n shouldMention: !Settings.plugins.NoReplyMention.enabled,\n showMentionToggle: channel.guild_id !== null\n });\n }\n } else if (settings.store.enableDeleteOnClick && (isMe || PermissionStore.can(PermissionsBits.MANAGE_MESSAGES, channel))) {\n if (msg.deleted) {\n FluxDispatcher.dispatch({\n type: \"MESSAGE_DELETE\",\n channelId: channel.id,\n id: msg.id,\n mlDeleted: true\n });\n } else {\n MessageActions.deleteMessage(channel.id, msg.id);\n }\n event.preventDefault();\n }\n });\n },\n\n stop() {\n removeClickListener(this.onClick);\n document.removeEventListener(\"keydown\", keydown);\n document.removeEventListener(\"keyup\", keyup);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport type AccessoryCallback = (props: Record) => JSX.Element | null | Array;\nexport type Accessory = {\n callback: AccessoryCallback;\n position?: number;\n};\n\nexport const accessories = new Map();\n\nexport function addAccessory(\n identifier: string,\n callback: AccessoryCallback,\n position?: number\n) {\n accessories.set(identifier, {\n callback,\n position,\n });\n}\n\nexport function removeAccessory(identifier: string) {\n accessories.delete(identifier);\n}\n\nexport function _modifyAccessories(\n elements: JSX.Element[],\n props: Record\n) {\n for (const accessory of accessories.values()) {\n let accessories = accessory.callback(props);\n if (accessories == null)\n continue;\n\n if (!Array.isArray(accessories))\n accessories = [accessories];\n else if (accessories.length === 0)\n continue;\n\n elements.splice(\n accessory.position != null\n ? accessory.position < 0\n ? elements.length + accessory.position\n : accessory.position\n : elements.length,\n 0,\n ...accessories.filter(e => e != null) as JSX.Element[]\n );\n }\n\n return elements;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addAccessory } from \"@api/MessageAccessories\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants.js\";\nimport { classes } from \"@utils/misc\";\nimport { Queue } from \"@utils/Queue\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy, findComponentByCodeLazy } from \"@webpack\";\nimport {\n Button,\n ChannelStore,\n FluxDispatcher,\n GuildStore,\n MessageStore,\n Parser,\n PermissionStore,\n RestAPI,\n Text,\n TextAndImagesSettingsStores,\n UserStore\n} from \"@webpack/common\";\nimport { Channel, Guild, Message } from \"discord-types/general\";\n\nconst messageCache = new Map();\n\nconst Embed = findComponentByCodeLazy(\".inlineMediaEmbed\");\nconst AutoModEmbed = findComponentByCodeLazy(\".withFooter]:\", \"childrenMessageContent:\");\nconst ChannelMessage = findComponentByCodeLazy(\"renderSimpleAccessories)\");\n\nconst SearchResultClasses = findByPropsLazy(\"message\", \"searchResult\");\n\nconst messageLinkRegex = /(?\n \n }\n});\n\n\nasync function fetchMessage(channelID: string, messageID: string) {\n const cached = messageCache.get(messageID);\n if (cached) return cached.message;\n\n messageCache.set(messageID, { fetched: false });\n\n const res = await RestAPI.get({\n url: `/channels/${channelID}/messages`,\n query: {\n limit: 1,\n around: messageID\n },\n retries: 2\n }).catch(() => null);\n\n const msg = res?.body?.[0];\n if (!msg) return;\n\n const message: Message = MessageStore.getMessages(msg.channel_id).receiveMessage(msg).get(msg.id);\n\n messageCache.set(message.id, {\n message,\n fetched: true\n });\n\n return message;\n}\n\n\nfunction getImages(message: Message): Attachment[] {\n const attachments: Attachment[] = [];\n\n for (const { content_type, height, width, url, proxy_url } of message.attachments ?? []) {\n if (content_type?.startsWith(\"image/\"))\n attachments.push({\n height: height!,\n width: width!,\n url: url,\n proxyURL: proxy_url!\n });\n }\n\n for (const { type, image, thumbnail, url } of message.embeds ?? []) {\n if (type === \"image\")\n attachments.push({ ...(image ?? thumbnail!) });\n else if (url && type === \"gifv\" && !tenorRegex.test(url))\n attachments.push({\n height: thumbnail!.height,\n width: thumbnail!.width,\n url\n });\n }\n\n return attachments;\n}\n\nfunction noContent(attachments: number, embeds: number) {\n if (!attachments && !embeds) return \"\";\n if (!attachments) return `[no content, ${embeds} embed${embeds !== 1 ? \"s\" : \"\"}]`;\n if (!embeds) return `[no content, ${attachments} attachment${attachments !== 1 ? \"s\" : \"\"}]`;\n return `[no content, ${attachments} attachment${attachments !== 1 ? \"s\" : \"\"} and ${embeds} embed${embeds !== 1 ? \"s\" : \"\"}]`;\n}\n\nfunction requiresRichEmbed(message: Message) {\n if (message.components.length) return true;\n if (message.attachments.some(a => !a.content_type?.startsWith(\"image/\"))) return true;\n if (message.embeds.some(e => e.type !== \"image\" && (e.type !== \"gifv\" || tenorRegex.test(e.url!)))) return true;\n\n return false;\n}\n\nfunction computeWidthAndHeight(width: number, height: number) {\n const maxWidth = 400;\n const maxHeight = 300;\n\n if (width > height) {\n const adjustedWidth = Math.min(width, maxWidth);\n return { width: adjustedWidth, height: Math.round(height / (width / adjustedWidth)) };\n }\n\n const adjustedHeight = Math.min(height, maxHeight);\n return { width: Math.round(width / (height / adjustedHeight)), height: adjustedHeight };\n}\n\nfunction withEmbeddedBy(message: Message, embeddedBy: string[]) {\n return new Proxy(message, {\n get(_, prop) {\n if (prop === \"vencordEmbeddedBy\") return embeddedBy;\n // @ts-ignore ts so bad\n return Reflect.get(...arguments);\n }\n });\n}\n\n\nfunction MessageEmbedAccessory({ message }: { message: Message; }) {\n // @ts-ignore\n const embeddedBy: string[] = message.vencordEmbeddedBy ?? [];\n\n const accessories = [] as (JSX.Element | null)[];\n\n let match = null as RegExpMatchArray | null;\n while ((match = messageLinkRegex.exec(message.content!)) !== null) {\n const [_, guildID, channelID, messageID] = match;\n if (embeddedBy.includes(messageID)) {\n continue;\n }\n\n const linkedChannel = ChannelStore.getChannel(channelID);\n if (!linkedChannel || (guildID !== \"@me\" && !PermissionStore.can(1024n /* view channel */, linkedChannel))) {\n continue;\n }\n\n const { listMode, idList } = settings.store;\n\n const isListed = [guildID, channelID, message.author.id].some(id => id && idList.includes(id));\n\n if (listMode === \"blacklist\" && isListed) continue;\n if (listMode === \"whitelist\" && !isListed) continue;\n\n let linkedMessage = messageCache.get(messageID)?.message;\n if (!linkedMessage) {\n linkedMessage ??= MessageStore.getMessage(channelID, messageID);\n if (linkedMessage) {\n messageCache.set(messageID, { message: linkedMessage, fetched: true });\n } else {\n const msg = { ...message } as any;\n delete msg.embeds;\n delete msg.interaction;\n\n messageFetchQueue.push(() => fetchMessage(channelID, messageID)\n .then(m => m && FluxDispatcher.dispatch({\n type: \"MESSAGE_UPDATE\",\n message: msg\n }))\n );\n continue;\n }\n }\n\n const messageProps: MessageEmbedProps = {\n message: withEmbeddedBy(linkedMessage, [...embeddedBy, message.id]),\n channel: linkedChannel,\n guildID\n };\n\n const type = settings.store.automodEmbeds;\n accessories.push(\n type === \"always\" || (type === \"prefer\" && !requiresRichEmbed(linkedMessage))\n ? \n : \n );\n }\n\n return accessories.length ? <>{accessories} : null;\n}\n\nfunction ChannelMessageEmbedAccessory({ message, channel, guildID }: MessageEmbedProps): JSX.Element | null {\n const isDM = guildID === \"@me\";\n\n const guild = !isDM && GuildStore.getGuild(channel.guild_id);\n const dmReceiver = UserStore.getUser(ChannelStore.getChannel(channel.id).recipients?.[0]);\n\n\n return \n {isDM ? \"Direct Message - \" : (guild as Guild).name + \" - \"}\n {isDM\n ? Parser.parse(`<@${dmReceiver.id}>`)\n : Parser.parse(`<#${channel.id}>`)\n }\n ,\n iconProxyURL: guild\n ? `https://${window.GLOBAL_ENV.CDN_HOST}/icons/${guild.id}/${guild.icon}.png`\n : `https://${window.GLOBAL_ENV.CDN_HOST}/avatars/${dmReceiver.id}/${dmReceiver.avatar}`\n }\n }}\n renderDescription={() => (\n
\n \n
\n )}\n />;\n}\n\nfunction AutomodEmbedAccessory(props: MessageEmbedProps): JSX.Element | null {\n const { message, channel, guildID } = props;\n const compact = TextAndImagesSettingsStores.MessageDisplayCompact.useSetting();\n const isDM = guildID === \"@me\";\n const images = getImages(message);\n const { parse } = Parser;\n\n return \n {isDM\n ? parse(`<@${ChannelStore.getChannel(channel.id).recipients[0]}>`)\n : parse(`<#${channel.id}>`)\n }\n {isDM ? \" - Direct Message\" : \" - \" + GuildStore.getGuild(channel.guild_id)?.name}\n \n }\n compact={compact}\n content={\n <>\n {message.content || message.attachments.length <= images.length\n ? parse(message.content)\n : [noContent(message.attachments.length, message.embeds.length)]\n }\n {images.map(a => {\n const { width, height } = computeWidthAndHeight(a.width, a.height);\n return (\n
\n \n
\n );\n })}\n \n }\n hideTimestamp={false}\n message={message}\n _messageEmbed=\"automod\"\n />;\n}\n\nexport default definePlugin({\n name: \"MessageLinkEmbeds\",\n description: \"Adds a preview to messages that link another message\",\n authors: [Devs.TheSun, Devs.Ven, Devs.RyanCaoDev],\n dependencies: [\"MessageAccessoriesAPI\"],\n\n settings,\n\n start() {\n addAccessory(\"messageLinkEmbed\", props => {\n if (!messageLinkRegex.test(props.message.content))\n return null;\n\n // need to reset the regex because it's global\n messageLinkRegex.lastIndex = 0;\n\n return (\n \n \n \n );\n }, 4 /* just above rich embeds */);\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n(window.VencordStyles ??= new Map()).set(\"src/plugins/messageLogger/deleteStyleOverlay.css\", {\n name: \"src/plugins/messageLogger/deleteStyleOverlay.css\",\n source: \".messagelogger-deleted {\\n background-color: rgba(240 71 71 / 15%) !important;\\n}\\n\",\n classNames: {},\n dom: null,\n});\n\nexport default \"src/plugins/messageLogger/deleteStyleOverlay.css\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n(window.VencordStyles ??= new Map()).set(\"src/plugins/messageLogger/deleteStyleText.css\", {\n name: \"src/plugins/messageLogger/deleteStyleText.css\",\n source: \"/* Message content highlighting */\\n.messagelogger-deleted [class*=\\\"contents\\\"] > :is(div, h1, h2, h3, p) {\\n color: #f04747 !important;\\n}\\n\\n/* Bot \\\"thinking\\\" text highlighting */\\n.messagelogger-deleted [class*=\\\"colorStandard\\\"] {\\n color: #f04747 !important;\\n}\\n\\n/* Embed highlighting */\\n.messagelogger-deleted article :is(div, span, h1, h2, h3, p) {\\n color: #f04747 !important;\\n}\\n\\n.messagelogger-deleted a {\\n color: #be3535 !important;\\n text-decoration: underline;\\n}\\n\",\n classNames: {},\n dom: null,\n});\n\nexport default \"src/plugins/messageLogger/deleteStyleText.css\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./messageLogger.css\";\n\nimport { addContextMenuPatch, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { Settings } from \"@api/Settings\";\nimport { disableStyle, enableStyle } from \"@api/Styles\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ChannelStore, FluxDispatcher, i18n, Menu, moment, Parser, Timestamp, UserStore } from \"@webpack/common\";\n\nimport overlayStyle from \"./deleteStyleOverlay.css?managed\";\nimport textStyle from \"./deleteStyleText.css?managed\";\n\nconst styles = findByPropsLazy(\"edited\", \"communicationDisabled\", \"isSystemMessage\");\n\nfunction addDeleteStyle() {\n if (Settings.plugins.MessageLogger.deleteStyle === \"text\") {\n enableStyle(textStyle);\n disableStyle(overlayStyle);\n } else {\n disableStyle(textStyle);\n enableStyle(overlayStyle);\n }\n}\n\nconst REMOVE_HISTORY_ID = \"ml-remove-history\";\nconst TOGGLE_DELETE_STYLE_ID = \"ml-toggle-style\";\nconst patchMessageContextMenu: NavContextMenuPatchCallback = (children, props) => () => {\n const { message } = props;\n const { deleted, editHistory, id, channel_id } = message;\n\n if (!deleted && !editHistory?.length) return;\n\n toggle: {\n if (!deleted) break toggle;\n\n const domElement = document.getElementById(`chat-messages-${channel_id}-${id}`);\n if (!domElement) break toggle;\n\n children.push((\n domElement.classList.toggle(\"messagelogger-deleted\")}\n />\n ));\n }\n\n children.push((\n {\n if (deleted) {\n FluxDispatcher.dispatch({\n type: \"MESSAGE_DELETE\",\n channelId: channel_id,\n id,\n mlDeleted: true\n });\n } else {\n message.editHistory = [];\n }\n }}\n />\n ));\n};\n\nexport default definePlugin({\n name: \"MessageLogger\",\n description: \"Temporarily logs deleted and edited messages.\",\n authors: [Devs.rushii, Devs.Ven, Devs.AutumnVN],\n\n start() {\n addDeleteStyle();\n addContextMenuPatch(\"message\", patchMessageContextMenu);\n },\n\n stop() {\n removeContextMenuPatch(\"message\", patchMessageContextMenu);\n },\n\n renderEdit(edit: { timestamp: any, content: string; }) {\n return (\n \n
\n {Parser.parse(edit.content)}\n \n {\" \"}({i18n.Messages.MESSAGE_EDITED})\n \n
\n
\n );\n },\n\n makeEdit(newMessage: any, oldMessage: any): any {\n return {\n timestamp: moment?.call(newMessage.edited_timestamp),\n content: oldMessage.content\n };\n },\n\n options: {\n deleteStyle: {\n type: OptionType.SELECT,\n description: \"The style of deleted messages\",\n default: \"text\",\n options: [\n { label: \"Red text\", value: \"text\", default: true },\n { label: \"Red overlay\", value: \"overlay\" }\n ],\n onChange: () => addDeleteStyle()\n },\n ignoreBots: {\n type: OptionType.BOOLEAN,\n description: \"Whether to ignore messages by bots\",\n default: false\n },\n ignoreSelf: {\n type: OptionType.BOOLEAN,\n description: \"Whether to ignore messages by yourself\",\n default: false\n },\n ignoreUsers: {\n type: OptionType.STRING,\n description: \"Comma-separated list of user IDs to ignore\",\n default: \"\"\n },\n ignoreChannels: {\n type: OptionType.STRING,\n description: \"Comma-separated list of channel IDs to ignore\",\n default: \"\"\n },\n ignoreGuilds: {\n type: OptionType.STRING,\n description: \"Comma-separated list of guild IDs to ignore\",\n default: \"\"\n },\n },\n\n handleDelete(cache: any, data: { ids: string[], id: string; mlDeleted?: boolean; }, isBulk: boolean) {\n try {\n if (cache == null || (!isBulk && !cache.has(data.id))) return cache;\n\n const mutate = (id: string) => {\n const msg = cache.get(id);\n if (!msg) return;\n\n const EPHEMERAL = 64;\n const shouldIgnore = data.mlDeleted ||\n (msg.flags & EPHEMERAL) === EPHEMERAL ||\n this.shouldIgnore(msg);\n\n if (shouldIgnore) {\n cache = cache.remove(id);\n } else {\n cache = cache.update(id, m => m\n .set(\"deleted\", true)\n .set(\"attachments\", m.attachments.map(a => (a.deleted = true, a))));\n }\n };\n\n if (isBulk) {\n data.ids.forEach(mutate);\n } else {\n mutate(data.id);\n }\n } catch (e) {\n new Logger(\"MessageLogger\").error(\"Error during handleDelete\", e);\n }\n return cache;\n },\n\n shouldIgnore(message: any) {\n const { ignoreBots, ignoreSelf, ignoreUsers, ignoreChannels, ignoreGuilds } = Settings.plugins.MessageLogger;\n const myId = UserStore.getCurrentUser().id;\n\n return ignoreBots && message.author?.bot ||\n ignoreSelf && message.author?.id === myId ||\n ignoreUsers.includes(message.author?.id) ||\n ignoreChannels.includes(message.channel_id) ||\n ignoreChannels.includes(ChannelStore.getChannel(message.channel_id)?.parent_id) ||\n ignoreGuilds.includes(ChannelStore.getChannel(message.channel_id)?.guild_id);\n },\n\n // Based on canary 63b8f1b4f2025213c5cf62f0966625bee3d53136\n patches: [\n {\n // MessageStore\n // Module 171447\n find: \"displayName=\\\"MessageStore\\\"\",\n replacement: [\n {\n // Add deleted=true to all target messages in the MESSAGE_DELETE event\n match: /MESSAGE_DELETE:function\\((\\i)\\){let.+?((?:\\i\\.){2})getOrCreate.+?},/,\n replace:\n \"MESSAGE_DELETE:function($1){\" +\n \" var cache = $2getOrCreate($1.channelId);\" +\n \" cache = $self.handleDelete(cache, $1, false);\" +\n \" $2commit(cache);\" +\n \"},\"\n },\n {\n // Add deleted=true to all target messages in the MESSAGE_DELETE_BULK event\n match: /MESSAGE_DELETE_BULK:function\\((\\i)\\){let.+?((?:\\i\\.){2})getOrCreate.+?},/,\n replace:\n \"MESSAGE_DELETE_BULK:function($1){\" +\n \" var cache = $2getOrCreate($1.channelId);\" +\n \" cache = $self.handleDelete(cache, $1, true);\" +\n \" $2commit(cache);\" +\n \"},\"\n },\n {\n // Add current cached content + new edit time to cached message's editHistory\n match: /(MESSAGE_UPDATE:function\\((\\i)\\).+?)\\.update\\((\\i)/,\n replace: \"$1\" +\n \".update($3,m =>\" +\n \" (($2.message.flags & 64) === 64 || $self.shouldIgnore($2.message)) ? m :\" +\n \" $2.message.content !== m.editHistory?.[0]?.content && $2.message.content !== m.content ?\" +\n \" m.set('editHistory',[...(m.editHistory || []), $self.makeEdit($2.message, m)]) :\" +\n \" m\" +\n \")\" +\n \".update($3\"\n },\n {\n // fix up key (edit last message) attempting to edit a deleted message\n match: /(?<=getLastEditableMessage\\(\\i\\)\\{.{0,200}\\.find\\((\\i)=>)/,\n replace: \"!$1.deleted &&\"\n }\n ]\n },\n\n {\n // Message domain model\n // Module 451\n find: \"}addReaction(\",\n replacement: [\n {\n match: /this\\.customRenderedContent=(\\i)\\.customRenderedContent,/,\n replace: \"this.customRenderedContent = $1.customRenderedContent,\" +\n \"this.deleted = $1.deleted || false,\" +\n \"this.editHistory = $1.editHistory || [],\"\n }\n ]\n },\n\n {\n // Updated message transformer(?)\n // Module 819525\n find: \"THREAD_STARTER_MESSAGE?null===\",\n replacement: [\n // {\n // // DEBUG: Log the params of the target function to the patch below\n // match: /function N\\(e,t\\){/,\n // replace: \"function L(e,t){console.log('pre-transform', e, t);\"\n // },\n {\n // Pass through editHistory & deleted & original attachments to the \"edited message\" transformer\n match: /interactionData:(\\i)\\.interactionData/,\n replace:\n \"interactionData:$1.interactionData,\" +\n \"deleted:$1.deleted,\" +\n \"editHistory:$1.editHistory,\" +\n \"attachments:$1.attachments\"\n },\n\n // {\n // // DEBUG: Log the params of the target function to the patch below\n // match: /function R\\(e\\){/,\n // replace: \"function R(e){console.log('after-edit-transform', arguments);\"\n // },\n {\n // Construct new edited message and add editHistory & deleted (ref above)\n // Pass in custom data to attachment parser to mark attachments deleted as well\n match: /attachments:(\\i)\\((\\i)\\)/,\n replace:\n \"attachments: $1((() => {\" +\n \" if ($self.shouldIgnore($2)) return $2;\" +\n \" let old = arguments[1]?.attachments;\" +\n \" if (!old) return $2;\" +\n \" let new_ = $2.attachments?.map(a => a.id) ?? [];\" +\n \" let diff = old.filter(a => !new_.includes(a.id));\" +\n \" old.forEach(a => a.deleted = true);\" +\n \" $2.attachments = [...diff, ...$2.attachments];\" +\n \" return $2;\" +\n \"})()),\" +\n \"deleted: arguments[1]?.deleted,\" +\n \"editHistory: arguments[1]?.editHistory\"\n },\n {\n // Preserve deleted attribute on attachments\n match: /(\\((\\i)\\){return null==\\2\\.attachments.+?)spoiler:/,\n replace:\n \"$1deleted: arguments[0]?.deleted,\" +\n \"spoiler:\"\n }\n ]\n },\n\n {\n // Attachment renderer\n // Module 96063\n find: \".removeAttachmentHoverButton\",\n replacement: [\n {\n match: /(className:\\i,attachment:\\i),/,\n replace: \"$1,attachment: {deleted},\"\n },\n {\n match: /\\[\\i\\.obscured\\]:.+?,/,\n replace: \"$& 'messagelogger-deleted-attachment': deleted,\"\n }\n ]\n },\n\n {\n // Base message component renderer\n // Module 748241\n find: \"Message must not be a thread starter message\",\n replacement: [\n {\n // Append messagelogger-deleted to classNames if deleted\n match: /\\)\\(\"li\",\\{(.+?),className:/,\n replace: \")(\\\"li\\\",{$1,className:(arguments[0].message.deleted ? \\\"messagelogger-deleted \\\" : \\\"\\\")+\"\n }\n ]\n },\n\n {\n // Message content renderer\n // Module 43016\n find: \"Messages.MESSAGE_EDITED,\\\")\\\"\",\n replacement: [\n {\n // Render editHistory in the deepest div for message content\n match: /(\\)\\(\"div\",\\{id:.+?children:\\[)/,\n replace: \"$1 (arguments[0].message.editHistory?.length > 0 ? arguments[0].message.editHistory.map(edit => $self.renderEdit(edit)) : null), \"\n }\n ]\n },\n\n {\n // ReferencedMessageStore\n // Module 778667\n find: \"displayName=\\\"ReferencedMessageStore\\\"\",\n replacement: [\n {\n match: /MESSAGE_DELETE:function\\((\\i)\\).+?},/,\n replace: \"MESSAGE_DELETE:function($1){},\"\n },\n {\n match: /MESSAGE_DELETE_BULK:function\\((\\i)\\).+?},/,\n replace: \"MESSAGE_DELETE_BULK:function($1){},\"\n }\n ]\n },\n\n {\n // Message context base menu\n // Module 600300\n find: \"useMessageMenu:\",\n replacement: [\n {\n // Remove the first section if message is deleted\n match: /children:(\\[\"\"===.+?\\])/,\n replace: \"children:arguments[0].message.deleted?[]:$1\"\n }\n ]\n }\n\n // {\n // // MessageStore caching internals\n // // Module 819525\n // find: \"e.getOrCreate=function(t)\",\n // replacement: [\n // // {\n // // // DEBUG: log getOrCreate return values from MessageStore caching internals\n // // match: /getOrCreate=function(.+?)return/,\n // // replace: \"getOrCreate=function$1console.log('getOrCreate',n);return\"\n // // }\n // ]\n // }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, registerCommand, sendBotMessage, unregisterCommand } from \"@api/Commands\";\nimport * as DataStore from \"@api/DataStore\";\nimport { Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nconst EMOTE = \"<:luna:1035316192220553236>\";\nconst DATA_KEY = \"MessageTags_TAGS\";\nconst MessageTagsMarker = Symbol(\"MessageTags\");\n\ninterface Tag {\n name: string;\n message: string;\n enabled: boolean;\n}\n\nconst getTags = () => DataStore.get(DATA_KEY).then(t => t ?? []);\nconst getTag = (name: string) => DataStore.get(DATA_KEY).then((t: Tag[]) => (t ?? []).find((tt: Tag) => tt.name === name) ?? null);\nconst addTag = async (tag: Tag) => {\n const tags = await getTags();\n tags.push(tag);\n DataStore.set(DATA_KEY, tags);\n return tags;\n};\nconst removeTag = async (name: string) => {\n let tags = await getTags();\n tags = await tags.filter((t: Tag) => t.name !== name);\n DataStore.set(DATA_KEY, tags);\n return tags;\n};\n\nfunction createTagCommand(tag: Tag) {\n registerCommand({\n name: tag.name,\n description: tag.name,\n inputType: ApplicationCommandInputType.BUILT_IN_TEXT,\n execute: async (_, ctx) => {\n if (!await getTag(tag.name)) {\n sendBotMessage(ctx.channel.id, {\n content: `${EMOTE} The tag **${tag.name}** does not exist anymore! Please reload ur Discord to fix :)`\n });\n return { content: `/${tag.name}` };\n }\n\n if (Settings.plugins.MessageTags.clyde) sendBotMessage(ctx.channel.id, {\n content: `${EMOTE} The tag **${tag.name}** has been sent!`\n });\n return { content: tag.message.replaceAll(\"\\\\n\", \"\\n\") };\n },\n [MessageTagsMarker]: true,\n }, \"CustomTags\");\n}\n\n\nexport default definePlugin({\n name: \"MessageTags\",\n description: \"Allows you to save messages and to use them with a simple command.\",\n authors: [Devs.Luna],\n options: {\n clyde: {\n name: \"Clyde message on send\",\n description: \"If enabled, clyde will send you an ephemeral message when a tag was used.\",\n type: OptionType.BOOLEAN,\n default: true\n }\n },\n dependencies: [\"CommandsAPI\"],\n\n async start() {\n for (const tag of await getTags()) createTagCommand(tag);\n },\n\n commands: [\n {\n name: \"tags\",\n description: \"Manage all the tags for yourself\",\n inputType: ApplicationCommandInputType.BUILT_IN,\n options: [\n {\n name: \"create\",\n description: \"Create a new tag\",\n type: ApplicationCommandOptionType.SUB_COMMAND,\n options: [\n {\n name: \"tag-name\",\n description: \"The name of the tag to trigger the response\",\n type: ApplicationCommandOptionType.STRING,\n required: true\n },\n {\n name: \"message\",\n description: \"The message that you will send when using this tag\",\n type: ApplicationCommandOptionType.STRING,\n required: true\n }\n ]\n },\n {\n name: \"list\",\n description: \"List all tags from yourself\",\n type: ApplicationCommandOptionType.SUB_COMMAND,\n options: []\n },\n {\n name: \"delete\",\n description: \"Remove a tag from your yourself\",\n type: ApplicationCommandOptionType.SUB_COMMAND,\n options: [\n {\n name: \"tag-name\",\n description: \"The name of the tag to trigger the response\",\n type: ApplicationCommandOptionType.STRING,\n required: true\n }\n ]\n },\n {\n name: \"preview\",\n description: \"Preview a tag without sending it publicly\",\n type: ApplicationCommandOptionType.SUB_COMMAND,\n options: [\n {\n name: \"tag-name\",\n description: \"The name of the tag to trigger the response\",\n type: ApplicationCommandOptionType.STRING,\n required: true\n }\n ]\n }\n ],\n\n async execute(args, ctx) {\n\n switch (args[0].name) {\n case \"create\": {\n const name: string = findOption(args[0].options, \"tag-name\", \"\");\n const message: string = findOption(args[0].options, \"message\", \"\");\n\n if (await getTag(name))\n return sendBotMessage(ctx.channel.id, {\n content: `${EMOTE} A Tag with the name **${name}** already exists!`\n });\n\n const tag = {\n name: name,\n enabled: true,\n message: message\n };\n\n createTagCommand(tag);\n await addTag(tag);\n\n sendBotMessage(ctx.channel.id, {\n content: `${EMOTE} Successfully created the tag **${name}**!`\n });\n break; // end 'create'\n }\n case \"delete\": {\n const name: string = findOption(args[0].options, \"tag-name\", \"\");\n\n if (!await getTag(name))\n return sendBotMessage(ctx.channel.id, {\n content: `${EMOTE} A Tag with the name **${name}** does not exist!`\n });\n\n unregisterCommand(name);\n await removeTag(name);\n\n sendBotMessage(ctx.channel.id, {\n content: `${EMOTE} Successfully deleted the tag **${name}**!`\n });\n break; // end 'delete'\n }\n case \"list\": {\n sendBotMessage(ctx.channel.id, {\n embeds: [\n {\n // @ts-ignore\n title: \"All Tags:\",\n // @ts-ignore\n description: (await getTags())\n .map(tag => `\\`${tag.name}\\`: ${tag.message.slice(0, 72).replaceAll(\"\\\\n\", \" \")}${tag.message.length > 72 ? \"...\" : \"\"}`)\n .join(\"\\n\") || `${EMOTE} Woops! There are no tags yet, use \\`/tags create\\` to create one!`,\n // @ts-ignore\n color: 0xd77f7f,\n type: \"rich\",\n }\n ]\n });\n break; // end 'list'\n }\n case \"preview\": {\n const name: string = findOption(args[0].options, \"tag-name\", \"\");\n const tag = await getTag(name);\n\n if (!tag)\n return sendBotMessage(ctx.channel.id, {\n content: `${EMOTE} A Tag with the name **${name}** does not exist!`\n });\n\n sendBotMessage(ctx.channel.id, {\n content: tag.message.replaceAll(\"\\\\n\", \"\\n\")\n });\n break; // end 'preview'\n }\n\n default: {\n sendBotMessage(ctx.channel.id, {\n content: \"Invalid sub-command\"\n });\n break;\n }\n }\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated, Samu and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ApplicationCommandInputType, findOption, OptionalMessageOption, RequiredMessageOption, sendBotMessage } from \"@api/Commands\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\n\nfunction mock(input: string): string {\n let output = \"\";\n for (let i = 0; i < input.length; i++) {\n output += i % 2 ? input[i].toUpperCase() : input[i].toLowerCase();\n }\n return output;\n}\n\nexport default definePlugin({\n name: \"MoreCommands\",\n description: \"echo, lenny, mock\",\n authors: [Devs.Arjix, Devs.echo, Devs.Samu],\n dependencies: [\"CommandsAPI\"],\n commands: [\n {\n name: \"echo\",\n description: \"Sends a message as Clyde (locally)\",\n options: [OptionalMessageOption],\n inputType: ApplicationCommandInputType.BOT,\n execute: (opts, ctx) => {\n const content = findOption(opts, \"message\", \"\");\n\n sendBotMessage(ctx.channel.id, { content });\n },\n },\n {\n name: \"lenny\",\n description: \"Sends a lenny face\",\n options: [OptionalMessageOption],\n execute: opts => ({\n content: findOption(opts, \"message\", \"\") + \" ( \u0361\u00B0 \u035C\u0296 \u0361\u00B0)\"\n }),\n },\n {\n name: \"mock\",\n description: \"mOcK PeOpLe\",\n options: [RequiredMessageOption],\n execute: opts => ({\n content: mock(findOption(opts, \"message\", \"\"))\n }),\n },\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { findOption, OptionalMessageOption } from \"@api/Commands\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"MoreKaomoji\",\n description: \"Adds more Kaomoji to discord. \u30FD(\u00B4\u25BD`)/\",\n authors: [Devs.JacobTm],\n dependencies: [\"CommandsAPI\"],\n commands: [\n { name: \"dissatisfaction\", description: \" \uFF1E\uFE4F\uFF1C\" },\n { name: \"smug\", description: \" \u0CA0_\u0CA0\" },\n { name: \"happy\", description: \" \u30FD(\u00B4\u25BD`)/\" },\n { name: \"crying\", description: \" \u0CA5_\u0CA5\" },\n { name: \"angry\", description: \" \u30FD(\uFF40\u0414\u00B4)\uFF89\" },\n { name: \"anger\", description: \" \u30FD(\uFF4F`\u76BF\u2032\uFF4F)\uFF89\" },\n { name: \"joy\", description: \" <(\uFFE3\uFE36\uFFE3)>\" },\n { name: \"blush\", description: \"\u0AEE \u02F6\u1D54 \u1D55 \u1D54\u02F6 \u10D0\" },\n { name: \"confused\", description: \"(\u2022\u0E34_\u2022\u0E34)?\" },\n { name: \"sleeping\", description: \"(\u1D17_\u1D17)\" },\n { name: \"laughing\", description: \"o(\u2267\u25BD\u2266)o\" },\n\n ].map(data => ({\n ...data,\n options: [OptionalMessageOption],\n execute: opts => ({\n content: findOption(opts, \"message\", \"\") + data.description\n })\n }))\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Flex } from \"@components/Flex\";\nimport { Devs } from \"@utils/constants\";\nimport { Margins } from \"@utils/margins\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy, findLazy } from \"@webpack\";\nimport { Card, ChannelStore, Forms, GuildStore, PermissionsBits, Switch, TextInput, Tooltip, useState } from \"@webpack/common\";\nimport { RC } from \"@webpack/types\";\nimport { Channel, Message, User } from \"discord-types/general\";\n\ntype PermissionName = \"CREATE_INSTANT_INVITE\" | \"KICK_MEMBERS\" | \"BAN_MEMBERS\" | \"ADMINISTRATOR\" | \"MANAGE_CHANNELS\" | \"MANAGE_GUILD\" | \"CHANGE_NICKNAME\" | \"MANAGE_NICKNAMES\" | \"MANAGE_ROLES\" | \"MANAGE_WEBHOOKS\" | \"MANAGE_GUILD_EXPRESSIONS\" | \"CREATE_GUILD_EXPRESSIONS\" | \"VIEW_AUDIT_LOG\" | \"VIEW_CHANNEL\" | \"VIEW_GUILD_ANALYTICS\" | \"VIEW_CREATOR_MONETIZATION_ANALYTICS\" | \"MODERATE_MEMBERS\" | \"SEND_MESSAGES\" | \"SEND_TTS_MESSAGES\" | \"MANAGE_MESSAGES\" | \"EMBED_LINKS\" | \"ATTACH_FILES\" | \"READ_MESSAGE_HISTORY\" | \"MENTION_EVERYONE\" | \"USE_EXTERNAL_EMOJIS\" | \"ADD_REACTIONS\" | \"USE_APPLICATION_COMMANDS\" | \"MANAGE_THREADS\" | \"CREATE_PUBLIC_THREADS\" | \"CREATE_PRIVATE_THREADS\" | \"USE_EXTERNAL_STICKERS\" | \"SEND_MESSAGES_IN_THREADS\" | \"CONNECT\" | \"SPEAK\" | \"MUTE_MEMBERS\" | \"DEAFEN_MEMBERS\" | \"MOVE_MEMBERS\" | \"USE_VAD\" | \"PRIORITY_SPEAKER\" | \"STREAM\" | \"USE_EMBEDDED_ACTIVITIES\" | \"USE_SOUNDBOARD\" | \"USE_EXTERNAL_SOUNDS\" | \"REQUEST_TO_SPEAK\" | \"MANAGE_EVENTS\" | \"CREATE_EVENTS\";\n\ninterface Tag {\n // name used for identifying, must be alphanumeric + underscores\n name: string;\n // name shown on the tag itself, can be anything probably; automatically uppercase'd\n displayName: string;\n description: string;\n permissions?: PermissionName[];\n condition?(message: Message | null, user: User, channel: Channel): boolean;\n}\n\ninterface TagSetting {\n text: string;\n showInChat: boolean;\n showInNotChat: boolean;\n}\ninterface TagSettings {\n WEBHOOK: TagSetting,\n OWNER: TagSetting,\n ADMINISTRATOR: TagSetting,\n MODERATOR_STAFF: TagSetting,\n MODERATOR: TagSetting,\n VOICE_MODERATOR: TagSetting,\n [k: string]: TagSetting;\n}\n\n// PermissionStore.computePermissions is not the same function and doesn't work here\nconst PermissionUtil = findByPropsLazy(\"computePermissions\", \"canEveryoneRole\") as {\n computePermissions({ ...args }): bigint;\n};\n\nconst Tag = findLazy(m => m.Types?.[0] === \"BOT\") as RC<{ type?: number, className?: string, useRemSizes?: boolean; }> & { Types: Record; };\n\nconst isWebhook = (message: Message, user: User) => !!message?.webhookId && user.isNonUserBot();\n\nconst tags: Tag[] = [\n {\n name: \"WEBHOOK\",\n displayName: \"Webhook\",\n description: \"Messages sent by webhooks\",\n condition: isWebhook\n }, {\n name: \"OWNER\",\n displayName: \"Owner\",\n description: \"Owns the server\",\n condition: (_, user, channel) => GuildStore.getGuild(channel?.guild_id)?.ownerId === user.id\n }, {\n name: \"ADMINISTRATOR\",\n displayName: \"Admin\",\n description: \"Has the administrator permission\",\n permissions: [\"ADMINISTRATOR\"]\n }, {\n name: \"MODERATOR_STAFF\",\n displayName: \"Staff\",\n description: \"Can manage the server, channels or roles\",\n permissions: [\"MANAGE_GUILD\", \"MANAGE_CHANNELS\", \"MANAGE_ROLES\"]\n }, {\n name: \"MODERATOR\",\n displayName: \"Mod\",\n description: \"Can manage messages or kick/ban people\",\n permissions: [\"MANAGE_MESSAGES\", \"KICK_MEMBERS\", \"BAN_MEMBERS\"]\n }, {\n name: \"VOICE_MODERATOR\",\n displayName: \"VC Mod\",\n description: \"Can manage voice chats\",\n permissions: [\"MOVE_MEMBERS\", \"MUTE_MEMBERS\", \"DEAFEN_MEMBERS\"]\n }\n];\nconst defaultSettings = Object.fromEntries(\n tags.map(({ name, displayName }) => [name, { text: displayName, showInChat: true, showInNotChat: true }])\n) as TagSettings;\n\nfunction SettingsComponent(props: { setValue(v: any): void; }) {\n settings.store.tagSettings ??= defaultSettings;\n\n const [tagSettings, setTagSettings] = useState(settings.store.tagSettings as TagSettings);\n const setValue = (v: TagSettings) => {\n setTagSettings(v);\n props.setValue(v);\n };\n\n return (\n \n {tags.map(t => (\n \n \n \n {({ onMouseEnter, onMouseLeave }) => (\n \n {t.displayName} Tag \n \n )}\n \n \n\n {\n tagSettings[t.name].text = v;\n setValue(tagSettings);\n }}\n className={Margins.bottom16}\n />\n\n {\n tagSettings[t.name].showInChat = v;\n setValue(tagSettings);\n }}\n hideBorder\n >\n Show in messages\n \n\n {\n tagSettings[t.name].showInNotChat = v;\n setValue(tagSettings);\n }}\n hideBorder\n >\n Show in member list and profiles\n \n \n ))}\n \n );\n}\n\nconst settings = definePluginSettings({\n dontShowForBots: {\n description: \"Don't show extra tags for bots (excluding webhooks)\",\n type: OptionType.BOOLEAN\n },\n dontShowBotTag: {\n description: \"Only show extra tags for bots / Hide [BOT] text\",\n type: OptionType.BOOLEAN\n },\n tagSettings: {\n type: OptionType.COMPONENT,\n component: SettingsComponent,\n description: \"fill me\",\n }\n});\n\nexport default definePlugin({\n name: \"MoreUserTags\",\n description: \"Adds tags for webhooks and moderative roles (owner, admin, etc.)\",\n authors: [Devs.Cyn, Devs.TheSun, Devs.RyanCaoDev, Devs.LordElias, Devs.AutumnVN],\n settings,\n patches: [\n // add tags to the tag list\n {\n find: \"BotTagTypes:\",\n replacement: {\n match: /\\((\\i)=\\{\\}\\)\\)\\[(\\i)\\.BOT/,\n replace: \"($1=$self.getTagTypes()))[$2.BOT\"\n }\n },\n {\n find: \".DISCORD_SYSTEM_MESSAGE_BOT_TAG_TOOLTIP,\",\n replacement: [\n // make the tag show the right text\n {\n match: /(switch\\((\\i)\\){.+?)case (\\i(?:\\.\\i)?)\\.BOT:default:(\\i)=(\\i\\.\\i\\.Messages)\\.BOT_TAG_BOT/,\n replace: (_, origSwitch, variant, tags, displayedText, strings) =>\n `${origSwitch}default:{${displayedText} = $self.getTagText(${tags}[${variant}], ${strings})}`\n },\n // show OP tags correctly\n {\n match: /(\\i)=(\\i)===\\i(?:\\.\\i)?\\.ORIGINAL_POSTER/,\n replace: \"$1=$self.isOPTag($2)\"\n },\n // add HTML data attributes (for easier theming)\n {\n match: /.botText,children:(\\i)}\\)]/,\n replace: \"$&,'data-tag':$1.toLowerCase()\"\n }\n ],\n },\n // in messages\n {\n find: \"renderSystemTag:\",\n replacement: {\n match: /;return\\((\\(null==\\i\\?void 0:\\i\\.isSystemDM\\(\\).+?.Types.ORIGINAL_POSTER\\)),null==(\\i)\\)/,\n replace: \";$1;$2=$self.getTag({...arguments[0],origType:$2,location:'chat'});return $2 == null\"\n }\n },\n // in the member list\n {\n find: \".Messages.GUILD_OWNER,\",\n replacement: {\n match: /(?\\i)=\\(null==.{0,100}\\.BOT;return null!=(?\\i)&&\\i\\.bot/,\n replace: \"$ = $self.getTag({user: $, channel: arguments[0].channel, origType: $.bot ? 0 : null, location: 'not-chat' }); return typeof $ === 'number'\"\n }\n },\n // pass channel id down props to be used in profiles\n {\n find: \".hasAvatarForGuild(null==\",\n replacement: {\n match: /(?=usernameIcon:)/,\n replace: \"moreTags_channelId:arguments[0].channelId,\"\n }\n },\n {\n find: 'copyMetaData:\"User Tag\"',\n replacement: {\n match: /(?=,botClass:)/,\n replace: \",moreTags_channelId:arguments[0].moreTags_channelId\"\n }\n },\n // in profiles\n {\n find: \",overrideDiscriminator:\",\n replacement: [\n {\n // prevent channel id from getting ghosted\n // it's either this or extremely long lookbehind\n match: /user:\\i,nick:\\i,/,\n replace: \"$&moreTags_channelId,\"\n }, {\n match: /,botType:(\\i\\((\\i)\\)),/g,\n replace: \",botType:$self.getTag({user:$2,channelId:moreTags_channelId,origType:$1,location:'not-chat'}),\"\n }\n ]\n },\n ],\n\n start() {\n if (settings.store.tagSettings) return;\n // @ts-ignore\n if (!settings.store.visibility_WEBHOOK) settings.store.tagSettings = defaultSettings;\n else {\n const newSettings = { ...defaultSettings };\n Object.entries(Vencord.PlainSettings.plugins.MoreUserTags).forEach(([name, value]) => {\n const [setting, tag] = name.split(\"_\");\n if (setting === \"visibility\") {\n switch (value) {\n case \"always\":\n // its the default\n break;\n case \"chat\":\n newSettings[tag].showInNotChat = false;\n break;\n case \"not-chat\":\n newSettings[tag].showInChat = false;\n break;\n case \"never\":\n newSettings[tag].showInChat = false;\n newSettings[tag].showInNotChat = false;\n break;\n }\n }\n settings.store.tagSettings = newSettings;\n delete Vencord.Settings.plugins.MoreUserTags[name];\n });\n }\n },\n\n getPermissions(user: User, channel: Channel): string[] {\n const guild = GuildStore.getGuild(channel?.guild_id);\n if (!guild) return [];\n\n const permissions = PermissionUtil.computePermissions({ user, context: guild, overwrites: channel.permissionOverwrites });\n return Object.entries(PermissionsBits)\n .map(([perm, permInt]) =>\n permissions & permInt ? perm : \"\"\n )\n .filter(Boolean);\n },\n\n getTagTypes() {\n const obj = {};\n let i = 100;\n tags.forEach(({ name }) => {\n obj[name] = ++i;\n obj[i] = name;\n obj[`${name}-BOT`] = ++i;\n obj[i] = `${name}-BOT`;\n obj[`${name}-OP`] = ++i;\n obj[i] = `${name}-OP`;\n });\n return obj;\n },\n\n isOPTag: (tag: number) => tag === Tag.Types.ORIGINAL_POSTER || tags.some(t => tag === Tag.Types[`${t.name}-OP`]),\n\n getTagText(passedTagName: string, strings: Record) {\n if (!passedTagName) return strings.BOT_TAG_BOT;\n const [tagName, variant] = passedTagName.split(\"-\");\n const tag = tags.find(({ name }) => tagName === name);\n if (!tag) return strings.BOT_TAG_BOT;\n if (variant === \"BOT\" && tagName !== \"WEBHOOK\" && this.settings.store.dontShowForBots) return strings.BOT_TAG_BOT;\n\n const tagText = settings.store.tagSettings?.[tag.name]?.text || tag.displayName;\n switch (variant) {\n case \"OP\":\n return `${strings.BOT_TAG_FORUM_ORIGINAL_POSTER} \u2022 ${tagText}`;\n case \"BOT\":\n return `${strings.BOT_TAG_BOT} \u2022 ${tagText}`;\n default:\n return tagText;\n }\n },\n\n getTag({\n message, user, channelId, origType, location, channel\n }: {\n message?: Message,\n user: User & { isClyde(): boolean; },\n channel?: Channel & { isForumPost(): boolean; },\n channelId?: string;\n origType?: number;\n location: \"chat\" | \"not-chat\";\n }): number | null {\n if (!user)\n return null;\n if (location === \"chat\" && user.id === \"1\")\n return Tag.Types.OFFICIAL;\n if (user.isClyde())\n return Tag.Types.AI;\n\n let type = typeof origType === \"number\" ? origType : null;\n\n channel ??= ChannelStore.getChannel(channelId!) as any;\n if (!channel) return type;\n\n const settings = this.settings.store;\n const perms = this.getPermissions(user, channel);\n\n for (const tag of tags) {\n if (location === \"chat\" && !settings.tagSettings[tag.name].showInChat) continue;\n if (location === \"not-chat\" && !settings.tagSettings[tag.name].showInNotChat) continue;\n\n if (\n tag.permissions?.some(perm => perms.includes(perm)) ||\n (tag.condition?.(message!, user, channel))\n ) {\n if (channel.isForumPost() && channel.ownerId === user.id)\n type = Tag.Types[`${tag.name}-OP`];\n else if (user.bot && !isWebhook(message!, user) && !settings.dontShowBotTag)\n type = Tag.Types[`${tag.name}-BOT`];\n else\n type = Tag.Types[tag.name];\n break;\n }\n }\n return type;\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { makeRange } from \"@components/PluginSettings/components/SettingSliderComponent\";\nimport { Devs } from \"@utils/constants\";\nimport { sleep } from \"@utils/misc\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { RelationshipStore, SelectedChannelStore, UserStore } from \"@webpack/common\";\nimport { Message, ReactionEmoji } from \"discord-types/general\";\n\ninterface IMessageCreate {\n type: \"MESSAGE_CREATE\";\n optimistic: boolean;\n isPushNotification: boolean;\n channelId: string;\n message: Message;\n}\n\ninterface IReactionAdd {\n type: \"MESSAGE_REACTION_ADD\";\n optimistic: boolean;\n channelId: string;\n messageId: string;\n messageAuthorId: string;\n userId: \"195136840355807232\";\n emoji: ReactionEmoji;\n}\n\ninterface IVoiceChannelEffectSendEvent {\n type: string;\n emoji?: ReactionEmoji; // Just in case...\n channelId: string;\n userId: string;\n animationType: number;\n animationId: number;\n}\n\nconst MOYAI = \"\uD83D\uDDFF\";\nconst MOYAI_URL =\n \"https://raw.githubusercontent.com/MeguminSama/VencordPlugins/main/plugins/moyai/moyai.mp3\";\nconst MOYAI_URL_HD =\n \"https://raw.githubusercontent.com/MeguminSama/VencordPlugins/main/plugins/moyai/moyai_hd.wav\";\n\nconst settings = definePluginSettings({\n volume: {\n description: \"Volume of the \uD83D\uDDFF\uD83D\uDDFF\uD83D\uDDFF\",\n type: OptionType.SLIDER,\n markers: makeRange(0, 1, 0.1),\n default: 0.5,\n stickToMarkers: false\n },\n quality: {\n description: \"Quality of the \uD83D\uDDFF\uD83D\uDDFF\uD83D\uDDFF\",\n type: OptionType.SELECT,\n options: [\n { label: \"Normal\", value: \"Normal\", default: true },\n { label: \"HD\", value: \"HD\" }\n ],\n },\n triggerWhenUnfocused: {\n description: \"Trigger the \uD83D\uDDFF even when the window is unfocused\",\n type: OptionType.BOOLEAN,\n default: true\n },\n ignoreBots: {\n description: \"Ignore bots\",\n type: OptionType.BOOLEAN,\n default: true\n },\n ignoreBlocked: {\n description: \"Ignore blocked users\",\n type: OptionType.BOOLEAN,\n default: true\n }\n});\n\nexport default definePlugin({\n name: \"Moyai\",\n authors: [Devs.Megu, Devs.Nuckyz],\n description: \"\uD83D\uDDFF\uD83D\uDDFF\uD83D\uDDFF\uD83D\uDDFF\uD83D\uDDFF\uD83D\uDDFF\uD83D\uDDFF\uD83D\uDDFF\",\n settings,\n\n flux: {\n async MESSAGE_CREATE({ optimistic, type, message, channelId }: IMessageCreate) {\n if (optimistic || type !== \"MESSAGE_CREATE\") return;\n if (message.state === \"SENDING\") return;\n if (settings.store.ignoreBots && message.author?.bot) return;\n if (settings.store.ignoreBlocked && RelationshipStore.isBlocked(message.author?.id)) return;\n if (!message.content) return;\n if (channelId !== SelectedChannelStore.getChannelId()) return;\n\n const moyaiCount = getMoyaiCount(message.content);\n\n for (let i = 0; i < moyaiCount; i++) {\n boom();\n await sleep(300);\n }\n },\n\n MESSAGE_REACTION_ADD({ optimistic, type, channelId, userId, messageAuthorId, emoji }: IReactionAdd) {\n if (optimistic || type !== \"MESSAGE_REACTION_ADD\") return;\n if (settings.store.ignoreBots && UserStore.getUser(userId)?.bot) return;\n if (settings.store.ignoreBlocked && RelationshipStore.isBlocked(messageAuthorId)) return;\n if (channelId !== SelectedChannelStore.getChannelId()) return;\n\n const name = emoji.name.toLowerCase();\n if (name !== MOYAI && !name.includes(\"moyai\") && !name.includes(\"moai\")) return;\n\n boom();\n },\n\n VOICE_CHANNEL_EFFECT_SEND({ emoji }: IVoiceChannelEffectSendEvent) {\n if (!emoji?.name) return;\n const name = emoji.name.toLowerCase();\n if (name !== MOYAI && !name.includes(\"moyai\") && !name.includes(\"moai\")) return;\n\n boom();\n }\n }\n});\n\nfunction countOccurrences(sourceString: string, subString: string) {\n let i = 0;\n let lastIdx = 0;\n while ((lastIdx = sourceString.indexOf(subString, lastIdx) + 1) !== 0)\n i++;\n\n return i;\n}\n\nfunction countMatches(sourceString: string, pattern: RegExp) {\n if (!pattern.global)\n throw new Error(\"pattern must be global\");\n\n let i = 0;\n while (pattern.test(sourceString))\n i++;\n\n return i;\n}\n\nconst customMoyaiRe = //gi;\n\nfunction getMoyaiCount(message: string) {\n const count = countOccurrences(message, MOYAI)\n + countMatches(message, customMoyaiRe);\n\n return Math.min(count, 10);\n}\n\nfunction boom() {\n if (!settings.store.triggerWhenUnfocused && !document.hasFocus()) return;\n const audioElement = document.createElement(\"audio\");\n\n audioElement.src = settings.store.quality === \"HD\"\n ? MOYAI_URL_HD\n : MOYAI_URL;\n\n audioElement.volume = settings.store.volume;\n audioElement.play();\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByProps } from \"@webpack\";\n\nconst settings = definePluginSettings({\n guild: {\n description: \"Mute Guild\",\n type: OptionType.BOOLEAN,\n default: true\n },\n everyone: {\n description: \"Suppress @everyone and @here\",\n type: OptionType.BOOLEAN,\n default: true\n },\n role: {\n description: \"Suppress All Role @mentions\",\n type: OptionType.BOOLEAN,\n default: true\n }\n});\n\nexport default definePlugin({\n name: \"MuteNewGuild\",\n description: \"Mutes newly joined guilds\",\n authors: [Devs.Glitch, Devs.Nuckyz, Devs.carince],\n patches: [\n {\n find: \",acceptInvite(\",\n replacement: {\n match: /INVITE_ACCEPT_SUCCESS.+?,(\\i)=null!==.+?;/,\n replace: (m, guildId) => `${m}$self.handleMute(${guildId});`\n }\n },\n {\n find: \"{joinGuild:\",\n replacement: {\n match: /guildId:(\\i),lurker:(\\i).{0,20}}\\)\\);/,\n replace: (m, guildId, lurker) => `${m}if(!${lurker})$self.handleMute(${guildId});`\n }\n }\n ],\n settings,\n\n handleMute(guildId: string | null) {\n if (guildId === \"@me\" || guildId === \"null\" || guildId == null) return;\n findByProps(\"updateGuildNotificationSettings\").updateGuildNotificationSettings(guildId,\n {\n muted: settings.store.guild,\n suppress_everyone: settings.store.everyone,\n suppress_roles: settings.store.role\n }\n );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport { isNonNullish } from \"@utils/guards\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { Avatar, ChannelStore, Clickable, RelationshipStore, ScrollerThin, UserStore } from \"@webpack/common\";\nimport { Channel, User } from \"discord-types/general\";\n\nconst SelectedChannelActionCreators = findByPropsLazy(\"selectPrivateChannel\");\nconst AvatarUtils = findByPropsLazy(\"getChannelIconURL\");\nconst UserUtils = findByPropsLazy(\"getGlobalName\");\n\nconst ProfileListClasses = findByPropsLazy(\"emptyIconFriends\", \"emptyIconGuilds\");\nconst GuildLabelClasses = findByPropsLazy(\"guildNick\", \"guildAvatarWithoutIcon\");\n\nfunction getGroupDMName(channel: Channel) {\n return channel.name ||\n channel.recipients\n .map(UserStore.getUser)\n .filter(isNonNullish)\n .map(c => RelationshipStore.getNickname(c.id) || UserUtils.getName(c))\n .join(\", \");\n}\n\nexport default definePlugin({\n name: \"MutualGroupDMs\",\n description: \"Shows mutual group dms in profiles\",\n authors: [Devs.amia],\n\n patches: [\n {\n find: \".Messages.USER_PROFILE_MODAL\", // Note: the module is lazy-loaded\n replacement: {\n match: /(?<=\\.MUTUAL_GUILDS\\}\\),)(?=(\\i\\.bot).{0,20}(\\(0,\\i\\.jsx\\)\\(.{0,100}id:))/,\n replace: '($1||arguments[0].isCurrentUser)?null:$2\"MUTUAL_GDMS\",children:\"Mutual Groups\"}),'\n }\n },\n {\n find: \".UserProfileSections.USER_INFO_CONNECTIONS:\",\n replacement: {\n match: /(?<={user:(\\i),onClose:(\\i)}\\);)(?=case \\i\\.\\i\\.MUTUAL_FRIENDS)/,\n replace: \"case \\\"MUTUAL_GDMS\\\":return $self.renderMutualGDMs($1,$2);\"\n }\n }\n ],\n\n renderMutualGDMs(user: User, onClose: () => void) {\n const entries = ChannelStore.getSortedPrivateChannels().filter(c => c.isGroupDM() && c.recipients.includes(user.id)).map(c => (\n {\n onClose();\n SelectedChannelActionCreators.selectPrivateChannel(c.id);\n }}\n >\n \n \n
\n
{getGroupDMName(c)}
\n
{c.recipients.length + 1} Members
\n
\n \n ));\n\n return (\n \n {entries.length > 0\n ? entries\n : (\n
\n
\n
No group dms in common
\n
\n )\n }\n \n );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\n\nconst RelationshipStore = findByPropsLazy(\"getRelationships\", \"isBlocked\");\n\nexport default definePlugin({\n name: \"NoBlockedMessages\",\n description: \"Hides all blocked messages from chat completely.\",\n authors: [Devs.rushii, Devs.Samu],\n patches: [\n {\n find: \"Messages.BLOCKED_MESSAGES_HIDE\",\n replacement: [\n {\n match: /let\\{[^}]*collapsedReason[^}]*\\}/,\n replace: \"return null;$&\"\n }\n ]\n },\n ...[\n 'displayName=\"MessageStore\"',\n 'displayName=\"ReadStateStore\"'\n ].map(find => ({\n find,\n predicate: () => Settings.plugins.NoBlockedMessages.ignoreBlockedMessages === true,\n replacement: [\n {\n match: /(?<=MESSAGE_CREATE:function\\((\\i)\\){)/,\n replace: (_, props) => `if($self.isBlocked(${props}.message))return;`\n }\n ]\n }))\n ],\n options: {\n ignoreBlockedMessages: {\n description: \"Completely ignores (recent) incoming messages from blocked users (locally).\",\n type: OptionType.BOOLEAN,\n default: false,\n restartNeeded: true,\n },\n },\n isBlocked: message =>\n RelationshipStore.isBlocked(message.author.id)\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NoDevtoolsWarning\",\n description: \"Disables the 'HOLD UP' banner in the console. As a side effect, also prevents Discord from hiding your token, which prevents random logouts.\",\n authors: [Devs.Ven],\n patches: [{\n find: \"setDevtoolsCallbacks\",\n replacement: {\n match: /if\\(null!=\\i&&\"0.0.0\"===\\i\\.remoteApp\\.getVersion\\(\\)\\)/,\n replace: \"if(true)\"\n }\n }]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NoF1\",\n description: \"Disables F1 help bind.\",\n authors: [Devs.Cyn],\n patches: [\n {\n find: ',\"f1\"],comboKeysBindGlobal:',\n replacement: {\n match: ',\"f1\"],comboKeysBindGlobal:',\n replace: \"],comboKeysBindGlobal:\",\n },\n },\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n(window.VencordStyles ??= new Map()).set(\"src/plugins/noMosaic/styles.css\", {\n name: \"src/plugins/noMosaic/styles.css\",\n source: \"[class^=\\\"nonMediaAttachmentsContainer_\\\"] [class*=\\\"messageAttachment_\\\"] {\\n position: relative;\\n}\\n\",\n classNames: {},\n dom: null,\n});\n\nexport default \"src/plugins/noMosaic/styles.css\";\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { disableStyle, enableStyle } from \"@api/Styles\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nimport style from \"./styles.css?managed\";\n\nconst settings = definePluginSettings({\n inlineVideo: {\n description: \"Play videos without carousel modal\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n },\n mediaLayoutType: {\n description: \"Choose media layout type\",\n type: OptionType.SELECT,\n restartNeeded: true,\n options: [\n { label: \"STATIC, render loading image but image isn't resposive, no problem unless discord window width is too small\", value: \"STATIC\", default: true },\n { label: \"RESPONSIVE, image is responsive but not render loading image, cause messages shift when loaded\", value: \"RESPONSIVE\" },\n ]\n }\n});\n\nexport default definePlugin({\n name: \"NoMosaic\",\n authors: [Devs.AutumnVN],\n description: \"Removes Discord new image mosaic\",\n tags: [\"image\", \"mosaic\", \"media\"],\n\n settings,\n\n patches: [\n {\n find: \".oneByTwoLayoutThreeGrid\",\n replacement: [{\n match: /mediaLayoutType:\\i\\.\\i\\.MOSAIC/,\n replace: \"mediaLayoutType:$self.mediaLayoutType()\",\n },\n {\n match: /null!==\\(\\i=\\i\\.get\\(\\i\\)\\)&&void 0!==\\i\\?\\i:\"INVALID\"/,\n replace: '\"INVALID\"',\n }]\n },\n {\n find: \"renderAttachments(\",\n predicate: () => settings.store.inlineVideo,\n replacement: {\n match: /url:(\\i)\\.url\\}\\);return /,\n replace: \"$&$1.content_type?.startsWith('image/')&&\"\n }\n },\n {\n find: \"Messages.REMOVE_ATTACHMENT_TOOLTIP_TEXT\",\n replacement: {\n match: /\\i===\\i\\.\\i\\.MOSAIC/,\n replace: \"true\"\n }\n }\n ],\n\n mediaLayoutType() {\n return settings.store.mediaLayoutType;\n },\n\n start() {\n enableStyle(style);\n },\n\n stop() {\n disableStyle(style);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\n\nconst MessageRequestStore = findByPropsLazy(\"getMessageRequestsCount\");\n\nconst settings = definePluginSettings({\n hideFriendRequestsCount: {\n type: OptionType.BOOLEAN,\n description: \"Hide incoming friend requests count\",\n default: true,\n restartNeeded: true\n },\n hideMessageRequestsCount: {\n type: OptionType.BOOLEAN,\n description: \"Hide message requests count\",\n default: true,\n restartNeeded: true\n },\n hidePremiumOffersCount: {\n type: OptionType.BOOLEAN,\n description: \"Hide nitro offers count\",\n default: true,\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"NoPendingCount\",\n description: \"Removes the ping count of incoming friend requests, message requests, and nitro offers.\",\n authors: [Devs.amia],\n\n settings: settings,\n\n // Functions used to determine the top left count indicator can be found in the single module that calls getUnacknowledgedOffers(...)\n // or by searching for \"showProgressBadge:\"\n patches: [\n {\n find: \"getPendingCount(){\",\n predicate: () => settings.store.hideFriendRequestsCount,\n replacement: {\n match: /(?<=getPendingCount\\(\\)\\{)/,\n replace: \"return 0;\"\n }\n },\n {\n find: \"getMessageRequestsCount(){\",\n predicate: () => settings.store.hideMessageRequestsCount,\n replacement: {\n match: /(?<=getMessageRequestsCount\\(\\)\\{)/,\n replace: \"return 0;\"\n }\n },\n // This prevents the Message Requests tab from always hiding due to the previous patch (and is compatible with spam requests)\n // In short, only the red badge is hidden. Button visibility behavior isn't changed.\n {\n find: \".getSpamChannelsCount(),\",\n predicate: () => settings.store.hideMessageRequestsCount,\n replacement: {\n match: /(?<=getSpamChannelsCount\\(\\),\\i=)\\i\\.getMessageRequestsCount\\(\\)/,\n replace: \"$self.getRealMessageRequestCount()\"\n }\n },\n {\n find: \"showProgressBadge:\",\n predicate: () => settings.store.hidePremiumOffersCount,\n replacement: {\n // The two groups inside the first group grab the minified names of the variables,\n // they are then referenced later to find unviewedTrialCount + unviewedDiscountCount.\n match: /(?<=\\{unviewedTrialCount:(\\i),unviewedDiscountCount:(\\i)\\}.{0,200}\\i=)\\1\\+\\2/,\n replace: \"0\"\n }\n }\n ],\n\n getRealMessageRequestCount() {\n return MessageRequestStore.getMessageRequestChannelIds().size;\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NoProfileThemes\",\n description: \"Completely removes Nitro profile themes\",\n authors: [Devs.TheKodeToad],\n patches: [\n {\n find: \".NITRO_BANNER,\",\n replacement: {\n // = isPremiumAtLeast(user.premiumType, TIER_2)\n match: /=(?=\\i\\.\\i\\.isPremiumAtLeast\\(null==(\\i))/,\n // = user.banner && isPremiumAtLeast(user.premiumType, TIER_2)\n replace: \"=(arguments[0]?.bannerSrc||$1?.banner)&&\"\n }\n },\n {\n find: \".avatarPositionPremiumNoBanner,default:\",\n replacement: {\n // premiumUserWithoutBanner: foo().avatarPositionPremiumNoBanner, default: foo().avatarPositionNormal\n match: /\\.avatarPositionPremiumNoBanner(?=,default:\\i\\.(\\i))/,\n // premiumUserWithoutBanner: foo().avatarPositionNormal...\n replace: \".$1\"\n }\n },\n {\n find: \"hasThemeColors(){\",\n replacement: {\n match: /get canUsePremiumProfileCustomization\\(\\){return /,\n replace: \"$&false &&\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport type { Message } from \"discord-types/general\";\n\nconst settings = definePluginSettings({\n userList: {\n description:\n \"List of users to allow or exempt pings for (separated by commas or spaces)\",\n type: OptionType.STRING,\n default: \"1234567890123445,1234567890123445\",\n },\n shouldPingListed: {\n description: \"Behaviour\",\n type: OptionType.SELECT,\n options: [\n {\n label: \"Do not ping the listed users\",\n value: false,\n },\n {\n label: \"Only ping the listed users\",\n value: true,\n default: true,\n },\n ],\n },\n inverseShiftReply: {\n description: \"Invert Discord's shift replying behaviour (enable to make shift reply mention user)\",\n type: OptionType.BOOLEAN,\n default: false,\n }\n});\n\nexport default definePlugin({\n name: \"NoReplyMention\",\n description: \"Disables reply pings by default\",\n authors: [Devs.DustyAngel47, Devs.axyie, Devs.pylix, Devs.outfoxxed],\n settings,\n\n shouldMention(message: Message, isHoldingShift: boolean) {\n const isListed = settings.store.userList.includes(message.author.id);\n const isExempt = settings.store.shouldPingListed ? isListed : !isListed;\n return settings.store.inverseShiftReply ? isHoldingShift !== isExempt : !isHoldingShift && isExempt;\n },\n\n patches: [\n {\n find: \",\\\"Message\\\")}function\",\n replacement: {\n match: /:(\\i),shouldMention:!(\\i)\\.shiftKey/,\n replace: \":$1,shouldMention:$self.shouldMention($1,$2.shiftKey)\"\n }\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NoScreensharePreview\",\n description: \"Disables screenshare previews from being sent.\",\n authors: [Devs.Nuckyz],\n patches: [\n {\n find: '\"ApplicationStreamPreviewUploadManager\"',\n replacement: {\n match: /await \\i\\.\\i\\.(makeChunkedRequest\\(|post\\(\\{url:)\\i\\.\\i\\.STREAM_PREVIEW.+?\\}\\)/g,\n replace: \"0\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NoTypingAnimation\",\n authors: [Devs.AutumnVN],\n description: \"Disables the CPU-intensive typing dots animation\",\n patches: [{\n find: \"dotCycle\",\n replacement: {\n match: /document.hasFocus\\(\\)/,\n replace: \"false\"\n }\n }]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Sofia Lima\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\n\nexport default definePlugin({\n name: \"NoUnblockToJump\",\n description: \"Allows you to jump to messages of blocked users without unblocking them\",\n authors: [Devs.dzshn],\n patches: [\n {\n find: '.id,\"Search Results\"',\n replacement: {\n match: /if\\(.{1,10}\\)(.{1,10}\\.show\\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/,\n replace: \"if(false)$1\"\n }\n },\n {\n find: \"renderJumpButton()\",\n replacement: {\n match: /if\\(.{1,10}\\)(.{1,10}\\.show\\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/,\n replace: \"if(false)$1\"\n }\n },\n {\n find: \"flash:!0,returnMessageId\",\n replacement: {\n match: /.\\?(.{1,10}\\.show\\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/,\n replace: \"false?$1\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NormalizeMessageLinks\",\n description: \"Strip canary/ptb from message links\",\n authors: [Devs.bb010g],\n patches: [\n {\n find: \".Messages.COPY_MESSAGE_LINK,\",\n replacement: {\n match: /\\.concat\\(location\\.host\\)/,\n replace: \".concat($self.normalizeHost(location.host))\",\n },\n },\n ],\n normalizeHost(host: string) {\n return host.replace(/(^|\\b)(canary\\.|ptb\\.)(discord.com)$/, \"$1$3\");\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NSFWGateBypass\",\n description: \"Allows you to access NSFW channels without setting/verifying your age\",\n authors: [Devs.Commandtechno],\n patches: [\n {\n find: \".nsfwAllowed=null\",\n replacement: {\n match: /(\\w+)\\.nsfwAllowed=/,\n replace: \"$1.nsfwAllowed=true;\",\n },\n },\n ],\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { ChannelStore, ReadStateStore, UserStore } from \"@webpack/common\";\nimport { MessageJSON } from \"discord-types/general\";\n\nconst enum ChannelType {\n DM = 1,\n GROUP_DM = 3\n}\n\nconst settings = definePluginSettings({\n channelToAffect: {\n type: OptionType.SELECT,\n description: \"Select the type of DM for the plugin to affect\",\n options: [\n { label: \"Both\", value: \"both_dms\", default: true },\n { label: \"User DMs\", value: \"user_dm\" },\n { label: \"Group DMs\", value: \"group_dm\" },\n ]\n },\n allowMentions: {\n type: OptionType.BOOLEAN,\n description: \"Receive audio pings for @mentions\",\n default: false,\n },\n allowEveryone: {\n type: OptionType.BOOLEAN,\n description: \"Receive audio pings for @everyone and @here in group DMs\",\n default: false,\n },\n});\n\nexport default definePlugin({\n name: \"OnePingPerDM\",\n description: \"If unread messages are sent by a user in DMs multiple times, you'll only receive one audio ping. Read the messages to reset the limit\",\n authors: [Devs.ProffDea],\n settings,\n patches: [{\n find: \".getDesktopType()===\",\n replacement: [{\n match: /(\\i\\.\\i\\.getDesktopType\\(\\)===\\i\\.\\i\\.NEVER)\\)/,\n replace: \"$&if(!$self.isPrivateChannelRead(arguments[0]?.message))return;else \"\n },\n {\n match: /sound:(\\i\\?\\i:void 0,volume:\\i,onClick)/,\n replace: \"sound:!$self.isPrivateChannelRead(arguments[0]?.message)?undefined:$1\"\n }]\n }],\n isPrivateChannelRead(message: MessageJSON) {\n const channelType = ChannelStore.getChannel(message.channel_id)?.type;\n if (\n (channelType !== ChannelType.DM && channelType !== ChannelType.GROUP_DM) ||\n (channelType === ChannelType.DM && settings.store.channelToAffect === \"group_dm\") ||\n (channelType === ChannelType.GROUP_DM && settings.store.channelToAffect === \"user_dm\") ||\n (settings.store.allowMentions && message.mentions.some(m => m.id === UserStore.getCurrentUser().id)) ||\n (settings.store.allowEveryone && message.mention_everyone)\n ) {\n return true;\n }\n return ReadStateStore.getOldestUnreadMessageId(message.channel_id) === message.id;\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"oneko\",\n description: \"cat follow mouse (real)\",\n // Listing adryd here because this literally just evals her script\n authors: [Devs.Ven, Devs.adryd],\n\n start() {\n fetch(\"https://raw.githubusercontent.com/adryd325/oneko.js/8fa8a1864aa71cd7a794d58bc139e755e96a236c/oneko.js\")\n .then(x => x.text())\n .then(s => s.replace(\"./oneko.gif\", \"https://raw.githubusercontent.com/adryd325/oneko.js/14bab15a755d0e35cd4ae19c931d96d306f99f42/oneko.gif\"))\n .then(eval);\n },\n\n stop() {\n document.getElementById(\"oneko\")?.remove();\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType, PluginNative } from \"@utils/types\";\nimport { showToast, Toasts } from \"@webpack/common\";\nimport type { MouseEvent } from \"react\";\n\nconst ShortUrlMatcher = /^https:\\/\\/(spotify\\.link|s\\.team)\\/.+$/;\nconst SpotifyMatcher = /^https:\\/\\/open\\.spotify\\.com\\/(track|album|artist|playlist|user|episode)\\/(.+)(?:\\?.+?)?$/;\nconst SteamMatcher = /^https:\\/\\/(steamcommunity\\.com|(?:help|store)\\.steampowered\\.com)\\/.+$/;\nconst EpicMatcher = /^https:\\/\\/store\\.epicgames\\.com\\/(.+)$/;\n\nconst settings = definePluginSettings({\n spotify: {\n type: OptionType.BOOLEAN,\n description: \"Open Spotify links in the Spotify app\",\n default: true,\n },\n steam: {\n type: OptionType.BOOLEAN,\n description: \"Open Steam links in the Steam app\",\n default: true,\n },\n epic: {\n type: OptionType.BOOLEAN,\n description: \"Open Epic Games links in the Epic Games Launcher\",\n default: true,\n }\n});\n\nconst Native = VencordNative.pluginHelpers.OpenInApp as PluginNative;\n\nexport default definePlugin({\n name: \"OpenInApp\",\n description: \"Open Spotify, Steam and Epic Games URLs in their respective apps instead of your browser\",\n authors: [Devs.Ven],\n settings,\n\n patches: [\n {\n find: \"trackAnnouncementMessageLinkClicked({\",\n replacement: {\n match: /(?<=handleClick:function\\(\\)\\{return (\\i)\\}.+?)function \\1\\(.+?\\)\\{/,\n replace: \"async $& if(await $self.handleLink(...arguments)) return;\"\n }\n },\n // Make Spotify profile activity links open in app on web\n {\n find: \"WEB_OPEN(\",\n predicate: () => !IS_DISCORD_DESKTOP && settings.store.spotify,\n replacement: {\n match: /\\i\\.\\i\\.isProtocolRegistered\\(\\)(.{0,100})window.open/g,\n replace: \"true$1VencordNative.native.openExternal\"\n }\n },\n {\n find: \".CONNECTED_ACCOUNT_VIEWED,\",\n replacement: {\n match: /(?<=href:\\i,onClick:\\i=>\\{)(?=.{0,10}\\i=(\\i)\\.type,.{0,100}CONNECTED_ACCOUNT_VIEWED)/,\n replace: \"$self.handleAccountView(arguments[0],$1.type,$1.id);\"\n }\n }\n ],\n\n async handleLink(data: { href: string; }, event?: MouseEvent) {\n if (!data) return false;\n\n let url = data.href;\n if (!IS_WEB && ShortUrlMatcher.test(url)) {\n event?.preventDefault();\n // CORS jumpscare\n url = await Native.resolveRedirect(url);\n }\n\n spotify: {\n if (!settings.store.spotify) break spotify;\n\n const match = SpotifyMatcher.exec(url);\n if (!match) break spotify;\n\n const [, type, id] = match;\n VencordNative.native.openExternal(`spotify:${type}:${id}`);\n\n event?.preventDefault();\n return true;\n }\n\n steam: {\n if (!settings.store.steam) break steam;\n\n if (!SteamMatcher.test(url)) break steam;\n\n VencordNative.native.openExternal(`steam://openurl/${url}`);\n event?.preventDefault();\n\n // Steam does not focus itself so show a toast so it's slightly less confusing\n showToast(\"Opened link in Steam\", Toasts.Type.SUCCESS);\n return true;\n }\n\n epic: {\n if (!settings.store.epic) break epic;\n\n const match = EpicMatcher.exec(url);\n if (!match) break epic;\n\n VencordNative.native.openExternal(`com.epicgames.launcher://store/${match[1]}`);\n event?.preventDefault();\n\n return true;\n }\n\n // in case short url didn't end up being something we can handle\n if (event?.defaultPrevented) {\n window.open(url, \"_blank\");\n return true;\n }\n\n return false;\n },\n\n handleAccountView(event: { preventDefault(): void; }, platformType: string, userId: string) {\n if (platformType === \"spotify\" && settings.store.spotify) {\n VencordNative.native.openExternal(`spotify:user:${userId}`);\n event.preventDefault();\n } else if (platformType === \"steam\" && settings.store.steam) {\n VencordNative.native.openExternal(`steam://openurl/https://steamcommunity.com/profiles/${userId}`);\n showToast(\"Opened link in Steam\", Toasts.Type.SUCCESS);\n event.preventDefault();\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { FluxDispatcher } from \"@webpack/common\";\n\nconst enum Intensity {\n Normal,\n Better,\n ProjectX,\n}\n\nconst settings = definePluginSettings({\n superIntensePartyMode: {\n description: \"Party intensity\",\n type: OptionType.SELECT,\n options: [\n { label: \"Normal\", value: Intensity.Normal, default: true },\n { label: \"Better\", value: Intensity.Better },\n { label: \"Project X\", value: Intensity.ProjectX },\n ],\n restartNeeded: false,\n onChange: setSettings\n },\n});\n\nexport default definePlugin({\n name: \"Party mode \uD83C\uDF89\",\n description: \"Allows you to use party mode cause the party never ends \u2728\",\n authors: [Devs.UwUDev],\n settings,\n\n start() {\n setPoggerState(true);\n setSettings(settings.store.superIntensePartyMode);\n },\n\n stop() {\n setPoggerState(false);\n },\n});\n\nfunction setPoggerState(state: boolean) {\n FluxDispatcher.dispatch({\n type: \"POGGERMODE_SETTINGS_UPDATE\",\n settings: {\n enabled: state,\n settingsVisible: state\n }\n });\n}\n\nfunction setSettings(intensity: Intensity) {\n const state = {\n screenshakeEnabledLocations: { 0: true, 1: true, 2: true },\n shakeIntensity: 1,\n confettiSize: 16,\n confettiCount: 5,\n combosRequiredCount: 1\n };\n\n switch (intensity) {\n case Intensity.Normal: {\n Object.assign(state, {\n screenshakeEnabledLocations: { 0: true, 1: false, 2: false },\n combosRequiredCount: 5\n });\n break;\n }\n case Intensity.Better: {\n Object.assign(state, {\n confettiSize: 12,\n confettiCount: 8,\n });\n break;\n }\n case Intensity.ProjectX: {\n Object.assign(state, {\n shakeIntensity: 20,\n confettiSize: 25,\n confettiCount: 15,\n });\n break;\n }\n }\n\n FluxDispatcher.dispatch({\n type: \"POGGERMODE_SETTINGS_UPDATE\",\n settings: state\n });\n}\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nconst settings = definePluginSettings({\n lockout: {\n type: OptionType.BOOLEAN,\n default: true,\n description: 'Bypass the permission lockout prevention (\"Pretty sure you don\\'t want to do this\")',\n restartNeeded: true\n },\n onboarding: {\n type: OptionType.BOOLEAN,\n default: true,\n description: 'Bypass the onboarding requirements (\"Making this change will make your server incompatible [...]\")',\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"PermissionFreeWill\",\n description: \"Disables the client-side restrictions for channel permission management.\",\n authors: [Devs.lewisakura],\n\n patches: [\n // Permission lockout, just set the check to true\n {\n find: \".showPermissionLockoutModal(\",\n replacement: [\n {\n match: /case\"DENY\":.{0,50}if\\((?=\\i\\.\\i\\.can)/,\n replace: \"$&true||\"\n }\n ],\n predicate: () => settings.store.lockout\n },\n // Onboarding, same thing but we need to prevent the check\n {\n find: \".ONBOARDING_CHANNEL_THRESHOLD_WARNING\",\n replacement: [\n {\n // are we java yet?\n match: /(?<=(?:isDefaultChannelThresholdMetAfterDelete|checkDefaultChannelThresholdMetAfterChannelPermissionDeny):function\\(\\)\\{)return \\i(?=\\})/g,\n replace: \"return () => true\"\n }\n ],\n predicate: () => settings.store.onboarding\n }\n ],\n settings\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { classNameFactory } from \"@api/Styles\";\nimport { wordsToTitle } from \"@utils/text\";\nimport { GuildStore, i18n, Parser } from \"@webpack/common\";\nimport { Guild, GuildMember, Role } from \"discord-types/general\";\nimport type { ReactNode } from \"react\";\n\nimport { PermissionsSortOrder, settings } from \".\";\nimport { PermissionType } from \"./components/RolesAndUsersPermissions\";\n\nexport const cl = classNameFactory(\"vc-permviewer-\");\n\nfunction formatPermissionWithoutMatchingString(permission: string) {\n return wordsToTitle(permission.toLowerCase().split(\"_\"));\n}\n\n// because discord is unable to be consistent with their names\nconst PermissionKeyMap = {\n MANAGE_GUILD: \"MANAGE_SERVER\",\n MANAGE_GUILD_EXPRESSIONS: \"MANAGE_EXPRESSIONS\",\n CREATE_GUILD_EXPRESSIONS: \"CREATE_EXPRESSIONS\",\n MODERATE_MEMBERS: \"MODERATE_MEMBER\", // HELLOOOO ??????\n STREAM: \"VIDEO\",\n SEND_VOICE_MESSAGES: \"ROLE_PERMISSIONS_SEND_VOICE_MESSAGE\",\n} as const;\n\nexport function getPermissionString(permission: string) {\n permission = PermissionKeyMap[permission] || permission;\n\n return i18n.Messages[permission] ||\n // shouldn't get here but just in case\n formatPermissionWithoutMatchingString(permission);\n}\n\nexport function getPermissionDescription(permission: string): ReactNode {\n // DISCORD PLEEEEEEEEAAAAASE IM BEGGING YOU :(\n if (permission === \"USE_APPLICATION_COMMANDS\")\n permission = \"USE_APPLICATION_COMMANDS_GUILD\";\n else if (permission === \"SEND_VOICE_MESSAGES\")\n permission = \"SEND_VOICE_MESSAGE_GUILD\";\n else if (permission !== \"STREAM\")\n permission = PermissionKeyMap[permission] || permission;\n\n const msg = i18n.Messages[`ROLE_PERMISSIONS_${permission}_DESCRIPTION`] as any;\n if (msg?.hasMarkdown)\n return Parser.parse(msg.message);\n\n if (typeof msg === \"string\") return msg;\n\n return \"\";\n}\n\nexport function getSortedRoles({ roles, id }: Guild, member: GuildMember) {\n return [...member.roles, id]\n .map(id => roles[id])\n .sort((a, b) => b.position - a.position);\n}\n\nexport function sortUserRoles(roles: Role[]) {\n switch (settings.store.permissionsSortOrder) {\n case PermissionsSortOrder.HighestRole:\n return roles.sort((a, b) => b.position - a.position);\n case PermissionsSortOrder.LowestRole:\n return roles.sort((a, b) => a.position - b.position);\n default:\n return roles;\n }\n}\n\nexport function sortPermissionOverwrites(overwrites: T[], guildId: string) {\n const guild = GuildStore.getGuild(guildId);\n\n return overwrites.sort((a, b) => {\n if (a.type !== PermissionType.Role || b.type !== PermissionType.Role) return 0;\n\n const roleA = guild.roles[a.id];\n const roleB = guild.roles[b.id];\n\n return roleB.position - roleA.position;\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function PermissionDeniedIcon() {\n return (\n \n Denied\n \n \n );\n}\n\nexport function PermissionAllowedIcon() {\n return (\n \n Allowed\n \n \n );\n}\n\nexport function PermissionDefaultIcon() {\n return (\n \n \n Not overwritten\n \n \n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { InfoIcon, OwnerCrownIcon } from \"@components/Icons\";\nimport { getUniqueUsername } from \"@utils/discord\";\nimport { ModalCloseButton, ModalContent, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from \"@utils/modal\";\nimport { ContextMenuApi, FluxDispatcher, GuildMemberStore, Menu, PermissionsBits, Text, Tooltip, useEffect, UserStore, useState, useStateFromStores } from \"@webpack/common\";\nimport type { Guild } from \"discord-types/general\";\n\nimport { settings } from \"..\";\nimport { cl, getPermissionDescription, getPermissionString } from \"../utils\";\nimport { PermissionAllowedIcon, PermissionDefaultIcon, PermissionDeniedIcon } from \"./icons\";\n\nexport const enum PermissionType {\n Role = 0,\n User = 1,\n Owner = 2\n}\n\nexport interface RoleOrUserPermission {\n type: PermissionType;\n id?: string;\n permissions?: bigint;\n overwriteAllow?: bigint;\n overwriteDeny?: bigint;\n}\n\nfunction openRolesAndUsersPermissionsModal(permissions: Array, guild: Guild, header: string) {\n return openModal(modalProps => (\n \n ));\n}\n\nfunction RolesAndUsersPermissionsComponent({ permissions, guild, modalProps, header }: { permissions: Array; guild: Guild; modalProps: ModalProps; header: string; }) {\n permissions.sort((a, b) => a.type - b.type);\n\n useStateFromStores(\n [GuildMemberStore],\n () => GuildMemberStore.getMemberIds(guild.id),\n null,\n (old, current) => old.length === current.length\n );\n\n useEffect(() => {\n const usersToRequest = permissions\n .filter(p => p.type === PermissionType.User && !GuildMemberStore.isMember(guild.id, p.id!))\n .map(({ id }) => id);\n\n FluxDispatcher.dispatch({\n type: \"GUILD_MEMBERS_REQUEST\",\n guildIds: [guild.id],\n userIds: usersToRequest\n });\n }, []);\n\n const [selectedItemIndex, selectItem] = useState(0);\n const selectedItem = permissions[selectedItemIndex];\n\n return (\n \n \n {header} permissions:\n \n \n\n \n {!selectedItem && (\n
\n No permissions to display!\n
\n )}\n\n {selectedItem && (\n
\n
\n {permissions.map((permission, index) => {\n const user = UserStore.getUser(permission.id ?? \"\");\n const role = guild.roles[permission.id ?? \"\"];\n\n return (\n selectItem(index)}\n >\n {\n if ((settings.store as any).unsafeViewAsRole && permission.type === PermissionType.Role)\n ContextMenuApi.openContextMenu(e, () => (\n \n ));\n }}\n >\n {(permission.type === PermissionType.Role || permission.type === PermissionType.Owner) && (\n \n )}\n {permission.type === PermissionType.User && user !== undefined && (\n \n )}\n \n {\n permission.type === PermissionType.Role\n ? role?.name ?? \"Unknown Role\"\n : permission.type === PermissionType.User\n ? (user && getUniqueUsername(user)) ?? \"Unknown User\"\n : (\n \n @owner\n \n \n )\n }\n \n
\n \n );\n })}\n
\n
\n {Object.entries(PermissionsBits).map(([permissionName, bit]) => (\n
\n
\n {(() => {\n const { permissions, overwriteAllow, overwriteDeny } = selectedItem;\n\n if (permissions)\n return (permissions & bit) === bit\n ? PermissionAllowedIcon()\n : PermissionDeniedIcon();\n\n if (overwriteAllow && (overwriteAllow & bit) === bit)\n return PermissionAllowedIcon();\n if (overwriteDeny && (overwriteDeny & bit) === bit)\n return PermissionDeniedIcon();\n\n return PermissionDefaultIcon();\n })()}\n
\n {getPermissionString(permissionName)}\n\n \n {props => }\n \n
\n ))}\n
\n \n )}\n
\n \n );\n}\n\nfunction RoleContextMenu({ guild, roleId, onClose }: { guild: Guild; roleId: string; onClose: () => void; }) {\n return (\n \n {\n const role = guild.roles[roleId];\n if (!role) return;\n\n onClose();\n\n FluxDispatcher.dispatch({\n type: \"IMPERSONATE_UPDATE\",\n guildId: guild.id,\n data: {\n type: \"ROLES\",\n roles: {\n [roleId]: role\n }\n }\n });\n }}\n />\n \n );\n}\n\nconst RolesAndUsersPermissions = ErrorBoundary.wrap(RolesAndUsersPermissionsComponent);\n\nexport default openRolesAndUsersPermissionsModal;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { classNameFactory } from \"@api/Styles\";\nimport { Text, Tooltip, useState } from \"@webpack/common\";\nexport const cl = classNameFactory(\"vc-expandableheader-\");\nimport \"./ExpandableHeader.css\";\n\nexport interface ExpandableHeaderProps {\n onMoreClick?: () => void;\n moreTooltipText?: string;\n onDropDownClick?: (state: boolean) => void;\n defaultState?: boolean;\n headerText: string;\n children: React.ReactNode;\n buttons?: React.ReactNode[];\n}\n\nexport default function ExpandableHeader({ children, onMoreClick, buttons, moreTooltipText, defaultState = false, onDropDownClick, headerText }: ExpandableHeaderProps) {\n const [showContent, setShowContent] = useState(defaultState);\n\n return (\n <>\n
\n \n {headerText}\n \n\n
\n {\n buttons ?? null\n }\n\n {\n onMoreClick && // only show more button if callback is provided\n \n {tooltipProps => (\n \n \n \n \n \n )}\n \n }\n\n\n \n {tooltipProps => (\n {\n setShowContent(v => !v);\n onDropDownClick?.(showContent);\n }}\n >\n \n \n \n \n )}\n \n
\n
\n {showContent && children}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport ExpandableHeader from \"@components/ExpandableHeader\";\nimport { proxyLazy } from \"@utils/lazy\";\nimport { classes } from \"@utils/misc\";\nimport { filters, findBulk } from \"@webpack\";\nimport { i18n, PermissionsBits, Text, Tooltip, useMemo, UserStore } from \"@webpack/common\";\nimport type { Guild, GuildMember } from \"discord-types/general\";\n\nimport { PermissionsSortOrder, settings } from \"..\";\nimport { cl, getPermissionString, getSortedRoles, sortUserRoles } from \"../utils\";\nimport openRolesAndUsersPermissionsModal, { PermissionType, type RoleOrUserPermission } from \"./RolesAndUsersPermissions\";\n\ninterface UserPermission {\n permission: string;\n roleColor: string;\n rolePosition: number;\n}\n\ntype UserPermissions = Array;\n\nconst Classes = proxyLazy(() => {\n const modules = findBulk(\n filters.byProps(\"roles\", \"rolePill\", \"rolePillBorder\"),\n filters.byProps(\"roleCircle\", \"dotBorderBase\", \"dotBorderColor\"),\n filters.byProps(\"roleNameOverflow\", \"root\", \"roleName\", \"roleRemoveButton\")\n );\n\n return Object.assign({}, ...modules);\n}) as Record<\"roles\" | \"rolePill\" | \"rolePillBorder\" | \"desaturateUserColors\" | \"flex\" | \"alignCenter\" | \"justifyCenter\" | \"svg\" | \"background\" | \"dot\" | \"dotBorderColor\" | \"roleCircle\" | \"dotBorderBase\" | \"flex\" | \"alignCenter\" | \"justifyCenter\" | \"wrap\" | \"root\" | \"role\" | \"roleRemoveButton\" | \"roleDot\" | \"roleFlowerStar\" | \"roleRemoveIcon\" | \"roleRemoveIconFocused\" | \"roleVerifiedIcon\" | \"roleName\" | \"roleNameOverflow\" | \"actionButton\" | \"overflowButton\" | \"addButton\" | \"addButtonIcon\" | \"overflowRolesPopout\" | \"overflowRolesPopoutArrowWrapper\" | \"overflowRolesPopoutArrow\" | \"popoutBottom\" | \"popoutTop\" | \"overflowRolesPopoutHeader\" | \"overflowRolesPopoutHeaderIcon\" | \"overflowRolesPopoutHeaderText\" | \"roleIcon\", string>;\n\nfunction UserPermissionsComponent({ guild, guildMember, showBorder }: { guild: Guild; guildMember: GuildMember; showBorder: boolean; }) {\n const stns = settings.use([\"permissionsSortOrder\"]);\n\n const [rolePermissions, userPermissions] = useMemo(() => {\n const userPermissions: UserPermissions = [];\n\n const userRoles = getSortedRoles(guild, guildMember);\n\n const rolePermissions: Array = userRoles.map(role => ({\n type: PermissionType.Role,\n ...role\n }));\n\n if (guild.ownerId === guildMember.userId) {\n rolePermissions.push({\n type: PermissionType.Owner,\n permissions: Object.values(PermissionsBits).reduce((prev, curr) => prev | curr, 0n)\n });\n\n const OWNER = i18n.Messages.GUILD_OWNER || \"Server Owner\";\n userPermissions.push({\n permission: OWNER,\n roleColor: \"var(--primary-300)\",\n rolePosition: Infinity\n });\n }\n\n sortUserRoles(userRoles);\n\n for (const [permission, bit] of Object.entries(PermissionsBits)) {\n for (const { permissions, colorString, position } of userRoles) {\n if ((permissions & bit) === bit) {\n userPermissions.push({\n permission: getPermissionString(permission),\n roleColor: colorString || \"var(--primary-300)\",\n rolePosition: position\n });\n\n break;\n }\n }\n }\n\n userPermissions.sort((a, b) => b.rolePosition - a.rolePosition);\n\n return [rolePermissions, userPermissions];\n }, [stns.permissionsSortOrder]);\n\n const { root, role, roleRemoveButton, roleNameOverflow, roles, rolePill, rolePillBorder, roleCircle, roleName } = Classes;\n\n return (\n \n openRolesAndUsersPermissionsModal(\n rolePermissions,\n guild,\n guildMember.nick || UserStore.getUser(guildMember.userId).username\n )\n }\n defaultState={settings.store.defaultPermissionsDropdownState}\n buttons={[\n (\n {tooltipProps => (\n {\n stns.permissionsSortOrder = stns.permissionsSortOrder === PermissionsSortOrder.HighestRole ? PermissionsSortOrder.LowestRole : PermissionsSortOrder.HighestRole;\n }}\n >\n \n \n \n \n )}\n )\n ]}>\n {userPermissions.length > 0 && (\n
\n {userPermissions.map(({ permission, roleColor }) => (\n
\n
\n \n
\n
\n \n {permission}\n \n
\n
\n ))}\n
\n )}\n \n );\n}\n\nexport default ErrorBoundary.wrap(UserPermissionsComponent, { noop: true });\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { ChannelStore, GuildMemberStore, GuildStore, Menu, PermissionsBits, UserStore } from \"@webpack/common\";\nimport type { Guild, GuildMember } from \"discord-types/general\";\n\nimport openRolesAndUsersPermissionsModal, { PermissionType, RoleOrUserPermission } from \"./components/RolesAndUsersPermissions\";\nimport UserPermissions from \"./components/UserPermissions\";\nimport { getSortedRoles, sortPermissionOverwrites } from \"./utils\";\n\nexport const enum PermissionsSortOrder {\n HighestRole,\n LowestRole\n}\n\nconst enum MenuItemParentType {\n User,\n Channel,\n Guild\n}\n\nexport const settings = definePluginSettings({\n permissionsSortOrder: {\n description: \"The sort method used for defining which role grants an user a certain permission\",\n type: OptionType.SELECT,\n options: [\n { label: \"Highest Role\", value: PermissionsSortOrder.HighestRole, default: true },\n { label: \"Lowest Role\", value: PermissionsSortOrder.LowestRole }\n ],\n },\n defaultPermissionsDropdownState: {\n description: \"Whether the permissions dropdown on user popouts should be open by default\",\n type: OptionType.BOOLEAN,\n default: false,\n }\n});\n\nfunction MenuItem(guildId: string, id?: string, type?: MenuItemParentType) {\n if (type === MenuItemParentType.User && !GuildMemberStore.isMember(guildId, id!)) return null;\n\n return (\n {\n const guild = GuildStore.getGuild(guildId);\n\n let permissions: RoleOrUserPermission[];\n let header: string;\n\n switch (type) {\n case MenuItemParentType.User: {\n const member = GuildMemberStore.getMember(guildId, id!);\n\n permissions = getSortedRoles(guild, member)\n .map(role => ({\n type: PermissionType.Role,\n ...role\n }));\n\n if (guild.ownerId === id) {\n permissions.push({\n type: PermissionType.Owner,\n permissions: Object.values(PermissionsBits).reduce((prev, curr) => prev | curr, 0n)\n });\n }\n\n header = member.nick ?? UserStore.getUser(member.userId).username;\n\n break;\n }\n\n case MenuItemParentType.Channel: {\n const channel = ChannelStore.getChannel(id!);\n\n permissions = sortPermissionOverwrites(Object.values(channel.permissionOverwrites).map(({ id, allow, deny, type }) => ({\n type: type as PermissionType,\n id,\n overwriteAllow: allow,\n overwriteDeny: deny\n })), guildId);\n\n header = channel.name;\n\n break;\n }\n\n default: {\n permissions = Object.values(guild.roles).map(role => ({\n type: PermissionType.Role,\n ...role\n }));\n\n header = guild.name;\n\n break;\n }\n }\n\n openRolesAndUsersPermissionsModal(permissions, guild, header);\n }}\n />\n );\n}\n\nfunction makeContextMenuPatch(childId: string | string[], type?: MenuItemParentType): NavContextMenuPatchCallback {\n return (children, props) => () => {\n if (!props || (type === MenuItemParentType.User && !props.user) || (type === MenuItemParentType.Guild && !props.guild)) return children;\n\n const group = findGroupChildrenByChildId(childId, children);\n\n const item = (() => {\n switch (type) {\n case MenuItemParentType.User:\n return MenuItem(props.guildId, props.user.id, type);\n case MenuItemParentType.Channel:\n return MenuItem(props.guild.id, props.channel.id, type);\n case MenuItemParentType.Guild:\n return MenuItem(props.guild.id);\n default:\n return null;\n }\n })();\n\n if (item == null) return;\n\n if (group)\n group.push(item);\n else if (childId === \"roles\" && props.guildId)\n // \"roles\" may not be present due to the member not having any roles. In that case, add it above \"Copy ID\"\n children.splice(-1, 0, {item});\n };\n}\n\nexport default definePlugin({\n name: \"PermissionsViewer\",\n description: \"View the permissions a user or channel has, and the roles of a server\",\n authors: [Devs.Nuckyz, Devs.Ven],\n settings,\n\n patches: [\n {\n find: \".popularApplicationCommandIds,\",\n replacement: {\n match: /showBorder:(.{0,60})}\\),(?<=guild:(\\i),guildMember:(\\i),.+?)/,\n replace: (m, showBoder, guild, guildMember) => `${m}$self.UserPermissions(${guild},${guildMember},${showBoder}),`\n }\n }\n ],\n\n UserPermissions: (guild: Guild, guildMember: GuildMember | undefined, showBoder: boolean) => !!guildMember && ,\n\n userContextMenuPatch: makeContextMenuPatch(\"roles\", MenuItemParentType.User),\n channelContextMenuPatch: makeContextMenuPatch([\"mute-channel\", \"unmute-channel\"], MenuItemParentType.Channel),\n guildContextMenuPatch: makeContextMenuPatch(\"privacy\", MenuItemParentType.Guild),\n\n start() {\n addContextMenuPatch(\"user-context\", this.userContextMenuPatch);\n addContextMenuPatch(\"channel-context\", this.channelContextMenuPatch);\n addContextMenuPatch([\"guild-context\", \"guild-header-popout\"], this.guildContextMenuPatch);\n },\n\n stop() {\n removeContextMenuPatch(\"user-context\", this.userContextMenuPatch);\n removeContextMenuPatch(\"channel-context\", this.channelContextMenuPatch);\n removeContextMenuPatch([\"guild-context\", \"guild-header-popout\"], this.guildContextMenuPatch);\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ApplicationCommandInputType, ApplicationCommandOptionType, Argument, CommandContext, findOption, sendBotMessage } from \"@api/Commands\";\nimport { Devs } from \"@utils/constants\";\nimport { makeLazy } from \"@utils/lazy\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { UploadHandler, UserUtils } from \"@webpack/common\";\nimport { applyPalette, GIFEncoder, quantize } from \"gifenc\";\n\nconst DRAFT_TYPE = 0;\nconst DEFAULT_DELAY = 20;\nconst DEFAULT_RESOLUTION = 128;\nconst FRAMES = 10;\n\nconst getFrames = makeLazy(() => Promise.all(\n Array.from(\n { length: FRAMES },\n (_, i) => loadImage(`https://raw.githubusercontent.com/VenPlugs/petpet/main/frames/pet${i}.gif`)\n ))\n);\n\nconst UploadStore = findByPropsLazy(\"getUploads\");\n\nfunction loadImage(source: File | string) {\n const isFile = source instanceof File;\n const url = isFile ? URL.createObjectURL(source) : source;\n\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => {\n if (isFile)\n URL.revokeObjectURL(url);\n resolve(img);\n };\n img.onerror = (event, _source, _lineno, _colno, err) => reject(err || event);\n img.crossOrigin = \"Anonymous\";\n img.src = url;\n });\n}\n\nasync function resolveImage(options: Argument[], ctx: CommandContext, noServerPfp: boolean): Promise {\n for (const opt of options) {\n switch (opt.name) {\n case \"image\":\n const upload = UploadStore.getUploads(ctx.channel.id, DRAFT_TYPE)[0];\n if (upload) {\n if (!upload.isImage) throw \"Upload is not an image\";\n return upload.item.file;\n }\n break;\n case \"url\":\n return opt.value;\n case \"user\":\n try {\n const user = await UserUtils.getUser(opt.value);\n return user.getAvatarURL(noServerPfp ? void 0 : ctx.guild?.id, 2048).replace(/\\?size=\\d+$/, \"?size=2048\");\n } catch (err) {\n console.error(\"[petpet] Failed to fetch user\\n\", err);\n throw \"Failed to fetch user. Check the console for more info.\";\n }\n }\n }\n return null;\n}\n\nexport default definePlugin({\n name: \"petpet\",\n description: \"Adds a /petpet slash command to create headpet gifs from any image\",\n authors: [Devs.Ven],\n dependencies: [\"CommandsAPI\"],\n commands: [\n {\n inputType: ApplicationCommandInputType.BUILT_IN,\n name: \"petpet\",\n description: \"Create a petpet gif. You can only specify one of the image options\",\n options: [\n {\n name: \"delay\",\n description: \"The delay between each frame. Defaults to 20.\",\n type: ApplicationCommandOptionType.INTEGER\n },\n {\n name: \"resolution\",\n description: \"Resolution for the gif. Defaults to 120. If you enter an insane number and it freezes Discord that's your fault.\",\n type: ApplicationCommandOptionType.INTEGER\n },\n {\n name: \"image\",\n description: \"Image attachment to use\",\n type: ApplicationCommandOptionType.ATTACHMENT\n },\n {\n name: \"url\",\n description: \"URL to fetch image from\",\n type: ApplicationCommandOptionType.STRING\n },\n {\n name: \"user\",\n description: \"User whose avatar to use as image\",\n type: ApplicationCommandOptionType.USER\n },\n {\n name: \"no-server-pfp\",\n description: \"Use the normal avatar instead of the server specific one when using the 'user' option\",\n type: ApplicationCommandOptionType.BOOLEAN\n }\n ],\n execute: async (opts, cmdCtx) => {\n const frames = await getFrames();\n\n const noServerPfp = findOption(opts, \"no-server-pfp\", false);\n try {\n var url = await resolveImage(opts, cmdCtx, noServerPfp);\n if (!url) throw \"No Image specified!\";\n } catch (err) {\n sendBotMessage(cmdCtx.channel.id, {\n content: String(err),\n });\n return;\n }\n\n const avatar = await loadImage(url);\n\n const delay = findOption(opts, \"delay\", DEFAULT_DELAY);\n const resolution = findOption(opts, \"resolution\", DEFAULT_RESOLUTION);\n\n const gif = GIFEncoder();\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = resolution;\n const ctx = canvas.getContext(\"2d\")!;\n\n for (let i = 0; i < FRAMES; i++) {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n const j = i < FRAMES / 2 ? i : FRAMES - i;\n const width = 0.8 + j * 0.02;\n const height = 0.8 - j * 0.05;\n const offsetX = (1 - width) * 0.5 + 0.1;\n const offsetY = 1 - height - 0.08;\n\n ctx.drawImage(avatar, offsetX * resolution, offsetY * resolution, width * resolution, height * resolution);\n ctx.drawImage(frames[i], 0, 0, resolution, resolution);\n\n const { data } = ctx.getImageData(0, 0, resolution, resolution);\n const palette = quantize(data, 256);\n const index = applyPalette(data, palette);\n\n gif.writeFrame(index, resolution, resolution, {\n transparent: true,\n palette,\n delay,\n });\n }\n\n gif.finish();\n const file = new File([gif.bytesView()], \"petpet.gif\", { type: \"image/gif\" });\n // Immediately after the command finishes, Discord clears all input, including pending attachments.\n // Thus, setTimeout is needed to make this execute after Discord cleared the input\n setTimeout(() => UploadHandler.promptToUpload([file], cmdCtx.channel, DRAFT_TYPE), 10);\n },\n },\n ]\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport \"./styles.css\";\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { React, Tooltip } from \"@webpack/common\";\n\nconst settings = definePluginSettings({\n loop: {\n description: \"Whether to make the PiP video loop or not\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: false\n }\n});\n\nexport default definePlugin({\n name: \"PictureInPicture\",\n description: \"Adds picture in picture to videos (next to the Download button)\",\n authors: [Devs.Lumap],\n settings,\n patches: [\n {\n find: \".nonMediaAttachment]\",\n replacement: {\n match: /\\.nonMediaAttachment\\]:!(\\i).{0,10}children:\\[(\\S)/,\n replace: \"$&,$1&&$2&&$self.renderPiPButton(),\"\n },\n },\n ],\n\n renderPiPButton: ErrorBoundary.wrap(() => {\n return (\n \n {tooltipProps => (\n {\n const video = e.currentTarget.parentNode!.parentNode!.querySelector(\"video\")!;\n const videoClone = document.body.appendChild(video.cloneNode(true)) as HTMLVideoElement;\n\n videoClone.loop = settings.store.loop;\n videoClone.style.display = \"none\";\n videoClone.onleavepictureinpicture = () => videoClone.remove();\n\n function launchPiP() {\n videoClone.currentTime = video.currentTime;\n videoClone.requestPictureInPicture();\n video.pause();\n videoClone.play();\n }\n\n if (videoClone.readyState === 4 /* HAVE_ENOUGH_DATA */)\n launchPiP();\n else\n videoClone.onloadedmetadata = launchPiP;\n }}\n >\n \n \n \n \n )}\n \n );\n }, { noop: true })\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings, Settings, useSettings } from \"@api/Settings\";\nimport { OptionType } from \"@utils/types\";\nimport { findStoreLazy } from \"@webpack\";\n\nexport const enum PinOrder {\n LastMessage,\n Custom\n}\n\nexport const settings = definePluginSettings({\n pinOrder: {\n type: OptionType.SELECT,\n description: \"Which order should pinned DMs be displayed in?\",\n options: [\n { label: \"Most recent message\", value: PinOrder.LastMessage, default: true },\n { label: \"Custom (right click channels to reorder)\", value: PinOrder.Custom }\n ]\n }\n});\n\nconst PrivateChannelSortStore = findStoreLazy(\"PrivateChannelSortStore\");\n\nexport let snapshotArray: string[];\nlet snapshot: Set | undefined;\n\nconst getArray = () => (Settings.plugins.PinDMs.pinnedDMs || void 0)?.split(\",\") as string[] | undefined;\nconst save = (pins: string[]) => {\n snapshot = void 0;\n Settings.plugins.PinDMs.pinnedDMs = pins.join(\",\");\n};\nconst takeSnapshot = () => {\n snapshotArray = getArray() ?? [];\n return snapshot = new Set(snapshotArray);\n};\nconst requireSnapshot = () => snapshot ?? takeSnapshot();\n\nexport function usePinnedDms() {\n useSettings([\"plugins.PinDMs.pinnedDMs\"]);\n\n return requireSnapshot();\n}\n\nexport function isPinned(id: string) {\n return requireSnapshot().has(id);\n}\n\nexport function togglePin(id: string) {\n const snapshot = requireSnapshot();\n if (!snapshot.delete(id)) {\n snapshot.add(id);\n }\n\n save([...snapshot]);\n}\n\nexport function sortedSnapshot() {\n requireSnapshot();\n if (settings.store.pinOrder === PinOrder.LastMessage)\n return PrivateChannelSortStore.getPrivateChannelIds().filter(isPinned);\n\n return snapshotArray;\n}\n\nexport function getPinAt(idx: number) {\n return sortedSnapshot()[idx];\n}\n\nexport function movePin(id: string, direction: -1 | 1) {\n const pins = getArray()!;\n const a = pins.indexOf(id);\n const b = a + direction;\n\n [pins[a], pins[b]] = [pins[b], pins[a]];\n\n save(pins);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { Menu } from \"@webpack/common\";\n\nimport { isPinned, movePin, PinOrder, settings, snapshotArray, togglePin } from \"./settings\";\n\nfunction PinMenuItem(channelId: string) {\n const pinned = isPinned(channelId);\n const canMove = pinned && settings.store.pinOrder === PinOrder.Custom;\n\n return (\n <>\n togglePin(channelId)}\n />\n {canMove && snapshotArray[0] !== channelId && (\n movePin(channelId, -1)}\n />\n )}\n {canMove && snapshotArray[snapshotArray.length - 1] !== channelId && (\n movePin(channelId, +1)}\n />\n )}\n \n );\n}\n\nconst GroupDMContext: NavContextMenuPatchCallback = (children, props) => () => {\n const container = findGroupChildrenByChildId(\"leave-channel\", children);\n if (container)\n container.unshift(PinMenuItem(props.channel.id));\n};\n\nconst UserContext: NavContextMenuPatchCallback = (children, props) => () => {\n const container = findGroupChildrenByChildId(\"close-dm\", children);\n if (container) {\n const idx = container.findIndex(c => c?.props?.id === \"close-dm\");\n container.splice(idx, 0, PinMenuItem(props.channel.id));\n }\n};\n\nexport function addContextMenus() {\n addContextMenuPatch(\"gdm-context\", GroupDMContext);\n addContextMenuPatch(\"user-context\", UserContext);\n}\n\nexport function removeContextMenus() {\n removeContextMenuPatch(\"gdm-context\", GroupDMContext);\n removeContextMenuPatch(\"user-context\", UserContext);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { Channel } from \"discord-types/general\";\n\nimport { addContextMenus, removeContextMenus } from \"./contextMenus\";\nimport { getPinAt, isPinned, settings, snapshotArray, sortedSnapshot, usePinnedDms } from \"./settings\";\n\nexport default definePlugin({\n name: \"PinDMs\",\n description: \"Allows you to pin private channels to the top of your DM list. To pin/unpin or reorder pins, right click DMs\",\n authors: [Devs.Ven, Devs.Strencher],\n\n settings,\n\n start: addContextMenus,\n stop: removeContextMenus,\n\n usePinCount(channelIds: string[]) {\n const pinnedDms = usePinnedDms();\n // See comment on 2nd patch for reasoning\n return channelIds.length ? [pinnedDms.size] : [];\n },\n\n getChannel(channels: Record, idx: number) {\n return channels[getPinAt(idx)];\n },\n\n isPinned,\n getSnapshot: sortedSnapshot,\n\n getScrollOffset(channelId: string, rowHeight: number, padding: number, preRenderedChildren: number, originalOffset: number) {\n if (!isPinned(channelId))\n return (\n (rowHeight + padding) * 2 // header\n + rowHeight * snapshotArray.length // pins\n + originalOffset // original pin offset minus pins\n );\n\n return rowHeight * (snapshotArray.indexOf(channelId) + preRenderedChildren) + padding;\n },\n\n patches: [\n // Patch DM list\n {\n find: \".privateChannelsHeaderContainer,\",\n replacement: [\n {\n // filter Discord's privateChannelIds list to remove pins, and pass\n // pinCount as prop. This needs to be here so that the entire DM list receives\n // updates on pin/unpin\n match: /(?<=\\i,{channels:\\i,)privateChannelIds:(\\i),/,\n replace: \"privateChannelIds:$1.filter(c=>!$self.isPinned(c)),pinCount:$self.usePinCount($1),\"\n },\n {\n // sections is an array of numbers, where each element is a section and\n // the number is the amount of rows. Add our pinCount in second place\n // - Section 1: buttons for pages like Friends & Library\n // - Section 2: our pinned dms\n // - Section 3: the normal dm list\n match: /(?<=renderRow:this\\.renderRow,)sections:\\[\\i,/,\n // For some reason, adding our sections when no private channels are ready yet\n // makes DMs infinitely load. Thus usePinCount returns either a single element\n // array with the count, or an empty array. Due to spreading, only in the former\n // case will an element be added to the outer array\n // Thanks for the fix, Strencher!\n replace: \"$&...this.props.pinCount??[],\"\n },\n {\n // Patch renderSection (renders the header) to set the text to \"Pinned DMs\" instead of \"Direct Messages\"\n // lookbehind is used to lookup parameter name. We could use arguments[0], but\n // if children ever is wrapped in an iife, it will break\n match: /children:(\\i\\.\\i\\.Messages.DIRECT_MESSAGES)(?<=renderSection=(\\i)=>{.+?)/,\n replace: \"children:$2.section===1?'Pinned DMs':$1\"\n },\n {\n // Patch channel lookup inside renderDM\n // channel=channels[channelIds[row]];\n match: /(?<=renderDM=\\((\\i),(\\i)\\)=>{.*?this.state,\\i=\\i\\[\\i\\],\\i=)((\\i)\\[\\i\\]);/,\n // section 1 is us, manually get our own channel\n // section === 1 ? getChannel(channels, row) : channels[channelIds[row]];\n replace: \"$1===1?$self.getChannel($4,$2):$3;\"\n },\n {\n // Fix getRowHeight's check for whether this is the DMs section\n // DMS (inlined) === section\n match: /(?<=getRowHeight=\\(.{2,50}?)1===\\i/,\n // DMS (inlined) === section - 1\n replace: \"$&-1\"\n },\n {\n // Override scrollToChannel to properly account for pinned channels\n match: /(?<=scrollTo\\(\\{to:\\i\\}\\):\\(\\i\\+=)(\\d+)\\*\\(.+?(?=,)/,\n replace: \"$self.getScrollOffset(arguments[0],$1,this.props.padding,this.state.preRenderedChildren,$&)\"\n }\n ]\n },\n\n // Fix Alt Up/Down navigation\n {\n find: \".Routes.APPLICATION_STORE&&\",\n replacement: {\n // channelIds = __OVERLAY__ ? stuff : [...getStaticPaths(),...channelIds)]\n match: /(?<=\\i=__OVERLAY__\\?\\i:\\[\\.\\.\\.\\i\\(\\),\\.\\.\\.)\\i/,\n // ....concat(pins).concat(toArray(channelIds).filter(c => !isPinned(c)))\n replace: \"$self.getSnapshot().concat($&.filter(c=>!$self.isPinned(c)))\"\n }\n },\n // fix alt+shift+up/down\n {\n find: \".getFlattenedGuildIds()],\",\n replacement: {\n match: /(?<=\\i===\\i\\.ME\\?)\\i\\.\\i\\.getPrivateChannelIds\\(\\)/,\n replace: \"$self.getSnapshot().concat($&.filter(c=>!$self.isPinned(c)))\"\n }\n },\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"PlainFolderIcon\",\n description: \"Doesn't show the small guild icons in folders\",\n authors: [Devs.botato],\n patches: [{\n find: \".expandedFolderIconWrapper\",\n replacement: [{\n match: /\\(\\w\\|\\|\\w\\)&&(\\(.{0,40}\\(.{1,3}\\.animated)/,\n replace: \"$1\",\n }]\n }]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Channel, User } from \"discord-types/general/index.js\";\n\ninterface DecoratorProps {\n activities: any[];\n channel: Channel;\n /**\n * Only for DM members\n */\n channelName?: string;\n /**\n * Only for server members\n */\n currentUser?: User;\n guildId?: string;\n isMobile: boolean;\n isOwner?: boolean;\n isTyping: boolean;\n selected: boolean;\n status: string;\n user: User;\n [key: string]: any;\n}\nexport type Decorator = (props: DecoratorProps) => JSX.Element | null;\ntype OnlyIn = \"guilds\" | \"dms\";\n\nexport const decorators = new Map();\n\nexport function addDecorator(identifier: string, decorator: Decorator, onlyIn?: OnlyIn) {\n decorators.set(identifier, { decorator, onlyIn });\n}\n\nexport function removeDecorator(identifier: string) {\n decorators.delete(identifier);\n}\n\nexport function __getDecorators(props: DecoratorProps): (JSX.Element | null)[] {\n const isInGuild = !!(props.guildId);\n return Array.from(decorators.values(), decoratorObj => {\n const { decorator, onlyIn } = decoratorObj;\n // this can most likely be done cleaner\n if (!onlyIn || (onlyIn === \"guilds\" && isInGuild) || (onlyIn === \"dms\" && !isInGuild)) {\n return decorator(props);\n }\n return null;\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Channel, Message } from \"discord-types/general/index.js\";\n\ninterface DecorationProps {\n author: {\n /**\n * Will be username if the user has no nickname\n */\n nick: string;\n iconRoleId: string;\n guildMemberAvatar: string;\n colorRoleName: string;\n colorString: string;\n };\n channel: Channel;\n compact: boolean;\n decorations: {\n /**\n * Element for the [BOT] tag if there is one\n */\n 0: JSX.Element | null;\n /**\n * Other decorations (including ones added with this api)\n */\n 1: JSX.Element[];\n };\n message: Message;\n [key: string]: any;\n}\nexport type Decoration = (props: DecorationProps) => JSX.Element | null;\n\nexport const decorations = new Map();\n\nexport function addDecoration(identifier: string, decoration: Decoration) {\n decorations.set(identifier, decoration);\n}\n\nexport function removeDecoration(identifier: string) {\n decorations.delete(identifier);\n}\n\nexport function __addDecorationsToMessage(props: DecorationProps): (JSX.Element | null)[] {\n return [...decorations.values()].map(decoration => {\n return decoration(props);\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addBadge, BadgePosition, ProfileBadge, removeBadge } from \"@api/Badges\";\nimport { addDecorator, removeDecorator } from \"@api/MemberListDecorators\";\nimport { addDecoration, removeDecoration } from \"@api/MessageDecorations\";\nimport { Settings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy, findStoreLazy } from \"@webpack\";\nimport { PresenceStore, Tooltip, UserStore } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\n\nconst SessionsStore = findStoreLazy(\"SessionsStore\");\n\nfunction Icon(path: string, opts?: { viewBox?: string; width?: number; height?: number; }) {\n return ({ color, tooltip, small }: { color: string; tooltip: string; small: boolean; }) => (\n \n {(tooltipProps: any) => (\n \n \n \n )}\n \n );\n}\n\nconst Icons = {\n desktop: Icon(\"M4 2.5c-1.103 0-2 .897-2 2v11c0 1.104.897 2 2 2h7v2H7v2h10v-2h-4v-2h7c1.103 0 2-.896 2-2v-11c0-1.103-.897-2-2-2H4Zm16 2v9H4v-9h16Z\"),\n web: Icon(\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2Zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93Zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39Z\"),\n mobile: Icon(\"M 187 0 L 813 0 C 916.277 0 1000 83.723 1000 187 L 1000 1313 C 1000 1416.277 916.277 1500 813 1500 L 187 1500 C 83.723 1500 0 1416.277 0 1313 L 0 187 C 0 83.723 83.723 0 187 0 Z M 125 1000 L 875 1000 L 875 250 L 125 250 Z M 500 1125 C 430.964 1125 375 1180.964 375 1250 C 375 1319.036 430.964 1375 500 1375 C 569.036 1375 625 1319.036 625 1250 C 625 1180.964 569.036 1125 500 1125 Z\", { viewBox: \"0 0 1000 1500\", height: 17, width: 17 }),\n console: Icon(\"M14.8 2.7 9 3.1V47h3.3c1.7 0 6.2.3 10 .7l6.7.6V2l-4.2.2c-2.4.1-6.9.3-10 .5zm1.8 6.4c1 1.7-1.3 3.6-2.7 2.2C12.7 10.1 13.5 8 15 8c.5 0 1.2.5 1.6 1.1zM16 33c0 6-.4 10-1 10s-1-4-1-10 .4-10 1-10 1 4 1 10zm15-8v23.3l3.8-.7c2-.3 4.7-.6 6-.6H43V3h-2.2c-1.3 0-4-.3-6-.6L31 1.7V25z\", { viewBox: \"0 0 50 50\" }),\n};\ntype Platform = keyof typeof Icons;\n\nconst StatusUtils = findByPropsLazy(\"getStatusColor\", \"StatusTypes\");\n\nconst PlatformIcon = ({ platform, status, small }: { platform: Platform, status: string; small: boolean; }) => {\n const tooltip = platform[0].toUpperCase() + platform.slice(1);\n const Icon = Icons[platform] ?? Icons.desktop;\n\n return ;\n};\n\nconst getStatus = (id: string): Record => PresenceStore.getState()?.clientStatuses?.[id];\n\nconst PlatformIndicator = ({ user, wantMargin = true, wantTopMargin = false, small = false }: { user: User; wantMargin?: boolean; wantTopMargin?: boolean; small?: boolean; }) => {\n if (!user || user.bot) return null;\n\n if (user.id === UserStore.getCurrentUser().id) {\n const sessions = SessionsStore.getSessions();\n if (typeof sessions !== \"object\") return null;\n const sortedSessions = Object.values(sessions).sort(({ status: a }: any, { status: b }: any) => {\n if (a === b) return 0;\n if (a === \"online\") return 1;\n if (b === \"online\") return -1;\n if (a === \"idle\") return 1;\n if (b === \"idle\") return -1;\n return 0;\n });\n\n const ownStatus = Object.values(sortedSessions).reduce((acc: any, curr: any) => {\n if (curr.clientInfo.client !== \"unknown\")\n acc[curr.clientInfo.client] = curr.status;\n return acc;\n }, {});\n\n const { clientStatuses } = PresenceStore.getState();\n clientStatuses[UserStore.getCurrentUser().id] = ownStatus;\n }\n\n const status = PresenceStore.getState()?.clientStatuses?.[user.id] as Record;\n if (!status) return null;\n\n const icons = Object.entries(status).map(([platform, status]) => (\n \n ));\n\n if (!icons.length) return null;\n\n return (\n \n {icons}\n \n );\n};\n\nconst badge: ProfileBadge = {\n component: p => ,\n position: BadgePosition.START,\n shouldShow: userInfo => !!Object.keys(getStatus(userInfo.user.id) ?? {}).length,\n key: \"indicator\"\n};\n\nconst indicatorLocations = {\n list: {\n description: \"In the member list\",\n onEnable: () => addDecorator(\"platform-indicator\", props =>\n \n \n \n ),\n onDisable: () => removeDecorator(\"platform-indicator\")\n },\n badges: {\n description: \"In user profiles, as badges\",\n onEnable: () => addBadge(badge),\n onDisable: () => removeBadge(badge)\n },\n messages: {\n description: \"Inside messages\",\n onEnable: () => addDecoration(\"platform-indicator\", props =>\n \n \n \n ),\n onDisable: () => removeDecoration(\"platform-indicator\")\n }\n};\n\nexport default definePlugin({\n name: \"PlatformIndicators\",\n description: \"Adds platform indicators (Desktop, Mobile, Web...) to users\",\n authors: [Devs.kemo, Devs.TheSun, Devs.Nuckyz, Devs.Ven],\n dependencies: [\"MessageDecorationsAPI\", \"MemberListDecoratorsAPI\"],\n\n start() {\n const settings = Settings.plugins.PlatformIndicators;\n const { displayMode } = settings;\n\n // transfer settings from the old ones, which had a select menu instead of booleans\n if (displayMode) {\n if (displayMode !== \"both\") settings[displayMode] = true;\n else {\n settings.list = true;\n settings.badges = true;\n }\n settings.messages = true;\n delete settings.displayMode;\n }\n\n Object.entries(indicatorLocations).forEach(([key, value]) => {\n if (settings[key]) value.onEnable();\n });\n },\n\n stop() {\n Object.entries(indicatorLocations).forEach(([_, value]) => {\n value.onDisable();\n });\n },\n\n patches: [\n {\n find: \".Masks.STATUS_ONLINE_MOBILE\",\n predicate: () => Settings.plugins.PlatformIndicators.colorMobileIndicator,\n replacement: [\n {\n // Return the STATUS_ONLINE_MOBILE mask if the user is on mobile, no matter the status\n match: /\\.STATUS_TYPING;switch(?=.+?(if\\(\\i\\)return \\i\\.\\i\\.Masks\\.STATUS_ONLINE_MOBILE))/,\n replace: \".STATUS_TYPING;$1;switch\"\n },\n {\n // Return the STATUS_ONLINE_MOBILE mask if the user is on mobile, no matter the status\n match: /switch\\(\\i\\)\\{case \\i\\.\\i\\.ONLINE:(if\\(\\i\\)return\\{[^}]+\\})/,\n replace: \"$1;$&\"\n }\n ]\n },\n {\n find: \".AVATAR_STATUS_MOBILE_16;\",\n predicate: () => Settings.plugins.PlatformIndicators.colorMobileIndicator,\n replacement: [\n {\n // Return the AVATAR_STATUS_MOBILE size mask if the user is on mobile, no matter the status\n match: /\\i===\\i\\.\\i\\.ONLINE&&(?=.{0,70}\\.AVATAR_STATUS_MOBILE_16;)/,\n replace: \"\"\n },\n {\n // Fix sizes for mobile indicators which aren't online\n match: /(?<=\\(\\i\\.status,)(\\i)(?=,(\\i),\\i\\))/,\n replace: (_, userStatus, isMobile) => `${isMobile}?\"online\":${userStatus}`\n },\n {\n // Make isMobile true no matter the status\n match: /(?<=\\i&&!\\i)&&\\i===\\i\\.\\i\\.ONLINE/,\n replace: \"\"\n }\n ]\n },\n {\n find: \"}isMobileOnline(\",\n predicate: () => Settings.plugins.PlatformIndicators.colorMobileIndicator,\n replacement: {\n // Make isMobileOnline return true no matter what is the user status\n match: /(?<=\\i\\[\\i\\.\\i\\.MOBILE\\])===\\i\\.\\i\\.ONLINE/,\n replace: \"!= null\"\n }\n }\n ],\n\n options: {\n ...Object.fromEntries(\n Object.entries(indicatorLocations).map(([key, value]) => {\n return [key, {\n type: OptionType.BOOLEAN,\n description: `Show indicators ${value.description.toLowerCase()}`,\n // onChange doesn't give any way to know which setting was changed, so restart required\n restartNeeded: true,\n default: true\n }];\n })\n ),\n colorMobileIndicator: {\n type: OptionType.BOOLEAN,\n description: \"Whether to make the mobile indicator match the color of the user status.\",\n default: true,\n restartNeeded: true\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { generateId, sendBotMessage } from \"@api/Commands\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { Button, ButtonLooks, ButtonWrapperClasses, DraftStore, DraftType, SelectedChannelStore, Tooltip, UserStore, useStateFromStores } from \"@webpack/common\";\nimport { MessageAttachment } from \"discord-types/general\";\n\ninterface Props {\n type: {\n analyticsName: string;\n isEmpty: boolean;\n attachments: boolean;\n };\n}\n\nconst UploadStore = findByPropsLazy(\"getUploads\");\n\nconst getDraft = (channelId: string) => DraftStore.getDraft(channelId, DraftType.ChannelMessage);\n\n\nconst getImageBox = (url: string): Promise<{ width: number, height: number; } | null> =>\n new Promise(res => {\n const img = new Image();\n img.onload = () =>\n res({ width: img.width, height: img.height });\n\n img.onerror = () =>\n res(null);\n\n img.src = url;\n });\n\n\nconst getAttachments = async (channelId: string) =>\n await Promise.all(\n UploadStore.getUploads(channelId, DraftType.ChannelMessage)\n .map(async (upload: any) => {\n const { isImage, filename, spoiler, item: { file } } = upload;\n const url = URL.createObjectURL(file);\n const attachment: MessageAttachment = {\n id: generateId(),\n filename: spoiler ? \"SPOILER_\" + filename : filename,\n // weird eh? if i give it the normal content type the preview doenst work\n content_type: undefined,\n size: await upload.getSize(),\n spoiler,\n // discord adds query params to the url, so we need to add a hash to prevent that\n url: url + \"#\",\n proxy_url: url + \"#\",\n };\n\n if (isImage) {\n const box = await getImageBox(url);\n if (!box) return attachment;\n\n attachment.width = box.width;\n attachment.height = box.height;\n }\n\n return attachment;\n })\n );\n\n\nexport function PreviewButton(chatBoxProps: Props) {\n const { isEmpty, attachments } = chatBoxProps.type;\n\n const channelId = SelectedChannelStore.getChannelId();\n const draft = useStateFromStores([DraftStore], () => getDraft(channelId));\n\n if (chatBoxProps.type.analyticsName !== \"normal\") return null;\n\n const hasAttachments = attachments && UploadStore.getUploads(channelId, DraftType.ChannelMessage).length > 0;\n const hasContent = !isEmpty && draft?.length > 0;\n\n if (!hasContent && !hasAttachments) return null;\n\n return (\n \n {tooltipProps => (\n \n sendBotMessage(\n channelId,\n {\n content: getDraft(channelId),\n author: UserStore.getCurrentUser(),\n attachments: hasAttachments ? await getAttachments(channelId) : undefined,\n }\n )}\n size=\"\"\n look={ButtonLooks.BLANK}\n innerClassName={ButtonWrapperClasses.button}\n style={{ padding: \"0 2px\", height: \"100%\" }}\n >\n
\n \n
\n \n )}\n
\n );\n\n}\n\nexport default definePlugin({\n name: \"PreviewMessage\",\n description: \"Lets you preview your message before sending it.\",\n authors: [Devs.Aria],\n patches: [\n {\n find: \"ChannelTextAreaButtons\",\n replacement: {\n match: /(\\i)\\.push.{1,30}disabled:(\\i),.{1,20}\\},\"gift\"\\)\\)/,\n replace: \"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()\",\n }\n },\n ],\n\n chatBarIcon: ErrorBoundary.wrap(PreviewButton, { noop: true }),\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Link } from \"@components/Link\";\nimport { Forms, React } from \"@webpack/common\";\n\nexport default function PronounsAboutComponent() {\n return (\n \n More Information\n To add your own pronouns, visit{\" \"}\n pronoundb.org\n \n \n \n The two pronoun formats are lowercase and capitalized. Example:\n
    \n
  • Lowercase: they/them
  • \n
  • Capitalized: They/Them
  • \n
\n Text like \"Ask me my pronouns\" or \"Any pronouns\" will always be capitalized.

\n You can also configure whether or not to display pronouns for the current user (since you probably already know them)\n
\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { OptionType } from \"@utils/types\";\n\nimport { PronounsFormat, PronounSource } from \"./pronoundbUtils\";\n\nexport const settings = definePluginSettings({\n pronounsFormat: {\n type: OptionType.SELECT,\n description: \"The format for pronouns to appear in chat\",\n options: [\n {\n label: \"Lowercase\",\n value: PronounsFormat.Lowercase,\n default: true\n },\n {\n label: \"Capitalized\",\n value: PronounsFormat.Capitalized\n }\n ]\n },\n pronounSource: {\n type: OptionType.SELECT,\n description: \"Where to source pronouns from\",\n options: [\n {\n label: \"Prefer PronounDB, fall back to Discord\",\n value: PronounSource.PreferPDB,\n default: true\n },\n {\n label: \"Prefer Discord, fall back to PronounDB (might lead to inconsistency between pronouns in chat and profile)\",\n value: PronounSource.PreferDiscord\n }\n ]\n },\n showSelf: {\n type: OptionType.BOOLEAN,\n description: \"Enable or disable showing pronouns for the current user\",\n default: true\n },\n showInMessages: {\n type: OptionType.BOOLEAN,\n description: \"Show in messages\",\n default: true\n },\n showInProfile: {\n type: OptionType.BOOLEAN,\n description: \"Show in profile\",\n default: true\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport interface UserProfileProps {\n userId: string;\n}\n\nexport interface UserProfilePronounsProps {\n currentPronouns: string | null;\n hidePersonalInformation: boolean;\n}\n\nexport interface PronounsResponse {\n [id: string]: PronounCode;\n}\n\nexport type PronounCode = keyof typeof PronounMapping;\n\nexport const PronounMapping = {\n hh: \"He/Him\",\n hi: \"He/It\",\n hs: \"He/She\",\n ht: \"He/They\",\n ih: \"It/Him\",\n ii: \"It/Its\",\n is: \"It/She\",\n it: \"It/They\",\n shh: \"She/He\",\n sh: \"She/Her\",\n si: \"She/It\",\n st: \"She/They\",\n th: \"They/He\",\n ti: \"They/It\",\n ts: \"They/She\",\n tt: \"They/Them\",\n any: \"Any pronouns\",\n other: \"Other pronouns\",\n ask: \"Ask me my pronouns\",\n avoid: \"Avoid pronouns, use my name\",\n unspecified: \"Unspecified\"\n} as const;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { VENCORD_USER_AGENT } from \"@utils/constants\";\nimport { debounce } from \"@utils/debounce\";\nimport { getCurrentChannel } from \"@utils/discord\";\nimport { useAwaiter } from \"@utils/react\";\nimport { UserProfileStore, UserStore } from \"@webpack/common\";\n\nimport { settings } from \"./settings\";\nimport { PronounCode, PronounMapping, PronounsResponse } from \"./types\";\n\ntype PronounsWithSource = [string | null, string];\nconst EmptyPronouns: PronounsWithSource = [null, \"\"];\n\nexport const enum PronounsFormat {\n Lowercase = \"LOWERCASE\",\n Capitalized = \"CAPITALIZED\"\n}\n\nexport const enum PronounSource {\n PreferPDB,\n PreferDiscord\n}\n\n// A map of cached pronouns so the same request isn't sent twice\nconst cache: Record = {};\n// A map of ids and callbacks that should be triggered on fetch\nconst requestQueue: Record void)[]> = {};\n\n// Executes all queued requests and calls their callbacks\nconst bulkFetch = debounce(async () => {\n const ids = Object.keys(requestQueue);\n const pronouns = await bulkFetchPronouns(ids);\n for (const id of ids) {\n // Call all callbacks for the id\n requestQueue[id]?.forEach(c => c(pronouns[id]));\n delete requestQueue[id];\n }\n});\n\nfunction getDiscordPronouns(id: string, useGlobalProfile: boolean = false) {\n const globalPronouns = UserProfileStore.getUserProfile(id)?.pronouns;\n\n if (useGlobalProfile) return globalPronouns;\n\n return (\n UserProfileStore.getGuildMemberProfile(id, getCurrentChannel()?.guild_id)?.pronouns\n || globalPronouns\n );\n}\n\nexport function useFormattedPronouns(id: string, useGlobalProfile: boolean = false): PronounsWithSource {\n // Discord is so stupid you can put tons of newlines in pronouns\n const discordPronouns = getDiscordPronouns(id, useGlobalProfile)?.trim().replace(NewLineRe, \" \");\n\n const [result] = useAwaiter(() => fetchPronouns(id), {\n fallbackValue: getCachedPronouns(id),\n onError: e => console.error(\"Fetching pronouns failed: \", e)\n });\n\n if (settings.store.pronounSource === PronounSource.PreferDiscord && discordPronouns)\n return [discordPronouns, \"Discord\"];\n\n if (result && result !== \"unspecified\")\n return [formatPronouns(result), \"PronounDB\"];\n\n return [discordPronouns, \"Discord\"];\n}\n\nexport function useProfilePronouns(id: string, useGlobalProfile: boolean = false): PronounsWithSource {\n const pronouns = useFormattedPronouns(id, useGlobalProfile);\n\n if (!settings.store.showInProfile) return EmptyPronouns;\n if (!settings.store.showSelf && id === UserStore.getCurrentUser().id) return EmptyPronouns;\n\n return pronouns;\n}\n\n\nconst NewLineRe = /\\n+/g;\n\n// Gets the cached pronouns, if you're too impatient for a promise!\nexport function getCachedPronouns(id: string): string | null {\n const cached = cache[id];\n if (cached && cached !== \"unspecified\") return cached;\n\n return cached || null;\n}\n\n// Fetches the pronouns for one id, returning a promise that resolves if it was cached, or once the request is completed\nexport function fetchPronouns(id: string): Promise {\n return new Promise(res => {\n const cached = getCachedPronouns(id);\n if (cached) return res(cached);\n\n // If there is already a request added, then just add this callback to it\n if (id in requestQueue) return requestQueue[id].push(res);\n\n // If not already added, then add it and call the debounced function to make sure the request gets executed\n requestQueue[id] = [res];\n bulkFetch();\n });\n}\n\nasync function bulkFetchPronouns(ids: string[]): Promise {\n const params = new URLSearchParams();\n params.append(\"platform\", \"discord\");\n params.append(\"ids\", ids.join(\",\"));\n\n try {\n const req = await fetch(\"https://pronoundb.org/api/v1/lookup-bulk?\" + params.toString(), {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"X-PronounDB-Source\": VENCORD_USER_AGENT\n }\n });\n return await req.json()\n .then((res: PronounsResponse) => {\n Object.assign(cache, res);\n return res;\n });\n } catch (e) {\n // If the request errors, treat it as if no pronouns were found for all ids, and log it\n console.error(\"PronounDB fetching failed: \", e);\n const dummyPronouns = Object.fromEntries(ids.map(id => [id, \"unspecified\"] as const));\n Object.assign(cache, dummyPronouns);\n return dummyPronouns;\n }\n}\n\nexport function formatPronouns(pronouns: string): string {\n const { pronounsFormat } = Settings.plugins.PronounDB as { pronounsFormat: PronounsFormat, enabled: boolean; };\n // For capitalized pronouns, just return the mapping (it is by default capitalized)\n if (pronounsFormat === PronounsFormat.Capitalized) return PronounMapping[pronouns];\n // If it is set to lowercase and a special code (any, ask, avoid), then just return the capitalized text\n else if (\n pronounsFormat === PronounsFormat.Lowercase\n && [\"any\", \"ask\", \"avoid\", \"other\"].includes(pronouns)\n ) return PronounMapping[pronouns];\n // Otherwise (lowercase and not a special code), then convert the mapping to lowercase\n else return PronounMapping[pronouns].toLowerCase();\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { classes } from \"@utils/misc\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { UserStore } from \"@webpack/common\";\nimport { Message } from \"discord-types/general\";\n\nimport { useFormattedPronouns } from \"../pronoundbUtils\";\nimport { settings } from \"../settings\";\n\nconst styles: Record = findByPropsLazy(\"timestampInline\");\n\nconst AUTO_MODERATION_ACTION = 24;\n\nfunction shouldShow(message: Message): boolean {\n if (!settings.store.showInMessages)\n return false;\n if (message.author.bot || message.author.system || message.type === AUTO_MODERATION_ACTION)\n return false;\n if (!settings.store.showSelf && message.author.id === UserStore.getCurrentUser().id)\n return false;\n\n return true;\n}\n\nexport const PronounsChatComponentWrapper = ErrorBoundary.wrap(({ message }: { message: Message; }) => {\n return shouldShow(message)\n ? \n : null;\n}, { noop: true });\n\nexport const CompactPronounsChatComponentWrapper = ErrorBoundary.wrap(({ message }: { message: Message; }) => {\n return shouldShow(message)\n ? \n : null;\n}, { noop: true });\n\nfunction PronounsChatComponent({ message }: { message: Message; }) {\n const [result] = useFormattedPronouns(message.author.id);\n\n return result\n ? (\n \u2022 {result}\n )\n : null;\n}\n\nexport const CompactPronounsChatComponent = ErrorBoundary.wrap(({ message }: { message: Message; }) => {\n const [result] = useFormattedPronouns(message.author.id);\n\n return result\n ? (\n \u2022 {result}\n )\n : null;\n}, { noop: true });\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nimport PronounsAboutComponent from \"./components/PronounsAboutComponent\";\nimport { CompactPronounsChatComponentWrapper, PronounsChatComponentWrapper } from \"./components/PronounsChatComponent\";\nimport { useProfilePronouns } from \"./pronoundbUtils\";\nimport { settings } from \"./settings\";\n\nconst PRONOUN_TOOLTIP_PATCH = {\n match: /text:(.{0,10}.Messages\\.USER_PROFILE_PRONOUNS)(?=,)/,\n replace: '$& + (typeof vcPronounSource !== \"undefined\" ? ` (${vcPronounSource})` : \"\")'\n};\n\nexport default definePlugin({\n name: \"PronounDB\",\n authors: [Devs.Tyman, Devs.TheKodeToad, Devs.Ven],\n description: \"Adds pronouns to user messages using pronoundb\",\n patches: [\n // Add next to username (compact mode)\n {\n find: \"showCommunicationDisabledStyles\",\n replacement: {\n match: /(\"span\",{id:\\i,className:\\i,children:\\i}\\))/,\n replace: \"$1, $self.CompactPronounsChatComponentWrapper(arguments[0])\"\n }\n },\n // Patch the chat timestamp element (normal mode)\n {\n find: \"showCommunicationDisabledStyles\",\n replacement: {\n match: /(?<=return\\s*\\(0,\\i\\.jsxs?\\)\\(.+!\\i&&)(\\(0,\\i.jsxs?\\)\\(.+?\\{.+?\\}\\))/,\n replace: \"[$1, $self.PronounsChatComponentWrapper(arguments[0])]\"\n }\n },\n // Patch the profile popout username header to use our pronoun hook instead of Discord's pronouns\n {\n find: \".userTagNoNickname\",\n replacement: [\n {\n match: /{user:(\\i),[^}]*,pronouns:(\\i),[^}]*}=\\i;/,\n replace: \"$&let vcPronounSource;[$2,vcPronounSource]=$self.useProfilePronouns($1.id);\"\n },\n PRONOUN_TOOLTIP_PATCH\n ]\n },\n // Patch the profile modal username header to use our pronoun hook instead of Discord's pronouns\n {\n find: \".nameTagSmall)\",\n replacement: [\n {\n match: /\\.getName\\(\\i\\);(?<=displayProfile.{0,200})/,\n replace: \"$&const [vcPronounce,vcPronounSource]=$self.useProfilePronouns(arguments[0].user.id,true);if(arguments[0].displayProfile&&vcPronounce)arguments[0].displayProfile.pronouns=vcPronounce;\"\n },\n PRONOUN_TOOLTIP_PATCH\n ]\n }\n ],\n\n settings,\n\n settingsAboutComponent: PronounsAboutComponent,\n\n // Re-export the components on the plugin object so it is easily accessible in patches\n PronounsChatComponentWrapper,\n CompactPronounsChatComponentWrapper,\n useProfilePronouns\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addButton, removeButton } from \"@api/MessagePopover\";\nimport { Devs } from \"@utils/constants\";\nimport { insertTextIntoChatInputBox } from \"@utils/discord\";\nimport definePlugin from \"@utils/types\";\nimport { ChannelStore, PermissionsBits, PermissionStore } from \"@webpack/common\";\n\nexport default definePlugin({\n name: \"QuickMention\",\n authors: [Devs.kemo],\n description: \"Adds a quick mention button to the message actions bar\",\n dependencies: [\"MessagePopoverAPI\"],\n\n start() {\n addButton(\"QuickMention\", msg => {\n const channel = ChannelStore.getChannel(msg.channel_id);\n if (!PermissionStore.can(PermissionsBits.SEND_MESSAGES, channel)) return null;\n\n return {\n label: \"Quick Mention\",\n icon: this.Icon,\n message: msg,\n channel,\n onClick: () => insertTextIntoChatInputBox(`<@${msg.author.id}> `)\n };\n });\n },\n stop() {\n removeButton(\"QuickMention\");\n },\n\n Icon: () => (\n \n \n \n ),\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings, Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ChannelStore, FluxDispatcher as Dispatcher, MessageStore, PermissionsBits, PermissionStore, SelectedChannelStore, UserStore } from \"@webpack/common\";\nimport { Message } from \"discord-types/general\";\n\nconst Kangaroo = findByPropsLazy(\"jumpToMessage\");\n\nconst isMac = navigator.platform.includes(\"Mac\"); // bruh\nlet replyIdx = -1;\nlet editIdx = -1;\n\n\nconst enum MentionOptions {\n DISABLED,\n ENABLED,\n NO_REPLY_MENTION_PLUGIN\n}\n\nconst settings = definePluginSettings({\n shouldMention: {\n type: OptionType.SELECT,\n description: \"Ping reply by default\",\n options: [\n {\n label: \"Follow NoReplyMention\",\n value: MentionOptions.NO_REPLY_MENTION_PLUGIN,\n default: true\n },\n { label: \"Enabled\", value: MentionOptions.ENABLED },\n { label: \"Disabled\", value: MentionOptions.DISABLED },\n ]\n }\n});\n\nexport default definePlugin({\n name: \"QuickReply\",\n authors: [Devs.obscurity, Devs.Ven, Devs.pylix],\n description: \"Reply to (ctrl + up/down) and edit (ctrl + shift + up/down) messages via keybinds\",\n settings,\n\n start() {\n Dispatcher.subscribe(\"DELETE_PENDING_REPLY\", onDeletePendingReply);\n Dispatcher.subscribe(\"MESSAGE_END_EDIT\", onEndEdit);\n Dispatcher.subscribe(\"MESSAGE_START_EDIT\", onStartEdit);\n Dispatcher.subscribe(\"CREATE_PENDING_REPLY\", onCreatePendingReply);\n document.addEventListener(\"keydown\", onKeydown);\n },\n\n stop() {\n Dispatcher.unsubscribe(\"DELETE_PENDING_REPLY\", onDeletePendingReply);\n Dispatcher.unsubscribe(\"MESSAGE_END_EDIT\", onEndEdit);\n Dispatcher.unsubscribe(\"MESSAGE_START_EDIT\", onStartEdit);\n Dispatcher.unsubscribe(\"CREATE_PENDING_REPLY\", onCreatePendingReply);\n document.removeEventListener(\"keydown\", onKeydown);\n },\n});\n\nconst onDeletePendingReply = () => replyIdx = -1;\nconst onEndEdit = () => editIdx = -1;\n\nfunction calculateIdx(messages: Message[], id: string) {\n const idx = messages.findIndex(m => m.id === id);\n return idx === -1\n ? idx\n : messages.length - idx - 1;\n}\n\nfunction onStartEdit({ channelId, messageId, _isQuickEdit }: any) {\n if (_isQuickEdit) return;\n\n const meId = UserStore.getCurrentUser().id;\n\n const messages = MessageStore.getMessages(channelId)._array.filter(m => m.author.id === meId);\n editIdx = calculateIdx(messages, messageId);\n}\n\nfunction onCreatePendingReply({ message, _isQuickReply }: { message: Message; _isQuickReply: boolean; }) {\n if (_isQuickReply) return;\n\n replyIdx = calculateIdx(MessageStore.getMessages(message.channel_id)._array, message.id);\n}\n\nconst isCtrl = (e: KeyboardEvent) => isMac ? e.metaKey : e.ctrlKey;\nconst isAltOrMeta = (e: KeyboardEvent) => e.altKey || (!isMac && e.metaKey);\n\nfunction onKeydown(e: KeyboardEvent) {\n const isUp = e.key === \"ArrowUp\";\n if (!isUp && e.key !== \"ArrowDown\") return;\n if (!isCtrl(e) || isAltOrMeta(e)) return;\n\n if (e.shiftKey)\n nextEdit(isUp);\n else\n nextReply(isUp);\n}\n\nfunction jumpIfOffScreen(channelId: string, messageId: string) {\n const element = document.getElementById(\"message-content-\" + messageId);\n if (!element) return;\n\n const vh = Math.max(document.documentElement.clientHeight, window.innerHeight);\n const rect = element.getBoundingClientRect();\n const isOffscreen = rect.bottom < 200 || rect.top - vh >= -200;\n\n if (isOffscreen) {\n Kangaroo.jumpToMessage({\n channelId,\n messageId,\n flash: false,\n jumpType: \"INSTANT\"\n });\n }\n}\n\nfunction getNextMessage(isUp: boolean, isReply: boolean) {\n let messages: Array = MessageStore.getMessages(SelectedChannelStore.getChannelId())._array;\n if (!isReply) { // we are editing so only include own\n const meId = UserStore.getCurrentUser().id;\n messages = messages.filter(m => m.author.id === meId);\n }\n\n const mutate = (i: number) => isUp\n ? Math.min(messages.length - 1, i + 1)\n : Math.max(-1, i - 1);\n\n const findNextNonDeleted = (i: number) => {\n do {\n i = mutate(i);\n } while (i !== -1 && messages[messages.length - i - 1]?.deleted === true);\n return i;\n };\n\n let i: number;\n if (isReply)\n replyIdx = i = findNextNonDeleted(replyIdx);\n else\n editIdx = i = findNextNonDeleted(editIdx);\n\n return i === - 1 ? undefined : messages[messages.length - i - 1];\n}\n\nfunction shouldMention(message) {\n const { enabled, userList, shouldPingListed } = Settings.plugins.NoReplyMention;\n const shouldPing = !enabled || (shouldPingListed === userList.includes(message.author.id));\n\n switch (settings.store.shouldMention) {\n case MentionOptions.NO_REPLY_MENTION_PLUGIN: return shouldPing;\n case MentionOptions.DISABLED: return false;\n default: return true;\n }\n}\n\n// handle next/prev reply\nfunction nextReply(isUp: boolean) {\n const currChannel = ChannelStore.getChannel(SelectedChannelStore.getChannelId());\n if (currChannel.guild_id && !PermissionStore.can(PermissionsBits.SEND_MESSAGES, currChannel)) return;\n const message = getNextMessage(isUp, true);\n\n if (!message)\n return void Dispatcher.dispatch({\n type: \"DELETE_PENDING_REPLY\",\n channelId: SelectedChannelStore.getChannelId(),\n });\n const channel = ChannelStore.getChannel(message.channel_id);\n const meId = UserStore.getCurrentUser().id;\n\n Dispatcher.dispatch({\n type: \"CREATE_PENDING_REPLY\",\n channel,\n message,\n shouldMention: shouldMention(message),\n showMentionToggle: channel.guild_id !== null && message.author.id !== meId,\n _isQuickReply: true\n });\n jumpIfOffScreen(channel.id, message.id);\n}\n\n// handle next/prev edit\nfunction nextEdit(isUp: boolean) {\n const currChannel = ChannelStore.getChannel(SelectedChannelStore.getChannelId());\n if (currChannel.guild_id && !PermissionStore.can(PermissionsBits.SEND_MESSAGES, currChannel)) return;\n const message = getNextMessage(isUp, false);\n\n if (!message)\n return Dispatcher.dispatch({\n type: \"MESSAGE_END_EDIT\",\n channelId: SelectedChannelStore.getChannelId()\n });\n Dispatcher.dispatch({\n type: \"MESSAGE_START_EDIT\",\n channelId: message.channel_id,\n messageId: message.id,\n content: message.content,\n _isQuickEdit: true\n });\n jumpIfOffScreen(message.channel_id, message.id);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nlet ERROR_CODES: any;\nconst CODES_URL =\n \"https://raw.githubusercontent.com/facebook/react/17.0.2/scripts/error-codes/codes.json\";\n\nexport default definePlugin({\n name: \"ReactErrorDecoder\",\n description: 'Replaces \"Minifed React Error\" with the actual error.',\n authors: [Devs.Cyn],\n patches: [\n {\n find: '\"https://reactjs.org/docs/error-decoder.html?invariant=\"',\n replacement: {\n match: /(function .\\(.\\)){(for\\(var .=\"https:\\/\\/reactjs\\.org\\/docs\\/error-decoder\\.html\\?invariant=\"\\+.,.=1;.\n `${func}{var decoded=Vencord.Plugins.plugins.ReactErrorDecoder.decodeError.apply(null, arguments);if(decoded)return decoded;${original}}`,\n },\n },\n ],\n\n async start() {\n ERROR_CODES = await fetch(CODES_URL)\n .then(res => res.json())\n .catch(e => console.error(\"[ReactErrorDecoder] Failed to fetch React error codes\\n\", e));\n },\n\n stop() {\n ERROR_CODES = undefined;\n },\n\n decodeError(code: number, ...args: any) {\n let index = 0;\n return ERROR_CODES?.[code]?.replace(/%s/g, () => {\n const arg = args[index];\n index++;\n return arg;\n });\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Logger } from \"@utils/Logger\";\n\nconst logger = new Logger(\"ServerListAPI\");\n\nexport const enum ServerListRenderPosition {\n Above,\n In,\n}\n\nconst renderFunctionsAbove = new Set();\nconst renderFunctionsIn = new Set();\n\nfunction getRenderFunctions(position: ServerListRenderPosition) {\n return position === ServerListRenderPosition.Above ? renderFunctionsAbove : renderFunctionsIn;\n}\n\nexport function addServerListElement(position: ServerListRenderPosition, renderFunction: Function) {\n getRenderFunctions(position).add(renderFunction);\n}\n\nexport function removeServerListElement(position: ServerListRenderPosition, renderFunction: Function) {\n getRenderFunctions(position).delete(renderFunction);\n}\n\nexport const renderAll = (position: ServerListRenderPosition) => {\n const ret: Array = [];\n\n for (const renderFunction of getRenderFunctions(position)) {\n try {\n ret.unshift(renderFunction());\n } catch (e) {\n logger.error(\"Failed to render server list element:\", e);\n }\n }\n\n return ret;\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addServerListElement, removeServerListElement, ServerListRenderPosition } from \"@api/ServerList\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { Button, FluxDispatcher, GuildChannelStore, GuildStore, React, ReadStateStore } from \"@webpack/common\";\n\nfunction onClick() {\n const channels: Array = [];\n\n Object.values(GuildStore.getGuilds()).forEach(guild => {\n GuildChannelStore.getChannels(guild.id).SELECTABLE.forEach((c: { channel: { id: string; }; }) => {\n if (!ReadStateStore.hasUnread(c.channel.id)) return;\n\n channels.push({\n channelId: c.channel.id,\n // messageId: c.channel?.lastMessageId,\n messageId: ReadStateStore.lastMessageId(c.channel.id),\n readStateType: 0\n });\n });\n });\n\n FluxDispatcher.dispatch({\n type: \"BULK_ACK\",\n context: \"APP\",\n channels: channels\n });\n}\n\nconst ReadAllButton = () => (\n Read all\n);\n\nexport default definePlugin({\n name: \"ReadAllNotificationsButton\",\n description: \"Read all server notifications with a single button click!\",\n authors: [Devs.kemo],\n dependencies: [\"ServerListAPI\"],\n\n renderReadAllButton: () => ,\n\n start() {\n addServerListElement(ServerListRenderPosition.Above, this.renderReadAllButton);\n },\n\n stop() {\n removeServerListElement(ServerListRenderPosition.Above, this.renderReadAllButton);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { OptionType } from \"@utils/types\";\n\nexport default definePluginSettings({\n notices: {\n type: OptionType.BOOLEAN,\n description: \"Also show a notice at the top of your screen when removed (use this if you don't want to miss any notifications).\",\n default: false\n },\n offlineRemovals: {\n type: OptionType.BOOLEAN,\n description: \"Notify you when starting discord if you were removed while offline.\",\n default: true\n },\n friends: {\n type: OptionType.BOOLEAN,\n description: \"Notify when a friend removes you\",\n default: true\n },\n friendRequestCancels: {\n type: OptionType.BOOLEAN,\n description: \"Notify when a friend request is cancelled\",\n default: true\n },\n servers: {\n type: OptionType.BOOLEAN,\n description: \"Notify when removed from a server\",\n default: true\n },\n groups: {\n type: OptionType.BOOLEAN,\n description: \"Notify when removed from a group chat\",\n default: true\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Channel } from \"discord-types/general\";\n\nexport interface ChannelDelete {\n type: \"CHANNEL_DELETE\";\n channel: Channel;\n}\n\nexport interface GuildDelete {\n type: \"GUILD_DELETE\";\n guild: {\n id: string;\n unavailable?: boolean;\n };\n}\n\nexport interface RelationshipRemove {\n type: \"RELATIONSHIP_REMOVE\";\n relationship: {\n id: string;\n nickname: string;\n type: number;\n };\n}\n\nexport interface SimpleGroupChannel {\n id: string;\n name: string;\n iconURL?: string;\n}\n\nexport interface SimpleGuild {\n id: string;\n name: string;\n iconURL?: string;\n}\n\nexport const enum ChannelType {\n GROUP_DM = 3,\n}\n\nexport const enum RelationshipType {\n FRIEND = 1,\n BLOCKED = 2,\n INCOMING_REQUEST = 3,\n OUTGOING_REQUEST = 4,\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { DataStore, Notices } from \"@api/index\";\nimport { showNotification } from \"@api/Notifications\";\nimport { getUniqueUsername, openUserProfile } from \"@utils/discord\";\nimport { ChannelStore, GuildMemberStore, GuildStore, RelationshipStore, UserStore, UserUtils } from \"@webpack/common\";\n\nimport settings from \"./settings\";\nimport { ChannelType, RelationshipType, SimpleGroupChannel, SimpleGuild } from \"./types\";\n\nconst guilds = new Map();\nconst groups = new Map();\nconst friends = {\n friends: [] as string[],\n requests: [] as string[]\n};\n\nconst guildsKey = () => `relationship-notifier-guilds-${UserStore.getCurrentUser().id}`;\nconst groupsKey = () => `relationship-notifier-groups-${UserStore.getCurrentUser().id}`;\nconst friendsKey = () => `relationship-notifier-friends-${UserStore.getCurrentUser().id}`;\n\nasync function runMigrations() {\n DataStore.delMany([\"relationship-notifier-guilds\", \"relationship-notifier-groups\", \"relationship-notifier-friends\"]);\n}\n\nexport async function syncAndRunChecks() {\n await runMigrations();\n const [oldGuilds, oldGroups, oldFriends] = await DataStore.getMany([\n guildsKey(),\n groupsKey(),\n friendsKey()\n ]) as [Map | undefined, Map | undefined, Record<\"friends\" | \"requests\", string[]> | undefined];\n\n await Promise.all([syncGuilds(), syncGroups(), syncFriends()]);\n\n if (settings.store.offlineRemovals) {\n if (settings.store.groups && oldGroups?.size) {\n for (const [id, group] of oldGroups) {\n if (!groups.has(id))\n notify(`You are no longer in the group ${group.name}.`, group.iconURL);\n }\n }\n\n if (settings.store.servers && oldGuilds?.size) {\n for (const [id, guild] of oldGuilds) {\n if (!guilds.has(id))\n notify(`You are no longer in the server ${guild.name}.`, guild.iconURL);\n }\n }\n\n if (settings.store.friends && oldFriends?.friends.length) {\n for (const id of oldFriends.friends) {\n if (friends.friends.includes(id)) continue;\n\n const user = await UserUtils.getUser(id).catch(() => void 0);\n if (user)\n notify(\n `You are no longer friends with ${getUniqueUsername(user)}.`,\n user.getAvatarURL(undefined, undefined, false),\n () => openUserProfile(user.id)\n );\n }\n }\n\n if (settings.store.friendRequestCancels && oldFriends?.requests?.length) {\n for (const id of oldFriends.requests) {\n if (\n friends.requests.includes(id) ||\n [RelationshipType.FRIEND, RelationshipType.BLOCKED, RelationshipType.OUTGOING_REQUEST].includes(RelationshipStore.getRelationshipType(id))\n ) continue;\n\n const user = await UserUtils.getUser(id).catch(() => void 0);\n if (user)\n notify(\n `Friend request from ${getUniqueUsername(user)} has been revoked.`,\n user.getAvatarURL(undefined, undefined, false),\n () => openUserProfile(user.id)\n );\n }\n }\n }\n}\n\nexport function notify(text: string, icon?: string, onClick?: () => void) {\n if (settings.store.notices)\n Notices.showNotice(text, \"OK\", () => Notices.popNotice());\n\n showNotification({\n title: \"Relationship Notifier\",\n body: text,\n icon,\n onClick\n });\n}\n\nexport function getGuild(id: string) {\n return guilds.get(id);\n}\n\nexport function deleteGuild(id: string) {\n guilds.delete(id);\n syncGuilds();\n}\n\nexport async function syncGuilds() {\n guilds.clear();\n\n const me = UserStore.getCurrentUser().id;\n for (const [id, { name, icon }] of Object.entries(GuildStore.getGuilds())) {\n if (GuildMemberStore.isMember(id, me))\n guilds.set(id, {\n id,\n name,\n iconURL: icon && `https://cdn.discordapp.com/icons/${id}/${icon}.png`\n });\n }\n await DataStore.set(guildsKey(), guilds);\n}\n\nexport function getGroup(id: string) {\n return groups.get(id);\n}\n\nexport function deleteGroup(id: string) {\n groups.delete(id);\n syncGroups();\n}\n\nexport async function syncGroups() {\n groups.clear();\n\n for (const { type, id, name, rawRecipients, icon } of ChannelStore.getSortedPrivateChannels()) {\n if (type === ChannelType.GROUP_DM)\n groups.set(id, {\n id,\n name: name || rawRecipients.map(r => r.username).join(\", \"),\n iconURL: icon && `https://cdn.discordapp.com/channel-icons/${id}/${icon}.png`\n });\n }\n\n await DataStore.set(groupsKey(), groups);\n}\n\nexport async function syncFriends() {\n friends.friends = [];\n friends.requests = [];\n\n const relationShips = RelationshipStore.getRelationships();\n for (const id in relationShips) {\n switch (relationShips[id]) {\n case RelationshipType.FRIEND:\n friends.friends.push(id);\n break;\n case RelationshipType.INCOMING_REQUEST:\n friends.requests.push(id);\n break;\n }\n }\n\n await DataStore.set(friendsKey(), friends);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { getUniqueUsername, openUserProfile } from \"@utils/discord\";\nimport { UserUtils } from \"@webpack/common\";\n\nimport settings from \"./settings\";\nimport { ChannelDelete, ChannelType, GuildDelete, RelationshipRemove, RelationshipType } from \"./types\";\nimport { deleteGroup, deleteGuild, getGroup, getGuild, notify } from \"./utils\";\n\nlet manuallyRemovedFriend: string | undefined;\nlet manuallyRemovedGuild: string | undefined;\nlet manuallyRemovedGroup: string | undefined;\n\nexport const removeFriend = (id: string) => manuallyRemovedFriend = id;\nexport const removeGuild = (id: string) => manuallyRemovedGuild = id;\nexport const removeGroup = (id: string) => manuallyRemovedGroup = id;\n\nexport async function onRelationshipRemove({ relationship: { type, id } }: RelationshipRemove) {\n if (manuallyRemovedFriend === id) {\n manuallyRemovedFriend = undefined;\n return;\n }\n\n const user = await UserUtils.getUser(id)\n .catch(() => null);\n if (!user) return;\n\n switch (type) {\n case RelationshipType.FRIEND:\n if (settings.store.friends)\n notify(\n `${getUniqueUsername(user)} removed you as a friend.`,\n user.getAvatarURL(undefined, undefined, false),\n () => openUserProfile(user.id)\n );\n break;\n case RelationshipType.INCOMING_REQUEST:\n if (settings.store.friendRequestCancels)\n notify(\n `A friend request from ${getUniqueUsername(user)} has been removed.`,\n user.getAvatarURL(undefined, undefined, false),\n () => openUserProfile(user.id)\n );\n break;\n }\n}\n\nexport function onGuildDelete({ guild: { id, unavailable } }: GuildDelete) {\n if (!settings.store.servers) return;\n if (unavailable) return;\n\n if (manuallyRemovedGuild === id) {\n deleteGuild(id);\n manuallyRemovedGuild = undefined;\n return;\n }\n\n const guild = getGuild(id);\n if (guild) {\n deleteGuild(id);\n notify(`You were removed from the server ${guild.name}.`, guild.iconURL);\n }\n}\n\nexport function onChannelDelete({ channel: { id, type } }: ChannelDelete) {\n if (!settings.store.groups) return;\n if (type !== ChannelType.GROUP_DM) return;\n\n if (manuallyRemovedGroup === id) {\n deleteGroup(id);\n manuallyRemovedGroup = undefined;\n return;\n }\n\n const group = getGroup(id);\n if (group) {\n deleteGroup(id);\n notify(`You were removed from the group ${group.name}.`, group.iconURL);\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nimport { onChannelDelete, onGuildDelete, onRelationshipRemove, removeFriend, removeGroup, removeGuild } from \"./functions\";\nimport settings from \"./settings\";\nimport { syncAndRunChecks, syncFriends, syncGroups, syncGuilds } from \"./utils\";\n\nexport default definePlugin({\n name: \"RelationshipNotifier\",\n description: \"Notifies you when a friend, group chat, or server removes you.\",\n authors: [Devs.nick],\n settings,\n\n patches: [\n {\n find: \"removeRelationship:(\",\n replacement: {\n match: /(removeRelationship:\\((\\i),\\i,\\i\\)=>)/,\n replace: \"$1($self.removeFriend($2),0)||\"\n }\n },\n {\n find: \"async leaveGuild(\",\n replacement: {\n match: /(leaveGuild\\((\\i)\\){)/,\n replace: \"$1$self.removeGuild($2);\"\n }\n },\n {\n find: \"},closePrivateChannel(\",\n replacement: {\n match: /(closePrivateChannel\\((\\i)\\){)/,\n replace: \"$1$self.removeGroup($2);\"\n }\n }\n ],\n\n flux: {\n GUILD_CREATE: syncGuilds,\n GUILD_DELETE: onGuildDelete,\n CHANNEL_CREATE: syncGroups,\n CHANNEL_DELETE: onChannelDelete,\n RELATIONSHIP_ADD: syncFriends,\n RELATIONSHIP_UPDATE: syncFriends,\n RELATIONSHIP_REMOVE(e) {\n onRelationshipRemove(e);\n syncFriends();\n },\n CONNECTION_OPEN: syncAndRunChecks\n },\n\n async start() {\n setTimeout(() => {\n syncAndRunChecks();\n }, 5000);\n },\n\n removeFriend,\n removeGroup,\n removeGuild\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\n\nconst SpoilerClasses = findByPropsLazy(\"spoilerContent\");\nconst MessagesClasses = findByPropsLazy(\"messagesWrapper\", \"messages\");\n\nexport default definePlugin({\n name: \"RevealAllSpoilers\",\n description: \"Reveal all spoilers in a message by Ctrl-clicking a spoiler, or in the chat with Ctrl+Shift-click\",\n authors: [Devs.whqwert],\n\n patches: [\n {\n find: \".removeObscurity=\",\n replacement: {\n match: /(?<=\\.removeObscurity=(\\i)=>{)/,\n replace: (_, event) => `$self.reveal(${event});`\n }\n }\n ],\n\n reveal(event: MouseEvent) {\n const { ctrlKey, shiftKey, target } = event;\n\n if (!ctrlKey) { return; }\n\n const { spoilerContent, hidden } = SpoilerClasses;\n const { messagesWrapper } = MessagesClasses;\n\n const parent = shiftKey\n ? document.querySelector(`div.${messagesWrapper}`)\n : (target as HTMLSpanElement).parentElement;\n\n for (const spoiler of parent!.querySelectorAll(`span.${spoilerContent}.${hidden}`)) {\n (spoiler as HTMLSpanElement).click();\n }\n }\n\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { Flex } from \"@components/Flex\";\nimport { OpenExternalIcon } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { Menu } from \"@webpack/common\";\n\nconst Engines = {\n Google: \"https://lens.google.com/uploadbyurl?url=\",\n Yandex: \"https://yandex.com/images/search?rpt=imageview&url=\",\n SauceNAO: \"https://saucenao.com/search.php?url=\",\n IQDB: \"https://iqdb.org/?url=\",\n TinEye: \"https://www.tineye.com/search?url=\",\n ImgOps: \"https://imgops.com/start?url=\"\n} as const;\n\nfunction search(src: string, engine: string) {\n open(engine + encodeURIComponent(src), \"_blank\");\n}\n\nconst imageContextMenuPatch: NavContextMenuPatchCallback = (children, props) => () => {\n if (!props) return;\n const { reverseImageSearchType, itemHref, itemSrc } = props;\n\n if (!reverseImageSearchType || reverseImageSearchType !== \"img\") return;\n\n const src = itemHref ?? itemSrc;\n\n const group = findGroupChildrenByChildId(\"copy-link\", children);\n if (group) {\n group.push((\n \n {Object.keys(Engines).map((engine, i) => {\n const key = \"search-image-\" + engine;\n return (\n \n = 3 // Do not round Google, Yandex & SauceNAO\n ? \"50%\"\n : void 0\n }}\n aria-hidden=\"true\"\n height={16}\n width={16}\n src={new URL(\"/favicon.ico\", Engines[engine]).toString().replace(\"lens.\", \"\")}\n />\n {engine}\n \n }\n action={() => search(src, Engines[engine])}\n />\n );\n })}\n \n \n All\n \n }\n action={() => Object.values(Engines).forEach(e => search(src, e))}\n />\n \n ));\n }\n};\n\nexport default definePlugin({\n name: \"ReverseImageSearch\",\n description: \"Adds ImageSearch to image context menus\",\n authors: [Devs.Ven, Devs.Nuckyz],\n tags: [\"ImageUtilities\"],\n\n patches: [\n {\n find: \".Messages.MESSAGE_ACTIONS_MENU_LABEL\",\n replacement: {\n match: /favoriteableType:\\i,(?<=(\\i)\\.getAttribute\\(\"data-type\"\\).+?)/,\n replace: (m, target) => `${m}reverseImageSearchType:${target}.getAttribute(\"data-role\"),`\n }\n }\n ],\n\n start() {\n addContextMenuPatch(\"message\", imageContextMenuPatch);\n },\n\n stop() {\n removeContextMenuPatch(\"message\", imageContextMenuPatch);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { ChannelStore, GuildMemberStore, GuildStore } from \"@webpack/common\";\n\nconst settings = definePluginSettings({\n chatMentions: {\n type: OptionType.BOOLEAN,\n default: true,\n description: \"Show role colors in chat mentions (including in the message box)\",\n restartNeeded: true\n },\n memberList: {\n type: OptionType.BOOLEAN,\n default: true,\n description: \"Show role colors in member list role headers\",\n restartNeeded: true\n },\n voiceUsers: {\n type: OptionType.BOOLEAN,\n default: true,\n description: \"Show role colors in the voice chat user list\",\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"RoleColorEverywhere\",\n authors: [Devs.KingFish, Devs.lewisakura, Devs.AutumnVN],\n description: \"Adds the top role color anywhere possible\",\n patches: [\n // Chat Mentions\n {\n find: \"CLYDE_AI_MENTION_COLOR:null,\",\n replacement: [\n {\n match: /user:(\\i),channel:(\\i).{0,400}?\"@\"\\.concat\\(.+?\\)/,\n replace: \"$&,color:$self.getUserColor($1?.id,{channelId:$2?.id})\"\n }\n ],\n predicate: () => settings.store.chatMentions,\n },\n // Slate\n {\n find: \".userTooltip,children\",\n replacement: [\n {\n match: /let\\{id:(\\i),guildId:(\\i)[^}]*\\}.*?\\.default,{(?=children)/,\n replace: \"$&color:$self.getUserColor($1,{guildId:$2}),\"\n }\n ],\n predicate: () => settings.store.chatMentions,\n },\n {\n find: 'tutorialId:\"whos-online',\n replacement: [\n {\n match: /\\i.roleIcon,\\.\\.\\.\\i/,\n replace: \"$&,color:$self.roleGroupColor(arguments[0])\"\n },\n {\n match: /null,\\i,\" \u2014 \",\\i\\]/,\n replace: \"null,$self.roleGroupColor(arguments[0])]\"\n },\n ],\n predicate: () => settings.store.memberList,\n },\n {\n find: \"renderPrioritySpeaker\",\n replacement: [\n {\n match: /renderName\\(\\).{0,100}speaking:.{50,100}jsx.{5,10}{/,\n replace: \"$&...$self.getVoiceProps(this.props),\"\n }\n ],\n predicate: () => settings.store.voiceUsers,\n }\n ],\n settings,\n\n getColor(userId: string, { channelId, guildId }: { channelId?: string; guildId?: string; }) {\n if (!(guildId ??= ChannelStore.getChannel(channelId!)?.guild_id)) return null;\n return GuildMemberStore.getMember(guildId, userId)?.colorString ?? null;\n },\n\n getUserColor(userId: string, ids: { channelId?: string; guildId?: string; }) {\n const colorString = this.getColor(userId, ids);\n return colorString && parseInt(colorString.slice(1), 16);\n },\n\n roleGroupColor({ id, count, title, guildId, label }: { id: string; count: number; title: string; guildId: string; label: string; }) {\n const guild = GuildStore.getGuild(guildId);\n const role = guild?.roles[id];\n\n return (\n \n {title ?? label} — {count}\n \n );\n },\n\n getVoiceProps({ user: { id: userId }, guildId }: { user: { id: string; }; guildId: string; }) {\n return {\n style: {\n color: this.getColor(userId, { guildId })\n }\n };\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { ReplyIcon } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ChannelStore, i18n, Menu, PermissionsBits, PermissionStore, SelectedChannelStore } from \"@webpack/common\";\nimport { Message } from \"discord-types/general\";\n\n\nconst messageUtils = findByPropsLazy(\"replyToMessage\");\n\nconst messageContextMenuPatch: NavContextMenuPatchCallback = (children, { message }: { message: Message; }) => () => {\n // make sure the message is in the selected channel\n if (SelectedChannelStore.getChannelId() !== message.channel_id) return;\n const channel = ChannelStore.getChannel(message?.channel_id);\n if (!channel) return;\n if (channel.guild_id && !PermissionStore.can(PermissionsBits.SEND_MESSAGES, channel)) return;\n\n // dms and group chats\n const dmGroup = findGroupChildrenByChildId(\"pin\", children);\n if (dmGroup && !dmGroup.some(child => child?.props?.id === \"reply\")) {\n const pinIndex = dmGroup.findIndex(c => c?.props.id === \"pin\");\n return dmGroup.splice(pinIndex + 1, 0, (\n messageUtils.replyToMessage(channel, message, e)}\n />\n ));\n }\n\n // servers\n const serverGroup = findGroupChildrenByChildId(\"mark-unread\", children);\n if (serverGroup && !serverGroup.some(child => child?.props?.id === \"reply\")) {\n return serverGroup.unshift((\n messageUtils.replyToMessage(channel, message, e)}\n />\n ));\n }\n};\n\n\nexport default definePlugin({\n name: \"SearchReply\",\n description: \"Adds a reply button to search results\",\n authors: [Devs.Aria],\n\n start() {\n addContextMenuPatch(\"message\", messageContextMenuPatch);\n },\n\n stop() {\n removeContextMenuPatch(\"message\", messageContextMenuPatch);\n }\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\n// NOTE - Ultimately should probably be turned into a ringtone picker plugin\nexport default definePlugin({\n name: \"SecretRingToneEnabler\",\n description: \"Always play the secret version of the discord ringtone (except during special ringtone events)\",\n authors: [Devs.AndrewDLO, Devs.FieryFlames],\n patches: [\n {\n find: \"call_ringing_beat\\\"\",\n replacement: {\n match: /500===\\i\\.random\\(1,1e3\\)/,\n replace: \"true\"\n }\n },\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport { addPreSendListener, removePreSendListener } from \"@api/MessageEvents\";\nimport { classNameFactory } from \"@api/Styles\";\nimport { Devs } from \"@utils/constants\";\nimport { getTheme, insertTextIntoChatInputBox, Theme } from \"@utils/discord\";\nimport { Margins } from \"@utils/margins\";\nimport { closeModal, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, openModal } from \"@utils/modal\";\nimport definePlugin from \"@utils/types\";\nimport { Button, ButtonLooks, ButtonWrapperClasses, Forms, Parser, Select, Tooltip, useMemo, useState } from \"@webpack/common\";\n\nfunction parseTime(time: string) {\n const cleanTime = time.slice(1, -1).replace(/(\\d)(AM|PM)$/i, \"$1 $2\");\n\n let ms = new Date(`${new Date().toDateString()} ${cleanTime}`).getTime() / 1000;\n if (isNaN(ms)) return time;\n\n // add 24h if time is in the past\n if (Date.now() / 1000 > ms) ms += 86400;\n\n return ``;\n}\n\nconst Formats = [\"\", \"t\", \"T\", \"d\", \"D\", \"f\", \"F\", \"R\"] as const;\ntype Format = typeof Formats[number];\n\nconst cl = classNameFactory(\"vc-st-\");\n\nfunction PickerModal({ rootProps, close }: { rootProps: ModalProps, close(): void; }) {\n const [value, setValue] = useState();\n const [format, setFormat] = useState(\"\");\n const time = Math.round((new Date(value!).getTime() || Date.now()) / 1000);\n\n const formatTimestamp = (time: number, format: Format) => ``;\n\n const [formatted, rendered] = useMemo(() => {\n const formatted = formatTimestamp(time, format);\n return [formatted, Parser.parse(formatted)];\n }, [time, format]);\n\n return (\n \n \n \n Timestamp Picker\n \n\n \n \n\n \n setValue(e.currentTarget.value)}\n style={{\n colorScheme: getTheme() === Theme.Light ? \"light\" : \"dark\",\n }}\n />\n\n Timestamp Format\n ({\n label: m,\n value: m\n }))\n }\n isSelected={v => v === format}\n select={v => setFormat(v)}\n serialize={v => v}\n renderOptionLabel={o => (\n
\n {Parser.parse(formatTimestamp(time, o.value))}\n
\n )}\n renderOptionValue={() => rendered}\n />\n\n Preview\n \n {rendered} ({formatted})\n \n
\n\n \n {\n insertTextIntoChatInputBox(formatted + \" \");\n close();\n }}\n >Insert\n \n
\n );\n}\n\nexport default definePlugin({\n name: \"SendTimestamps\",\n description: \"Send timestamps easily via chat box button & text shortcuts. Read the extended description!\",\n authors: [Devs.Ven, Devs.Tyler],\n dependencies: [\"MessageEventsAPI\"],\n\n patches: [\n {\n find: \"ChannelTextAreaButtons\",\n replacement: {\n match: /(\\i)\\.push.{1,30}disabled:(\\i),.{1,20}\\},\"gift\"\\)\\)/,\n replace: \"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()\",\n }\n },\n ],\n\n start() {\n this.listener = addPreSendListener((_, msg) => {\n msg.content = msg.content.replace(/`\\d{1,2}:\\d{2} ?(?:AM|PM)?`/gi, parseTime);\n });\n },\n\n stop() {\n removePreSendListener(this.listener);\n },\n\n chatBarIcon(chatBoxProps: { type: { analyticsName: string; }; }) {\n if (chatBoxProps.type.analyticsName !== \"normal\") return null;\n\n return (\n \n {({ onMouseEnter, onMouseLeave }) => (\n
\n {\n const key = openModal(props => (\n closeModal(key)}\n />\n ));\n }}\n className={cl(\"button\")}\n >\n
\n \n \n \n \n \n \n
\n \n
\n )\n }\n
\n );\n },\n\n settingsAboutComponent() {\n const samples = [\n \"12:00\",\n \"3:51\",\n \"17:59\",\n \"24:00\",\n \"12:00 AM\",\n \"0:13PM\"\n ].map(s => `\\`${s}\\``);\n\n return (\n <>\n \n To quickly send send time only timestamps, include timestamps formatted as `HH:MM` (including the backticks!) in your message\n \n \n See below for examples.\n If you need anything more specific, use the Date button in the chat bar!\n \n \n Examples:\n
    \n {samples.map(s => (\n
  • \n {s} {\"->\"} {Parser.parse(parseTime(s))}\n
  • \n ))}\n
\n
\n \n );\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Sofia Lima\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addServerListElement, removeServerListElement, ServerListRenderPosition } from \"@api/ServerList\";\nimport { Settings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { useForceUpdater } from \"@utils/react\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { GuildStore, PresenceStore, RelationshipStore } from \"@webpack/common\";\n\nconst enum IndicatorType {\n SERVER = 1 << 0,\n FRIEND = 1 << 1,\n BOTH = SERVER | FRIEND,\n}\n\nlet onlineFriends = 0;\nlet guildCount = 0;\nlet forceUpdateFriendCount: () => void;\nlet forceUpdateGuildCount: () => void;\n\nfunction FriendsIndicator() {\n forceUpdateFriendCount = useForceUpdater();\n\n return (\n \n {onlineFriends} online\n \n );\n}\n\nfunction ServersIndicator() {\n forceUpdateGuildCount = useForceUpdater();\n\n return (\n \n {guildCount} servers\n \n );\n}\n\nfunction handlePresenceUpdate() {\n onlineFriends = 0;\n const relations = RelationshipStore.getRelationships();\n for (const id of Object.keys(relations)) {\n const type = relations[id];\n // FRIEND relationship type\n if (type === 1 && PresenceStore.getStatus(id) !== \"offline\") {\n onlineFriends += 1;\n }\n }\n forceUpdateFriendCount?.();\n}\n\nfunction handleGuildUpdate() {\n guildCount = GuildStore.getGuildCount();\n forceUpdateGuildCount?.();\n}\n\nexport default definePlugin({\n name: \"ServerListIndicators\",\n description: \"Add online friend count or server count in the server list\",\n authors: [Devs.dzshn],\n dependencies: [\"ServerListAPI\"],\n\n options: {\n mode: {\n description: \"mode\",\n type: OptionType.SELECT,\n options: [\n { label: \"Only online friend count\", value: IndicatorType.FRIEND, default: true },\n { label: \"Only server count\", value: IndicatorType.SERVER },\n { label: \"Both server and online friend counts\", value: IndicatorType.BOTH },\n ]\n }\n },\n\n renderIndicator: () => {\n const { mode } = Settings.plugins.ServerListIndicators;\n return \n
\n {!!(mode & IndicatorType.FRIEND) && }\n {!!(mode & IndicatorType.SERVER) && }\n
\n
;\n },\n\n flux: {\n PRESENCE_UPDATES: handlePresenceUpdate,\n GUILD_CREATE: handleGuildUpdate,\n GUILD_DELETE: handleGuildUpdate,\n },\n\n\n start() {\n addServerListElement(ServerListRenderPosition.Above, this.renderIndicator);\n\n handlePresenceUpdate();\n handleGuildUpdate();\n },\n\n stop() {\n removeServerListElement(ServerListRenderPosition.Above, this.renderIndicator);\n }\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport \"./styles.css\";\n\nimport { classNameFactory } from \"@api/Styles\";\nimport { openImageModal, openUserProfile } from \"@utils/discord\";\nimport { classes } from \"@utils/misc\";\nimport { ModalRoot, ModalSize, openModal } from \"@utils/modal\";\nimport { useAwaiter } from \"@utils/react\";\nimport { findByPropsLazy, findExportedComponentLazy } from \"@webpack\";\nimport { FluxDispatcher, Forms, GuildChannelStore, GuildMemberStore, moment, Parser, PresenceStore, RelationshipStore, ScrollerThin, SnowflakeUtils, TabBar, Timestamp, useEffect, UserStore, UserUtils, useState, useStateFromStores } from \"@webpack/common\";\nimport { Guild, User } from \"discord-types/general\";\n\nconst IconUtils = findByPropsLazy(\"getGuildBannerURL\");\nconst IconClasses = findByPropsLazy(\"icon\", \"acronym\", \"childWrapper\");\nconst FriendRow = findExportedComponentLazy(\"FriendRow\");\n\nconst cl = classNameFactory(\"vc-gp-\");\n\nexport function openGuildProfileModal(guild: Guild) {\n openModal(props =>\n \n \n \n );\n}\n\nconst enum Tabs {\n ServerInfo,\n Friends,\n BlockedUsers\n}\n\ninterface GuildProps {\n guild: Guild;\n}\n\ninterface RelationshipProps extends GuildProps {\n setCount(count: number): void;\n}\n\nconst fetched = {\n friends: false,\n blocked: false\n};\n\nfunction renderTimestamp(timestamp: number) {\n return (\n \n );\n}\n\nfunction GuildProfileModal({ guild }: GuildProps) {\n const [friendCount, setFriendCount] = useState();\n const [blockedCount, setBlockedCount] = useState();\n\n useEffect(() => {\n fetched.friends = false;\n fetched.blocked = false;\n }, []);\n\n const [currentTab, setCurrentTab] = useState(Tabs.ServerInfo);\n\n const bannerUrl = guild.banner && IconUtils.getGuildBannerURL({\n id: guild.id,\n banner: guild.banner\n }, true).replace(/\\?size=\\d+$/, \"?size=1024\");\n\n const iconUrl = guild.icon && IconUtils.getGuildIconURL({\n id: guild.id,\n icon: guild.icon,\n canAnimate: true,\n size: 512\n });\n\n return (\n
\n {bannerUrl && currentTab === Tabs.ServerInfo && (\n openImageModal(bannerUrl)}\n />\n )}\n\n
\n {guild.icon\n ? openImageModal(iconUrl)}\n />\n :
{guild.acronym}
\n }\n\n
\n {guild.name}\n {guild.description && {guild.description}}\n
\n
\n\n \n \n Server Info\n \n \n Friends{friendCount !== undefined ? ` (${friendCount})` : \"\"}\n \n \n Blocked Users{blockedCount !== undefined ? ` (${blockedCount})` : \"\"}\n \n \n\n
\n {currentTab === Tabs.ServerInfo && }\n {currentTab === Tabs.Friends && }\n {currentTab === Tabs.BlockedUsers && }\n
\n
\n );\n}\n\n\nfunction Owner(guildId: string, owner: User) {\n const guildAvatar = GuildMemberStore.getMember(guildId, owner.id)?.avatar;\n const ownerAvatarUrl =\n guildAvatar\n ? IconUtils.getGuildMemberAvatarURLSimple({\n userId: owner!.id,\n avatar: guildAvatar,\n guildId,\n canAnimate: true\n }, true)\n : IconUtils.getUserAvatarURL(owner, true);\n\n return (\n
\n \"\" openImageModal(ownerAvatarUrl)} />\n {Parser.parse(`<@${owner.id}>`)}\n
\n );\n}\n\nfunction ServerInfoTab({ guild }: GuildProps) {\n const [owner] = useAwaiter(() => UserUtils.getUser(guild.ownerId), {\n deps: [guild.ownerId],\n fallbackValue: null\n });\n\n const Fields = {\n \"Server Owner\": owner ? Owner(guild.id, owner) : \"Loading...\",\n \"Created At\": renderTimestamp(SnowflakeUtils.extractTimestamp(guild.id)),\n \"Joined At\": guild.joinedAt ? renderTimestamp(guild.joinedAt.getTime()) : \"-\", // Not available in lurked guild\n \"Vanity Link\": guild.vanityURLCode ? ({`discord.gg/${guild.vanityURLCode}`}) : \"-\", // Making the anchor href valid would cause Discord to reload\n \"Preferred Locale\": guild.preferredLocale || \"-\",\n \"Verification Level\": [\"None\", \"Low\", \"Medium\", \"High\", \"Highest\"][guild.verificationLevel] || \"?\",\n \"Nitro Boosts\": `${guild.premiumSubscriberCount ?? 0} (Level ${guild.premiumTier ?? 0})`,\n \"Channels\": GuildChannelStore.getChannels(guild.id)?.count - 1 || \"?\", // - null category\n \"Roles\": Object.keys(guild.roles).length - 1, // - @everyone\n };\n\n return (\n
\n {Object.entries(Fields).map(([name, node]) =>\n
\n {name}\n {typeof node === \"string\" ? {node} : node}\n
\n )}\n
\n );\n}\n\nfunction FriendsTab({ guild, setCount }: RelationshipProps) {\n return UserList(\"friends\", guild, RelationshipStore.getFriendIDs(), setCount);\n}\n\nfunction BlockedUsersTab({ guild, setCount }: RelationshipProps) {\n const blockedIds = Object.keys(RelationshipStore.getRelationships()).filter(id => RelationshipStore.isBlocked(id));\n return UserList(\"blocked\", guild, blockedIds, setCount);\n}\n\nfunction UserList(type: \"friends\" | \"blocked\", guild: Guild, ids: string[], setCount: (count: number) => void) {\n const missing = [] as string[];\n const members = [] as string[];\n\n for (const id of ids) {\n if (GuildMemberStore.isMember(guild.id, id))\n members.push(id);\n else\n missing.push(id);\n }\n\n // Used for side effects (rerender on member request success)\n useStateFromStores(\n [GuildMemberStore],\n () => GuildMemberStore.getMemberIds(guild.id),\n null,\n (old, curr) => old.length === curr.length\n );\n\n useEffect(() => {\n if (!fetched[type] && missing.length) {\n fetched[type] = true;\n FluxDispatcher.dispatch({\n type: \"GUILD_MEMBERS_REQUEST\",\n guildIds: [guild.id],\n userIds: missing\n });\n }\n }, []);\n\n useEffect(() => setCount(members.length), [members.length]);\n\n return (\n \n {members.map(id =>\n openUserProfile(id)}\n onContextMenu={() => { }}\n />\n )}\n \n );\n}\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { Menu } from \"@webpack/common\";\nimport { Guild } from \"discord-types/general\";\n\nimport { openGuildProfileModal } from \"./GuildProfileModal\";\n\nconst Patch: NavContextMenuPatchCallback = (children, { guild }: { guild: Guild; }) => () => {\n const group = findGroupChildrenByChildId(\"privacy\", children);\n\n group?.push(\n openGuildProfileModal(guild)}\n />\n );\n};\n\nexport default definePlugin({\n name: \"ServerProfile\",\n description: \"Allows you to view info about a server by right clicking it in the server list\",\n authors: [Devs.Ven, Devs.Nuckyz],\n tags: [\"guild\", \"info\"],\n\n start() {\n addContextMenuPatch([\"guild-context\", \"guild-header-popout\"], Patch);\n },\n\n stop() {\n removeContextMenuPatch([\"guild-context\", \"guild-header-popout\"], Patch);\n }\n});\n", "export default \"/* eslint-disable simple-header/header */\\nimport React from \\\"react\\\";\\n\\nconst handleClick = async () =>\\n console.log((await import(\\\"@webpack/common\\\")).Clipboard.copy(\\\"\\\\u200b\\\"));\\n\\nexport const Example: React.FC<{\\n real: boolean,\\n shigged?: number,\\n}> = ({ real, shigged }) => <>\\n

{`Shigg${real ? `ies${shigged === 0x1B ? \\\"t\\\" : \\\"\\\"}` : \\\"y\\\"}`}

\\n \\n;\\n\"", "'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Channel = exports.ChannelPort = void 0;\nconst eventemitter3_1 = require(\"eventemitter3\");\nconst ipcPrefix = 'vapIpc';\nconst kEdgeCreate = Symbol.for('vapIpc.edgeCreate');\n/** A port essentially a broadcast network for pipes,\n * meaning that emissions from one pipe are sent to all other pipes.\n */\nclass ChannelPort {\n _pipes = new Map();\n _listeners = new Map();\n _createListenerMap() {\n return new Map();\n }\n _emit(sourceName, event, ...data) {\n for (const [pipeName, listenerMap] of this._listeners.entries()) {\n if (pipeName === sourceName)\n continue;\n const listener = listenerMap.get(event);\n if (listener)\n listener(...data);\n }\n }\n createPipe(name) {\n const existingPipe = this.getPipe(name);\n if (existingPipe)\n return existingPipe;\n const listenerMap = this._createListenerMap();\n this._listeners.set(name, listenerMap);\n const pipe = {\n emit: this._emit.bind(this, name),\n listen: (event, fn) => void listenerMap.set(event, fn),\n };\n this._pipes.set(name, pipe);\n return pipe;\n }\n getPipe(name) {\n return this._pipes.get(name) ?? null;\n }\n}\nexports.ChannelPort = ChannelPort;\n/** A channel is a node in a decentralized ipc network.\n * Each channel can talk to other channels through pipes,\n * and channels identify each other through handshakes.\n * The handshake will also let other channels know which channels\n * they can redirect messages to.\n * This implementation does **NOT** account for [ring topologies](https://en.wikipedia.org/wiki/Ring_network).\n **/\nclass Channel {\n id;\n // TODO: better debug logs\n /** edge id -> edge */\n _edges = new Map();\n /** nonce -> callback */\n _callbacks = new Map();\n /** message name -> caller */\n _callers = new Map();\n /** edge id -> pipe */\n _edgePipes = new Map();\n _pipes = [];\n _emitter = new eventemitter3_1.EventEmitter();\n _logger;\n _destroyed = false;\n constructor(id) {\n this.id = id;\n }\n addPipe(pipe) {\n pipe.listen(`${ipcPrefix}:handshake`, (edge) => {\n this._handleHandshake(pipe, edge);\n });\n pipe.listen(`${ipcPrefix}:message`, (message) => {\n this._handleMessage(pipe, message);\n });\n this._pipes.push(pipe);\n this._logger?.log(`Adding pipe to channel \"${this.id}\"`);\n }\n setLogger(logger) {\n this._logger = logger;\n }\n _handleHandshake(pipe, edge) {\n if (this.id === edge.id)\n return;\n // TODO: improve the way channels store edges\n this._logger?.log(`\uD83E\uDD1D \"${edge.id}\" -> \"${this.id}\" (edges: [${edge.channelIds.join(', ')}])`);\n const prevEdge = this._edges.get(edge.id);\n if (prevEdge) {\n const newEdgeIds = edge.channelIds.filter((edgeId) => !prevEdge?.channelIds.includes(edgeId));\n if (newEdgeIds.includes(this.id)) {\n newEdgeIds.splice(newEdgeIds.indexOf(this.id), 1);\n }\n if (!newEdgeIds.length)\n return;\n this._edges.set(edge.id, {\n ...edge,\n channelIds: [...prevEdge.channelIds, ...newEdgeIds],\n });\n }\n else {\n const edgeIds = [...edge.channelIds].filter((edgeId) => edgeId !== this.id);\n this._edges.set(edge.id, {\n ...edge,\n channelIds: edgeIds,\n });\n this._edgePipes.set(edge.id, pipe);\n }\n this._emitter.emit(kEdgeCreate, edge);\n this.handshakeAll();\n }\n _handleMessage(pipe, message) {\n if (message.proxiedBy === this.id)\n return;\n if (message.destination !== this.id) {\n return this._emitMessage({\n ...message,\n proxiedBy: this.id,\n });\n }\n // Event\n if (!message.nonce)\n return void this._emitter.emit(message.name, message.data);\n // Response\n const callback = this._callbacks.get(message.nonce);\n if (callback)\n return void callback(message.data);\n // Call\n const caller = this._callers.get(message.name);\n if (caller) {\n caller(message.data)\n .catch((error) => {\n console.error(error);\n return new Error(error?.message ?? `${error}`);\n })\n .then((data) => {\n this._emitMessage({\n name: message.name,\n source: this.id,\n destination: message.source,\n data,\n nonce: message.nonce,\n });\n });\n return;\n }\n }\n _emitHandshake(pipe) {\n const edge = this.getEdge();\n pipe.emit(`${ipcPrefix}:handshake`, edge);\n }\n _emitMessage(message) {\n const edgeId = this.findEdgeId(message.destination);\n if (!edgeId)\n return; // TODO: bucket edge emissions until handshake?\n const pipe = this._edgePipes.get(edgeId);\n pipe?.emit(`${ipcPrefix}:message`, message);\n }\n getEdge() {\n const edgeIds = [\n ...this._edges.keys(),\n ...[...this._edges.values()].map((edge) => edge.channelIds).flat(),\n ].filter((id, index, arr) => arr.indexOf(id) === index);\n return {\n id: this.id,\n channelIds: edgeIds,\n };\n }\n findEdgeId(destinaton) {\n for (const edge of this._edges.values()) {\n if (edge.id === destinaton || edge.channelIds.includes(destinaton)) {\n return edge.id;\n }\n }\n return null;\n }\n waitForEdge(destination) {\n const edgeId = this.findEdgeId(destination);\n if (edgeId)\n return Promise.resolve(edgeId);\n return new Promise((resolve) => {\n const checkEdge = (edge) => {\n if (edge.id === destination || edge.channelIds.includes(destination)) {\n this._emitter.off(kEdgeCreate, checkEdge);\n resolve(edge.id);\n }\n };\n this._emitter.on(kEdgeCreate, checkEdge);\n });\n }\n createNonce() {\n return Math.random().toString(16).slice(2);\n }\n send(messageData) {\n this._emitMessage({\n ...messageData,\n source: this.id,\n });\n }\n call(messageData, opts = {\n timeout: 10000,\n }) {\n const nonce = this.createNonce();\n const promise = new Promise((resolve, reject) => {\n const timeout = setTimeout(() => {\n this._callbacks.delete(nonce);\n reject(new Error('Call timed out'));\n }, opts.timeout);\n this._callbacks.set(nonce, (data) => {\n this._callbacks.delete(nonce);\n clearTimeout(timeout);\n if (opts.signal?.aborted) {\n if (opts.signal.reason instanceof Error)\n reject(opts.signal.reason);\n }\n else {\n if (data instanceof Error)\n reject(data);\n else\n resolve(data);\n }\n });\n });\n this._emitMessage({\n ...messageData,\n source: this.id,\n nonce,\n });\n return promise;\n }\n on(name, fn) {\n this._emitter.on(name, fn);\n return this;\n }\n off(name, fn) {\n this._emitter.off(name, fn);\n return this;\n }\n once(name, fn) {\n this._emitter.once(name, fn);\n return;\n }\n onCall(name, caller) {\n this._callers.set(name, async (...data) => await caller(...data));\n }\n removeCaller() { }\n handshakeAll() {\n this._pipes.forEach((pipe) => this._emitHandshake(pipe));\n }\n destroy() {\n this._emitter.removeAllListeners();\n this._callbacks.clear();\n this._callers.clear();\n this._edgePipes.clear();\n this._pipes = [];\n this._destroyed = true;\n }\n}\nexports.Channel = Channel;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RemoteClient = exports.RemoteHost = void 0;\n/** An RPC host, can be connected to by multiple clients */\nclass RemoteHost {\n channel;\n constructor(channel, spec) {\n this.channel = channel;\n for (const [name, fn] of Object.entries(spec)) {\n channel.onCall(name, async (input) => {\n const result = await fn(...input);\n return result;\n });\n }\n channel.handshakeAll();\n }\n}\nexports.RemoteHost = RemoteHost;\nclass RemoteClient {\n hostName;\n channel;\n constructor(hostName, channel) {\n this.hostName = hostName;\n this.channel = channel;\n }\n async connect() {\n await this.channel.waitForEdge(this.hostName);\n }\n run(name, ...output) {\n return this.channel.call({\n name,\n destination: this.hostName,\n data: output,\n });\n }\n}\nexports.RemoteClient = RemoteClient;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkerClient = exports.createWorkerHost = void 0;\nconst channel_1 = require(\"./channel\");\nconst rpc_1 = require(\"./rpc\");\nconst createWorkerHost = (name, spec) => {\n const channel = new channel_1.Channel(name);\n channel.addPipe({\n emit: (event, data) => postMessage({ event, data }),\n listen: (event, callback) => addEventListener('message', ({ data }) => {\n if (data.event === event)\n callback(data.data);\n }),\n });\n return new rpc_1.RemoteHost(channel, spec);\n};\nexports.createWorkerHost = createWorkerHost;\nclass WorkerClient extends rpc_1.RemoteClient {\n workerOpts;\n worker;\n workerListeners = [];\n url;\n constructor(name, hostName, source, workerOpts = {}) {\n const channel = new channel_1.Channel(name);\n super(hostName, channel);\n this.workerOpts = workerOpts;\n if (source instanceof Blob) {\n const blob = new Blob([source], { type: 'text/javascript' });\n this.url = URL.createObjectURL(blob);\n }\n else\n this.url = source;\n }\n async init() {\n const worker = (this.worker = new Worker(this.url, this.workerOpts));\n this.channel.addPipe({\n emit: (event, data) => worker.postMessage({ event, data }),\n listen: (event, callback) => {\n const listener = (ev) => {\n const { event: evName, data } = ev.data;\n if (evName === event)\n callback(data);\n };\n this.workerListeners.push(listener);\n worker.addEventListener('message', listener);\n },\n });\n await this.connect();\n }\n destroy() {\n if (this.worker) {\n for (const listener of this.workerListeners)\n this.worker.removeEventListener('message', listener);\n this.worker.terminate();\n }\n this.channel.destroy();\n if (this.url.startsWith('blob:'))\n URL.revokeObjectURL(this.url);\n }\n}\nexports.WorkerClient = WorkerClient;\n", "\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./channel\"), exports);\n__exportStar(require(\"./rpc\"), exports);\n__exportStar(require(\"./worker\"), exports);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { React } from \"@webpack/common\";\n\ntype Shiki = typeof import(\"../api/shiki\").shiki;\ninterface ThemeState {\n id: Shiki[\"currentThemeUrl\"],\n theme: Shiki[\"currentTheme\"],\n}\n\nconst currentTheme: ThemeState = {\n id: null,\n theme: null,\n};\n\nconst themeSetters = new Set>>();\n\nexport const useTheme = (): ThemeState => {\n const [, setTheme] = React.useState(currentTheme);\n\n React.useEffect(() => {\n themeSetters.add(setTheme);\n return () => void themeSetters.delete(setTheme);\n }, []);\n\n return currentTheme;\n};\n\nexport function dispatchTheme(state: ThemeState) {\n if (currentTheme.id === state.id) return;\n Object.assign(currentTheme, state);\n themeSetters.forEach(setTheme => setTheme(state));\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ILanguageRegistration } from \"@vap/shiki\";\n\nexport const VPC_REPO = \"Vap0r1ze/vapcord\";\nexport const VPC_REPO_COMMIT = \"88a7032a59cca40da170926651b08201ea3b965a\";\nexport const vpcRepoAssets = `https://raw.githubusercontent.com/${VPC_REPO}/${VPC_REPO_COMMIT}/assets/shiki-codeblocks`;\nexport const vpcRepoGrammar = (fileName: string) => `${vpcRepoAssets}/${fileName}`;\nexport const vpcRepoLanguages = `${vpcRepoAssets}/languages.json`;\n\nexport interface Language {\n name: string;\n id: string;\n devicon?: string;\n grammarUrl: string,\n grammar?: ILanguageRegistration[\"grammar\"];\n scopeName: string;\n aliases?: string[];\n custom?: boolean;\n}\nexport interface LanguageJson {\n name: string;\n id: string;\n fileName: string;\n devicon?: string;\n scopeName: string;\n aliases?: string[];\n}\n\nexport const languages: Record = {};\n\nexport const loadLanguages = async () => {\n const langsJson: LanguageJson[] = await fetch(vpcRepoLanguages).then(res => res.json());\n const loadedLanguages = Object.fromEntries(\n langsJson.map(lang => [lang.id, {\n ...lang,\n grammarUrl: vpcRepoGrammar(lang.fileName),\n }])\n );\n Object.assign(languages, loadedLanguages);\n};\n\nexport const getGrammar = (lang: Language): Promise> => {\n if (lang.grammar) return Promise.resolve(lang.grammar);\n return fetch(lang.grammarUrl).then(res => res.json());\n};\n\nconst aliasCache = new Map();\nexport function resolveLang(idOrAlias: string) {\n if (Object.prototype.hasOwnProperty.call(languages, idOrAlias)) return languages[idOrAlias];\n\n const lang = Object.values(languages).find(lang => lang.aliases?.includes(idOrAlias));\n\n if (!lang) return null;\n\n aliasCache.set(idOrAlias, lang);\n return lang;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { IShikiTheme } from \"@vap/shiki\";\n\nexport const SHIKI_REPO = \"shikijs/shiki\";\nexport const SHIKI_REPO_COMMIT = \"0b28ad8ccfbf2615f2d9d38ea8255416b8ac3043\";\nexport const shikiRepoTheme = (name: string) => `https://raw.githubusercontent.com/${SHIKI_REPO}/${SHIKI_REPO_COMMIT}/packages/shiki/themes/${name}.json`;\n\nexport const themes = {\n // Default\n DarkPlus: shikiRepoTheme(\"dark-plus\"),\n\n // Dev Choices\n MaterialCandy: \"https://raw.githubusercontent.com/millsp/material-candy/master/material-candy.json\",\n\n // More from Shiki repo\n DraculaSoft: shikiRepoTheme(\"dracula-soft\"),\n Dracula: shikiRepoTheme(\"dracula\"),\n GithubDarkDimmed: shikiRepoTheme(\"github-dark-dimmed\"),\n GithubDark: shikiRepoTheme(\"github-dark\"),\n GithubLight: shikiRepoTheme(\"github-light\"),\n LightPlus: shikiRepoTheme(\"light-plus\"),\n MaterialDarker: shikiRepoTheme(\"material-darker\"),\n MaterialDefault: shikiRepoTheme(\"material-default\"),\n MaterialLighter: shikiRepoTheme(\"material-lighter\"),\n MaterialOcean: shikiRepoTheme(\"material-ocean\"),\n MaterialPalenight: shikiRepoTheme(\"material-palenight\"),\n MinDark: shikiRepoTheme(\"min-dark\"),\n MinLight: shikiRepoTheme(\"min-light\"),\n Monokai: shikiRepoTheme(\"monokai\"),\n Nord: shikiRepoTheme(\"nord\"),\n OneDarkPro: shikiRepoTheme(\"one-dark-pro\"),\n Poimandres: shikiRepoTheme(\"poimandres\"),\n RosePineDawn: shikiRepoTheme(\"rose-pine-dawn\"),\n RosePineMoon: shikiRepoTheme(\"rose-pine-moon\"),\n RosePine: shikiRepoTheme(\"rose-pine\"),\n SlackDark: shikiRepoTheme(\"slack-dark\"),\n SlackOchin: shikiRepoTheme(\"slack-ochin\"),\n SolarizedDark: shikiRepoTheme(\"solarized-dark\"),\n SolarizedLight: shikiRepoTheme(\"solarized-light\"),\n VitesseDark: shikiRepoTheme(\"vitesse-dark\"),\n VitesseLight: shikiRepoTheme(\"vitesse-light\"),\n CssVariables: shikiRepoTheme(\"css-variables\"),\n};\n\nexport const themeCache = new Map();\n\nexport const getTheme = (url: string): Promise => {\n if (themeCache.has(url)) return Promise.resolve(themeCache.get(url)!);\n return fetch(url).then(res => res.json());\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { shikiOnigasmSrc, shikiWorkerSrc } from \"@utils/dependencies\";\nimport { WorkerClient } from \"@vap/core/ipc\";\nimport type { IShikiTheme, IThemedToken } from \"@vap/shiki\";\n\nimport { dispatchTheme } from \"../hooks/useTheme\";\nimport type { ShikiSpec } from \"../types\";\nimport { getGrammar, languages, loadLanguages, resolveLang } from \"./languages\";\nimport { themes } from \"./themes\";\n\nconst themeUrls = Object.values(themes);\n\nlet resolveClient: (client: WorkerClient) => void;\n\nexport const shiki = {\n client: null as WorkerClient | null,\n currentTheme: null as IShikiTheme | null,\n currentThemeUrl: null as string | null,\n timeoutMs: 10000,\n languages,\n themes,\n loadedThemes: new Set(),\n loadedLangs: new Set(),\n clientPromise: new Promise>(resolve => resolveClient = resolve),\n\n init: async (initThemeUrl: string | undefined) => {\n /** https://stackoverflow.com/q/58098143 */\n const workerBlob = await fetch(shikiWorkerSrc).then(res => res.blob());\n\n const client = shiki.client = new WorkerClient(\n \"shiki-client\",\n \"shiki-host\",\n workerBlob,\n { name: \"ShikiWorker\" },\n );\n await client.init();\n\n const themeUrl = initThemeUrl || themeUrls[0];\n\n await loadLanguages();\n await client.run(\"setOnigasm\", { wasm: shikiOnigasmSrc });\n await client.run(\"setHighlighter\", { theme: themeUrl, langs: [] });\n shiki.loadedThemes.add(themeUrl);\n await shiki._setTheme(themeUrl);\n resolveClient(client);\n },\n _setTheme: async (themeUrl: string) => {\n shiki.currentThemeUrl = themeUrl;\n const { themeData } = await shiki.client!.run(\"getTheme\", { theme: themeUrl });\n shiki.currentTheme = JSON.parse(themeData);\n dispatchTheme({ id: themeUrl, theme: shiki.currentTheme });\n },\n loadTheme: async (themeUrl: string) => {\n const client = await shiki.clientPromise;\n if (shiki.loadedThemes.has(themeUrl)) return;\n\n await client.run(\"loadTheme\", { theme: themeUrl });\n\n shiki.loadedThemes.add(themeUrl);\n },\n setTheme: async (themeUrl: string) => {\n await shiki.clientPromise;\n themeUrl ||= themeUrls[0];\n if (!shiki.loadedThemes.has(themeUrl)) await shiki.loadTheme(themeUrl);\n\n await shiki._setTheme(themeUrl);\n },\n loadLang: async (langId: string) => {\n const client = await shiki.clientPromise;\n const lang = resolveLang(langId);\n\n if (!lang || shiki.loadedLangs.has(lang.id)) return;\n\n await client.run(\"loadLanguage\", {\n lang: {\n ...lang,\n grammar: lang.grammar ?? await getGrammar(lang),\n }\n });\n shiki.loadedLangs.add(lang.id);\n },\n tokenizeCode: async (code: string, langId: string): Promise => {\n const client = await shiki.clientPromise;\n const lang = resolveLang(langId);\n if (!lang) return [];\n\n if (!shiki.loadedLangs.has(lang.id)) await shiki.loadLang(lang.id);\n\n return await client.run(\"codeToThemedTokens\", {\n code,\n lang: langId,\n theme: shiki.currentThemeUrl ?? themeUrls[0],\n });\n },\n destroy() {\n shiki.currentTheme = null;\n shiki.currentThemeUrl = null;\n dispatchTheme({ id: null, theme: null });\n shiki.client?.destroy();\n }\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n(window.VencordStyles ??= new Map()).set(\"src/plugins/shikiCodeblocks.desktop/devicon.css\", {\n name: \"src/plugins/shikiCodeblocks.desktop/devicon.css\",\n source: \"@import url(\\\"https://cdn.jsdelivr.net/gh/devicons/devicon@v2.10.1/devicon.min.css\\\");\\n\",\n classNames: {},\n dom: null,\n});\n\nexport default \"src/plugins/shikiCodeblocks.desktop/devicon.css\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type {\n ILanguageRegistration,\n IShikiTheme,\n IThemedToken,\n IThemeRegistration,\n} from \"@vap/shiki\";\n\n/** This must be atleast a subset of the `@vap/shiki-worker` spec */\nexport type ShikiSpec = {\n setOnigasm: ({ wasm }: { wasm: string; }) => Promise;\n setHighlighter: ({ theme, langs }: {\n theme: IThemeRegistration | void;\n langs: ILanguageRegistration[];\n }) => Promise;\n loadTheme: ({ theme }: {\n theme: string | IShikiTheme;\n }) => Promise;\n getTheme: ({ theme }: { theme: string; }) => Promise<{ themeData: string; }>;\n loadLanguage: ({ lang }: { lang: ILanguageRegistration; }) => Promise;\n codeToThemedTokens: ({\n code,\n lang,\n theme,\n }: {\n code: string;\n lang?: string;\n theme?: string;\n }) => Promise;\n};\n\nexport const enum StyleSheets {\n Main = \"MAIN\",\n DevIcons = \"DEVICONS\",\n}\n\nexport const enum HljsSetting {\n Never = \"NEVER\",\n Secondary = \"SECONDARY\",\n Primary = \"PRIMARY\",\n Always = \"ALWAYS\",\n}\nexport const enum DeviconSetting {\n Disabled = \"DISABLED\",\n Greyscale = \"GREYSCALE\",\n Color = \"COLOR\"\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { disableStyle, enableStyle } from \"@api/Styles\";\nimport { parseUrl } from \"@utils/misc\";\nimport { wordsFromPascal, wordsToTitle } from \"@utils/text\";\nimport { OptionType } from \"@utils/types\";\n\nimport { shiki } from \"./api/shiki\";\nimport { themes } from \"./api/themes\";\nimport deviconStyle from \"./devicon.css?managed\";\nimport { DeviconSetting, HljsSetting } from \"./types\";\n\nconst themeNames = Object.keys(themes) as (keyof typeof themes)[];\n\nexport type ShikiSettings = typeof settings.store;\nexport const settings = definePluginSettings({\n theme: {\n type: OptionType.SELECT,\n description: \"Default themes\",\n options: themeNames.map(themeName => ({\n label: wordsToTitle(wordsFromPascal(themeName)),\n value: themes[themeName],\n default: themes[themeName] === themes.DarkPlus,\n })),\n onChange: shiki.setTheme,\n },\n customTheme: {\n type: OptionType.STRING,\n description: \"A link to a custom vscode theme\",\n placeholder: themes.MaterialCandy,\n onChange: value => {\n shiki.setTheme(value || settings.store.theme);\n },\n },\n tryHljs: {\n type: OptionType.SELECT,\n description: \"Use the more lightweight default Discord highlighter and theme.\",\n options: [\n {\n label: \"Never\",\n value: HljsSetting.Never,\n },\n {\n label: \"Prefer Shiki instead of Highlight.js\",\n value: HljsSetting.Secondary,\n default: true,\n },\n {\n label: \"Prefer Highlight.js instead of Shiki\",\n value: HljsSetting.Primary,\n },\n {\n label: \"Always\",\n value: HljsSetting.Always,\n },\n ],\n },\n useDevIcon: {\n type: OptionType.SELECT,\n description: \"How to show language icons on codeblocks\",\n options: [\n {\n label: \"Disabled\",\n value: DeviconSetting.Disabled,\n },\n {\n label: \"Colorless\",\n value: DeviconSetting.Greyscale,\n default: true,\n },\n {\n label: \"Colored\",\n value: DeviconSetting.Color,\n },\n ],\n onChange: (newValue: DeviconSetting) => {\n if (newValue === DeviconSetting.Disabled) disableStyle(deviconStyle);\n else enableStyle(deviconStyle);\n },\n },\n bgOpacity: {\n type: OptionType.SLIDER,\n description: \"Background opacity\",\n markers: [0, 20, 40, 60, 80, 100],\n default: 100,\n componentProps: {\n stickToMarkers: false,\n onValueRender: null, // Defaults to percentage\n },\n },\n}, {\n theme: {\n disabled() { return !!this.store.customTheme; },\n },\n customTheme: {\n isValid(value) {\n if (!value) return true;\n const url = parseUrl(value);\n if (!url) return \"Must be a valid URL\";\n\n if (!url.pathname.endsWith(\".json\")) return \"Must be a json file\";\n\n return true;\n },\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PartialExcept } from \"@utils/types\";\nimport { React } from \"@webpack/common\";\n\nimport { shiki } from \"../api/shiki\";\nimport { settings as pluginSettings, ShikiSettings } from \"../settings\";\n\nexport function useShikiSettings(settingKeys: F[], overrides?: Partial) {\n const settings: Partial = pluginSettings.use(settingKeys);\n const [isLoading, setLoading] = React.useState(false);\n\n const withOverrides = { ...settings, ...overrides } as PartialExcept;\n const themeUrl = withOverrides.customTheme || withOverrides.theme;\n\n if (overrides) {\n const willChangeTheme = shiki.currentThemeUrl && themeUrl && themeUrl !== shiki.currentThemeUrl;\n const noOverrides = Object.keys(overrides).length === 0;\n\n if (isLoading && (!willChangeTheme || noOverrides)) setLoading(false);\n if (!isLoading && willChangeTheme) {\n setLoading(true);\n shiki.setTheme(themeUrl);\n }\n }\n\n return {\n ...withOverrides,\n isThemeLoading: themeUrl !== shiki.currentThemeUrl,\n };\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function hex2Rgb(hex: string) {\n hex = hex.slice(1);\n if (hex.length < 6)\n hex = hex\n .split(\"\")\n .map(c => c + c)\n .join(\"\");\n if (hex.length === 6) hex += \"ff\";\n if (hex.length > 6) hex = hex.slice(0, 6);\n return hex\n .split(/(..)/)\n .filter(Boolean)\n .map(c => parseInt(c, 16));\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { classNameFactory } from \"@api/Styles\";\nimport { hljs } from \"@webpack/common\";\n\nimport { resolveLang } from \"../api/languages\";\nimport { HighlighterProps } from \"../components/Highlighter\";\nimport { HljsSetting } from \"../types\";\n\nexport const cl = classNameFactory(\"shiki-\");\n\nexport const shouldUseHljs = ({\n lang,\n tryHljs,\n}: {\n lang: HighlighterProps[\"lang\"],\n tryHljs: HljsSetting,\n}) => {\n const hljsLang = lang ? hljs?.getLanguage?.(lang) : null;\n const shikiLang = lang ? resolveLang(lang) : null;\n const langName = shikiLang?.name;\n\n switch (tryHljs) {\n case HljsSetting.Always:\n return true;\n case HljsSetting.Primary:\n return !!hljsLang || lang === \"\";\n case HljsSetting.Secondary:\n return !langName && !!hljsLang;\n case HljsSetting.Never:\n return false;\n default: return false;\n }\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Clipboard, React } from \"@webpack/common\";\n\nexport function useCopyCooldown(cooldown: number) {\n const [copyCooldown, setCopyCooldown] = React.useState(false);\n\n function copy(text: string) {\n Clipboard.copy(text);\n setCopyCooldown(true);\n\n setTimeout(() => {\n setCopyCooldown(false);\n }, cooldown);\n }\n\n return [copyCooldown, copy] as const;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { useCopyCooldown } from \"../hooks/useCopyCooldown\";\n\nexport interface CopyButtonProps extends React.DetailedHTMLProps, HTMLButtonElement> {\n content: string;\n}\n\nexport function CopyButton({ content, ...props }: CopyButtonProps) {\n const [copyCooldown, copy] = useCopyCooldown(1000);\n\n return (\n copy(content)}\n >\n {copyCooldown ? \"Copied!\" : \"Copy\"}\n \n\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Clipboard } from \"@webpack/common\";\n\nimport { cl } from \"../utils/misc\";\nimport { CopyButton } from \"./CopyButton\";\n\nexport interface ButtonRowProps {\n theme: import(\"./Highlighter\").ThemeBase;\n content: string;\n}\n\nexport function ButtonRow({ content, theme }: ButtonRowProps) {\n const buttons: JSX.Element[] = [];\n\n if (Clipboard.SUPPORTS_COPY) {\n buttons.push(\n \n );\n }\n\n return
{buttons}
;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { IThemedToken } from \"@vap/shiki\";\nimport { hljs } from \"@webpack/common\";\n\nimport { cl } from \"../utils/misc\";\nimport { ThemeBase } from \"./Highlighter\";\n\nexport interface CodeProps {\n theme: ThemeBase;\n useHljs: boolean;\n lang?: string;\n content: string;\n tokens: IThemedToken[][] | null;\n}\n\nexport const Code = ({\n theme,\n useHljs,\n lang,\n content,\n tokens,\n}: CodeProps) => {\n let lines!: JSX.Element[];\n\n if (useHljs) {\n try {\n const { value: hljsHtml } = hljs.highlight(lang!, content, true);\n lines = hljsHtml\n .split(\"\\n\")\n .map((line, i) => );\n } catch {\n lines = content.split(\"\\n\").map(line => {line});\n }\n } else {\n const renderTokens =\n tokens ??\n content\n .split(\"\\n\")\n .map(line => [{ color: theme.plainColor, content: line } as IThemedToken]);\n\n lines = renderTokens.map(line => {\n // [Cynthia] this makes it so when you highlight the codeblock\n // empty lines are also selected and copied when you Ctrl+C.\n if (line.length === 0) {\n return {\"\\n\"};\n }\n\n return (\n <>\n {line.map(({ content, color, fontStyle }, i) => (\n \n {content}\n \n ))}\n \n );\n });\n }\n\n const codeTableRows = lines.map((line, i) => (\n \n {i + 1}\n {line}\n \n ));\n\n return {...codeTableRows}
;\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Language } from \"../api/languages\";\nimport { DeviconSetting } from \"../types\";\nimport { cl } from \"../utils/misc\";\n\nexport interface HeaderProps {\n langName?: string;\n useDevIcon: DeviconSetting;\n shikiLang: Language | null;\n}\n\nexport function Header({ langName, useDevIcon, shikiLang }: HeaderProps) {\n if (!langName) return <>;\n\n return (\n
\n {useDevIcon !== DeviconSetting.Disabled && shikiLang?.devicon && (\n \n )}\n {langName}\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { useAwaiter, useIntersection } from \"@utils/react\";\nimport { hljs, React } from \"@webpack/common\";\n\nimport { resolveLang } from \"../api/languages\";\nimport { shiki } from \"../api/shiki\";\nimport { useShikiSettings } from \"../hooks/useShikiSettings\";\nimport { useTheme } from \"../hooks/useTheme\";\nimport { hex2Rgb } from \"../utils/color\";\nimport { cl, shouldUseHljs } from \"../utils/misc\";\nimport { ButtonRow } from \"./ButtonRow\";\nimport { Code } from \"./Code\";\nimport { Header } from \"./Header\";\n\nexport interface ThemeBase {\n plainColor: string;\n accentBgColor: string;\n accentFgColor: string;\n backgroundColor: string;\n}\n\nexport interface HighlighterProps {\n lang?: string;\n content: string;\n isPreview: boolean;\n tempSettings?: Record;\n}\n\nexport const createHighlighter = (props: HighlighterProps) => (\n
\n        \n            \n        \n    
\n);\nexport const Highlighter = ({\n lang,\n content,\n isPreview,\n tempSettings,\n}: HighlighterProps) => {\n const {\n tryHljs,\n useDevIcon,\n bgOpacity,\n } = useShikiSettings([\"tryHljs\", \"useDevIcon\", \"bgOpacity\"], tempSettings);\n const { id: currentThemeId, theme: currentTheme } = useTheme();\n\n const shikiLang = lang ? resolveLang(lang) : null;\n const useHljs = shouldUseHljs({ lang, tryHljs });\n\n const [rootRef, isIntersecting] = useIntersection(true);\n\n const [tokens] = useAwaiter(async () => {\n if (!shikiLang || useHljs || !isIntersecting) return null;\n return await shiki.tokenizeCode(content, lang!);\n }, {\n fallbackValue: null,\n deps: [lang, content, currentThemeId, isIntersecting],\n });\n\n const themeBase: ThemeBase = {\n plainColor: currentTheme?.fg || \"var(--text-normal)\",\n accentBgColor:\n currentTheme?.colors?.[\"statusBar.background\"] || (useHljs ? \"#7289da\" : \"#007BC8\"),\n accentFgColor: currentTheme?.colors?.[\"statusBar.foreground\"] || \"#FFF\",\n backgroundColor:\n currentTheme?.colors?.[\"editor.background\"] || \"var(--background-secondary)\",\n };\n\n let langName;\n if (lang) langName = useHljs ? hljs?.getLanguage?.(lang)?.name : shikiLang?.name;\n\n return (\n \n \n \n \n {!isPreview && }\n \n \n );\n};\n\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nconst styles = new Map();\n\nexport function setStyle(css: string, id: string) {\n const style = document.createElement(\"style\");\n style.innerText = css;\n document.head.appendChild(style);\n styles.set(id, style);\n}\n\nexport function removeStyle(id: string) {\n styles.get(id)?.remove();\n return styles.delete(id);\n}\n\nexport const clearStyles = () => {\n styles.forEach(style => style.remove());\n styles.clear();\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./shiki.css\";\n\nimport { enableStyle } from \"@api/Styles\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nimport previewExampleText from \"~fileContent/previewExample.tsx\";\n\nimport { shiki } from \"./api/shiki\";\nimport { createHighlighter } from \"./components/Highlighter\";\nimport deviconStyle from \"./devicon.css?managed\";\nimport { settings } from \"./settings\";\nimport { DeviconSetting } from \"./types\";\nimport { clearStyles } from \"./utils/createStyle\";\n\nexport default definePlugin({\n name: \"ShikiCodeblocks\",\n description: \"Brings vscode-style codeblocks into Discord, powered by Shiki\",\n authors: [Devs.Vap],\n patches: [\n {\n find: \"codeBlock:{react(\",\n replacement: {\n match: /codeBlock:\\{react\\((\\i),(\\i),(\\i)\\)\\{/,\n replace: \"$&return $self.renderHighlighter($1,$2,$3);\"\n }\n }\n ],\n start: async () => {\n if (settings.store.useDevIcon !== DeviconSetting.Disabled)\n enableStyle(deviconStyle);\n\n await shiki.init(settings.store.customTheme || settings.store.theme);\n },\n stop: () => {\n shiki.destroy();\n clearStyles();\n },\n settingsAboutComponent: ({ tempSettings }) => createHighlighter({\n lang: \"tsx\",\n content: previewExampleText,\n isPreview: true,\n tempSettings,\n }),\n settings,\n\n // exports\n shiki,\n createHighlighter,\n renderHighlighter: ({ lang, content }: { lang: string; content: string; }) => {\n return createHighlighter({\n lang: lang?.toLowerCase(),\n content,\n isPreview: false,\n });\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"ShowAllMessageButtons\",\n description: \"Always show all message buttons no matter if you are holding the shift key or not.\",\n authors: [Devs.Nuckyz],\n\n patches: [\n {\n find: \".Messages.MESSAGE_UTILITIES_A11Y_LABEL\",\n replacement: {\n match: /isExpanded:\\i&&(.+?),/,\n replace: \"isExpanded:$1,\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { findComponentByCodeLazy, findLazy } from \"@webpack\";\nimport { i18n, useToken } from \"@webpack/common\";\n\nconst ColorMap = findLazy(m => m.colors?.INTERACTIVE_MUTED?.css);\nconst VerifiedIconComponent = findComponentByCodeLazy(\".CONNECTIONS_ROLE_OFFICIAL_ICON_TOOLTIP\");\n\nexport function VerifiedIcon() {\n const color = useToken(ColorMap.colors.INTERACTIVE_MUTED).hex();\n const forcedIconColor = useToken(ColorMap.colors.INTERACTIVE_ACTIVE).hex();\n\n return (\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { CopyIcon, LinkIcon } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport { copyWithToast } from \"@utils/misc\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByCodeLazy, findByPropsLazy, findComponentByCodeLazy, findStoreLazy } from \"@webpack\";\nimport { Text, Tooltip, UserProfileStore } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\n\nimport { VerifiedIcon } from \"./VerifiedIcon\";\n\nconst Section = findComponentByCodeLazy(\".lastSection\", \"children:\");\nconst ThemeStore = findStoreLazy(\"ThemeStore\");\nconst platforms: { get(type: string): ConnectionPlatform; } = findByPropsLazy(\"isSupported\", \"getByUrl\");\nconst getTheme: (user: User, displayProfile: any) => any = findByCodeLazy(',\"--profile-gradient-primary-color\"');\n\nconst enum Spacing {\n COMPACT,\n COZY,\n ROOMY\n}\nconst getSpacingPx = (spacing: Spacing | undefined) => (spacing ?? Spacing.COMPACT) * 2 + 4;\n\nconst settings = definePluginSettings({\n iconSize: {\n type: OptionType.NUMBER,\n description: \"Icon size (px)\",\n default: 32\n },\n iconSpacing: {\n type: OptionType.SELECT,\n description: \"Icon margin\",\n default: Spacing.COZY,\n options: [\n { label: \"Compact\", value: Spacing.COMPACT },\n { label: \"Cozy\", value: Spacing.COZY }, // US Spelling :/\n { label: \"Roomy\", value: Spacing.ROOMY }\n ]\n }\n});\n\ninterface Connection {\n type: string;\n id: string;\n name: string;\n verified: boolean;\n}\n\ninterface ConnectionPlatform {\n getPlatformUserUrl(connection: Connection): string;\n icon: { lightSVG: string, darkSVG: string; };\n}\n\nconst profilePopoutComponent = ErrorBoundary.wrap(({ user, displayProfile }: { user: User, displayProfile; }) =>\n \n);\n\nconst profilePanelComponent = ErrorBoundary.wrap(({ id }: { id: string; }) =>\n \n);\n\nfunction ConnectionsComponent({ id, theme }: { id: string, theme: string; }) {\n const profile = UserProfileStore.getUserProfile(id);\n if (!profile)\n return null;\n\n const connections: Connection[] = profile.connectedAccounts;\n if (!connections?.length)\n return null;\n\n return (\n
\n \n Connections\n \n \n {connections.map(connection => )}\n \n
\n );\n}\n\nfunction CompactConnectionComponent({ connection, theme }: { connection: Connection, theme: string; }) {\n const platform = platforms.get(connection.type);\n const url = platform.getPlatformUserUrl?.(connection);\n\n const img = (\n \n );\n\n const TooltipIcon = url ? LinkIcon : CopyIcon;\n\n return (\n \n {connection.name}\n {connection.verified && }\n \n \n }\n key={connection.id}\n >\n {tooltipProps =>\n url\n ? {\n if (Vencord.Plugins.isPluginEnabled(\"OpenInApp\")) {\n const OpenInApp = Vencord.Plugins.plugins.OpenInApp as any as typeof import(\"../openInApp\").default;\n // handleLink will .preventDefault() if applicable\n OpenInApp.handleLink(e.currentTarget, e);\n }\n }}\n >\n {img}\n \n : copyWithToast(connection.name)}\n >\n {img}\n \n\n }\n \n );\n}\n\nexport default definePlugin({\n name: \"ShowConnections\",\n description: \"Show connected accounts in user popouts\",\n authors: [Devs.TheKodeToad],\n patches: [\n {\n find: \"{isUsingGuildBio:null!==(\",\n replacement: {\n match: /,theme:\\i\\}\\)(?=,.{0,150}setNote:)/,\n replace: \"$&,$self.profilePopoutComponent({ user: arguments[0].user, displayProfile: arguments[0].displayProfile })\"\n }\n },\n {\n find: \"\\\"Profile Panel: user cannot be undefined\\\"\",\n replacement: {\n // createElement(Divider, {}), createElement(NoteComponent)\n match: /\\(0,\\i\\.jsx\\)\\(\\i\\.\\i,\\{\\}\\).{0,100}setNote:(?=.+?channelId:(\\i).id)/,\n replace: \"$self.profilePanelComponent({ id: $1.recipients[0] }),$&\"\n }\n }\n ],\n settings,\n profilePopoutComponent,\n profilePanelComponent\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { formatDuration } from \"@utils/text\";\nimport { findByPropsLazy, findComponentByCodeLazy, findComponentLazy } from \"@webpack\";\nimport { EmojiStore, FluxDispatcher, GuildMemberStore, GuildStore, moment, Parser, PermissionsBits, PermissionStore, SnowflakeUtils, Text, Timestamp, Tooltip, useEffect, useState } from \"@webpack/common\";\nimport type { Channel } from \"discord-types/general\";\n\nimport openRolesAndUsersPermissionsModal, { PermissionType, RoleOrUserPermission } from \"../../permissionsViewer/components/RolesAndUsersPermissions\";\nimport { sortPermissionOverwrites } from \"../../permissionsViewer/utils\";\nimport { settings } from \"..\";\n\nconst enum SortOrderTypes {\n LATEST_ACTIVITY = 0,\n CREATION_DATE = 1\n}\n\nconst enum ForumLayoutTypes {\n DEFAULT = 0,\n LIST = 1,\n GRID = 2\n}\n\ninterface DefaultReaction {\n emojiId: string | null;\n emojiName: string | null;\n}\n\ninterface Tag {\n id: string;\n name: string;\n emojiId: string | null;\n emojiName: string | null;\n moderated: boolean;\n}\n\ninterface ExtendedChannel extends Channel {\n defaultThreadRateLimitPerUser?: number;\n defaultSortOrder?: SortOrderTypes | null;\n defaultForumLayout?: ForumLayoutTypes;\n defaultReactionEmoji?: DefaultReaction | null;\n availableTags?: Array;\n}\n\nconst enum ChannelTypes {\n GUILD_TEXT = 0,\n GUILD_VOICE = 2,\n GUILD_ANNOUNCEMENT = 5,\n GUILD_STAGE_VOICE = 13,\n GUILD_FORUM = 15\n}\n\nconst enum VideoQualityModes {\n AUTO = 1,\n FULL = 2\n}\n\nconst enum ChannelFlags {\n PINNED = 1 << 1,\n REQUIRE_TAG = 1 << 4\n}\n\n\nconst ChatScrollClasses = findByPropsLazy(\"auto\", \"content\", \"scrollerBase\");\nconst ChatClasses = findByPropsLazy(\"chat\", \"content\", \"noChat\", \"chatContent\");\nconst ChannelBeginHeader = findComponentByCodeLazy(\".Messages.ROLE_REQUIRED_SINGLE_USER_MESSAGE\");\nconst TagComponent = findComponentLazy(m => {\n if (typeof m !== \"function\") return false;\n\n const code = Function.prototype.toString.call(m);\n // Get the component which doesn't include increasedActivity\n return code.includes(\".Messages.FORUM_TAG_A11Y_FILTER_BY_TAG\") && !code.includes(\"increasedActivityPill\");\n});\n\nconst EmojiParser = findByPropsLazy(\"convertSurrogateToName\");\nconst EmojiUtils = findByPropsLazy(\"getURL\", \"getEmojiColors\");\n\nconst ChannelTypesToChannelNames = {\n [ChannelTypes.GUILD_TEXT]: \"text\",\n [ChannelTypes.GUILD_ANNOUNCEMENT]: \"announcement\",\n [ChannelTypes.GUILD_FORUM]: \"forum\",\n [ChannelTypes.GUILD_VOICE]: \"voice\",\n [ChannelTypes.GUILD_STAGE_VOICE]: \"stage\"\n};\n\nconst SortOrderTypesToNames = {\n [SortOrderTypes.LATEST_ACTIVITY]: \"Latest activity\",\n [SortOrderTypes.CREATION_DATE]: \"Creation date\"\n};\n\nconst ForumLayoutTypesToNames = {\n [ForumLayoutTypes.DEFAULT]: \"Not set\",\n [ForumLayoutTypes.LIST]: \"List view\",\n [ForumLayoutTypes.GRID]: \"Gallery view\"\n};\n\nconst VideoQualityModesToNames = {\n [VideoQualityModes.AUTO]: \"Automatic\",\n [VideoQualityModes.FULL]: \"720p\"\n};\n\n// Icon from the modal when clicking a message link you don't have access to view\nconst HiddenChannelLogo = \"/assets/433e3ec4319a9d11b0cbe39342614982.svg\";\n\nfunction HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) {\n const [viewAllowedUsersAndRoles, setViewAllowedUsersAndRoles] = useState(settings.store.defaultAllowedUsersAndRolesDropdownState);\n const [permissions, setPermissions] = useState([]);\n\n const {\n type,\n topic,\n lastMessageId,\n defaultForumLayout,\n lastPinTimestamp,\n defaultAutoArchiveDuration,\n availableTags,\n id: channelId,\n rateLimitPerUser,\n defaultThreadRateLimitPerUser,\n defaultSortOrder,\n defaultReactionEmoji,\n bitrate,\n rtcRegion,\n videoQualityMode,\n permissionOverwrites,\n guild_id\n } = channel;\n\n useEffect(() => {\n const membersToFetch: Array = [];\n\n const guildOwnerId = GuildStore.getGuild(guild_id).ownerId;\n if (!GuildMemberStore.getMember(guild_id, guildOwnerId)) membersToFetch.push(guildOwnerId);\n\n Object.values(permissionOverwrites).forEach(({ type, id: userId }) => {\n if (type === 1 && !GuildMemberStore.getMember(guild_id, userId)) {\n membersToFetch.push(userId);\n }\n });\n\n if (membersToFetch.length > 0) {\n FluxDispatcher.dispatch({\n type: \"GUILD_MEMBERS_REQUEST\",\n guildIds: [guild_id],\n userIds: membersToFetch\n });\n }\n\n if (Settings.plugins.PermissionsViewer.enabled) {\n setPermissions(sortPermissionOverwrites(Object.values(permissionOverwrites).map(overwrite => ({\n type: overwrite.type as PermissionType,\n id: overwrite.id,\n overwriteAllow: overwrite.allow,\n overwriteDeny: overwrite.deny\n })), guild_id));\n }\n }, [channelId]);\n\n return (\n
\n
\n \n\n
\n This is a {!PermissionStore.can(PermissionsBits.VIEW_CHANNEL, channel) ? \"hidden\" : \"locked\"} {ChannelTypesToChannelNames[type]} channel.\n {channel.isNSFW() &&\n \n {({ onMouseLeave, onMouseEnter }) => (\n \n \n \n )}\n \n }\n
\n\n {(!channel.isGuildVoice() && !channel.isGuildStageVoice()) && (\n \n You can not see the {channel.isForumChannel() ? \"posts\" : \"messages\"} of this channel.\n {channel.isForumChannel() && topic && topic.length > 0 && \" However you may see its guidelines:\"}\n \n )}\n\n {channel.isForumChannel() && topic && topic.length > 0 && (\n
\n {Parser.parseTopic(topic, false, { channelId })}\n
\n )}\n\n {lastMessageId &&\n \n Last {channel.isForumChannel() ? \"post\" : \"message\"} created:\n \n \n }\n\n {lastPinTimestamp &&\n Last message pin: \n }\n {(rateLimitPerUser ?? 0) > 0 &&\n Slowmode: {formatDuration(rateLimitPerUser!, \"seconds\")}\n }\n {(defaultThreadRateLimitPerUser ?? 0) > 0 &&\n \n Default thread slowmode: {formatDuration(defaultThreadRateLimitPerUser!, \"seconds\")}\n \n }\n {((channel.isGuildVoice() || channel.isGuildStageVoice()) && bitrate != null) &&\n Bitrate: {bitrate} bits\n }\n {rtcRegion !== undefined &&\n Region: {rtcRegion ?? \"Automatic\"}\n }\n {(channel.isGuildVoice() || channel.isGuildStageVoice()) &&\n Video quality mode: {VideoQualityModesToNames[videoQualityMode ?? VideoQualityModes.AUTO]}\n }\n {(defaultAutoArchiveDuration ?? 0) > 0 &&\n \n Default inactivity duration before archiving {channel.isForumChannel() ? \"posts\" : \"threads\"}:\n {\" \" + formatDuration(defaultAutoArchiveDuration!, \"minutes\")}\n \n }\n {defaultForumLayout != null &&\n Default layout: {ForumLayoutTypesToNames[defaultForumLayout]}\n }\n {defaultSortOrder != null &&\n Default sort order: {SortOrderTypesToNames[defaultSortOrder]}\n }\n {defaultReactionEmoji != null &&\n
\n Default reaction emoji:\n {Parser.defaultRules[defaultReactionEmoji.emojiName ? \"emoji\" : \"customEmoji\"].react({\n name: defaultReactionEmoji.emojiName\n ? EmojiParser.convertSurrogateToName(defaultReactionEmoji.emojiName)\n : EmojiStore.getCustomEmojiById(defaultReactionEmoji.emojiId)?.name ?? \"\",\n emojiId: defaultReactionEmoji.emojiId ?? void 0,\n surrogate: defaultReactionEmoji.emojiName ?? void 0,\n src: defaultReactionEmoji.emojiName\n ? EmojiUtils.getURL(defaultReactionEmoji.emojiName)\n : void 0\n }, void 0, { key: \"0\" })}\n
\n }\n {channel.hasFlag(ChannelFlags.REQUIRE_TAG) &&\n Posts on this forum require a tag to be set.\n }\n {availableTags && availableTags.length > 0 &&\n
\n Available tags:\n
\n {availableTags.map(tag => )}\n
\n
\n }\n
\n
\n {Settings.plugins.PermissionsViewer.enabled && (\n \n {({ onMouseLeave, onMouseEnter }) => (\n openRolesAndUsersPermissionsModal(permissions, GuildStore.getGuild(channel.guild_id), channel.name)}\n >\n \n \n \n \n )}\n \n )}\n Allowed users and roles:\n \n {({ onMouseLeave, onMouseEnter }) => (\n setViewAllowedUsersAndRoles(v => !v)}\n >\n \n \n \n \n )}\n \n
\n {viewAllowedUsersAndRoles && }\n
\n
\n
\n );\n}\n\nexport default ErrorBoundary.wrap(HiddenChannelLockScreen);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./style.css\";\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { canonicalizeMatch } from \"@utils/patches\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ChannelStore, PermissionsBits, PermissionStore, Tooltip } from \"@webpack/common\";\nimport type { Channel, Role } from \"discord-types/general\";\n\nimport HiddenChannelLockScreen from \"./components/HiddenChannelLockScreen\";\n\nconst ChannelListClasses = findByPropsLazy(\"channelEmoji\", \"unread\", \"icon\");\n\nconst enum ShowMode {\n LockIcon,\n HiddenIconWithMutedStyle\n}\n\nexport const settings = definePluginSettings({\n hideUnreads: {\n description: \"Hide Unreads\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n },\n showMode: {\n description: \"The mode used to display hidden channels.\",\n type: OptionType.SELECT,\n options: [\n { label: \"Plain style with Lock Icon instead\", value: ShowMode.LockIcon, default: true },\n { label: \"Muted style with hidden eye icon on the right\", value: ShowMode.HiddenIconWithMutedStyle },\n ],\n restartNeeded: true\n },\n defaultAllowedUsersAndRolesDropdownState: {\n description: \"Whether the allowed users and roles dropdown on hidden channels should be open by default\",\n type: OptionType.BOOLEAN,\n default: true\n }\n});\n\nexport default definePlugin({\n name: \"ShowHiddenChannels\",\n description: \"Show channels that you do not have access to view.\",\n authors: [Devs.BigDuck, Devs.AverageReactEnjoyer, Devs.D3SOX, Devs.Ven, Devs.Nuckyz, Devs.Nickyux, Devs.dzshn],\n settings,\n\n patches: [\n {\n // RenderLevel defines if a channel is hidden, collapsed in category, visible, etc\n find: '\"placeholder-channel-id\"',\n replacement: [\n // Remove the special logic for channels we don't have access to\n {\n match: /if\\(!\\i\\.\\i\\.can\\(\\i\\.\\i\\.VIEW_CHANNEL.+?{if\\(this\\.id===\\i\\).+?threadIds:\\i}}/,\n replace: \"\"\n },\n // Do not check for unreads when selecting the render level if the channel is hidden\n {\n match: /(?=!\\(0,\\i\\.getHasImportantUnread\\)\\(this\\.record\\))/,\n replace: \"$self.isHiddenChannel(this.record)||\"\n },\n // Make channels we dont have access to be the same level as normal ones\n {\n match: /(activeJoinedRelevantThreads:.{0,50}VIEW_CHANNEL.+?renderLevel:(.+?),threadIds.+?renderLevel:).+?(?=,threadIds)/g,\n replace: (_, rest, defaultRenderLevel) => `${rest}${defaultRenderLevel}`\n },\n // Remove permission checking for getRenderLevel function\n {\n match: /(?<=getRenderLevel\\(\\i\\){.+?return)!\\i\\.\\i\\.can\\(\\i\\.\\i\\.VIEW_CHANNEL,this\\.record\\)\\|\\|/,\n replace: \" \"\n }\n ]\n },\n {\n find: \"VoiceChannel, transitionTo: Channel does not have a guildId\",\n replacement: [\n {\n // Do not show confirmation to join a voice channel when already connected to another if clicking on a hidden voice channel\n match: /(?<=getCurrentClientVoiceChannelId\\((\\i)\\.guild_id\\);return)/,\n replace: (_, channel) => `!$self.isHiddenChannel(${channel})&&`\n },\n {\n // Prevent Discord from trying to connect to hidden voice channels\n match: /(?=&&\\i\\.\\i\\.selectVoiceChannel\\((\\i)\\.id\\))/,\n replace: (_, channel) => `&&!$self.isHiddenChannel(${channel})`\n },\n {\n // Make Discord show inside the channel if clicking on a hidden or locked channel\n match: /!__OVERLAY__&&\\((?<=selectVoiceChannel\\((\\i)\\.id\\).+?)/,\n replace: (m, channel) => `${m}$self.isHiddenChannel(${channel},true)||`\n }\n ]\n },\n // Prevent Discord from trying to connect to hidden stage channels\n {\n find: \".MAX_STAGE_VOICE_USER_LIMIT})\",\n replacement: {\n match: /!(\\i)\\.isRoleSubscriptionTemplatePreviewChannel\\(\\)/,\n replace: (m, channel) => `${m}&&!$self.isHiddenChannel(${channel})`\n }\n },\n {\n find: \"ChannelItemEditButton:function(){\",\n replacement: [\n // Render null instead of the buttons if the channel is hidden\n ...[\n \"renderEditButton\",\n \"renderInviteButton\",\n ].map(func => ({\n match: new RegExp(`(?<=${func}\\\\(\\\\){)`, \"g\"), // Global because Discord has multiple declarations of the same functions\n replace: \"if($self.isHiddenChannel(this.props.channel))return null;\"\n }))\n ]\n },\n {\n find: \"VoiceChannel.renderPopout: There must always be something to render\",\n all: true,\n // Render null instead of the buttons if the channel is hidden\n replacement: {\n match: /(?<=renderOpenChatButton=\\(\\)=>{)/,\n replace: \"if($self.isHiddenChannel(this.props.channel))return null;\"\n }\n },\n {\n find: \".Messages.CHANNEL_TOOLTIP_DIRECTORY\",\n predicate: () => settings.store.showMode === ShowMode.LockIcon,\n replacement: {\n // Lock Icon\n match: /(?=switch\\((\\i)\\.type\\).{0,30}\\.GUILD_ANNOUNCEMENT.{0,70}\\(0,\\i\\.\\i\\))/,\n replace: (_, channel) => `if($self.isHiddenChannel(${channel}))return $self.LockIcon;`\n }\n },\n {\n find: \"UNREAD_IMPORTANT:\",\n predicate: () => settings.store.showMode === ShowMode.HiddenIconWithMutedStyle,\n replacement: [\n // Make the channel appear as muted if it's hidden\n {\n match: /(?<={channel:(\\i),name:\\i,muted:(\\i).+?;)/,\n replace: (_, channel, muted) => `${muted}=$self.isHiddenChannel(${channel})?true:${muted};`\n },\n // Add the hidden eye icon if the channel is hidden\n {\n match: /\\i\\.children.+?:null(?<=,channel:(\\i).+?)/,\n replace: (m, channel) => `${m},$self.isHiddenChannel(${channel})?$self.HiddenChannelIcon():null`\n },\n // Make voice channels also appear as muted if they are muted\n {\n match: /(?<=\\.wrapper:\\i\\.notInteractive,)(.+?)if\\((\\i)\\)return (\\i\\.MUTED);/,\n replace: (_, otherClasses, isMuted, mutedClassExpression) => `${isMuted}?${mutedClassExpression}:\"\",${otherClasses}if(${isMuted})return \"\";`\n }\n ]\n },\n {\n find: \"UNREAD_IMPORTANT:\",\n replacement: [\n {\n // Make muted channels also appear as unread if hide unreads is false, using the HiddenIconWithMutedStyle and the channel is hidden\n predicate: () => settings.store.hideUnreads === false && settings.store.showMode === ShowMode.HiddenIconWithMutedStyle,\n match: /\\.LOCKED;if\\((?<={channel:(\\i).+?)/,\n replace: (m, channel) => `${m}!$self.isHiddenChannel(${channel})&&`\n },\n {\n // Hide unreads\n predicate: () => settings.store.hideUnreads === true,\n match: /(?<={channel:(\\i),name:\\i,.+?unread:(\\i).+?;)/,\n replace: (_, channel, unread) => `${unread}=$self.isHiddenChannel(${channel})?false:${unread};`\n }\n ]\n },\n {\n // Hide the new version of unreads box for hidden channels\n find: '.displayName=\"ChannelListUnreadsStore\"',\n replacement: {\n match: /(?<=if\\(null==(\\i))(?=.{0,160}?getHasImportantUnread\\)\\(\\i\\))/g, // Global because Discord has multiple methods like that in the same module\n replace: (_, channel) => `||$self.isHiddenChannel(${channel})`\n }\n },\n {\n // Make the old version of unreads box not visible for hidden channels\n find: \"renderBottomUnread(){\",\n replacement: {\n match: /(?=&&\\(0,\\i\\.getHasImportantUnread\\)\\((\\i\\.record)\\))/,\n replace: \"&&!$self.isHiddenChannel($1)\"\n }\n },\n {\n // Make the state of the old version of unreads box not include hidden channels\n find: \".useFlattenedChannelIdListWithThreads)\",\n replacement: {\n match: /(?=&&\\(0,\\i\\.getHasImportantUnread\\)\\((\\i)\\))/,\n replace: \"&&!$self.isHiddenChannel($1)\"\n }\n },\n // Only render the channel header and buttons that work when transitioning to a hidden channel\n {\n find: \"Missing channel in Channel.renderHeaderToolbar\",\n replacement: [\n {\n match: /(?<=renderHeaderToolbar=\\(\\)=>{.+?case \\i\\.\\i\\.GUILD_TEXT:)(?=.+?(\\i\\.push.{0,50}channel:(\\i)},\"notifications\"\\)\\)))(?<=isLurking:(\\i).+?)/,\n replace: (_, pushNotificationButtonExpression, channel, isLurking) => `if(!${isLurking}&&$self.isHiddenChannel(${channel})){${pushNotificationButtonExpression};break;}`\n },\n {\n match: /(?<=renderHeaderToolbar=\\(\\)=>{.+?case \\i\\.\\i\\.GUILD_MEDIA:)(?=.+?(\\i\\.push.{0,40}channel:(\\i)},\"notifications\"\\)\\)))(?<=isLurking:(\\i).+?)/,\n replace: (_, pushNotificationButtonExpression, channel, isLurking) => `if(!${isLurking}&&$self.isHiddenChannel(${channel})){${pushNotificationButtonExpression};break;}`\n },\n {\n match: /renderMobileToolbar=\\(\\)=>{.+?case \\i\\.\\i\\.GUILD_DIRECTORY:(?<=let{channel:(\\i).+?)/,\n replace: (m, channel) => `${m}if($self.isHiddenChannel(${channel}))break;`\n },\n {\n match: /(?<=renderHeaderBar=\\(\\)=>{.+?hideSearch:(\\i)\\.isDirectory\\(\\))/,\n replace: (_, channel) => `||$self.isHiddenChannel(${channel})`\n },\n {\n match: /(?<=renderSidebar\\(\\){)/,\n replace: \"if($self.isHiddenChannel(this.props.channel))return null;\"\n },\n {\n match: /(?<=renderChat\\(\\){)/,\n replace: \"if($self.isHiddenChannel(this.props.channel))return $self.HiddenChannelLockScreen(this.props.channel);\"\n }\n ]\n },\n // Avoid trying to fetch messages from hidden channels\n {\n find: '\"MessageManager\"',\n replacement: {\n match: /\"Skipping fetch because channelId is a static route\"\\);return}(?=.+?getChannel\\((\\i)\\))/,\n replace: (m, channelId) => `${m}if($self.isHiddenChannel({channelId:${channelId}}))return;`\n }\n },\n // Patch keybind handlers so you can't accidentally jump to hidden channels\n {\n find: '\"alt+shift+down\"',\n replacement: {\n match: /(?<=getChannel\\(\\i\\);return null!=(\\i))(?=.{0,150}?getHasImportantUnread\\)\\(\\i\\))/,\n replace: (_, channel) => `&&!$self.isHiddenChannel(${channel})`\n }\n },\n // Patch keybind handlers so you can't accidentally jump to hidden channels\n {\n find: \".APPLICATION_STORE&&null!=\",\n replacement: {\n match: /(?<=getState\\(\\)\\.channelId.{0,30}?\\(0,\\i\\.\\i\\)\\(\\i\\))(?=\\.map\\()/,\n replace: \".filter(e=>!$self.isHiddenChannel(e))\"\n }\n },\n {\n find: \".Messages.ROLE_REQUIRED_SINGLE_USER_MESSAGE\",\n replacement: [\n {\n // Change the role permission check to CONNECT if the channel is locked\n match: /ADMINISTRATOR\\)\\|\\|(?<=context:(\\i)}.+?)(?=(.+?)VIEW_CHANNEL)/,\n replace: (m, channel, permCheck) => `${m}!Vencord.Webpack.Common.PermissionStore.can(${PermissionsBits.CONNECT}n,${channel})?${permCheck}CONNECT):`\n },\n {\n // Change the permissionOverwrite check to CONNECT if the channel is locked\n match: /permissionOverwrites\\[.+?\\i=(?<=context:(\\i)}.+?)(?=(.+?)VIEW_CHANNEL)/,\n replace: (m, channel, permCheck) => `${m}!Vencord.Webpack.Common.PermissionStore.can(${PermissionsBits.CONNECT}n,${channel})?${permCheck}CONNECT):`\n },\n {\n // Include the @everyone role in the allowed roles list for Hidden Channels\n match: /sortBy.{0,30}?\\.filter\\(\\i=>(?<=channel:(\\i).+?)/,\n replace: (m, channel) => `${m}$self.isHiddenChannel(${channel})?true:`\n },\n {\n // If the @everyone role has the required permissions, make the array only contain it\n match: /computePermissionsForRoles.+?.value\\(\\)(?<=channel:(\\i).+?)/,\n replace: (m, channel) => `${m}.reduce(...$self.makeAllowedRolesReduce(${channel}.guild_id))`\n },\n {\n // Patch the header to only return allowed users and roles if it's a hidden channel or locked channel (Like when it's used on the HiddenChannelLockScreen)\n match: /MANAGE_ROLES.{0,90}?return(?=\\(.+?(\\(0,\\i\\.jsxs\\)\\(\"div\",{className:\\i\\.members.+?guildId:(\\i)\\.guild_id.+?roleColor.+?\\]}\\)))/,\n replace: (m, component, channel) => {\n // Export the channel for the users allowed component patch\n component = component.replace(canonicalizeMatch(/(?<=users:\\i)/), `,shcChannel:${channel}`);\n // Always render the component for multiple allowed users\n component = component.replace(canonicalizeMatch(/1!==\\i\\.length/), \"true\");\n\n return `${m} $self.isHiddenChannel(${channel},true)?${component}:`;\n }\n }\n ]\n },\n {\n find: \".avatars),children\",\n replacement: [\n {\n // Create a variable for the channel prop\n match: /maxUsers:\\i,users:\\i.+?=(\\i).+?;/,\n replace: (m, props) => `${m}let{shcChannel}=${props};`\n },\n {\n // Make Discord always render the plus button if the component is used inside the HiddenChannelLockScreen\n match: /\\i>0(?=&&.{0,60}renderPopout)/,\n replace: m => `($self.isHiddenChannel(shcChannel,true)?true:${m})`\n },\n {\n // Prevent Discord from overwriting the last children with the plus button if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen\n match: /(?<=\\.value\\(\\),(\\i)=.+?length-)1(?=\\]=.{0,60}renderPopout)/,\n replace: (_, amount) => `($self.isHiddenChannel(shcChannel,true)&&${amount}<=0?0:1)`\n },\n {\n // Show only the plus text without overflowed children amount if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen\n match: /(?<=\"\\+\",)(\\i)\\+1/,\n replace: (m, amount) => `$self.isHiddenChannel(shcChannel,true)&&${amount}<=0?\"\":${m}`\n }\n ]\n },\n {\n find: \".Messages.CHANNEL_CALL_CURRENT_SPEAKER.format\",\n replacement: [\n {\n // Remove the divider and the open chat button for the HiddenChannelLockScreen\n match: /\"more-options-popout\"\\)\\),(?<=let{channel:(\\i).+?inCall:(\\i).+?)/,\n replace: (m, channel, inCall) => `${m}${inCall}||!$self.isHiddenChannel(${channel},true)&&`\n },\n {\n // Remove invite users button for the HiddenChannelLockScreen\n match: /\"popup\".{0,100}?if\\((?<=let{channel:(\\i).+?inCall:(\\i).+?)/,\n replace: (m, channel, inCall) => `${m}(${inCall}||!$self.isHiddenChannel(${channel},true))&&`\n },\n ]\n },\n {\n find: \".Messages.EMBEDDED_ACTIVITIES_DEVELOPER_ACTIVITY_SHELF_FETCH_ERROR\",\n replacement: [\n {\n // Render our HiddenChannelLockScreen component instead of the main voice channel component\n match: /renderContent\\(\\i\\){.+?this\\.renderVoiceChannelEffects.+?children:/,\n replace: \"$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)?$self.HiddenChannelLockScreen(this.props.channel):\"\n },\n {\n // Disable gradients for the HiddenChannelLockScreen of voice channels\n match: /renderContent\\(\\i\\){.+?disableGradients:/,\n replace: \"$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)||\"\n },\n {\n // Disable useless components for the HiddenChannelLockScreen of voice channels\n match: /(?:{|,)render(?!Header|ExternalHeader).{0,30}?:/g,\n replace: \"$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)?()=>null:\"\n },\n {\n // Disable bad CSS class which mess up hidden voice channels styling\n match: /callContainer,(?<=\\i\\.callContainer,)/,\n replace: '$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)?\"\":'\n }\n ]\n },\n {\n find: '\"HasBeenInStageChannel\"',\n replacement: [\n {\n // Render our HiddenChannelLockScreen component instead of the main stage channel component\n match: /\"124px\".+?children:(?<=let \\i,{channel:(\\i).+?)(?=.{0,20}?}\\)}function)/,\n replace: (m, channel) => `${m}$self.isHiddenChannel(${channel})?$self.HiddenChannelLockScreen(${channel}):`\n },\n {\n // Disable useless components for the HiddenChannelLockScreen of stage channels\n match: /render(?:BottomLeft|BottomCenter|BottomRight|ChatToasts):\\(\\)=>(?<=let \\i,{channel:(\\i).+?)/g,\n replace: (m, channel) => `${m}$self.isHiddenChannel(${channel})?null:`\n },\n {\n // Disable gradients for the HiddenChannelLockScreen of stage channels\n match: /\"124px\".+?disableGradients:(?<=let \\i,{channel:(\\i).+?)/,\n replace: (m, channel) => `${m}$self.isHiddenChannel(${channel})||`\n },\n {\n // Disable strange styles applied to the header for the HiddenChannelLockScreen of stage channels\n match: /\"124px\".+?style:(?<=let \\i,{channel:(\\i).+?)/,\n replace: (m, channel) => `${m}$self.isHiddenChannel(${channel})?void 0:`\n }\n ]\n },\n {\n find: \".Messages.STAGE_FULL_MODERATOR_TITLE\",\n replacement: [\n {\n // Remove the divider and amount of users in stage channel components for the HiddenChannelLockScreen\n match: /\\(0,\\i\\.jsx\\)\\(\\i\\.\\i\\.Divider.+?}\\)]}\\)(?=.+?:(\\i)\\.guild_id)/,\n replace: (m, channel) => `$self.isHiddenChannel(${channel})?null:(${m})`\n },\n {\n // Remove the open chat button for the HiddenChannelLockScreen\n match: /\"recents\".+?&&(?=\\(.+?channelId:(\\i)\\.id,showRequestToSpeakSidebar)/,\n replace: (m, channel) => `${m}!$self.isHiddenChannel(${channel})&&`\n }\n ]\n },\n {\n // Make the chat input bar channel list contain hidden channels\n find: \",queryStaticRouteChannels(\",\n replacement: [\n {\n // Make the getChannels call to GuildChannelStore return hidden channels\n match: /(?<=queryChannels\\(\\i\\){.+?getChannels\\(\\i)(?=\\))/,\n replace: \",true\"\n },\n {\n // Avoid filtering out hidden channels from the channel list\n match: /(?<=queryChannels\\(\\i\\){.+?isGuildChannelType\\)\\((\\i)\\.type\\))(?=&&!\\i\\.\\i\\.can\\()/,\n replace: \"&&!$self.isHiddenChannel($1)\"\n }\n ]\n },\n {\n find: \"\\\"^/guild-stages/(\\\\\\\\d+)(?:/)?(\\\\\\\\d+)?\\\"\",\n replacement: {\n // Make mentions of hidden channels work\n match: /\\i\\.\\i\\.can\\(\\i\\.\\i\\.VIEW_CHANNEL,\\i\\)/,\n replace: \"true\"\n },\n },\n {\n find: \".shouldCloseDefaultModals\",\n replacement: {\n // Show inside voice channel instead of trying to join them when clicking on a channel mention\n match: /(?<=getChannel\\(\\i\\);if\\(null!=(\\i))(?=.{0,100}?selectVoiceChannel)/,\n replace: (_, channel) => `&&!$self.isHiddenChannel(${channel})`\n }\n },\n {\n find: '.displayName=\"GuildChannelStore\"',\n replacement: [\n {\n // Make GuildChannelStore contain hidden channels\n match: /isChannelGated\\(.+?\\)(?=&&)/,\n replace: m => `${m}&&false`\n },\n {\n // Filter hidden channels from GuildChannelStore.getChannels unless told otherwise\n match: /(?<=getChannels\\(\\i)(\\){.+?)return (.+?)}/,\n replace: (_, rest, channels) => `,shouldIncludeHidden${rest}return $self.resolveGuildChannels(${channels},shouldIncludeHidden??false);}`\n }\n ]\n },\n {\n find: \".Messages.FORM_LABEL_MUTED\",\n replacement: {\n // Make GuildChannelStore.getChannels return hidden channels\n match: /(?<=getChannels\\(\\i)(?=\\))/,\n replace: \",true\"\n }\n },\n {\n find: '.displayName=\"NowPlayingViewStore\"',\n replacement: {\n // Make active now voice states on hidden channels\n match: /(getVoiceStateForUser.{0,150}?)&&\\i\\.\\i\\.canWithPartialContext.{0,20}VIEW_CHANNEL.+?}\\)(?=\\?)/,\n replace: \"$1\"\n }\n }\n ],\n\n isHiddenChannel(channel: Channel & { channelId?: string; }, checkConnect = false) {\n if (!channel) return false;\n\n if (channel.channelId) channel = ChannelStore.getChannel(channel.channelId);\n if (!channel || channel.isDM() || channel.isGroupDM() || channel.isMultiUserDM()) return false;\n\n return !PermissionStore.can(PermissionsBits.VIEW_CHANNEL, channel) || checkConnect && !PermissionStore.can(PermissionsBits.CONNECT, channel);\n },\n\n resolveGuildChannels(channels: Record | string | number>, shouldIncludeHidden: boolean) {\n if (shouldIncludeHidden) return channels;\n\n const res = {};\n for (const [key, maybeObjChannels] of Object.entries(channels)) {\n if (!Array.isArray(maybeObjChannels)) {\n res[key] = maybeObjChannels;\n continue;\n }\n\n res[key] ??= [];\n\n for (const objChannel of maybeObjChannels) {\n if (objChannel.channel.id === null || !this.isHiddenChannel(objChannel.channel)) res[key].push(objChannel);\n }\n }\n\n return res;\n },\n\n makeAllowedRolesReduce(guildId: string) {\n return [\n (prev: Array, _: Role, index: number, originalArray: Array) => {\n if (index !== 0) return prev;\n\n const everyoneRole = originalArray.find(role => role.id === guildId);\n\n if (everyoneRole) return [everyoneRole];\n return originalArray;\n },\n [] as Array\n ];\n },\n\n HiddenChannelLockScreen: (channel: any) => ,\n\n LockIcon: ErrorBoundary.wrap(() => (\n \n \n \n ), { noop: true }),\n\n HiddenChannelIcon: ErrorBoundary.wrap(() => (\n \n {({ onMouseLeave, onMouseEnter }) => (\n \n \n \n )}\n \n ), { noop: true })\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 rini\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport \"./styles.css\";\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Message, User } from \"discord-types/general\";\n\ninterface UsernameProps {\n author: { nick: string; };\n message: Message;\n withMentionPrefix?: boolean;\n isRepliedMessage: boolean;\n userOverride?: User;\n}\n\nconst settings = definePluginSettings({\n mode: {\n type: OptionType.SELECT,\n description: \"How to display usernames and nicks\",\n options: [\n { label: \"Username then nickname\", value: \"user-nick\", default: true },\n { label: \"Nickname then username\", value: \"nick-user\" },\n { label: \"Username only\", value: \"user\" },\n ],\n },\n displayNames: {\n type: OptionType.BOOLEAN,\n description: \"Use display names in place of usernames\",\n default: false\n },\n inReplies: {\n type: OptionType.BOOLEAN,\n default: false,\n description: \"Also apply functionality to reply previews\",\n },\n});\n\nexport default definePlugin({\n name: \"ShowMeYourName\",\n description: \"Display usernames next to nicks, or no nicks at all\",\n authors: [Devs.Rini, Devs.TheKodeToad],\n patches: [\n {\n find: \".useCanSeeRemixBadge)\",\n replacement: {\n match: /(?<=onContextMenu:\\i,children:).*?\\}/,\n replace: \"$self.renderUsername(arguments[0])}\"\n }\n },\n ],\n settings,\n\n renderUsername: ({ author, message, isRepliedMessage, withMentionPrefix, userOverride }: UsernameProps) => {\n try {\n const user = userOverride ?? message.author;\n let { username } = user;\n if (settings.store.displayNames)\n username = (user as any).globalName || username;\n\n const { nick } = author;\n const prefix = withMentionPrefix ? \"@\" : \"\";\n if (username === nick || isRepliedMessage && !settings.store.inReplies)\n return prefix + nick;\n if (settings.store.mode === \"user-nick\")\n return <>{prefix}{username} {nick};\n if (settings.store.mode === \"nick-user\")\n return <>{prefix}{nick} {username};\n return prefix + username;\n } catch {\n return author?.nick;\n }\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"ShowTimeouts\",\n description: \"Display member timeout icons in chat regardless of permissions.\",\n authors: [Devs.Dolfies],\n patches: [\n {\n find: \"showCommunicationDisabledStyles\",\n replacement: {\n match: /&&\\i\\.\\i\\.canManageUser\\(\\i\\.\\i\\.MODERATE_MEMBERS,\\i\\.author,\\i\\)/,\n replace: \"\",\n },\n },\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addPreSendListener, removePreSendListener, SendListener } from \"@api/MessageEvents\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Button, ButtonLooks, ButtonWrapperClasses, React, Tooltip } from \"@webpack/common\";\n\nlet lastState = false;\n\nconst settings = definePluginSettings({\n persistState: {\n type: OptionType.BOOLEAN,\n description: \"Whether to persist the state of the silent message toggle when changing channels\",\n default: false,\n onChange(newValue: boolean) {\n if (newValue === false) lastState = false;\n }\n },\n autoDisable: {\n type: OptionType.BOOLEAN,\n description: \"Automatically disable the silent message toggle again after sending one\",\n default: true\n }\n});\n\nfunction SilentMessageToggle(chatBoxProps: {\n type: {\n analyticsName: string;\n };\n}) {\n const [enabled, setEnabled] = React.useState(lastState);\n\n function setEnabledValue(value: boolean) {\n if (settings.store.persistState) lastState = value;\n setEnabled(value);\n }\n\n React.useEffect(() => {\n const listener: SendListener = (_, message) => {\n if (enabled) {\n if (settings.store.autoDisable) setEnabledValue(false);\n if (!message.content.startsWith(\"@silent \")) message.content = \"@silent \" + message.content;\n }\n };\n\n addPreSendListener(listener);\n return () => void removePreSendListener(listener);\n }, [enabled]);\n\n if (chatBoxProps.type.analyticsName !== \"normal\") return null;\n\n return (\n \n {tooltipProps => (\n
\n setEnabledValue(!enabled)}\n size=\"\"\n look={ButtonLooks.BLANK}\n innerClassName={ButtonWrapperClasses.button}\n style={{ padding: \"0 6px\" }}\n >\n
\n \n \n \n \n {!enabled && }\n \n \n
\n \n
\n )}\n
\n );\n}\n\nexport default definePlugin({\n name: \"SilentMessageToggle\",\n authors: [Devs.Nuckyz, Devs.CatNoir],\n description: \"Adds a button to the chat bar to toggle sending a silent message.\",\n dependencies: [\"MessageEventsAPI\"],\n\n settings,\n patches: [\n {\n find: \"ChannelTextAreaButtons\",\n replacement: {\n match: /(\\i)\\.push.{1,30}disabled:(\\i),.{1,20}\\},\"gift\"\\)\\)/,\n replace: \"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()\",\n }\n },\n ],\n\n chatBarIcon: ErrorBoundary.wrap(SilentMessageToggle, { noop: true }),\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from \"@api/Commands\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Button, ButtonLooks, ButtonWrapperClasses, FluxDispatcher, React, Tooltip } from \"@webpack/common\";\n\nconst settings = definePluginSettings({\n showIcon: {\n type: OptionType.BOOLEAN,\n default: false,\n description: \"Show an icon for toggling the plugin\",\n restartNeeded: true,\n },\n isEnabled: {\n type: OptionType.BOOLEAN,\n description: \"Toggle functionality\",\n default: true,\n }\n});\n\nfunction SilentTypingToggle(chatBoxProps: {\n type: {\n analyticsName: string;\n };\n}) {\n const { isEnabled } = settings.use([\"isEnabled\"]);\n const toggle = () => settings.store.isEnabled = !settings.store.isEnabled;\n\n if (chatBoxProps.type.analyticsName !== \"normal\") return null;\n\n return (\n \n {(tooltipProps: any) => (\n
\n \n
\n \n \n {isEnabled && }\n \n
\n \n
\n )}\n
\n );\n}\n\nexport default definePlugin({\n name: \"SilentTyping\",\n authors: [Devs.Ven, Devs.Rini],\n description: \"Hide that you are typing\",\n patches: [\n {\n find: '.dispatch({type:\"TYPING_START_LOCAL\"',\n replacement: {\n match: /startTyping\\(\\i\\){.+?},stop/,\n replace: \"startTyping:$self.startTyping,stop\"\n }\n },\n {\n find: \"ChannelTextAreaButtons\",\n predicate: () => settings.store.showIcon,\n replacement: {\n match: /(\\i)\\.push.{1,30}disabled:(\\i),.{1,20}\\},\"gift\"\\)\\)/,\n replace: \"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()\",\n }\n },\n ],\n dependencies: [\"CommandsAPI\"],\n settings,\n commands: [{\n name: \"silenttype\",\n description: \"Toggle whether you're hiding that you're typing or not.\",\n inputType: ApplicationCommandInputType.BUILT_IN,\n options: [\n {\n name: \"value\",\n description: \"whether to hide or not that you're typing (default is toggle)\",\n required: false,\n type: ApplicationCommandOptionType.BOOLEAN,\n },\n ],\n execute: async (args, ctx) => {\n settings.store.isEnabled = !!findOption(args, \"value\", !settings.store.isEnabled);\n sendBotMessage(ctx.channel.id, {\n content: settings.store.isEnabled ? \"Silent typing enabled!\" : \"Silent typing disabled!\",\n });\n },\n }],\n\n async startTyping(channelId: string) {\n if (settings.store.isEnabled) return;\n FluxDispatcher.dispatch({ type: \"TYPING_START_LOCAL\", channelId });\n },\n\n chatBarIcon: ErrorBoundary.wrap(SilentTypingToggle, { noop: true }),\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Flex } from \"@components/Flex\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { RelationshipStore } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\nimport { Settings } from \"Vencord\";\n\nexport default definePlugin({\n name: \"SortFriendRequests\",\n authors: [Devs.Megu],\n description: \"Sorts friend requests by date of receipt\",\n\n patches: [{\n find: \"getRelationshipCounts(){\",\n replacement: {\n match: /\\.sortBy\\(\\i=>\\i\\.comparator\\)/,\n replace: \".sortBy((row) => $self.sortList(row))\"\n }\n }, {\n find: \"RelationshipTypes.PENDING_INCOMING?\",\n replacement: {\n predicate: () => Settings.plugins.SortFriendRequests.showDates,\n match: /(user:(\\i),.{10,50}),subText:(\\i),(className:\\i\\.userInfo}\\))/,\n replace: (_, pre, user, subtext, post) => `${pre},\n subText: $self.makeSubtext(${subtext}, ${user}),\n ${post}`\n }\n }],\n\n sortList(row: any) {\n return row.type === 3 || row.type === 4\n ? -this.getSince(row.user)\n : row.comparator;\n },\n\n getSince(user: User) {\n return new Date(RelationshipStore.getSince(user.id));\n },\n\n makeSubtext(text: string, user: User) {\n const since = this.getSince(user);\n return (\n \n {text}\n {!isNaN(since.getTime()) && Received — {since.toDateString()}}\n \n );\n },\n\n options: {\n showDates: {\n type: OptionType.BOOLEAN,\n description: \"Show dates on friend requests\",\n default: false,\n restartNeeded: true\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n(window.VencordStyles ??= new Map()).set(\"src/plugins/spotifyControls/hoverOnly.css\", {\n name: \"src/plugins/spotifyControls/hoverOnly.css\",\n source: \".vc-spotify-button-row {\\n height: 0;\\n opacity: 0;\\n pointer-events: none;\\n transition: 0.2s;\\n transition-property: height;\\n}\\n\\n#vc-spotify-player:hover .vc-spotify-button-row {\\n opacity: 1;\\n height: 32px;\\n pointer-events: auto;\\n\\n /* only transition opacity on show to prevent clipping */\\n transition-property: height, opacity;\\n}\\n\",\n classNames: {},\n dom: null,\n});\n\nexport default \"src/plugins/spotifyControls/hoverOnly.css\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { proxyLazy } from \"@utils/lazy\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { Flux, FluxDispatcher } from \"@webpack/common\";\n\nexport interface Track {\n id: string;\n name: string;\n duration: number;\n isLocal: boolean;\n album: {\n id: string;\n name: string;\n image: {\n height: number;\n width: number;\n url: string;\n };\n };\n artists: {\n id: string;\n href: string;\n name: string;\n type: string;\n uri: string;\n }[];\n}\n\ninterface PlayerState {\n accountId: string;\n track: Track | null;\n volumePercent: number,\n isPlaying: boolean,\n repeat: boolean,\n position: number,\n context?: any;\n device?: Device;\n\n // added by patch\n actual_repeat: Repeat;\n}\n\ninterface Device {\n id: string;\n is_active: boolean;\n}\n\ntype Repeat = \"off\" | \"track\" | \"context\";\n\n// Don't wanna run before Flux and Dispatcher are ready!\nexport const SpotifyStore = proxyLazy(() => {\n // For some reason ts hates extends Flux.Store\n const { Store } = Flux;\n\n const SpotifySocket = findByPropsLazy(\"getActiveSocketAndDevice\");\n const SpotifyUtils = findByPropsLazy(\"SpotifyAPI\");\n\n const API_BASE = \"https://api.spotify.com/v1/me/player\";\n\n class SpotifyStore extends Store {\n public mPosition = 0;\n private start = 0;\n\n public track: Track | null = null;\n public device: Device | null = null;\n public isPlaying = false;\n public repeat: Repeat = \"off\";\n public shuffle = false;\n public volume = 0;\n\n public isSettingPosition = false;\n\n public openExternal(path: string) {\n const url = Settings.plugins.SpotifyControls.useSpotifyUris || Vencord.Plugins.isPluginEnabled(\"OpenInApp\")\n ? \"spotify:\" + path.replaceAll(\"/\", (_, idx) => idx === 0 ? \"\" : \":\")\n : \"https://open.spotify.com\" + path;\n\n VencordNative.native.openExternal(url);\n }\n\n // Need to keep track of this manually\n public get position(): number {\n let pos = this.mPosition;\n if (this.isPlaying) {\n pos += Date.now() - this.start;\n }\n return pos;\n }\n\n public set position(p: number) {\n this.mPosition = p;\n this.start = Date.now();\n }\n\n prev() {\n this.req(\"post\", \"/previous\");\n }\n\n next() {\n this.req(\"post\", \"/next\");\n }\n\n setVolume(percent: number) {\n this.req(\"put\", \"/volume\", {\n query: {\n volume_percent: Math.round(percent)\n }\n\n }).then(() => {\n this.volume = percent;\n this.emitChange();\n });\n }\n\n setPlaying(playing: boolean) {\n this.req(\"put\", playing ? \"/play\" : \"/pause\");\n }\n\n setRepeat(state: Repeat) {\n this.req(\"put\", \"/repeat\", {\n query: { state }\n });\n }\n\n setShuffle(state: boolean) {\n this.req(\"put\", \"/shuffle\", {\n query: { state }\n }).then(() => {\n this.shuffle = state;\n this.emitChange();\n });\n }\n\n seek(ms: number) {\n if (this.isSettingPosition) return Promise.resolve();\n\n this.isSettingPosition = true;\n\n return this.req(\"put\", \"/seek\", {\n query: {\n position_ms: Math.round(ms)\n }\n }).catch((e: any) => {\n console.error(\"[VencordSpotifyControls] Failed to seek\", e);\n this.isSettingPosition = false;\n });\n }\n\n private req(method: \"post\" | \"get\" | \"put\", route: string, data: any = {}) {\n if (this.device?.is_active)\n (data.query ??= {}).device_id = this.device.id;\n\n const { socket } = SpotifySocket.getActiveSocketAndDevice();\n return SpotifyUtils.SpotifyAPI[method](socket.accountId, socket.accessToken, {\n url: API_BASE + route,\n ...data\n });\n }\n }\n\n const store = new SpotifyStore(FluxDispatcher, {\n SPOTIFY_PLAYER_STATE(e: PlayerState) {\n store.track = e.track;\n store.device = e.device ?? null;\n store.isPlaying = e.isPlaying ?? false;\n store.volume = e.volumePercent ?? 0;\n store.repeat = e.actual_repeat || \"off\";\n store.position = e.position ?? 0;\n store.isSettingPosition = false;\n store.emitChange();\n },\n SPOTIFY_SET_DEVICES({ devices }: { devices: Device[]; }) {\n store.device = devices.find(d => d.is_active) ?? devices[0] ?? null;\n store.emitChange();\n }\n });\n\n return store;\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./spotifyStyles.css\";\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { ImageIcon, LinkIcon, OpenExternalIcon } from \"@components/Icons\";\nimport { debounce } from \"@utils/debounce\";\nimport { openImageModal } from \"@utils/discord\";\nimport { classes, copyWithToast } from \"@utils/misc\";\nimport { ContextMenuApi, FluxDispatcher, Forms, Menu, React, useEffect, useState, useStateFromStores } from \"@webpack/common\";\n\nimport { SpotifyStore, Track } from \"./SpotifyStore\";\n\nconst cl = (className: string) => `vc-spotify-${className}`;\n\nfunction msToHuman(ms: number) {\n const minutes = ms / 1000 / 60;\n const m = Math.floor(minutes);\n const s = Math.floor((minutes - m) * 60);\n return `${m.toString().padStart(2, \"0\")}:${s.toString().padStart(2, \"0\")}`;\n}\n\nfunction Svg(path: string, label: string) {\n return () => (\n \n \n \n );\n}\n\n// KraXen's icons :yesyes:\n// from https://fonts.google.com/icons?icon.style=Rounded&icon.set=Material+Icons\n// older material icon style, but still really good\nconst PlayButton = Svg(\"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18c.62-.39.62-1.29 0-1.69L9.54 5.98C8.87 5.55 8 6.03 8 6.82z\", \"play\");\nconst PauseButton = Svg(\"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z\", \"pause\");\nconst SkipPrev = Svg(\"M7 6c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1s-1-.45-1-1V7c0-.55.45-1 1-1zm3.66 6.82l5.77 4.07c.66.47 1.58-.01 1.58-.82V7.93c0-.81-.91-1.28-1.58-.82l-5.77 4.07c-.57.4-.57 1.24 0 1.64z\", \"previous\");\nconst SkipNext = Svg(\"M7.58 16.89l5.77-4.07c.56-.4.56-1.24 0-1.63L7.58 7.11C6.91 6.65 6 7.12 6 7.93v8.14c0 .81.91 1.28 1.58.82zM16 7v10c0 .55.45 1 1 1s1-.45 1-1V7c0-.55-.45-1-1-1s-1 .45-1 1z\", \"next\");\nconst Repeat = Svg(\"M7 7h10v1.79c0 .45.54.67.85.35l2.79-2.79c.2-.2.2-.51 0-.71l-2.79-2.79c-.31-.31-.85-.09-.85.36V5H6c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1V7zm10 10H7v-1.79c0-.45-.54-.67-.85-.35l-2.79 2.79c-.2.2-.2.51 0 .71l2.79 2.79c.31.31.85.09.85-.36V19h11c.55 0 1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1v3z\", \"repeat\");\nconst Shuffle = Svg(\"M10.59 9.17L6.12 4.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41l4.46 4.46 1.42-1.4zm4.76-4.32l1.19 1.19L4.7 17.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L17.96 7.46l1.19 1.19c.31.31.85.09.85-.36V4.5c0-.28-.22-.5-.5-.5h-3.79c-.45 0-.67.54-.36.85zm-.52 8.56l-1.41 1.41 3.13 3.13-1.2 1.2c-.31.31-.09.85.36.85h3.79c.28 0 .5-.22.5-.5v-3.79c0-.45-.54-.67-.85-.35l-1.19 1.19-3.13-3.14z\", \"shuffle\");\n\nfunction Button(props: React.ButtonHTMLAttributes) {\n return (\n \n {props.children}\n \n );\n}\n\nfunction CopyContextMenu({ name, path }: { name: string; path: string; }) {\n const copyId = `spotify-copy-${name}`;\n const openId = `spotify-open-${name}`;\n\n return (\n FluxDispatcher.dispatch({ type: \"CONTEXT_MENU_CLOSE\" })}\n aria-label={`Spotify ${name} Menu`}\n >\n copyWithToast(\"https://open.spotify.com\" + path)}\n icon={LinkIcon}\n />\n SpotifyStore.openExternal(path)}\n icon={OpenExternalIcon}\n />\n \n );\n}\n\nfunction makeContextMenu(name: string, path: string) {\n return (e: React.MouseEvent) =>\n ContextMenuApi.openContextMenu(e, () => );\n}\n\nfunction Controls() {\n const [isPlaying, shuffle, repeat] = useStateFromStores(\n [SpotifyStore],\n () => [SpotifyStore.isPlaying, SpotifyStore.shuffle, SpotifyStore.repeat]\n );\n\n const [nextRepeat, repeatClassName] = (() => {\n switch (repeat) {\n case \"off\": return [\"context\", \"repeat-off\"] as const;\n case \"context\": return [\"track\", \"repeat-context\"] as const;\n case \"track\": return [\"off\", \"repeat-track\"] as const;\n default: throw new Error(`Invalid repeat state ${repeat}`);\n }\n })();\n\n // the 1 is using position absolute so it does not make the button jump around\n return (\n \n SpotifyStore.setShuffle(!shuffle)}\n >\n \n \n \n \n \n SpotifyStore.setRepeat(nextRepeat)}\n style={{ position: \"relative\" }}\n >\n {repeat === \"track\" && 1}\n \n \n \n );\n}\n\nconst seek = debounce((v: number) => {\n SpotifyStore.seek(v);\n});\n\nfunction SeekBar() {\n const { duration } = SpotifyStore.track!;\n\n const [storePosition, isSettingPosition, isPlaying] = useStateFromStores(\n [SpotifyStore],\n () => [SpotifyStore.mPosition, SpotifyStore.isSettingPosition, SpotifyStore.isPlaying]\n );\n\n const [position, setPosition] = useState(storePosition);\n\n // eslint-disable-next-line consistent-return\n useEffect(() => {\n if (isPlaying && !isSettingPosition) {\n setPosition(SpotifyStore.position);\n const interval = setInterval(() => {\n setPosition(p => p + 1000);\n }, 1000);\n\n return () => clearInterval(interval);\n }\n }, [storePosition, isSettingPosition, isPlaying]);\n\n return (\n
\n \n {msToHuman(position)}\n \n {\n if (isSettingPosition) return;\n setPosition(v);\n seek(v);\n }}\n renderValue={msToHuman}\n />\n \n {msToHuman(duration)}\n \n
\n );\n}\n\n\nfunction AlbumContextMenu({ track }: { track: Track; }) {\n const volume = useStateFromStores([SpotifyStore], () => SpotifyStore.volume);\n\n return (\n FluxDispatcher.dispatch({ type: \"CONTEXT_MENU_CLOSE\" })}\n aria-label=\"Spotify Album Menu\"\n >\n SpotifyStore.openExternal(`/album/${track.album.id}`)}\n icon={OpenExternalIcon}\n />\n openImageModal(track.album.image.url)}\n icon={ImageIcon}\n />\n (\n SpotifyStore.setVolume(v))}\n />\n )}\n />\n \n );\n}\n\nfunction makeLinkProps(name: string, condition: unknown, path: string) {\n if (!condition) return {};\n\n return {\n role: \"link\",\n onClick: () => SpotifyStore.openExternal(path),\n onContextMenu: makeContextMenu(name, path)\n } satisfies React.HTMLAttributes;\n}\n\nfunction Info({ track }: { track: Track; }) {\n const img = track?.album?.image;\n\n const [coverExpanded, setCoverExpanded] = useState(false);\n\n const i = (\n <>\n {img && (\n setCoverExpanded(!coverExpanded)}\n onContextMenu={e => {\n ContextMenuApi.openContextMenu(e, () => );\n }}\n />\n )}\n \n );\n\n if (coverExpanded && img) return (\n
\n {i}\n
\n );\n\n return (\n
\n {i}\n
\n \n {track.name}\n \n {track.artists.some(a => a.name) && (\n \n by \n {track.artists.map((a, i) => (\n \n \n {a.name}\n \n {i !== track.artists.length - 1 && {\", \"}}\n \n ))}\n \n )}\n {track.album.name && (\n \n on \n \n {track.album.name}\n \n \n )}\n
\n
\n );\n}\n\nexport function Player() {\n const track = useStateFromStores(\n [SpotifyStore],\n () => SpotifyStore.track,\n null,\n (prev, next) => prev?.id ? (prev.id === next?.id) : prev?.name === next?.name\n );\n\n const device = useStateFromStores(\n [SpotifyStore],\n () => SpotifyStore.device,\n null,\n (prev, next) => prev?.id === next?.id\n );\n\n const isPlaying = useStateFromStores([SpotifyStore], () => SpotifyStore.isPlaying);\n const [shouldHide, setShouldHide] = useState(false);\n\n // Hide player after 5 minutes of inactivity\n // eslint-disable-next-line consistent-return\n React.useEffect(() => {\n setShouldHide(false);\n if (!isPlaying) {\n const timeout = setTimeout(() => setShouldHide(true), 1000 * 60 * 5);\n return () => clearTimeout(timeout);\n }\n }, [isPlaying]);\n\n if (!track || !device?.is_active || shouldHide)\n return null;\n\n return (\n (\n
\n

Failed to render Spotify Modal :(

\n

Check the console for errors

\n
\n )}>\n
\n \n \n \n
\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { disableStyle, enableStyle } from \"@api/Styles\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nimport hoverOnlyStyle from \"./hoverOnly.css?managed\";\nimport { Player } from \"./PlayerComponent\";\n\nfunction toggleHoverControls(value: boolean) {\n (value ? enableStyle : disableStyle)(hoverOnlyStyle);\n}\n\nexport default definePlugin({\n name: \"SpotifyControls\",\n description: \"Adds a Spotify player above the account panel\",\n authors: [Devs.Ven, Devs.afn, Devs.KraXen72],\n options: {\n hoverControls: {\n description: \"Show controls on hover\",\n type: OptionType.BOOLEAN,\n default: false,\n onChange: v => toggleHoverControls(v)\n },\n useSpotifyUris: {\n type: OptionType.BOOLEAN,\n description: \"Open Spotify URIs instead of Spotify URLs. Will only work if you have Spotify installed and might not work on all platforms\",\n default: false\n }\n },\n patches: [\n {\n find: \"showTaglessAccountPanel:\",\n replacement: {\n // return React.createElement(AccountPanel, { ..., showTaglessAccountPanel: blah })\n match: /return ?(.{0,30}\\(.{1,3},\\{[^}]+?,showTaglessAccountPanel:.+?\\}\\))/,\n // return [Player, Panel]\n replace: \"return [$self.renderPlayer(),$1]\"\n }\n },\n // Adds POST and a Marker to the SpotifyAPI (so we can easily find it)\n {\n find: \".PLAYER_DEVICES\",\n replacement: {\n match: /get:(\\i)\\.bind\\(null,(\\i\\.\\i)\\.get\\)/,\n replace: \"post:$1.bind(null,$2.post),$&\"\n }\n },\n // Discord doesn't give you the repeat kind, only a boolean\n {\n find: 'repeat:\"off\"!==',\n replacement: {\n match: /repeat:\"off\"!==(.{1,3}),/,\n replace: \"actual_repeat:$1,$&\"\n }\n }\n ],\n start: () => toggleHoverControls(Settings.plugins.SpotifyControls.hoverControls),\n renderPlayer: () => \n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nconst settings = definePluginSettings({\n noSpotifyAutoPause: {\n description: \"Disable Spotify auto-pause\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n },\n keepSpotifyActivityOnIdle: {\n description: \"Keep Spotify activity playing when idling\",\n type: OptionType.BOOLEAN,\n default: false,\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"SpotifyCrack\",\n description: \"Free listen along, no auto-pausing in voice chat, and allows activity to continue playing when idling\",\n authors: [Devs.Cyn, Devs.Nuckyz],\n settings,\n\n patches: [\n {\n\n find: 'dispatch({type:\"SPOTIFY_PROFILE_UPDATE\"',\n replacement: {\n match: /SPOTIFY_PROFILE_UPDATE.+?isPremium:(?=\"premium\"===(\\i)\\.body\\.product)/,\n replace: (m, req) => `${m}(${req}.body.product=\"premium\")&&`\n },\n },\n {\n find: '.displayName=\"SpotifyStore\"',\n replacement: [\n {\n predicate: () => settings.store.noSpotifyAutoPause,\n match: /(?<=function \\i\\(\\){)(?=.{0,200}SPOTIFY_AUTO_PAUSED\\))/,\n replace: \"return;\"\n },\n {\n predicate: () => settings.store.keepSpotifyActivityOnIdle,\n match: /(?<=shouldShowActivity\\(\\){.{0,50})&&!\\i\\.\\i\\.isIdle\\(\\)/,\n replace: \"\"\n }\n ]\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ApplicationCommandInputType, sendBotMessage } from \"@api/Commands\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { FluxDispatcher } from \"@webpack/common\";\n\ninterface Album {\n id: string;\n image: {\n height: number;\n width: number;\n url: string;\n };\n name: string;\n}\n\ninterface Artist {\n external_urls: {\n spotify: string;\n };\n href: string;\n id: string;\n name: string;\n type: \"artist\" | string;\n uri: string;\n}\n\ninterface Track {\n id: string;\n album: Album;\n artists: Artist[];\n duration: number;\n isLocal: boolean;\n name: string;\n}\n\nconst Spotify = findByPropsLazy(\"getPlayerState\");\nconst MessageCreator = findByPropsLazy(\"getSendMessageOptionsForReply\", \"sendMessage\");\nconst PendingReplyStore = findByPropsLazy(\"getPendingReply\");\n\nfunction sendMessage(channelId, message) {\n message = {\n // The following are required to prevent Discord from throwing an error\n invalidEmojis: [],\n tts: false,\n validNonShortcutEmojis: [],\n ...message\n };\n const reply = PendingReplyStore.getPendingReply(channelId);\n MessageCreator.sendMessage(channelId, message, void 0, MessageCreator.getSendMessageOptionsForReply(reply))\n .then(() => {\n if (reply) {\n FluxDispatcher.dispatch({ type: \"DELETE_PENDING_REPLY\", channelId });\n }\n });\n}\n\nexport default definePlugin({\n name: \"SpotifyShareCommands\",\n description: \"Share your current Spotify track, album or artist via slash command (/track, /album, /artist)\",\n authors: [Devs.katlyn],\n dependencies: [\"CommandsAPI\"],\n commands: [\n {\n name: \"track\",\n description: \"Send your current Spotify track to chat\",\n inputType: ApplicationCommandInputType.BUILT_IN,\n options: [],\n execute: (_, ctx) => {\n const track: Track | null = Spotify.getTrack();\n if (track === null) {\n sendBotMessage(ctx.channel.id, {\n content: \"You're not listening to any music.\"\n });\n return;\n }\n // Note: Due to how Discord handles commands, we need to manually create and send the message\n sendMessage(ctx.channel.id, {\n content: `https://open.spotify.com/track/${track.id}`\n });\n }\n },\n {\n name: \"album\",\n description: \"Send your current Spotify album to chat\",\n inputType: ApplicationCommandInputType.BUILT_IN,\n options: [],\n execute: (_, ctx) => {\n const track: Track | null = Spotify.getTrack();\n if (track === null) {\n sendBotMessage(ctx.channel.id, {\n content: \"You're not listening to any music.\"\n });\n return;\n }\n sendMessage(ctx.channel.id, {\n content: `https://open.spotify.com/album/${track.album.id}`\n });\n }\n },\n {\n name: \"artist\",\n description: \"Send your current Spotify artist to chat\",\n inputType: ApplicationCommandInputType.BUILT_IN,\n options: [],\n execute: (_, ctx) => {\n const track: Track | null = Spotify.getTrack();\n if (track === null) {\n sendBotMessage(ctx.channel.id, {\n content: \"You're not listening to any music.\"\n });\n return;\n }\n sendMessage(ctx.channel.id, {\n content: track.artists[0].external_urls.spotify\n });\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { Forms, React } from \"@webpack/common\";\n\ninterface AppStartPerformance {\n prefix: string;\n logs: Log[];\n logGroups: LogGroup[];\n endTime_: number;\n isTracing_: boolean;\n}\n\ninterface LogGroup {\n index: number;\n timestamp: number;\n logs: Log[];\n nativeLogs: any[];\n serverTrace: string;\n}\n\ninterface Log {\n emoji: string;\n prefix: string;\n log: string;\n timestamp?: number;\n delta?: number;\n}\n\nconst AppStartPerformance = findByPropsLazy(\"markWithDelta\", \"markAndLog\", \"markAt\") as AppStartPerformance;\n\ninterface TimerItemProps extends Log {\n instance: {\n sinceStart: number;\n sinceLast: number;\n };\n}\n\nfunction TimerItem({ emoji, prefix, log, delta, instance }: TimerItemProps) {\n return (\n \n {instance.sinceStart.toFixed(3)}s\n {instance.sinceLast.toFixed(3)}s\n {delta?.toFixed(0) ?? \"\"}\n
{emoji} {prefix ?? \" \"}{log}
\n
\n );\n}\n\ninterface TimingSectionProps {\n title: string;\n logs: Log[];\n traceEnd?: number;\n}\n\nfunction TimingSection({ title, logs, traceEnd }: TimingSectionProps) {\n const startTime = logs.find(l => l.timestamp)?.timestamp ?? 0;\n\n let lastTimestamp = startTime;\n const timings = logs.map(log => {\n // Get last log entry with valid timestamp\n const timestamp = log.timestamp ?? lastTimestamp;\n\n const sinceStart = (timestamp - startTime) / 1000;\n const sinceLast = (timestamp - lastTimestamp) / 1000;\n\n lastTimestamp = timestamp;\n\n return { sinceStart, sinceLast };\n });\n\n return (\n \n \n {traceEnd && (\n
\n Trace ended at: {(new Date(traceEnd)).toTimeString()}\n
\n )}\n
\n Start\n Interval\n Delta\n Event\n {AppStartPerformance.logs.map((log, i) => (\n \n ))}\n
\n
\n
\n );\n}\n\ninterface ServerTraceProps {\n trace: string;\n}\n\nfunction ServerTrace({ trace }: ServerTraceProps) {\n const lines = trace.split(\"\\n\");\n\n return (\n \n \n \n {lines.map(line => (\n {line}\n ))}\n \n \n \n );\n}\n\nfunction StartupTimingPage() {\n if (!AppStartPerformance?.logs) return
Loading...
;\n\n const serverTrace = AppStartPerformance.logGroups.find(g => g.serverTrace)?.serverTrace;\n\n return (\n \n \n {/* Lazy Divider */}\n
 
\n {serverTrace && }\n
\n );\n}\n\nexport default ErrorBoundary.wrap(StartupTimingPage);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport { LazyComponent } from \"@utils/react\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"StartupTimings\",\n description: \"Adds Startup Timings to the Settings menu\",\n authors: [Devs.Megu],\n patches: [{\n find: \"UserSettingsSections.PAYMENT_FLOW_MODAL_TEST_PAGE,\",\n replacement: {\n match: /{section:\\i\\.UserSettingsSections\\.PAYMENT_FLOW_MODAL_TEST_PAGE/,\n replace: '{section:\"StartupTimings\",label:\"Startup Timings\",element:$self.StartupTimingPage},$&'\n }\n }],\n StartupTimingPage: LazyComponent(() => require(\"./StartupTimingPage\").default)\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated, ant0n, FieryFlames and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nexport const settings = definePluginSettings({\n superReactByDefault: {\n type: OptionType.BOOLEAN,\n description: \"Reaction picker will default to Super Reactions\",\n default: true,\n },\n unlimitedSuperReactionPlaying: {\n type: OptionType.BOOLEAN,\n description: \"Remove the limit on Super Reactions playing at once\",\n default: false,\n },\n\n superReactionPlayingLimit: {\n description: \"Max Super Reactions to play at once\",\n type: OptionType.SLIDER,\n default: 20,\n markers: [5, 10, 20, 40, 60, 80, 100],\n stickToMarkers: true,\n },\n}, {\n superReactionPlayingLimit: {\n disabled() { return this.store.unlimitedSuperReactionPlaying; },\n }\n});\n\nexport default definePlugin({\n name: \"SuperReactionTweaks\",\n description: \"Customize the limit of Super Reactions playing at once, and super react by default\",\n authors: [Devs.FieryFlames, Devs.ant0n],\n patches: [\n {\n find: \",BURST_REACTION_EFFECT_PLAY\",\n replacement: {\n match: /(?<=BURST_REACTION_EFFECT_PLAY:\\i=>{.{50,100})(\\i\\(\\i,\\i\\))>=\\d+/,\n replace: \"!$self.shouldPlayBurstReaction($1)\"\n }\n },\n {\n find: \".hasAvailableBurstCurrency)\",\n replacement: {\n match: /(?<=\\.useBurstReactionsExperiment.{0,20})useState\\(!1\\)(?=.+?(\\i===\\i\\.EmojiIntention.REACTION))/,\n replace: \"useState($self.settings.store.superReactByDefault && $1)\"\n }\n }\n ],\n settings,\n\n shouldPlayBurstReaction(playingCount: number) {\n if (settings.store.unlimitedSuperReactionPlaying) return true;\n if (playingCount <= settings.store.superReactionPlayingLimit) return true;\n return false;\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { DataStore } from \"@api/index\";\nimport { addPreSendListener, removePreSendListener } from \"@api/MessageEvents\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Flex } from \"@components/Flex\";\nimport { DeleteIcon } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport { useForceUpdater } from \"@utils/react\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Button, Forms, React, TextInput, useState } from \"@webpack/common\";\n\nconst STRING_RULES_KEY = \"TextReplace_rulesString\";\nconst REGEX_RULES_KEY = \"TextReplace_rulesRegex\";\n\ntype Rule = Record<\"find\" | \"replace\" | \"onlyIfIncludes\", string>;\n\ninterface TextReplaceProps {\n title: string;\n rulesArray: Rule[];\n rulesKey: string;\n update: () => void;\n}\n\nconst makeEmptyRule: () => Rule = () => ({\n find: \"\",\n replace: \"\",\n onlyIfIncludes: \"\"\n});\nconst makeEmptyRuleArray = () => [makeEmptyRule()];\n\nlet stringRules = makeEmptyRuleArray();\nlet regexRules = makeEmptyRuleArray();\n\nconst settings = definePluginSettings({\n replace: {\n type: OptionType.COMPONENT,\n description: \"\",\n component: () => {\n const update = useForceUpdater();\n return (\n <>\n \n \n \n \n );\n }\n },\n});\n\nfunction stringToRegex(str: string) {\n const match = str.match(/^(\\/)?(.+?)(?:\\/([gimsuy]*))?$/); // Regex to match regex\n return match\n ? new RegExp(\n match[2], // Pattern\n match[3]\n ?.split(\"\") // Remove duplicate flags\n .filter((char, pos, flagArr) => flagArr.indexOf(char) === pos)\n .join(\"\")\n ?? \"g\"\n )\n : new RegExp(str); // Not a regex, return string\n}\n\nfunction renderFindError(find: string) {\n try {\n stringToRegex(find);\n return null;\n } catch (e) {\n return (\n \n {String(e)}\n \n );\n }\n}\n\nfunction Input({ initialValue, onChange, placeholder }: {\n placeholder: string;\n initialValue: string;\n onChange(value: string): void;\n}) {\n const [value, setValue] = useState(initialValue);\n return (\n value !== initialValue && onChange(value)}\n />\n );\n}\n\nfunction TextReplace({ title, rulesArray, rulesKey, update }: TextReplaceProps) {\n const isRegexRules = title === \"Using Regex\";\n\n async function onClickRemove(index: number) {\n if (index === rulesArray.length - 1) return;\n rulesArray.splice(index, 1);\n\n await DataStore.set(rulesKey, rulesArray);\n update();\n }\n\n async function onChange(e: string, index: number, key: string) {\n if (index === rulesArray.length - 1)\n rulesArray.push(makeEmptyRule());\n\n rulesArray[index][key] = e;\n\n if (rulesArray[index].find === \"\" && rulesArray[index].replace === \"\" && rulesArray[index].onlyIfIncludes === \"\" && index !== rulesArray.length - 1)\n rulesArray.splice(index, 1);\n\n await DataStore.set(rulesKey, rulesArray);\n update();\n }\n\n return (\n <>\n {title}\n \n {\n rulesArray.map((rule, index) =>\n \n \n \n onChange(e, index, \"find\")}\n />\n onChange(e, index, \"replace\")}\n />\n onChange(e, index, \"onlyIfIncludes\")}\n />\n \n onClickRemove(index)}\n style={{\n background: \"none\",\n color: \"var(--status-danger)\",\n ...(index === rulesArray.length - 1\n ? {\n visibility: \"hidden\",\n pointerEvents: \"none\"\n }\n : {}\n )\n }}\n >\n \n \n \n {isRegexRules && renderFindError(rule.find)}\n \n )\n }\n \n \n );\n}\n\nfunction TextReplaceTesting() {\n const [value, setValue] = useState(\"\");\n return (\n <>\n Test Rules\n \n \n \n );\n}\n\nfunction applyRules(content: string): string {\n if (content.length === 0)\n return content;\n\n if (stringRules) {\n for (const rule of stringRules) {\n if (!rule.find || !rule.replace) continue;\n if (rule.onlyIfIncludes && !content.includes(rule.onlyIfIncludes)) continue;\n\n content = ` ${content} `.replaceAll(rule.find, rule.replace.replaceAll(\"\\\\n\", \"\\n\")).replace(/^\\s|\\s$/g, \"\");\n }\n }\n\n if (regexRules) {\n for (const rule of regexRules) {\n if (!rule.find || !rule.replace) continue;\n if (rule.onlyIfIncludes && !content.includes(rule.onlyIfIncludes)) continue;\n\n try {\n const regex = stringToRegex(rule.find);\n content = content.replace(regex, rule.replace.replaceAll(\"\\\\n\", \"\\n\"));\n } catch (e) {\n new Logger(\"TextReplace\").error(`Invalid regex: ${rule.find}`);\n }\n }\n }\n\n content = content.trim();\n return content;\n}\n\nconst TEXT_REPLACE_RULES_CHANNEL_ID = \"1102784112584040479\";\n\nexport default definePlugin({\n name: \"TextReplace\",\n description: \"Replace text in your messages. You can find pre-made rules in the #textreplace-rules channel in Vencord's Server\",\n authors: [Devs.AutumnVN, Devs.TheKodeToad],\n dependencies: [\"MessageEventsAPI\"],\n\n settings,\n\n async start() {\n stringRules = await DataStore.get(STRING_RULES_KEY) ?? makeEmptyRuleArray();\n regexRules = await DataStore.get(REGEX_RULES_KEY) ?? makeEmptyRuleArray();\n\n this.preSend = addPreSendListener((channelId, msg) => {\n // Channel used for sharing rules, applying rules here would be messy\n if (channelId === TEXT_REPLACE_RULES_CHANNEL_ID) return;\n msg.content = applyRules(msg.content);\n });\n },\n\n stop() {\n removePreSendListener(this.preSend);\n }\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { UserStore } from \"@webpack/common\";\nimport { Message } from \"discord-types/general\";\n\nexport default definePlugin({\n name: \"ThemeAttributes\",\n description: \"Adds data attributes to various elements for theming purposes\",\n authors: [Devs.Ven],\n\n patches: [\n // Add data-tab-id to all tab bar items\n // This for examples applies to the User and Server settings sidebars\n {\n find: \".tabBarRef\",\n replacement: {\n match: /style:this\\.getStyle\\(\\),role:\"tab\"/,\n replace: \"$&,'data-tab-id':this.props.id\"\n }\n },\n\n // Add data-author-id and data-is-self to all messages\n {\n find: \".messageListItem\",\n replacement: {\n match: /\\.messageListItem(?=,\"aria)/,\n replace: \"$&,...$self.getMessageProps(arguments[0])\"\n }\n }\n ],\n\n getMessageProps(props: { message: Message; }) {\n const authorId = props.message?.author?.id;\n return {\n \"data-author-id\": authorId,\n \"data-is-self\": authorId && authorId === UserStore.getCurrentUser()?.id\n };\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"TimeBarAllActivities\",\n description: \"Adds the Spotify time bar to all activities if they have start and end timestamps\",\n authors: [Devs.obscurity],\n patches: [\n {\n find: \"}renderTimeBar(\",\n replacement: {\n match: /renderTimeBar\\((.{1,3})\\){.{0,50}?let/,\n replace: \"renderTimeBar($1){let\"\n }\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { OptionType } from \"@utils/types\";\n\nexport const settings = definePluginSettings({\n receivedInput: {\n type: OptionType.STRING,\n description: \"Input language for received messages\",\n default: \"auto\",\n hidden: true\n },\n receivedOutput: {\n type: OptionType.STRING,\n description: \"Output language for received messages\",\n default: \"en\",\n hidden: true\n },\n sentInput: {\n type: OptionType.STRING,\n description: \"Input language for sent messages\",\n default: \"auto\",\n hidden: true\n },\n sentOutput: {\n type: OptionType.STRING,\n description: \"Output language for sent messages\",\n default: \"en\",\n hidden: true\n },\n autoTranslate: {\n type: OptionType.BOOLEAN,\n description: \"Automatically translate your messages before sending. You can also shift/right click the translate button to toggle this\",\n default: false\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n/*\nTo generate:\n- Visit https://translate.google.com/?sl=auto&tl=en&op=translate\n- Open Language dropdown\n- Open Devtools and use the element picker to pick the root of the language picker\n- Right click on the element in devtools and click \"Store as global variable\"\n\ncopy(Object.fromEntries(\n Array.from(\n temp1.querySelectorAll(\"[data-language-code]\"),\n e => [e.dataset.languageCode, e.children[1].textContent]\n ).sort((a, b) => a[1] === \"Detect language\" ? -1 : b[1] === \"Detect language\" ? 1 : a[1].localeCompare(b[1]))\n))\n*/\n\nexport type Language = keyof typeof Languages;\n\nexport const Languages = {\n \"auto\": \"Detect language\",\n \"af\": \"Afrikaans\",\n \"sq\": \"Albanian\",\n \"am\": \"Amharic\",\n \"ar\": \"Arabic\",\n \"hy\": \"Armenian\",\n \"as\": \"Assamese\",\n \"ay\": \"Aymara\",\n \"az\": \"Azerbaijani\",\n \"bm\": \"Bambara\",\n \"eu\": \"Basque\",\n \"be\": \"Belarusian\",\n \"bn\": \"Bengali\",\n \"bho\": \"Bhojpuri\",\n \"bs\": \"Bosnian\",\n \"bg\": \"Bulgarian\",\n \"ca\": \"Catalan\",\n \"ceb\": \"Cebuano\",\n \"ny\": \"Chichewa\",\n \"zh-CN\": \"Chinese (Simplified)\",\n \"zh-TW\": \"Chinese (Traditional)\",\n \"co\": \"Corsican\",\n \"hr\": \"Croatian\",\n \"cs\": \"Czech\",\n \"da\": \"Danish\",\n \"dv\": \"Dhivehi\",\n \"doi\": \"Dogri\",\n \"nl\": \"Dutch\",\n \"en\": \"English\",\n \"eo\": \"Esperanto\",\n \"et\": \"Estonian\",\n \"ee\": \"Ewe\",\n \"tl\": \"Filipino\",\n \"fi\": \"Finnish\",\n \"fr\": \"French\",\n \"fy\": \"Frisian\",\n \"gl\": \"Galician\",\n \"ka\": \"Georgian\",\n \"de\": \"German\",\n \"el\": \"Greek\",\n \"gn\": \"Guarani\",\n \"gu\": \"Gujarati\",\n \"ht\": \"Haitian Creole\",\n \"ha\": \"Hausa\",\n \"haw\": \"Hawaiian\",\n \"iw\": \"Hebrew\",\n \"hi\": \"Hindi\",\n \"hmn\": \"Hmong\",\n \"hu\": \"Hungarian\",\n \"is\": \"Icelandic\",\n \"ig\": \"Igbo\",\n \"ilo\": \"Ilocano\",\n \"id\": \"Indonesian\",\n \"ga\": \"Irish\",\n \"it\": \"Italian\",\n \"ja\": \"Japanese\",\n \"jw\": \"Javanese\",\n \"kn\": \"Kannada\",\n \"kk\": \"Kazakh\",\n \"km\": \"Khmer\",\n \"rw\": \"Kinyarwanda\",\n \"gom\": \"Konkani\",\n \"ko\": \"Korean\",\n \"kri\": \"Krio\",\n \"ku\": \"Kurdish (Kurmanji)\",\n \"ckb\": \"Kurdish (Sorani)\",\n \"ky\": \"Kyrgyz\",\n \"lo\": \"Lao\",\n \"la\": \"Latin\",\n \"lv\": \"Latvian\",\n \"ln\": \"Lingala\",\n \"lt\": \"Lithuanian\",\n \"lg\": \"Luganda\",\n \"lb\": \"Luxembourgish\",\n \"mk\": \"Macedonian\",\n \"mai\": \"Maithili\",\n \"mg\": \"Malagasy\",\n \"ms\": \"Malay\",\n \"ml\": \"Malayalam\",\n \"mt\": \"Maltese\",\n \"mi\": \"Maori\",\n \"mr\": \"Marathi\",\n \"mni-Mtei\": \"Meiteilon (Manipuri)\",\n \"lus\": \"Mizo\",\n \"mn\": \"Mongolian\",\n \"my\": \"Myanmar (Burmese)\",\n \"ne\": \"Nepali\",\n \"no\": \"Norwegian\",\n \"or\": \"Odia (Oriya)\",\n \"om\": \"Oromo\",\n \"ps\": \"Pashto\",\n \"fa\": \"Persian\",\n \"pl\": \"Polish\",\n \"pt\": \"Portuguese\",\n \"pa\": \"Punjabi\",\n \"qu\": \"Quechua\",\n \"ro\": \"Romanian\",\n \"ru\": \"Russian\",\n \"sm\": \"Samoan\",\n \"sa\": \"Sanskrit\",\n \"gd\": \"Scots Gaelic\",\n \"nso\": \"Sepedi\",\n \"sr\": \"Serbian\",\n \"st\": \"Sesotho\",\n \"sn\": \"Shona\",\n \"sd\": \"Sindhi\",\n \"si\": \"Sinhala\",\n \"sk\": \"Slovak\",\n \"sl\": \"Slovenian\",\n \"so\": \"Somali\",\n \"es\": \"Spanish\",\n \"su\": \"Sundanese\",\n \"sw\": \"Swahili\",\n \"sv\": \"Swedish\",\n \"tg\": \"Tajik\",\n \"ta\": \"Tamil\",\n \"tt\": \"Tatar\",\n \"te\": \"Telugu\",\n \"th\": \"Thai\",\n \"ti\": \"Tigrinya\",\n \"ts\": \"Tsonga\",\n \"tr\": \"Turkish\",\n \"tk\": \"Turkmen\",\n \"ak\": \"Twi\",\n \"uk\": \"Ukrainian\",\n \"ur\": \"Urdu\",\n \"ug\": \"Uyghur\",\n \"uz\": \"Uzbek\",\n \"vi\": \"Vietnamese\",\n \"cy\": \"Welsh\",\n \"xh\": \"Xhosa\",\n \"yi\": \"Yiddish\",\n \"yo\": \"Yoruba\",\n \"zu\": \"Zulu\"\n} as const;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { classNameFactory } from \"@api/Styles\";\n\nimport { settings } from \"./settings\";\n\nexport const cl = classNameFactory(\"vc-trans-\");\n\ninterface TranslationData {\n src: string;\n sentences: {\n // \uD83C\uDFF3\uFE0F\u200D\u26A7\uFE0F\n trans: string;\n }[];\n}\n\nexport interface TranslationValue {\n src: string;\n text: string;\n}\n\nexport async function translate(kind: \"received\" | \"sent\", text: string): Promise {\n const sourceLang = settings.store[kind + \"Input\"];\n const targetLang = settings.store[kind + \"Output\"];\n\n const url = \"https://translate.googleapis.com/translate_a/single?\" + new URLSearchParams({\n // see https://stackoverflow.com/a/29537590 for more params\n // holy shidd nvidia\n client: \"gtx\",\n // source language\n sl: sourceLang,\n // target language\n tl: targetLang,\n // what to return, t = translation probably\n dt: \"t\",\n // Send json object response instead of weird array\n dj: \"1\",\n source: \"input\",\n // query, duh\n q: text\n });\n\n const res = await fetch(url);\n if (!res.ok)\n throw new Error(\n `Failed to translate \"${text}\" (${sourceLang} -> ${targetLang})`\n + `\\n${res.status} ${res.statusText}`\n );\n\n const { src, sentences }: TranslationData = await res.json();\n\n return {\n src,\n text: sentences.\n map(s => s?.trans).\n filter(Boolean).\n join(\"\")\n };\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Margins } from \"@utils/margins\";\nimport { ModalCloseButton, ModalContent, ModalHeader, ModalProps, ModalRoot } from \"@utils/modal\";\nimport { Forms, SearchableSelect, Switch, useMemo } from \"@webpack/common\";\n\nimport { Languages } from \"./languages\";\nimport { settings } from \"./settings\";\nimport { cl } from \"./utils\";\n\nconst LanguageSettingKeys = [\"receivedInput\", \"receivedOutput\", \"sentInput\", \"sentOutput\"] as const;\n\nfunction LanguageSelect({ settingsKey, includeAuto }: { settingsKey: typeof LanguageSettingKeys[number]; includeAuto: boolean; }) {\n const currentValue = settings.use([settingsKey])[settingsKey];\n\n const options = useMemo(\n () => {\n const options = Object.entries(Languages).map(([value, label]) => ({ value, label }));\n if (!includeAuto)\n options.shift();\n\n return options;\n }, []\n );\n\n return (\n
\n \n {settings.def[settingsKey].description}\n \n\n o.value === currentValue)}\n placeholder={\"Select a language\"}\n maxVisibleItems={5}\n closeOnSelect={true}\n onChange={v => settings.store[settingsKey] = v}\n />\n
\n );\n}\n\nfunction AutoTranslateToggle() {\n const value = settings.use([\"autoTranslate\"]).autoTranslate;\n\n return (\n settings.store.autoTranslate = v}\n note={settings.def.autoTranslate.description}\n hideBorder\n >\n Auto Translate\n \n );\n}\n\n\nexport function TranslateModal({ rootProps }: { rootProps: ModalProps; }) {\n return (\n \n \n \n Translate\n \n \n \n\n \n {LanguageSettingKeys.map(s => (\n \n ))}\n\n \n\n \n \n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { classes } from \"@utils/misc\";\nimport { openModal } from \"@utils/modal\";\nimport { Button, ButtonLooks, ButtonWrapperClasses, Tooltip } from \"@webpack/common\";\n\nimport { settings } from \"./settings\";\nimport { TranslateModal } from \"./TranslateModal\";\nimport { cl } from \"./utils\";\n\nexport function TranslateIcon({ height = 24, width = 24, className }: { height?: number; width?: number; className?: string; }) {\n return (\n \n \n \n );\n}\n\nexport function TranslateChatBarIcon({ slateProps }: { slateProps: { type: { analyticsName: string; }; }; }) {\n const { autoTranslate } = settings.use([\"autoTranslate\"]);\n\n if (slateProps.type.analyticsName !== \"normal\")\n return null;\n\n const toggle = () => settings.store.autoTranslate = !autoTranslate;\n\n return (\n \n {({ onMouseEnter, onMouseLeave }) => (\n
\n {\n if (e.shiftKey) return toggle();\n\n openModal(props => (\n \n ));\n }}\n onContextMenu={() => toggle()}\n style={{ padding: \"0 4px\" }}\n >\n
\n \n
\n \n
\n )}\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Parser, useEffect, useState } from \"@webpack/common\";\nimport { Message } from \"discord-types/general\";\n\nimport { Languages } from \"./languages\";\nimport { TranslateIcon } from \"./TranslateIcon\";\nimport { cl, TranslationValue } from \"./utils\";\n\nconst TranslationSetters = new Map void>();\n\nexport function handleTranslate(messageId: string, data: TranslationValue) {\n TranslationSetters.get(messageId)!(data);\n}\n\nfunction Dismiss({ onDismiss }: { onDismiss: () => void; }) {\n return (\n \n Dismiss\n \n );\n}\n\nexport function TranslationAccessory({ message }: { message: Message; }) {\n const [translation, setTranslation] = useState();\n\n useEffect(() => {\n // Ignore MessageLinkEmbeds messages\n if ((message as any).vencordEmbeddedBy) return;\n\n TranslationSetters.set(message.id, setTranslation);\n\n return () => void TranslationSetters.delete(message.id);\n }, []);\n\n if (!translation) return null;\n\n return (\n \n \n {Parser.parse(translation.text)}\n {\" \"}\n (translated from {Languages[translation.src] ?? translation.src} - setTranslation(undefined)} />)\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { addAccessory, removeAccessory } from \"@api/MessageAccessories\";\nimport { addPreSendListener, removePreSendListener } from \"@api/MessageEvents\";\nimport { addButton, removeButton } from \"@api/MessagePopover\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { ChannelStore, Menu } from \"@webpack/common\";\n\nimport { settings } from \"./settings\";\nimport { TranslateChatBarIcon, TranslateIcon } from \"./TranslateIcon\";\nimport { handleTranslate, TranslationAccessory } from \"./TranslationAccessory\";\nimport { translate } from \"./utils\";\n\nconst messageCtxPatch: NavContextMenuPatchCallback = (children, { message }) => () => {\n if (!message.content) return;\n\n const group = findGroupChildrenByChildId(\"copy-text\", children);\n if (!group) return;\n\n group.splice(group.findIndex(c => c?.props?.id === \"copy-text\") + 1, 0, (\n {\n const trans = await translate(\"received\", message.content);\n handleTranslate(message.id, trans);\n }}\n />\n ));\n};\n\nexport default definePlugin({\n name: \"Translate\",\n description: \"Translate messages with Google Translate\",\n authors: [Devs.Ven],\n dependencies: [\"MessageAccessoriesAPI\", \"MessagePopoverAPI\", \"MessageEventsAPI\"],\n settings,\n // not used, just here in case some other plugin wants it or w/e\n translate,\n\n patches: [\n {\n find: \"ChannelTextAreaButtons\",\n replacement: {\n match: /(\\i)\\.push.{1,30}disabled:(\\i),.{1,20}\\},\"gift\"\\)\\)/,\n replace: \"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()\",\n }\n },\n ],\n\n start() {\n addAccessory(\"vc-translation\", props => );\n\n addContextMenuPatch(\"message\", messageCtxPatch);\n\n addButton(\"vc-translate\", message => {\n if (!message.content) return null;\n\n return {\n label: \"Translate\",\n icon: TranslateIcon,\n message,\n channel: ChannelStore.getChannel(message.channel_id),\n onClick: async () => {\n const trans = await translate(\"received\", message.content);\n handleTranslate(message.id, trans);\n }\n };\n });\n\n this.preSend = addPreSendListener(async (_, message) => {\n if (!settings.store.autoTranslate) return;\n if (!message.content) return;\n\n message.content = (await translate(\"sent\", message.content)).text;\n });\n },\n\n stop() {\n removePreSendListener(this.preSend);\n removeContextMenuPatch(\"message\", messageCtxPatch);\n removeButton(\"vc-translate\");\n removeAccessory(\"vc-translation\");\n },\n\n chatBarIcon: (slateProps: any) => (\n \n \n \n )\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { openUserProfile } from \"@utils/discord\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Avatar, GuildMemberStore, React, RelationshipStore } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\n\nconst settings = definePluginSettings({\n showAvatars: {\n type: OptionType.BOOLEAN,\n default: true,\n description: \"Show avatars in the typing indicator\"\n },\n showRoleColors: {\n type: OptionType.BOOLEAN,\n default: true,\n description: \"Show role colors in the typing indicator\"\n },\n alternativeFormatting: {\n type: OptionType.BOOLEAN,\n default: true,\n description: \"Show a more useful message when several users are typing\"\n }\n});\n\nexport function buildSeveralUsers({ a, b, count }: { a: string, b: string, count: number; }) {\n return [\n {a},\n \", \",\n {b},\n `, and ${count} others are typing...`\n ];\n}\n\ninterface Props {\n user: User;\n guildId: string;\n}\n\nconst TypingUser = ErrorBoundary.wrap(function ({ user, guildId }: Props) {\n return (\n {\n openUserProfile(user.id);\n }}\n style={{\n display: \"grid\",\n gridAutoFlow: \"column\",\n gap: \"4px\",\n color: settings.store.showRoleColors ? GuildMemberStore.getMember(guildId, user.id)?.colorString : undefined,\n cursor: \"pointer\"\n }}\n >\n {settings.store.showAvatars && (\n
\n \n
\n )}\n {GuildMemberStore.getNick(guildId!, user.id)\n || (!guildId && RelationshipStore.getNickname(user.id))\n || (user as any).globalName\n || user.username\n }\n \n );\n}, { noop: true });\n\nexport default definePlugin({\n name: \"TypingTweaks\",\n description: \"Show avatars and role colours in the typing indicator\",\n authors: [Devs.zt],\n patches: [\n // Style the indicator and add function call to modify the children before rendering\n {\n find: \"getCooldownTextStyle\",\n replacement: {\n match: /(?<=children:\\[(\\i)\\.length>0.{0,200}?\"aria-atomic\":!0,children:)\\i/,\n replace: \"$self.mutateChildren(this.props, $1, $&), style: $self.TYPING_TEXT_STYLE\"\n }\n },\n // Changes the indicator to keep the user object when creating the list of typing users\n {\n find: \"getCooldownTextStyle\",\n replacement: {\n match: /(?<=map\\(\\i=>)\\i\\.\\i\\.getName\\(\\i,this\\.props\\.channel\\.id,(\\i)\\)/,\n replace: \"$1\"\n }\n },\n // Adds the alternative formatting for several users typing\n {\n find: \"getCooldownTextStyle\",\n replacement: {\n match: /(?<=(\\i)\\.length\\?\\i.\\i\\.Messages.THREE_USERS_TYPING\\.format\\({\\i:(\\i),(?:\\i:)?(\\i),\\i:\\i}\\):)\\i\\.\\i\\.Messages\\.SEVERAL_USERS_TYPING/,\n replace: (_, users, a, b) => `$self.buildSeveralUsers({ a: ${a}, b: ${b}, count: ${users}.length - 2 })`\n },\n predicate: () => settings.store.alternativeFormatting\n }\n ],\n settings,\n\n TYPING_TEXT_STYLE: {\n display: \"grid\",\n gridAutoFlow: \"column\",\n gridGap: \"0.25em\"\n },\n\n buildSeveralUsers,\n\n mutateChildren(props: any, users: User[], children: any) {\n if (!Array.isArray(children)) return children;\n\n let element = 0;\n\n return children.map(c =>\n c.type === \"strong\"\n ? \n : c\n );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings, Settings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { LazyComponent } from \"@utils/react\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { find, findStoreLazy } from \"@webpack\";\nimport { ChannelStore, GuildMemberStore, i18n, RelationshipStore, Tooltip, UserStore, useStateFromStores } from \"@webpack/common\";\n\nimport { buildSeveralUsers } from \"../typingTweaks\";\n\nconst ThreeDots = LazyComponent(() => {\n // This doesn't really need to explicitly find Dots' own module, but it's fine\n const res = find(m => m.Dots && !m.Menu);\n\n return res?.Dots;\n});\n\nconst TypingStore = findStoreLazy(\"TypingStore\");\nconst UserGuildSettingsStore = findStoreLazy(\"UserGuildSettingsStore\");\n\nfunction getDisplayName(guildId: string, userId: string) {\n const user = UserStore.getUser(userId);\n return GuildMemberStore.getNick(guildId, userId) ?? (user as any).globalName ?? user.username;\n}\n\nfunction TypingIndicator({ channelId }: { channelId: string; }) {\n const typingUsers: Record = useStateFromStores(\n [TypingStore],\n () => ({ ...TypingStore.getTypingUsers(channelId) as Record }),\n null,\n (old, current) => {\n const oldKeys = Object.keys(old);\n const currentKeys = Object.keys(current);\n\n return oldKeys.length === currentKeys.length && currentKeys.every(key => old[key] != null);\n }\n );\n\n const guildId = ChannelStore.getChannel(channelId).guild_id;\n\n if (!settings.store.includeMutedChannels) {\n const isChannelMuted = UserGuildSettingsStore.isChannelMuted(guildId, channelId);\n if (isChannelMuted) return null;\n }\n\n const myId = UserStore.getCurrentUser()?.id;\n\n const typingUsersArray = Object.keys(typingUsers).filter(id => id !== myId && !(RelationshipStore.isBlocked(id) && !settings.store.includeBlockedUsers));\n let tooltipText: string;\n\n switch (typingUsersArray.length) {\n case 0: break;\n case 1: {\n tooltipText = i18n.Messages.ONE_USER_TYPING.format({ a: getDisplayName(guildId, typingUsersArray[0]) });\n break;\n }\n case 2: {\n tooltipText = i18n.Messages.TWO_USERS_TYPING.format({ a: getDisplayName(guildId, typingUsersArray[0]), b: getDisplayName(guildId, typingUsersArray[1]) });\n break;\n }\n case 3: {\n tooltipText = i18n.Messages.THREE_USERS_TYPING.format({ a: getDisplayName(guildId, typingUsersArray[0]), b: getDisplayName(guildId, typingUsersArray[1]), c: getDisplayName(guildId, typingUsersArray[2]) });\n break;\n }\n default: {\n tooltipText = Settings.plugins.TypingTweaks.enabled\n ? buildSeveralUsers({ a: getDisplayName(guildId, typingUsersArray[0]), b: getDisplayName(guildId, typingUsersArray[1]), count: typingUsersArray.length - 2 })\n : i18n.Messages.SEVERAL_USERS_TYPING;\n break;\n }\n }\n\n if (typingUsersArray.length > 0) {\n return (\n \n {props => (\n \n \n \n )}\n \n );\n }\n\n return null;\n}\n\nconst settings = definePluginSettings({\n includeMutedChannels: {\n type: OptionType.BOOLEAN,\n description: \"Whether to show the typing indicator for muted channels.\",\n default: false\n },\n includeBlockedUsers: {\n type: OptionType.BOOLEAN,\n description: \"Whether to show the typing indicator for blocked users.\",\n default: false\n }\n});\n\nexport default definePlugin({\n name: \"TypingIndicator\",\n description: \"Adds an indicator if someone is typing on a channel.\",\n authors: [Devs.Nuckyz, Devs.obscurity],\n settings,\n\n patches: [\n // Normal channel\n {\n find: \"UNREAD_IMPORTANT:\",\n replacement: {\n match: /channel:(\\i).{0,100}?channelEmoji,.{0,250}?\\.children.{0,50}?:null/,\n replace: \"$&,$self.TypingIndicator($1.id)\"\n }\n },\n // Theads\n {\n // This is the thread \"spine\" that shows in the left\n find: \"M11 9H4C2.89543 9 2 8.10457 2 7V1C2 0.447715 1.55228 0 1 0C0.447715 0 0 0.447715 0 1V7C0 9.20914 1.79086 11 4 11H11C11.5523 11 12 10.5523 12 10C12 9.44771 11.5523 9 11 9Z\",\n replacement: {\n match: /mentionsCount:\\i.+?null(?<=channel:(\\i).+?)/,\n replace: \"$&,$self.TypingIndicator($1.id)\"\n }\n }\n ],\n\n TypingIndicator: (channelId: string) => (\n \n \n \n ),\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addPreEditListener, addPreSendListener, MessageObject, removePreEditListener, removePreSendListener } from \"@api/MessageEvents\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"Unindent\",\n description: \"Trims leading indentation from codeblocks\",\n authors: [Devs.Ven],\n dependencies: [\"MessageEventsAPI\"],\n patches: [\n {\n find: \"inQuote:\",\n replacement: {\n match: /,content:([^,]+),inQuote/,\n replace: (_, content) => `,content:Vencord.Plugins.plugins.Unindent.unindent(${content}),inQuote`\n }\n }\n ],\n\n unindent(str: string) {\n // Users cannot send tabs, they get converted to spaces. However, a bot may send tabs, so convert them to 4 spaces first\n str = str.replace(/\\t/g, \" \");\n const minIndent = str.match(/^ *(?=\\S)/gm)\n ?.reduce((prev, curr) => Math.min(prev, curr.length), Infinity) ?? 0;\n\n if (!minIndent) return str;\n return str.replace(new RegExp(`^ {${minIndent}}`, \"gm\"), \"\");\n },\n\n unindentMsg(msg: MessageObject) {\n msg.content = msg.content.replace(/```(.|\\n)*?```/g, m => {\n const lines = m.split(\"\\n\");\n if (lines.length < 2) return m; // Do not affect inline codeblocks\n let suffix = \"\";\n if (lines[lines.length - 1] === \"```\") suffix = lines.pop()!;\n return `${lines[0]}\\n${this.unindent(lines.slice(1).join(\"\\n\"))}\\n${suffix}`;\n });\n },\n\n start() {\n this.preSend = addPreSendListener((_, msg) => this.unindentMsg(msg));\n this.preEdit = addPreEditListener((_cid, _mid, msg) => this.unindentMsg(msg));\n },\n\n stop() {\n removePreSendListener(this.preSend);\n removePreEditListener(this.preEdit);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { ImageInvisible, ImageVisible } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { Menu, PermissionsBits, PermissionStore, RestAPI, UserStore } from \"@webpack/common\";\n\nconst EMBED_SUPPRESSED = 1 << 2;\n\nconst messageContextMenuPatch: NavContextMenuPatchCallback = (children, { channel, message: { author, embeds, flags, id: messageId } }) => () => {\n const isEmbedSuppressed = (flags & EMBED_SUPPRESSED) !== 0;\n if (!isEmbedSuppressed && !embeds.length) return;\n\n const hasEmbedPerms = channel.isPrivate() || !!(PermissionStore.getChannelPermissions({ id: channel.id }) & PermissionsBits.EMBED_LINKS);\n if (author.id === UserStore.getCurrentUser().id && !hasEmbedPerms) return;\n\n const menuGroup = findGroupChildrenByChildId(\"delete\", children);\n const deleteIndex = menuGroup?.findIndex(i => i?.props?.id === \"delete\");\n if (!deleteIndex || !menuGroup) return;\n\n menuGroup.splice(deleteIndex - 1, 0, (\n \n RestAPI.patch({\n url: `/channels/${channel.id}/messages/${messageId}`,\n body: { flags: isEmbedSuppressed ? flags & ~EMBED_SUPPRESSED : flags | EMBED_SUPPRESSED }\n })\n }\n />\n ));\n};\n\nexport default definePlugin({\n name: \"UnsuppressEmbeds\",\n authors: [Devs.rad, Devs.HypedDomi],\n description: \"Allows you to unsuppress embeds in messages\",\n\n start() {\n addContextMenuPatch(\"message\", messageContextMenuPatch);\n },\n\n stop() {\n removeContextMenuPatch(\"message\", messageContextMenuPatch);\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ApplicationCommandOptionType, sendBotMessage } from \"@api/Commands\";\nimport { ApplicationCommandInputType } from \"@api/Commands/types\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"UrbanDictionary\",\n description: \"Search for a word on Urban Dictionary via /urban slash command\",\n authors: [Devs.jewdev],\n dependencies: [\"CommandsAPI\"],\n commands: [\n {\n name: \"urban\",\n description: \"Returns the definition of a word from Urban Dictionary\",\n inputType: ApplicationCommandInputType.BUILT_IN,\n options: [\n {\n type: ApplicationCommandOptionType.STRING,\n name: \"word\",\n description: \"The word to search for on Urban Dictionary\",\n required: true\n }\n ],\n execute: async (args, ctx) => {\n try {\n const query = encodeURIComponent(args[0].value);\n const { list: [definition] } = await (await fetch(`https://api.urbandictionary.com/v0/define?term=${query}`)).json();\n\n if (!definition)\n return void sendBotMessage(ctx.channel.id, { content: \"No results found.\" });\n\n const linkify = (text: string) => text\n .replaceAll(\"\\r\\n\", \"\\n\")\n .replace(/([*>_`~\\\\])/gsi, \"\\\\$1\")\n .replace(/\\[(.+?)\\]/g, (_, word) => `[${word}](https://www.urbandictionary.com/define.php?term=${encodeURIComponent(word)} \"Define '${word}' on Urban Dictionary\")`)\n .trim();\n\n return void sendBotMessage(ctx.channel.id, {\n embeds: [\n {\n type: \"rich\",\n author: {\n name: `Uploaded by \"${definition.author}\"`,\n url: `https://www.urbandictionary.com/author.php?author=${encodeURIComponent(definition.author)}`,\n },\n title: definition.word,\n url: `https://www.urbandictionary.com/define.php?term=${encodeURIComponent(definition.word)}`,\n description: linkify(definition.definition),\n fields: [\n {\n name: \"Example\",\n value: linkify(definition.example),\n },\n {\n name: \"Want more definitions?\",\n value: `Check out [more definitions](https://www.urbandictionary.com/define.php?term=${query} \"Define \"${args[0].value}\" on Urban Dictionary\") on Urban Dictionary.`,\n },\n ],\n color: 0xFF9900,\n footer: { text: `\uD83D\uDC4D ${definition.thumbs_up.toString()} | \uD83D\uDC4E ${definition.thumbs_down.toString()}`, icon_url: \"https://www.urbandictionary.com/favicon.ico\" },\n timestamp: new Date(definition.written_on).toISOString(),\n },\n ] as any,\n });\n } catch (error) {\n sendBotMessage(ctx.channel.id, {\n content: `Something went wrong: \\`${error}\\``,\n });\n }\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./VoiceChannelSection.css\";\n\nimport { findByCodeLazy, findByPropsLazy } from \"@webpack\";\nimport { Button, Forms, PermissionStore, Toasts } from \"@webpack/common\";\nimport { Channel } from \"discord-types/general\";\n\nconst ChannelActions = findByPropsLazy(\"selectChannel\", \"selectVoiceChannel\");\nconst UserPopoutSection = findByCodeLazy(\".lastSection\", \"children:\");\n\nconst CONNECT = 1n << 20n;\n\ninterface VoiceChannelFieldProps {\n channel: Channel;\n label: string;\n showHeader: boolean;\n}\n\nexport const VoiceChannelSection = ({ channel, label, showHeader }: VoiceChannelFieldProps) => (\n \n {showHeader && In a voice channel}\n {\n if (PermissionStore.can(CONNECT, channel))\n ChannelActions.selectVoiceChannel(channel.id);\n else\n Toasts.show({\n message: \"Insufficient permissions to enter the channel.\",\n id: \"user-voice-show-insufficient-permissions\",\n type: Toasts.Type.FAILURE,\n options: {\n position: Toasts.Position.BOTTOM,\n }\n });\n }}\n >\n {label}\n \n \n);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findStoreLazy } from \"@webpack\";\nimport { ChannelStore, GuildStore, UserStore } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\n\nimport { VoiceChannelSection } from \"./components/VoiceChannelSection\";\n\nconst VoiceStateStore = findStoreLazy(\"VoiceStateStore\");\n\nconst settings = definePluginSettings({\n showInUserProfileModal: {\n type: OptionType.BOOLEAN,\n description: \"Show a user's voice channel in their profile modal\",\n default: true,\n },\n showVoiceChannelSectionHeader: {\n type: OptionType.BOOLEAN,\n description: 'Whether to show \"IN A VOICE CHANNEL\" above the join button',\n default: true,\n }\n});\n\ninterface UserProps {\n user: User;\n}\n\nconst VoiceChannelField = ErrorBoundary.wrap(({ user }: UserProps) => {\n const { channelId } = VoiceStateStore.getVoiceStateForUser(user.id) ?? {};\n if (!channelId) return null;\n\n const channel = ChannelStore.getChannel(channelId);\n if (!channel) return null;\n\n const guild = GuildStore.getGuild(channel.guild_id);\n\n if (!guild) return null; // When in DM call\n\n const result = `${guild.name} | ${channel.name}`;\n\n return (\n \n );\n});\n\nexport default definePlugin({\n name: \"UserVoiceShow\",\n description: \"Shows whether a User is currently in a voice channel somewhere in their profile\",\n authors: [Devs.LordElias],\n settings,\n\n patchModal({ user }: UserProps) {\n if (!settings.store.showInUserProfileModal)\n return null;\n\n return (\n
\n \n
\n );\n },\n\n patchPopout: ({ user }: UserProps) => {\n const isSelfUser = user.id === UserStore.getCurrentUser().id;\n return (\n
\n \n
\n );\n },\n\n patches: [\n // above message box\n {\n find: \".lastEditedByContainer\",\n replacement: {\n match: /\\(0,\\i\\.jsx\\)\\(\\i\\.\\i,{user:\\i,setNote/,\n replace: \"$self.patchPopout(arguments[0]),$&\",\n }\n },\n // below username\n {\n find: \".USER_PROFILE_MODAL\",\n replacement: {\n match: /\\.body.+?displayProfile:\\i}\\),/,\n replace: \"$&$self.patchModal(arguments[0]),\",\n }\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n(window.VencordStyles ??= new Map()).set(\"src/plugins/usrbg/index.css\", {\n name: \"src/plugins/usrbg/index.css\",\n source: \":is([class*=\\\"userProfile\\\"], [class*=\\\"userPopout\\\"]) [class*=\\\"bannerPremium\\\"] {\\n background: center / cover no-repeat;\\n}\\n\\n[class*=\\\"NonPremium\\\"]:has([class*=\\\"bannerPremium\\\"]) [class*=\\\"avatarPositionNormal\\\"],\\n[class*=\\\"PremiumWithoutBanner\\\"]:has([class*=\\\"bannerPremium\\\"]) [class*=\\\"avatarPositionPremiumNoBanner\\\"] {\\n top: 76px;\\n}\\n\\n[style*=\\\"background-image\\\"] [class*=\\\"background_\\\"] {\\n background-color: transparent !important;\\n}\\n\",\n classNames: {},\n dom: null,\n});\n\nexport default \"src/plugins/usrbg/index.css\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { enableStyle } from \"@api/Styles\";\nimport { Link } from \"@components/Link\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nimport style from \"./index.css?managed\";\n\nconst BASE_URL = \"https://raw.githubusercontent.com/AutumnVN/usrbg/main/usrbg.json\";\n\nlet data = {} as Record;\n\nconst settings = definePluginSettings({\n nitroFirst: {\n description: \"Banner to use if both Nitro and USRBG banners are present\",\n type: OptionType.SELECT,\n options: [\n { label: \"Nitro banner\", value: true, default: true },\n { label: \"USRBG banner\", value: false },\n ]\n },\n voiceBackground: {\n description: \"Use USRBG banners as voice chat backgrounds\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"USRBG\",\n description: \"Displays user banners from USRBG, allowing anyone to get a banner without Nitro\",\n authors: [Devs.AutumnVN, Devs.pylix, Devs.TheKodeToad],\n settings,\n patches: [\n {\n find: \".NITRO_BANNER,\",\n replacement: [\n {\n match: /(\\i)\\.premiumType/,\n replace: \"$self.premiumHook($1)||$&\"\n },\n {\n match: /(?<=function \\i\\((\\i)\\)\\{)(?=var.{30,50},bannerSrc:)/,\n replace: \"$1.bannerSrc=$self.useBannerHook($1);\"\n },\n {\n match: /\\?\\(0,\\i\\.jsx\\)\\(\\i,{type:\\i,shown/,\n replace: \"&&$self.shouldShowBadge(arguments[0])$&\"\n }\n ]\n },\n {\n find: \"\\\"data-selenium-video-tile\\\":\",\n predicate: () => settings.store.voiceBackground,\n replacement: [\n {\n match: /(?<=function\\((\\i),\\i\\)\\{)(?=let.{20,40},style:)/,\n replace: \"$1.style=$self.voiceBackgroundHook($1);\"\n }\n ]\n }\n ],\n\n\n data,\n\n settingsAboutComponent: () => {\n return (\n CLICK HERE TO GET YOUR OWN BANNER\n );\n },\n\n voiceBackgroundHook({ className, participantUserId }: any) {\n if (className.includes(\"tile_\")) {\n if (data[participantUserId]) {\n return {\n backgroundImage: `url(${data[participantUserId]})`,\n backgroundSize: \"cover\",\n backgroundPosition: \"center\",\n backgroundRepeat: \"no-repeat\"\n };\n }\n }\n },\n\n useBannerHook({ displayProfile, user }: any) {\n if (displayProfile?.banner && settings.store.nitroFirst) return;\n if (data[user.id]) return data[user.id];\n },\n\n premiumHook({ userId }: any) {\n if (data[userId]) return 2;\n },\n\n shouldShowBadge({ displayProfile, user }: any) {\n return displayProfile?.banner && (!data[user.id] || settings.store.nitroFirst);\n },\n\n async start() {\n enableStyle(style);\n\n const res = await fetch(BASE_URL);\n if (res.ok) {\n data = await res.json();\n this.data = data;\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { sleep } from \"@utils/misc\";\nimport { Queue } from \"@utils/Queue\";\nimport definePlugin from \"@utils/types\";\nimport { UserStore, UserUtils, useState } from \"@webpack/common\";\nimport type { ComponentType, ReactNode } from \"react\";\n\nconst fetching = new Set();\nconst queue = new Queue(5);\n\ninterface MentionProps {\n data: {\n userId?: string;\n channelId?: string;\n content: any;\n };\n parse: (content: any, props: MentionProps[\"props\"]) => ReactNode;\n props: {\n key: string;\n formatInline: boolean;\n noStyleAndInteraction: boolean;\n };\n RoleMention: ComponentType;\n UserMention: ComponentType;\n}\n\nfunction MentionWrapper({ data, UserMention, RoleMention, parse, props }: MentionProps) {\n const [userId, setUserId] = useState(data.userId);\n\n // if userId is set it means the user is cached. Uncached users have userId set to undefined\n if (userId)\n return (\n \n );\n\n // Parses the raw text node array data.content into a ReactNode[]: [\"<@userid>\"]\n const children = parse(data.content, props);\n\n return (\n // Discord is deranged and renders unknown user mentions as role mentions\n \n {\n const mention = children?.[0]?.props?.children;\n if (typeof mention !== \"string\") return;\n\n const id = mention.match(/<@!?(\\d+)>/)?.[1];\n if (!id) return;\n\n if (fetching.has(id))\n return;\n\n if (UserStore.getUser(id))\n return setUserId(id);\n\n const fetch = () => {\n fetching.add(id);\n\n queue.unshift(() =>\n UserUtils.getUser(id)\n .then(() => {\n setUserId(id);\n fetching.delete(id);\n })\n .catch(e => {\n if (e?.status === 429) {\n queue.unshift(() => sleep(1000).then(fetch));\n fetching.delete(id);\n }\n })\n .finally(() => sleep(300))\n );\n };\n\n fetch();\n }}\n >\n {children}\n \n \n );\n}\n\nexport default definePlugin({\n name: \"ValidUser\",\n description: \"Fix mentions for unknown users showing up as '<@343383572805058560>' (hover over a mention to fix it)\",\n authors: [Devs.Ven],\n tags: [\"MentionCacheFix\"],\n\n patches: [{\n find: 'className:\"mention\"',\n replacement: {\n // mention = { react: function (data, parse, props) { if (data.userId == null) return RoleMention() else return UserMention()\n match: /react(?=\\(\\i,\\i,\\i\\).{0,50}return null==\\i\\?\\(0,\\i\\.jsx\\)\\((\\i\\.\\i),.+?jsx\\)\\((\\i\\.\\i),\\{className:\"mention\")/,\n // react: (...args) => OurWrapper(RoleMention, UserMention, ...args), originalReact: theirFunc\n replace: \"react:(...args)=>$self.renderMention($1,$2,...args),originalReact\"\n }\n }],\n\n renderMention(RoleMention, UserMention, data, parse, props) {\n return (\n \n \n \n );\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { ChannelStore, SelectedChannelStore } from \"@webpack/common\";\n\nconst timers = {} as Record;\n\nexport default definePlugin({\n name: \"VoiceChatDoubleClick\",\n description: \"Join voice chats via double click instead of single click\",\n authors: [Devs.Ven, Devs.D3SOX],\n patches: [\n ...[\n \".handleVoiceStatusClick\", // voice channels\n \".handleClickChat\" // stage channels\n ].map(find => ({\n find,\n // hack: these are not React onClick, it is a custom prop handled by Discord\n // thus, replacing this with onDoubleClick won't work, and you also cannot check\n // e.detail since instead of the event they pass the channel.\n // do this timer workaround instead\n replacement: [\n {\n match: /onClick:\\(\\)=>\\{this.handleClick\\(\\)/g,\n replace: \"onClick:()=>{$self.schedule(()=>{this.handleClick()},this)\",\n },\n ]\n })),\n {\n // channel mentions\n find: \".shouldCloseDefaultModals\",\n replacement: {\n match: /onClick:(\\i)(?=,.{0,30}className:\"channelMention\".+?(\\i)\\.inContent)/,\n replace: (_, onClick, props) => \"\"\n + `onClick:(vcDoubleClickEvt)=>$self.shouldRunOnClick(vcDoubleClickEvt,${props})&&${onClick}()`,\n }\n }\n ],\n\n shouldRunOnClick(e: MouseEvent, { channelId }) {\n const channel = ChannelStore.getChannel(channelId);\n if (!channel || ![2, 13].includes(channel.type)) return true;\n return e.detail >= 2;\n },\n\n schedule(cb: () => void, e: any) {\n const id = e.props.channel.id as string;\n if (SelectedChannelStore.getVoiceChannelId() === id) {\n cb();\n return;\n }\n // use a different counter for each channel\n const data = (timers[id] ??= { timeout: void 0, i: 0 });\n // clear any existing timer\n clearTimeout(data.timeout);\n\n // if we already have 2 or more clicks, run the callback immediately\n if (++data.i >= 2) {\n cb();\n delete timers[id];\n } else {\n // else reset the counter in 500ms\n data.timeout = setTimeout(() => {\n delete timers[id];\n }, 500);\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { ErrorCard } from \"@components/ErrorCard\";\nimport { Devs } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport { Margins } from \"@utils/margins\";\nimport { wordsToTitle } from \"@utils/text\";\nimport definePlugin, { OptionType, PluginOptionsItem } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { Button, ChannelStore, Forms, GuildMemberStore, SelectedChannelStore, SelectedGuildStore, useMemo, UserStore } from \"@webpack/common\";\n\ninterface VoiceState {\n userId: string;\n channelId?: string;\n oldChannelId?: string;\n deaf: boolean;\n mute: boolean;\n selfDeaf: boolean;\n selfMute: boolean;\n}\n\nconst VoiceStateStore = findByPropsLazy(\"getVoiceStatesForChannel\", \"getCurrentClientVoiceChannelId\");\n\n// Mute/Deaf for other people than you is commented out, because otherwise someone can spam it and it will be annoying\n// Filtering out events is not as simple as just dropping duplicates, as otherwise mute, unmute, mute would\n// not say the second mute, which would lead you to believe they're unmuted\n\nfunction speak(text: string, settings: any = Settings.plugins.VcNarrator) {\n if (!text) return;\n\n const speech = new SpeechSynthesisUtterance(text);\n let voice = speechSynthesis.getVoices().find(v => v.voiceURI === settings.voice);\n if (!voice) {\n new Logger(\"VcNarrator\").error(`Voice \"${settings.voice}\" not found. Resetting to default.`);\n voice = speechSynthesis.getVoices().find(v => v.default);\n settings.voice = voice?.voiceURI;\n if (!voice) return; // This should never happen\n }\n speech.voice = voice!;\n speech.volume = settings.volume;\n speech.rate = settings.rate;\n speechSynthesis.speak(speech);\n}\n\nfunction clean(str: string) {\n const replacer = Settings.plugins.VcNarrator.latinOnly\n ? /[^\\p{Script=Latin}\\p{Number}\\p{Punctuation}\\s]/gu\n : /[^\\p{Letter}\\p{Number}\\p{Punctuation}\\s]/gu;\n\n return str.normalize(\"NFKC\")\n .replace(replacer, \"\")\n .replace(/_{2,}/g, \"_\")\n .trim();\n}\n\nfunction formatText(str: string, user: string, channel: string, displayName: string, nickname: string) {\n return str\n .replaceAll(\"{{USER}}\", clean(user) || (user ? \"Someone\" : \"\"))\n .replaceAll(\"{{CHANNEL}}\", clean(channel) || \"channel\")\n .replaceAll(\"{{DISPLAY_NAME}}\", clean(displayName) || (displayName ? \"Someone\" : \"\"))\n .replaceAll(\"{{NICKNAME}}\", clean(nickname) || (nickname ? \"Someone\" : \"\"));\n}\n\n/*\nlet StatusMap = {} as Record;\n*/\n\n// For every user, channelId and oldChannelId will differ when moving channel.\n// Only for the local user, channelId and oldChannelId will be the same when moving channel,\n// for some ungodly reason\nlet myLastChannelId: string | undefined;\n\nfunction getTypeAndChannelId({ channelId, oldChannelId }: VoiceState, isMe: boolean) {\n if (isMe && channelId !== myLastChannelId) {\n oldChannelId = myLastChannelId;\n myLastChannelId = channelId;\n }\n\n if (channelId !== oldChannelId) {\n if (channelId) return [oldChannelId ? \"move\" : \"join\", channelId];\n if (oldChannelId) return [\"leave\", oldChannelId];\n }\n /*\n if (channelId) {\n if (deaf || selfDeaf) return [\"deafen\", channelId];\n if (mute || selfMute) return [\"mute\", channelId];\n const oldStatus = StatusMap[userId];\n if (oldStatus.deaf) return [\"undeafen\", channelId];\n if (oldStatus.mute) return [\"unmute\", channelId];\n }\n */\n return [\"\", \"\"];\n}\n\n/*\nfunction updateStatuses(type: string, { deaf, mute, selfDeaf, selfMute, userId, channelId }: VoiceState, isMe: boolean) {\n if (isMe && (type === \"join\" || type === \"move\")) {\n StatusMap = {};\n const states = VoiceStateStore.getVoiceStatesForChannel(channelId!) as Record;\n for (const userId in states) {\n const s = states[userId];\n StatusMap[userId] = {\n mute: s.mute || s.selfMute,\n deaf: s.deaf || s.selfDeaf\n };\n }\n return;\n }\n\n if (type === \"leave\" || (type === \"move\" && channelId !== SelectedChannelStore.getVoiceChannelId())) {\n if (isMe)\n StatusMap = {};\n else\n delete StatusMap[userId];\n\n return;\n }\n\n StatusMap[userId] = {\n deaf: deaf || selfDeaf,\n mute: mute || selfMute\n };\n}\n*/\n\nfunction playSample(tempSettings: any, type: string) {\n const settings = Object.assign({}, Settings.plugins.VcNarrator, tempSettings);\n const currentUser = UserStore.getCurrentUser();\n const myGuildId = SelectedGuildStore.getGuildId();\n\n speak(formatText(settings[type + \"Message\"], currentUser.username, \"general\", (currentUser as any).globalName ?? currentUser.username, GuildMemberStore.getNick(myGuildId, currentUser.id) ?? currentUser.username), settings);\n}\n\nexport default definePlugin({\n name: \"VcNarrator\",\n description: \"Announces when users join, leave, or move voice channels via narrator\",\n authors: [Devs.Ven],\n\n flux: {\n VOICE_STATE_UPDATES({ voiceStates }: { voiceStates: VoiceState[]; }) {\n const myGuildId = SelectedGuildStore.getGuildId();\n const myChanId = SelectedChannelStore.getVoiceChannelId();\n const myId = UserStore.getCurrentUser().id;\n\n if (ChannelStore.getChannel(myChanId!)?.type === 13 /* Stage Channel */) return;\n\n for (const state of voiceStates) {\n const { userId, channelId, oldChannelId } = state;\n const isMe = userId === myId;\n if (!isMe) {\n if (!myChanId) continue;\n if (channelId !== myChanId && oldChannelId !== myChanId) continue;\n }\n\n const [type, id] = getTypeAndChannelId(state, isMe);\n if (!type) continue;\n\n const template = Settings.plugins.VcNarrator[type + \"Message\"];\n const user = isMe && !Settings.plugins.VcNarrator.sayOwnName ? \"\" : UserStore.getUser(userId).username;\n const displayName = user && ((UserStore.getUser(userId) as any).globalName ?? user);\n const nickname = user && (GuildMemberStore.getNick(myGuildId, userId) ?? user);\n const channel = ChannelStore.getChannel(id).name;\n\n speak(formatText(template, user, channel, displayName, nickname));\n\n // updateStatuses(type, state, isMe);\n }\n },\n\n AUDIO_TOGGLE_SELF_MUTE() {\n const chanId = SelectedChannelStore.getVoiceChannelId()!;\n const s = VoiceStateStore.getVoiceStateForChannel(chanId) as VoiceState;\n if (!s) return;\n\n const event = s.mute || s.selfMute ? \"unmute\" : \"mute\";\n speak(formatText(Settings.plugins.VcNarrator[event + \"Message\"], \"\", ChannelStore.getChannel(chanId).name, \"\", \"\"));\n },\n\n AUDIO_TOGGLE_SELF_DEAF() {\n const chanId = SelectedChannelStore.getVoiceChannelId()!;\n const s = VoiceStateStore.getVoiceStateForChannel(chanId) as VoiceState;\n if (!s) return;\n\n const event = s.deaf || s.selfDeaf ? \"undeafen\" : \"deafen\";\n speak(formatText(Settings.plugins.VcNarrator[event + \"Message\"], \"\", ChannelStore.getChannel(chanId).name, \"\", \"\"));\n }\n },\n\n start() {\n if (typeof speechSynthesis === \"undefined\" || speechSynthesis.getVoices().length === 0) {\n new Logger(\"VcNarrator\").warn(\n \"SpeechSynthesis not supported or no Narrator voices found. Thus, this plugin will not work. Check my Settings for more info\"\n );\n return;\n }\n\n },\n\n optionsCache: null as Record | null,\n\n get options() {\n return this.optionsCache ??= {\n voice: {\n type: OptionType.SELECT,\n description: \"Narrator Voice\",\n options: window.speechSynthesis?.getVoices().map(v => ({\n label: v.name,\n value: v.voiceURI,\n default: v.default\n })) ?? []\n },\n volume: {\n type: OptionType.SLIDER,\n description: \"Narrator Volume\",\n default: 1,\n markers: [0, 0.25, 0.5, 0.75, 1],\n stickToMarkers: false\n },\n rate: {\n type: OptionType.SLIDER,\n description: \"Narrator Speed\",\n default: 1,\n markers: [0.1, 0.5, 1, 2, 5, 10],\n stickToMarkers: false\n },\n sayOwnName: {\n description: \"Say own name\",\n type: OptionType.BOOLEAN,\n default: false\n },\n latinOnly: {\n description: \"Strip non latin characters from names before saying them\",\n type: OptionType.BOOLEAN,\n default: false\n },\n joinMessage: {\n type: OptionType.STRING,\n description: \"Join Message\",\n default: \"{{USER}} joined\"\n },\n leaveMessage: {\n type: OptionType.STRING,\n description: \"Leave Message\",\n default: \"{{USER}} left\"\n },\n moveMessage: {\n type: OptionType.STRING,\n description: \"Move Message\",\n default: \"{{USER}} moved to {{CHANNEL}}\"\n },\n muteMessage: {\n type: OptionType.STRING,\n description: \"Mute Message (only self for now)\",\n default: \"{{USER}} Muted\"\n },\n unmuteMessage: {\n type: OptionType.STRING,\n description: \"Unmute Message (only self for now)\",\n default: \"{{USER}} unmuted\"\n },\n deafenMessage: {\n type: OptionType.STRING,\n description: \"Deafen Message (only self for now)\",\n default: \"{{USER}} deafened\"\n },\n undeafenMessage: {\n type: OptionType.STRING,\n description: \"Undeafen Message (only self for now)\",\n default: \"{{USER}} undeafened\"\n }\n };\n },\n\n settingsAboutComponent({ tempSettings: s }) {\n const [hasVoices, hasEnglishVoices] = useMemo(() => {\n const voices = speechSynthesis.getVoices();\n return [voices.length !== 0, voices.some(v => v.lang.startsWith(\"en\"))];\n }, []);\n\n const types = useMemo(\n () => Object.keys(Vencord.Plugins.plugins.VcNarrator.options!).filter(k => k.endsWith(\"Message\")).map(k => k.slice(0, -7)),\n [],\n );\n\n let errorComponent: React.ReactElement | null = null;\n if (!hasVoices) {\n let error = \"No narrator voices found. \";\n error += navigator.platform?.toLowerCase().includes(\"linux\")\n ? \"Install speech-dispatcher or espeak and run Discord with the --enable-speech-dispatcher flag\"\n : \"Try installing some in the Narrator settings of your Operating System\";\n errorComponent = {error};\n } else if (!hasEnglishVoices) {\n errorComponent = You don't have any English voices installed, so the narrator might sound weird;\n }\n\n return (\n \n \n You can customise the spoken messages below. You can disable specific messages by setting them to nothing\n \n \n The special placeholders {\"{{USER}}\"}, {\"{{DISPLAY_NAME}}\"}, {\"{{NICKNAME}}\"} and {\"{{CHANNEL}}\"}{\" \"}\n will be replaced with the user's name (nothing if it's yourself), the user's display name, the user's nickname on current server and the channel's name respectively\n \n {hasEnglishVoices && (\n <>\n Play Example Sounds\n \n {types.map(t => (\n \n ))}\n \n \n )}\n {errorComponent}\n \n );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./index.css\";\n\nimport { openNotificationLogModal } from \"@api/Notifications/notificationLog\";\nimport { Settings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { LazyComponent } from \"@utils/react\";\nimport definePlugin from \"@utils/types\";\nimport { filters, find } from \"@webpack\";\nimport { Menu, Popout, useState } from \"@webpack/common\";\nimport type { ReactNode } from \"react\";\n\nconst HeaderBarIcon = LazyComponent(() => {\n const filter = filters.byCode(\".HEADER_BAR_BADGE\");\n return find(m => m.Icon && filter(m.Icon)).Icon;\n});\n\nfunction VencordPopout(onClose: () => void) {\n const pluginEntries = [] as ReactNode[];\n\n for (const plugin of Object.values(Vencord.Plugins.plugins)) {\n if (plugin.toolboxActions) {\n pluginEntries.push(\n \n {Object.entries(plugin.toolboxActions).map(([text, action]) => {\n const key = `vc-toolbox-${plugin.name}-${text}`;\n\n return (\n \n );\n })}\n \n );\n }\n }\n\n return (\n \n \n {\n Settings.useQuickCss = !Settings.useQuickCss;\n onClose();\n }}\n />\n VencordNative.quickCss.openEditor()}\n />\n {...pluginEntries}\n \n );\n}\n\nfunction VencordPopoutIcon(isShown: boolean) {\n return (\n \n \n \n );\n}\n\nfunction VencordPopoutButton() {\n const [show, setShow] = useState(false);\n\n return (\n setShow(false)}\n renderPopout={() => VencordPopout(() => setShow(false))}\n >\n {(_, { isShown }) => (\n setShow(v => !v)}\n tooltip={isShown ? null : \"Vencord Toolbox\"}\n icon={() => VencordPopoutIcon(isShown)}\n selected={isShown}\n />\n )}\n \n );\n}\n\nfunction ToolboxFragmentWrapper({ children }: { children: ReactNode[]; }) {\n children.splice(\n children.length - 1, 0,\n \n \n \n );\n\n return <>{children};\n}\n\nexport default definePlugin({\n name: \"VencordToolbox\",\n description: \"Adds a button next to the inbox button in the channel header that houses Vencord quick actions\",\n authors: [Devs.Ven, Devs.AutumnVN],\n\n patches: [\n {\n find: \"toolbar:function\",\n replacement: {\n match: /(?<=toolbar:function.{0,100}\\()\\i.Fragment,/,\n replace: \"$self.ToolboxFragmentWrapper,\"\n }\n }\n ],\n\n ToolboxFragmentWrapper: ErrorBoundary.wrap(ToolboxFragmentWrapper, {\n fallback: () =>

Failed to render :(

\n })\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport { ImageIcon } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport { openImageModal } from \"@utils/discord\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { GuildMemberStore, Menu } from \"@webpack/common\";\nimport type { Channel, Guild, User } from \"discord-types/general\";\n\nconst BannerStore = findByPropsLazy(\"getGuildBannerURL\");\n\ninterface UserContextProps {\n channel: Channel;\n guildId?: string;\n user: User;\n}\n\ninterface GuildContextProps {\n guild?: Guild;\n}\n\nconst settings = definePluginSettings({\n format: {\n type: OptionType.SELECT,\n description: \"Choose the image format to use for non animated images. Animated images will always use .gif\",\n options: [\n {\n label: \"webp\",\n value: \"webp\",\n default: true\n },\n {\n label: \"png\",\n value: \"png\",\n },\n {\n label: \"jpg\",\n value: \"jpg\",\n }\n ]\n },\n imgSize: {\n type: OptionType.SELECT,\n description: \"The image size to use\",\n options: [\"128\", \"256\", \"512\", \"1024\", \"2048\", \"4096\"].map(n => ({ label: n, value: n, default: n === \"1024\" }))\n }\n});\n\nfunction openImage(url: string) {\n const format = url.startsWith(\"/\") ? \"png\" : settings.store.format;\n\n const u = new URL(url, window.location.href);\n u.searchParams.set(\"size\", settings.store.imgSize);\n u.pathname = u.pathname.replace(/\\.(png|jpe?g|webp)$/, `.${format}`);\n url = u.toString();\n\n u.searchParams.set(\"size\", \"4096\");\n const originalUrl = u.toString();\n\n openImageModal(url, {\n original: originalUrl,\n height: 256\n });\n}\n\nconst UserContext: NavContextMenuPatchCallback = (children, { user, guildId }: UserContextProps) => () => {\n if (!user) return;\n const memberAvatar = GuildMemberStore.getMember(guildId!, user.id)?.avatar || null;\n\n children.splice(-1, 0, (\n \n openImage(BannerStore.getUserAvatarURL(user, true))}\n icon={ImageIcon}\n />\n {memberAvatar && (\n openImage(BannerStore.getGuildMemberAvatarURLSimple({\n userId: user.id,\n avatar: memberAvatar,\n guildId,\n canAnimate: true\n }, true))}\n icon={ImageIcon}\n />\n )}\n \n ));\n};\n\nconst GuildContext: NavContextMenuPatchCallback = (children, { guild }: GuildContextProps) => () => {\n if (!guild) return;\n\n const { id, icon, banner } = guild;\n if (!banner && !icon) return;\n\n children.splice(-1, 0, (\n \n {icon ? (\n \n openImage(BannerStore.getGuildIconURL({\n id,\n icon,\n canAnimate: true\n }))\n }\n icon={ImageIcon}\n />\n ) : null}\n {banner ? (\n \n openImage(BannerStore.getGuildBannerURL({\n id,\n banner,\n }, true))\n }\n icon={ImageIcon}\n />\n ) : null}\n \n ));\n};\n\nexport default definePlugin({\n name: \"ViewIcons\",\n authors: [Devs.Ven, Devs.TheKodeToad, Devs.Nuckyz],\n description: \"Makes avatars and banners in user profiles clickable, and adds View Icon/Banner entries in the user and server context menu\",\n tags: [\"ImageUtilities\"],\n\n settings,\n\n openImage,\n\n start() {\n addContextMenuPatch(\"user-context\", UserContext);\n addContextMenuPatch(\"guild-context\", GuildContext);\n },\n\n stop() {\n removeContextMenuPatch(\"user-context\", UserContext);\n removeContextMenuPatch(\"guild-context\", GuildContext);\n },\n\n patches: [\n // Make pfps clickable\n {\n find: \"User Profile Modal - Context Menu\",\n replacement: {\n match: /\\{src:(\\i)(?=,avatarDecoration)/,\n replace: \"{src:$1,onClick:()=>$self.openImage($1)\"\n }\n },\n // Make banners clickable\n {\n find: \".NITRO_BANNER,\",\n replacement: {\n // style: { backgroundImage: shouldShowBanner ? \"url(\".concat(bannerUrl,\n match: /style:\\{(?=backgroundImage:(\\i&&\\i)\\?\"url\\(\"\\.concat\\((\\i),)/,\n replace:\n // onClick: () => shouldShowBanner && ev.target.style.backgroundImage && openImage(bannerUrl), style: { cursor: shouldShowBanner ? \"pointer\" : void 0,\n 'onClick:ev=>$1&&ev.target.style.backgroundImage&&$self.openImage($2),style:{cursor:$1?\"pointer\":void 0,'\n }\n },\n {\n find: \".avatarPositionPanel\",\n replacement: {\n match: /(?<=avatarWrapperNonUserBot.{0,50})onClick:(\\i\\|\\|\\i)\\?void 0(?<=,avatarSrc:(\\i).+?)/,\n replace: \"style:($1)?{cursor:\\\"pointer\\\"}:{},onClick:$1?()=>{$self.openImage($2)}\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { findByPropsLazy } from \"@webpack\";\nimport { Parser } from \"@webpack/common\";\n\nconst CodeContainerClasses = findByPropsLazy(\"markup\", \"codeContainer\");\n\n/**\n * Renders code in a Discord codeblock\n */\nexport function CodeBlock(props: { content?: string, lang: string; }) {\n return (\n
\n {Parser.defaultRules.codeBlock.react(props, null, {})}\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { addButton, removeButton } from \"@api/MessagePopover\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport { CodeBlock } from \"@components/CodeBlock\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { Devs } from \"@utils/constants\";\nimport { Margins } from \"@utils/margins\";\nimport { copyWithToast } from \"@utils/misc\";\nimport { closeModal, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalRoot, ModalSize, openModal } from \"@utils/modal\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Button, ChannelStore, Forms, Menu, Text } from \"@webpack/common\";\nimport { Message } from \"discord-types/general\";\n\n\nconst CopyIcon = () => {\n return \n \n \n ;\n};\n\nfunction sortObject(obj: T): T {\n return Object.fromEntries(Object.entries(obj).sort(([k1], [k2]) => k1.localeCompare(k2))) as T;\n}\n\nfunction cleanMessage(msg: Message) {\n const clone = sortObject(JSON.parse(JSON.stringify(msg)));\n for (const key of [\n \"email\",\n \"phone\",\n \"mfaEnabled\",\n \"personalConnectionId\"\n ]) delete clone.author[key];\n\n // message logger added properties\n const cloneAny = clone as any;\n delete cloneAny.editHistory;\n delete cloneAny.deleted;\n cloneAny.attachments?.forEach(a => delete a.deleted);\n\n return clone;\n}\n\nfunction openViewRawModal(json: string, type: string, msgContent?: string) {\n const key = openModal(props => (\n \n \n \n View Raw\n closeModal(key)} />\n \n \n
\n {!!msgContent && (\n <>\n Content\n \n \n \n )}\n\n {type} Data\n \n
\n
\n \n \n \n {!!msgContent && (\n \n )}\n \n \n
\n
\n ));\n}\n\nfunction openViewRawModalMessage(msg: Message) {\n msg = cleanMessage(msg);\n const msgJson = JSON.stringify(msg, null, 4);\n\n return openViewRawModal(msgJson, \"Message\", msg.content);\n}\n\nconst settings = definePluginSettings({\n clickMethod: {\n description: \"Change the button to view the raw content/data of any message.\",\n type: OptionType.SELECT,\n options: [\n { label: \"Left Click to view the raw content.\", value: \"Left\", default: true },\n { label: \"Right click to view the raw content.\", value: \"Right\" }\n ]\n }\n});\n\nfunction MakeContextCallback(name: string) {\n const callback: NavContextMenuPatchCallback = (children, props) => () => {\n if ((name === \"Guild\" && !props.guild) || (name === \"User\" && !props.user)) return;\n const lastChild = children.at(-1);\n if (lastChild?.key === \"developer-actions\") {\n const p = lastChild.props;\n if (!Array.isArray(p.children))\n p.children = [p.children];\n ({ children } = p);\n }\n\n children.splice(-1, 0,\n openViewRawModal(JSON.stringify(props[name.toLowerCase()], null, 4), name)}\n icon={CopyIcon}\n />\n );\n };\n return callback;\n}\n\n\nexport default definePlugin({\n name: \"ViewRaw\",\n description: \"Copy and view the raw content/data of any message, channel or guild\",\n authors: [Devs.KingFish, Devs.Ven, Devs.rad, Devs.ImLvna],\n dependencies: [\"MessagePopoverAPI\"],\n settings,\n\n start() {\n addButton(\"ViewRaw\", msg => {\n const handleClick = () => {\n if (settings.store.clickMethod === \"Right\") {\n copyWithToast(msg.content);\n } else {\n openViewRawModalMessage(msg);\n }\n };\n\n const handleContextMenu = e => {\n if (settings.store.clickMethod === \"Left\") {\n e.preventDefault();\n e.stopPropagation();\n copyWithToast(msg.content);\n } else {\n e.preventDefault();\n e.stopPropagation();\n openViewRawModalMessage(msg);\n }\n };\n\n const label = settings.store.clickMethod === \"Right\"\n ? \"Copy Raw (Left Click) / View Raw (Right Click)\"\n : \"View Raw (Left Click) / Copy Raw (Right Click)\";\n\n return {\n label,\n icon: CopyIcon,\n message: msg,\n channel: ChannelStore.getChannel(msg.channel_id),\n onClick: handleClick,\n onContextMenu: handleContextMenu\n };\n });\n\n addContextMenuPatch(\"guild-context\", MakeContextCallback(\"Guild\"));\n addContextMenuPatch(\"channel-context\", MakeContextCallback(\"Channel\"));\n addContextMenuPatch(\"user-context\", MakeContextCallback(\"User\"));\n },\n\n stop() {\n removeButton(\"CopyRawMessage\");\n removeContextMenuPatch(\"guild-context\", MakeContextCallback(\"Guild\"));\n removeContextMenuPatch(\"channel-context\", MakeContextCallback(\"Channel\"));\n removeContextMenuPatch(\"user-context\", MakeContextCallback(\"User\"));\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { OptionType } from \"@utils/types\";\n\nexport const settings = definePluginSettings({\n noiseSuppression: {\n type: OptionType.BOOLEAN,\n description: \"Noise Suppression\",\n default: true,\n },\n echoCancellation: {\n type: OptionType.BOOLEAN,\n description: \"Echo Cancellation\",\n default: true,\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PluginNative } from \"@utils/types\";\nimport { Button, showToast, Toasts, useState } from \"@webpack/common\";\n\nimport type { VoiceRecorder } from \".\";\nimport { settings } from \"./settings\";\n\nconst Native = VencordNative.pluginHelpers.VoiceMessages as PluginNative;\n\nexport const VoiceRecorderDesktop: VoiceRecorder = ({ setAudioBlob, onRecordingChange }) => {\n const [recording, setRecording] = useState(false);\n\n const changeRecording = (recording: boolean) => {\n setRecording(recording);\n onRecordingChange?.(recording);\n };\n\n function toggleRecording() {\n const discordVoice = DiscordNative.nativeModules.requireModule(\"discord_voice\");\n const nowRecording = !recording;\n\n if (nowRecording) {\n discordVoice.startLocalAudioRecording(\n {\n echoCancellation: settings.store.echoCancellation,\n noiseCancellation: settings.store.noiseSuppression,\n },\n (success: boolean) => {\n if (success)\n changeRecording(true);\n else\n showToast(\"Failed to start recording\", Toasts.Type.FAILURE);\n }\n );\n } else {\n discordVoice.stopLocalAudioRecording(async (filePath: string) => {\n if (filePath) {\n const buf = await Native.readRecording(filePath);\n if (buf)\n setAudioBlob(new Blob([buf], { type: \"audio/ogg; codecs=opus\" }));\n else\n showToast(\"Failed to finish recording\", Toasts.Type.FAILURE);\n }\n changeRecording(false);\n });\n }\n }\n\n return (\n \n );\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { classNameFactory } from \"@api/Styles\";\n\nexport const cl = classNameFactory(\"vc-vmsg-\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { useTimer } from \"@utils/react\";\nimport { findComponentByCodeLazy } from \"@webpack\";\n\nimport { cl } from \"./utils\";\n\ninterface VoiceMessageProps {\n src: string;\n waveform: string;\n}\nconst VoiceMessage = findComponentByCodeLazy(\"waveform:\");\n\nexport type VoicePreviewOptions = {\n src?: string;\n waveform: string;\n recording?: boolean;\n};\nexport const VoicePreview = ({\n src,\n waveform,\n recording,\n}: VoicePreviewOptions) => {\n const durationMs = useTimer({\n deps: [recording]\n });\n\n const durationSeconds = recording ? Math.floor(durationMs / 1000) : 0;\n const durationDisplay = Math.floor(durationSeconds / 60) + \":\" + (durationSeconds % 60).toString().padStart(2, \"0\");\n\n if (src && !recording)\n return ;\n\n return (\n
\n
\n
{durationDisplay}
\n
{recording ? \"RECORDING\" : \"----\"}
\n
\n );\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Button, useState } from \"@webpack/common\";\n\nimport type { VoiceRecorder } from \".\";\nimport { settings } from \"./settings\";\n\nexport const VoiceRecorderWeb: VoiceRecorder = ({ setAudioBlob, onRecordingChange }) => {\n const [recording, setRecording] = useState(false);\n const [paused, setPaused] = useState(false);\n const [recorder, setRecorder] = useState();\n const [chunks, setChunks] = useState([]);\n\n const changeRecording = (recording: boolean) => {\n setRecording(recording);\n onRecordingChange?.(recording);\n };\n\n function toggleRecording() {\n const nowRecording = !recording;\n\n if (nowRecording) {\n navigator.mediaDevices.getUserMedia({\n audio: {\n echoCancellation: settings.store.echoCancellation,\n noiseSuppression: settings.store.noiseSuppression,\n }\n }).then(stream => {\n const chunks = [] as Blob[];\n setChunks(chunks);\n\n const recorder = new MediaRecorder(stream);\n setRecorder(recorder);\n recorder.addEventListener(\"dataavailable\", e => {\n chunks.push(e.data);\n });\n recorder.start();\n\n changeRecording(true);\n });\n } else {\n if (recorder) {\n recorder.addEventListener(\"stop\", () => {\n setAudioBlob(new Blob(chunks, { type: \"audio/ogg; codecs=opus\" }));\n\n changeRecording(false);\n });\n recorder.stop();\n }\n }\n }\n\n return (\n <>\n \n\n {\n setPaused(!paused);\n if (paused) recorder?.resume();\n else recorder?.pause();\n }}\n >\n {paused ? \"Resume\" : \"Pause\"} recording\n \n \n );\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport { addContextMenuPatch, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { Microphone } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport { ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, openModal } from \"@utils/modal\";\nimport { useAwaiter } from \"@utils/react\";\nimport definePlugin from \"@utils/types\";\nimport { chooseFile } from \"@utils/web\";\nimport { findByPropsLazy, findStoreLazy } from \"@webpack\";\nimport { Button, FluxDispatcher, Forms, lodash, Menu, PermissionsBits, PermissionStore, RestAPI, SelectedChannelStore, showToast, SnowflakeUtils, Toasts, useEffect, useState } from \"@webpack/common\";\nimport { ComponentType } from \"react\";\n\nimport { VoiceRecorderDesktop } from \"./DesktopRecorder\";\nimport { settings } from \"./settings\";\nimport { cl } from \"./utils\";\nimport { VoicePreview } from \"./VoicePreview\";\nimport { VoiceRecorderWeb } from \"./WebRecorder\";\n\nconst CloudUtils = findByPropsLazy(\"CloudUpload\");\nconst MessageCreator = findByPropsLazy(\"getSendMessageOptionsForReply\", \"sendMessage\");\nconst PendingReplyStore = findStoreLazy(\"PendingReplyStore\");\nconst OptionClasses = findByPropsLazy(\"optionName\", \"optionIcon\", \"optionLabel\");\n\nexport type VoiceRecorder = ComponentType<{\n setAudioBlob(blob: Blob): void;\n onRecordingChange?(recording: boolean): void;\n}>;\n\nconst VoiceRecorder = IS_DISCORD_DESKTOP ? VoiceRecorderDesktop : VoiceRecorderWeb;\n\nexport default definePlugin({\n name: \"VoiceMessages\",\n description: \"Allows you to send voice messages like on mobile. To do so, right click the upload button and click Send Voice Message\",\n authors: [Devs.Ven, Devs.Vap, Devs.Nickyux],\n settings,\n\n start() {\n addContextMenuPatch(\"channel-attach\", ctxMenuPatch);\n },\n\n stop() {\n removeContextMenuPatch(\"channel-attach\", ctxMenuPatch);\n }\n});\n\ntype AudioMetadata = {\n waveform: string,\n duration: number,\n};\nconst EMPTY_META: AudioMetadata = {\n waveform: \"AAAAAAAAAAAA\",\n duration: 1,\n};\n\nfunction sendAudio(blob: Blob, meta: AudioMetadata) {\n const channelId = SelectedChannelStore.getChannelId();\n const reply = PendingReplyStore.getPendingReply(channelId);\n if (reply) FluxDispatcher.dispatch({ type: \"DELETE_PENDING_REPLY\", channelId });\n\n const upload = new CloudUtils.CloudUpload({\n file: new File([blob], \"voice-message.ogg\", { type: \"audio/ogg; codecs=opus\" }),\n isClip: false,\n isThumbnail: false,\n platform: 1,\n }, channelId, false, 0);\n\n upload.on(\"complete\", () => {\n RestAPI.post({\n url: `/channels/${channelId}/messages`,\n body: {\n flags: 1 << 13,\n channel_id: channelId,\n content: \"\",\n nonce: SnowflakeUtils.fromTimestamp(Date.now()),\n sticker_ids: [],\n type: 0,\n attachments: [{\n id: \"0\",\n filename: upload.filename,\n uploaded_filename: upload.uploadedFilename,\n waveform: meta.waveform,\n duration_secs: meta.duration,\n }],\n message_reference: reply ? MessageCreator.getSendMessageOptionsForReply(reply)?.messageReference : null,\n }\n });\n });\n upload.on(\"error\", () => showToast(\"Failed to upload voice message\", Toasts.Type.FAILURE));\n\n upload.upload();\n}\n\nfunction useObjectUrl() {\n const [url, setUrl] = useState();\n const setWithFree = (blob: Blob) => {\n if (url)\n URL.revokeObjectURL(url);\n setUrl(URL.createObjectURL(blob));\n };\n\n return [url, setWithFree] as const;\n}\n\nfunction Modal({ modalProps }: { modalProps: ModalProps; }) {\n const [isRecording, setRecording] = useState(false);\n const [blob, setBlob] = useState();\n const [blobUrl, setBlobUrl] = useObjectUrl();\n\n useEffect(() => () => {\n if (blobUrl)\n URL.revokeObjectURL(blobUrl);\n }, [blobUrl]);\n\n const [meta] = useAwaiter(async () => {\n if (!blob) return EMPTY_META;\n\n const audioContext = new AudioContext();\n const audioBuffer = await audioContext.decodeAudioData(await blob.arrayBuffer());\n const channelData = audioBuffer.getChannelData(0);\n\n // average the samples into much lower resolution bins, maximum of 256 total bins\n const bins = new Uint8Array(lodash.clamp(Math.floor(audioBuffer.duration * 10), Math.min(32, channelData.length), 256));\n const samplesPerBin = Math.floor(channelData.length / bins.length);\n\n // Get root mean square of each bin\n for (let binIdx = 0; binIdx < bins.length; binIdx++) {\n let squares = 0;\n for (let sampleOffset = 0; sampleOffset < samplesPerBin; sampleOffset++) {\n const sampleIdx = binIdx * samplesPerBin + sampleOffset;\n squares += channelData[sampleIdx] ** 2;\n }\n bins[binIdx] = ~~(Math.sqrt(squares / samplesPerBin) * 0xFF);\n }\n\n // Normalize bins with easing\n const maxBin = Math.max(...bins);\n const ratio = 1 + (0xFF / maxBin - 1) * Math.min(1, 100 * (maxBin / 0xFF) ** 3);\n for (let i = 0; i < bins.length; i++) bins[i] = Math.min(0xFF, ~~(bins[i] * ratio));\n\n return {\n waveform: window.btoa(String.fromCharCode(...bins)),\n duration: audioBuffer.duration,\n };\n }, {\n deps: [blob],\n fallbackValue: EMPTY_META,\n });\n\n return (\n \n \n Record Voice Message\n \n\n \n
\n {\n setBlob(blob);\n setBlobUrl(blob);\n }}\n onRecordingChange={setRecording}\n />\n\n {\n const file = await chooseFile(\"audio/*\");\n if (file) {\n setBlob(file);\n setBlobUrl(file);\n }\n }}\n >\n Upload File\n \n
\n\n Preview\n \n\n
\n\n \n {\n sendAudio(blob!, meta);\n modalProps.onClose();\n showToast(\"Now sending voice message... Please be patient\", Toasts.Type.MESSAGE);\n }}\n >\n Send\n \n \n
\n );\n}\n\nconst ctxMenuPatch: NavContextMenuPatchCallback = (children, props) => () => {\n if (props.channel.guild_id && !(PermissionStore.can(PermissionsBits.SEND_VOICE_MESSAGES, props.channel) && PermissionStore.can(PermissionsBits.SEND_MESSAGES, props.channel))) return;\n\n children.push(\n \n \n
Send voice message
\n
\n }\n action={() => openModal(modalProps => )}\n />\n );\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { saveFile } from \"@utils/web\";\nimport { findByProps } from \"@webpack\";\nimport { Clipboard, ComponentDispatch } from \"@webpack/common\";\n\nasync function fetchImage(url: string) {\n const res = await fetch(url);\n if (res.status !== 200) return;\n\n return await res.blob();\n}\n\n\nconst settings = definePluginSettings({\n // This needs to be all in one setting because to enable any of these, we need to make Discord use their desktop context\n // menu handler instead of the web one, which breaks the other menus that aren't enabled\n addBack: {\n type: OptionType.BOOLEAN,\n description: \"Add back the Discord context menus for images, links and the chat input bar\",\n // Web slate menu has proper spellcheck suggestions and image context menu is also pretty good,\n // so disable this by default. Vesktop just doesn't, so enable by default\n default: IS_VESKTOP,\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"WebContextMenus\",\n description: \"Re-adds context menus missing in the web version of Discord: Links & Images (Copy/Open Link/Image), Text Area (Copy, Cut, Paste, SpellCheck)\",\n authors: [Devs.Ven],\n enabledByDefault: true,\n required: IS_VESKTOP,\n\n settings,\n\n start() {\n if (settings.store.addBack) {\n const ctxMenuCallbacks = findByProps(\"contextMenuCallbackNative\");\n window.removeEventListener(\"contextmenu\", ctxMenuCallbacks.contextMenuCallbackWeb);\n window.addEventListener(\"contextmenu\", ctxMenuCallbacks.contextMenuCallbackNative);\n this.changedListeners = true;\n }\n },\n\n stop() {\n if (this.changedListeners) {\n const ctxMenuCallbacks = findByProps(\"contextMenuCallbackNative\");\n window.removeEventListener(\"contextmenu\", ctxMenuCallbacks.contextMenuCallbackNative);\n window.addEventListener(\"contextmenu\", ctxMenuCallbacks.contextMenuCallbackWeb);\n }\n },\n\n patches: [\n // Add back Copy & Open Link\n {\n // There is literally no reason for Discord to make this Desktop only.\n // The only thing broken is copy, but they already have a different copy function\n // with web support????\n find: \"open-native-link\",\n replacement: [\n {\n // if (IS_DESKTOP || null == ...)\n match: /if\\(!\\i\\.\\i\\|\\|null==/,\n replace: \"if(null==\"\n },\n // Fix silly Discord calling the non web support copy\n {\n match: /\\i\\.\\i\\.copy/,\n replace: \"Vencord.Webpack.Common.Clipboard.copy\"\n }\n ]\n },\n\n // Add back Copy & Save Image\n {\n find: 'id:\"copy-image\"',\n replacement: [\n {\n // if (!IS_WEB || null ==\n match: /!\\i\\.isPlatformEmbedded/,\n replace: \"false\"\n },\n {\n match: /return\\s*?\\[\\i\\.\\i\\.canCopyImage\\(\\)/,\n replace: \"return [true\"\n },\n {\n match: /(?<=COPY_IMAGE_MENU_ITEM,)action:/,\n replace: \"action:()=>$self.copyImage(arguments[0]),oldAction:\"\n },\n {\n match: /(?<=SAVE_IMAGE_MENU_ITEM,)action:/,\n replace: \"action:()=>$self.saveImage(arguments[0]),oldAction:\"\n },\n ]\n },\n\n // Add back image context menu\n {\n find: 'navId:\"image-context\"',\n predicate: () => settings.store.addBack,\n replacement: {\n // return IS_DESKTOP ? React.createElement(Menu, ...)\n match: /return \\i\\.\\i\\?/,\n replace: \"return true?\"\n }\n },\n\n // Add back link context menu\n {\n find: '\"interactionUsernameProfile\"',\n predicate: () => settings.store.addBack,\n replacement: {\n match: /if\\((?=\"A\"===\\i\\.tagName&&\"\"!==\\i\\.textContent)/,\n replace: \"if(false&&\"\n }\n },\n\n // Add back slate / text input context menu\n {\n find: 'getElementById(\"slate-toolbar\"',\n predicate: () => settings.store.addBack,\n replacement: {\n match: /(?<=handleContextMenu\\(\\i\\)\\{.{0,200}isPlatformEmbedded)\\?/,\n replace: \"||true?\"\n }\n },\n {\n find: \".SLASH_COMMAND_SUGGESTIONS_TOGGLED,{\",\n predicate: () => settings.store.addBack,\n replacement: [\n {\n // if (!IS_DESKTOP) return null;\n match: /if\\(!\\i\\.\\i\\)return null;/,\n replace: \"\"\n },\n {\n // Change calls to DiscordNative.clipboard to us instead\n match: /\\b\\i\\.\\i\\.(copy|cut|paste)/g,\n replace: \"$self.$1\"\n }\n ]\n },\n {\n find: '\"add-to-dictionary\"',\n predicate: () => settings.store.addBack,\n replacement: {\n match: /let\\{text:\\i=\"\"/,\n replace: \"return [null,null];$&\"\n }\n }\n ],\n\n async copyImage(url: string) {\n // Clipboard only supports image/png, jpeg and similar won't work. Thus, we need to convert it to png\n // via canvas first\n const img = new Image();\n img.onload = () => {\n const canvas = document.createElement(\"canvas\");\n canvas.width = img.naturalWidth;\n canvas.height = img.naturalHeight;\n canvas.getContext(\"2d\")!.drawImage(img, 0, 0);\n\n canvas.toBlob(data => {\n navigator.clipboard.write([\n new ClipboardItem({\n \"image/png\": data!\n })\n ]);\n }, \"image/png\");\n };\n img.crossOrigin = \"anonymous\";\n img.src = url;\n },\n\n async saveImage(url: string) {\n const data = await fetchImage(url);\n if (!data) return;\n\n const name = new URL(url).pathname.split(\"/\").pop()!;\n const file = new File([data], name, { type: data.type });\n\n saveFile(file);\n },\n\n copy() {\n const selection = document.getSelection();\n if (!selection) return;\n\n Clipboard.copy(selection.toString());\n },\n\n cut() {\n this.copy();\n ComponentDispatch.dispatch(\"INSERT_TEXT\", { rawText: \"\" });\n },\n\n async paste() {\n const clip = (await navigator.clipboard.read())[0];\n if (!clip) return;\n\n const data = new DataTransfer();\n for (const type of clip.types) {\n if (type === \"image/png\") {\n const file = new File([await clip.getType(type)], \"unknown.png\", { type });\n data.items.add(file);\n } else if (type === \"text/plain\") {\n const blob = await clip.getType(type);\n data.setData(type, await blob.text());\n }\n }\n\n document.dispatchEvent(\n new ClipboardEvent(\"paste\", {\n clipboardData: data\n })\n );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ComponentDispatch, FluxDispatcher, NavigationRouter, SelectedGuildStore, SettingsRouter } from \"@webpack/common\";\n\nconst KeyBinds = findByPropsLazy(\"JUMP_TO_GUILD\", \"SERVER_NEXT\");\n\nexport default definePlugin({\n name: \"WebKeybinds\",\n description: \"Re-adds keybinds missing in the web version of Discord: ctrl+t, ctrl+shift+t, ctrl+tab, ctrl+shift+tab, ctrl+1-9, ctrl+,. Only works fully on Vesktop/ArmCord, not inside your browser\",\n authors: [Devs.Ven],\n enabledByDefault: true,\n\n onKey(e: KeyboardEvent) {\n const hasCtrl = e.ctrlKey || (e.metaKey && navigator.platform.includes(\"Mac\"));\n\n if (hasCtrl) switch (e.key) {\n case \"t\":\n case \"T\":\n e.preventDefault();\n if (e.shiftKey) {\n if (SelectedGuildStore.getGuildId()) NavigationRouter.transitionToGuild(\"@me\");\n ComponentDispatch.safeDispatch(\"TOGGLE_DM_CREATE\");\n } else {\n FluxDispatcher.dispatch({\n type: \"QUICKSWITCHER_SHOW\",\n query: \"\",\n queryMode: null\n });\n }\n break;\n case \",\":\n e.preventDefault();\n SettingsRouter.open(\"My Account\");\n break;\n case \"Tab\":\n const handler = e.shiftKey ? KeyBinds.SERVER_PREV : KeyBinds.SERVER_NEXT;\n handler.action(e);\n break;\n default:\n if (e.key >= \"1\" && e.key <= \"9\") {\n e.preventDefault();\n KeyBinds.JUMP_TO_GUILD.action(e, `mod+${e.key}`);\n }\n break;\n }\n },\n\n start() {\n document.addEventListener(\"keydown\", this.onKey);\n },\n\n stop() {\n document.removeEventListener(\"keydown\", this.onKey);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { sleep } from \"@utils/misc\";\nimport { Queue } from \"@utils/Queue\";\nimport { useForceUpdater } from \"@utils/react\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy, findComponentByCodeLazy } from \"@webpack\";\nimport { ChannelStore, FluxDispatcher, React, RestAPI, Tooltip } from \"@webpack/common\";\nimport { CustomEmoji } from \"@webpack/types\";\nimport { Message, ReactionEmoji, User } from \"discord-types/general\";\n\nconst UserSummaryItem = findComponentByCodeLazy(\"defaultRenderUser\", \"showDefaultAvatarsForNullUsers\");\nconst AvatarStyles = findByPropsLazy(\"moreUsers\", \"emptyUser\", \"avatarContainer\", \"clickableAvatar\");\n\nconst queue = new Queue();\nlet reactions: Record;\n\nfunction fetchReactions(msg: Message, emoji: ReactionEmoji, type: number) {\n const key = emoji.name + (emoji.id ? `:${emoji.id}` : \"\");\n return RestAPI.get({\n url: `/channels/${msg.channel_id}/messages/${msg.id}/reactions/${key}`,\n query: {\n limit: 100,\n type\n },\n oldFormErrors: true\n })\n .then(res => FluxDispatcher.dispatch({\n type: \"MESSAGE_REACTION_ADD_USERS\",\n channelId: msg.channel_id,\n messageId: msg.id,\n users: res.body,\n emoji,\n reactionType: type\n }))\n .catch(console.error)\n .finally(() => sleep(250));\n}\n\nfunction getReactionsWithQueue(msg: Message, e: ReactionEmoji, type: number) {\n const key = `${msg.id}:${e.name}:${e.id ?? \"\"}:${type}`;\n const cache = reactions[key] ??= { fetched: false, users: {} };\n if (!cache.fetched) {\n queue.unshift(() => fetchReactions(msg, e, type));\n cache.fetched = true;\n }\n\n return cache.users;\n}\n\nfunction makeRenderMoreUsers(users: User[]) {\n return function renderMoreUsers(_label: string, _count: number) {\n return (\n u.username).join(\", \")} >\n {({ onMouseEnter, onMouseLeave }) => (\n \n +{users.length - 5}\n \n )}\n \n );\n };\n}\n\nfunction handleClickAvatar(event: React.MouseEvent) {\n event.stopPropagation();\n}\n\nexport default definePlugin({\n name: \"WhoReacted\",\n description: \"Renders the avatars of users who reacted to a message\",\n authors: [Devs.Ven, Devs.KannaDev],\n\n patches: [{\n find: \",reactionRef:\",\n replacement: {\n match: /(\\i)\\?null:\\(0,\\i\\.jsx\\)\\(\\i\\.\\i,{className:\\i\\.reactionCount,.*?}\\),/,\n replace: \"$&$1?null:$self.renderUsers(this.props),\"\n }\n }, {\n find: '.displayName=\"MessageReactionsStore\";',\n replacement: {\n match: /(?<=CONNECTION_OPEN:function\\(\\){)(\\i)={}/,\n replace: \"$&;$self.reactions=$1\"\n }\n }],\n\n renderUsers(props: RootObject) {\n return props.message.reactions.length > 10 ? null : (\n \n \n \n );\n },\n\n _renderUsers({ message, emoji, type }: RootObject) {\n const forceUpdate = useForceUpdater();\n React.useEffect(() => {\n const cb = (e: any) => {\n if (e.messageId === message.id)\n forceUpdate();\n };\n FluxDispatcher.subscribe(\"MESSAGE_REACTION_ADD_USERS\", cb);\n\n return () => FluxDispatcher.unsubscribe(\"MESSAGE_REACTION_ADD_USERS\", cb);\n }, [message.id]);\n\n const reactions = getReactionsWithQueue(message, emoji, type);\n const users = Object.values(reactions).filter(Boolean) as User[];\n\n for (const user of users) {\n FluxDispatcher.dispatch({\n type: \"USER_UPDATE\",\n user\n });\n }\n\n return (\n \n
\n \n
\n \n );\n },\n\n set reactions(value: any) {\n reactions = value;\n }\n});\n\ninterface ReactionCacheEntry {\n fetched: boolean;\n users: Record;\n}\n\ninterface RootObject {\n message: Message;\n readOnly: boolean;\n isLurking: boolean;\n isPendingMember: boolean;\n useChatFontScaling: boolean;\n emoji: CustomEmoji;\n count: number;\n burst_user_ids: any[];\n burst_count: number;\n burst_colors: any[];\n burst_me: boolean;\n me: boolean;\n type: number;\n hideEmoji: boolean;\n remainingBurstCurrency: number;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from \"@api/Commands\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"Wikisearch\",\n description: \"Searches Wikipedia for your requested query. (/wikisearch)\",\n authors: [Devs.Samu],\n dependencies: [\"CommandsAPI\"],\n commands: [\n {\n name: \"wikisearch\",\n description: \"Searches Wikipedia for your request.\",\n inputType: ApplicationCommandInputType.BUILT_IN,\n options: [\n {\n name: \"search\",\n description: \"Word to search for\",\n type: ApplicationCommandOptionType.STRING,\n required: true\n },\n ],\n execute: async (_, ctx) => {\n const word = findOption(_, \"search\", \"\");\n\n if (!word) {\n return sendBotMessage(ctx.channel.id, {\n content: \"No word was defined!\"\n });\n }\n\n const dataSearchParams = new URLSearchParams({\n action: \"query\",\n format: \"json\",\n list: \"search\",\n formatversion: \"2\",\n origin: \"*\",\n srsearch: word\n });\n\n const data = await fetch(\"https://en.wikipedia.org/w/api.php?\" + dataSearchParams).then(response => response.json())\n .catch(err => {\n console.log(err);\n sendBotMessage(ctx.channel.id, { content: \"There was an error. Check the console for more info\" });\n return null;\n });\n\n if (!data) return;\n\n if (!data.query?.search?.length) {\n console.log(data);\n return sendBotMessage(ctx.channel.id, { content: \"No results given\" });\n }\n\n const altData = await fetch(`https://en.wikipedia.org/w/api.php?action=query&format=json&prop=info%7Cdescription%7Cimages%7Cimageinfo%7Cpageimages&list=&meta=&indexpageids=1&pageids=${data.query.search[0].pageid}&formatversion=2&origin=*`)\n .then(res => res.json())\n .then(data => data.query.pages[0])\n .catch(err => {\n console.log(err);\n sendBotMessage(ctx.channel.id, { content: \"There was an error. Check the console for more info\" });\n return null;\n });\n\n if (!altData) return;\n\n const thumbnailData = altData.thumbnail;\n\n const thumbnail = thumbnailData && {\n url: thumbnailData.source.replace(/(50px-)/ig, \"1000px-\"),\n height: thumbnailData.height * 100,\n width: thumbnailData.width * 100\n };\n\n sendBotMessage(ctx.channel.id, {\n embeds: [\n {\n type: \"rich\",\n title: data.query.search[0].title,\n url: `https://wikipedia.org/w/index.php?curid=${data.query.search[0].pageid}`,\n color: \"0x8663BE\",\n description: data.query.search[0].snippet.replace(/( |<([^>]+)>)/ig, \"\").replace(/(")/ig, \"\\\"\") + \"...\",\n image: thumbnail,\n footer: {\n text: \"Powered by the Wikimedia API\",\n },\n }\n ] as any\n });\n }\n }\n ]\n});\n", "import p0 from \"./plugins/_api/badges\";\nimport p1 from \"./plugins/_api/commands\";\nimport p2 from \"./plugins/_api/contextMenu\";\nimport p3 from \"./plugins/_api/memberListDecorators\";\nimport p4 from \"./plugins/_api/messageAccessories\";\nimport p5 from \"./plugins/_api/messageDecorations\";\nimport p6 from \"./plugins/_api/messageEvents\";\nimport p7 from \"./plugins/_api/messagePopover\";\nimport p8 from \"./plugins/_api/notices\";\nimport p9 from \"./plugins/_api/serverList\";\nimport p10 from \"./plugins/_core/noTrack\";\nimport p11 from \"./plugins/_core/settings\";\nimport p12 from \"./plugins/_core/supportHelper\";\nimport p13 from \"./plugins/alwaysAnimate\";\nimport p14 from \"./plugins/alwaysTrust\";\nimport p15 from \"./plugins/anonymiseFileNames\";\nimport p16 from \"./plugins/arRPC.web\";\nimport p17 from \"./plugins/banger\";\nimport p18 from \"./plugins/betterFolders\";\nimport p19 from \"./plugins/betterGifAltText\";\nimport p20 from \"./plugins/betterNotes\";\nimport p21 from \"./plugins/betterRoleDot\";\nimport p22 from \"./plugins/betterUploadButton\";\nimport p23 from \"./plugins/biggerStreamPreview\";\nimport p24 from \"./plugins/blurNsfw\";\nimport p25 from \"./plugins/callTimer\";\nimport p26 from \"./plugins/clearURLs\";\nimport p27 from \"./plugins/clientTheme\";\nimport p28 from \"./plugins/colorSighted\";\nimport p29 from \"./plugins/consoleShortcuts\";\nimport p30 from \"./plugins/copyUserURLs\";\nimport p31 from \"./plugins/crashHandler\";\nimport p32 from \"./plugins/customRPC\";\nimport p33 from \"./plugins/dearrow\";\nimport p34 from \"./plugins/disableDMCallIdle\";\nimport p35 from \"./plugins/emoteCloner\";\nimport p36 from \"./plugins/experiments\";\nimport p37 from \"./plugins/f8break\";\nimport p38 from \"./plugins/fakeNitro\";\nimport p39 from \"./plugins/fakeProfileThemes\";\nimport p40 from \"./plugins/favEmojiFirst\";\nimport p41 from \"./plugins/favGifSearch\";\nimport p42 from \"./plugins/fixSpotifyEmbeds.desktop\";\nimport p43 from \"./plugins/forceOwnerCrown\";\nimport p44 from \"./plugins/friendInvites\";\nimport p45 from \"./plugins/gameActivityToggle\";\nimport p46 from \"./plugins/gifPaste\";\nimport p47 from \"./plugins/greetStickerPicker\";\nimport p48 from \"./plugins/hideAttachments\";\nimport p49 from \"./plugins/iLoveSpam\";\nimport p50 from \"./plugins/ignoreActivities\";\nimport p51 from \"./plugins/imageZoom\";\nimport p52 from \"./plugins/invisibleChat.desktop\";\nimport p53 from \"./plugins/keepCurrentChannel\";\nimport p54 from \"./plugins/lastfm\";\nimport p55 from \"./plugins/loadingQuotes\";\nimport p56 from \"./plugins/memberCount\";\nimport p57 from \"./plugins/messageClickActions\";\nimport p58 from \"./plugins/messageLinkEmbeds\";\nimport p59 from \"./plugins/messageLogger\";\nimport p60 from \"./plugins/messageTags\";\nimport p61 from \"./plugins/moreCommands\";\nimport p62 from \"./plugins/moreKaomoji\";\nimport p63 from \"./plugins/moreUserTags\";\nimport p64 from \"./plugins/moyai\";\nimport p65 from \"./plugins/muteNewGuild\";\nimport p66 from \"./plugins/mutualGroupDMs\";\nimport p67 from \"./plugins/noBlockedMessages\";\nimport p68 from \"./plugins/noDevtoolsWarning\";\nimport p69 from \"./plugins/noF1\";\nimport p70 from \"./plugins/noMosaic\";\nimport p71 from \"./plugins/noPendingCount\";\nimport p72 from \"./plugins/noProfileThemes\";\nimport p73 from \"./plugins/noReplyMention\";\nimport p74 from \"./plugins/noScreensharePreview\";\nimport p75 from \"./plugins/noTypingAnimation\";\nimport p76 from \"./plugins/noUnblockToJump\";\nimport p77 from \"./plugins/normalizeMessageLinks\";\nimport p78 from \"./plugins/nsfwGateBypass\";\nimport p79 from \"./plugins/onePingPerDM\";\nimport p80 from \"./plugins/oneko\";\nimport p81 from \"./plugins/openInApp\";\nimport p82 from \"./plugins/partyMode\";\nimport p83 from \"./plugins/permissionFreeWill\";\nimport p84 from \"./plugins/permissionsViewer\";\nimport p85 from \"./plugins/petpet\";\nimport p86 from \"./plugins/pictureInPicture\";\nimport p87 from \"./plugins/pinDms\";\nimport p88 from \"./plugins/plainFolderIcon\";\nimport p89 from \"./plugins/platformIndicators\";\nimport p90 from \"./plugins/previewMessage\";\nimport p91 from \"./plugins/pronoundb\";\nimport p92 from \"./plugins/quickMention\";\nimport p93 from \"./plugins/quickReply\";\nimport p94 from \"./plugins/reactErrorDecoder\";\nimport p95 from \"./plugins/readAllNotificationsButton\";\nimport p96 from \"./plugins/relationshipNotifier\";\nimport p97 from \"./plugins/revealAllSpoilers\";\nimport p98 from \"./plugins/reverseImageSearch\";\nimport p99 from \"./plugins/roleColorEverywhere\";\nimport p100 from \"./plugins/searchReply\";\nimport p101 from \"./plugins/secretRingTone\";\nimport p102 from \"./plugins/sendTimestamps\";\nimport p103 from \"./plugins/serverListIndicators\";\nimport p104 from \"./plugins/serverProfile\";\nimport p105 from \"./plugins/shikiCodeblocks.desktop\";\nimport p106 from \"./plugins/showAllMessageButtons\";\nimport p107 from \"./plugins/showConnections\";\nimport p108 from \"./plugins/showHiddenChannels\";\nimport p109 from \"./plugins/showMeYourName\";\nimport p110 from \"./plugins/showTimeouts\";\nimport p111 from \"./plugins/silentMessageToggle\";\nimport p112 from \"./plugins/silentTyping\";\nimport p113 from \"./plugins/sortFriendRequests\";\nimport p114 from \"./plugins/spotifyControls\";\nimport p115 from \"./plugins/spotifyCrack\";\nimport p116 from \"./plugins/spotifyShareCommands\";\nimport p117 from \"./plugins/startupTimings\";\nimport p118 from \"./plugins/superReactionTweaks\";\nimport p119 from \"./plugins/textReplace\";\nimport p120 from \"./plugins/themeAttributes\";\nimport p121 from \"./plugins/timeBarAllActivities\";\nimport p122 from \"./plugins/translate\";\nimport p123 from \"./plugins/typingIndicator\";\nimport p124 from \"./plugins/typingTweaks\";\nimport p125 from \"./plugins/unindent\";\nimport p126 from \"./plugins/unsuppressEmbeds\";\nimport p127 from \"./plugins/urbanDictionary\";\nimport p128 from \"./plugins/userVoiceShow\";\nimport p129 from \"./plugins/usrbg\";\nimport p130 from \"./plugins/validUser\";\nimport p131 from \"./plugins/vcDoubleClick\";\nimport p132 from \"./plugins/vcNarrator\";\nimport p133 from \"./plugins/vencordToolbox\";\nimport p134 from \"./plugins/viewIcons\";\nimport p135 from \"./plugins/viewRaw\";\nimport p136 from \"./plugins/voiceMessages\";\nimport p137 from \"./plugins/webContextMenus.web\";\nimport p138 from \"./plugins/webKeybinds.web\";\nimport p139 from \"./plugins/whoReacted\";\nimport p140 from \"./plugins/wikisearch\";\nexport default {\n[p0.name]:p0,\n[p1.name]:p1,\n[p2.name]:p2,\n[p3.name]:p3,\n[p4.name]:p4,\n[p5.name]:p5,\n[p6.name]:p6,\n[p7.name]:p7,\n[p8.name]:p8,\n[p9.name]:p9,\n[p10.name]:p10,\n[p11.name]:p11,\n[p12.name]:p12,\n[p13.name]:p13,\n[p14.name]:p14,\n[p15.name]:p15,\n[p16.name]:p16,\n[p17.name]:p17,\n[p18.name]:p18,\n[p19.name]:p19,\n[p20.name]:p20,\n[p21.name]:p21,\n[p22.name]:p22,\n[p23.name]:p23,\n[p24.name]:p24,\n[p25.name]:p25,\n[p26.name]:p26,\n[p27.name]:p27,\n[p28.name]:p28,\n[p29.name]:p29,\n[p30.name]:p30,\n[p31.name]:p31,\n[p32.name]:p32,\n[p33.name]:p33,\n[p34.name]:p34,\n[p35.name]:p35,\n[p36.name]:p36,\n[p37.name]:p37,\n[p38.name]:p38,\n[p39.name]:p39,\n[p40.name]:p40,\n[p41.name]:p41,\n[p42.name]:p42,\n[p43.name]:p43,\n[p44.name]:p44,\n[p45.name]:p45,\n[p46.name]:p46,\n[p47.name]:p47,\n[p48.name]:p48,\n[p49.name]:p49,\n[p50.name]:p50,\n[p51.name]:p51,\n[p52.name]:p52,\n[p53.name]:p53,\n[p54.name]:p54,\n[p55.name]:p55,\n[p56.name]:p56,\n[p57.name]:p57,\n[p58.name]:p58,\n[p59.name]:p59,\n[p60.name]:p60,\n[p61.name]:p61,\n[p62.name]:p62,\n[p63.name]:p63,\n[p64.name]:p64,\n[p65.name]:p65,\n[p66.name]:p66,\n[p67.name]:p67,\n[p68.name]:p68,\n[p69.name]:p69,\n[p70.name]:p70,\n[p71.name]:p71,\n[p72.name]:p72,\n[p73.name]:p73,\n[p74.name]:p74,\n[p75.name]:p75,\n[p76.name]:p76,\n[p77.name]:p77,\n[p78.name]:p78,\n[p79.name]:p79,\n[p80.name]:p80,\n[p81.name]:p81,\n[p82.name]:p82,\n[p83.name]:p83,\n[p84.name]:p84,\n[p85.name]:p85,\n[p86.name]:p86,\n[p87.name]:p87,\n[p88.name]:p88,\n[p89.name]:p89,\n[p90.name]:p90,\n[p91.name]:p91,\n[p92.name]:p92,\n[p93.name]:p93,\n[p94.name]:p94,\n[p95.name]:p95,\n[p96.name]:p96,\n[p97.name]:p97,\n[p98.name]:p98,\n[p99.name]:p99,\n[p100.name]:p100,\n[p101.name]:p101,\n[p102.name]:p102,\n[p103.name]:p103,\n[p104.name]:p104,\n[p105.name]:p105,\n[p106.name]:p106,\n[p107.name]:p107,\n[p108.name]:p108,\n[p109.name]:p109,\n[p110.name]:p110,\n[p111.name]:p111,\n[p112.name]:p112,\n[p113.name]:p113,\n[p114.name]:p114,\n[p115.name]:p115,\n[p116.name]:p116,\n[p117.name]:p117,\n[p118.name]:p118,\n[p119.name]:p119,\n[p120.name]:p120,\n[p121.name]:p121,\n[p122.name]:p122,\n[p123.name]:p123,\n[p124.name]:p124,\n[p125.name]:p125,\n[p126.name]:p126,\n[p127.name]:p127,\n[p128.name]:p128,\n[p129.name]:p129,\n[p130.name]:p130,\n[p131.name]:p131,\n[p132.name]:p132,\n[p133.name]:p133,\n[p134.name]:p134,\n[p135.name]:p135,\n[p136.name]:p136,\n[p137.name]:p137,\n[p138.name]:p138,\n[p139.name]:p139,\n[p140.name]:p140,\n};", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { User } from \"discord-types/general\";\nimport { ComponentType, HTMLProps } from \"react\";\n\nimport Plugins from \"~plugins\";\n\nexport const enum BadgePosition {\n START,\n END\n}\n\nexport interface ProfileBadge {\n /** The tooltip to show on hover. Required for image badges */\n description?: string;\n /** Custom component for the badge (tooltip not included) */\n component?: ComponentType;\n /** The custom image to use */\n image?: string;\n link?: string;\n /** Action to perform when you click the badge */\n onClick?(): void;\n /** Should the user display this badge? */\n shouldShow?(userInfo: BadgeUserArgs): boolean;\n /** Optional props (e.g. style) for the badge, ignored for component badges */\n props?: HTMLProps;\n /** Insert at start or end? */\n position?: BadgePosition;\n /** The badge name to display, Discord uses this. Required for component badges */\n key?: string;\n}\n\nconst Badges = new Set();\n\n/**\n * Register a new badge with the Badges API\n * @param badge The badge to register\n */\nexport function addBadge(badge: ProfileBadge) {\n badge.component &&= ErrorBoundary.wrap(badge.component, { noop: true });\n Badges.add(badge);\n}\n\n/**\n * Unregister a badge from the Badges API\n * @param badge The badge to remove\n */\nexport function removeBadge(badge: ProfileBadge) {\n return Badges.delete(badge);\n}\n\n/**\n * Inject badges into the profile badges array.\n * You probably don't need to use this.\n */\nexport function _getBadges(args: BadgeUserArgs) {\n const badges = [] as ProfileBadge[];\n for (const badge of Badges) {\n if (!badge.shouldShow || badge.shouldShow(args)) {\n badge.position === BadgePosition.START\n ? badges.unshift({ ...badge, ...args })\n : badges.push({ ...badge, ...args });\n }\n }\n const donorBadges = (Plugins.BadgeAPI as unknown as typeof import(\"../plugins/_api/badges\").default).getDonorBadges(args.user.id);\n if (donorBadges) badges.unshift(...donorBadges);\n\n return badges;\n}\n\nexport interface BadgeUserArgs {\n user: User;\n profile: Profile;\n premiumSince: Date;\n premiumGuildSince?: Date;\n}\n\ninterface ConnectedAccount {\n type: string;\n id: string;\n name: string;\n verified: boolean;\n}\n\ninterface Profile {\n connectedAccounts: ConnectedAccount[];\n premiumType: number;\n premiumSince: string;\n premiumGuildSince?: any;\n lastFetched: number;\n profileFetchFailed: boolean;\n application?: any;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport * as $Badges from \"./Badges\";\nimport * as $Commands from \"./Commands\";\nimport * as $ContextMenu from \"./ContextMenu\";\nimport * as $DataStore from \"./DataStore\";\nimport * as $MemberListDecorators from \"./MemberListDecorators\";\nimport * as $MessageAccessories from \"./MessageAccessories\";\nimport * as $MessageDecorations from \"./MessageDecorations\";\nimport * as $MessageEventsAPI from \"./MessageEvents\";\nimport * as $MessagePopover from \"./MessagePopover\";\nimport * as $Notices from \"./Notices\";\nimport * as $Notifications from \"./Notifications\";\nimport * as $ServerList from \"./ServerList\";\nimport * as $Settings from \"./Settings\";\nimport * as $Styles from \"./Styles\";\n\n/**\n * An API allowing you to listen to Message Clicks or run your own logic\n * before a message is sent\n *\n * If your plugin uses this, you must add MessageEventsAPI to its dependencies\n */\nexport const MessageEvents = $MessageEventsAPI;\n/**\n * An API allowing you to create custom notices\n * (snackbars on the top, like the Update prompt)\n */\nexport const Notices = $Notices;\n/**\n * An API allowing you to register custom commands\n */\nexport const Commands = $Commands;\n/**\n * A wrapper around IndexedDB. This can store arbitrarily\n * large data and supports a lot of datatypes (Blob, Map, ...).\n * For a full list, see the mdn link below\n *\n * This should always be preferred over the Settings API if possible, as\n * localstorage has very strict size restrictions and blocks the event loop\n *\n * Make sure your keys are unique (tip: prefix them with ur plugin name)\n * and please clean up no longer needed entries.\n *\n * This is actually just idb-keyval, so if you're familiar with that, you're golden!\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#supported_types}\n */\nexport const DataStore = $DataStore;\n/**\n * An API allowing you to add custom components as message accessories\n */\nexport const MessageAccessories = $MessageAccessories;\n/**\n * An API allowing you to add custom buttons in the message popover\n */\nexport const MessagePopover = $MessagePopover;\n/**\n * An API allowing you to add badges to user profiles\n */\nexport const Badges = $Badges;\n/**\n * An API allowing you to add custom elements to the server list\n */\nexport const ServerList = $ServerList;\n/**\n * An API allowing you to add components as message accessories\n */\nexport const MessageDecorations = $MessageDecorations;\n/**\n * An API allowing you to add components to member list users, in both DM's and servers\n */\nexport const MemberListDecorators = $MemberListDecorators;\n/**\n * An API allowing you to persist data\n */\nexport const Settings = $Settings;\n/**\n * An API allowing you to dynamically load styles\n * a\n */\nexport const Styles = $Styles;\n/**\n * An API allowing you to display notifications\n */\nexport const Notifications = $Notifications;\n\n/**\n * An api allowing you to patch and add/remove items to/from context menus\n */\nexport const ContextMenu = $ContextMenu;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { LiteralUnion } from \"type-fest\";\n\n/**\n * Wait for a property to be defined on the target, then call the callback with\n * the value\n * @param target Object\n * @param property Property to be defined\n * @param callback Callback\n *\n * @example onceDefined(window, \"webpackChunkdiscord_app\", wpInstance => wpInstance.push(...));\n */\nexport function onceDefined>(\n target: T, property: P, callback: (v: P extends keyof T ? T[P] : any) => void\n): void {\n const propertyAsAny = property as any;\n\n if (property in target)\n return void callback(target[propertyAsAny]);\n\n Object.defineProperty(target, property, {\n set(v) {\n delete target[propertyAsAny];\n target[propertyAsAny] = v;\n callback(v);\n },\n configurable: true,\n enumerable: false\n });\n}\n", "/*!\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport * from \"./ChangeList\";\nexport * from \"./constants\";\nexport * from \"./debounce\";\nexport * from \"./discord\";\nexport * from \"./guards\";\nexport * from \"./lazy\";\nexport * from \"./localStorage\";\nexport * from \"./Logger\";\nexport * from \"./margins\";\nexport * from \"./misc\";\nexport * from \"./modal\";\nexport * from \"./onceDefined\";\nexport * from \"./onlyOnce\";\nexport * from \"./patches\";\nexport * from \"./Queue\";\nexport * from \"./react\";\nexport * from \"./text\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addSettingsListener, Settings } from \"@api/Settings\";\n\n\nlet style: HTMLStyleElement;\nlet themesStyle: HTMLStyleElement;\n\nfunction createStyle(id: string) {\n const style = document.createElement(\"style\");\n style.id = id;\n document.documentElement.append(style);\n return style;\n}\n\nasync function initSystemValues() {\n const values = await VencordNative.themes.getSystemValues();\n const variables = Object.entries(values)\n .filter(([, v]) => v !== \"#\")\n .map(([k, v]) => `--${k}: ${v};`)\n .join(\"\");\n\n createStyle(\"vencord-os-theme-values\").textContent = `:root{${variables}}`;\n}\n\nexport async function toggle(isEnabled: boolean) {\n if (!style) {\n if (isEnabled) {\n style = createStyle(\"vencord-custom-css\");\n VencordNative.quickCss.addChangeListener(css => {\n style.textContent = css;\n // At the time of writing this, changing textContent resets the disabled state\n style.disabled = !Settings.useQuickCss;\n });\n style.textContent = await VencordNative.quickCss.get();\n }\n } else\n style.disabled = !isEnabled;\n}\n\nasync function initThemes() {\n themesStyle ??= createStyle(\"vencord-themes\");\n\n const { themeLinks, enabledThemes } = Settings;\n\n const links: string[] = [...themeLinks];\n\n if (IS_WEB) {\n for (const theme of enabledThemes) {\n const themeData = await VencordNative.themes.getThemeData(theme);\n if (!themeData) continue;\n const blob = new Blob([themeData], { type: \"text/css\" });\n links.push(URL.createObjectURL(blob));\n }\n } else {\n const localThemes = enabledThemes.map(theme => `vencord:///themes/${theme}?v=${Date.now()}`);\n links.push(...localThemes);\n }\n\n themesStyle.textContent = links.map(link => `@import url(\"${link.trim()}\");`).join(\"\\n\");\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n initSystemValues();\n initThemes();\n\n toggle(Settings.useQuickCss);\n addSettingsListener(\"useQuickCss\", toggle);\n\n addSettingsListener(\"themeLinks\", initThemes);\n addSettingsListener(\"enabledThemes\", initThemes);\n\n if (!IS_WEB)\n VencordNative.quickCss.addThemeChangeListener(initThemes);\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport * as Common from \"./common\";\nexport * from \"./webpack\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { WEBPACK_CHUNK } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport { canonicalizeReplacement } from \"@utils/patches\";\nimport { PatchReplacement } from \"@utils/types\";\n\nimport { traceFunction } from \"../debug/Tracer\";\nimport { _initWebpack } from \".\";\n\nlet webpackChunk: any[];\n\nconst logger = new Logger(\"WebpackInterceptor\", \"#8caaee\");\n\nif (window[WEBPACK_CHUNK]) {\n logger.info(`Patching ${WEBPACK_CHUNK}.push (was already existent, likely from cache!)`);\n _initWebpack(window[WEBPACK_CHUNK]);\n patchPush(window[WEBPACK_CHUNK]);\n} else {\n Object.defineProperty(window, WEBPACK_CHUNK, {\n get: () => webpackChunk,\n set: v => {\n if (v?.push) {\n if (!v.push.$$vencordOriginal) {\n logger.info(`Patching ${WEBPACK_CHUNK}.push`);\n patchPush(v);\n }\n\n if (_initWebpack(v)) {\n logger.info(\"Successfully initialised Vencord webpack\");\n // @ts-ignore\n delete window[WEBPACK_CHUNK];\n window[WEBPACK_CHUNK] = v;\n }\n }\n webpackChunk = v;\n },\n configurable: true\n });\n\n // wreq.m is the webpack module factory.\n // normally, this is populated via webpackGlobal.push, which we patch below.\n // However, Discord has their .m prepopulated.\n // Thus, we use this hack to immediately access their wreq.m and patch all already existing factories\n Object.defineProperty(Function.prototype, \"m\", {\n set(v: any) {\n // When using react devtools or other extensions, we may also catch their webpack here.\n // This ensures we actually got the right one\n if (new Error().stack?.includes(\"discord.com\")) {\n logger.info(\"Found webpack module factory\");\n patchFactories(v);\n\n delete (Function.prototype as any).m;\n }\n\n Object.defineProperty(this, \"m\", {\n value: v,\n configurable: true,\n });\n },\n configurable: true\n });\n}\n\nfunction patchPush(webpackGlobal: any) {\n function handlePush(chunk: any) {\n try {\n patchFactories(chunk[1]);\n } catch (err) {\n logger.error(\"Error in handlePush\", err);\n }\n\n return handlePush.$$vencordOriginal.call(webpackGlobal, chunk);\n }\n\n handlePush.$$vencordOriginal = webpackGlobal.push;\n // Webpack overwrites .push with its own push like so: `d.push = n.bind(null, d.push.bind(d));`\n // it wraps the old push (`d.push.bind(d)`). this old push is in this case our handlePush.\n // If we then repatched the new push, we would end up with recursive patching, which leads to our patches\n // being applied multiple times.\n // Thus, override bind to use the original push\n handlePush.bind = (...args: unknown[]) => handlePush.$$vencordOriginal.bind(...args);\n\n Object.defineProperty(webpackGlobal, \"push\", {\n get: () => handlePush,\n set(v) {\n handlePush.$$vencordOriginal = v;\n },\n configurable: true\n });\n}\n\nfunction patchFactories(factories: Record void>) {\n const { subscriptions, listeners } = Vencord.Webpack;\n const { patches } = Vencord.Plugins;\n\n for (const id in factories) {\n let mod = factories[id];\n // Discords Webpack chunks for some ungodly reason contain random\n // newlines. Cyn recommended this workaround and it seems to work fine,\n // however this could potentially break code, so if anything goes weird,\n // this is probably why.\n // Additionally, `[actual newline]` is one less char than \"\\n\", so if Discord\n // ever targets newer browsers, the minifier could potentially use this trick and\n // cause issues.\n //\n // 0, prefix is to turn it into an expression: 0,function(){} would be invalid syntax without the 0,\n let code: string = \"0,\" + mod.toString().replaceAll(\"\\n\", \"\");\n const originalMod = mod;\n const patchedBy = new Set();\n\n const factory = factories[id] = function (module, exports, require) {\n try {\n mod(module, exports, require);\n } catch (err) {\n // Just rethrow discord errors\n if (mod === originalMod) throw err;\n\n logger.error(\"Error in patched chunk\", err);\n return void originalMod(module, exports, require);\n }\n\n exports = module.exports;\n\n if (!exports) return;\n\n // There are (at the time of writing) 11 modules exporting the window\n // Make these non enumerable to improve webpack search performance\n if (exports === window) {\n Object.defineProperty(require.c, id, {\n value: require.c[id],\n enumerable: false,\n configurable: true,\n writable: true\n });\n return;\n }\n\n const numberId = Number(id);\n\n for (const callback of listeners) {\n try {\n callback(exports, numberId);\n } catch (err) {\n logger.error(\"Error in webpack listener\", err);\n }\n }\n\n for (const [filter, callback] of subscriptions) {\n try {\n if (filter(exports)) {\n subscriptions.delete(filter);\n callback(exports, numberId);\n } else if (exports.default && filter(exports.default)) {\n subscriptions.delete(filter);\n callback(exports.default, numberId);\n }\n } catch (err) {\n logger.error(\"Error while firing callback for webpack chunk\", err);\n }\n }\n } as any as { toString: () => string, original: any, (...args: any[]): void; };\n\n // for some reason throws some error on which calling .toString() leads to infinite recursion\n // when you force load all chunks???\n factory.toString = () => mod.toString();\n factory.original = originalMod;\n\n for (let i = 0; i < patches.length; i++) {\n const patch = patches[i];\n const executePatch = traceFunction(`patch by ${patch.plugin}`, (match: string | RegExp, replace: string) => code.replace(match, replace));\n if (patch.predicate && !patch.predicate()) continue;\n\n if (code.includes(patch.find)) {\n patchedBy.add(patch.plugin);\n\n const previousMod = mod;\n const previousCode = code;\n\n // we change all patch.replacement to array in plugins/index\n for (const replacement of patch.replacement as PatchReplacement[]) {\n if (replacement.predicate && !replacement.predicate()) continue;\n const lastMod = mod;\n const lastCode = code;\n\n canonicalizeReplacement(replacement, patch.plugin);\n\n try {\n const newCode = executePatch(replacement.match, replacement.replace as string);\n if (newCode === code) {\n if (!patch.noWarn) {\n logger.warn(`Patch by ${patch.plugin} had no effect (Module id is ${id}): ${replacement.match}`);\n if (IS_DEV) {\n logger.debug(\"Function Source:\\n\", code);\n }\n }\n\n if (patch.group) {\n logger.warn(`Undoing patch ${patch.find} by ${patch.plugin} because replacement ${replacement.match} had no effect`);\n code = previousCode;\n mod = previousMod;\n patchedBy.delete(patch.plugin);\n break;\n }\n } else {\n code = newCode;\n mod = (0, eval)(`// Webpack Module ${id} - Patched by ${[...patchedBy].join(\", \")}\\n${newCode}\\n//# sourceURL=WebpackModule${id}`);\n }\n } catch (err) {\n logger.error(`Patch by ${patch.plugin} errored (Module id is ${id}): ${replacement.match}\\n`, err);\n\n if (IS_DEV) {\n const changeSize = code.length - lastCode.length;\n const match = lastCode.match(replacement.match)!;\n\n // Use 200 surrounding characters of context\n const start = Math.max(0, match.index! - 200);\n const end = Math.min(lastCode.length, match.index! + match[0].length + 200);\n // (changeSize may be negative)\n const endPatched = end + changeSize;\n\n const context = lastCode.slice(start, end);\n const patchedContext = code.slice(start, endPatched);\n\n // inline require to avoid including it in !IS_DEV builds\n const diff = (require(\"diff\") as typeof import(\"diff\")).diffWordsWithSpace(context, patchedContext);\n let fmt = \"%c %s \";\n const elements = [] as string[];\n for (const d of diff) {\n const color = d.removed\n ? \"red\"\n : d.added\n ? \"lime\"\n : \"grey\";\n fmt += \"%c%s\";\n elements.push(\"color:\" + color, d.value);\n }\n\n logger.errorCustomFmt(...Logger.makeTitle(\"white\", \"Before\"), context);\n logger.errorCustomFmt(...Logger.makeTitle(\"white\", \"After\"), patchedContext);\n const [titleFmt, ...titleElements] = Logger.makeTitle(\"white\", \"Diff\");\n logger.errorCustomFmt(titleFmt + fmt, ...titleElements, ...elements);\n }\n\n patchedBy.delete(patch.plugin);\n if (patch.group) {\n logger.warn(`Undoing patch ${patch.find} by ${patch.plugin} because replacement ${replacement.match} errored`);\n code = previousCode;\n mod = previousMod;\n break;\n }\n\n code = lastCode;\n mod = lastMod;\n }\n }\n\n if (!patch.all) patches.splice(i--, 1);\n }\n }\n }\n}\n", "/*!\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport * as Api from \"./api\";\nexport * as Plugins from \"./plugins\";\nexport * as Util from \"./utils\";\nexport * as QuickCss from \"./utils/quickCss\";\nexport * as Updater from \"./utils/updater\";\nexport * as Webpack from \"./webpack\";\nexport { PlainSettings, Settings };\n\nimport \"./utils/quickCss\";\nimport \"./webpack/patchWebpack\";\n\nimport { StartAt } from \"@utils/types\";\n\nimport { get as dsGet } from \"./api/DataStore\";\nimport { showNotification } from \"./api/Notifications\";\nimport { PlainSettings, Settings } from \"./api/Settings\";\nimport { patches, PMLogger, startAllPlugins } from \"./plugins\";\nimport { localStorage } from \"./utils/localStorage\";\nimport { relaunch } from \"./utils/native\";\nimport { getCloudSettings, putCloudSettings } from \"./utils/settingsSync\";\nimport { checkForUpdates, update, UpdateLogger } from \"./utils/updater\";\nimport { onceReady } from \"./webpack\";\nimport { SettingsRouter } from \"./webpack/common\";\n\nasync function syncSettings() {\n // pre-check for local shared settings\n if (\n Settings.cloud.authenticated &&\n await dsGet(\"Vencord_cloudSecret\") === null // this has been enabled due to local settings share or some other bug\n ) {\n // show a notification letting them know and tell them how to fix it\n showNotification({\n title: \"Cloud Integrations\",\n body: \"We've noticed you have cloud integrations enabled in another client! Due to limitations, you will \" +\n \"need to re-authenticate to continue using them. Click here to go to the settings page to do so!\",\n color: \"var(--yellow-360)\",\n onClick: () => SettingsRouter.open(\"VencordCloud\")\n });\n return;\n }\n\n if (\n Settings.cloud.settingsSync && // if it's enabled\n Settings.cloud.authenticated // if cloud integrations are enabled\n ) {\n if (localStorage.Vencord_settingsDirty) {\n await putCloudSettings();\n delete localStorage.Vencord_settingsDirty;\n } else if (await getCloudSettings(false)) { // if we synchronized something (false means no sync)\n // we show a notification here instead of allowing getCloudSettings() to show one to declutter the amount of\n // potential notifications that might occur. getCloudSettings() will always send a notification regardless if\n // there was an error to notify the user, but besides that we only want to show one notification instead of all\n // of the possible ones it has (such as when your settings are newer).\n showNotification({\n title: \"Cloud Settings\",\n body: \"Your settings have been updated! Click here to restart to fully apply changes!\",\n color: \"var(--green-360)\",\n onClick: relaunch\n });\n }\n }\n}\n\nasync function init() {\n await onceReady;\n startAllPlugins(StartAt.WebpackReady);\n\n syncSettings();\n\n if (!IS_WEB) {\n try {\n const isOutdated = await checkForUpdates();\n if (!isOutdated) return;\n\n if (Settings.autoUpdate) {\n await update();\n if (Settings.autoUpdateNotification)\n setTimeout(() => showNotification({\n title: \"Vencord has been updated!\",\n body: \"Click here to restart\",\n permanent: true,\n noPersist: true,\n onClick: relaunch\n }), 10_000);\n return;\n }\n\n if (Settings.notifyAboutUpdates)\n setTimeout(() => showNotification({\n title: \"A Vencord update is available!\",\n body: \"Click here to view the update\",\n permanent: true,\n noPersist: true,\n onClick() {\n SettingsRouter.open(\"VencordUpdater\");\n }\n }), 10_000);\n } catch (err) {\n UpdateLogger.error(\"Failed to check for updates\", err);\n }\n }\n\n if (IS_DEV) {\n const pendingPatches = patches.filter(p => !p.all && p.predicate?.() !== false);\n if (pendingPatches.length)\n PMLogger.warn(\n \"Webpack has finished initialising, but some patches haven't been applied yet.\",\n \"This might be expected since some Modules are lazy loaded, but please verify\",\n \"that all plugins are working as intended.\",\n \"You are seeing this warning because this is a Development build of Vencord.\",\n \"\\nThe following patches have not been applied:\",\n \"\\n\\n\" + pendingPatches.map(p => `${p.plugin}: ${p.find}`).join(\"\\n\")\n );\n }\n}\n\nstartAllPlugins(StartAt.Init);\ninit();\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n startAllPlugins(StartAt.DOMContentLoaded);\n\n if (IS_DISCORD_DESKTOP && Settings.winNativeTitleBar && navigator.platform.toLowerCase().startsWith(\"win\")) {\n document.head.append(Object.assign(document.createElement(\"style\"), {\n id: \"vencord-native-titlebar-style\",\n textContent: \"[class*=titleBar]{display: none!important}\"\n }));\n }\n}, { once: true });\n\n"], - "mappings": ";;;;67BAAA,IAkBaA,EACFC,EAnBXC,EAAAC,EAAA,kBAkBaH,EAAiC,OAAO,IAAI,g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AI,mBACR,EACA,IAAK,CACD,KAAM,aACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,UACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,SACN,GAAI,mBACR,EACA,UAAW,CACP,KAAM,YACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,SACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,UACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,OACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,SACN,GAAI,mBACR,EACA,UAAW,CACP,KAAM,MACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,OACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,SACN,GAAI,mBACR,EACA,IAAK,CACD,KAAM,MACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,SACN,GAAI,mBACR,EACA,MAAO,CACH,KAAM,QACN,GAAI,mBACR,EACA,QAAS,CACL,KAAM,UACN,GAAI,mBACR,EACA,YAAa,CACT,KAAM,cACN,GAAI,mBACR,EACA,MAAO,CACH,KAAM,QACN,GAAI,mBACR,EACA,QAAS,CACL,KAAM,WACN,GAAI,mBACR,EACA,aAAc,CACV,KAAM,eACN,GAAI,mBACR,EACA,WAAY,CACR,KAAM,aACN,GAAI,mBACR,EACA,QAAS,CACL,KAAM,UACN,GAAI,oBACR,EACA,oBAAqB,CACjB,KAAM,wBACN,GAAI,oBACR,EACA,MAAO,CACH,KAAM,QACN,GAAI,EACR,EACA,MAAO,CACH,KAAM,QACN,GAAI,mBACR,EACA,IAAK,CACD,KAAM,MACN,GAAI,mBACR,EACA,SAAU,CACN,KAAM,WACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,OACN,GAAI,mBACR,EACA,MAAO,CACH,KAAM,QACN,GAAI,mBACR,EACA,MAAO,CACH,KAAM,QACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,SACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,OACN,GAAI,mBACR,EACA,IAAK,CACD,KAAM,WACN,GAAI,mBACR,EACA,SAAU,CACN,KAAM,YACN,GAAI,mBACR,EACA,cAAe,CACX,KAAM,gBACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,iBACN,GAAI,mBACR,EACA,MAAO,CACH,KAAM,MACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,SACN,GAAI,kBACR,EACA,WAAY,CACR,KAAM,cACN,GAAI,mBACR,EACA,GAAI,CACA,KAAM,KACN,GAAI,mBACR,EACA,QAAS,CACL,KAAM,UACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,OACN,GAAI,oBACJ,MAAO,EACX,EACA,QAAS,CACL,KAAM,UACN,GAAI,mBACR,EACA,WAAY,CACR,KAAM,aACN,GAAI,kBACR,EACA,OAAQ,CACJ,KAAM,SACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,SACN,GAAI,mBACR,EACA,WAAY,CACR,KAAM,aACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,SACN,GAAI,mBACR,EACA,YAAa,CACT,KAAM,cACN,GAAI,mBACR,EACA,UAAW,CACP,KAAM,YACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,UACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,gBACN,GAAI,mBACR,EACA,MAAO,CACH,KAAM,QACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,SACN,GAAI,oBACR,EACA,QAAS,CACL,KAAM,UACN,GAAI,oBACR,EACA,IAAK,CACD,KAAM,MACN,GAAI,mBACR,EACA,SAAU,CACN,KAAM,WACN,GAAI,mBACR,EACA,MAAO,CACH,KAAM,QACN,GAAI,mBACR,EACA,MAAO,CACH,KAAM,kBACN,GAAI,mBACR,EACA,WAAY,CACR,KAAM,aACN,GAAI,mBACR,EACA,UAAW,CACP,KAAM,YACN,GAAI,mBACR,EACA,YAAa,CACT,KAAM,QACN,GAAI,mBACR,EACA,SAAU,CACN,KAAM,QACN,GAAI,mBACR,EACA,QAAS,CACL,KA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CAxJA,IAwBMI,GAsDAH,GACAK,GAoDAK,GAnINC,GAAAC,EAAA,kBAAAC,IAkBAC,KACAC,IAKMZ,GAAsB,IAAIa,GAAO,gBAAiB,SAAS,EAsD3DhB,GAAgB,IAAI,IACpBK,GAAgB,IAAI,IAoDpBK,GAAY,IAAI,MCnItB,IAkBaO,GAlBbC,GAAAC,EAAA,kBAAAC,IAkBaH,GAAe,CACxB,oBACA,kBACA,iBACA,uBACA,uBACA,eACA,gBACA,4BACA,2BACA,QACA,aACA,mBACA,qBACA,eACA,eACA,gBACA,mBACA,cACA,gBACA,oBACA,mBACA,cACA,cACA,gBACA,eACA,wBACA,gBACA,gBACA,cACA,cACA,cACA,cACA,cACA,SACA,UACA,MACA,cACA,OACA,QACA,SACA,eACA,aACA,aACA,aACA,UACA,WACA,cACA,QACA,QACA,aACA,WACA,YACA,UACA,cACA,aACA,SACA,SACA,SACA,OACA,cACA,aACA,aACA,YACA,aACA,SACA,aACA,mBACA,YACA,UACA,QACA,YACA,OACA,QACA,MACA,OACA,cACA,WACA,cACA,gBACA,kBACA,SACA,YACA,SACA,sBACA,mBACA,OACA,kBACA,eACA,cACA,eACA,kBACA,kBACA,kBACA,iBACA,SACA,QACA,SACA,SACA,gBACA,yBACA,2BACA,kBACA,kBACA,sBACA,YACA,aACA,cACA,oBACA,sBACA,iBACA,iBACA,iBACA,cACA,SACA,aACA,cACA,aACA,eACA,WACA,sBACA,SACA,qBACJ,IC7IA,IA+BMI,GACAC,GAECC,GAlCPC,GAAAC,EAAA,kBAAAC,IAkBAC,KAOAC,IACAC,IAEAC,KAGMT,GAAe,sBACfC,GAAkB,OAAOD,GAAa,MAAM,EAE3CE,GAAQQ,EAAa,CACxB,KAAM,YACN,YAAa,qCACb,QAAS,CAACC,EAAK,KAAK,EACpB,aAAc,CAAC,kBAAkB,EAEjC,aAAaC,EAAa,CACtB,OAAQA,GAAOX,GAAgB,KAAKW,CAAG,EACjCA,EAAI,QAAQZ,GAAc,MAAM,EAC/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A,YAAa,8BACb,SAAUL,GACV,QAAUK,GACDA,EACDA,EAAM,OAAS,IAAY,2DACxB,GAFY,+BAI3B,EACA,QAAS,CACL,OACA,YAAa,mBACb,SAAUL,GACV,QAAUK,GACFA,GAASA,EAAM,OAAS,IAAY,2DACjC,EAEf,EACA,MAAO,CACH,OACA,YAAa,iBACb,SAAUL,GACV,QAAUK,GACFA,GAASA,EAAM,OAAS,IAAY,yDACjC,EAEf,EACA,KAAM,CACF,OACA,YAAa,gBACb,SAAUL,GACV,QAAS,CACL,CACI,MAAO,UACP,MAAO,EACP,QAAS,EACb,EACA,CACI,MAAO,YACP,MAAO,CACX,EACA,CACI,MAAO,YACP,MAAO,CACX,EACA,CACI,MAAO,WACP,MAAO,CACX,EACA,CACI,MAAO,YACP,MAAO,CACX,CACJ,CACJ,EACA,WAAY,CACR,OACA,YAAa,mEACb,SAAUA,GACV,SAAUG,GACV,QAASC,EACb,EACA,cAAe,CACX,OACA,YAAa,iBACb,SAAUJ,GACV,QAAS,CACL,CACI,MAAO,OACP,MAAO,EACP,QAAS,EACb,EACA,CACI,MAAO,qBACP,MAAO,CACX,EACA,CACI,MAAO,4BACP,MAAO,CACX,EACA,CACI,MAAO,SACP,MAAO,CACX,CACJ,CACJ,EACA,UAAW,CACP,OACA,YAAa,mDACb,SAAUA,GACV,SAAUM,GACV,QAAUD,GACFA,GAASA,EAAQ,EAAU,0CACxB,EAEf,EACA,QAAS,CACL,OACA,YAAa,iDACb,SAAUL,GACV,SAAUM,GACV,QAAUD,GACFA,GAASA,EAAQ,EAAU,wCACxB,EAEf,EACA,SAAU,CACN,OACA,YAAa,qBACb,SAAUL,GACV,QAASO,EACb,EACA,gBAAiB,CACb,OACA,YAAa,oBACb,SAAUP,GACV,QAAUK,GACFA,GAASA,EAAM,OAAS,IAAY,4DACjC,EAEf,EACA,WAAY,CACR,OACA,YAAa,uBACb,SAAUL,GACV,QAASO,EACb,EACA,kBAAmB,CACf,OACA,YAAa,sBACb,SAAUP,GAC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Y,CACR,OACA,YAAa,oCACb,QAAS,KACT,OAAQ,EACZ,EACA,cAAe,CACX,OACA,YAAa,2HACb,QAAS,EACb,CACJ,CAAC,ICnDD,IAmCaC,GAnCbC,GAAAC,EAAA,kBAAAC,IAmCaH,GAAY,CACrB,KAAQ,kBACR,GAAM,YACN,GAAM,WACN,GAAM,UACN,GAAM,SACN,GAAM,WACN,GAAM,WACN,GAAM,SACN,GAAM,cACN,GAAM,UACN,GAAM,SACN,GAAM,aACN,GAAM,UACN,IAAO,WACP,GAAM,UACN,GAAM,YACN,GAAM,UACN,IAAO,UACP,GAAM,WACN,QAAS,uBACT,QAAS,wBACT,GAAM,WACN,GAAM,WACN,GAAM,QACN,GAAM,SACN,GAAM,UACN,IAAO,QACP,GAAM,QACN,GAAM,UACN,GAAM,YACN,GAAM,WACN,GAAM,MACN,GAAM,WACN,GAAM,UACN,GAAM,SACN,GAAM,UACN,GAAM,WACN,GAAM,WACN,GAAM,SACN,GAAM,QACN,GAAM,UACN,GAAM,WACN,GAAM,iBACN,GAAM,QACN,IAAO,WACP,GAAM,SACN,GAAM,QACN,IAAO,QACP,GAAM,YACN,GAAM,YACN,GAAM,OACN,IAAO,UACP,GAAM,aACN,GAAM,QACN,GAAM,UACN,GAAM,WACN,GAAM,WACN,GAAM,UACN,GAAM,SACN,GAAM,QACN,GAAM,cACN,IAAO,UACP,GAAM,SACN,IAAO,OACP,GAAM,qBACN,IAAO,mBACP,GAAM,SACN,GAAM,MACN,GAAM,QACN,GAAM,UACN,GAAM,UACN,GAAM,aACN,GAAM,UACN,GAAM,gBACN,GAAM,aACN,IAAO,WACP,GAAM,WACN,GAAM,QACN,GAAM,YACN,GAAM,UACN,GAAM,QACN,GAAM,UACN,WAAY,uBACZ,IAAO,OACP,GAAM,YACN,GAAM,oBACN,GAAM,SACN,GAAM,YACN,GAAM,eACN,GAAM,QACN,GAAM,SACN,GAAM,UACN,GAAM,SACN,GAAM,aACN,GAAM,UACN,GAAM,UACN,GAAM,WACN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,CAAC,CACL,CACJ,CACJ,CACJ,CAAC,IC7GD,IA6IOC,GA7IPC,GAAAC,EAAA,KAAAC,IAAAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACOhJ,GAAQ,CACf,CAACiJ,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MA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AMC,GAAiB,EACvB,OAAOD,GAAa,uBACb,MAAME,GAAiB,EAAK,GAKnCJ,GAAiB,CACb,MAAO,iBACP,KAAM,iFACN,MAAO,mBACP,QAASK,EACb,CAAC,EAGb,CAEA,eAAeC,IAAO,CAClB,MAAMC,GACNC,iBAAoC,EAEpCV,GAAa,EAGT,GAAI,CAEA,GAAI,CADe,MAAMW,GAAgB,EACxB,OAEjB,GAAIf,EAAS,WAAY,CACrB,MAAMgB,GAAO,EACThB,EAAS,wBACT,WAAW,IAAMM,GAAiB,CAC9B,MAAO,4BACP,KAAM,wBACN,UAAW,GACX,UAAW,GACX,QAASK,EACb,CAAC,EAAG,GAAM,EACd,MACJ,CAEIX,EAAS,oBACT,WAAW,IAAMM,GAAiB,CAC9B,MAAO,iCACP,KAAM,gCACN,UAAW,GACX,UAAW,GACX,SAAU,CACNC,GAAe,KAAK,gBAAgB,CACxC,CACJ,CAAC,EAAG,GAAM,CAClB,OAASU,EAAP,CACEC,GAAa,MAAM,8BAA+BD,CAAG,CACzD,CAeR,CApIA,IAAAE,GAAAC,EAAA,KAAAC,IAkBAC,KACAC,KACAC,KACAC,KACAC,KACAC,KAGAF,KACAG,KAEAC,IAEAC,KACAC,KACAC,IACAT,KACAU,KACAC,KACAC,KACAT,KACAC,KACAS,IA8FAtB,SAA4B,EAC5BF,GAAK,EAEL,SAAS,iBAAiB,mBAAoB,IAAM,CAChDE,qBAAwC,CAQ5C,EAAG,CAAE,KAAM,EAAK,CAAC", - "names": ["VencordFragment", "VencordCreateElement", "init_react", "__esmMin", "args", "Logger", "init_Logger", "__esmMin", "init_react", "name", "color", "title", "level", "levelColor", "args", "customFmt", "fmt", "styleStr", "Margins", "init_margins", "__esmMin", "init_react", "dir", "size", "cl", "makeLazy", "factory", "attempts", "tries", "cache", "proxyLazy", "isChild", "isSameTick", "proxyDummy", "kCACHE", "kGET", "handler", "target", "p", "receiver", "unconfigurable", "init_lazy", "__esmMin", "init_react", "method", "args", "v", "keys", "key", "descriptor", "LazyComponent", "factory", "attempts", "get", "makeLazy", "props", "Component", "NoopComponent", "VencordCreateElement", "init_lazyReact", "__esmMin", "init_react", "init_lazy", "noopTracer", "traceFunction", "init_Tracer", "__esmMin", "init_react", "init_Logger", "name", "f", "mapper", "_initWebpack", "instance", "cache", "r", "wreq", "handleModuleNotFound", "method", "filter", "err", "logger", "findLazy", "proxyLazy", "find", "findAll", "ret", "key", "mod", "findByProps", "props", "res", "filters", "findByPropsLazy", "findByCode", "code", "findByCodeLazy", "findStore", "name", "findStoreLazy", "findComponentByCode", "findComponentLazy", "LazyComponent", "findComponentByCodeLazy", "findExportedComponentLazy", "waitFor", "callback", "existing", "id", "subscriptions", "addListener", "listeners", "removeListener", "search", "results", "factories", "outer", "factory", "str", "extract", "_resolveReady", "onceReady", "findBulk", "findModuleId", "init_webpack", "__esmMin", "init_react", "init_lazy", "init_lazyReact", "init_Logger", "init_Tracer", "Logger", "m", "p", "s", "c", "traceFunction", "isIndirect", "isWaitFor", "found", "filterFns", "length", "j", "ModalImageClasses", "ButtonWrapperClasses", "init_classes", "__esmMin", "init_react", "init_webpack", "findLazy", "m", "findByPropsLazy", "waitForComponent", "name", "filter", "myValue", "lazyComponent", "LazyComponent", "waitFor", "v", "waitForStore", "cb", "filters", "init_internal", "__esmMin", "init_react", "init_webpack", "Forms", "Card", "Button", "Switch", "Tooltip", "TextInput", "TextArea", "Text", "Select", "SearchableSelect", "Slider", "ButtonLooks", "Popout", "Dialog", "TabBar", "Paginator", "ScrollerThin", "Clickable", "Avatar", "useToken", "MaskedLink", "Timestamp", "Flex", "init_components", "__esmMin", "init_react", "init_webpack", "init_internal", "waitForComponent", "m", "filters", "waitFor", "Menu", "ContextMenuApi", "init_menu", "__esmMin", "init_react", "init_webpack", "waitFor", "m", "findByPropsLazy", "React", "useState", "useEffect", "useMemo", "useRef", "useReducer", "useCallback", "ReactDOM", "init_react", "__esmMin", "init_webpack", "findByPropsLazy", "waitFor", "m", "TextAndImagesSettingsStores", "StatusSettingsStores", "UserSettingsActionCreators", "init_settingsStores", "__esmMin", "init_react", "init_webpack", "findByPropsLazy", "Flux", "DraftType", "MessageStore", "PrivateChannelsStore", "PermissionStore", "GuildChannelStore", "ReadStateStore", "PresenceStore", "PoggerModeSettingsStore", "GuildStore", "UserStore", "UserProfileStore", "SelectedChannelStore", "SelectedGuildStore", "ChannelStore", "GuildMemberStore", "RelationshipStore", "EmojiStore", "WindowStore", "DraftStore", "useStateFromStores", "init_stores", "__esmMin", "init_react", "init_webpack", "init_internal", "findByPropsLazy", "waitForStore", "s", "m", "components_d_exports", "init_components_d", "__esmMin", "init_react", "menu_d_exports", "init_menu_d", "__esmMin", "init_react", "utils_d_exports", "init_utils_d", "__esmMin", "init_react", "showToast", "message", "type", "ToastType", "Toasts", "FluxDispatcher", "ComponentDispatch", "RestAPI", "moment", "hljs", "lodash", "i18n", "SnowflakeUtils", "Parser", "Alerts", "ToastPosition", "UserUtils", "UploadHandler", "ApplicationAssetUtils", "Clipboard", "NavigationRouter", "SettingsRouter", "PermissionsBits", "init_utils", "__esmMin", "init_react", "init_lazy", "init_webpack", "waitFor", "m", "findByPropsLazy", "findLazy", "cb", "_resolveReady", "proxyLazy", "find", "common_exports", "__export", "Alerts", "ApplicationAssetUtils", "Avatar", "Button", "ButtonLooks", "ButtonWrapperClasses", "Card", "ChannelStore", "Clickable", "Clipboard", "ComponentDispatch", "components_d_exports", "ContextMenuApi", "Dialog", "DraftStore", "DraftType", "EmojiStore", "Flex", "Flux", "FluxDispatcher", "Forms", "GuildChannelStore", "GuildMemberStore", "GuildStore", "MaskedLink", "Menu", "menu_d_exports", "MessageStore", "ModalImageClasses", "NavigationRouter", "Paginator", "Parser", "PermissionStore", "PermissionsBits", "PoggerModeSettingsStore", "Popout", "PresenceStore", "PrivateChannelsStore", "React", "ReactDOM", "ReadStateStore", "RelationshipStore", "RestAPI", "ScrollerThin", "SearchableSelect", "Select", "SelectedChannelStore", "SelectedGuildStore", "SettingsRouter", "Slider", "SnowflakeUtils", "StatusSettingsStores", "Switch", "TabBar", "Text", "TextAndImagesSettingsStores", "TextArea", "TextInput", "Timestamp", "Toasts", "Tooltip", "UploadHandler", "UserProfileStore", "UserSettingsActionCreators", "UserStore", "UserUtils", "utils_d_exports", "WindowStore", "hljs", "i18n", "lodash", "moment", "showToast", "useCallback", "useEffect", "useMemo", "useReducer", "useRef", "useState", "useStateFromStores", "useToken", "init_common", "__esmMin", "init_react", "init_classes", "init_components", "init_menu", "init_settingsStores", "init_stores", "init_components_d", "init_menu_d", "init_utils_d", "init_utils", "git_hash_default", "init_git_hash", "__esmMin", "init_react", "git_remote_default", "init_git_remote", "__esmMin", "init_react", "WEBPACK_CHUNK", "REACT_GLOBAL", "VENCORD_USER_AGENT", "SUPPORT_CHANNEL_ID", "Devs", "DevsById", "init_constants", "__esmMin", "init_react", "init_git_hash", "init_git_remote", "git_hash_default", "git_remote_default", "d", "_", "v", "mergeDefaults", "obj", "defaults", "key", "v", "classes", "sleep", "ms", "r", "copyWithToast", "text", "toastMessage", "Clipboard", "Toasts", "isObject", "isObjectEmpty", "k", "parseUrl", "urlString", "identity", "value", "checkIntersecting", "isMobile", "isPluginDev", "init_misc", "__esmMin", "init_react", "init_common", "init_constants", "el", "elementBox", "documentHeight", "id", "DevsById", "useAwaiter", "factory", "providedOpts", "opts", "state", "setState", "useState", "useEffect", "isAlive", "value", "error", "useForceUpdater", "withDep", "r", "useReducer", "x", "useTimer", "interval", "deps", "time", "setTime", "start", "useMemo", "intervalId", "NoopComponent", "useIntersection", "init_react", "__esmMin", "init_common", "init_misc", "init_lazyReact", "intersectOnly", "observerRef", "React", "isIntersecting", "setIntersecting", "element", "checkIntersecting", "entries", "entry", "ErrorCard", "props", "VencordCreateElement", "classes", "init_ErrorCard", "__esmMin", "init_react", "init_", "init_misc", "color", "logger", "NO_ERROR", "ErrorBoundary", "ErrorBoundary_default", "init_ErrorBoundary", "__esmMin", "init_react", "init_Logger", "init_margins", "init_common", "init_ErrorCard", "Logger", "LazyComponent", "React", "error", "stack", "message", "eolIdx", "errorInfo", "VencordCreateElement", "msg", "ErrorCard", "Margins", "Component", "errorBoundaryProps", "props", "Heart", "VencordCreateElement", "init_Heart", "__esmMin", "init_react", "DonateButton", "props", "VencordCreateElement", "Button", "Heart", "init_DonateButton", "__esmMin", "init_react", "init_common", "init_Heart", "Flex", "props", "VencordCreateElement", "init_Flex", "__esmMin", "init_react", "openModalLazy", "render", "options", "ModalAPI", "openModal", "contextKey", "closeModal", "modalKey", "closeAllModals", "ModalSize", "Modals", "ImageModal", "ModalRoot", "ModalHeader", "ModalContent", "ModalFooter", "ModalCloseButton", "init_modal", "__esmMin", "init_react", "init_webpack", "findByPropsLazy", "LazyComponent", "findByProps", "definePlugin", "p", "init_types", "__esmMin", "init_react", "loadBadges", "noCache", "DonorBadges", "init", "lines", "r", "Logger", "line", "id", "description", "image", "CONTRIBUTOR_BADGE", "ContributorBadge", "badges_default", "init_badges", "__esmMin", "init_react", "init_Badges", "init_DonateButton", "init_ErrorBoundary", "init_Flex", "init_Heart", "init_constants", "init_Logger", "init_margins", "init_misc", "init_modal", "init_types", "init_common", "user", "isPluginDev", "definePlugin", "Devs", "Toasts", "ErrorBoundary_default", "badge", "Component", "VencordCreateElement", "userId", "modalKey", "openModal", "props", "closeModal", "Modals", "Flex", "Forms", "Heart", "Margins", "DonateButton", "commands_default", "init_commands", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "_", "cmd", "args", "ctx", "contextMenu_default", "init_contextMenu", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "memberListDecorators_default", "init_memberListDecorators", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "messageAccessories_default", "init_messageAccessories", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "messageDecorations_default", "init_messageDecorations", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "messageEvents_default", "init_messageEvents", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "_", "rest1", "rest2", "parsedMessage", "channel", "replyOptions", "extra", "m", "message", "event", "messagePopover_default", "init_messagePopover", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "m", "makeElement", "msg", "notices_default", "init_notices", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "serverList_default", "init_serverList", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "noTrack_default", "init_noTrack", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "ContextMenu_exports", "__export", "_patchContextMenu", "addContextMenuPatch", "addGlobalContextMenuPatch", "findGroupChildrenByChildId", "globalPatches", "navPatches", "removeContextMenuPatch", "removeGlobalContextMenuPatch", "navId", "patch", "id", "contextMenuPatches", "results", "children", "_itemsArray", "child", "nextChildren", "found", "props", "callback", "patchedMenus", "err", "ContextMenuLogger", "init_ContextMenu", "__esmMin", "init_react", "init_Logger", "Logger", "debounce", "func", "delay", "timeout", "args", "init_debounce", "__esmMin", "init_react", "localStorage", "init_localStorage", "__esmMin", "init_react", "Queue", "init_Queue", "__esmMin", "init_react", "maxSize", "func", "NotificationComponent_default", "init_NotificationComponent", "__esmMin", "init_react", "init_", "init_Settings", "init_ErrorBoundary", "init_misc", "init_common", "ErrorBoundary_default", "title", "body", "richBody", "color", "icon", "onClick", "onClose", "image", "permanent", "className", "dismissOnClick", "timeout", "position", "useSettings", "hasFocus", "useStateFromStores", "WindowStore", "isHover", "setIsHover", "useState", "elapsed", "setElapsed", "start", "useMemo", "useEffect", "intervalId", "timeoutProgress", "VencordCreateElement", "classes", "e", "props", "DataStore_exports", "__export", "clear", "createStore", "del", "delMany", "entries", "get", "getMany", "keys", "promisifyRequest", "set", "setMany", "update", "values", "request", "resolve", "reject", "dbName", "storeName", "dbp", "txMode", "callback", "db", "defaultGetStore", "defaultGetStoreFunc", "key", "customStore", "store", "value", "entry", "updater", "err", "eachCursor", "items", "cursor", "i", "init_DataStore", "__esmMin", "init_react", "Styles_exports", "__export", "classNameFactory", "classNameToSelector", "compileStyle", "disableStyle", "enableStyle", "isStyleEnabled", "requireStyle", "setStyleClassNames", "styleMap", "toggleStyle", "name", "style", "init_Styles", "__esmMin", "init_react", "classNames", "recompile", "match", "className", "prefix", "args", "arg", "value", "nanoid", "init_index_browser", "__esmMin", "init_react", "size", "id", "byte", "persistNotification", "notification", "limit", "Settings", "update", "KEY", "old", "log", "onClick", "onClose", "richBody", "permanent", "noPersist", "dismissOnClick", "pureNotification", "nanoid", "signals", "x", "deleteNotification", "timestamp", "getLog", "index", "set", "useLogs", "signal", "setSignal", "useReducer", "useEffect", "_", "pending", "useAwaiter", "NotificationEntry", "data", "removing", "setRemoving", "useState", "ref", "React", "div", "setHeight", "VencordCreateElement", "cl", "NotificationComponent_default", "Timestamp", "moment", "NotificationLog", "Forms", "LogModal", "modalProps", "close", "ModalRoot", "ModalHeader", "Text", "ModalCloseButton", "ModalContent", "ModalFooter", "Button", "Alerts", "openNotificationLogModal", "key", "openModal", "closeModal", "init_notificationLog", "__esmMin", "init_react", "init_DataStore", "init_Settings", "init_Styles", "init_modal", "init_common", "init_index_browser", "init_NotificationComponent", "get", "classNameFactory", "getRoot", "reactRoot", "container", "ReactDOM", "_showNotification", "notification", "id", "root", "resolve", "VencordCreateElement", "NotificationComponent_default", "shouldBeNative", "useNative", "Settings", "requestPermission", "showNotification", "data", "persistNotification", "title", "body", "icon", "image", "onClick", "onClose", "n", "NotificationQueue", "init_Notifications", "__esmMin", "init_react", "init_Settings", "init_Queue", "init_common", "init_NotificationComponent", "init_notificationLog", "Queue", "Notifications_exports", "__export", "requestPermission", "showNotification", "init_Notifications", "__esmMin", "init_react", "deflateSync", "data", "opts", "dopt", "inflateSync", "out", "inflt", "u8", "u16", "u32", "fleb", "fdeb", "clim", "freb", "_a", "fl", "revfl", "_b", "fd", "revfd", "rev", "x", "i", "hMap", "flt", "fdt", "flm", "flrm", "fdm", "fdrm", "max", "bits", "bits16", "shft", "slc", "ec", "err", "wbits", "wbits16", "hTree", "ln", "lc", "clen", "wfblk", "wblk", "deo", "et", "dflt", "td", "tds", "init_browser", "__esmMin", "init_react", "eb", "start", "b", "r", "j", "cd", "mb", "s", "l", "le", "co", "rvb", "sv", "r_1", "v", "m", "a", "d", "p", "o", "e", "n", "ind", "msg", "nt", "dat", "buf", "st", "sl", "noBuf", "noSt", "cbuf", "bl", "nbuf", "final", "pos", "bt", "lm", "dm", "lbt", "dbt", "tbts", "type", "hLit", "hcLen", "tl", "ldt", "clt", "clb", "clbmsk", "clm", "c", "lt", "dt", "t", "lms", "dms", "lpos", "sym", "add", "dsym", "end", "t2", "i0", "i1", "i2", "maxSym", "tr", "mbt", "lft", "cst", "i2_1", "i2_2", "i2_3", "cl", "cli", "cln", "cls", "w", "cf", "syms", "lf", "df", "li", "bs", "dlt", "mlb", "ddt", "mdb", "_c", "lclt", "nlc", "_d", "lcdt", "ndc", "lcfreq", "_e", "lct", "mlcb", "nlcc", "flen", "ftlen", "dtlen", "ll", "dl", "llm", "lcts", "it", "clct", "len", "dst", "lvl", "plvl", "pre", "post", "lst", "opt", "msk_1", "prev", "head", "bs1_1", "bs2_1", "hsh", "lc_1", "wi", "hv", "imod", "pimod", "rem", "ch_1", "dif", "maxn", "maxd", "ml", "nl", "mmd", "md", "ti", "pti", "lin", "din", "getAuthorization", "secrets", "get", "origin", "cloudUrlOrigin", "update", "getUserId", "setAuthorization", "secret", "deauthorizeCloud", "authorizeCloud", "Settings", "oauthConfiguration", "getCloudUrl", "clientId", "redirectUri", "showNotification", "OAuth2AuthorizeModal", "findByProps", "openModal", "props", "VencordCreateElement", "location", "res", "cloudLogger", "e", "getCloudAuth", "init_cloud", "__esmMin", "init_react", "init_DataStore", "init_Notifications", "init_Settings", "init_webpack", "init_common", "init_Logger", "init_modal", "Logger", "id", "UserStore", "relaunch", "showItemInFolder", "path", "init_native", "__esmMin", "init_react", "saveFile", "file", "a", "chooseFile", "mimeTypes", "resolve", "input", "init_web", "__esmMin", "init_react", "importSettings", "data", "parsed", "err", "PlainSettings", "exportSettings", "minify", "settings", "quickCss", "downloadSettingsBackup", "filename", "backup", "saveFile", "uploadSettingsBackup", "showToast", "file", "chooseFile", "reader", "toastSuccess", "Logger", "toastFailure", "putCloudSettings", "manual", "res", "getCloudUrl", "getCloudAuth", "deflateSync", "cloudSettingsLogger", "showNotification", "written", "e", "getCloudSettings", "shouldNotify", "force", "Settings", "localWritten", "inflateSync", "relaunch", "deleteCloudSettings", "toast", "init_settingsSync", "__esmMin", "init_react", "init_Notifications", "init_Settings", "init_common", "init_browser", "init_cloud", "init_Logger", "init_native", "init_web", "type", "message", "Toasts", "Settings_exports", "__export", "PlainSettings", "Settings", "addSettingsListener", "definePluginSettings", "migratePluginSettings", "useSettings", "makeProxy", "settings", "root", "path", "proxyCache", "target", "p", "v", "plugins_default", "plugin", "setting", "def", "o", "setPath", "subscription", "subscriptions", "localStorage", "saveSettingsOnFrequentAction", "paths", "forceUpdate", "React", "onUpdate", "value", "name", "oldNames", "plugins", "oldName", "logger", "checks", "definedSettings", "DefaultSettings", "init_Settings", "__esmMin", "init_react", "init_debounce", "init_localStorage", "init_Logger", "init_misc", "init_settingsSync", "init_types", "init_common", "init_plugins", "Logger", "mergeDefaults", "err", "debounce", "putCloudSettings", "updater_exports", "__export", "UpdateLogger", "changes", "checkForUpdates", "getRepo", "isNewer", "isOutdated", "maybePromptToUpdate", "update", "updateError", "Unwrap", "p", "res", "c", "git_hash_default", "confirmMessage", "checkForDev", "wantsUpdate", "relaunch", "err", "init_updater", "__esmMin", "init_react", "init_git_hash", "init_Logger", "init_native", "Logger", "handleComponentFailed", "maybePromptToUpdate", "init_handleComponentFailed", "__esmMin", "init_react", "init_updater", "onlyOnce", "f", "called", "result", "init_onlyOnce", "__esmMin", "init_react", "SettingsTab", "title", "children", "VencordCreateElement", "Forms", "Text", "Margins", "wrapTab", "component", "tab", "ErrorBoundary_default", "onError", "init_shared", "__esmMin", "init_react", "init_", "init_ErrorBoundary", "init_handleComponentFailed", "init_margins", "init_onlyOnce", "init_common", "onlyOnce", "handleComponentFailed", "VencordTab_exports", "__export", "VencordTab_default", "VencordSettings", "settingsDir", "settingsDirPending", "useAwaiter", "settings", "useSettings", "donateImage", "React", "DEFAULT_DONATE_IMAGE", "SHIGGY_DONATE_IMAGE", "isWindows", "isMac", "Switches", "VencordCreateElement", "SettingsTab", "DonateCard", "Forms", "Card", "cl", "Button", "relaunch", "showItemInFolder", "Margins", "s", "Switch", "v", "NotificationSection", "VencordFragment", "ErrorCard", "Select", "identity", "Slider", "openNotificationLogModal", "image", "DonateButton", "init_VencordTab", "__esmMin", "init_react", "init_notificationLog", "init_Settings", "init_Styles", "init_DonateButton", "init_ErrorCard", "init_margins", "init_misc", "init_native", "init_common", "init_shared", "classNameFactory", "wrapTab", "Notices_exports", "__export", "currentNotice", "nextNotice", "noticesQueue", "popNotice", "showNotice", "NoticesModule", "message", "buttonText", "onOkClick", "init_Notices", "__esmMin", "init_react", "init_webpack", "waitFor", "m", "Icon", "height", "width", "className", "children", "viewBox", "svgProps", "VencordCreateElement", "classes", "LinkIcon", "CopyIcon", "props", "OpenExternalIcon", "ImageIcon", "InfoIcon", "OwnerCrownIcon", "i18n", "ScreenshareIcon", "ImageVisible", "ImageInvisible", "Microphone", "CogWheel", "ReplyIcon", "DeleteIcon", "init_Icons", "__esmMin", "init_react", "init_", "init_misc", "init_common", "getUnitStr", "unit", "isOne", "short", "formatDuration", "time", "dur", "moment", "unitsAmounts", "units", "amountsToBeRemoved", "outer", "i", "v", "daysAmountIndex", "daysAmount", "daysMod", "res", "amount", "humanFriendlyJoin", "elements", "mapper", "s", "length", "makeCodeblock", "text", "language", "chars", "wordsFromCamel", "wordsFromSnake", "wordsFromKebab", "wordsFromPascal", "wordsFromTitle", "wordsToCamel", "wordsToSnake", "wordsToKebab", "wordsToPascal", "wordsToTitle", "init_text", "__esmMin", "init_react", "init_common", "w", "words", "generateId", "SnowflakeUtils", "sendBotMessage", "channelId", "message", "botMessage", "MessageCreator", "MessageSender", "mergeDefaults", "findOption", "args", "name", "fallbackValue", "a", "init_commandHelpers", "__esmMin", "init_react", "init_misc", "init_webpack", "init_common", "findByPropsLazy", "ApplicationCommandOptionType", "ApplicationCommandInputType", "ApplicationCommandType", "init_types", "__esmMin", "init_react", "Commands_exports", "__export", "ApplicationCommandInputType", "ApplicationCommandOptionType", "ApplicationCommandType", "BUILT_IN", "OptionalMessageOption", "RequiredMessageOption", "_handleCommand", "_init", "commands", "findOption", "generateId", "prepareOption", "registerCommand", "sendBotMessage", "unregisterCommand", "opt", "i", "opts", "OptPlaceholder", "ReqPlaceholder", "x", "registerSubCommands", "cmd", "plugin", "o", "subCmd", "command", "c", "name", "idx", "init_Commands", "__esmMin", "init_react", "init_text", "init_commandHelpers", "init_types", "cmds", "args", "ctx", "handleError", "err", "msg", "reason", "makeCodeblock", "res", "Badge", "text", "color", "VencordCreateElement", "init_Badge", "__esmMin", "init_react", "SettingBooleanComponent", "option", "pluginSettings", "definedSettings", "id", "onChange", "onError", "def", "state", "setState", "React", "error", "setError", "handleChange", "newValue", "isValid", "VencordCreateElement", "Forms", "Switch", "wordsToTitle", "wordsFromCamel", "init_SettingBooleanComponent", "__esmMin", "init_react", "init_text", "init_common", "SettingCustomComponent", "option", "onChange", "onError", "init_SettingCustomComponent", "__esmMin", "init_react", "SettingNumericComponent", "option", "pluginSettings", "definedSettings", "id", "onChange", "onError", "serialize", "value", "state", "setState", "React", "error", "setError", "handleChange", "newValue", "isValid", "MAX_SAFE_NUMBER", "VencordCreateElement", "Forms", "TextInput", "init_SettingNumericComponent", "__esmMin", "init_react", "init_types", "init_common", "SettingSelectComponent", "option", "pluginSettings", "definedSettings", "onChange", "onError", "id", "def", "o", "state", "setState", "React", "error", "setError", "handleChange", "newValue", "isValid", "VencordCreateElement", "Forms", "Select", "init_SettingSelectComponent", "__esmMin", "init_react", "init_common", "makeRange", "start", "end", "step", "ranges", "value", "SettingSliderComponent", "option", "pluginSettings", "definedSettings", "id", "onChange", "onError", "def", "error", "setError", "React", "handleChange", "newValue", "isValid", "VencordCreateElement", "Forms", "Slider", "v", "init_SettingSliderComponent", "__esmMin", "init_react", "init_common", "SettingTextComponent", "option", "pluginSettings", "definedSettings", "id", "onChange", "onError", "state", "setState", "React", "error", "setError", "handleChange", "newValue", "isValid", "VencordCreateElement", "Forms", "TextInput", "init_SettingTextComponent", "__esmMin", "init_react", "init_common", "init_components", "__esmMin", "init_react", "init_Badge", "init_SettingBooleanComponent", "init_SettingCustomComponent", "init_SettingNumericComponent", "init_SettingSelectComponent", "init_SettingSliderComponent", "init_SettingTextComponent", "getCurrentChannel", "ChannelStore", "SelectedChannelStore", "getCurrentGuild", "GuildStore", "openPrivateChannel", "userId", "PrivateChannelsStore", "getTheme", "UserSettingsActionCreators", "insertTextIntoChatInputBox", "text", "ComponentDispatch", "sendMessage", "channelId", "data", "waitForChannelReady", "extra", "messageData", "MessageActions", "openImageModal", "url", "props", "openModal", "modalProps", "VencordCreateElement", "ModalRoot", "ModalImageClasses", "ImageModal", "MaskedLink", "openUserProfile", "id", "UserUtils", "guildId", "SelectedGuildStore", "UserProfileActions", "fetchUserProfile", "options", "cached", "UserProfileStore", "FluxDispatcher", "body", "RestAPI", "getUniqueUsername", "user", "Theme", "init_discord", "__esmMin", "init_react", "init_webpack", "init_common", "init_modal", "findByPropsLazy", "openContributorModal", "user", "openModal", "modalProps", "VencordCreateElement", "ModalRoot", "ErrorBoundary_default", "ModalContent", "cl", "ContributorModal", "GithubIcon", "src", "getTheme", "GithubIconLight", "GithubIconDark", "WebsiteIcon", "WebsiteIconLight", "WebsiteIconDark", "useSettings", "profile", "useStateFromStores", "UserProfileStore", "useEffect", "fetchUserProfile", "githubName", "a", "website", "plugins", "useMemo", "allPlugins", "plugins_default", "DevsById", "p", "b", "VencordFragment", "Forms", "MaskedLink", "PluginCard", "showToast", "init_ContributorModal", "__esmMin", "init_react", "init_", "init_Settings", "init_Styles", "init_ErrorBoundary", "init_constants", "init_discord", "init_modal", "init_common", "init_plugins", "init_PluginSettings", "classNameFactory", "makeDummyUser", "user", "newUser", "UserRecord", "generateId", "FluxDispatcher", "PluginModal", "plugin", "onRestartNeeded", "onClose", "transitionState", "authors", "setAuthors", "React", "pluginSettings", "useSettings", "tempSettings", "setTempSettings", "errors", "setErrors", "saveError", "setSaveError", "canSubmit", "e", "hasSettings", "isObjectEmpty", "author", "UserUtils", "a", "saveAndClose", "result", "restartNeeded", "key", "value", "option", "renderSettings", "VencordCreateElement", "Forms", "options", "setting", "onChange", "newValue", "s", "onError", "hasError", "Component", "Components", "Flex", "renderMoreUsers", "_label", "count", "sliceCount", "sliceStart", "sliceEnd", "Tooltip", "u", "onMouseEnter", "onMouseLeave", "AvatarStyles", "ModalRoot", "ModalHeader", "Text", "ModalCloseButton", "ModalContent", "UserSummaryItem", "Clickable", "openContributorModal", "classes", "Margins", "ErrorBoundary_default", "ModalFooter", "Button", "init_PluginModal", "__esmMin", "init_react", "init_Commands", "init_Settings", "init_ErrorBoundary", "init_Flex", "init_lazy", "init_margins", "init_misc", "init_modal", "init_types", "init_webpack", "init_common", "init_components", "init_ContributorModal", "findComponentByCodeLazy", "findByPropsLazy", "proxyLazy", "UserStore", "SettingTextComponent", "SettingNumericComponent", "SettingBooleanComponent", "SettingSelectComponent", "SettingSliderComponent", "SettingCustomComponent", "Switch", "checked", "onChange", "disabled", "VencordCreateElement", "classes", "SwitchClasses", "SWITCH_ON", "SWITCH_OFF", "VencordFragment", "e", "init_Switch", "__esmMin", "init_react", "init_", "init_misc", "init_webpack", "findByPropsLazy", "AddonCard", "disabled", "isNew", "name", "infoButton", "footer", "author", "enabled", "setEnabled", "description", "onMouseEnter", "onMouseLeave", "VencordCreateElement", "cl", "Text", "Badge", "Switch", "init_AddonCard", "__esmMin", "init_react", "init_", "init_Styles", "init_Badge", "init_Switch", "init_common", "classNameFactory", "ChangeList", "init_ChangeList", "__esmMin", "init_react", "item", "mapper", "plugins_exports", "__export", "PMLogger", "isPluginEnabled", "patches", "plugins", "startAllPlugins", "startDependenciesRecursive", "startPlugin", "stopPlugin", "p", "plugins_default", "settings", "restartNeeded", "failures", "dep", "Settings", "logger", "pluginsValues", "init_plugins", "__esmMin", "init_react", "init_Commands", "init_Settings", "init_Logger", "init_types", "init_common", "init_Tracer", "Logger", "d", "error", "name", "def", "checks", "patch", "traceFunction", "target", "commands", "flux", "e", "cmd", "registerCommand", "event", "FluxDispatcher", "unregisterCommand", "showErrorToast", "message", "Toasts", "ReloadRequiredCard", "required", "VencordCreateElement", "Card", "cl", "VencordFragment", "Forms", "Button", "PluginCard", "plugin", "disabled", "onRestartNeeded", "onMouseEnter", "onMouseLeave", "isNew", "settings", "Settings", "isEnabled", "openModal", "openModalLazy", "modalProps", "PluginModal", "toggleEnabled", "wasEnabled", "restartNeeded", "failures", "startDependenciesRecursive", "logger", "showNotice", "stopPlugin", "startPlugin", "msg", "AddonCard", "classes", "ButtonClasses", "isObjectEmpty", "CogWheel", "InfoIcon", "PluginSettings", "useSettings", "changes", "React", "ChangeList", "Alerts", "s", "i", "Parser", "depMap", "o", "plugins_default", "deps", "dep", "sortedPlugins", "a", "b", "searchValue", "setSearchValue", "onSearch", "query", "prev", "onStatusChange", "status", "pluginFilter", "enabled", "newPlugins", "v", "t", "useAwaiter", "get", "cachedPlugins", "now", "existingTimestamps", "sortedPluginNames", "p", "set", "lodash", "plugins", "requiredPlugins", "d", "tooltipText", "makeDependencyList", "Tooltip", "name", "Text", "SettingsTab", "Margins", "TextInput", "InputStyles", "Select", "init_PluginSettings", "__esmMin", "init_react", "init_", "init_DataStore", "init_Notices", "init_Settings", "init_Styles", "init_Icons", "init_PluginModal", "init_AddonCard", "init_shared", "init_ChangeList", "init_Logger", "init_margins", "init_misc", "init_modal", "init_webpack", "init_common", "init_plugins", "classNameFactory", "Logger", "findByPropsLazy", "PluginsTab_exports", "__export", "PluginsTab_default", "init_PluginsTab", "__esmMin", "init_react", "init_PluginSettings", "init_shared", "wrapTab", "PluginSettings", "Link", "props", "VencordCreateElement", "init_Link", "__esmMin", "init_react", "ThemesTab_exports", "__export", "ThemesTab_default", "Validator", "link", "res", "err", "pending", "useAwaiter", "contentType", "text", "VencordCreateElement", "Forms", "Validators", "themeLinks", "VencordFragment", "Margins", "Card", "ThemeCard", "theme", "enabled", "onChange", "onDelete", "AddonCard", "Flex", "Link", "e", "invite", "InviteActions", "showToast", "FluxDispatcher", "ThemesTab", "settings", "useSettings", "fileInputRef", "useRef", "currentTab", "setCurrentTab", "useState", "themeText", "setThemeText", "userThemes", "setUserThemes", "themeDir", "themeDirPending", "useEffect", "refreshLocalThemes", "themes", "onLocalThemeChange", "fileName", "value", "f", "onFileUpload", "files", "uploads", "file", "name", "resolve", "reject", "reader", "renderLocalThemes", "Button", "showItemInFolder", "cl", "onBlur", "s", "renderOnlineThemes", "TextArea", "classes", "TextAreaProps", "SettingsTab", "TabBar", "FileInput", "init_ThemesTab", "__esmMin", "init_react", "init_Settings", "init_Styles", "init_Flex", "init_Icons", "init_Link", "init_margins", "init_misc", "init_native", "init_webpack", "init_common", "init_AddonCard", "init_shared", "findByPropsLazy", "findLazy", "m", "classNameFactory", "wrapTab", "UpdaterTab_exports", "__export", "UpdaterTab_default", "withDispatcher", "dispatcher", "action", "e", "UpdateLogger", "code", "path", "cmd", "stderr", "err", "Alerts", "VencordCreateElement", "ErrorCard", "line", "Parser", "HashLink", "repo", "hash", "disabled", "Link", "Changes", "updates", "repoPending", "Card", "author", "message", "Updatable", "props", "setUpdates", "React", "changes", "isChecking", "setIsChecking", "isUpdating", "setIsUpdating", "isOutdated", "VencordFragment", "updateError", "Forms", "Margins", "Flex", "classes", "Button", "update", "r", "relaunch", "checkForUpdates", "Toasts", "Newer", "Updater", "settings", "useSettings", "useAwaiter", "getRepo", "commonProps", "SettingsTab", "Switch", "v", "git_hash_default", "isNewer", "init_UpdaterTab", "__esmMin", "init_react", "init_Settings", "init_ErrorCard", "init_Flex", "init_Link", "init_margins", "init_misc", "init_native", "init_updater", "init_common", "init_git_hash", "init_shared", "wrapTab", "CheckedTextInput", "initialValue", "onChange", "validate", "value", "setValue", "React", "error", "setError", "handleChange", "v", "res", "VencordCreateElement", "VencordFragment", "TextInput", "init_CheckedTextInput", "__esmMin", "init_react", "init_common", "CloudTab_exports", "__export", "CloudTab_default", "validateUrl", "url", "eraseAllData", "res", "getCloudUrl", "getCloudAuth", "cloudLogger", "showNotification", "Settings", "deauthorizeCloud", "SettingsSyncSection", "cloud", "useSettings", "sectionEnabled", "VencordCreateElement", "Forms", "Margins", "Switch", "v", "Button", "putCloudSettings", "Tooltip", "onMouseLeave", "onMouseEnter", "getCloudSettings", "deleteCloudSettings", "CloudTab", "settings", "SettingsTab", "Link", "authorizeCloud", "CheckedTextInput", "Alerts", "init_CloudTab", "__esmMin", "init_react", "init_Notifications", "init_Settings", "init_CheckedTextInput", "init_Link", "init_cloud", "init_margins", "init_settingsSync", "init_common", "init_shared", "wrapTab", "BackupAndRestoreTab_exports", "__export", "BackupAndRestoreTab_default", "BackupRestoreTab", "VencordCreateElement", "SettingsTab", "Card", "classes", "Flex", "Text", "Margins", "Button", "uploadSettingsBackup", "downloadSettingsBackup", "init_BackupAndRestoreTab", "__esmMin", "init_react", "init_Flex", "init_margins", "init_misc", "init_settingsSync", "init_common", "init_shared", "wrapTab", "settings_default", "init_settings", "__esmMin", "init_react", "init_ContextMenu", "init_Settings", "init_constants", "init_types", "init_common", "init_git_hash", "definePlugin", "Devs", "addContextMenuPatch", "children", "c", "it", "id", "SettingsRouter", "m", "component", "props", "Settings", "SectionTypes", "func", "b", "Component", "electronVersion", "chromiumVersion", "additionalInfo", "VencordCreateElement", "VencordFragment", "git_hash_default", "REMEMBER_DISMISS_KEY", "AllowedChannelIds", "supportHelper_default", "init_supportHelper", "__esmMin", "init_react", "init_api", "init_constants", "init_misc", "init_text", "init_types", "init_updater", "init_common", "init_git_hash", "init_plugins", "init_settings", "SUPPORT_CHANNEL_ID", "definePlugin", "Devs", "ctx", "RELEASE_CHANNEL", "client", "isApiPlugin", "plugin", "plugins_default", "enabledPlugins", "p", "enabledApiPlugins", "info", "git_hash_default", "settings_default", "isOutdated", "k", "v", "makeCodeblock", "channelId", "isPluginDev", "UserStore", "DataStore", "rememberDismiss", "Alerts", "VencordCreateElement", "Forms", "alwaysAnimate_default", "init_alwaysAnimate", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "m", "rest", "alwaysTrust_default", "init_alwaysTrust", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "tarExtMatcher", "anonymiseFileNames_default", "init_anonymiseFileNames", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "definePlugin", "Devs", "Settings", "file", "name", "extIdx", "ext", "chars", "lookupAsset", "applicationId", "key", "ApplicationAssetUtils", "lookupApp", "socket", "RpcUtils", "apps", "ws", "arRPC_default", "init_arRPC", "__esmMin", "init_react", "init_Notices", "init_Link", "init_constants", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePlugin", "Devs", "VencordCreateElement", "VencordFragment", "Forms", "Link", "data", "activity", "assets", "appId", "app", "FluxDispatcher", "res", "showNotice", "popNotice", "Toasts", "banger_default", "init_banger", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "ChannelRTCStore", "Animations", "GuildsBar", "FolderSideBar_default", "init_FolderSideBar", "__esmMin", "init_react", "init_ErrorBoundary", "init_webpack", "init_common", "init_betterFolders", "findStoreLazy", "findByPropsLazy", "findComponentByCodeLazy", "ErrorBoundary_default", "guildsBarProps", "expandedFolders", "useStateFromStores", "ExpandedGuildFolderStore", "isFullscreen", "Sidebar", "VencordCreateElement", "visible", "guilds", "barStyle", "settings", "animationStyle", "show", "getGuildFolder", "id", "SortedGuildStore", "folder", "closeFolders", "ExpandedGuildFolderStore", "FolderUtils", "GuildsTree", "lastGuildId", "dispatchingFoldersClose", "settings", "betterFolders_default", "init_betterFolders", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_webpack", "init_common", "init_FolderSideBar", "findByPropsLazy", "findStoreLazy", "definePluginSettings", "definePlugin", "Devs", "_", "rest", "guildsTree", "isExpandedOrExpandedIds", "folderNote", "isExpanded", "m", "data", "guildFolder", "FluxDispatcher", "expandedFolders", "isBetterFolders", "oldTree", "expandedFolderIds", "newTree", "guildOrFolder", "child", "i18n", "guildsBarProps", "VencordCreateElement", "FolderSideBar_default", "betterGifAltText_default", "init_betterGifAltText", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "props", "url", "name", "UserPopoutSectionCssClasses", "betterNotes_default", "init_betterNotes", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_webpack", "findByPropsLazy", "definePlugin", "Devs", "m", "rest", "Settings", "VencordCreateElement", "betterRoleDot_default", "init_betterRoleDot", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_common", "definePlugin", "Devs", "Settings", "color", "Clipboard", "Toasts", "betterUploadButton_default", "init_betterUploadButton", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "ApplicationStreamPreviewStore", "ApplicationStreamingStore", "init_stores", "__esmMin", "init_react", "init_webpack", "findStoreLazy", "handleViewPreview", "addViewStreamContext", "streamContextPatch", "userContextPatch", "biggerStreamPreview_default", "init_biggerStreamPreview", "__esmMin", "init_react", "init_ContextMenu", "init_Icons", "init_constants", "init_discord", "init_types", "init_common", "init_stores", "guildId", "channelId", "ownerId", "previewUrl", "ApplicationStreamPreviewStore", "openImageModal", "children", "userId", "stream", "ApplicationStreamingStore", "streamPreviewItem", "VencordCreateElement", "Menu", "ScreenshareIcon", "user", "definePlugin", "Devs", "addContextMenuPatch", "removeContextMenuPatch", "setCss", "style", "Settings", "blurNsfw_default", "init_blurNsfw", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "definePlugin", "Devs", "formatDuration", "ms", "human", "Settings", "format", "n", "unit", "s", "delim", "d", "h", "m", "res", "callTimer_default", "init_callTimer", "__esmMin", "init_react", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "definePlugin", "Devs", "channelId", "VencordCreateElement", "ErrorBoundary_default", "time", "useTimer", "MessageEvents_exports", "__export", "_handleClick", "_handlePreEdit", "_handlePreSend", "addClickListener", "addPreEditListener", "addPreSendListener", "removeClickListener", "removePreEditListener", "removePreSendListener", "channelId", "messageObj", "extra", "replyOptions", "listener", "sendListeners", "result", "e", "MessageEventsLogger", "messageId", "editListeners", "message", "channel", "event", "MessageStore", "listeners", "init_MessageEvents", "__esmMin", "init_react", "init_Logger", "init_common", "Logger", "defaultRules", "init_defaultRules", "__esmMin", "init_react", "reRegExpChar", "reHasRegExpChar", "clearURLs_default", "init_clearURLs", "__esmMin", "init_react", "init_MessageEvents", "init_constants", "init_types", "init_defaultRules", "definePlugin", "Devs", "str", "rules", "defaultRules", "rule", "splitRule", "paramRule", "hostRule", "hostRuleIndex", "param", "parent", "match", "url", "_value", "regex", "hostRuleName", "msg", "addPreSendListener", "_", "addPreEditListener", "_cid", "_mid", "removePreSendListener", "removePreEditListener", "onPickColor", "color", "hexColor", "settings", "updateColorVars", "ThemeSettings", "lightnessWarning", "hexToLightness", "lightModeWarning", "getTheme", "VencordCreateElement", "Forms", "ColorPicker", "colorPresets", "classes", "Margins", "generateColorOffsets", "styleLinkNodes", "variableLightness", "styleLinkNode", "cssLink", "cssString", "variableMatch", "variableRegex", "variable", "lightness", "lightnessOffsets", "key", "lightnessOffset", "plusOrMinus", "style", "hue", "saturation", "hexToHSL", "hexCode", "r", "g", "b", "cMax", "cMin", "delta", "clientTheme_default", "init_clientTheme", "__esmMin", "init_react", "init_", "init_Settings", "init_constants", "init_discord", "init_margins", "init_misc", "init_types", "init_webpack", "init_common", "findComponentByCodeLazy", "definePluginSettings", "Button", "definePlugin", "Devs", "colorSighted_default", "init_colorSighted", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "canonicalizeMatch", "match", "canonSource", "canonicalizeReplace", "replace", "pluginName", "self", "args", "canonicalizeDescriptor", "descriptor", "canonicalize", "original", "canonicalizeReplacement", "replacement", "plugin", "descriptors", "init_patches", "__esmMin", "init_react", "consoleShortcuts_default", "init_consoleShortcuts", "__esmMin", "init_react", "init_constants", "init_native", "init_patches", "init_types", "init_webpack", "init_common", "definePlugin", "Devs", "newFindWrapper", "filterFactory", "cache", "filterProps", "cacheKey", "matches", "findAll", "result", "uniqueMatches", "fakeRenderWin", "find", "f", "wreq", "search", "extract", "code", "findModuleId", "filters", "props", "relaunch", "canonicalizeMatch", "canonicalizeReplace", "canonicalizeReplacement", "component", "prevWin", "win", "doc", "s", "n", "ReactDOM", "React", "shortcuts", "key", "val", "UserContextMenuPatch", "copyUserURLs_default", "init_copyUserURLs", "__esmMin", "init_react", "init_ContextMenu", "init_Icons", "init_constants", "init_types", "init_common", "children", "user", "VencordCreateElement", "Menu", "Clipboard", "LinkIcon", "definePlugin", "Devs", "addContextMenuPatch", "removeContextMenuPatch", "CrashHandlerLogger", "ModalStack", "settings", "crashCount", "lastCrashTimestamp", "shouldAttemptNextHandle", "crashHandler_default", "init_crashHandler", "__esmMin", "init_react", "init_Notifications", "init_Settings", "init_constants", "init_Logger", "init_modal", "init_types", "init_updater", "init_webpack", "init_common", "Logger", "findByPropsLazy", "definePluginSettings", "definePlugin", "Devs", "_this", "showNotification", "maybePromptToUpdate", "err", "FluxDispatcher", "closeAllModals", "NavigationRouter", "isTruthy", "item", "isNonNullish", "init_guards", "__esmMin", "init_react", "getApplicationAsset", "key", "ApplicationAssetUtils", "settings", "onChange", "setRpc", "Settings", "isStreamLinkDisabled", "isStreamLinkValid", "value", "isTimestampDisabled", "isImageKeyValid", "createActivity", "appID", "appName", "details", "state", "type", "streamLink", "startTime", "endTime", "imageBig", "imageBigTooltip", "imageSmall", "imageSmallTooltip", "buttonOneText", "buttonOneURL", "buttonTwoText", "buttonTwoURL", "activity", "isTruthy", "k", "v", "disable", "FluxDispatcher", "ActivityComponent", "ActivityClassName", "Colors", "customRPC_default", "init_customRPC", "__esmMin", "init_react", "init_Settings", "init_Link", "init_constants", "init_guards", "init_types", "init_webpack", "init_common", "findComponentByCodeLazy", "findByPropsLazy", "definePluginSettings", "definePlugin", "Devs", "useAwaiter", "VencordCreateElement", "VencordFragment", "Forms", "Link", "SelectedChannelStore", "GuildStore", "SelectedGuildStore", "UserStore", "embedDidMount", "embed", "videoId", "embedUrlRe", "res", "titles", "thumbnails", "hasTitle", "hasThumb", "err", "Logger", "DearrowButton", "component", "VencordCreateElement", "Tooltip", "onMouseEnter", "onMouseLeave", "enabled", "oldThumb", "oldTitle", "dearrow_default", "init_dearrow", "__esmMin", "init_react", "init_", "init_ErrorBoundary", "init_constants", "init_Logger", "init_types", "init_common", "definePlugin", "Devs", "ErrorBoundary_default", "disableDMCallIdle_default", "init_disableDMCallIdle", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "getUrl", "data", "StickerExt", "fetchSticker", "id", "cached", "StickersStore", "body", "RestAPI", "FluxDispatcher", "cloneSticker", "guildId", "sticker", "fetchBlob", "UserStore", "cloneEmoji", "emoji", "dataUrl", "resolve", "reader", "EmojiManager", "getGuildCandidates", "meId", "GuildStore", "g", "PermissionStore", "PermissionsBits", "isAnimated", "emojiSlots", "emojis", "EmojiStore", "count", "a", "b", "url", "res", "doClone", "Toasts", "e", "message", "Logger", "CloneModal", "isCloning", "setIsCloning", "React", "name", "setName", "x", "invalidateMemo", "guilds", "VencordCreateElement", "VencordFragment", "Forms", "Margins", "CheckedTextInput", "v", "nameValidator", "Tooltip", "onMouseLeave", "onMouseEnter", "getFontSize", "buildMenuItem", "type", "fetchData", "Menu", "openModalLazy", "modalProps", "ModalRoot", "ModalHeader", "ModalContent", "isGifUrl", "messageContextMenuPatch", "expressionPickerPatch", "emoteCloner_default", "init_emoteCloner", "__esmMin", "init_react", "init_ContextMenu", "init_CheckedTextInput", "init_constants", "init_Logger", "init_margins", "init_modal", "init_types", "init_webpack", "init_common", "findStoreLazy", "findByPropsLazy", "s", "children", "props", "favoriteableId", "itemHref", "itemSrc", "favoriteableType", "menuItem", "match", "findGroupChildrenByChildId", "firstChild", "definePlugin", "Devs", "addContextMenuPatch", "removeContextMenuPatch", "KbdStyles", "settings", "experiments_default", "init_experiments", "__esmMin", "init_react", "init_Settings", "init_ErrorBoundary", "init_ErrorCard", "init_constants", "init_margins", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePluginSettings", "definePlugin", "Devs", "_", "user", "flags", "isMacOS", "modKey", "altKey", "VencordCreateElement", "React", "Forms", "ErrorBoundary_default", "ErrorCard", "Margins", "f8break_default", "init_f8break", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "init_web_metadata", "__esmMin", "init_react", "require_apng_canvas", "__commonJSMin", "exports", "module", "init_react", "self", "i", "o", "a", "s", "u", "n", "t", "e", "__require", "c", "r", "Y", "G", "q", "l", "d", "g", "f", "h", "p", "v", "A", "m", "w", "b", "_", "j", "L", "U", "y", "T", "E", "P", "x", "N", "O", "R", "C", "B", "I", "D", "k", "F", "S", "M", "importApngJs", "rnnoiseDist", "rnnoiseWorkletSrc", "shikiWorkerSrc", "shikiOnigasmSrc", "getStegCloak", "init_dependencies", "__esmMin", "init_react", "init_lazy", "init_web_metadata", "makeLazy", "__markAsModule", "exports", "__export", "GIFEncoder", "applyPalette", "src_default", "nearestColor", "nearestColorIndex", "nearestColorIndexWithDistance", "prequantize", "quantize", "snapColorsToPalette", "constants_default", "createStream", "initialCapacity", "cursor", "contents", "byte", "expand", "data", "offset", "byteLength", "i", "newCapacity", "prevCapacity", "CAPACITY_DOUBLING_MAX", "oldContents", "BITS", "DEFAULT_HSIZE", "MASKS", "lzwEncode", "width", "height", "pixels", "colorDepth", "outStream", "accum", "htab", "codetab", "hsize", "initCodeSize", "cur_accum", "cur_bits", "init_bits", "g_init_bits", "clear_flg", "n_bits", "maxcode", "ClearCode", "EOFCode", "free_ent", "a_count", "ent", "hshift", "fcode", "output", "length", "idx", "next_block", "c", "disp", "code", "lzwEncode_default", "rgb888_to_rgb565", "r", "g", "b", "rgba8888_to_rgba4444", "a", "rgb888_to_rgb444", "clamp", "value", "min", "max", "sqr", "find_nn", "bins", "hasAlpha", "nn", "err", "bin1", "n1", "wa", "wr", "wg", "wb", "bin", "n2", "nerr2", "nerr", "create_bin", "create_bin_list", "format", "bincount", "size", "color", "index", "rgba", "maxColors", "opts", "clearAlpha", "clearAlphaColor", "clearAlphaThreshold", "oneBitAlpha", "useSqrt", "bincountMinusOne", "heap", "maxbins", "d", "h", "l", "l2", "extbins", "tb", "b1", "nb", "palette", "k", "existsInPalette", "p", "matchesRGB", "matchesAlpha", "euclideanDistanceSquared", "sum", "n", "dx", "roundStep", "step", "roundRGB", "roundAlpha", "cache", "key", "nearestColorIndexRGBA", "rgb888_to_key", "nearestColorIndexRGB", "mindist", "px2", "a2", "curdist", "sqr2", "r2", "g2", "b2", "knownColors", "threshold", "paletteRGB", "thresholdSq", "dim", "distanceSq", "colors", "pixel", "distanceFn", "minDist", "minDistIndex", "j", "paletteColor", "dist", "opt", "auto", "stream", "HSIZE", "hasInit", "writeHeader", "transparent", "transparentIndex", "delay", "repeat", "dispose", "first", "encodeLogicalScreenDescriptor", "encodeColorTable", "encodeNetscapeExt", "delayTime", "encodeGraphicControlExt", "useLocalColorTable", "encodeImageDescriptor", "encodePixels", "writeUTFBytes", "transp", "userInput", "writeUInt16", "globalColorTableSize", "colorTableSize", "fields", "backgroundColorIndex", "pixelAspectRatio", "colorTableLength", "localPalette", "palSize", "short", "text", "searchProtoClassField", "localName", "protoClass", "field", "value", "import_gifenc", "DRAFT_TYPE", "StickerStore", "UserSettingsProtoStore", "ProtoUtils", "PreloadedUserSettingsActionCreators", "AppearanceSettingsActionCreators", "ClientThemeSettingsActionsCreators", "USE_EXTERNAL_EMOJIS", "USE_EXTERNAL_STICKERS", "fakeNitroEmojiRegex", "fakeNitroStickerRegex", "fakeNitroGifStickerRegex", "settings", "fakeNitro_default", "init_fakeNitro", "__esmMin", "init_react", "init_MessageEvents", "init_Settings", "init_constants", "init_dependencies", "init_discord", "init_lazy", "init_Logger", "init_types", "init_webpack", "init_common", "findStoreLazy", "findByPropsLazy", "proxyLazy", "UserSettingsActionCreators", "definePluginSettings", "definePlugin", "Devs", "_", "intention", "rest", "canUseExternal", "m", "premiumCheck", "func", "props", "backgroundGradientPresetId", "originalCall", "theme", "content", "rest1", "message", "rest2", "embed", "stickers", "attachments", "renderableSticker", "reactNode", "node", "getCurrentGuild", "UserStore", "proto", "user", "appearanceSettingsDummy", "clientThemeSettingsDummy", "original", "currentAppearanceSettings", "newAppearanceProto", "FluxDispatcher", "firstContent", "lastIndex", "lastContent", "array", "item", "child", "inline", "nextIndex", "transformLinkChild", "fakeNitroMatch", "url", "emojiName", "EmojiStore", "Parser", "gifMatch", "transformChild", "modifyChildren", "modifyChild", "newChild", "listHasAnItem", "index", "children", "lodash", "err", "Logger", "itemsToMaybePush", "contentItems", "attachment", "imgMatch", "stickerName", "match", "link", "type", "fake", "channelId", "channel", "ChannelStore", "PermissionStore", "stickerId", "Settings", "stickerLink", "parseURL", "importApngJs", "frames", "width", "height", "gif", "resolution", "canvas", "ctx", "scale", "previousFrameData", "frame", "left", "top", "img", "delay", "blendOp", "disposeOp", "data", "palette", "file", "UploadHandler", "s", "getWordBoundary", "origStr", "offset", "addPreSendListener", "messageObj", "extra", "guildId", "stickerBypass", "sticker", "canUseStickers", "canUseEmotes", "emoji", "emojiString", "addPreEditListener", "__", "emojiStr", "emojiId", "removePreSendListener", "removePreEditListener", "virtualMerge", "objects", "fallback", "findObjectByProp", "prop", "i", "handler", "acc", "obj", "method", "_", "args", "dist_default", "init_dist", "__esmMin", "init_react", "encode", "primary", "accent", "message", "padding", "encoded", "x", "decode", "bio", "colorString", "parsed", "settings", "fakeProfileThemes_default", "init_fakeProfileThemes", "__esmMin", "init_react", "init_Settings", "init_ErrorBoundary", "init_constants", "init_margins", "init_misc", "init_types", "init_common", "init_dist", "definePluginSettings", "definePlugin", "Devs", "VencordCreateElement", "Forms", "user", "colors", "dist_default", "ErrorBoundary_default", "Button", "copyWithToast", "Margins", "favEmojiFirst_default", "init_favEmojiFirst", "__esmMin", "init_react", "init_constants", "init_types", "init_common", "definePlugin", "Devs", "query", "emojiContext", "EmojiStore", "a", "b", "aIsFavorite", "bIsFavorite", "SearchBar", "instance", "SearchBarComponent", "query", "setQuery", "useState", "ref", "useRef", "onChange", "useCallback", "searchQuery", "props", "result", "gif", "fuzzySearch", "getTargetString", "m", "a", "b", "e", "useEffect", "VencordCreateElement", "containerClasses", "urlStr", "url", "settings", "searchString", "searchIndex", "score", "favGifSearch_default", "init_favGifSearch", "__esmMin", "init_react", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePluginSettings", "definePlugin", "Devs", "ErrorBoundary_default", "favorites", "filteredFavorites", "fixSpotifyEmbeds_default", "init_fixSpotifyEmbeds", "__esmMin", "init_react", "init_Settings", "init_components", "init_constants", "init_types", "definePlugin", "Devs", "definePluginSettings", "makeRange", "forceOwnerCrown_default", "init_forceOwnerCrown", "__esmMin", "init_react", "init_constants", "init_types", "init_common", "definePlugin", "Devs", "props", "guildId", "userId", "GuildStore", "FriendInvites", "uuid4", "friendInvites_default", "init_friendInvites", "__esmMin", "init_react", "init_Commands", "init_constants", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePlugin", "Devs", "args", "ctx", "uses", "findOption", "UserStore", "sendBotMessage", "invite", "random", "invite_suggestions", "RestAPI", "_", "friendInviteList", "style_default", "init_style", "__esmMin", "init_react", "makeIcon", "showCurrentGame", "VencordCreateElement", "VencordFragment", "GameActivityToggleButton", "StatusSettingsStores", "Button", "old", "gameActivityToggle_default", "init_gameActivityToggle", "__esmMin", "init_react", "init_Styles", "init_ErrorBoundary", "init_constants", "init_types", "init_webpack", "init_common", "init_style", "findComponentByCodeLazy", "definePlugin", "Devs", "ErrorBoundary_default", "enableStyle", "style_default", "disableStyle", "closeExpressionPicker", "gifPaste_default", "init_gifPaste", "__esmMin", "init_react", "init_constants", "init_discord", "init_types", "init_webpack", "findByPropsLazy", "definePlugin", "Devs", "gif", "insertTextIntoChatInputBox", "greet", "channel", "message", "stickers", "options", "MessageActions", "settings", "msg", "GreetMenu", "s", "greetMode", "multiGreetChoices", "VencordCreateElement", "Menu", "FluxDispatcher", "GreetMode", "mode", "WELCOME_STICKERS", "sticker", "VencordFragment", "checked", "greetStickerPicker_default", "init_greetStickerPicker", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_webpack", "init_common", "definePluginSettings", "findByPropsLazy", "definePlugin", "Devs", "event", "props", "ContextMenuApi", "MessagePopover_exports", "__export", "_buildPopoverElements", "addButton", "buttons", "removeButton", "identifier", "item", "msg", "makeButton", "items", "getItem", "err", "logger", "init_MessagePopover", "__esmMin", "init_react", "init_Logger", "Logger", "style", "KEY", "hiddenMessages", "getHiddenMessages", "saveHiddenMessages", "hideAttachments_default", "init_hideAttachments", "__esmMin", "init_react", "init_DataStore", "init_MessagePopover", "init_Icons", "init_constants", "init_types", "init_common", "get", "set", "ids", "definePlugin", "Devs", "addButton", "msg", "isHidden", "ImageVisible", "ImageInvisible", "ChannelStore", "removeButton", "elements", "id", "iLoveSpam_default", "init_iLoveSpam", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "ToggleIcon", "activity", "tooltipText", "path", "fill", "VencordCreateElement", "Tooltip", "tooltipProps", "e", "handleActivityToggle", "ToggleActivityComponent", "isPlaying", "s", "settings", "ignoredActivities", "act", "ToggleIconOff", "ToggleIconOn", "ignoredActivityIndex", "getIgnoredActivities", "_", "index", "StatusSettingsStores", "old", "RunningGameStore", "ignoreActivities_default", "init_ignoreActivities", "__esmMin", "init_react", "init_DataStore", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_webpack", "init_common", "findStoreLazy", "definePluginSettings", "definePlugin", "Devs", "m", "activities", "props", "nowPlaying", "oldIgnoredActivitiesData", "get", "del", "gamesSeen", "ignoredActivity", "game", "exePath", "ErrorBoundary_default", "ELEMENT_ID", "init_constants", "__esmMin", "init_react", "waitFor", "condition", "cb", "init_waitFor", "__esmMin", "init_react", "cl", "Magnifier", "init_Magnifier", "__esmMin", "init_react", "init_Styles", "init_common", "init_constants", "init_imageZoom", "init_waitFor", "classNameFactory", "instance", "initialSize", "initalZoom", "ready", "setReady", "useState", "lensPosition", "setLensPosition", "imagePosition", "setImagePosition", "opacity", "setOpacity", "isShiftDown", "useRef", "zoom", "size", "element", "currentVideoElementRef", "originalVideoElementRef", "imageRef", "React", "onKeyDown", "e", "onKeyUp", "syncVideos", "updateMousePosition", "offset", "pos", "x", "y", "onMouseDown", "settings", "FluxDispatcher", "onMouseUp", "onWheel", "val", "waitFor", "elem", "ELEMENT_ID", "box", "VencordCreateElement", "styles_default", "init_styles", "__esmMin", "init_react", "settings", "imageContextMenuPatch", "imageZoom_default", "init_imageZoom", "__esmMin", "init_react", "init_ContextMenu", "init_Settings", "init_Styles", "init_components", "init_constants", "init_debounce", "init_types", "init_common", "init_Magnifier", "init_styles", "definePluginSettings", "makeRange", "children", "VencordCreateElement", "Menu", "ContextMenuApi", "props", "ref", "debounce", "value", "definePlugin", "Devs", "ELEMENT_ID", "Magnifier", "instance", "e", "ReactDOM", "state", "enableStyle", "styles_default", "addContextMenuPatch", "disableStyle", "removeContextMenuPatch", "DecModal", "props", "encryptedMessage", "password", "setPassword", "React", "VencordCreateElement", "ModalRoot", "ModalHeader", "Forms", "ModalContent", "TextInput", "ModalFooter", "Button", "toSend", "decrypt", "buildDecModal", "msg", "openModal", "init_DecryptionModal", "__esmMin", "init_react", "init_modal", "init_common", "init_invisibleChat", "EncModal", "props", "secret", "setSecret", "React", "cover", "setCover", "password", "setPassword", "noCover", "setNoCover", "isValid", "VencordCreateElement", "ModalRoot", "ModalHeader", "Forms", "ModalContent", "TextInput", "e", "Switch", "ModalFooter", "Button", "encrypted", "encrypt", "toSend", "insertTextIntoChatInputBox", "buildEncModal", "openModal", "init_EncryptionModal", "__esmMin", "init_react", "init_discord", "init_modal", "init_common", "init_invisibleChat", "PopOverIcon", "VencordCreateElement", "Indicator", "Tooltip", "onMouseEnter", "onMouseLeave", "ChatBarIcon", "chatBoxProps", "Button", "ButtonLooks", "ButtonWrapperClasses", "buildEncModal", "encrypt", "secret", "password", "cover", "steggo", "decrypt", "encrypted", "removeIndicator", "decrypted", "isCorrectPassword", "result", "iteratePasswords", "message", "passwords", "settings", "s", "content", "i", "invisibleChat_default", "init_invisibleChat", "__esmMin", "init_react", "init_MessagePopover", "init_Settings", "init_ErrorBoundary", "init_constants", "init_dependencies", "init_types", "init_common", "init_DecryptionModal", "init_EncryptionModal", "definePluginSettings", "definePlugin", "Devs", "StegCloak", "getStegCloak", "addButton", "ChannelStore", "res", "buildDecModal", "removeButton", "url", "body", "RestAPI", "revealed", "urlCheck", "embed", "FluxDispatcher", "ErrorBoundary_default", "attemptToNavigateToChannel", "guildId", "channelId", "ChannelStore", "NavigationRouter", "isSwitchingAccount", "previousCache", "keepCurrentChannel_default", "init_keepCurrentChannel", "__esmMin", "init_react", "init_DataStore", "init_constants", "init_types", "init_common", "definePlugin", "Devs", "set", "get", "SelectedGuildStore", "SelectedChannelStore", "getApplicationAsset", "key", "ApplicationAssetUtils", "applicationId", "setActivity", "activity", "FluxDispatcher", "placeholderId", "logger", "presenceStore", "settings", "lastfm_default", "init_lastfm", "__esmMin", "init_react", "init_Settings", "init_Link", "init_constants", "init_Logger", "init_types", "init_webpack", "init_common", "Logger", "findByPropsLazy", "definePluginSettings", "definePlugin", "Devs", "VencordCreateElement", "VencordFragment", "Forms", "Link", "params", "res", "json", "trackData", "x", "track", "largeImage", "assets", "buttons", "statusName", "v", "quotes", "settings", "loadingQuotes_default", "init_loadingQuotes", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "definePluginSettings", "definePlugin", "Devs", "quote", "key", "codes", "s", "MemberCount", "channelId", "guildId", "useStateFromStores", "SelectedChannelStore", "getCurrentChannel", "groups", "ChannelMemberStore", "total", "GuildMemberCountStore", "online", "count", "curr", "VencordCreateElement", "Flex", "Tooltip", "numberFormat", "props", "sharedIntlNumberFormat", "memberCount_default", "init_memberCount", "__esmMin", "init_react", "init_ErrorBoundary", "init_Flex", "init_constants", "init_discord", "init_types", "init_webpack", "init_common", "findStoreLazy", "value", "definePlugin", "Devs", "ErrorBoundary_default", "isDeletePressed", "keydown", "keyup", "settings", "messageClickActions_default", "init_messageClickActions", "__esmMin", "init_react", "init_MessageEvents", "init_Settings", "init_constants", "init_types", "init_webpack", "init_common", "definePluginSettings", "definePlugin", "Devs", "MessageActions", "findByPropsLazy", "EditStore", "addClickListener", "msg", "channel", "event", "isMe", "UserStore", "PermissionStore", "PermissionsBits", "FluxDispatcher", "Settings", "removeClickListener", "MessageAccessories_exports", "__export", "_modifyAccessories", "accessories", "addAccessory", "removeAccessory", "identifier", "callback", "position", "elements", "props", "accessory", "e", "init_MessageAccessories", "__esmMin", "init_react", "fetchMessage", "channelID", "messageID", "cached", "messageCache", "msg", "RestAPI", "message", "MessageStore", "getImages", "attachments", "content_type", "height", "width", "url", "proxy_url", "type", "image", "thumbnail", "tenorRegex", "noContent", "embeds", "requiresRichEmbed", "a", "e", "computeWidthAndHeight", "adjustedWidth", "adjustedHeight", "withEmbeddedBy", "embeddedBy", "_", "prop", "MessageEmbedAccessory", "accessories", "match", "messageLinkRegex", "guildID", "linkedChannel", "ChannelStore", "PermissionStore", "listMode", "idList", "settings", "isListed", "id", "linkedMessage", "messageFetchQueue", "m", "FluxDispatcher", "messageProps", "VencordCreateElement", "AutomodEmbedAccessory", "ChannelMessageEmbedAccessory", "VencordFragment", "channel", "isDM", "guild", "GuildStore", "dmReceiver", "UserStore", "Embed", "Text", "Parser", "classes", "SearchResultClasses", "ChannelMessage", "props", "compact", "TextAndImagesSettingsStores", "images", "parse", "AutoModEmbed", "messageLinkEmbeds_default", "init_messageLinkEmbeds", "__esmMin", "init_react", "init_MessageAccessories", "init_Settings", "init_ErrorBoundary", "init_constants", "init_misc", "init_Queue", "init_types", "init_webpack", "init_common", "findComponentByCodeLazy", "findByPropsLazy", "Queue", "definePluginSettings", "Button", "definePlugin", "Devs", "addAccessory", "ErrorBoundary_default", "deleteStyleOverlay_default", "init_deleteStyleOverlay", "__esmMin", "init_react", "deleteStyleText_default", "init_deleteStyleText", "__esmMin", "init_react", "addDeleteStyle", "Settings", "enableStyle", "deleteStyleText_default", "disableStyle", "deleteStyleOverlay_default", "styles", "REMOVE_HISTORY_ID", "TOGGLE_DELETE_STYLE_ID", "patchMessageContextMenu", "messageLogger_default", "init_messageLogger", "__esmMin", "init_react", "init_", "init_ContextMenu", "init_Settings", "init_Styles", "init_ErrorBoundary", "init_constants", "init_Logger", "init_types", "init_webpack", "init_common", "init_deleteStyleOverlay", "init_deleteStyleText", "findByPropsLazy", "children", "props", "message", "deleted", "editHistory", "id", "channel_id", "toggle", "domElement", "VencordCreateElement", "Menu", "FluxDispatcher", "definePlugin", "Devs", "addContextMenuPatch", "removeContextMenuPatch", "edit", "ErrorBoundary_default", "Parser", "Timestamp", "i18n", "newMessage", "oldMessage", "moment", "cache", "data", "isBulk", "mutate", "msg", "EPHEMERAL", "m", "a", "e", "Logger", "ignoreBots", "ignoreSelf", "ignoreUsers", "ignoreChannels", "ignoreGuilds", "myId", "UserStore", "ChannelStore", "createTagCommand", "tag", "registerCommand", "_", "ctx", "getTag", "Settings", "sendBotMessage", "EMOTE", "MessageTagsMarker", "DATA_KEY", "getTags", "addTag", "removeTag", "messageTags_default", "init_messageTags", "__esmMin", "init_react", "init_Commands", "init_DataStore", "init_Settings", "init_constants", "init_types", "get", "t", "name", "tt", "tags", "set", "definePlugin", "Devs", "args", "findOption", "message", "unregisterCommand", "mock", "input", "output", "i", "moreCommands_default", "init_moreCommands", "__esmMin", "init_react", "init_Commands", "init_constants", "init_types", "definePlugin", "Devs", "OptionalMessageOption", "opts", "ctx", "content", "findOption", "sendBotMessage", "RequiredMessageOption", "moreKaomoji_default", "init_moreKaomoji", "__esmMin", "init_react", "init_Commands", "init_constants", "init_types", "definePlugin", "Devs", "data", "OptionalMessageOption", "opts", "findOption", "SettingsComponent", "props", "settings", "defaultSettings", "tagSettings", "setTagSettings", "useState", "setValue", "v", "VencordCreateElement", "Flex", "tags", "t", "Card", "Forms", "Tooltip", "onMouseEnter", "onMouseLeave", "Tag", "TextInput", "Margins", "Switch", "PermissionUtil", "isWebhook", "moreUserTags_default", "init_moreUserTags", "__esmMin", "init_react", "init_Settings", "init_Flex", "init_constants", "init_margins", "init_types", "init_webpack", "init_common", "findByPropsLazy", "findLazy", "m", "message", "user", "_", "channel", "GuildStore", "name", "displayName", "definePluginSettings", "definePlugin", "Devs", "origSwitch", "variant", "displayedText", "strings", "newSettings", "value", "setting", "tag", "guild", "permissions", "PermissionsBits", "perm", "permInt", "obj", "i", "passedTagName", "tagName", "tagText", "channelId", "origType", "location", "type", "ChannelStore", "perms", "countOccurrences", "sourceString", "subString", "i", "lastIdx", "countMatches", "pattern", "getMoyaiCount", "message", "count", "MOYAI", "customMoyaiRe", "boom", "settings", "audioElement", "MOYAI_URL_HD", "MOYAI_URL", "moyai_default", "init_moyai", "__esmMin", "init_react", "init_Settings", "init_SettingSliderComponent", "init_constants", "init_misc", "init_types", "init_common", "definePluginSettings", "makeRange", "definePlugin", "Devs", "optimistic", "type", "channelId", "RelationshipStore", "SelectedChannelStore", "moyaiCount", "sleep", "userId", "messageAuthorId", "emoji", "UserStore", "name", "settings", "muteNewGuild_default", "init_muteNewGuild", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_webpack", "definePluginSettings", "definePlugin", "Devs", "m", "guildId", "lurker", "findByProps", "getGroupDMName", "channel", "UserStore", "isNonNullish", "c", "RelationshipStore", "UserUtils", "SelectedChannelActionCreators", "AvatarUtils", "ProfileListClasses", "GuildLabelClasses", "mutualGroupDMs_default", "init_mutualGroupDMs", "__esmMin", "init_react", "init_constants", "init_guards", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePlugin", "Devs", "user", "onClose", "entries", "ChannelStore", "VencordCreateElement", "Clickable", "Avatar", "ScrollerThin", "RelationshipStore", "noBlockedMessages_default", "init_noBlockedMessages", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_webpack", "findByPropsLazy", "definePlugin", "Devs", "find", "Settings", "_", "props", "message", "noDevtoolsWarning_default", "init_noDevtoolsWarning", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "noF1_default", "init_noF1", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "styles_default", "init_styles", "__esmMin", "init_react", "settings", "noMosaic_default", "init_noMosaic", "__esmMin", "init_react", "init_Settings", "init_Styles", "init_constants", "init_types", "init_styles", "definePluginSettings", "definePlugin", "Devs", "enableStyle", "styles_default", "disableStyle", "MessageRequestStore", "settings", "noPendingCount_default", "init_noPendingCount", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_webpack", "findByPropsLazy", "definePluginSettings", "definePlugin", "Devs", "noProfileThemes_default", "init_noProfileThemes", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "settings", "noReplyMention_default", "init_noReplyMention", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "definePluginSettings", "definePlugin", "Devs", "message", "isHoldingShift", "isListed", "isExempt", "noScreensharePreview_default", "init_noScreensharePreview", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "noTypingAnimation_default", "init_noTypingAnimation", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "noUnblockToJump_default", "init_noUnblockToJump", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "normalizeMessageLinks_default", "init_normalizeMessageLinks", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "host", "nsfwGateBypass_default", "init_nsfwGateBypass", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "settings", "onePingPerDM_default", "init_onePingPerDM", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_common", "definePluginSettings", "definePlugin", "Devs", "message", "channelType", "ChannelStore", "m", "UserStore", "ReadStateStore", "oneko_default", "init_oneko", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "x", "s", "ShortUrlMatcher", "SpotifyMatcher", "SteamMatcher", "EpicMatcher", "settings", "Native", "openInApp_default", "init_openInApp", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_common", "definePluginSettings", "definePlugin", "Devs", "data", "event", "url", "spotify", "match", "type", "id", "steam", "showToast", "Toasts", "epic", "platformType", "userId", "setPoggerState", "state", "FluxDispatcher", "setSettings", "intensity", "settings", "partyMode_default", "init_partyMode", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_common", "definePluginSettings", "definePlugin", "Devs", "settings", "permissionFreeWill_default", "init_permissionFreeWill", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "definePluginSettings", "definePlugin", "Devs", "formatPermissionWithoutMatchingString", "permission", "wordsToTitle", "getPermissionString", "PermissionKeyMap", "i18n", "getPermissionDescription", "msg", "Parser", "getSortedRoles", "roles", "id", "member", "a", "b", "sortUserRoles", "settings", "sortPermissionOverwrites", "overwrites", "guildId", "guild", "GuildStore", "roleA", "cl", "init_utils", "__esmMin", "init_react", "init_Styles", "init_text", "init_common", "init_permissionsViewer", "init_RolesAndUsersPermissions", "classNameFactory", "PermissionDeniedIcon", "VencordCreateElement", "PermissionAllowedIcon", "PermissionDefaultIcon", "init_icons", "__esmMin", "init_react", "openRolesAndUsersPermissionsModal", "permissions", "guild", "header", "openModal", "modalProps", "VencordCreateElement", "RolesAndUsersPermissions", "RolesAndUsersPermissionsComponent", "a", "b", "useStateFromStores", "GuildMemberStore", "old", "current", "useEffect", "usersToRequest", "p", "id", "FluxDispatcher", "selectedItemIndex", "selectItem", "useState", "selectedItem", "ModalRoot", "ModalHeader", "Text", "cl", "ModalCloseButton", "ModalContent", "permission", "index", "user", "UserStore", "role", "e", "settings", "ContextMenuApi", "RoleContextMenu", "getUniqueUsername", "Flex", "OwnerCrownIcon", "PermissionsBits", "permissionName", "bit", "overwriteAllow", "overwriteDeny", "PermissionAllowedIcon", "PermissionDeniedIcon", "PermissionDefaultIcon", "getPermissionString", "Tooltip", "getPermissionDescription", "props", "InfoIcon", "roleId", "onClose", "Menu", "RolesAndUsersPermissions_default", "init_RolesAndUsersPermissions", "__esmMin", "init_react", "init_ErrorBoundary", "init_Flex", "init_Icons", "init_discord", "init_modal", "init_common", "init_permissionsViewer", "init_utils", "init_icons", "ErrorBoundary_default", "ExpandableHeader", "children", "onMoreClick", "buttons", "moreTooltipText", "defaultState", "onDropDownClick", "headerText", "showContent", "setShowContent", "useState", "VencordCreateElement", "VencordFragment", "Text", "cl", "Tooltip", "tooltipProps", "v", "init_ExpandableHeader", "__esmMin", "init_react", "init_Styles", "init_common", "init_", "classNameFactory", "UserPermissionsComponent", "guild", "guildMember", "showBorder", "stns", "settings", "rolePermissions", "userPermissions", "useMemo", "userRoles", "getSortedRoles", "role", "PermissionsBits", "prev", "curr", "OWNER", "i18n", "sortUserRoles", "permission", "bit", "permissions", "colorString", "position", "getPermissionString", "a", "b", "root", "roleRemoveButton", "roleNameOverflow", "roles", "rolePill", "rolePillBorder", "roleCircle", "roleName", "Classes", "VencordCreateElement", "ExpandableHeader", "RolesAndUsersPermissions_default", "UserStore", "Tooltip", "tooltipProps", "cl", "classes", "roleColor", "Text", "UserPermissions_default", "init_UserPermissions", "__esmMin", "init_react", "init_ErrorBoundary", "init_ExpandableHeader", "init_lazy", "init_misc", "init_webpack", "init_common", "init_permissionsViewer", "init_utils", "init_RolesAndUsersPermissions", "proxyLazy", "modules", "findBulk", "filters", "ErrorBoundary_default", "MenuItem", "guildId", "id", "type", "GuildMemberStore", "VencordCreateElement", "Menu", "guild", "GuildStore", "permissions", "header", "member", "getSortedRoles", "role", "PermissionsBits", "prev", "curr", "UserStore", "channel", "ChannelStore", "sortPermissionOverwrites", "allow", "deny", "RolesAndUsersPermissions_default", "makeContextMenuPatch", "childId", "children", "props", "group", "findGroupChildrenByChildId", "item", "settings", "permissionsViewer_default", "init_permissionsViewer", "__esmMin", "init_react", "init_", "init_ContextMenu", "init_Settings", "init_constants", "init_types", "init_common", "init_RolesAndUsersPermissions", "init_UserPermissions", "init_utils", "definePluginSettings", "definePlugin", "Devs", "m", "showBoder", "guildMember", "UserPermissions_default", "addContextMenuPatch", "removeContextMenuPatch", "loadImage", "source", "isFile", "url", "resolve", "reject", "img", "event", "_source", "_lineno", "_colno", "err", "resolveImage", "options", "ctx", "noServerPfp", "opt", "upload", "UploadStore", "DRAFT_TYPE", "UserUtils", "import_gifenc", "DEFAULT_DELAY", "DEFAULT_RESOLUTION", "FRAMES", "getFrames", "petpet_default", "init_petpet", "__esmMin", "init_react", "init_Commands", "init_constants", "init_lazy", "init_types", "init_webpack", "init_common", "makeLazy", "_", "i", "findByPropsLazy", "definePlugin", "Devs", "opts", "cmdCtx", "frames", "findOption", "sendBotMessage", "avatar", "delay", "resolution", "gif", "canvas", "j", "width", "height", "offsetX", "offsetY", "data", "palette", "index", "file", "UploadHandler", "settings", "pictureInPicture_default", "init_pictureInPicture", "__esmMin", "init_react", "init_", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_common", "definePluginSettings", "definePlugin", "Devs", "ErrorBoundary_default", "VencordCreateElement", "Tooltip", "tooltipProps", "e", "video", "videoClone", "launchPiP", "usePinnedDms", "useSettings", "requireSnapshot", "isPinned", "id", "togglePin", "snapshot", "save", "sortedSnapshot", "settings", "PrivateChannelSortStore", "snapshotArray", "getPinAt", "idx", "movePin", "direction", "pins", "getArray", "a", "b", "takeSnapshot", "init_settings", "__esmMin", "init_react", "init_Settings", "init_types", "init_webpack", "definePluginSettings", "findStoreLazy", "Settings", "PinMenuItem", "channelId", "pinned", "isPinned", "canMove", "settings", "VencordCreateElement", "VencordFragment", "Menu", "togglePin", "snapshotArray", "movePin", "addContextMenus", "addContextMenuPatch", "GroupDMContext", "UserContext", "removeContextMenus", "removeContextMenuPatch", "init_contextMenus", "__esmMin", "init_react", "init_ContextMenu", "init_common", "init_settings", "children", "props", "container", "findGroupChildrenByChildId", "idx", "c", "pinDms_default", "init_pinDms", "__esmMin", "init_react", "init_constants", "init_types", "init_contextMenus", "init_settings", "definePlugin", "Devs", "settings", "addContextMenus", "removeContextMenus", "channelIds", "pinnedDms", "usePinnedDms", "channels", "idx", "getPinAt", "isPinned", "sortedSnapshot", "channelId", "rowHeight", "padding", "preRenderedChildren", "originalOffset", "snapshotArray", "plainFolderIcon_default", "init_plainFolderIcon", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "MemberListDecorators_exports", "__export", "__getDecorators", "addDecorator", "decorators", "removeDecorator", "identifier", "decorator", "onlyIn", "props", "isInGuild", "decoratorObj", "init_MemberListDecorators", "__esmMin", "init_react", "MessageDecorations_exports", "__export", "__addDecorationsToMessage", "addDecoration", "decorations", "removeDecoration", "identifier", "decoration", "props", "init_MessageDecorations", "__esmMin", "init_react", "Icon", "path", "opts", "color", "tooltip", "small", "VencordCreateElement", "Tooltip", "tooltipProps", "SessionsStore", "Icons", "StatusUtils", "PlatformIcon", "getStatus", "PlatformIndicator", "badge", "indicatorLocations", "platformIndicators_default", "init_platformIndicators", "__esmMin", "init_react", "init_Badges", "init_MemberListDecorators", "init_MessageDecorations", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_webpack", "init_common", "findStoreLazy", "findByPropsLazy", "platform", "status", "id", "PresenceStore", "user", "wantMargin", "wantTopMargin", "UserStore", "sessions", "sortedSessions", "a", "b", "ownStatus", "acc", "curr", "clientStatuses", "icons", "p", "userInfo", "addDecorator", "props", "ErrorBoundary_default", "removeDecorator", "addBadge", "removeBadge", "addDecoration", "removeDecoration", "definePlugin", "Devs", "settings", "Settings", "displayMode", "key", "value", "_", "userStatus", "isMobile", "PreviewButton", "chatBoxProps", "isEmpty", "attachments", "channelId", "SelectedChannelStore", "draft", "useStateFromStores", "DraftStore", "getDraft", "hasAttachments", "UploadStore", "VencordCreateElement", "Tooltip", "tooltipProps", "Button", "sendBotMessage", "UserStore", "getAttachments", "ButtonLooks", "ButtonWrapperClasses", "getImageBox", "previewMessage_default", "init_previewMessage", "__esmMin", "init_react", "init_Commands", "init_ErrorBoundary", "init_constants", "init_types", "init_webpack", "init_common", "findByPropsLazy", "url", "res", "img", "upload", "isImage", "filename", "spoiler", "file", "attachment", "generateId", "box", "definePlugin", "Devs", "ErrorBoundary_default", "PronounsAboutComponent", "VencordCreateElement", "React", "Forms", "Link", "init_PronounsAboutComponent", "__esmMin", "init_react", "init_Link", "init_common", "settings", "init_settings", "__esmMin", "init_react", "init_Settings", "init_types", "init_pronoundbUtils", "definePluginSettings", "PronounMapping", "init_types", "__esmMin", "init_react", "getDiscordPronouns", "id", "useGlobalProfile", "globalPronouns", "UserProfileStore", "getCurrentChannel", "useFormattedPronouns", "discordPronouns", "NewLineRe", "result", "useAwaiter", "fetchPronouns", "getCachedPronouns", "e", "settings", "formatPronouns", "useProfilePronouns", "pronouns", "UserStore", "EmptyPronouns", "cached", "cache", "res", "requestQueue", "bulkFetch", "bulkFetchPronouns", "ids", "params", "VENCORD_USER_AGENT", "dummyPronouns", "pronounsFormat", "Settings", "PronounMapping", "init_pronoundbUtils", "__esmMin", "init_react", "init_Settings", "init_constants", "init_debounce", "init_discord", "init_common", "init_settings", "init_types", "debounce", "c", "shouldShow", "message", "settings", "AUTO_MODERATION_ACTION", "UserStore", "PronounsChatComponent", "result", "useFormattedPronouns", "VencordCreateElement", "classes", "styles", "PronounsChatComponentWrapper", "CompactPronounsChatComponentWrapper", "CompactPronounsChatComponent", "init_PronounsChatComponent", "__esmMin", "init_react", "init_ErrorBoundary", "init_misc", "init_webpack", "init_common", "init_pronoundbUtils", "init_settings", "findByPropsLazy", "ErrorBoundary_default", "PRONOUN_TOOLTIP_PATCH", "pronoundb_default", "init_pronoundb", "__esmMin", "init_react", "init_", "init_constants", "init_types", "init_PronounsAboutComponent", "init_PronounsChatComponent", "init_pronoundbUtils", "init_settings", "definePlugin", "Devs", "settings", "PronounsAboutComponent", "PronounsChatComponentWrapper", "CompactPronounsChatComponentWrapper", "useProfilePronouns", "quickMention_default", "init_quickMention", "__esmMin", "init_react", "init_MessagePopover", "init_constants", "init_discord", "init_types", "init_common", "definePlugin", "Devs", "addButton", "msg", "channel", "ChannelStore", "PermissionStore", "PermissionsBits", "insertTextIntoChatInputBox", "removeButton", "VencordCreateElement", "calculateIdx", "messages", "id", "idx", "m", "onStartEdit", "channelId", "messageId", "_isQuickEdit", "meId", "UserStore", "MessageStore", "editIdx", "onCreatePendingReply", "message", "_isQuickReply", "replyIdx", "onKeydown", "isUp", "isCtrl", "isAltOrMeta", "nextEdit", "nextReply", "jumpIfOffScreen", "element", "vh", "rect", "Kangaroo", "getNextMessage", "isReply", "SelectedChannelStore", "mutate", "i", "findNextNonDeleted", "shouldMention", "enabled", "userList", "shouldPingListed", "Settings", "shouldPing", "settings", "currChannel", "ChannelStore", "PermissionStore", "PermissionsBits", "FluxDispatcher", "channel", "isMac", "quickReply_default", "onDeletePendingReply", "onEndEdit", "init_quickReply", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePluginSettings", "definePlugin", "Devs", "ERROR_CODES", "CODES_URL", "reactErrorDecoder_default", "init_reactErrorDecoder", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "_", "func", "original", "res", "code", "args", "index", "arg", "ServerList_exports", "__export", "ServerListRenderPosition", "addServerListElement", "removeServerListElement", "renderAll", "getRenderFunctions", "position", "renderFunctionsAbove", "renderFunctionsIn", "renderFunction", "logger", "init_ServerList", "__esmMin", "init_react", "init_Logger", "Logger", "ret", "e", "onClick", "channels", "GuildStore", "guild", "GuildChannelStore", "c", "ReadStateStore", "FluxDispatcher", "ReadAllButton", "readAllNotificationsButton_default", "init_readAllNotificationsButton", "__esmMin", "init_react", "init_ServerList", "init_constants", "init_types", "init_common", "VencordCreateElement", "Button", "definePlugin", "Devs", "addServerListElement", "removeServerListElement", "settings_default", "init_settings", "__esmMin", "init_react", "init_Settings", "init_types", "definePluginSettings", "init_types", "__esmMin", "init_react", "runMigrations", "DataStore", "syncAndRunChecks", "oldGuilds", "oldGroups", "oldFriends", "guildsKey", "groupsKey", "friendsKey", "syncGuilds", "syncGroups", "syncFriends", "settings_default", "id", "group", "groups", "notify", "guild", "guilds", "friends", "user", "UserUtils", "getUniqueUsername", "openUserProfile", "RelationshipStore", "text", "icon", "onClick", "Notices", "showNotification", "getGuild", "deleteGuild", "me", "UserStore", "name", "GuildStore", "GuildMemberStore", "getGroup", "deleteGroup", "type", "rawRecipients", "ChannelStore", "r", "relationShips", "init_utils", "__esmMin", "init_react", "init_api", "init_Notifications", "init_discord", "init_common", "init_settings", "init_types", "onRelationshipRemove", "type", "id", "manuallyRemovedFriend", "user", "UserUtils", "settings_default", "notify", "getUniqueUsername", "openUserProfile", "onGuildDelete", "unavailable", "manuallyRemovedGuild", "deleteGuild", "guild", "getGuild", "onChannelDelete", "manuallyRemovedGroup", "deleteGroup", "group", "getGroup", "removeFriend", "removeGuild", "removeGroup", "init_functions", "__esmMin", "init_react", "init_discord", "init_common", "init_settings", "init_types", "init_utils", "relationshipNotifier_default", "init_relationshipNotifier", "__esmMin", "init_react", "init_constants", "init_types", "init_functions", "init_settings", "init_utils", "definePlugin", "Devs", "settings_default", "syncGuilds", "onGuildDelete", "syncGroups", "onChannelDelete", "syncFriends", "onRelationshipRemove", "syncAndRunChecks", "removeFriend", "removeGroup", "removeGuild", "SpoilerClasses", "MessagesClasses", "revealAllSpoilers_default", "init_revealAllSpoilers", "__esmMin", "init_react", "init_constants", "init_types", "init_webpack", "findByPropsLazy", "definePlugin", "Devs", "_", "event", "ctrlKey", "shiftKey", "target", "spoilerContent", "hidden", "messagesWrapper", "parent", "spoiler", "search", "src", "engine", "Engines", "imageContextMenuPatch", "reverseImageSearch_default", "init_reverseImageSearch", "__esmMin", "init_react", "init_ContextMenu", "init_Flex", "init_Icons", "init_constants", "init_types", "init_common", "children", "props", "reverseImageSearchType", "itemHref", "itemSrc", "group", "findGroupChildrenByChildId", "VencordCreateElement", "Menu", "i", "key", "Flex", "OpenExternalIcon", "e", "definePlugin", "Devs", "m", "target", "addContextMenuPatch", "removeContextMenuPatch", "settings", "roleColorEverywhere_default", "init_roleColorEverywhere", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_common", "definePluginSettings", "definePlugin", "Devs", "userId", "channelId", "guildId", "ChannelStore", "GuildMemberStore", "ids", "colorString", "id", "count", "title", "label", "role", "GuildStore", "VencordCreateElement", "messageUtils", "messageContextMenuPatch", "searchReply_default", "init_searchReply", "__esmMin", "init_react", "init_ContextMenu", "init_Icons", "init_constants", "init_types", "init_webpack", "init_common", "findByPropsLazy", "children", "message", "SelectedChannelStore", "channel", "ChannelStore", "PermissionStore", "PermissionsBits", "dmGroup", "findGroupChildrenByChildId", "child", "pinIndex", "c", "VencordCreateElement", "Menu", "i18n", "ReplyIcon", "e", "serverGroup", "definePlugin", "Devs", "addContextMenuPatch", "removeContextMenuPatch", "secretRingTone_default", "init_secretRingTone", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "parseTime", "time", "cleanTime", "ms", "PickerModal", "rootProps", "close", "value", "setValue", "useState", "format", "setFormat", "formatTimestamp", "formatted", "rendered", "useMemo", "Parser", "VencordCreateElement", "ModalRoot", "ModalHeader", "cl", "Forms", "ModalCloseButton", "ModalContent", "e", "getTheme", "Select", "Formats", "v", "o", "Margins", "ModalFooter", "Button", "insertTextIntoChatInputBox", "sendTimestamps_default", "init_sendTimestamps", "__esmMin", "init_react", "init_", "init_MessageEvents", "init_Styles", "init_constants", "init_discord", "init_margins", "init_modal", "init_types", "init_common", "classNameFactory", "definePlugin", "Devs", "addPreSendListener", "_", "msg", "removePreSendListener", "chatBoxProps", "Tooltip", "onMouseEnter", "onMouseLeave", "ButtonLooks", "ButtonWrapperClasses", "key", "openModal", "props", "closeModal", "samples", "s", "VencordFragment", "FriendsIndicator", "forceUpdateFriendCount", "useForceUpdater", "VencordCreateElement", "onlineFriends", "ServersIndicator", "forceUpdateGuildCount", "guildCount", "handlePresenceUpdate", "relations", "RelationshipStore", "id", "PresenceStore", "handleGuildUpdate", "GuildStore", "serverListIndicators_default", "init_serverListIndicators", "__esmMin", "init_react", "init_ServerList", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_common", "definePlugin", "Devs", "mode", "Settings", "ErrorBoundary_default", "addServerListElement", "removeServerListElement", "openGuildProfileModal", "guild", "openModal", "props", "VencordCreateElement", "ModalRoot", "GuildProfileModal", "renderTimestamp", "timestamp", "Timestamp", "moment", "friendCount", "setFriendCount", "useState", "blockedCount", "setBlockedCount", "useEffect", "fetched", "currentTab", "setCurrentTab", "bannerUrl", "IconUtils", "iconUrl", "cl", "openImageModal", "classes", "IconClasses", "Forms", "TabBar", "ServerInfoTab", "FriendsTab", "BlockedUsersTab", "Owner", "guildId", "owner", "guildAvatar", "GuildMemberStore", "ownerAvatarUrl", "Parser", "useAwaiter", "UserUtils", "Fields", "SnowflakeUtils", "GuildChannelStore", "name", "node", "setCount", "UserList", "RelationshipStore", "blockedIds", "id", "type", "ids", "missing", "members", "useStateFromStores", "old", "curr", "FluxDispatcher", "ScrollerThin", "FriendRow", "UserStore", "PresenceStore", "openUserProfile", "init_GuildProfileModal", "__esmMin", "init_react", "init_", "init_Styles", "init_discord", "init_misc", "init_modal", "init_webpack", "init_common", "findByPropsLazy", "findExportedComponentLazy", "classNameFactory", "Patch", "serverProfile_default", "init_serverProfile", "__esmMin", "init_react", "init_ContextMenu", "init_constants", "init_types", "init_common", "init_GuildProfileModal", "children", "guild", "findGroupChildrenByChildId", "VencordCreateElement", "Menu", "openGuildProfileModal", "definePlugin", "Devs", "addContextMenuPatch", "removeContextMenuPatch", "previewExample_default", "init_previewExample", "__esmMin", "init_react", "require_eventemitter3", "__commonJSMin", "exports", "module", "init_react", "has", "prefix", "Events", "EE", "fn", "context", "once", "addListener", "emitter", "event", "listener", "evt", "clearEvent", "EventEmitter", "names", "events", "name", "handlers", "l", "ee", "listeners", "a1", "a2", "a3", "a4", "a5", "len", "args", "i", "length", "j", "require_channel", "__commonJSMin", "exports", "init_react", "eventemitter3_1", "ipcPrefix", "kEdgeCreate", "ChannelPort", "sourceName", "event", "data", "pipeName", "listenerMap", "listener", "name", "existingPipe", "pipe", "fn", "Channel", "id", "edge", "message", "logger", "prevEdge", "newEdgeIds", "edgeId", "edgeIds", "callback", "caller", "error", "index", "arr", "destinaton", "destination", "resolve", "checkEdge", "messageData", "opts", "nonce", "promise", "reject", "timeout", "require_rpc", "__commonJSMin", "exports", "init_react", "RemoteHost", "channel", "spec", "name", "fn", "input", "RemoteClient", "hostName", "output", "require_worker", "__commonJSMin", "exports", "init_react", "channel_1", "rpc_1", "createWorkerHost", "name", "spec", "channel", "event", "data", "callback", "WorkerClient", "hostName", "source", "workerOpts", "blob", "worker", "listener", "ev", "evName", "require_ipc", "__commonJSMin", "exports", "init_react", "__createBinding", "o", "m", "k", "k2", "desc", "__exportStar", "p", "dispatchTheme", "state", "currentTheme", "themeSetters", "setTheme", "useTheme", "init_useTheme", "__esmMin", "init_react", "init_common", "React", "resolveLang", "idOrAlias", "languages", "lang", "aliasCache", "VPC_REPO", "VPC_REPO_COMMIT", "vpcRepoAssets", "vpcRepoGrammar", "vpcRepoLanguages", "loadLanguages", "getGrammar", "init_languages", "__esmMin", "init_react", "fileName", "langsJson", "res", "loadedLanguages", "SHIKI_REPO", "SHIKI_REPO_COMMIT", "shikiRepoTheme", "themes", "init_themes", "__esmMin", "init_react", "name", "import_ipc", "themeUrls", "resolveClient", "shiki", "init_shiki", "__esmMin", "init_react", "init_dependencies", "init_useTheme", "init_languages", "init_themes", "themes", "languages", "resolve", "initThemeUrl", "workerBlob", "shikiWorkerSrc", "res", "client", "themeUrl", "loadLanguages", "shikiOnigasmSrc", "themeData", "dispatchTheme", "langId", "lang", "resolveLang", "getGrammar", "code", "devicon_default", "init_devicon", "__esmMin", "init_react", "init_types", "__esmMin", "init_react", "themeNames", "settings", "init_settings", "__esmMin", "init_react", "init_Settings", "init_Styles", "init_misc", "init_text", "init_types", "init_shiki", "init_themes", "init_devicon", "themes", "definePluginSettings", "themeName", "wordsToTitle", "wordsFromPascal", "shiki", "value", "newValue", "disableStyle", "devicon_default", "enableStyle", "url", "parseUrl", "useShikiSettings", "settingKeys", "overrides", "settings", "isLoading", "setLoading", "React", "withOverrides", "themeUrl", "willChangeTheme", "shiki", "noOverrides", "init_useShikiSettings", "__esmMin", "init_react", "init_common", "init_shiki", "init_settings", "hex2Rgb", "hex", "c", "init_color", "__esmMin", "init_react", "cl", "shouldUseHljs", "init_misc", "__esmMin", "init_react", "init_Styles", "init_common", "init_languages", "init_types", "classNameFactory", "lang", "tryHljs", "hljsLang", "hljs", "langName", "resolveLang", "useCopyCooldown", "cooldown", "copyCooldown", "setCopyCooldown", "React", "copy", "text", "Clipboard", "init_useCopyCooldown", "__esmMin", "init_react", "init_common", "CopyButton", "content", "props", "copyCooldown", "copy", "useCopyCooldown", "VencordCreateElement", "init_CopyButton", "__esmMin", "init_react", "init_useCopyCooldown", "ButtonRow", "content", "theme", "buttons", "Clipboard", "VencordCreateElement", "CopyButton", "cl", "init_ButtonRow", "__esmMin", "init_react", "init_common", "init_misc", "init_CopyButton", "Code", "init_Code", "__esmMin", "init_react", "init_common", "init_misc", "theme", "useHljs", "lang", "content", "tokens", "lines", "hljsHtml", "hljs", "line", "i", "VencordCreateElement", "VencordFragment", "color", "fontStyle", "codeTableRows", "cl", "Header", "langName", "useDevIcon", "shikiLang", "VencordCreateElement", "cl", "VencordFragment", "init_Header", "__esmMin", "init_react", "init_types", "init_misc", "createHighlighter", "Highlighter", "init_Highlighter", "__esmMin", "init_react", "init_ErrorBoundary", "init_common", "init_languages", "init_shiki", "init_useShikiSettings", "init_useTheme", "init_color", "init_misc", "init_ButtonRow", "init_Code", "init_Header", "props", "VencordCreateElement", "cl", "ErrorBoundary_default", "lang", "content", "isPreview", "tempSettings", "tryHljs", "useDevIcon", "bgOpacity", "useShikiSettings", "currentThemeId", "currentTheme", "useTheme", "shikiLang", "resolveLang", "useHljs", "shouldUseHljs", "rootRef", "isIntersecting", "useIntersection", "tokens", "useAwaiter", "shiki", "themeBase", "langName", "hljs", "hex2Rgb", "Header", "Code", "ButtonRow", "styles", "clearStyles", "init_createStyle", "__esmMin", "init_react", "style", "shikiCodeblocks_default", "init_shikiCodeblocks", "__esmMin", "init_react", "init_", "init_Styles", "init_constants", "init_types", "init_previewExample", "init_shiki", "init_Highlighter", "init_devicon", "init_settings", "init_createStyle", "definePlugin", "Devs", "settings", "enableStyle", "devicon_default", "shiki", "clearStyles", "tempSettings", "createHighlighter", "previewExample_default", "lang", "content", "showAllMessageButtons_default", "init_showAllMessageButtons", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "VerifiedIcon", "color", "useToken", "ColorMap", "forcedIconColor", "VencordCreateElement", "VerifiedIconComponent", "i18n", "init_VerifiedIcon", "__esmMin", "init_react", "init_webpack", "init_common", "findLazy", "m", "findComponentByCodeLazy", "ConnectionsComponent", "id", "theme", "profile", "UserProfileStore", "connections", "VencordCreateElement", "Section", "Text", "Flex", "getSpacingPx", "settings", "connection", "CompactConnectionComponent", "platform", "platforms", "url", "img", "TooltipIcon", "LinkIcon", "CopyIcon", "Tooltip", "VerifiedIcon", "tooltipProps", "e", "copyWithToast", "ThemeStore", "getTheme", "profilePopoutComponent", "profilePanelComponent", "showConnections_default", "init_showConnections", "__esmMin", "init_react", "init_", "init_Settings", "init_ErrorBoundary", "init_Flex", "init_Icons", "init_constants", "init_misc", "init_types", "init_webpack", "init_common", "init_VerifiedIcon", "findComponentByCodeLazy", "findStoreLazy", "findByPropsLazy", "findByCodeLazy", "spacing", "definePluginSettings", "ErrorBoundary_default", "user", "displayProfile", "definePlugin", "Devs", "HiddenChannelLockScreen", "channel", "viewAllowedUsersAndRoles", "setViewAllowedUsersAndRoles", "useState", "settings", "permissions", "setPermissions", "type", "topic", "lastMessageId", "defaultForumLayout", "lastPinTimestamp", "defaultAutoArchiveDuration", "availableTags", "channelId", "rateLimitPerUser", "defaultThreadRateLimitPerUser", "defaultSortOrder", "defaultReactionEmoji", "bitrate", "rtcRegion", "videoQualityMode", "permissionOverwrites", "guild_id", "useEffect", "membersToFetch", "guildOwnerId", "GuildStore", "GuildMemberStore", "userId", "FluxDispatcher", "Settings", "sortPermissionOverwrites", "overwrite", "VencordCreateElement", "ChatScrollClasses", "ChatClasses", "HiddenChannelLogo", "Text", "PermissionStore", "PermissionsBits", "ChannelTypesToChannelNames", "Tooltip", "onMouseLeave", "onMouseEnter", "Parser", "Timestamp", "moment", "SnowflakeUtils", "formatDuration", "VideoQualityModesToNames", "ForumLayoutTypesToNames", "SortOrderTypesToNames", "EmojiParser", "EmojiStore", "EmojiUtils", "tag", "TagComponent", "RolesAndUsersPermissions_default", "v", "ChannelBeginHeader", "HiddenChannelLockScreen_default", "init_HiddenChannelLockScreen", "__esmMin", "init_react", "init_Settings", "init_ErrorBoundary", "init_text", "init_webpack", "init_common", "init_RolesAndUsersPermissions", "init_utils", "init_showHiddenChannels", "findByPropsLazy", "findComponentByCodeLazy", "findComponentLazy", "m", "code", "ErrorBoundary_default", "ChannelListClasses", "settings", "showHiddenChannels_default", "init_showHiddenChannels", "__esmMin", "init_react", "init_", "init_Settings", "init_ErrorBoundary", "init_constants", "init_patches", "init_types", "init_webpack", "init_common", "init_HiddenChannelLockScreen", "findByPropsLazy", "definePluginSettings", "definePlugin", "Devs", "_", "rest", "defaultRenderLevel", "channel", "m", "func", "muted", "otherClasses", "isMuted", "mutedClassExpression", "unread", "pushNotificationButtonExpression", "isLurking", "channelId", "permCheck", "PermissionsBits", "component", "canonicalizeMatch", "props", "amount", "inCall", "channels", "checkConnect", "ChannelStore", "PermissionStore", "shouldIncludeHidden", "res", "key", "maybeObjChannels", "objChannel", "guildId", "prev", "index", "originalArray", "everyoneRole", "role", "VencordCreateElement", "HiddenChannelLockScreen_default", "ErrorBoundary_default", "Tooltip", "onMouseLeave", "onMouseEnter", "settings", "showMeYourName_default", "init_showMeYourName", "__esmMin", "init_react", "init_", "init_Settings", "init_constants", "init_types", "definePluginSettings", "definePlugin", "Devs", "author", "message", "isRepliedMessage", "withMentionPrefix", "userOverride", "user", "username", "nick", "prefix", "VencordCreateElement", "VencordFragment", "showTimeouts_default", "init_showTimeouts", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "SilentMessageToggle", "chatBoxProps", "enabled", "setEnabled", "React", "lastState", "setEnabledValue", "value", "settings", "listener", "_", "message", "addPreSendListener", "removePreSendListener", "VencordCreateElement", "Tooltip", "tooltipProps", "Button", "ButtonLooks", "ButtonWrapperClasses", "silentMessageToggle_default", "init_silentMessageToggle", "__esmMin", "init_react", "init_MessageEvents", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_common", "definePluginSettings", "newValue", "definePlugin", "Devs", "ErrorBoundary_default", "SilentTypingToggle", "chatBoxProps", "isEnabled", "settings", "toggle", "VencordCreateElement", "Tooltip", "tooltipProps", "Button", "ButtonLooks", "ButtonWrapperClasses", "silentTyping_default", "init_silentTyping", "__esmMin", "init_react", "init_Commands", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_common", "definePluginSettings", "definePlugin", "Devs", "args", "ctx", "findOption", "sendBotMessage", "channelId", "FluxDispatcher", "ErrorBoundary_default", "sortFriendRequests_default", "init_sortFriendRequests", "__esmMin", "init_react", "init_Flex", "init_constants", "init_types", "init_common", "init_Vencord", "definePlugin", "Devs", "Settings", "_", "pre", "user", "subtext", "post", "row", "RelationshipStore", "text", "since", "VencordCreateElement", "Flex", "hoverOnly_default", "init_hoverOnly", "__esmMin", "init_react", "SpotifyStore", "init_SpotifyStore", "__esmMin", "init_react", "init_Settings", "init_lazy", "init_webpack", "init_common", "proxyLazy", "Store", "Flux", "SpotifySocket", "findByPropsLazy", "SpotifyUtils", "API_BASE", "path", "url", "Settings", "_", "idx", "pos", "p", "percent", "playing", "state", "ms", "e", "method", "route", "data", "socket", "store", "FluxDispatcher", "devices", "d", "msToHuman", "ms", "minutes", "m", "s", "Svg", "path", "label", "VencordCreateElement", "classes", "cl", "Button", "props", "CopyContextMenu", "name", "copyId", "openId", "Menu", "FluxDispatcher", "copyWithToast", "LinkIcon", "SpotifyStore", "OpenExternalIcon", "makeContextMenu", "e", "ContextMenuApi", "Controls", "isPlaying", "shuffle", "repeat", "useStateFromStores", "nextRepeat", "repeatClassName", "Flex", "Shuffle", "SkipPrev", "PauseButton", "PlayButton", "SkipNext", "Repeat", "SeekBar", "duration", "storePosition", "isSettingPosition", "position", "setPosition", "useState", "useEffect", "interval", "p", "Forms", "v", "seek", "AlbumContextMenu", "track", "volume", "openImageModal", "ImageIcon", "ref", "debounce", "makeLinkProps", "condition", "Info", "img", "coverExpanded", "setCoverExpanded", "VencordFragment", "a", "i", "React", "Player", "prev", "next", "device", "shouldHide", "setShouldHide", "timeout", "ErrorBoundary_default", "init_PlayerComponent", "__esmMin", "init_react", "init_", "init_ErrorBoundary", "init_Flex", "init_Icons", "init_debounce", "init_discord", "init_misc", "init_common", "init_SpotifyStore", "className", "toggleHoverControls", "value", "enableStyle", "disableStyle", "hoverOnly_default", "spotifyControls_default", "init_spotifyControls", "__esmMin", "init_react", "init_Settings", "init_Styles", "init_constants", "init_types", "init_hoverOnly", "init_PlayerComponent", "definePlugin", "Devs", "v", "Settings", "VencordCreateElement", "Player", "settings", "spotifyCrack_default", "init_spotifyCrack", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "definePluginSettings", "definePlugin", "Devs", "m", "req", "sendMessage", "channelId", "message", "reply", "PendingReplyStore", "MessageCreator", "FluxDispatcher", "Spotify", "spotifyShareCommands_default", "init_spotifyShareCommands", "__esmMin", "init_react", "init_Commands", "init_constants", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePlugin", "Devs", "_", "ctx", "track", "sendBotMessage", "StartupTimingPage_exports", "__export", "StartupTimingPage_default", "TimerItem", "emoji", "prefix", "log", "delta", "instance", "VencordCreateElement", "React", "TimingSection", "title", "logs", "traceEnd", "startTime", "lastTimestamp", "timings", "timestamp", "sinceStart", "sinceLast", "Forms", "AppStartPerformance", "i", "ServerTrace", "trace", "lines", "Flex", "line", "StartupTimingPage", "serverTrace", "g", "init_StartupTimingPage", "__esmMin", "init_react", "init_ErrorBoundary", "init_Flex", "init_webpack", "init_common", "findByPropsLazy", "ErrorBoundary_default", "startupTimings_default", "init_startupTimings", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "LazyComponent", "settings", "superReactionTweaks_default", "init_superReactionTweaks", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "definePluginSettings", "definePlugin", "Devs", "playingCount", "stringToRegex", "str", "match", "char", "pos", "flagArr", "renderFindError", "find", "e", "VencordCreateElement", "Input", "initialValue", "onChange", "placeholder", "value", "setValue", "useState", "TextInput", "TextReplace", "title", "rulesArray", "rulesKey", "update", "isRegexRules", "onClickRemove", "index", "DataStore", "key", "makeEmptyRule", "VencordFragment", "Forms", "Flex", "rule", "React", "Button", "DeleteIcon", "TextReplaceTesting", "applyRules", "content", "stringRules", "regexRules", "regex", "Logger", "STRING_RULES_KEY", "REGEX_RULES_KEY", "makeEmptyRuleArray", "settings", "TEXT_REPLACE_RULES_CHANNEL_ID", "textReplace_default", "init_textReplace", "__esmMin", "init_react", "init_api", "init_MessageEvents", "init_Settings", "init_Flex", "init_Icons", "init_constants", "init_Logger", "init_types", "init_common", "definePluginSettings", "useForceUpdater", "definePlugin", "Devs", "addPreSendListener", "channelId", "msg", "removePreSendListener", "themeAttributes_default", "init_themeAttributes", "__esmMin", "init_react", "init_constants", "init_types", "init_common", "definePlugin", "Devs", "props", "authorId", "UserStore", "timeBarAllActivities_default", "init_timeBarAllActivities", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "settings", "init_settings", "__esmMin", "init_react", "init_Settings", "init_types", "definePluginSettings", "Languages", "init_languages", "__esmMin", "init_react", "translate", "kind", "text", "sourceLang", "settings", "targetLang", "url", "res", "src", "sentences", "s", "cl", "init_utils", "__esmMin", "init_react", "init_Styles", "init_settings", "classNameFactory", "LanguageSelect", "settingsKey", "includeAuto", "currentValue", "settings", "options", "useMemo", "Languages", "value", "label", "VencordCreateElement", "Margins", "Forms", "SearchableSelect", "o", "v", "AutoTranslateToggle", "Switch", "TranslateModal", "rootProps", "ModalRoot", "ModalHeader", "cl", "ModalCloseButton", "ModalContent", "LanguageSettingKeys", "s", "init_TranslateModal", "__esmMin", "init_react", "init_margins", "init_modal", "init_common", "init_languages", "init_settings", "init_utils", "TranslateIcon", "height", "width", "className", "VencordCreateElement", "classes", "cl", "TranslateChatBarIcon", "slateProps", "autoTranslate", "settings", "toggle", "Tooltip", "onMouseEnter", "onMouseLeave", "Button", "ButtonLooks", "ButtonWrapperClasses", "e", "openModal", "props", "TranslateModal", "init_TranslateIcon", "__esmMin", "init_react", "init_misc", "init_modal", "init_common", "init_settings", "init_TranslateModal", "init_utils", "handleTranslate", "messageId", "data", "TranslationSetters", "Dismiss", "onDismiss", "VencordCreateElement", "cl", "TranslationAccessory", "message", "translation", "setTranslation", "useState", "useEffect", "TranslateIcon", "Parser", "Languages", "init_TranslationAccessory", "__esmMin", "init_react", "init_common", "init_languages", "init_TranslateIcon", "init_utils", "messageCtxPatch", "translate_default", "init_translate", "__esmMin", "init_react", "init_", "init_ContextMenu", "init_MessageAccessories", "init_MessageEvents", "init_MessagePopover", "init_ErrorBoundary", "init_constants", "init_types", "init_common", "init_settings", "init_TranslateIcon", "init_TranslationAccessory", "init_utils", "children", "message", "group", "findGroupChildrenByChildId", "c", "VencordCreateElement", "Menu", "TranslateIcon", "trans", "translate", "handleTranslate", "definePlugin", "Devs", "settings", "addAccessory", "props", "TranslationAccessory", "addContextMenuPatch", "addButton", "ChannelStore", "addPreSendListener", "_", "removePreSendListener", "removeContextMenuPatch", "removeButton", "removeAccessory", "slateProps", "ErrorBoundary_default", "TranslateChatBarIcon", "buildSeveralUsers", "a", "b", "count", "VencordCreateElement", "settings", "TypingUser", "typingTweaks_default", "init_typingTweaks", "__esmMin", "init_react", "init_Settings", "init_ErrorBoundary", "init_constants", "init_discord", "init_types", "init_common", "definePluginSettings", "ErrorBoundary_default", "user", "guildId", "openUserProfile", "GuildMemberStore", "Avatar", "RelationshipStore", "definePlugin", "Devs", "_", "users", "props", "children", "element", "c", "getDisplayName", "guildId", "userId", "user", "UserStore", "GuildMemberStore", "TypingIndicator", "channelId", "typingUsers", "useStateFromStores", "TypingStore", "old", "current", "oldKeys", "currentKeys", "key", "ChannelStore", "settings", "UserGuildSettingsStore", "myId", "typingUsersArray", "id", "RelationshipStore", "tooltipText", "i18n", "Settings", "buildSeveralUsers", "VencordCreateElement", "Tooltip", "props", "ThreeDots", "typingIndicator_default", "init_typingIndicator", "__esmMin", "init_react", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_webpack", "init_common", "init_typingTweaks", "LazyComponent", "find", "m", "findStoreLazy", "definePluginSettings", "definePlugin", "Devs", "ErrorBoundary_default", "unindent_default", "init_unindent", "__esmMin", "init_react", "init_MessageEvents", "init_constants", "init_types", "definePlugin", "Devs", "_", "content", "str", "minIndent", "prev", "curr", "msg", "m", "lines", "suffix", "addPreSendListener", "addPreEditListener", "_cid", "_mid", "removePreSendListener", "removePreEditListener", "EMBED_SUPPRESSED", "messageContextMenuPatch", "unsuppressEmbeds_default", "init_unsuppressEmbeds", "__esmMin", "init_react", "init_ContextMenu", "init_Icons", "init_constants", "init_types", "init_common", "children", "channel", "author", "embeds", "flags", "messageId", "isEmbedSuppressed", "hasEmbedPerms", "PermissionStore", "PermissionsBits", "UserStore", "menuGroup", "findGroupChildrenByChildId", "deleteIndex", "i", "VencordCreateElement", "Menu", "ImageVisible", "ImageInvisible", "RestAPI", "definePlugin", "Devs", "addContextMenuPatch", "removeContextMenuPatch", "urbanDictionary_default", "init_urbanDictionary", "__esmMin", "init_react", "init_Commands", "init_types", "init_constants", "definePlugin", "Devs", "args", "ctx", "query", "definition", "sendBotMessage", "linkify", "text", "_", "word", "error", "ChannelActions", "UserPopoutSection", "CONNECT", "VoiceChannelSection", "init_VoiceChannelSection", "__esmMin", "init_react", "init_", "init_webpack", "init_common", "findByPropsLazy", "findByCodeLazy", "channel", "label", "showHeader", "VencordCreateElement", "Forms", "Button", "PermissionStore", "Toasts", "VoiceStateStore", "settings", "VoiceChannelField", "userVoiceShow_default", "init_userVoiceShow", "__esmMin", "init_react", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_webpack", "init_common", "init_VoiceChannelSection", "findStoreLazy", "definePluginSettings", "ErrorBoundary_default", "user", "channelId", "channel", "ChannelStore", "guild", "GuildStore", "result", "VencordCreateElement", "VoiceChannelSection", "definePlugin", "Devs", "isSelfUser", "UserStore", "usrbg_default", "init_usrbg", "__esmMin", "init_react", "BASE_URL", "data", "settings", "usrbg_default", "init_usrbg", "__esmMin", "init_react", "init_Settings", "init_Styles", "init_Link", "init_constants", "init_types", "definePluginSettings", "definePlugin", "Devs", "VencordCreateElement", "Link", "className", "participantUserId", "displayProfile", "user", "userId", "enableStyle", "res", "MentionWrapper", "data", "UserMention", "RoleMention", "parse", "props", "userId", "setUserId", "useState", "VencordCreateElement", "children", "mention", "id", "fetching", "UserStore", "fetch", "queue", "UserUtils", "e", "sleep", "validUser_default", "init_validUser", "__esmMin", "init_react", "init_ErrorBoundary", "init_constants", "init_misc", "init_Queue", "init_types", "init_common", "Queue", "definePlugin", "Devs", "ErrorBoundary_default", "timers", "vcDoubleClick_default", "init_vcDoubleClick", "__esmMin", "init_react", "init_constants", "init_types", "init_common", "definePlugin", "Devs", "find", "_", "onClick", "props", "channelId", "channel", "ChannelStore", "cb", "e", "id", "SelectedChannelStore", "data", "speak", "text", "settings", "Settings", "speech", "voice", "v", "Logger", "clean", "str", "replacer", "formatText", "user", "channel", "displayName", "nickname", "getTypeAndChannelId", "channelId", "oldChannelId", "isMe", "myLastChannelId", "playSample", "tempSettings", "type", "currentUser", "UserStore", "myGuildId", "SelectedGuildStore", "GuildMemberStore", "VoiceStateStore", "vcNarrator_default", "init_vcNarrator", "__esmMin", "init_react", "init_Settings", "init_ErrorCard", "init_constants", "init_Logger", "init_margins", "init_text", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePlugin", "Devs", "voiceStates", "myChanId", "SelectedChannelStore", "myId", "ChannelStore", "state", "userId", "id", "template", "chanId", "s", "event", "hasVoices", "hasEnglishVoices", "useMemo", "voices", "types", "k", "errorComponent", "VencordCreateElement", "ErrorCard", "error", "Forms", "VencordFragment", "Margins", "t", "Button", "wordsToTitle", "VencordPopout", "onClose", "pluginEntries", "plugin", "VencordCreateElement", "Menu", "text", "action", "key", "openNotificationLogModal", "Settings", "VencordPopoutIcon", "isShown", "VencordPopoutButton", "show", "setShow", "useState", "Popout", "_", "HeaderBarIcon", "v", "ToolboxFragmentWrapper", "children", "ErrorBoundary_default", "VencordFragment", "vencordToolbox_default", "init_vencordToolbox", "__esmMin", "init_react", "init_", "init_notificationLog", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_webpack", "init_common", "LazyComponent", "filter", "filters", "find", "m", "definePlugin", "Devs", "openImage", "url", "format", "settings", "u", "originalUrl", "openImageModal", "BannerStore", "UserContext", "GuildContext", "viewIcons_default", "init_viewIcons", "__esmMin", "init_react", "init_ContextMenu", "init_Settings", "init_Icons", "init_constants", "init_discord", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePluginSettings", "n", "children", "user", "guildId", "memberAvatar", "GuildMemberStore", "VencordCreateElement", "Menu", "ImageIcon", "guild", "id", "icon", "banner", "definePlugin", "Devs", "addContextMenuPatch", "removeContextMenuPatch", "CodeBlock", "props", "VencordCreateElement", "CodeContainerClasses", "Parser", "init_CodeBlock", "__esmMin", "init_react", "init_webpack", "init_common", "findByPropsLazy", "sortObject", "obj", "k1", "k2", "cleanMessage", "msg", "clone", "key", "cloneAny", "a", "openViewRawModal", "json", "type", "msgContent", "openModal", "props", "VencordCreateElement", "ErrorBoundary_default", "ModalRoot", "ModalHeader", "Text", "ModalCloseButton", "closeModal", "ModalContent", "VencordFragment", "Forms", "CodeBlock", "Margins", "ModalFooter", "Flex", "Button", "copyWithToast", "openViewRawModalMessage", "msgJson", "MakeContextCallback", "name", "children", "lastChild", "p", "Menu", "CopyIcon", "settings", "viewRaw_default", "init_viewRaw", "__esmMin", "init_react", "init_ContextMenu", "init_MessagePopover", "init_Settings", "init_CodeBlock", "init_ErrorBoundary", "init_Flex", "init_constants", "init_margins", "init_misc", "init_modal", "init_types", "init_common", "definePluginSettings", "definePlugin", "Devs", "addButton", "handleClick", "handleContextMenu", "e", "ChannelStore", "addContextMenuPatch", "removeButton", "removeContextMenuPatch", "settings", "init_settings", "__esmMin", "init_react", "init_Settings", "init_types", "definePluginSettings", "Native", "init_DesktopRecorder", "__esmMin", "init_react", "init_common", "init_settings", "cl", "init_utils", "__esmMin", "init_react", "init_Styles", "classNameFactory", "VoiceMessage", "VoicePreview", "init_VoicePreview", "__esmMin", "init_react", "init_webpack", "init_utils", "findComponentByCodeLazy", "src", "waveform", "recording", "durationMs", "useTimer", "durationSeconds", "durationDisplay", "VencordCreateElement", "cl", "VoiceRecorderWeb", "init_WebRecorder", "__esmMin", "init_react", "init_common", "init_settings", "setAudioBlob", "onRecordingChange", "recording", "setRecording", "useState", "paused", "setPaused", "recorder", "setRecorder", "chunks", "setChunks", "changeRecording", "toggleRecording", "settings", "stream", "e", "VencordCreateElement", "VencordFragment", "Button", "sendAudio", "blob", "meta", "channelId", "SelectedChannelStore", "reply", "PendingReplyStore", "FluxDispatcher", "upload", "CloudUtils", "RestAPI", "SnowflakeUtils", "MessageCreator", "showToast", "Toasts", "useObjectUrl", "url", "setUrl", "useState", "Modal", "modalProps", "isRecording", "setRecording", "setBlob", "blobUrl", "setBlobUrl", "useEffect", "useAwaiter", "EMPTY_META", "audioBuffer", "channelData", "bins", "lodash", "samplesPerBin", "binIdx", "squares", "sampleOffset", "sampleIdx", "maxBin", "ratio", "i", "VencordCreateElement", "ModalRoot", "ModalHeader", "Forms", "ModalContent", "cl", "VoiceRecorder", "Button", "file", "chooseFile", "VoicePreview", "ModalFooter", "OptionClasses", "voiceMessages_default", "ctxMenuPatch", "init_voiceMessages", "__esmMin", "init_react", "init_", "init_ContextMenu", "init_Icons", "init_constants", "init_modal", "init_types", "init_web", "init_webpack", "init_common", "init_DesktopRecorder", "init_settings", "init_utils", "init_VoicePreview", "init_WebRecorder", "findByPropsLazy", "findStoreLazy", "VoiceRecorderWeb", "definePlugin", "Devs", "settings", "addContextMenuPatch", "removeContextMenuPatch", "children", "props", "PermissionStore", "PermissionsBits", "Menu", "Microphone", "openModal", "fetchImage", "url", "res", "settings", "webContextMenus_default", "init_webContextMenus", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_web", "init_webpack", "init_common", "definePluginSettings", "definePlugin", "Devs", "ctxMenuCallbacks", "findByProps", "img", "canvas", "data", "name", "file", "saveFile", "selection", "Clipboard", "ComponentDispatch", "clip", "type", "blob", "KeyBinds", "webKeybinds_default", "init_webKeybinds", "__esmMin", "init_react", "init_constants", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePlugin", "Devs", "SelectedGuildStore", "NavigationRouter", "ComponentDispatch", "FluxDispatcher", "SettingsRouter", "fetchReactions", "msg", "emoji", "type", "key", "RestAPI", "res", "FluxDispatcher", "sleep", "getReactionsWithQueue", "e", "cache", "reactions", "queue", "makeRenderMoreUsers", "users", "_label", "_count", "VencordCreateElement", "Tooltip", "u", "onMouseEnter", "onMouseLeave", "AvatarStyles", "handleClickAvatar", "event", "UserSummaryItem", "whoReacted_default", "init_whoReacted", "__esmMin", "init_react", "init_ErrorBoundary", "init_constants", "init_misc", "init_Queue", "init_types", "init_webpack", "init_common", "findComponentByCodeLazy", "findByPropsLazy", "Queue", "definePlugin", "Devs", "props", "ErrorBoundary_default", "message", "forceUpdate", "useForceUpdater", "React", "cb", "user", "ChannelStore", "value", "wikisearch_default", "init_wikisearch", "__esmMin", "init_react", "init_Commands", "init_constants", "init_types", "definePlugin", "Devs", "_", "ctx", "word", "findOption", "sendBotMessage", "dataSearchParams", "data", "response", "err", "altData", "res", "thumbnailData", "thumbnail", "plugins_default", "init_plugins", "__esmMin", "init_react", "init_badges", "init_commands", "init_contextMenu", "init_memberListDecorators", "init_messageAccessories", "init_messageDecorations", "init_messageEvents", "init_messagePopover", "init_notices", "init_serverList", "init_noTrack", "init_settings", "init_supportHelper", "init_alwaysAnimate", "init_alwaysTrust", "init_anonymiseFileNames", "init_arRPC", "init_banger", "init_betterFolders", "init_betterGifAltText", "init_betterNotes", "init_betterRoleDot", "init_betterUploadButton", "init_biggerStreamPreview", "init_blurNsfw", "init_callTimer", "init_clearURLs", "init_clientTheme", "init_colorSighted", "init_consoleShortcuts", "init_copyUserURLs", "init_crashHandler", "init_customRPC", "init_dearrow", "init_disableDMCallIdle", "init_emoteCloner", "init_experiments", "init_f8break", "init_fakeNitro", "init_fakeProfileThemes", "init_favEmojiFirst", "init_favGifSearch", "init_fixSpotifyEmbeds", "init_forceOwnerCrown", "init_friendInvites", "init_gameActivityToggle", "init_gifPaste", "init_greetStickerPicker", "init_hideAttachments", "init_iLoveSpam", "init_ignoreActivities", "init_imageZoom", "init_invisibleChat", "init_keepCurrentChannel", "init_lastfm", "init_loadingQuotes", "init_memberCount", "init_messageClickActions", "init_messageLinkEmbeds", "init_messageLogger", "init_messageTags", "init_moreCommands", "init_moreKaomoji", "init_moreUserTags", "init_moyai", "init_muteNewGuild", "init_mutualGroupDMs", "init_noBlockedMessages", "init_noDevtoolsWarning", "init_noF1", "init_noMosaic", "init_noPendingCount", "init_noProfileThemes", "init_noReplyMention", "init_noScreensharePreview", "init_noTypingAnimation", "init_noUnblockToJump", "init_normalizeMessageLinks", "init_nsfwGateBypass", "init_onePingPerDM", "init_oneko", "init_openInApp", "init_partyMode", "init_permissionFreeWill", "init_permissionsViewer", "init_petpet", "init_pictureInPicture", "init_pinDms", "init_plainFolderIcon", "init_platformIndicators", "init_previewMessage", "init_pronoundb", "init_quickMention", "init_quickReply", "init_reactErrorDecoder", "init_readAllNotificationsButton", "init_relationshipNotifier", "init_revealAllSpoilers", "init_reverseImageSearch", "init_roleColorEverywhere", "init_searchReply", "init_secretRingTone", "init_sendTimestamps", "init_serverListIndicators", "init_serverProfile", "init_shikiCodeblocks", "init_showAllMessageButtons", "init_showConnections", "init_showHiddenChannels", "init_showMeYourName", "init_showTimeouts", "init_silentMessageToggle", "init_silentTyping", "init_sortFriendRequests", "init_spotifyControls", "init_spotifyCrack", "init_spotifyShareCommands", "init_startupTimings", "init_superReactionTweaks", "init_textReplace", "init_themeAttributes", "init_timeBarAllActivities", "init_translate", "init_typingIndicator", "init_typingTweaks", "init_unindent", "init_unsuppressEmbeds", "init_urbanDictionary", "init_userVoiceShow", "init_usrbg", "init_validUser", "init_vcDoubleClick", "init_vcNarrator", "init_vencordToolbox", "init_viewIcons", "init_viewRaw", "init_voiceMessages", "init_webContextMenus", "init_webKeybinds", "init_whoReacted", "init_wikisearch", "badges_default", "commands_default", "contextMenu_default", "memberListDecorators_default", "messageAccessories_default", "messageDecorations_default", "messageEvents_default", "messagePopover_default", "notices_default", "serverList_default", "noTrack_default", "settings_default", "supportHelper_default", "alwaysAnimate_default", "alwaysTrust_default", "anonymiseFileNames_default", "arRPC_default", "banger_default", "betterFolders_default", "betterGifAltText_default", "betterNotes_default", "betterRoleDot_default", "betterUploadButton_default", "biggerStreamPreview_default", "blurNsfw_default", "callTimer_default", "clearURLs_default", "clientTheme_default", "colorSighted_default", "consoleShortcuts_default", "copyUserURLs_default", "crashHandler_default", "customRPC_default", "dearrow_default", "disableDMCallIdle_default", "emoteCloner_default", "experiments_default", "f8break_default", "fakeNitro_default", "fakeProfileThemes_default", "favEmojiFirst_default", "favGifSearch_default", "fixSpotifyEmbeds_default", "forceOwnerCrown_default", "friendInvites_default", "gameActivityToggle_default", "gifPaste_default", "greetStickerPicker_default", "hideAttachments_default", "iLoveSpam_default", "ignoreActivities_default", "imageZoom_default", "invisibleChat_default", "keepCurrentChannel_default", "lastfm_default", "loadingQuotes_default", "memberCount_default", "messageClickActions_default", "messageLinkEmbeds_default", "messageLogger_default", "messageTags_default", "moreCommands_default", "moreKaomoji_default", "moreUserTags_default", "moyai_default", "muteNewGuild_default", "mutualGroupDMs_default", "noBlockedMessages_default", "noDevtoolsWarning_default", "noF1_default", "noMosaic_default", "noPendingCount_default", "noProfileThemes_default", "noReplyMention_default", "noScreensharePreview_default", "noTypingAnimation_default", "noUnblockToJump_default", "normalizeMessageLinks_default", "nsfwGateBypass_default", "onePingPerDM_default", "oneko_default", "openInApp_default", "partyMode_default", "permissionFreeWill_default", "permissionsViewer_default", "petpet_default", "pictureInPicture_default", "pinDms_default", "plainFolderIcon_default", "platformIndicators_default", "previewMessage_default", "pronoundb_default", "quickMention_default", "quickReply_default", "reactErrorDecoder_default", "readAllNotificationsButton_default", "relationshipNotifier_default", "revealAllSpoilers_default", "reverseImageSearch_default", "roleColorEverywhere_default", "searchReply_default", "secretRingTone_default", "sendTimestamps_default", "serverListIndicators_default", "serverProfile_default", "shikiCodeblocks_default", "showAllMessageButtons_default", "showConnections_default", "showHiddenChannels_default", "showMeYourName_default", "showTimeouts_default", "silentMessageToggle_default", "silentTyping_default", "sortFriendRequests_default", "spotifyControls_default", "spotifyCrack_default", "spotifyShareCommands_default", "startupTimings_default", "superReactionTweaks_default", "textReplace_default", "themeAttributes_default", "timeBarAllActivities_default", "translate_default", "typingIndicator_default", "typingTweaks_default", "unindent_default", "unsuppressEmbeds_default", "urbanDictionary_default", "userVoiceShow_default", "usrbg_default", "validUser_default", "vcDoubleClick_default", "vcNarrator_default", "vencordToolbox_default", "viewIcons_default", "viewRaw_default", "voiceMessages_default", "webContextMenus_default", "webKeybinds_default", "whoReacted_default", "wikisearch_default", "Badges_exports", "__export", "BadgePosition", "_getBadges", "addBadge", "removeBadge", "badge", "ErrorBoundary_default", "Badges", "args", "badges", "donorBadges", "plugins_default", "init_Badges", "__esmMin", "init_react", "init_ErrorBoundary", "init_plugins", "api_exports", "__export", "Badges", "Commands", "ContextMenu", "DataStore", "MemberListDecorators", "MessageAccessories", "MessageDecorations", "MessageEvents", "MessagePopover", "Notices", "Notifications", "ServerList", "Settings", "Styles", "init_api", "__esmMin", "init_react", "init_Badges", "init_Commands", "init_ContextMenu", "init_DataStore", "init_MemberListDecorators", "init_MessageAccessories", "init_MessageDecorations", "init_MessageEvents", "init_MessagePopover", "init_Notices", "init_Notifications", "init_ServerList", "init_Settings", "init_Styles", "MessageEvents_exports", "Notices_exports", "Commands_exports", "DataStore_exports", "MessageAccessories_exports", "MessagePopover_exports", "Badges_exports", "ServerList_exports", "MessageDecorations_exports", "MemberListDecorators_exports", "Settings_exports", "Styles_exports", "Notifications_exports", "ContextMenu_exports", "onceDefined", "target", "property", "callback", "propertyAsAny", "v", "init_onceDefined", "__esmMin", "init_react", "utils_exports", "__export", "ChangeList", "Devs", "DevsById", "ImageModal", "LazyComponent", "Logger", "Margins", "ModalCloseButton", "ModalContent", "ModalFooter", "ModalHeader", "ModalRoot", "ModalSize", "Modals", "NoopComponent", "Queue", "REACT_GLOBAL", "SUPPORT_CHANNEL_ID", "Theme", "VENCORD_USER_AGENT", "WEBPACK_CHUNK", "canonicalizeDescriptor", "canonicalizeMatch", "canonicalizeReplace", "canonicalizeReplacement", "checkIntersecting", "classes", "closeAllModals", "closeModal", "copyWithToast", "debounce", "fetchUserProfile", "formatDuration", "getCurrentChannel", "getCurrentGuild", "getTheme", "getUniqueUsername", "git_hash_default", "git_remote_default", "humanFriendlyJoin", "identity", "insertTextIntoChatInputBox", "isMobile", "isNonNullish", "isObject", "isObjectEmpty", "isPluginDev", "isTruthy", "localStorage", "makeCodeblock", "makeLazy", "mergeDefaults", "onceDefined", "onlyOnce", "openImageModal", "openModal", "openModalLazy", "openPrivateChannel", "openUserProfile", "parseUrl", "proxyLazy", "sendMessage", "sleep", "useAwaiter", "useForceUpdater", "useIntersection", "useTimer", "wordsFromCamel", "wordsFromKebab", "wordsFromPascal", "wordsFromSnake", "wordsFromTitle", "wordsToCamel", "wordsToKebab", "wordsToPascal", "wordsToSnake", "wordsToTitle", "init_utils", "__esmMin", "init_react", "init_ChangeList", "init_constants", "init_debounce", "init_discord", "init_guards", "init_lazy", "init_localStorage", "init_Logger", "init_margins", "init_misc", "init_modal", "init_onceDefined", "init_onlyOnce", "init_patches", "init_Queue", "init_text", "quickCss_exports", "__export", "toggle", "createStyle", "id", "style", "initSystemValues", "values", "variables", "v", "k", "isEnabled", "css", "Settings", "initThemes", "themesStyle", "themeLinks", "enabledThemes", "links", "localThemes", "theme", "link", "init_quickCss", "__esmMin", "init_react", "init_Settings", "addSettingsListener", "webpack_exports", "__export", "common_exports", "_initWebpack", "_resolveReady", "addListener", "cache", "extract", "filters", "find", "findAll", "findBulk", "findByCode", "findByCodeLazy", "findByProps", "findByPropsLazy", "findComponentByCode", "findComponentByCodeLazy", "findComponentLazy", "findExportedComponentLazy", "findLazy", "findModuleId", "findStore", "findStoreLazy", "listeners", "onceReady", "removeListener", "search", "subscriptions", "waitFor", "wreq", "init_webpack", "__esmMin", "init_react", "init_common", "patchPush", "webpackGlobal", "handlePush", "chunk", "patchFactories", "err", "logger", "args", "v", "factories", "subscriptions", "listeners", "patches", "id", "mod", "code", "originalMod", "patchedBy", "factory", "module", "exports", "require", "numberId", "callback", "filter", "i", "patch", "executePatch", "traceFunction", "match", "replace", "previousMod", "previousCode", "replacement", "lastMod", "lastCode", "canonicalizeReplacement", "newCode", "webpackChunk", "init_patchWebpack", "__esmMin", "init_react", "init_constants", "init_Logger", "init_patches", "init_Tracer", "init_webpack", "Logger", "WEBPACK_CHUNK", "_initWebpack", "Vencord_exports", "__export", "api_exports", "PlainSettings", "plugins_exports", "quickCss_exports", "Settings", "updater_exports", "utils_exports", "webpack_exports", "syncSettings", "get", "showNotification", "SettingsRouter", "localStorage", "putCloudSettings", "getCloudSettings", "relaunch", "init", "onceReady", "startAllPlugins", "checkForUpdates", "update", "err", "UpdateLogger", "init_Vencord", "__esmMin", "init_react", "init_api", "init_plugins", "init_utils", "init_quickCss", "init_updater", "init_webpack", "init_patchWebpack", "init_types", "init_DataStore", "init_Notifications", "init_Settings", "init_localStorage", "init_native", "init_settingsSync", "init_common"] + "sources": ["../scripts/build/inject/react.mjs", "../src/utils/Logger.ts", "../src/utils/margins.ts", "../src/utils/lazy.ts", "../src/debug/Tracer.ts", "../src/webpack/webpack.ts", "../src/webpack/common/classes.ts", "../src/webpack/common/internal.tsx", "../src/webpack/common/components.ts", "../src/webpack/common/menu.ts", "../src/webpack/common/react.ts", "../src/webpack/common/settingsStores.ts", "../src/webpack/common/stores.ts", "../src/webpack/common/types/components.d.ts", "../src/webpack/common/types/menu.d.ts", "../src/webpack/common/types/utils.d.ts", "../src/webpack/common/utils.ts", "../src/webpack/common/index.ts", "git-hash:~git-hash", "git-remote:~git-remote", "../src/utils/constants.ts", "../src/utils/misc.tsx", "../src/utils/react.tsx", "../src/components/ErrorCard.tsx", "../src/components/ErrorBoundary.tsx", "../src/components/Heart.tsx", "../src/components/DonateButton.tsx", "../src/components/Flex.tsx", "../src/utils/modal.tsx", "../src/utils/types.ts", "../src/plugins/_api/badges.tsx", "../src/plugins/_api/commands.ts", "../src/plugins/_api/contextMenu.ts", "../src/plugins/_api/memberListDecorators.ts", "../src/plugins/_api/messageAccessories.ts", "../src/plugins/_api/messageDecorations.ts", "../src/plugins/_api/messageEvents.ts", "../src/plugins/_api/messagePopover.ts", "../src/plugins/_api/notices.ts", "../src/plugins/_api/serverList.ts", "../src/plugins/_core/noTrack.ts", "../src/api/ContextMenu.ts", "../src/utils/debounce.ts", "../src/utils/localStorage.ts", "../src/utils/Queue.ts", "../src/api/Notifications/NotificationComponent.tsx", "../src/api/DataStore/index.ts", "../src/api/Styles.ts", "../node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/index.browser.js", "../src/api/Notifications/notificationLog.tsx", "../src/api/Notifications/Notifications.tsx", "../src/api/Notifications/index.ts", "../node_modules/.pnpm/fflate@0.7.4/node_modules/fflate/esm/browser.js", "../src/utils/cloud.tsx", "../src/utils/native.ts", "../src/utils/web.ts", "../src/utils/settingsSync.ts", "../src/api/Settings.ts", "../src/utils/updater.ts", "../src/components/handleComponentFailed.ts", "../src/utils/onlyOnce.ts", "../src/components/VencordSettings/shared.tsx", "../src/components/VencordSettings/VencordTab.tsx", "../src/api/Notices.ts", "../src/components/Icons.tsx", "../src/utils/text.ts", "../src/api/Commands/commandHelpers.ts", "../src/api/Commands/types.ts", "../src/api/Commands/index.ts", "../src/components/Badge.tsx", "../src/components/PluginSettings/components/SettingBooleanComponent.tsx", "../src/components/PluginSettings/components/SettingCustomComponent.tsx", "../src/components/PluginSettings/components/SettingNumericComponent.tsx", "../src/components/PluginSettings/components/SettingSelectComponent.tsx", "../src/components/PluginSettings/components/SettingSliderComponent.tsx", "../src/components/PluginSettings/components/SettingTextComponent.tsx", "../src/components/PluginSettings/components/index.ts", "../src/utils/discord.tsx", "../src/components/PluginSettings/ContributorModal.tsx", "../src/components/PluginSettings/PluginModal.tsx", "../src/components/Switch.tsx", "../src/components/VencordSettings/AddonCard.tsx", "../src/utils/ChangeList.ts", "../src/plugins/index.ts", "../src/components/PluginSettings/index.tsx", "../src/components/VencordSettings/PluginsTab.tsx", "../src/components/Link.tsx", "../src/components/VencordSettings/ThemesTab.tsx", "../src/components/VencordSettings/UpdaterTab.tsx", "../src/components/CheckedTextInput.tsx", "../src/components/VencordSettings/CloudTab.tsx", "../src/components/VencordSettings/BackupAndRestoreTab.tsx", "../src/plugins/_core/settings.tsx", "../src/plugins/_core/supportHelper.tsx", "../src/plugins/alwaysAnimate/index.ts", "../src/plugins/alwaysTrust/index.ts", "../src/plugins/anonymiseFileNames/index.ts", "../src/plugins/arRPC.web/index.tsx", "../src/plugins/banger/index.ts", "../src/plugins/betterFolders/FolderSideBar.tsx", "../src/plugins/betterFolders/index.tsx", "../src/plugins/betterGifAltText/index.ts", "../src/plugins/betterNotes/index.tsx", "../src/plugins/betterRoleDot/index.ts", "../src/plugins/betterUploadButton/index.ts", "../src/plugins/biggerStreamPreview/webpack/stores.ts", "../src/plugins/biggerStreamPreview/index.tsx", "../src/plugins/blurNsfw/index.ts", "../src/plugins/callTimer/index.tsx", "../src/api/MessageEvents.ts", "../src/plugins/clearURLs/defaultRules.ts", "../src/plugins/clearURLs/index.ts", "../src/plugins/colorSighted/index.ts", "../src/utils/patches.ts", "../src/plugins/consoleShortcuts/index.ts", "../src/plugins/copyUserURLs/index.tsx", "../src/plugins/crashHandler/index.ts", "../src/utils/guards.ts", "../src/plugins/customRPC/index.tsx", "../src/plugins/dearrow/index.tsx", "../src/plugins/disableDMCallIdle/index.ts", "../src/plugins/emoteCloner/index.tsx", "../src/plugins/experiments/index.tsx", "../src/plugins/f8break/index.ts", "../src/utils/web-metadata.ts", "../src/utils/apng-canvas.js", "../src/utils/dependencies.ts", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/index.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/constants.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/stream.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/lzwEncode.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/rgb-packing.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/pnnquant2.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/color.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/palettize.js", "../src/plugins/fakeNitro/index.ts", "../node_modules/.pnpm/virtual-merge@1.0.1/node_modules/virtual-merge/dist/index.mjs", "../src/plugins/fakeProfileThemes/index.tsx", "../src/plugins/favEmojiFirst/index.ts", "../src/plugins/favGifSearch/index.tsx", "../src/plugins/fixSpotifyEmbeds.desktop/index.ts", "../src/plugins/forceOwnerCrown/index.ts", "../src/plugins/friendInvites/index.ts", "managed-style:src/plugins/gameActivityToggle/style.css", "../src/plugins/gameActivityToggle/index.tsx", "../src/plugins/gifPaste/index.ts", "../src/plugins/greetStickerPicker/index.tsx", "../src/api/MessagePopover.ts", "../src/plugins/hideAttachments/index.tsx", "../src/plugins/iLoveSpam/index.ts", "../src/plugins/ignoreActivities/index.tsx", "../src/plugins/imageZoom/constants.ts", "../src/plugins/imageZoom/utils/waitFor.ts", "../src/plugins/imageZoom/components/Magnifier.tsx", "managed-style:src/plugins/imageZoom/styles.css", "../src/plugins/imageZoom/index.tsx", "../src/plugins/invisibleChat.desktop/components/DecryptionModal.tsx", "../src/plugins/invisibleChat.desktop/components/EncryptionModal.tsx", "../src/plugins/invisibleChat.desktop/index.tsx", "../src/plugins/keepCurrentChannel/index.ts", "../src/plugins/lastfm/index.tsx", "../src/plugins/loadingQuotes/index.ts", "../src/plugins/memberCount/index.tsx", "../src/plugins/messageClickActions/index.ts", "../src/api/MessageAccessories.ts", "../src/plugins/messageLinkEmbeds/index.tsx", "managed-style:src/plugins/messageLogger/deleteStyleOverlay.css", "managed-style:src/plugins/messageLogger/deleteStyleText.css", "../src/plugins/messageLogger/index.tsx", "../src/plugins/messageTags/index.ts", "../src/plugins/moreCommands/index.ts", "../src/plugins/moreKaomoji/index.ts", "../src/plugins/moreUserTags/index.tsx", "../src/plugins/moyai/index.ts", "../src/plugins/muteNewGuild/index.tsx", "../src/plugins/mutualGroupDMs/index.tsx", "../src/plugins/noBlockedMessages/index.ts", "../src/plugins/noDevtoolsWarning/index.ts", "../src/plugins/noF1/index.ts", "managed-style:src/plugins/noMosaic/styles.css", "../src/plugins/noMosaic/index.ts", "../src/plugins/noPendingCount/index.ts", "../src/plugins/noProfileThemes/index.ts", "../src/plugins/noReplyMention/index.tsx", "../src/plugins/noScreensharePreview/index.ts", "../src/plugins/noTypingAnimation/index.ts", "../src/plugins/noUnblockToJump/index.ts", "../src/plugins/normalizeMessageLinks/index.ts", "../src/plugins/nsfwGateBypass/index.ts", "../src/plugins/onePingPerDM/index.ts", "../src/plugins/oneko/index.ts", "../src/plugins/openInApp/index.ts", "../src/plugins/partyMode/index.ts", "../src/plugins/permissionFreeWill/index.ts", "../src/plugins/permissionsViewer/utils.ts", "../src/plugins/permissionsViewer/components/icons.tsx", "../src/plugins/permissionsViewer/components/RolesAndUsersPermissions.tsx", "../src/components/ExpandableHeader.tsx", "../src/plugins/permissionsViewer/components/UserPermissions.tsx", "../src/plugins/permissionsViewer/index.tsx", "../src/plugins/petpet/index.ts", "../src/plugins/pictureInPicture/index.tsx", "../src/plugins/pinDms/settings.ts", "../src/plugins/pinDms/contextMenus.tsx", "../src/plugins/pinDms/index.tsx", "../src/plugins/plainFolderIcon/index.ts", "../src/api/MemberListDecorators.ts", "../src/api/MessageDecorations.ts", "../src/plugins/platformIndicators/index.tsx", "../src/plugins/previewMessage/index.tsx", "../src/plugins/pronoundb/components/PronounsAboutComponent.tsx", "../src/plugins/pronoundb/settings.ts", "../src/plugins/pronoundb/types.ts", "../src/plugins/pronoundb/pronoundbUtils.ts", "../src/plugins/pronoundb/components/PronounsChatComponent.tsx", "../src/plugins/pronoundb/index.ts", "../src/plugins/quickMention/index.tsx", "../src/plugins/quickReply/index.ts", "../src/plugins/reactErrorDecoder/index.ts", "../src/api/ServerList.ts", "../src/plugins/readAllNotificationsButton/index.tsx", "../src/plugins/relationshipNotifier/settings.ts", "../src/plugins/relationshipNotifier/types.ts", "../src/plugins/relationshipNotifier/utils.ts", "../src/plugins/relationshipNotifier/functions.ts", "../src/plugins/relationshipNotifier/index.ts", "../src/plugins/revealAllSpoilers/index.ts", "../src/plugins/reverseImageSearch/index.tsx", "../src/plugins/roleColorEverywhere/index.tsx", "../src/plugins/searchReply/index.tsx", "../src/plugins/secretRingTone/index.ts", "../src/plugins/sendTimestamps/index.tsx", "../src/plugins/serverListIndicators/index.tsx", "../src/plugins/serverProfile/GuildProfileModal.tsx", "../src/plugins/serverProfile/index.tsx", "include-file:~fileContent/previewExample.tsx", "../node_modules/.pnpm/eventemitter3@4.0.7/node_modules/eventemitter3/index.js", "../node_modules/.pnpm/@vap+core@0.0.12/node_modules/@vap/core/ipc/channel.js", "../node_modules/.pnpm/@vap+core@0.0.12/node_modules/@vap/core/ipc/rpc.js", "../node_modules/.pnpm/@vap+core@0.0.12/node_modules/@vap/core/ipc/worker.js", "../node_modules/.pnpm/@vap+core@0.0.12/node_modules/@vap/core/ipc/index.js", "../src/plugins/shikiCodeblocks.desktop/hooks/useTheme.ts", "../src/plugins/shikiCodeblocks.desktop/api/languages.ts", "../src/plugins/shikiCodeblocks.desktop/api/themes.ts", "../src/plugins/shikiCodeblocks.desktop/api/shiki.ts", "managed-style:src/plugins/shikiCodeblocks.desktop/devicon.css", "../src/plugins/shikiCodeblocks.desktop/types.ts", "../src/plugins/shikiCodeblocks.desktop/settings.ts", "../src/plugins/shikiCodeblocks.desktop/hooks/useShikiSettings.ts", "../src/plugins/shikiCodeblocks.desktop/utils/color.ts", "../src/plugins/shikiCodeblocks.desktop/utils/misc.ts", "../src/plugins/shikiCodeblocks.desktop/hooks/useCopyCooldown.ts", "../src/plugins/shikiCodeblocks.desktop/components/CopyButton.tsx", "../src/plugins/shikiCodeblocks.desktop/components/ButtonRow.tsx", "../src/plugins/shikiCodeblocks.desktop/components/Code.tsx", "../src/plugins/shikiCodeblocks.desktop/components/Header.tsx", "../src/plugins/shikiCodeblocks.desktop/components/Highlighter.tsx", "../src/plugins/shikiCodeblocks.desktop/utils/createStyle.ts", "../src/plugins/shikiCodeblocks.desktop/index.ts", "../src/plugins/showAllMessageButtons/index.ts", "../src/plugins/showConnections/VerifiedIcon.tsx", "../src/plugins/showConnections/index.tsx", "../src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx", "../src/plugins/showHiddenChannels/index.tsx", "../src/plugins/showMeYourName/index.tsx", "../src/plugins/showTimeouts/index.ts", "../src/plugins/silentMessageToggle/index.tsx", "../src/plugins/silentTyping/index.tsx", "../src/plugins/sortFriendRequests/index.tsx", "managed-style:src/plugins/spotifyControls/hoverOnly.css", "../src/plugins/spotifyControls/SpotifyStore.ts", "../src/plugins/spotifyControls/PlayerComponent.tsx", "../src/plugins/spotifyControls/index.tsx", "../src/plugins/spotifyCrack/index.ts", "../src/plugins/spotifyShareCommands/index.ts", "../src/plugins/startupTimings/StartupTimingPage.tsx", "../src/plugins/startupTimings/index.tsx", "../src/plugins/superReactionTweaks/index.ts", "../src/plugins/textReplace/index.tsx", "../src/plugins/themeAttributes/index.ts", "../src/plugins/timeBarAllActivities/index.ts", "../src/plugins/translate/settings.ts", "../src/plugins/translate/languages.ts", "../src/plugins/translate/utils.ts", "../src/plugins/translate/TranslateModal.tsx", "../src/plugins/translate/TranslateIcon.tsx", "../src/plugins/translate/TranslationAccessory.tsx", "../src/plugins/translate/index.tsx", "../src/plugins/typingTweaks/index.tsx", "../src/plugins/typingIndicator/index.tsx", "../src/plugins/unindent/index.ts", "../src/plugins/unsuppressEmbeds/index.tsx", "../src/plugins/urbanDictionary/index.ts", "../src/plugins/userVoiceShow/components/VoiceChannelSection.tsx", "../src/plugins/userVoiceShow/index.tsx", "managed-style:src/plugins/usrbg/index.css", "../src/plugins/usrbg/index.tsx", "../src/plugins/validUser/index.tsx", "../src/plugins/vcDoubleClick/index.ts", "../src/plugins/vcNarrator/index.tsx", "../src/plugins/vencordToolbox/index.tsx", "../src/plugins/viewIcons/index.tsx", "../src/components/CodeBlock.tsx", "../src/plugins/viewRaw/index.tsx", "../src/plugins/voiceMessages/settings.ts", "../src/plugins/voiceMessages/DesktopRecorder.tsx", "../src/plugins/voiceMessages/utils.ts", "../src/plugins/voiceMessages/VoicePreview.tsx", "../src/plugins/voiceMessages/WebRecorder.tsx", "../src/plugins/voiceMessages/index.tsx", "../src/plugins/webContextMenus.web/index.ts", "../src/plugins/webKeybinds.web/index.ts", "../src/plugins/whoReacted/index.tsx", "../src/plugins/wikisearch/index.ts", "import-plugins:~plugins", "../src/api/Badges.ts", "../src/api/index.ts", "../src/utils/onceDefined.ts", "../src/utils/index.ts", "../src/utils/quickCss.ts", "../src/webpack/index.ts", "../src/webpack/patchWebpack.ts", "../src/Vencord.ts"], + "sourcesContent": ["/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const VencordFragment = /* #__PURE__*/ Symbol.for(\"react.fragment\");\nexport let VencordCreateElement =\n (...args) => (VencordCreateElement = Vencord.Webpack.Common.React.createElement)(...args);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport class Logger {\n /**\n * Returns the console format args for a title with the specified background colour and black text\n * @param color Background colour\n * @param title Text\n * @returns Array. Destructure this into {@link Logger}.errorCustomFmt or console.log\n *\n * @example logger.errorCustomFmt(...Logger.makeTitleElements(\"white\", \"Hello\"), \"World\");\n */\n static makeTitle(color: string, title: string): [string, ...string[]] {\n return [\"%c %c %s \", \"\", `background: ${color}; color: black; font-weight: bold; border-radius: 5px;`, title];\n }\n\n constructor(public name: string, public color: string = \"white\") { }\n\n private _log(level: \"log\" | \"error\" | \"warn\" | \"info\" | \"debug\", levelColor: string, args: any[], customFmt = \"\") {\n console[level](\n `%c Vencord %c %c ${this.name} ${customFmt}`,\n `background: ${levelColor}; color: black; font-weight: bold; border-radius: 5px;`,\n \"\",\n `background: ${this.color}; color: black; font-weight: bold; border-radius: 5px;`\n , ...args\n );\n }\n\n public log(...args: any[]) {\n this._log(\"log\", \"#a6d189\", args);\n }\n\n public info(...args: any[]) {\n this._log(\"info\", \"#a6d189\", args);\n }\n\n public error(...args: any[]) {\n this._log(\"error\", \"#e78284\", args);\n }\n\n public errorCustomFmt(fmt: string, ...args: any[]) {\n this._log(\"error\", \"#e78284\", args, fmt);\n }\n\n public warn(...args: any[]) {\n this._log(\"warn\", \"#e5c890\", args);\n }\n\n public debug(...args: any[]) {\n this._log(\"debug\", \"#eebebe\", args);\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nlet styleStr = \"\";\n\nexport const Margins: Record<`${\"top\" | \"bottom\" | \"left\" | \"right\"}${8 | 16 | 20}`, string> = {} as any;\n\nfor (const dir of [\"top\", \"bottom\", \"left\", \"right\"] as const) {\n for (const size of [8, 16, 20] as const) {\n const cl = `vc-m-${dir}-${size}`;\n Margins[`${dir}${size}`] = cl;\n styleStr += `.${cl}{margin-${dir}:${size}px;}`;\n }\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", () =>\n document.head.append(Object.assign(document.createElement(\"style\"), {\n textContent: styleStr,\n id: \"vencord-margins\"\n })), { once: true });\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function makeLazy(factory: () => T, attempts = 5): () => T {\n let tries = 0;\n let cache: T;\n return () => {\n if (!cache && attempts > tries++) {\n cache = factory();\n if (!cache && attempts === tries)\n console.error(\"Lazy factory failed:\", factory);\n }\n return cache;\n };\n}\n\n// Proxies demand that these properties be unmodified, so proxyLazy\n// will always return the function default for them.\nconst unconfigurable = [\"arguments\", \"caller\", \"prototype\"];\n\nconst handler: ProxyHandler = {};\n\nconst kGET = Symbol.for(\"vencord.lazy.get\");\nconst kCACHE = Symbol.for(\"vencord.lazy.cached\");\n\nfor (const method of [\n \"apply\",\n \"construct\",\n \"defineProperty\",\n \"deleteProperty\",\n \"get\",\n \"getOwnPropertyDescriptor\",\n \"getPrototypeOf\",\n \"has\",\n \"isExtensible\",\n \"ownKeys\",\n \"preventExtensions\",\n \"set\",\n \"setPrototypeOf\"\n]) {\n handler[method] =\n (target: any, ...args: any[]) => Reflect[method](target[kGET](), ...args);\n}\n\nhandler.ownKeys = target => {\n const v = target[kGET]();\n const keys = Reflect.ownKeys(v);\n for (const key of unconfigurable) {\n if (!keys.includes(key)) keys.push(key);\n }\n return keys;\n};\n\nhandler.getOwnPropertyDescriptor = (target, p) => {\n if (typeof p === \"string\" && unconfigurable.includes(p))\n return Reflect.getOwnPropertyDescriptor(target, p);\n\n const descriptor = Reflect.getOwnPropertyDescriptor(target[kGET](), p);\n\n if (descriptor) Object.defineProperty(target, p, descriptor);\n return descriptor;\n};\n\n/**\n * Wraps the result of {@see makeLazy} in a Proxy you can consume as if it wasn't lazy.\n * On first property access, the lazy is evaluated\n * @param factory lazy factory\n * @param attempts how many times to try to evaluate the lazy before giving up\n * @returns Proxy\n *\n * Note that the example below exists already as an api, see {@link findByPropsLazy}\n * @example const mod = proxyLazy(() => findByProps(\"blah\")); console.log(mod.blah);\n */\nexport function proxyLazy(factory: () => T, attempts = 5): T {\n let tries = 0;\n const proxyDummy = Object.assign(function () { }, {\n [kCACHE]: void 0 as T | undefined,\n [kGET]() {\n if (!proxyDummy[kCACHE] && attempts > tries++) {\n proxyDummy[kCACHE] = factory();\n if (!proxyDummy[kCACHE] && attempts === tries)\n console.error(\"Lazy factory failed:\", factory);\n }\n return proxyDummy[kCACHE];\n }\n });\n\n return new Proxy(proxyDummy, handler) as any;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Logger } from \"@utils/Logger\";\n\nif (IS_DEV) {\n var traces = {} as Record;\n var logger = new Logger(\"Tracer\", \"#FFD166\");\n}\n\nconst noop = function () { };\n\nexport const beginTrace = !IS_DEV ? noop :\n function beginTrace(name: string, ...args: any[]) {\n if (name in traces)\n throw new Error(`Trace ${name} already exists!`);\n\n traces[name] = [performance.now(), args];\n };\n\nexport const finishTrace = !IS_DEV ? noop : function finishTrace(name: string) {\n const end = performance.now();\n\n const [start, args] = traces[name];\n delete traces[name];\n\n logger.debug(`${name} took ${end - start}ms`, args);\n};\n\ntype Func = (...args: any[]) => any;\ntype TraceNameMapper = (...args: Parameters) => string;\n\nconst noopTracer =\n (name: string, f: F, mapper?: TraceNameMapper) => f;\n\nexport const traceFunction = !IS_DEV\n ? noopTracer\n : function traceFunction(name: string, f: F, mapper?: TraceNameMapper): F {\n return function (this: any, ...args: Parameters) {\n const traceName = mapper?.(...args) ?? name;\n\n beginTrace(traceName, ...arguments);\n try {\n return f.apply(this, args);\n } finally {\n finishTrace(traceName);\n }\n } as F;\n };\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { proxyLazy } from \"@utils/lazy\";\nimport { Logger } from \"@utils/Logger\";\nimport type { WebpackInstance } from \"discord-types/other\";\n\nimport { traceFunction } from \"../debug/Tracer\";\n\nconst logger = new Logger(\"Webpack\");\n\nexport let _resolveReady: () => void;\n/**\n * Fired once a gateway connection to Discord has been established.\n * This indicates that the core webpack modules have been initialised\n */\nexport const onceReady = new Promise(r => _resolveReady = r);\n\nexport let wreq: WebpackInstance;\nexport let cache: WebpackInstance[\"c\"];\n\nexport type FilterFn = (mod: any) => boolean;\n\nexport const filters = {\n byProps: (...props: string[]): FilterFn =>\n props.length === 1\n ? m => m[props[0]] !== void 0\n : m => props.every(p => m[p] !== void 0),\n\n byCode: (...code: string[]): FilterFn => m => {\n if (typeof m !== \"function\") return false;\n const s = Function.prototype.toString.call(m);\n for (const c of code) {\n if (!s.includes(c)) return false;\n }\n return true;\n },\n byStoreName: (name: string): FilterFn => m =>\n m.constructor?.displayName === name\n};\n\nexport const subscriptions = new Map();\nexport const listeners = new Set();\n\nexport type CallbackFn = (mod: any, id: number) => void;\n\nexport function _initWebpack(instance: typeof window.webpackChunkdiscord_app) {\n if (cache !== void 0) throw \"no.\";\n\n instance.push([[Symbol(\"Vencord\")], {}, r => wreq = r]);\n instance.pop();\n if (!wreq) return false;\n\n cache = wreq.c;\n\n for (const id in cache) {\n const { exports } = cache[id];\n if (!exports) continue;\n\n const numberId = Number(id);\n\n for (const callback of listeners) {\n try {\n callback(exports, numberId);\n } catch (err) {\n logger.error(\"Error in webpack listener\", err);\n }\n }\n\n for (const [filter, callback] of subscriptions) {\n try {\n if (filter(exports)) {\n subscriptions.delete(filter);\n callback(exports, numberId);\n } else if (typeof exports === \"object\") {\n if (exports.default && filter(exports.default)) {\n subscriptions.delete(filter);\n callback(exports.default, numberId);\n }\n\n for (const nested in exports) if (nested.length <= 3) {\n if (exports[nested] && filter(exports[nested])) {\n subscriptions.delete(filter);\n callback(exports[nested], numberId);\n }\n }\n }\n } catch (err) {\n logger.error(\"Error while firing callback for webpack chunk\", err);\n }\n }\n }\n return true;\n}\n\nif (IS_DEV && IS_DISCORD_DESKTOP) {\n var devToolsOpen = false;\n // At this point in time, DiscordNative has not been exposed yet, so setImmediate is needed\n setTimeout(() => {\n DiscordNative/* just to make sure */?.window.setDevtoolsCallbacks(() => devToolsOpen = true, () => devToolsOpen = false);\n }, 0);\n}\n\nfunction handleModuleNotFound(method: string, ...filter: unknown[]) {\n const err = new Error(`webpack.${method} found no module`);\n logger.error(err, \"Filter:\", filter);\n\n // Strict behaviour in DevBuilds to fail early and make sure the issue is found\n if (IS_DEV && !devToolsOpen)\n throw err;\n}\n\n/**\n * Find the first module that matches the filter\n */\nexport const find = traceFunction(\"find\", function find(filter: FilterFn, { isIndirect = false, isWaitFor = false }: { isIndirect?: boolean; isWaitFor?: boolean; } = {}) {\n if (typeof filter !== \"function\")\n throw new Error(\"Invalid filter. Expected a function got \" + typeof filter);\n\n for (const key in cache) {\n const mod = cache[key];\n if (!mod?.exports) continue;\n\n if (filter(mod.exports)) {\n return isWaitFor ? [mod.exports, Number(key)] : mod.exports;\n }\n\n if (typeof mod.exports !== \"object\") continue;\n\n if (mod.exports.default && filter(mod.exports.default)) {\n const found = mod.exports.default;\n return isWaitFor ? [found, Number(key)] : found;\n }\n\n // the length check makes search about 20% faster\n for (const nestedMod in mod.exports) if (nestedMod.length <= 3) {\n const nested = mod.exports[nestedMod];\n if (nested && filter(nested)) {\n return isWaitFor ? [nested, Number(key)] : nested;\n }\n }\n }\n\n if (!isIndirect) {\n handleModuleNotFound(\"find\", filter);\n }\n\n return isWaitFor ? [null, null] : null;\n});\n\n/**\n * find but lazy\n */\nexport function findLazy(filter: FilterFn) {\n return proxyLazy(() => find(filter));\n}\n\nexport function findAll(filter: FilterFn) {\n if (typeof filter !== \"function\")\n throw new Error(\"Invalid filter. Expected a function got \" + typeof filter);\n\n const ret = [] as any[];\n for (const key in cache) {\n const mod = cache[key];\n if (!mod?.exports) continue;\n\n if (filter(mod.exports))\n ret.push(mod.exports);\n else if (typeof mod.exports !== \"object\")\n continue;\n\n if (mod.exports.default && filter(mod.exports.default))\n ret.push(mod.exports.default);\n else for (const nestedMod in mod.exports) if (nestedMod.length <= 3) {\n const nested = mod.exports[nestedMod];\n if (nested && filter(nested)) ret.push(nested);\n }\n }\n\n return ret;\n}\n\n/**\n * Same as {@link find} but in bulk\n * @param filterFns Array of filters. Please note that this array will be modified in place, so if you still\n * need it afterwards, pass a copy.\n * @returns Array of results in the same order as the passed filters\n */\nexport const findBulk = traceFunction(\"findBulk\", function findBulk(...filterFns: FilterFn[]) {\n if (!Array.isArray(filterFns))\n throw new Error(\"Invalid filters. Expected function[] got \" + typeof filterFns);\n\n const { length } = filterFns;\n\n if (length === 0)\n throw new Error(\"Expected at least two filters.\");\n\n if (length === 1) {\n if (IS_DEV) {\n throw new Error(\"bulk called with only one filter. Use find\");\n }\n return find(filterFns[0]);\n }\n\n const filters = filterFns as Array;\n\n let found = 0;\n const results = Array(length);\n\n outer:\n for (const key in cache) {\n const mod = cache[key];\n if (!mod?.exports) continue;\n\n for (let j = 0; j < length; j++) {\n const filter = filters[j];\n // Already done\n if (filter === undefined) continue;\n\n if (filter(mod.exports)) {\n results[j] = mod.exports;\n filters[j] = undefined;\n if (++found === length) break outer;\n break;\n }\n\n if (typeof mod.exports !== \"object\")\n continue;\n\n if (mod.exports.default && filter(mod.exports.default)) {\n results[j] = mod.exports.default;\n filters[j] = undefined;\n if (++found === length) break outer;\n break;\n }\n\n for (const nestedMod in mod.exports)\n if (nestedMod.length <= 3) {\n const nested = mod.exports[nestedMod];\n if (nested && filter(nested)) {\n results[j] = nested;\n filters[j] = undefined;\n if (++found === length) break outer;\n continue outer;\n }\n }\n }\n }\n\n if (found !== length) {\n const err = new Error(`Got ${length} filters, but only found ${found} modules!`);\n if (IS_DEV) {\n if (!devToolsOpen)\n // Strict behaviour in DevBuilds to fail early and make sure the issue is found\n throw err;\n } else {\n logger.warn(err);\n }\n }\n\n return results;\n});\n\n/**\n * Find the id of a module by its code\n * @param code Code\n * @returns number or null\n */\nexport const findModuleId = traceFunction(\"findModuleId\", function findModuleId(code: string) {\n for (const id in wreq.m) {\n if (wreq.m[id].toString().includes(code)) {\n return Number(id);\n }\n }\n\n const err = new Error(\"Didn't find module with code:\\n\" + code);\n if (IS_DEV) {\n if (!devToolsOpen)\n // Strict behaviour in DevBuilds to fail early and make sure the issue is found\n throw err;\n } else {\n logger.warn(err);\n }\n\n return null;\n});\n\n/**\n * Finds a mangled module by the provided code \"code\" (must be unique and can be anywhere in the module)\n * then maps it into an easily usable module via the specified mappers\n * @param code Code snippet\n * @param mappers Mappers to create the non mangled exports\n * @returns Unmangled exports as specified in mappers\n *\n * @example mapMangledModule(\"headerIdIsManaged:\", {\n * openModal: filters.byCode(\"headerIdIsManaged:\"),\n * closeModal: filters.byCode(\"key==\")\n * })\n */\nexport const mapMangledModule = traceFunction(\"mapMangledModule\", function mapMangledModule(code: string, mappers: Record): Record {\n const exports = {} as Record;\n\n const id = findModuleId(code);\n if (id === null)\n return exports;\n\n const mod = wreq(id);\n outer:\n for (const key in mod) {\n const member = mod[key];\n for (const newName in mappers) {\n // if the current mapper matches this module\n if (mappers[newName](member)) {\n exports[newName] = member;\n continue outer;\n }\n }\n }\n return exports;\n});\n\n/**\n * Same as {@link mapMangledModule} but lazy\n */\nexport function mapMangledModuleLazy(code: string, mappers: Record): Record {\n return proxyLazy(() => mapMangledModule(code, mappers));\n}\n\n/**\n * Find the first module that has the specified properties\n */\nexport function findByProps(...props: string[]) {\n const res = find(filters.byProps(...props), { isIndirect: true });\n if (!res)\n handleModuleNotFound(\"findByProps\", ...props);\n return res;\n}\n\n/**\n * findByProps but lazy\n */\nexport function findByPropsLazy(...props: string[]) {\n return proxyLazy(() => findByProps(...props));\n}\n\n/**\n * Find a function by its code\n */\nexport function findByCode(...code: string[]) {\n const res = find(filters.byCode(...code), { isIndirect: true });\n if (!res)\n handleModuleNotFound(\"findByCode\", ...code);\n return res;\n}\n\n/**\n * findByCode but lazy\n */\nexport function findByCodeLazy(...code: string[]) {\n return proxyLazy(() => findByCode(...code));\n}\n\n/**\n * Find a store by its displayName\n */\nexport function findStore(name: string) {\n const res = find(filters.byStoreName(name), { isIndirect: true });\n if (!res)\n handleModuleNotFound(\"findStore\", name);\n return res;\n}\n\n/**\n * findByDisplayName but lazy\n */\nexport function findStoreLazy(name: string) {\n return proxyLazy(() => findStore(name));\n}\n\n/**\n * Wait for a module that matches the provided filter to be registered,\n * then call the callback with the module as the first argument\n */\nexport function waitFor(filter: string | string[] | FilterFn, callback: CallbackFn) {\n if (typeof filter === \"string\")\n filter = filters.byProps(filter);\n else if (Array.isArray(filter))\n filter = filters.byProps(...filter);\n else if (typeof filter !== \"function\")\n throw new Error(\"filter must be a string, string[] or function, got \" + typeof filter);\n\n const [existing, id] = find(filter!, { isIndirect: true, isWaitFor: true });\n if (existing) return void callback(existing, id);\n\n subscriptions.set(filter, callback);\n}\n\nexport function addListener(callback: CallbackFn) {\n listeners.add(callback);\n}\n\nexport function removeListener(callback: CallbackFn) {\n listeners.delete(callback);\n}\n\n/**\n * Search modules by keyword. This searches the factory methods,\n * meaning you can search all sorts of things, displayName, methodName, strings somewhere in the code, etc\n * @param filters One or more strings or regexes\n * @returns Mapping of found modules\n */\nexport function search(...filters: Array) {\n const results = {} as Record;\n const factories = wreq.m;\n outer:\n for (const id in factories) {\n const factory = factories[id].original ?? factories[id];\n const str: string = factory.toString();\n for (const filter of filters) {\n if (typeof filter === \"string\" && !str.includes(filter)) continue outer;\n if (filter instanceof RegExp && !filter.test(str)) continue outer;\n }\n results[id] = factory;\n }\n\n return results;\n}\n\n/**\n * Extract a specific module by id into its own Source File. This has no effect on\n * the code, it is only useful to be able to look at a specific module without having\n * to view a massive file. extract then returns the extracted module so you can jump to it.\n * As mentioned above, note that this extracted module is not actually used,\n * so putting breakpoints or similar will have no effect.\n * @param id The id of the module to extract\n */\nexport function extract(id: number) {\n const mod = wreq.m[id] as Function;\n if (!mod) return null;\n\n const code = `\n// [EXTRACTED] WebpackModule${id}\n// WARNING: This module was extracted to be more easily readable.\n// This module is NOT ACTUALLY USED! This means putting breakpoints will have NO EFFECT!!\n\n0,${mod.toString()}\n//# sourceURL=ExtractedWebpackModule${id}\n`;\n const extracted = (0, eval)(code);\n return extracted as Function;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { findByPropsLazy, findLazy } from \"@webpack\";\n\nimport * as t from \"./types/classes\";\n\nexport const ModalImageClasses: t.ImageModalClasses = findLazy(m => m.image && m.modal && !m.applicationIcon);\nexport const ButtonWrapperClasses: t.ButtonWrapperClasses = findByPropsLazy(\"buttonWrapper\", \"buttonContent\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { LazyComponent } from \"@utils/react\";\n\n// eslint-disable-next-line path-alias/no-relative\nimport { FilterFn, filters, waitFor } from \"../webpack\";\n\nexport function waitForComponent = React.ComponentType & Record>(name: string, filter: FilterFn | string | string[]): T {\n let myValue: T = function () {\n throw new Error(`Vencord could not find the ${name} Component`);\n } as any;\n\n const lazyComponent = LazyComponent(() => myValue) as T;\n waitFor(filter, (v: any) => {\n myValue = v;\n Object.assign(lazyComponent, v);\n });\n\n return lazyComponent;\n}\n\nexport function waitForStore(name: string, cb: (v: any) => void) {\n waitFor(filters.byStoreName(name), cb);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n// eslint-disable-next-line path-alias/no-relative\nimport { filters, waitFor } from \"@webpack\";\n\nimport { waitForComponent } from \"./internal\";\nimport * as t from \"./types/components\";\n\nexport let Forms = {} as {\n FormTitle: t.FormTitle,\n FormSection: t.FormSection,\n FormDivider: t.FormDivider,\n FormText: t.FormText,\n};\n\nexport let Card: t.Card;\nexport let Button: t.Button;\nexport let Switch: t.Switch;\nexport let Tooltip: t.Tooltip;\nexport let TextInput: t.TextInput;\nexport let TextArea: t.TextArea;\nexport let Text: t.Text;\nexport let Select: t.Select;\nexport let SearchableSelect: t.SearchableSelect;\nexport let Slider: t.Slider;\nexport let ButtonLooks: t.ButtonLooks;\nexport let Popout: t.Popout;\nexport let Dialog: t.Dialog;\nexport let TabBar: any;\nexport let Paginator: t.Paginator;\nexport let ScrollerThin: t.ScrollerThin;\nexport let Clickable: t.Clickable;\nexport let Avatar: t.Avatar;\n// token lagger real\n/** css colour resolver stuff, no clue what exactly this does, just copied usage from Discord */\nexport let useToken: t.useToken;\n\nexport const MaskedLink = waitForComponent(\"MaskedLink\", m => m?.type?.toString().includes(\"MASKED_LINK)\"));\nexport const Timestamp = waitForComponent(\"Timestamp\", filters.byCode(\".Messages.MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL.format\"));\nexport const Flex = waitForComponent(\"Flex\", [\"Justify\", \"Align\", \"Wrap\"]);\n\nwaitFor([\"FormItem\", \"Button\"], m => {\n ({ useToken, Card, Button, FormSwitch: Switch, Tooltip, TextInput, TextArea, Text, Select, SearchableSelect, Slider, ButtonLooks, TabBar, Popout, Dialog, Paginator, ScrollerThin, Clickable, Avatar } = m);\n Forms = m;\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n// eslint-disable-next-line path-alias/no-relative\nimport { filters, mapMangledModuleLazy, waitFor } from \"../webpack\";\nimport type * as t from \"./types/menu\";\n\nexport let Menu = {} as t.Menu;\n\nwaitFor([\"MenuItem\", \"MenuSliderControl\"], m => Menu = m);\n\nexport const ContextMenu: t.ContextMenuApi = mapMangledModuleLazy('type:\"CONTEXT_MENU_OPEN\"', {\n open: filters.byCode(\"stopPropagation\"),\n openLazy: m => m.toString().length < 50,\n close: filters.byCode(\"CONTEXT_MENU_CLOSE\")\n});\n\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n// eslint-disable-next-line path-alias/no-relative\nimport { findByPropsLazy, waitFor } from \"../webpack\";\n\nexport let React: typeof import(\"react\");\nexport let useState: typeof React.useState;\nexport let useEffect: typeof React.useEffect;\nexport let useMemo: typeof React.useMemo;\nexport let useRef: typeof React.useRef;\nexport let useReducer: typeof React.useReducer;\nexport let useCallback: typeof React.useCallback;\n\nexport const ReactDOM: typeof import(\"react-dom\") & typeof import(\"react-dom/client\") = findByPropsLazy(\"createPortal\", \"render\");\n\nwaitFor(\"useState\", m => {\n React = m;\n ({ useEffect, useState, useMemo, useRef, useReducer, useCallback } = React);\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { findByPropsLazy } from \"@webpack\";\n\nexport const TextAndImagesSettingsStores = findByPropsLazy(\"MessageDisplayCompact\");\nexport const StatusSettingsStores = findByPropsLazy(\"ShowCurrentGame\");\n\nexport const UserSettingsActionCreators = findByPropsLazy(\"PreloadedUserSettingsActionCreators\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { proxyLazy } from \"@utils/lazy\";\nimport type * as Stores from \"discord-types/stores\";\n\n// eslint-disable-next-line path-alias/no-relative\nimport { filters, findByProps, findByPropsLazy, mapMangledModuleLazy } from \"../webpack\";\nimport { waitForStore } from \"./internal\";\nimport * as t from \"./types/stores\";\n\nexport const Flux: t.Flux = findByPropsLazy(\"connectStores\");\n\nexport type GenericStore = t.FluxStore & Record;\n\nexport enum DraftType {\n ChannelMessage = 0,\n ThreadSettings = 1,\n FirstThreadMessage = 2,\n ApplicationLauncherCommand = 3\n}\n\nexport let MessageStore: Omit & {\n getMessages(chanId: string): any;\n};\n\n// this is not actually a FluxStore\nexport const PrivateChannelsStore = findByPropsLazy(\"openPrivateChannel\");\nexport let PermissionStore: GenericStore;\nexport let GuildChannelStore: GenericStore;\nexport let ReadStateStore: GenericStore;\nexport let PresenceStore: GenericStore;\nexport let PoggerModeSettingsStore: GenericStore;\n\nexport let GuildStore: Stores.GuildStore & t.FluxStore;\nexport let UserStore: Stores.UserStore & t.FluxStore;\nexport let UserProfileStore: GenericStore;\nexport let SelectedChannelStore: Stores.SelectedChannelStore & t.FluxStore;\nexport let SelectedGuildStore: t.FluxStore & Record;\nexport let ChannelStore: Stores.ChannelStore & t.FluxStore;\nexport let GuildMemberStore: Stores.GuildMemberStore & t.FluxStore;\nexport let RelationshipStore: Stores.RelationshipStore & t.FluxStore & {\n /** Get the date (as a string) that the relationship was created */\n getSince(userId: string): string;\n};\n\nexport let EmojiStore: t.EmojiStore;\nexport let WindowStore: t.WindowStore;\nexport let DraftStore: t.DraftStore;\n\nexport const MaskedLinkStore = mapMangledModuleLazy('\"MaskedLinkStore\"', {\n openUntrustedLink: filters.byCode(\".apply(this,arguments)\")\n});\n\n/**\n * React hook that returns stateful data for one or more stores\n * You might need a custom comparator (4th argument) if your store data is an object\n *\n * @param stores The stores to listen to\n * @param mapper A function that returns the data you need\n * @param idk some thing, idk just pass null\n * @param isEqual A custom comparator for the data returned by mapper\n *\n * @example const user = useStateFromStores([UserStore], () => UserStore.getCurrentUser(), null, (old, current) => old.id === current.id);\n */\nexport const useStateFromStores: (\n stores: t.FluxStore[],\n mapper: () => T,\n idk?: any,\n isEqual?: (old: T, newer: T) => boolean\n) => T\n = proxyLazy(() => findByProps(\"useStateFromStores\").useStateFromStores);\n\nwaitForStore(\"DraftStore\", s => DraftStore = s);\nwaitForStore(\"UserStore\", s => UserStore = s);\nwaitForStore(\"UserProfileStore\", m => UserProfileStore = m);\nwaitForStore(\"ChannelStore\", m => ChannelStore = m);\nwaitForStore(\"SelectedChannelStore\", m => SelectedChannelStore = m);\nwaitForStore(\"SelectedGuildStore\", m => SelectedGuildStore = m);\nwaitForStore(\"GuildStore\", m => GuildStore = m);\nwaitForStore(\"GuildMemberStore\", m => GuildMemberStore = m);\nwaitForStore(\"RelationshipStore\", m => RelationshipStore = m);\nwaitForStore(\"PermissionStore\", m => PermissionStore = m);\nwaitForStore(\"PresenceStore\", m => PresenceStore = m);\nwaitForStore(\"ReadStateStore\", m => ReadStateStore = m);\nwaitForStore(\"GuildChannelStore\", m => GuildChannelStore = m);\nwaitForStore(\"MessageStore\", m => MessageStore = m);\nwaitForStore(\"WindowStore\", m => WindowStore = m);\nwaitForStore(\"EmojiStore\", m => EmojiStore = m);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { Moment } from \"moment\";\nimport type { ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, KeyboardEvent, MouseEvent, PropsWithChildren, PropsWithRef, ReactNode, Ref } from \"react\";\n\nexport type TextVariant = \"heading-sm/normal\" | \"heading-sm/medium\" | \"heading-sm/semibold\" | \"heading-sm/bold\" | \"heading-md/normal\" | \"heading-md/medium\" | \"heading-md/semibold\" | \"heading-md/bold\" | \"heading-lg/normal\" | \"heading-lg/medium\" | \"heading-lg/semibold\" | \"heading-lg/bold\" | \"heading-xl/normal\" | \"heading-xl/medium\" | \"heading-xl/bold\" | \"heading-xxl/normal\" | \"heading-xxl/medium\" | \"heading-xxl/bold\" | \"eyebrow\" | \"heading-deprecated-14/normal\" | \"heading-deprecated-14/medium\" | \"heading-deprecated-14/bold\" | \"text-xxs/normal\" | \"text-xxs/medium\" | \"text-xxs/semibold\" | \"text-xxs/bold\" | \"text-xs/normal\" | \"text-xs/medium\" | \"text-xs/semibold\" | \"text-xs/bold\" | \"text-sm/normal\" | \"text-sm/medium\" | \"text-sm/semibold\" | \"text-sm/bold\" | \"text-md/normal\" | \"text-md/medium\" | \"text-md/semibold\" | \"text-md/bold\" | \"text-lg/normal\" | \"text-lg/medium\" | \"text-lg/semibold\" | \"text-lg/bold\" | \"display-sm\" | \"display-md\" | \"display-lg\" | \"code\";\nexport type FormTextTypes = Record<\"DEFAULT\" | \"INPUT_PLACEHOLDER\" | \"DESCRIPTION\" | \"LABEL_BOLD\" | \"LABEL_SELECTED\" | \"LABEL_DESCRIPTOR\" | \"ERROR\" | \"SUCCESS\", string>;\nexport type Heading = `h${1 | 2 | 3 | 4 | 5 | 6}`;\n\nexport type Margins = Record<\"marginTop16\" | \"marginTop8\" | \"marginBottom8\" | \"marginTop20\" | \"marginBottom20\", string>;\nexport type ButtonLooks = Record<\"FILLED\" | \"INVERTED\" | \"OUTLINED\" | \"LINK\" | \"BLANK\", string>;\n\nexport type TextProps = PropsWithChildren & {\n variant?: TextVariant;\n tag?: \"div\" | \"span\" | \"p\" | \"strong\" | Heading;\n selectable?: boolean;\n lineClamp?: number;\n}>;\n\nexport type Text = ComponentType;\n\nexport type FormTitle = ComponentType & PropsWithChildren<{\n /** default is h5 */\n tag?: Heading;\n faded?: boolean;\n disabled?: boolean;\n required?: boolean;\n error?: ReactNode;\n}>>;\n\nexport type FormSection = ComponentType>;\n\nexport type FormDivider = ComponentType<{\n className?: string;\n style?: CSSProperties;\n}>;\n\n\nexport type FormText = ComponentType & TextProps> & { Types: FormTextTypes; };\n\nexport type Tooltip = ComponentType<{\n text: ReactNode;\n children: FunctionComponent<{\n onClick(): void;\n onMouseEnter(): void;\n onMouseLeave(): void;\n onContextMenu(): void;\n onFocus(): void;\n onBlur(): void;\n \"aria-label\"?: string;\n }>;\n \"aria-label\"?: string;\n\n allowOverflow?: boolean;\n forceOpen?: boolean;\n hide?: boolean;\n hideOnClick?: boolean;\n shouldShow?: boolean;\n spacing?: number;\n\n /** Tooltip.Colors.BLACK */\n color?: string;\n /** TooltipPositions.TOP */\n position?: string;\n\n tooltipClassName?: string;\n tooltipContentClassName?: string;\n}> & {\n Colors: Record<\"BLACK\" | \"BRAND\" | \"CUSTOM\" | \"GREEN\" | \"GREY\" | \"PRIMARY\" | \"RED\" | \"YELLOW\", string>;\n};\n\nexport type TooltipPositions = Record<\"BOTTOM\" | \"CENTER\" | \"LEFT\" | \"RIGHT\" | \"TOP\" | \"WINDOW_CENTER\", string>;\n\nexport type Card = ComponentType & {\n editable?: boolean;\n outline?: boolean;\n /** Card.Types.PRIMARY */\n type?: string;\n}>> & {\n Types: Record<\"BRAND\" | \"CUSTOM\" | \"DANGER\" | \"PRIMARY\" | \"SUCCESS\" | \"WARNING\", string>;\n};\n\nexport type Button = ComponentType, \"size\"> & {\n /** Button.Looks.FILLED */\n look?: string;\n /** Button.Colors.BRAND */\n color?: string;\n /** Button.Sizes.MEDIUM */\n size?: string;\n /** Button.BorderColors.BLACK */\n borderColor?: string;\n\n wrapperClassName?: string;\n className?: string;\n innerClassName?: string;\n\n buttonRef?: Ref;\n focusProps?: any;\n\n submittingStartedLabel?: string;\n submittingFinishedLabel?: string;\n}>> & {\n BorderColors: Record<\"BLACK\" | \"BRAND\" | \"BRAND_NEW\" | \"GREEN\" | \"LINK\" | \"PRIMARY\" | \"RED\" | \"TRANSPARENT\" | \"WHITE\" | \"YELLOW\", string>;\n Colors: Record<\"BRAND\" | \"RED\" | \"GREEN\" | \"YELLOW\" | \"PRIMARY\" | \"LINK\" | \"WHITE\" | \"BLACK\" | \"TRANSPARENT\" | \"BRAND_NEW\" | \"CUSTOM\", string>;\n Hovers: Record<\"DEFAULT\" | \"BRAND\" | \"RED\" | \"GREEN\" | \"YELLOW\" | \"PRIMARY\" | \"LINK\" | \"WHITE\" | \"BLACK\" | \"TRANSPARENT\", string>;\n Looks: Record<\"FILLED\" | \"INVERTED\" | \"OUTLINED\" | \"LINK\" | \"BLANK\", string>;\n Sizes: Record<\"NONE\" | \"TINY\" | \"SMALL\" | \"MEDIUM\" | \"LARGE\" | \"XLARGE\" | \"MIN\" | \"MAX\" | \"ICON\", string>;\n\n Link: any;\n};\n\nexport type Switch = ComponentType>;\n\nexport type Timestamp = ComponentType>;\n\nexport type TextInput = ComponentType;\n prefixElement?: ReactNode;\n\n focusProps?: any;\n\n /** TextInput.Sizes.DEFAULT */\n size?: string;\n} & Omit, \"onChange\">>> & {\n Sizes: Record<\"DEFAULT\" | \"MINI\", string>;\n};\n\nexport type TextArea = ComponentType, \"onChange\"> & {\n onChange(v: string): void;\n}>>;\n\ninterface SelectOption {\n disabled?: boolean;\n value: any;\n label: string;\n key?: React.Key;\n default?: boolean;\n}\n\nexport type Select = ComponentType; // TODO\n\n /**\n * - 0 ~ Filled\n * - 1 ~ Custom\n */\n look?: 0 | 1;\n className?: string;\n popoutClassName?: string;\n popoutPosition?: \"top\" | \"left\" | \"right\" | \"bottom\" | \"center\" | \"window_center\";\n optionClassName?: string;\n\n autoFocus?: boolean;\n isDisabled?: boolean;\n clearable?: boolean;\n closeOnSelect?: boolean;\n hideIcon?: boolean;\n\n select(value: any): void;\n isSelected(value: any): boolean;\n serialize(value: any): string;\n clear?(): void;\n\n maxVisibleItems?: number;\n popoutWidth?: number;\n\n onClose?(): void;\n onOpen?(): void;\n\n renderOptionLabel?(option: SelectOption): ReactNode;\n /** discord stupid this gets all options instead of one yeah */\n renderOptionValue?(option: SelectOption[]): ReactNode;\n\n \"aria-label\"?: boolean;\n \"aria-labelledby\"?: boolean;\n}>>;\n\nexport type SearchableSelect = ComponentType; // TODO\n value?: SelectOption;\n\n /**\n * - 0 ~ Filled\n * - 1 ~ Custom\n */\n look?: 0 | 1;\n className?: string;\n popoutClassName?: string;\n wrapperClassName?: string;\n popoutPosition?: \"top\" | \"left\" | \"right\" | \"bottom\" | \"center\" | \"window_center\";\n optionClassName?: string;\n\n autoFocus?: boolean;\n isDisabled?: boolean;\n clearable?: boolean;\n closeOnSelect?: boolean;\n clearOnSelect?: boolean;\n multi?: boolean;\n\n onChange(value: any): void;\n onSearchChange?(value: string): void;\n\n onClose?(): void;\n onOpen?(): void;\n onBlur?(): void;\n\n renderOptionPrefix?(option: SelectOption): ReactNode;\n renderOptionSuffix?(option: SelectOption): ReactNode;\n\n filter?(option: SelectOption[], query: string): SelectOption[];\n\n centerCaret?: boolean;\n debounceTime?: number;\n maxVisibleItems?: number;\n popoutWidth?: number;\n\n \"aria-labelledby\"?: boolean;\n}>>;\n\nexport type Slider = ComponentType>;\n\n// TODO - type maybe idk probably not that useful other than the constants\nexport type Flex = ComponentType> & {\n Align: Record<\"START\" | \"END\" | \"CENTER\" | \"STRETCH\" | \"BASELINE\", string>;\n Direction: Record<\"VERTICAL\" | \"HORIZONTAL\" | \"HORIZONTAL_REVERSE\", string>;\n Justify: Record<\"START\" | \"END\" | \"CENTER\" | \"BETWEEN\" | \"AROUND\", string>;\n Wrap: Record<\"NO_WRAP\" | \"WRAP\" | \"WRAP_REVERSE\", string>;\n};\n\ndeclare enum PopoutAnimation {\n NONE = \"1\",\n TRANSLATE = \"2\",\n SCALE = \"3\",\n FADE = \"4\"\n}\n\nexport type Popout = ComponentType<{\n children(\n thing: {\n \"aria-controls\": string;\n \"aria-expanded\": boolean;\n onClick(event: MouseEvent): void;\n onKeyDown(event: KeyboardEvent): void;\n onMouseDown(event: MouseEvent): void;\n },\n data: {\n isShown: boolean;\n position: string;\n }\n ): ReactNode;\n shouldShow?: boolean;\n renderPopout(args: {\n closePopout(): void;\n isPositioned: boolean;\n nudge: number;\n position: string;\n setPopoutRef(ref: any): void;\n updatePosition(): void;\n }): ReactNode;\n\n onRequestOpen?(): void;\n onRequestClose?(): void;\n\n /** \"center\" and others */\n align?: string;\n /** Popout.Animation */\n animation?: PopoutAnimation;\n autoInvert?: boolean;\n nudgeAlignIntoViewport?: boolean;\n /** \"bottom\" and others */\n position?: string;\n positionKey?: string;\n spacing?: number;\n}> & {\n Animation: typeof PopoutAnimation;\n};\n\nexport type Dialog = ComponentType>;\n\ntype Resolve = (data: { theme: \"light\" | \"dark\", saturation: number; }) => {\n hex(): string;\n hsl(): string;\n int(): number;\n spring(): string;\n};\n\nexport type useToken = (color: {\n css: string;\n resolve: Resolve;\n}) => ReturnType;\n\nexport type Paginator = ComponentType<{\n currentPage: number;\n maxVisiblePages: number;\n pageSize: number;\n totalCount: number;\n\n onPageChange?(page: number): void;\n hideMaxPage?: boolean;\n}>;\n\nexport type MaskedLink = ComponentType>;\n\nexport type ScrollerThin = ComponentType>;\n\nexport type Clickable = ComponentType>;\n\nexport type Avatar = ComponentType>;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { ComponentType, CSSProperties, MouseEvent, PropsWithChildren, ReactNode, UIEvent } from \"react\";\n\ntype RC = ComponentType>>;\n\nexport interface Menu {\n Menu: RC<{\n navId: string;\n onClose(): void;\n className?: string;\n style?: CSSProperties;\n hideScroller?: boolean;\n onSelect?(): void;\n }>;\n MenuSeparator: ComponentType;\n MenuGroup: RC<{\n label?: string;\n }>;\n MenuItem: RC<{\n id: string;\n label: ReactNode;\n action?(e: MouseEvent): void;\n icon?: ComponentType;\n\n color?: string;\n render?: ComponentType;\n onChildrenScroll?: Function;\n childRowHeight?: number;\n listClassName?: string;\n disabled?: boolean;\n }>;\n MenuCheckboxItem: RC<{\n id: string;\n label: string;\n checked: boolean;\n action?(e: MouseEvent): void;\n disabled?: boolean;\n }>;\n MenuRadioItem: RC<{\n id: string;\n group: string;\n label: string;\n checked: boolean;\n action?(e: MouseEvent): void;\n disabled?: boolean;\n }>;\n MenuControlItem: RC<{\n id: string;\n interactive?: boolean;\n }>;\n MenuSliderControl: RC<{\n minValue: number,\n maxValue: number,\n value: number,\n onChange(value: number): void,\n renderValue?(value: number): string,\n }>;\n}\n\nexport interface ContextMenuApi {\n close(): void;\n open(\n event: UIEvent,\n render?: Menu[\"Menu\"],\n options?: { enableSpellCheck?: boolean; },\n renderLazy?: () => Promise\n ): void;\n openLazy(\n event: UIEvent,\n renderLazy?: () => Promise,\n options?: { enableSpellCheck?: boolean; }\n ): void;\n}\n\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { ReactNode } from \"react\";\n\nimport type { FluxEvents } from \"./fluxEvents\";\nimport { i18nMessages } from \"./i18nMessages\";\n\nexport { FluxEvents };\n\nexport interface FluxDispatcher {\n _actionHandlers: any;\n _subscriptions: any;\n dispatch(event: { [key: string]: unknown; type: FluxEvents; }): Promise;\n isDispatching(): boolean;\n subscribe(event: FluxEvents, callback: (data: any) => void): void;\n unsubscribe(event: FluxEvents, callback: (data: any) => void): void;\n wait(callback: () => void): void;\n}\n\nexport type Parser = Record<\n | \"parse\"\n | \"parseTopic\"\n | \"parseEmbedTitle\"\n | \"parseInlineReply\"\n | \"parseGuildVerificationFormRule\"\n | \"parseGuildEventDescription\"\n | \"parseAutoModerationSystemMessage\"\n | \"parseForumPostGuidelines\"\n | \"parseForumPostMostRecentMessage\",\n (content: string, inline?: boolean, state?: Record) => ReactNode[]\n> & Record<\"defaultRules\" | \"guildEventRules\", Record>>;\n\nexport interface Alerts {\n show(alert: {\n title: any;\n body: React.ReactNode;\n className?: string;\n confirmColor?: string;\n cancelText?: string;\n confirmText?: string;\n secondaryConfirmText?: string;\n onCancel?(): void;\n onConfirm?(): void;\n onConfirmSecondary?(): void;\n }): void;\n /** This is a noop, it does nothing. */\n close(): void;\n}\n\nexport interface SnowflakeUtils {\n fromTimestamp(timestamp: number): string;\n extractTimestamp(snowflake: string): number;\n age(snowflake: string): number;\n atPreviousMillisecond(snowflake: string): string;\n compare(snowflake1?: string, snowflake2?: string): number;\n}\n\ninterface RestRequestData {\n url: string;\n query?: Record;\n body?: Record;\n oldFormErrors?: boolean;\n retries?: number;\n}\n\nexport type RestAPI = Record<\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\", (data: RestRequestData) => Promise> & {\n V6OrEarlierAPIError: Error;\n V8APIError: Error;\n getAPIBaseURL(withVersion?: boolean): string;\n};\n\nexport type Permissions = \"CREATE_INSTANT_INVITE\"\n | \"KICK_MEMBERS\"\n | \"BAN_MEMBERS\"\n | \"ADMINISTRATOR\"\n | \"MANAGE_CHANNELS\"\n | \"MANAGE_GUILD\"\n | \"CHANGE_NICKNAME\"\n | \"MANAGE_NICKNAMES\"\n | \"MANAGE_ROLES\"\n | \"MANAGE_WEBHOOKS\"\n | \"MANAGE_GUILD_EXPRESSIONS\"\n | \"CREATE_GUILD_EXPRESSIONS\"\n | \"VIEW_AUDIT_LOG\"\n | \"VIEW_CHANNEL\"\n | \"VIEW_GUILD_ANALYTICS\"\n | \"VIEW_CREATOR_MONETIZATION_ANALYTICS\"\n | \"MODERATE_MEMBERS\"\n | \"SEND_MESSAGES\"\n | \"SEND_TTS_MESSAGES\"\n | \"MANAGE_MESSAGES\"\n | \"EMBED_LINKS\"\n | \"ATTACH_FILES\"\n | \"READ_MESSAGE_HISTORY\"\n | \"MENTION_EVERYONE\"\n | \"USE_EXTERNAL_EMOJIS\"\n | \"ADD_REACTIONS\"\n | \"USE_APPLICATION_COMMANDS\"\n | \"MANAGE_THREADS\"\n | \"CREATE_PUBLIC_THREADS\"\n | \"CREATE_PRIVATE_THREADS\"\n | \"USE_EXTERNAL_STICKERS\"\n | \"SEND_MESSAGES_IN_THREADS\"\n | \"SEND_VOICE_MESSAGES\"\n | \"CONNECT\"\n | \"SPEAK\"\n | \"MUTE_MEMBERS\"\n | \"DEAFEN_MEMBERS\"\n | \"MOVE_MEMBERS\"\n | \"USE_VAD\"\n | \"PRIORITY_SPEAKER\"\n | \"STREAM\"\n | \"USE_EMBEDDED_ACTIVITIES\"\n | \"USE_SOUNDBOARD\"\n | \"USE_EXTERNAL_SOUNDS\"\n | \"REQUEST_TO_SPEAK\"\n | \"MANAGE_EVENTS\"\n | \"CREATE_EVENTS\";\n\nexport type PermissionsBits = Record;\n\nexport interface Locale {\n name: string;\n value: string;\n localizedName: string;\n}\n\nexport interface LocaleInfo {\n code: string;\n enabled: boolean;\n name: string;\n englishName: string;\n postgresLang: string;\n}\n\nexport interface i18n {\n getAvailableLocales(): Locale[];\n getLanguages(): LocaleInfo[];\n getDefaultLocale(): string;\n getLocale(): string;\n getLocaleInfo(): LocaleInfo;\n setLocale(locale: string): void;\n\n loadPromise: Promise;\n\n Messages: Record;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { proxyLazy } from \"@utils/lazy\";\nimport type { Channel, User } from \"discord-types/general\";\n\n// eslint-disable-next-line path-alias/no-relative\nimport { _resolveReady, filters, find, findByPropsLazy, findLazy, mapMangledModuleLazy, waitFor } from \"../webpack\";\nimport type * as t from \"./types/utils\";\n\nexport let FluxDispatcher: t.FluxDispatcher;\nexport let ComponentDispatch;\nwaitFor([\"ComponentDispatch\", \"ComponentDispatcher\"], m => ComponentDispatch = m.ComponentDispatch);\n\n\nexport const RestAPI: t.RestAPI = findByPropsLazy(\"getAPIBaseURL\", \"get\");\nexport const moment: typeof import(\"moment\") = findByPropsLazy(\"parseTwoDigitYear\");\n\nexport const hljs: typeof import(\"highlight.js\") = findByPropsLazy(\"highlight\");\n\nexport const lodash: typeof import(\"lodash\") = findByPropsLazy(\"debounce\", \"cloneDeep\");\n\nexport const i18n: t.i18n = findLazy(m => m.Messages?.[\"en-US\"]);\n\nexport let SnowflakeUtils: t.SnowflakeUtils;\nwaitFor([\"fromTimestamp\", \"extractTimestamp\"], m => SnowflakeUtils = m);\n\nexport let Parser: t.Parser;\nexport let Alerts: t.Alerts;\n\nconst ToastType = {\n MESSAGE: 0,\n SUCCESS: 1,\n FAILURE: 2,\n CUSTOM: 3\n};\nconst ToastPosition = {\n TOP: 0,\n BOTTOM: 1\n};\n\nexport const Toasts = {\n Type: ToastType,\n Position: ToastPosition,\n // what's less likely than getting 0 from Math.random()? Getting it twice in a row\n genId: () => (Math.random() || Math.random()).toString(36).slice(2),\n\n // hack to merge with the following interface, dunno if there's a better way\n ...{} as {\n show(data: {\n message: string,\n id: string,\n /**\n * Toasts.Type\n */\n type: number,\n options?: {\n /**\n * Toasts.Position\n */\n position?: number;\n component?: React.ReactNode,\n duration?: number;\n };\n }): void;\n pop(): void;\n }\n};\n\n/**\n * Show a simple toast. If you need more options, use Toasts.show manually\n */\nexport function showToast(message: string, type = ToastType.MESSAGE) {\n Toasts.show({\n id: Toasts.genId(),\n message,\n type\n });\n}\n\nexport const UserUtils = findByPropsLazy(\"getUser\", \"fetchCurrentUser\") as { getUser: (id: string) => Promise; };\nexport const UploadHandler = findByPropsLazy(\"showUploadFileSizeExceededError\", \"promptToUpload\") as {\n promptToUpload: (files: File[], channel: Channel, draftType: Number) => void;\n};\n\nexport const ApplicationAssetUtils = findByPropsLazy(\"fetchAssetIds\", \"getAssetImage\") as {\n fetchAssetIds: (applicationId: string, e: string[]) => Promise;\n};\n\nexport const Clipboard = mapMangledModuleLazy('document.queryCommandEnabled(\"copy\")||document.queryCommandSupported(\"copy\")', {\n copy: filters.byCode(\".copy(\"),\n SUPPORTS_COPY: x => typeof x === \"boolean\",\n});\n\nexport const NavigationRouter = mapMangledModuleLazy(\"transitionToGuild - \", {\n transitionTo: filters.byCode(\"transitionTo -\"),\n transitionToGuild: filters.byCode(\"transitionToGuild -\"),\n goBack: filters.byCode(\"goBack()\"),\n goForward: filters.byCode(\"goForward()\"),\n});\n\nwaitFor([\"dispatch\", \"subscribe\"], m => {\n FluxDispatcher = m;\n const cb = () => {\n m.unsubscribe(\"CONNECTION_OPEN\", cb);\n _resolveReady();\n };\n m.subscribe(\"CONNECTION_OPEN\", cb);\n});\n\n\n// This is the same module but this is easier\nwaitFor(\"showToast\", m => {\n Toasts.show = m.showToast;\n Toasts.pop = m.popToast;\n});\n\nwaitFor([\"show\", \"close\"], m => Alerts = m);\nwaitFor(\"parseTopic\", m => Parser = m);\n\nexport let SettingsRouter: any;\nwaitFor([\"open\", \"saveAccountChanges\"], m => SettingsRouter = m);\n\nexport const PermissionsBits: t.PermissionsBits = proxyLazy(() => find(m => typeof m.Permissions?.ADMINISTRATOR === \"bigint\").Permissions);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport * from \"./classes\";\nexport * from \"./components\";\nexport * from \"./menu\";\nexport * from \"./react\";\nexport * from \"./settingsStores\";\nexport * from \"./stores\";\nexport * as ComponentTypes from \"./types/components.d\";\nexport * as MenuTypes from \"./types/menu.d\";\nexport * as UtilTypes from \"./types/utils.d\";\nexport * from \"./utils\";\n", "export default \"96126fa\"", "export default \"Vendicated/Vencord\"", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport gitHash from \"~git-hash\";\nimport gitRemote from \"~git-remote\";\n\nexport {\n gitHash,\n gitRemote\n};\n\nexport const WEBPACK_CHUNK = \"webpackChunkdiscord_app\";\nexport const REACT_GLOBAL = \"Vencord.Webpack.Common.React\";\nexport const VENCORD_USER_AGENT = `Vencord/${gitHash}${gitRemote ? ` (https://github.com/${gitRemote})` : \"\"}`;\nexport const SUPPORT_CHANNEL_ID = \"1026515880080842772\";\n\nexport interface Dev {\n name: string;\n id: bigint;\n badge?: boolean;\n}\n\n/**\n * If you made a plugin or substantial contribution, add yourself here.\n * This object is used for the plugin author list, as well as to add a contributor badge to your profile.\n * If you wish to stay fully anonymous, feel free to set ID to 0n.\n * If you are fine with attribution but don't want the badge, add badge: false\n */\nexport const Devs = /* #__PURE__*/ Object.freeze({\n Ven: {\n name: \"Vendicated\",\n id: 343383572805058560n\n },\n Arjix: {\n name: \"ArjixWasTaken\",\n id: 674710789138939916n\n },\n Cyn: {\n name: \"Cynosphere\",\n id: 150745989836308480n\n },\n Megu: {\n name: \"Megumin\",\n id: 545581357812678656n\n },\n botato: {\n name: \"botato\",\n id: 440990343899643943n\n },\n obscurity: {\n name: \"obscurity\",\n id: 336678828233588736n,\n },\n rushii: {\n name: \"rushii\",\n id: 295190422244950017n\n },\n Glitch: {\n name: \"Glitchy\",\n id: 269567451199569920n\n },\n Samu: {\n name: \"Samu\",\n id: 702973430449832038n,\n },\n Animal: {\n name: \"Animal\",\n id: 118437263754395652n\n },\n MaiKokain: {\n name: \"Mai\",\n id: 722647978577363026n\n },\n echo: {\n name: \"ECHO\",\n id: 712639419785412668n\n },\n katlyn: {\n name: \"katlyn\",\n id: 250322741406859265n\n },\n nea: {\n name: \"nea\",\n id: 310702108997320705n,\n },\n Nuckyz: {\n name: \"Nuckyz\",\n id: 235834946571337729n\n },\n D3SOX: {\n name: \"D3SOX\",\n id: 201052085641281538n\n },\n Nickyux: {\n name: \"Nickyux\",\n id: 427146305651998721n\n },\n mantikafasi: {\n name: \"mantikafasi\",\n id: 287555395151593473n\n },\n Xinto: {\n name: \"Xinto\",\n id: 423915768191647755n\n },\n JacobTm: {\n name: \"Jacob.Tm\",\n id: 302872992097107991n\n },\n DustyAngel47: {\n name: \"DustyAngel47\",\n id: 714583473804935238n\n },\n BanTheNons: {\n name: \"BanTheNons\",\n id: 460478012794863637n\n },\n BigDuck: {\n name: \"BigDuck\",\n id: 1024588272623681609n\n },\n AverageReactEnjoyer: {\n name: \"Average React Enjoyer\",\n id: 1004904120056029256n\n },\n adryd: {\n name: \"adryd\",\n id: 0n\n },\n Tyman: {\n name: \"Tyman\",\n id: 487443883127472129n\n },\n afn: {\n name: \"afn\",\n id: 420043923822608384n\n },\n KraXen72: {\n name: \"KraXen72\",\n id: 379304073515499530n\n },\n kemo: {\n name: \"kemo\",\n id: 299693897859465228n\n },\n dzshn: {\n name: \"dzshn\",\n id: 310449948011528192n\n },\n Ducko: {\n name: \"Ducko\",\n id: 506482395269169153n\n },\n jewdev: {\n name: \"jewdev\",\n id: 222369866529636353n\n },\n Luna: {\n name: \"Luny\",\n id: 821472922140803112n\n },\n Vap: {\n name: \"Vap0r1ze\",\n id: 454072114492866560n\n },\n KingFish: {\n name: \"King Fish\",\n id: 499400512559382538n\n },\n Commandtechno: {\n name: \"Commandtechno\",\n id: 296776625432035328n,\n },\n TheSun: {\n name: \"ActuallyTheSun\",\n id: 406028027768733696n\n },\n axyie: {\n name: \"'ax\",\n id: 273562710745284628n,\n },\n pointy: {\n name: \"pointy\",\n id: 99914384989519872n\n },\n SammCheese: {\n name: \"Samm-Cheese\",\n id: 372148345894076416n\n },\n zt: {\n name: \"zt\",\n id: 289556910426816513n\n },\n captain: {\n name: \"Captain\",\n id: 347366054806159360n\n },\n nick: {\n name: \"nick\",\n id: 347884694408265729n,\n badge: false\n },\n whqwert: {\n name: \"whqwert\",\n id: 586239091520176128n\n },\n lewisakura: {\n name: \"lewisakura\",\n id: 96269247411400704n\n },\n RuiNtD: {\n name: \"RuiNtD\",\n id: 157917665162297344n\n },\n hunt: {\n name: \"hunt-g\",\n id: 222800179697287168n\n },\n cloudburst: {\n name: \"cloudburst\",\n id: 892128204150685769n\n },\n Aria: {\n name: \"Syncxv\",\n id: 549244932213309442n,\n },\n TheKodeToad: {\n name: \"TheKodeToad\",\n id: 706152404072267788n\n },\n LordElias: {\n name: \"LordElias\",\n id: 319460781567639554n\n },\n juby: {\n name: \"Juby210\",\n id: 324622488644616195n\n },\n Alyxia: {\n name: \"Alyxia Sother\",\n id: 952185386350829688n\n },\n Remty: {\n name: \"Remty\",\n id: 335055032204656642n\n },\n skyevg: {\n name: \"skyevg\",\n id: 1090310844283363348n\n },\n Dziurwa: {\n name: \"Dziurwa\",\n id: 1001086404203389018n\n },\n AutumnVN: {\n name: \"AutumnVN\",\n id: 393694671383166998n\n },\n pylix: {\n name: \"pylix\",\n id: 492949202121261067n\n },\n Tyler: {\n name: \"\\\\\\\\GGTyler\\\\\\\\\",\n id: 143117463788191746n\n },\n RyanCaoDev: {\n name: \"RyanCaoDev\",\n id: 952235800110694471n,\n },\n Strencher: {\n name: \"Strencher\",\n id: 415849376598982656n\n },\n FieryFlames: {\n name: \"Fiery\",\n id: 890228870559698955n\n },\n KannaDev: {\n name: \"Kanna\",\n id: 317728561106518019n\n },\n carince: {\n name: \"carince\",\n id: 818323528755314698n\n },\n PandaNinjas: {\n name: \"PandaNinjas\",\n id: 455128749071925248n\n },\n CatNoir: {\n name: \"CatNoir\",\n id: 260371016348336128n\n },\n outfoxxed: {\n name: \"outfoxxed\",\n id: 837425748435796060n\n },\n UwUDev: {\n name: \"UwU\",\n id: 691413039156690994n,\n },\n amia: {\n name: \"amia\",\n id: 142007603549962240n\n },\n phil: {\n name: \"phil\",\n id: 305288513941667851n\n },\n ImLvna: {\n name: \"Luna <3\",\n id: 799319081723232267n\n },\n rad: {\n name: \"rad\",\n id: 610945092504780823n\n },\n AndrewDLO: {\n name: \"Andrew-DLO\",\n id: 434135504792059917n\n },\n HypedDomi: {\n name: \"HypedDomi\",\n id: 354191516979429376n\n },\n Rini: {\n name: \"Rini\",\n id: 1079479184478441643n\n },\n castdrian: {\n name: \"castdrian\",\n id: 224617799434108928n\n },\n Arrow: {\n name: \"arrow\",\n id: 958158495302176778n\n },\n bb010g: {\n name: \"bb010g\",\n id: 72791153467990016n,\n },\n Lumap: {\n name: \"lumap\",\n id: 635383782576357407n\n },\n Dolfies: {\n name: \"Dolfies\",\n id: 852892297661906993n,\n },\n RuukuLada: {\n name: \"RuukuLada\",\n id: 119705748346241027n,\n },\n blahajZip: {\n name: \"blahaj.zip\",\n id: 683954422241427471n,\n },\n archeruwu: {\n name: \"archer_uwu\",\n id: 160068695383736320n\n },\n ProffDea: {\n name: \"ProffDea\",\n id: 609329952180928513n\n },\n ant0n: {\n name: \"ant0n\",\n id: 145224646868860928n\n },\n} satisfies Record);\n\n// iife so #__PURE__ works correctly\nexport const DevsById = /* #__PURE__*/ (() =>\n Object.freeze(Object.fromEntries(\n Object.entries(Devs)\n .filter(d => d[1].id !== 0n)\n .map(([_, v]) => [v.id, v] as const)\n ))\n)() as Record;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Clipboard, Toasts } from \"@webpack/common\";\n\nimport { DevsById } from \"./constants\";\n\n/**\n * Recursively merges defaults into an object and returns the same object\n * @param obj Object\n * @param defaults Defaults\n * @returns obj\n */\nexport function mergeDefaults(obj: T, defaults: T): T {\n for (const key in defaults) {\n const v = defaults[key];\n if (typeof v === \"object\" && !Array.isArray(v)) {\n obj[key] ??= {} as any;\n mergeDefaults(obj[key], v);\n } else {\n obj[key] ??= v;\n }\n }\n return obj;\n}\n\n/**\n * Calls .join(\" \") on the arguments\n * classes(\"one\", \"two\") => \"one two\"\n */\nexport function classes(...classes: Array) {\n return classes.filter(Boolean).join(\" \");\n}\n\n/**\n * Returns a promise that resolves after the specified amount of time\n */\nexport function sleep(ms: number): Promise {\n return new Promise(r => setTimeout(r, ms));\n}\n\nexport function copyWithToast(text: string, toastMessage = \"Copied to clipboard!\") {\n if (Clipboard.SUPPORTS_COPY) {\n Clipboard.copy(text);\n } else {\n toastMessage = \"Your browser does not support copying to clipboard\";\n }\n Toasts.show({\n message: toastMessage,\n id: Toasts.genId(),\n type: Toasts.Type.SUCCESS\n });\n}\n\n/**\n * Check if obj is a true object: of type \"object\" and not null or array\n */\nexport function isObject(obj: unknown): obj is object {\n return typeof obj === \"object\" && obj !== null && !Array.isArray(obj);\n}\n\n/**\n * Check if an object is empty or in other words has no own properties\n */\nexport function isObjectEmpty(obj: object) {\n for (const k in obj)\n if (Object.hasOwn(obj, k)) return false;\n\n return true;\n}\n\n/**\n * Returns null if value is not a URL, otherwise return URL object.\n * Avoids having to wrap url checks in a try/catch\n */\nexport function parseUrl(urlString: string): URL | null {\n try {\n return new URL(urlString);\n } catch {\n return null;\n }\n}\n\n/**\n * Checks whether an element is on screen\n */\nexport const checkIntersecting = (el: Element) => {\n const elementBox = el.getBoundingClientRect();\n const documentHeight = Math.max(document.documentElement.clientHeight, window.innerHeight);\n return !(elementBox.bottom < 0 || elementBox.top - documentHeight >= 0);\n};\n\nexport function identity(value: T): T {\n return value;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#mobile_tablet_or_desktop\n// \"In summary, we recommend looking for the string Mobi anywhere in the User Agent to detect a mobile device.\"\nexport const isMobile = navigator.userAgent.includes(\"Mobi\");\n\nexport const isPluginDev = (id: string) => Object.hasOwn(DevsById, id);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { React, useEffect, useMemo, useReducer, useState } from \"@webpack/common\";\n\nimport { makeLazy } from \"./lazy\";\nimport { checkIntersecting } from \"./misc\";\n\nexport const NoopComponent = () => null;\n\n/**\n * Check if an element is on screen\n * @param intersectOnly If `true`, will only update the state when the element comes into view\n * @returns [refCallback, isIntersecting]\n */\nexport const useIntersection = (intersectOnly = false): [\n refCallback: React.RefCallback,\n isIntersecting: boolean,\n] => {\n const observerRef = React.useRef(null);\n const [isIntersecting, setIntersecting] = useState(false);\n\n const refCallback = (element: Element | null) => {\n observerRef.current?.disconnect();\n observerRef.current = null;\n\n if (!element) return;\n\n if (checkIntersecting(element)) {\n setIntersecting(true);\n if (intersectOnly) return;\n }\n\n observerRef.current = new IntersectionObserver(entries => {\n for (const entry of entries) {\n if (entry.target !== element) continue;\n if (entry.isIntersecting && intersectOnly) {\n setIntersecting(true);\n observerRef.current?.disconnect();\n observerRef.current = null;\n } else {\n setIntersecting(entry.isIntersecting);\n }\n }\n });\n observerRef.current.observe(element);\n };\n\n return [refCallback, isIntersecting];\n};\n\ntype AwaiterRes = [T, any, boolean];\ninterface AwaiterOpts {\n fallbackValue: T;\n deps?: unknown[];\n onError?(e: any): void;\n onSuccess?(value: T): void;\n}\n/**\n * Await a promise\n * @param factory Factory\n * @param fallbackValue The fallback value that will be used until the promise resolved\n * @returns [value, error, isPending]\n */\n\nexport function useAwaiter(factory: () => Promise): AwaiterRes;\nexport function useAwaiter(factory: () => Promise, providedOpts: AwaiterOpts): AwaiterRes;\nexport function useAwaiter(factory: () => Promise, providedOpts?: AwaiterOpts): AwaiterRes {\n const opts: Required> = Object.assign({\n fallbackValue: null,\n deps: [],\n onError: null,\n }, providedOpts);\n const [state, setState] = useState({\n value: opts.fallbackValue,\n error: null,\n pending: true\n });\n\n useEffect(() => {\n let isAlive = true;\n if (!state.pending) setState({ ...state, pending: true });\n\n factory()\n .then(value => {\n if (!isAlive) return;\n setState({ value, error: null, pending: false });\n opts.onSuccess?.(value);\n })\n .catch(error => {\n if (!isAlive) return;\n setState({ value: null, error, pending: false });\n opts.onError?.(error);\n });\n\n return () => void (isAlive = false);\n }, opts.deps);\n\n return [state.value, state.error, state.pending];\n}\n/**\n * Returns a function that can be used to force rerender react components\n */\n\nexport function useForceUpdater(): () => void;\nexport function useForceUpdater(withDep: true): [unknown, () => void];\nexport function useForceUpdater(withDep?: true) {\n const r = useReducer(x => x + 1, 0);\n return withDep ? r : r[1];\n}\n/**\n * A lazy component. The factory method is called on first render. For example useful\n * for const Component = LazyComponent(() => findByDisplayName(\"...\").default)\n * @param factory Function returning a Component\n * @param attempts How many times to try to get the component before giving up\n * @returns Result of factory function\n */\n\nexport function LazyComponent(factory: () => React.ComponentType, attempts = 5) {\n const get = makeLazy(factory, attempts);\n return (props: T) => {\n const Component = get() ?? NoopComponent;\n return ;\n };\n}\n\ninterface TimerOpts {\n interval?: number;\n deps?: unknown[];\n}\n\nexport function useTimer({ interval = 1000, deps = [] }: TimerOpts) {\n const [time, setTime] = useState(0);\n const start = useMemo(() => Date.now(), deps);\n\n useEffect(() => {\n const intervalId = setInterval(() => setTime(Date.now() - start), interval);\n\n return () => {\n setTime(0);\n clearInterval(intervalId);\n };\n }, deps);\n\n return time;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./ErrorCard.css\";\n\nimport { classes } from \"@utils/misc\";\nimport type { HTMLProps } from \"react\";\n\nexport function ErrorCard(props: React.PropsWithChildren>) {\n return (\n
\n {props.children}\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Logger } from \"@utils/Logger\";\nimport { Margins } from \"@utils/margins\";\nimport { LazyComponent } from \"@utils/react\";\nimport { React } from \"@webpack/common\";\n\nimport { ErrorCard } from \"./ErrorCard\";\n\ninterface Props {\n /** Render nothing if an error occurs */\n noop?: boolean;\n /** Fallback component to render if an error occurs */\n fallback?: React.ComponentType>;\n /** called when an error occurs. The props property is only available if using .wrap */\n onError?(data: { error: Error, errorInfo: React.ErrorInfo, props: T; }): void;\n /** Custom error message */\n message?: string;\n\n /** The props passed to the wrapped component. Only used by wrap */\n wrappedProps?: T;\n}\n\nconst color = \"#e78284\";\n\nconst logger = new Logger(\"React ErrorBoundary\", color);\n\nconst NO_ERROR = {};\n\n// We might want to import this in a place where React isn't ready yet.\n// Thus, wrap in a LazyComponent\nconst ErrorBoundary = LazyComponent(() => {\n return class ErrorBoundary extends React.PureComponent> {\n state = {\n error: NO_ERROR as any,\n stack: \"\",\n message: \"\"\n };\n\n static getDerivedStateFromError(error: any) {\n let stack = error?.stack ?? \"\";\n let message = error?.message || String(error);\n\n if (error instanceof Error && stack) {\n const eolIdx = stack.indexOf(\"\\n\");\n if (eolIdx !== -1) {\n message = stack.slice(0, eolIdx);\n stack = stack.slice(eolIdx + 1).replace(/https:\\/\\/\\S+\\/assets\\//g, \"\");\n }\n }\n\n return { error, stack, message };\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n this.props.onError?.({ error, errorInfo, props: this.props.wrappedProps });\n logger.error(\"A component threw an Error\\n\", error);\n logger.error(\"Component Stack\", errorInfo.componentStack);\n }\n\n render() {\n if (this.state.error === NO_ERROR) return this.props.children;\n\n if (this.props.noop) return null;\n\n if (this.props.fallback)\n return ;\n\n const msg = this.props.message || \"An error occurred while rendering this Component. More info can be found below and in your console.\";\n\n return (\n \n

Oh no!

\n

{msg}

\n \n {this.state.message}\n {!!this.state.stack && (\n
\n                                {this.state.stack}\n                            
\n )}\n
\n
\n );\n }\n };\n}) as\n React.ComponentType> & {\n wrap(Component: React.ComponentType, errorBoundaryProps?: Omit, \"wrappedProps\">): React.FunctionComponent;\n };\n\nErrorBoundary.wrap = (Component, errorBoundaryProps) => props => (\n \n \n \n);\n\nexport default ErrorBoundary;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function Heart() {\n return (\n \n \n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Button } from \"@webpack/common\";\n\nimport { Heart } from \"./Heart\";\n\nexport default function DonateButton(props: any) {\n return (\n VencordNative.native.openExternal(\"https://github.com/sponsors/Vendicated\")}\n >\n \n Donate\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { React } from \"@webpack/common\";\n\nexport function Flex(props: React.PropsWithChildren<{\n flexDirection?: React.CSSProperties[\"flexDirection\"];\n style?: React.CSSProperties;\n className?: string;\n} & React.HTMLProps>) {\n props.style ??= {};\n props.style.display = \"flex\";\n // TODO(ven): Remove me, what was I thinking??\n props.style.gap ??= \"1em\";\n props.style.flexDirection ||= props.flexDirection;\n delete props.flexDirection;\n return (\n
\n {props.children}\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { filters, findByProps, findByPropsLazy, mapMangledModuleLazy } from \"@webpack\";\nimport type { ComponentType, PropsWithChildren, ReactNode, Ref } from \"react\";\n\nimport { LazyComponent } from \"./react\";\n\nexport const enum ModalSize {\n SMALL = \"small\",\n MEDIUM = \"medium\",\n LARGE = \"large\",\n DYNAMIC = \"dynamic\",\n}\n\nconst enum ModalTransitionState {\n ENTERING,\n ENTERED,\n EXITING,\n EXITED,\n HIDDEN,\n}\n\nexport interface ModalProps {\n transitionState: ModalTransitionState;\n onClose(): Promise;\n}\n\nexport interface ModalOptions {\n modalKey?: string;\n onCloseRequest?: (() => void);\n onCloseCallback?: (() => void);\n}\n\ntype RenderFunction = (props: ModalProps) => ReactNode;\n\nexport const Modals = mapMangledModuleLazy(\".closeWithCircleBackground\", {\n ModalRoot: filters.byCode(\".root\"),\n ModalHeader: filters.byCode(\".header\"),\n ModalContent: filters.byCode(\".content\"),\n ModalFooter: filters.byCode(\".footerSeparator\"),\n ModalCloseButton: filters.byCode(\".closeWithCircleBackground\"),\n}) as {\n ModalRoot: ComponentType>;\n ModalHeader: ComponentType>;\n /** This also accepts Scroller props but good luck with that */\n ModalContent: ComponentType;\n [prop: string]: any;\n }>>;\n ModalFooter: ComponentType>;\n ModalCloseButton: ComponentType<{\n focusProps?: any;\n onClick(): void;\n withCircleBackground?: boolean;\n hideOnFullscreen?: boolean;\n className?: string;\n }>;\n};\n\nexport type ImageModal = ComponentType<{\n className?: string;\n src: string;\n placeholder: string;\n original: string;\n width?: number;\n height?: number;\n animated?: boolean;\n responsive?: boolean;\n renderLinkComponent(props: any): ReactNode;\n maxWidth?: number;\n maxHeight?: number;\n shouldAnimate?: boolean;\n onClose?(): void;\n shouldHideMediaOptions?: boolean;\n}>;\n\nexport const ImageModal = LazyComponent(() => findByProps(\"ImageModal\").ImageModal as ImageModal);\n\nexport const ModalRoot = LazyComponent(() => Modals.ModalRoot);\nexport const ModalHeader = LazyComponent(() => Modals.ModalHeader);\nexport const ModalContent = LazyComponent(() => Modals.ModalContent);\nexport const ModalFooter = LazyComponent(() => Modals.ModalFooter);\nexport const ModalCloseButton = LazyComponent(() => Modals.ModalCloseButton);\n\nconst ModalAPI = findByPropsLazy(\"openModalLazy\");\n\n/**\n * Wait for the render promise to resolve, then open a modal with it.\n * This is equivalent to render().then(openModal)\n * You should use the Modal components exported by this file\n */\nexport function openModalLazy(render: () => Promise, options?: ModalOptions & { contextKey?: string; }): Promise {\n return ModalAPI.openModalLazy(render, options);\n}\n\n/**\n * Open a Modal with the given render function.\n * You should use the Modal components exported by this file\n */\nexport function openModal(render: RenderFunction, options?: ModalOptions, contextKey?: string): string {\n return ModalAPI.openModal(render, options, contextKey);\n}\n\n/**\n * Close a modal by its key\n */\nexport function closeModal(modalKey: string, contextKey?: string): void {\n return ModalAPI.closeModal(modalKey, contextKey);\n}\n\n/**\n * Close all open modals\n */\nexport function closeAllModals(): void {\n return ModalAPI.closeAllModals();\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Command } from \"@api/Commands\";\nimport { FluxEvents } from \"@webpack/types\";\nimport { Promisable } from \"type-fest\";\n\n// exists to export default definePlugin({...})\nexport default function definePlugin

(p: P & Record) {\n return p;\n}\n\nexport type ReplaceFn = (match: string, ...groups: string[]) => string;\n\nexport interface PatchReplacement {\n match: string | RegExp;\n replace: string | ReplaceFn;\n predicate?(): boolean;\n}\n\nexport interface Patch {\n plugin: string;\n find: string;\n replacement: PatchReplacement | PatchReplacement[];\n /** Whether this patch should apply to multiple modules */\n all?: boolean;\n /** Do not warn if this patch did no changes */\n noWarn?: boolean;\n predicate?(): boolean;\n}\n\nexport interface PluginAuthor {\n name: string;\n id: BigInt;\n}\n\nexport interface Plugin extends PluginDef {\n patches?: Patch[];\n started: boolean;\n isDependency?: boolean;\n}\n\nexport interface PluginDef {\n name: string;\n description: string;\n authors: PluginAuthor[];\n start?(): void;\n stop?(): void;\n patches?: Omit[];\n /**\n * List of commands. If you specify these, you must add CommandsAPI to dependencies\n */\n commands?: Command[];\n /**\n * A list of other plugins that your plugin depends on.\n * These will automatically be enabled and loaded before your plugin\n * Common examples are CommandsAPI, MessageEventsAPI...\n */\n dependencies?: string[],\n /**\n * Whether this plugin is required and forcefully enabled\n */\n required?: boolean;\n /**\n * Whether this plugin should be enabled by default, but can be disabled\n */\n enabledByDefault?: boolean;\n /**\n * Optionally provide settings that the user can configure in the Plugins tab of settings.\n * @deprecated Use `settings` instead\n */\n // TODO: Remove when everything is migrated to `settings`\n options?: Record;\n /**\n * Optionally provide settings that the user can configure in the Plugins tab of settings.\n */\n settings?: DefinedSettings;\n /**\n * Check that this returns true before allowing a save to complete.\n * If a string is returned, show the error to the user.\n */\n beforeSave?(options: Record): Promisable;\n /**\n * Allows you to specify a custom Component that will be rendered in your\n * plugin's settings page\n */\n settingsAboutComponent?: React.ComponentType<{\n tempSettings?: Record;\n }>;\n /**\n * Allows you to subscribe to Flux events\n */\n flux?: {\n [E in FluxEvents]?: (event: any) => void;\n };\n /**\n * Allows you to add custom actions to the Vencord Toolbox.\n * The key will be used as text for the button\n */\n toolboxActions?: Record void>;\n\n tags?: string[];\n}\n\nexport const enum OptionType {\n STRING,\n NUMBER,\n BIGINT,\n BOOLEAN,\n SELECT,\n SLIDER,\n COMPONENT,\n}\n\nexport type SettingsDefinition = Record;\nexport type SettingsChecks = {\n [K in keyof D]?: D[K] extends PluginSettingComponentDef ? IsDisabled> :\n (IsDisabled> & IsValid, DefinedSettings>);\n};\n\nexport type PluginSettingDef = (\n | PluginSettingStringDef\n | PluginSettingNumberDef\n | PluginSettingBooleanDef\n | PluginSettingSelectDef\n | PluginSettingSliderDef\n | PluginSettingComponentDef\n | PluginSettingBigIntDef\n) & PluginSettingCommon;\n\nexport interface PluginSettingCommon {\n description: string;\n placeholder?: string;\n onChange?(newValue: any): void;\n /**\n * Whether changing this setting requires a restart\n */\n restartNeeded?: boolean;\n componentProps?: Record;\n /**\n * Hide this setting from the settings UI\n */\n hidden?: boolean;\n /**\n * Set this if the setting only works on Browser or Desktop, not both\n */\n target?: \"WEB\" | \"DESKTOP\" | \"BOTH\";\n}\ninterface IsDisabled {\n /**\n * Checks if this setting should be disabled\n */\n disabled?(this: D): boolean;\n}\ninterface IsValid {\n /**\n * Prevents the user from saving settings if this is false or a string\n */\n isValid?(this: D, value: T): boolean | string;\n}\n\nexport interface PluginSettingStringDef {\n type: OptionType.STRING;\n default?: string;\n}\nexport interface PluginSettingNumberDef {\n type: OptionType.NUMBER;\n default?: number;\n}\nexport interface PluginSettingBigIntDef {\n type: OptionType.BIGINT;\n default?: BigInt;\n}\nexport interface PluginSettingBooleanDef {\n type: OptionType.BOOLEAN;\n default?: boolean;\n}\n\nexport interface PluginSettingSelectDef {\n type: OptionType.SELECT;\n options: readonly PluginSettingSelectOption[];\n}\nexport interface PluginSettingSelectOption {\n label: string;\n value: string | number | boolean;\n default?: boolean;\n}\n\nexport interface PluginSettingSliderDef {\n type: OptionType.SLIDER;\n /**\n * All the possible values in the slider. Needs at least two values.\n */\n markers: number[];\n /**\n * Default value to use\n */\n default: number;\n /**\n * If false, allow users to select values in-between your markers.\n */\n stickToMarkers?: boolean;\n}\n\ninterface IPluginOptionComponentProps {\n /**\n * Run this when the value changes.\n *\n * NOTE: The user will still need to click save to apply these changes.\n */\n setValue(newValue: any): void;\n /**\n * Set to true to prevent the user from saving.\n *\n * NOTE: This will not show the error to the user. It will only stop them saving.\n * Make sure to show the error in your component.\n */\n setError(error: boolean): void;\n /**\n * The options object\n */\n option: PluginSettingComponentDef;\n}\n\nexport interface PluginSettingComponentDef {\n type: OptionType.COMPONENT;\n component: (props: IPluginOptionComponentProps) => JSX.Element;\n}\n\n/** Maps a `PluginSettingDef` to its value type */\ntype PluginSettingType = O extends PluginSettingStringDef ? string :\n O extends PluginSettingNumberDef ? number :\n O extends PluginSettingBigIntDef ? BigInt :\n O extends PluginSettingBooleanDef ? boolean :\n O extends PluginSettingSelectDef ? O[\"options\"][number][\"value\"] :\n O extends PluginSettingSliderDef ? number :\n O extends PluginSettingComponentDef ? any :\n never;\ntype PluginSettingDefaultType = O extends PluginSettingSelectDef ? (\n O[\"options\"] extends { default?: boolean; }[] ? O[\"options\"][number][\"value\"] : undefined\n) : O extends { default: infer T; } ? T : undefined;\n\ntype SettingsStore = {\n [K in keyof D]: PluginSettingType | PluginSettingDefaultType;\n};\n\n/** An instance of defined plugin settings */\nexport interface DefinedSettings<\n Def extends SettingsDefinition = SettingsDefinition,\n Checks extends SettingsChecks = {},\n PrivateSettings extends object = {}\n> {\n /** Shorthand for `Vencord.Settings.plugins.PluginName`, but with typings */\n store: SettingsStore & PrivateSettings;\n /**\n * React hook for getting the settings for this plugin\n * @param filter optional filter to avoid rerenders for irrelevent settings\n */\n use>(filter?: F[]): Pick & PrivateSettings, F>;\n /** Definitions of each setting */\n def: Def;\n /** Setting methods with return values that could rely on other settings */\n checks: Checks;\n /**\n * Name of the plugin these settings belong to,\n * will be an empty string until plugin is initialized\n */\n pluginName: string;\n\n withPrivateSettings(): DefinedSettings;\n}\n\nexport type PartialExcept = Partial & Required>;\n\nexport type IpcRes = { ok: true; value: V; } | { ok: false, error: any; };\n\n/* -------------------------------------------- */\n/* Legacy Options Types */\n/* -------------------------------------------- */\n\nexport type PluginOptionBase = PluginSettingCommon & IsDisabled;\nexport type PluginOptionsItem =\n | PluginOptionString\n | PluginOptionNumber\n | PluginOptionBoolean\n | PluginOptionSelect\n | PluginOptionSlider\n | PluginOptionComponent;\nexport type PluginOptionString = PluginSettingStringDef & PluginSettingCommon & IsDisabled & IsValid;\nexport type PluginOptionNumber = (PluginSettingNumberDef | PluginSettingBigIntDef) & PluginSettingCommon & IsDisabled & IsValid;\nexport type PluginOptionBoolean = PluginSettingBooleanDef & PluginSettingCommon & IsDisabled & IsValid;\nexport type PluginOptionSelect = PluginSettingSelectDef & PluginSettingCommon & IsDisabled & IsValid;\nexport type PluginOptionSlider = PluginSettingSliderDef & PluginSettingCommon & IsDisabled & IsValid;\nexport type PluginOptionComponent = PluginSettingComponentDef & PluginSettingCommon;\n\nexport type PluginNative any>> = {\n [key in keyof PluginExports]:\n PluginExports[key] extends (event: Electron.IpcMainInvokeEvent, ...args: infer Args) => infer Return\n ? (...args: Args) => Return extends Promise ? Return : Promise\n : never;\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { BadgePosition, BadgeUserArgs, ProfileBadge } from \"@api/Badges\";\nimport DonateButton from \"@components/DonateButton\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { Heart } from \"@components/Heart\";\nimport { Devs } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport { Margins } from \"@utils/margins\";\nimport { isPluginDev } from \"@utils/misc\";\nimport { closeModal, Modals, openModal } from \"@utils/modal\";\nimport definePlugin from \"@utils/types\";\nimport { Forms, Toasts } from \"@webpack/common\";\n\nconst CONTRIBUTOR_BADGE = \"https://cdn.discordapp.com/attachments/1033680203433660458/1092089947126780035/favicon.png\";\n\nconst ContributorBadge: ProfileBadge = {\n description: \"Vencord Contributor\",\n image: CONTRIBUTOR_BADGE,\n position: BadgePosition.START,\n props: {\n style: {\n borderRadius: \"50%\",\n transform: \"scale(0.9)\" // The image is a bit too big compared to default badges\n }\n },\n shouldShow: ({ user }) => isPluginDev(user.id),\n link: \"https://github.com/Vendicated/Vencord\"\n};\n\nlet DonorBadges = {} as Record[]>;\n\nasync function loadBadges(noCache = false) {\n DonorBadges = {};\n\n const init = {} as RequestInit;\n if (noCache)\n init.cache = \"no-cache\";\n\n const badges = await fetch(\"https://gist.githubusercontent.com/Vendicated/51a3dd775f6920429ec6e9b735ca7f01/raw/badges.csv\", init)\n .then(r => r.text());\n\n const lines = badges.trim().split(\"\\n\");\n if (lines.shift() !== \"id,tooltip,image\") {\n new Logger(\"BadgeAPI\").error(\"Invalid badges.csv file!\");\n return;\n }\n\n for (const line of lines) {\n const [id, description, image] = line.split(\",\");\n (DonorBadges[id] ??= []).push({ image, description });\n }\n}\n\nexport default definePlugin({\n name: \"BadgeAPI\",\n description: \"API to add badges to users.\",\n authors: [Devs.Megu, Devs.Ven, Devs.TheSun],\n required: true,\n patches: [\n /* Patch the badge list component on user profiles */\n {\n find: \"Messages.PROFILE_USER_BADGES,role:\",\n replacement: [\n {\n match: /&&(\\i)\\.push\\(\\{id:\"premium\".+?\\}\\);/,\n replace: \"$&$1.unshift(...Vencord.Api.Badges._getBadges(arguments[0]));\",\n },\n {\n // alt: \"\", aria-hidden: false, src: originalSrc\n match: /alt:\" \",\"aria-hidden\":!0,src:(?=(\\i)\\.src)/,\n // ...badge.props, ..., src: badge.image ?? ...\n replace: \"...$1.props,$& $1.image??\"\n },\n // replace their component with ours if applicable\n {\n match: /(?<=text:(\\i)\\.description,spacing:12,)children:/,\n replace: \"children:$1.component ? () => $self.renderBadgeComponent($1) :\"\n },\n // conditionally override their onClick with badge.onClick if it exists\n {\n match: /href:(\\i)\\.link/,\n replace: \"...($1.onClick && { onClick: $1.onClick }),$&\"\n }\n ]\n }\n ],\n\n toolboxActions: {\n async \"Refetch Badges\"() {\n await loadBadges(true);\n Toasts.show({\n id: Toasts.genId(),\n message: \"Successfully refetched badges!\",\n type: Toasts.Type.SUCCESS\n });\n }\n },\n\n async start() {\n Vencord.Api.Badges.addBadge(ContributorBadge);\n await loadBadges();\n },\n\n renderBadgeComponent: ErrorBoundary.wrap((badge: ProfileBadge & BadgeUserArgs) => {\n const Component = badge.component!;\n return ;\n }, { noop: true }),\n\n\n getDonorBadges(userId: string) {\n return DonorBadges[userId]?.map(badge => ({\n ...badge,\n position: BadgePosition.START,\n props: {\n style: {\n borderRadius: \"50%\",\n transform: \"scale(0.9)\" // The image is a bit too big compared to default badges\n }\n },\n onClick() {\n const modalKey = openModal(props => (\n {\n closeModal(modalKey);\n VencordNative.native.openExternal(\"https://github.com/sponsors/Vendicated\");\n }}>\n \n \n \n \n \n Vencord Donor\n \n \n \n \n \n \n \n \n

\n \n This Badge is a special perk for Vencord Donors\n \n \n Please consider supporting the development of Vencord by becoming a donor. It would mean a lot!!\n \n
\n \n \n \n \n \n \n \n \n ));\n },\n }));\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"CommandsAPI\",\n authors: [Devs.Arjix],\n description: \"Api required by anything that uses commands\",\n patches: [\n // obtain BUILT_IN_COMMANDS instance\n {\n find: ',\"tenor\"',\n replacement: [\n {\n // Matches BUILT_IN_COMMANDS. This is not exported so this is\n // the only way. _init() just returns the same object to make the\n // patch simpler\n\n // textCommands = builtInCommands.filter(...)\n match: /(?<=\\w=)(\\w)(\\.filter\\(.{0,60}tenor)/,\n replace: \"Vencord.Api.Commands._init($1)$2\",\n }\n ],\n },\n // command error handling\n {\n find: \"Unexpected value for option\",\n replacement: {\n // return [2, cmd.execute(args, ctx)]\n match: /,(\\i)\\.execute\\((\\i),(\\i)\\)/,\n replace: (_, cmd, args, ctx) => `,Vencord.Api.Commands._handleCommand(${cmd}, ${args}, ${ctx})`\n }\n },\n // Show plugin name instead of \"Built-In\"\n {\n find: \".source,children\",\n replacement: {\n // ...children: p?.name\n match: /(?<=:(.{1,3})\\.displayDescription\\}.{0,200}\\.source,children:)[^}]+/,\n replace: \"$1.plugin||($&)\"\n }\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"ContextMenuAPI\",\n description: \"API for adding/removing items to/from context menus.\",\n authors: [Devs.Nuckyz, Devs.Ven],\n required: true,\n\n patches: [\n {\n find: \"\u266B (\u3064\uFF61\u25D5\u203F\u203F\u25D5\uFF61)\u3064 \u266A\",\n replacement: {\n match: /let{navId:/,\n replace: \"Vencord.Api.ContextMenu._patchContextMenu(arguments[0]);$&\"\n }\n },\n {\n find: \".Menu,{\",\n all: true,\n replacement: {\n match: /Menu,{(?<=\\.jsxs?\\)\\(\\i\\.Menu,{)/g,\n replace: \"$&contextMenuApiArguments:typeof arguments!=='undefined'?arguments:[],\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"MemberListDecoratorsAPI\",\n description: \"API to add decorators to member list (both in servers and DMs)\",\n authors: [Devs.TheSun, Devs.Ven],\n patches: [\n {\n find: \".lostPermission)\",\n replacement: [\n {\n match: /let\\{[^}]*lostPermissionTooltipText:\\i[^}]*\\}=(\\i),/,\n replace: \"$&vencordProps=$1,\"\n }, {\n match: /decorators:.{0,100}?children:\\[/,\n replace: \"$&...(typeof vencordProps=='undefined'?[]:Vencord.Api.MemberListDecorators.__getDecorators(vencordProps)),\"\n }\n ]\n },\n {\n find: \"PrivateChannel.renderAvatar\",\n replacement: {\n match: /decorators:(\\i\\.isSystemDM\\(\\))\\?(.+?):null/,\n replace: \"decorators:[...Vencord.Api.MemberListDecorators.__getDecorators(arguments[0]), $1?$2:null]\"\n }\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"MessageAccessoriesAPI\",\n description: \"API to add message accessories.\",\n authors: [Devs.Cyn],\n patches: [\n {\n find: \".Messages.REMOVE_ATTACHMENT_BODY\",\n replacement: {\n match: /(?<=.container\\)?,children:)(\\[.+?\\])/,\n replace: \"Vencord.Api.MessageAccessories._modifyAccessories($1,this.props)\",\n },\n },\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"MessageDecorationsAPI\",\n description: \"API to add decorations to messages\",\n authors: [Devs.TheSun],\n patches: [\n {\n find: '\"Message Username\"',\n replacement: {\n match: /\\.Messages\\.GUILD_COMMUNICATION_DISABLED_BOTTOM_SHEET_TITLE.+?}\\),\\i(?=\\])/,\n replace: \"$&,...Vencord.Api.MessageDecorations.__addDecorationsToMessage(arguments[0])\"\n }\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"MessageEventsAPI\",\n description: \"Api required by anything using message events.\",\n authors: [Devs.Arjix, Devs.hunt, Devs.Ven],\n patches: [\n {\n find: '\"MessageActionCreators\"',\n replacement: {\n match: /async editMessage\\(.+?\\)\\{/,\n replace: \"$&await Vencord.Api.MessageEvents._handlePreEdit(...arguments);\"\n }\n },\n {\n find: \".handleSendMessage=\",\n replacement: {\n // props.chatInputType...then((function(isMessageValid)... var parsedMessage = b.c.parse(channel,... var replyOptions = f.g.getSendMessageOptionsForReply(pendingReply);\n // Lookbehind: validateMessage)({openWarningPopout:..., type: i.props.chatInputType, content: t, stickers: r, ...}).then((function(isMessageValid)\n match: /(type:this\\.props\\.chatInputType.+?\\.then\\()(\\i=>\\{.+?let (\\i)=\\i\\.\\i\\.parse\\((\\i),.+?let (\\i)=\\i\\.\\i\\.getSendMessageOptionsForReply\\(\\i\\);)(?<=\\)\\(({.+?})\\)\\.then.+?)/,\n // props.chatInputType...then((async function(isMessageValid)... var replyOptions = f.g.getSendMessageOptionsForReply(pendingReply); if(await Vencord.api...) return { shoudClear:true, shouldRefocus:true };\n replace: (_, rest1, rest2, parsedMessage, channel, replyOptions, extra) => \"\" +\n `${rest1}async ${rest2}` +\n `if(await Vencord.Api.MessageEvents._handlePreSend(${channel}.id,${parsedMessage},${extra},${replyOptions}))` +\n \"return{shoudClear:true,shouldRefocus:true};\"\n }\n },\n {\n find: '(\"interactionUsernameProfile',\n replacement: {\n match: /let\\{id:\\i}=(\\i),{id:\\i}=(\\i);return \\i\\.useCallback\\((\\i)=>\\{/,\n replace: (m, message, channel, event) =>\n // the message param is shadowed by the event param, so need to alias them\n `const vcMsg=${message},vcChan=${channel};${m}Vencord.Api.MessageEvents._handleClick(vcMsg, vcChan, ${event});`\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"MessagePopoverAPI\",\n description: \"API to add buttons to message popovers.\",\n authors: [Devs.KingFish, Devs.Ven, Devs.Nuckyz],\n patches: [{\n find: \"Messages.MESSAGE_UTILITIES_A11Y_LABEL\",\n replacement: {\n // foo && !bar ? createElement(reactionStuffs)... createElement(blah,...makeElement(reply-other))\n match: /\\i&&!\\i\\?\\(0,\\i\\.jsxs?\\)\\(.{0,200}renderEmojiPicker:.{0,500}\\?(\\i)\\(\\{key:\"reply-other\"/,\n replace: (m, makeElement) => {\n const msg = m.match(/message:(.{1,3}),/)?.[1];\n if (!msg) throw new Error(\"Could not find message variable\");\n return `...Vencord.Api.MessagePopover._buildPopoverElements(${msg},${makeElement}),${m}`;\n }\n }\n }],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NoticesAPI\",\n description: \"Fixes notices being automatically dismissed\",\n authors: [Devs.Ven],\n required: true,\n patches: [\n {\n find: 'displayName=\"NoticeStore\"',\n replacement: [\n {\n match: /\\i=null;(?=.{0,80}getPremiumSubscription\\(\\))/g,\n replace: \"if(Vencord.Api.Notices.currentNotice)return false;$&\"\n },\n {\n match: /(?<=,NOTICE_DISMISS:function\\(\\i\\){)return null!=(\\i)/,\n replace: \"if($1.id==\\\"VencordNotice\\\")return($1=null,Vencord.Api.Notices.nextNotice(),true);$&\"\n }\n ]\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"ServerListAPI\",\n authors: [Devs.kemo],\n description: \"Api required for plugins that modify the server list\",\n patches: [\n {\n find: \"Messages.DISCODO_DISABLED\",\n replacement: {\n match: /(?<=Messages\\.DISCODO_DISABLED.+?return)(\\(.{0,75}?tutorialContainer.+?}\\))(?=}function)/,\n replace: \"[$1].concat(Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.Above))\"\n }\n },\n {\n find: \"Messages.SERVERS,children\",\n replacement: {\n match: /(?<=Messages\\.SERVERS,children:).+?default:return null\\}\\}\\)/,\n replace: \"Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.In).concat($&)\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NoTrack\",\n description: \"Disable Discord's tracking ('science'), metrics and Sentry crash reporting\",\n authors: [Devs.Cyn, Devs.Ven, Devs.Nuckyz, Devs.Arrow],\n required: true,\n patches: [\n {\n find: \"AnalyticsActionHandlers.handle\",\n replacement: {\n match: /^.+$/,\n replace: \"()=>{}\",\n },\n },\n {\n find: \"window.DiscordSentry=\",\n replacement: {\n match: /^.+$/,\n replace: \"()=>{}\",\n }\n },\n {\n find: \".METRICS,\",\n replacement: [\n {\n match: /this\\._intervalId=/,\n replace: \"this._intervalId=undefined&&\"\n },\n {\n match: /(increment\\(\\i\\){)/,\n replace: \"$1return;\"\n }\n ]\n },\n {\n find: \".installedLogHooks)\",\n replacement: {\n // if getDebugLogging() returns false, the hooks don't get installed.\n match: \"getDebugLogging(){\",\n replace: \"getDebugLogging(){return false;\"\n }\n },\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Logger } from \"@utils/Logger\";\nimport type { ReactElement } from \"react\";\n\ntype ContextMenuPatchCallbackReturn = (() => void) | void;\n/**\n * @param children The rendered context menu elements\n * @param args Any arguments passed into making the context menu, like the guild, channel, user or message for example\n * @returns A callback which is only ran once used to modify the context menu elements (Use to avoid duplicates)\n */\nexport type NavContextMenuPatchCallback = (children: Array, ...args: Array) => ContextMenuPatchCallbackReturn;\n/**\n * @param navId The navId of the context menu being patched\n * @param children The rendered context menu elements\n * @param args Any arguments passed into making the context menu, like the guild, channel, user or message for example\n * @returns A callback which is only ran once used to modify the context menu elements (Use to avoid duplicates)\n */\nexport type GlobalContextMenuPatchCallback = (navId: string, children: Array, ...args: Array) => ContextMenuPatchCallbackReturn;\n\nconst ContextMenuLogger = new Logger(\"ContextMenu\");\n\nexport const navPatches = new Map>();\nexport const globalPatches = new Set();\n\n/**\n * Add a context menu patch\n * @param navId The navId(s) for the context menu(s) to patch\n * @param patch The patch to be applied\n */\nexport function addContextMenuPatch(navId: string | Array, patch: NavContextMenuPatchCallback) {\n if (!Array.isArray(navId)) navId = [navId];\n for (const id of navId) {\n let contextMenuPatches = navPatches.get(id);\n if (!contextMenuPatches) {\n contextMenuPatches = new Set();\n navPatches.set(id, contextMenuPatches);\n }\n\n contextMenuPatches.add(patch);\n }\n}\n\n/**\n * Add a global context menu patch that fires the patch for all context menus\n * @param patch The patch to be applied\n */\nexport function addGlobalContextMenuPatch(patch: GlobalContextMenuPatchCallback) {\n globalPatches.add(patch);\n}\n\n/**\n * Remove a context menu patch\n * @param navId The navId(s) for the context menu(s) to remove the patch\n * @param patch The patch to be removed\n * @returns Whether the patch was successfully removed from the context menu(s)\n */\nexport function removeContextMenuPatch>(navId: T, patch: NavContextMenuPatchCallback): T extends string ? boolean : Array {\n const navIds = Array.isArray(navId) ? navId : [navId as string];\n\n const results = navIds.map(id => navPatches.get(id)?.delete(patch) ?? false);\n\n return (Array.isArray(navId) ? results : results[0]) as T extends string ? boolean : Array;\n}\n\n/**\n * Remove a global context menu patch\n * @param patch The patch to be removed\n * @returns Whether the patch was successfully removed\n */\nexport function removeGlobalContextMenuPatch(patch: GlobalContextMenuPatchCallback): boolean {\n return globalPatches.delete(patch);\n}\n\n/**\n * A helper function for finding the children array of a group nested inside a context menu based on the id(s) of its children\n * @param id The id of the child. If an array is specified, all ids will be tried\n * @param children The context menu children\n */\nexport function findGroupChildrenByChildId(id: string | string[], children: Array, _itemsArray?: Array): Array | null {\n for (const child of children) {\n if (child == null) continue;\n\n if (\n (Array.isArray(id) && id.some(id => child.props?.id === id))\n || child.props?.id === id\n ) return _itemsArray ?? null;\n\n let nextChildren = child.props?.children;\n if (nextChildren) {\n if (!Array.isArray(nextChildren)) {\n nextChildren = [nextChildren];\n child.props.children = nextChildren;\n }\n\n const found = findGroupChildrenByChildId(id, nextChildren, nextChildren);\n if (found !== null) return found;\n }\n }\n\n return null;\n}\n\ninterface ContextMenuProps {\n contextMenuApiArguments?: Array;\n navId: string;\n children: Array;\n \"aria-label\": string;\n onSelect: (() => void) | undefined;\n onClose: (callback: (...args: Array) => any) => void;\n}\n\nconst patchedMenus = new WeakSet();\n\nexport function _patchContextMenu(props: ContextMenuProps) {\n props.contextMenuApiArguments ??= [];\n const contextMenuPatches = navPatches.get(props.navId);\n\n if (!Array.isArray(props.children)) props.children = [props.children];\n\n if (contextMenuPatches) {\n for (const patch of contextMenuPatches) {\n try {\n const callback = patch(props.children, ...props.contextMenuApiArguments);\n if (!patchedMenus.has(props)) callback?.();\n } catch (err) {\n ContextMenuLogger.error(`Patch for ${props.navId} errored,`, err);\n }\n }\n }\n\n for (const patch of globalPatches) {\n try {\n const callback = patch(props.navId, props.children, ...props.contextMenuApiArguments);\n if (!patchedMenus.has(props)) callback?.();\n } catch (err) {\n ContextMenuLogger.error(\"Global patch errored,\", err);\n }\n }\n\n patchedMenus.add(props);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n/**\n * Returns a new function that will call the wrapped function\n * after the specified delay. If the function is called again\n * within the delay, the timer will be reset.\n * @param func The function to wrap\n * @param delay The delay in milliseconds\n */\nexport function debounce(func: T, delay = 300): T {\n let timeout: NodeJS.Timeout;\n return function (...args: any[]) {\n clearTimeout(timeout);\n timeout = setTimeout(() => { func(...args); }, delay);\n } as any;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const { localStorage } = window;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Promisable } from \"type-fest\";\n\n/**\n * A queue that can be used to run tasks consecutively.\n * Highly recommended for things like fetching data from Discord\n */\nexport class Queue {\n /**\n * @param maxSize The maximum amount of functions that can be queued at once.\n * If the queue is full, the oldest function will be removed.\n */\n constructor(public readonly maxSize = Infinity) { }\n\n private queue = [] as Array<() => Promisable>;\n\n private promise?: Promise;\n\n private next() {\n const func = this.queue.shift();\n if (func)\n this.promise = Promise.resolve()\n .then(func)\n .finally(() => this.next());\n else\n this.promise = undefined;\n }\n\n private run() {\n if (!this.promise)\n this.next();\n }\n\n /**\n * Append a task at the end of the queue. This task will be executed after all other tasks\n * If the queue exceeds the specified maxSize, the first task in queue will be removed.\n * @param func Task\n */\n push(func: () => Promisable) {\n if (this.size >= this.maxSize)\n this.queue.shift();\n\n this.queue.push(func);\n this.run();\n }\n\n /**\n * Prepend a task at the beginning of the queue. This task will be executed next\n * If the queue exceeds the specified maxSize, the last task in queue will be removed.\n * @param func Task\n */\n unshift(func: () => Promisable) {\n if (this.size >= this.maxSize)\n this.queue.pop();\n\n this.queue.unshift(func);\n this.run();\n }\n\n /**\n * The amount of tasks in the queue\n */\n get size() {\n return this.queue.length;\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport { useSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { classes } from \"@utils/misc\";\nimport { React, useEffect, useMemo, useState, useStateFromStores, WindowStore } from \"@webpack/common\";\n\nimport { NotificationData } from \"./Notifications\";\n\nexport default ErrorBoundary.wrap(function NotificationComponent({\n title,\n body,\n richBody,\n color,\n icon,\n onClick,\n onClose,\n image,\n permanent,\n className,\n dismissOnClick\n}: NotificationData & { className?: string; }) {\n const { timeout, position } = useSettings([\"notifications.timeout\", \"notifications.position\"]).notifications;\n const hasFocus = useStateFromStores([WindowStore], () => WindowStore.isFocused());\n\n const [isHover, setIsHover] = useState(false);\n const [elapsed, setElapsed] = useState(0);\n\n const start = useMemo(() => Date.now(), [timeout, isHover, hasFocus]);\n\n useEffect(() => {\n if (isHover || !hasFocus || timeout === 0 || permanent) return void setElapsed(0);\n\n const intervalId = setInterval(() => {\n const elapsed = Date.now() - start;\n if (elapsed >= timeout)\n onClose!();\n else\n setElapsed(elapsed);\n }, 10);\n\n return () => clearInterval(intervalId);\n }, [timeout, isHover, hasFocus]);\n\n const timeoutProgress = elapsed / timeout;\n\n return (\n {\n onClick?.();\n if (dismissOnClick !== false)\n onClose!();\n }}\n onContextMenu={e => {\n e.preventDefault();\n e.stopPropagation();\n onClose!();\n }}\n onMouseEnter={() => setIsHover(true)}\n onMouseLeave={() => setIsHover(false)}\n >\n
\n {icon && \"\"}\n
\n
\n

{title}

\n {\n e.preventDefault();\n e.stopPropagation();\n onClose!();\n }}\n >\n \n Dismiss Notification\n \n \n \n
\n
\n {richBody ??

{body}

}\n
\n
\n
\n {image && \"\"}\n {timeout !== 0 && !permanent && (\n \n )}\n \n );\n}, {\n onError: ({ props }) => props.onClose!()\n});\n", "/* eslint-disable simple-header/header */\n\n/*!\n * idb-keyval v6.2.0\n * Copyright 2016, Jake Archibald\n * Copyright 2022, Vendicated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function promisifyRequest(\n request: IDBRequest | IDBTransaction,\n): Promise {\n return new Promise((resolve, reject) => {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-ignore - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\n\nexport function createStore(dbName: string, storeName: string): UseStore {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const dbp = promisifyRequest(request);\n\n return (txMode, callback) =>\n dbp.then(db =>\n callback(db.transaction(storeName, txMode).objectStore(storeName)),\n );\n}\n\nexport type UseStore = (\n txMode: IDBTransactionMode,\n callback: (store: IDBObjectStore) => T | PromiseLike,\n) => Promise;\n\nlet defaultGetStoreFunc: UseStore | undefined;\n\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore(\"VencordData\", \"VencordStore\");\n }\n return defaultGetStoreFunc;\n}\n\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function get(\n key: IDBValidKey,\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readonly\", store => promisifyRequest(store.get(key)));\n}\n\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function set(\n key: IDBValidKey,\n value: any,\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readwrite\", store => {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic \u2013 if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function setMany(\n entries: [IDBValidKey, any][],\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readwrite\", store => {\n entries.forEach(entry => store.put(entry[1], entry[0]));\n return promisifyRequest(store.transaction);\n });\n}\n\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function getMany(\n keys: IDBValidKey[],\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readonly\", store =>\n Promise.all(keys.map(key => promisifyRequest(store.get(key)))),\n );\n}\n\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function update(\n key: IDBValidKey,\n updater: (oldValue: T | undefined) => T,\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\n \"readwrite\",\n store =>\n // Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise((resolve, reject) => {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n } catch (err) {\n reject(err);\n }\n };\n }),\n );\n}\n\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function del(\n key: IDBValidKey,\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readwrite\", store => {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function delMany(\n keys: IDBValidKey[],\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readwrite\", (store: IDBObjectStore) => {\n keys.forEach((key: IDBValidKey) => store.delete(key));\n return promisifyRequest(store.transaction);\n });\n}\n\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function clear(customStore = defaultGetStore()): Promise {\n return customStore(\"readwrite\", store => {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\n\nfunction eachCursor(\n store: IDBObjectStore,\n callback: (cursor: IDBCursorWithValue) => void,\n): Promise {\n store.openCursor().onsuccess = function () {\n if (!this.result) return;\n callback(this.result);\n this.result.continue();\n };\n return promisifyRequest(store.transaction);\n}\n\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function keys(\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readonly\", store => {\n // Fast path for modern browsers\n if (store.getAllKeys) {\n return promisifyRequest(\n store.getAllKeys() as unknown as IDBRequest,\n );\n }\n\n const items: KeyType[] = [];\n\n return eachCursor(store, cursor =>\n items.push(cursor.key as KeyType),\n ).then(() => items);\n });\n}\n\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function values(customStore = defaultGetStore()): Promise {\n return customStore(\"readonly\", store => {\n // Fast path for modern browsers\n if (store.getAll) {\n return promisifyRequest(store.getAll() as IDBRequest);\n }\n\n const items: T[] = [];\n\n return eachCursor(store, cursor => items.push(cursor.value as T)).then(\n () => items,\n );\n });\n}\n\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function entries(\n customStore = defaultGetStore(),\n): Promise<[KeyType, ValueType][]> {\n return customStore(\"readonly\", store => {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) {\n return Promise.all([\n promisifyRequest(\n store.getAllKeys() as unknown as IDBRequest,\n ),\n promisifyRequest(store.getAll() as IDBRequest),\n ]).then(([keys, values]) => keys.map((key, i) => [key, values[i]]));\n }\n\n const items: [KeyType, ValueType][] = [];\n\n return customStore(\"readonly\", store =>\n eachCursor(store, cursor =>\n items.push([cursor.key as KeyType, cursor.value]),\n ).then(() => items),\n );\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { MapValue } from \"type-fest/source/entry\";\n\nexport type Style = MapValue;\n\nexport const styleMap = window.VencordStyles ??= new Map();\n\nexport function requireStyle(name: string) {\n const style = styleMap.get(name);\n if (!style) throw new Error(`Style \"${name}\" does not exist`);\n return style;\n}\n\n/**\n * A style's name can be obtained from importing a stylesheet with `?managed` at the end of the import\n * @param name The name of the style\n * @returns `false` if the style was already enabled, `true` otherwise\n * @example\n * import pluginStyle from \"./plugin.css?managed\";\n *\n * // Inside some plugin method like \"start()\" or \"[option].onChange()\"\n * enableStyle(pluginStyle);\n */\nexport function enableStyle(name: string) {\n const style = requireStyle(name);\n\n if (style.dom?.isConnected)\n return false;\n\n if (!style.dom) {\n style.dom = document.createElement(\"style\");\n style.dom.dataset.vencordName = style.name;\n }\n compileStyle(style);\n\n document.head.appendChild(style.dom);\n return true;\n}\n\n/**\n * @param name The name of the style\n * @returns `false` if the style was already disabled, `true` otherwise\n * @see {@link enableStyle} for info on getting the name of an imported style\n */\nexport function disableStyle(name: string) {\n const style = requireStyle(name);\n if (!style.dom?.isConnected)\n return false;\n\n style.dom.remove();\n style.dom = null;\n return true;\n}\n\n/**\n * @param name The name of the style\n * @returns `true` in most cases, may return `false` in some edge cases\n * @see {@link enableStyle} for info on getting the name of an imported style\n */\nexport const toggleStyle = (name: string) => isStyleEnabled(name) ? disableStyle(name) : enableStyle(name);\n\n/**\n * @param name The name of the style\n * @returns Whether the style is enabled\n * @see {@link enableStyle} for info on getting the name of an imported style\n */\nexport const isStyleEnabled = (name: string) => requireStyle(name).dom?.isConnected ?? false;\n\n/**\n * Sets the variables of a style\n * ```ts\n * // -- plugin.ts --\n * import pluginStyle from \"./plugin.css?managed\";\n * import { setStyleVars } from \"@api/Styles\";\n * import { findByPropsLazy } from \"@webpack\";\n * const classNames = findByPropsLazy(\"thin\", \"scrollerBase\"); // { thin: \"thin-31rlnD scrollerBase-_bVAAt\", ... }\n *\n * // Inside some plugin method like \"start()\"\n * setStyleClassNames(pluginStyle, classNames);\n * enableStyle(pluginStyle);\n * ```\n * ```scss\n * // -- plugin.css --\n * .plugin-root [--thin]::-webkit-scrollbar { ... }\n * ```\n * ```scss\n * // -- final stylesheet --\n * .plugin-root .thin-31rlnD.scrollerBase-_bVAAt::-webkit-scrollbar { ... }\n * ```\n * @param name The name of the style\n * @param classNames An object where the keys are the variable names and the values are the variable values\n * @param recompile Whether to recompile the style after setting the variables, defaults to `true`\n * @see {@link enableStyle} for info on getting the name of an imported style\n */\nexport const setStyleClassNames = (name: string, classNames: Record, recompile = true) => {\n const style = requireStyle(name);\n style.classNames = classNames;\n if (recompile && isStyleEnabled(style.name))\n compileStyle(style);\n};\n\n/**\n * Updates the stylesheet after doing the following to the sourcecode:\n * - Interpolate style classnames\n * @param style **_Must_ be a style with a DOM element**\n * @see {@link setStyleClassNames} for more info on style classnames\n */\nexport const compileStyle = (style: Style) => {\n if (!style.dom) throw new Error(\"Style has no DOM element\");\n\n style.dom.textContent = style.source\n .replace(/\\[--(\\w+)\\]/g, (match, name) => {\n const className = style.classNames[name];\n return className ? classNameToSelector(className) : match;\n });\n};\n\n/**\n * @param name The classname\n * @param prefix A prefix to add each class, defaults to `\"\"`\n * @return A css selector for the classname\n * @example\n * classNameToSelector(\"foo bar\") // => \".foo.bar\"\n */\nexport const classNameToSelector = (name: string, prefix = \"\") => name.split(\" \").map(n => `.${prefix}${n}`).join(\"\");\n\ntype ClassNameFactoryArg = string | string[] | Record | false | null | undefined | 0 | \"\";\n/**\n * @param prefix The prefix to add to each class, defaults to `\"\"`\n * @returns A classname generator function\n * @example\n * const cl = classNameFactory(\"plugin-\");\n *\n * cl(\"base\", [\"item\", \"editable\"], { selected: null, disabled: true })\n * // => \"plugin-base plugin-item plugin-editable plugin-disabled\"\n */\nexport const classNameFactory = (prefix: string = \"\") => (...args: ClassNameFactoryArg[]) => {\n const classNames = new Set();\n for (const arg of args) {\n if (arg && typeof arg === \"string\") classNames.add(arg);\n else if (Array.isArray(arg)) arg.forEach(name => classNames.add(name));\n else if (arg && typeof arg === \"object\") Object.entries(arg).forEach(([name, value]) => value && classNames.add(name));\n }\n return Array.from(classNames, name => prefix + name).join(\" \");\n};\n", "export { urlAlphabet } from './url-alphabet/index.js'\nexport let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nexport let customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n let step = -~((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nexport let customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\nexport let nanoid = (size = 21) =>\n crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {\n byte &= 63\n if (byte < 36) {\n id += byte.toString(36)\n } else if (byte < 62) {\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte > 62) {\n id += '-'\n } else {\n id += '_'\n }\n return id\n }, '')\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport * as DataStore from \"@api/DataStore\";\nimport { Settings } from \"@api/Settings\";\nimport { classNameFactory } from \"@api/Styles\";\nimport { closeModal, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from \"@utils/modal\";\nimport { useAwaiter } from \"@utils/react\";\nimport { Alerts, Button, Forms, moment, React, Text, Timestamp, useEffect, useReducer, useState } from \"@webpack/common\";\nimport { nanoid } from \"nanoid\";\nimport type { DispatchWithoutAction } from \"react\";\n\nimport NotificationComponent from \"./NotificationComponent\";\nimport type { NotificationData } from \"./Notifications\";\n\ninterface PersistentNotificationData extends Pick {\n timestamp: number;\n id: string;\n}\n\nconst KEY = \"notification-log\";\n\nconst getLog = async () => {\n const log = await DataStore.get(KEY) as PersistentNotificationData[] | undefined;\n return log ?? [];\n};\n\nconst cl = classNameFactory(\"vc-notification-log-\");\nconst signals = new Set();\n\nexport async function persistNotification(notification: NotificationData) {\n if (notification.noPersist) return;\n\n const limit = Settings.notifications.logLimit;\n if (limit === 0) return;\n\n await DataStore.update(KEY, (old: PersistentNotificationData[] | undefined) => {\n const log = old ?? [];\n\n // Omit stuff we don't need\n const {\n onClick, onClose, richBody, permanent, noPersist, dismissOnClick,\n ...pureNotification\n } = notification;\n\n log.unshift({\n ...pureNotification,\n timestamp: Date.now(),\n id: nanoid()\n });\n\n if (log.length > limit && limit !== 200)\n log.length = limit;\n\n return log;\n });\n\n signals.forEach(x => x());\n}\n\nexport async function deleteNotification(timestamp: number) {\n const log = await getLog();\n const index = log.findIndex(x => x.timestamp === timestamp);\n if (index === -1) return;\n\n log.splice(index, 1);\n await DataStore.set(KEY, log);\n signals.forEach(x => x());\n}\n\nexport function useLogs() {\n const [signal, setSignal] = useReducer(x => x + 1, 0);\n\n useEffect(() => {\n signals.add(setSignal);\n return () => void signals.delete(setSignal);\n }, []);\n\n const [log, _, pending] = useAwaiter(getLog, {\n fallbackValue: [],\n deps: [signal]\n });\n\n return [log, pending] as const;\n}\n\nfunction NotificationEntry({ data }: { data: PersistentNotificationData; }) {\n const [removing, setRemoving] = useState(false);\n const ref = React.useRef(null);\n\n useEffect(() => {\n const div = ref.current!;\n\n const setHeight = () => {\n if (div.clientHeight === 0) return requestAnimationFrame(setHeight);\n div.style.height = `${div.clientHeight}px`;\n };\n\n setHeight();\n }, []);\n\n return (\n
\n {\n if (removing) return;\n setRemoving(true);\n\n setTimeout(() => deleteNotification(data.timestamp), 200);\n }}\n richBody={\n
\n {data.body}\n \n
\n }\n />\n
\n );\n}\n\nexport function NotificationLog({ log, pending }: { log: PersistentNotificationData[], pending: boolean; }) {\n if (!log.length && !pending)\n return (\n
\n
\n \n No notifications yet\n \n
\n );\n\n return (\n
\n {log.map(n => )}\n
\n );\n}\n\nfunction LogModal({ modalProps, close }: { modalProps: ModalProps; close(): void; }) {\n const [log, pending] = useLogs();\n\n return (\n \n \n Notification Log\n \n \n\n \n \n \n\n \n {\n Alerts.show({\n title: \"Are you sure?\",\n body: `This will permanently remove ${log.length} notification${log.length === 1 ? \"\" : \"s\"}. This action cannot be undone.`,\n async onConfirm() {\n await DataStore.set(KEY, []);\n signals.forEach(x => x());\n },\n confirmText: \"Do it!\",\n confirmColor: \"vc-notification-log-danger-btn\",\n cancelText: \"Nevermind\"\n });\n }}\n >\n Clear Notification Log\n \n \n \n );\n}\n\nexport function openNotificationLogModal() {\n const key = openModal(modalProps => (\n closeModal(key)}\n />\n ));\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { Queue } from \"@utils/Queue\";\nimport { ReactDOM } from \"@webpack/common\";\nimport type { ReactNode } from \"react\";\nimport type { Root } from \"react-dom/client\";\n\nimport NotificationComponent from \"./NotificationComponent\";\nimport { persistNotification } from \"./notificationLog\";\n\nconst NotificationQueue = new Queue();\n\nlet reactRoot: Root;\nlet id = 42;\n\nfunction getRoot() {\n if (!reactRoot) {\n const container = document.createElement(\"div\");\n container.id = \"vc-notification-container\";\n document.body.append(container);\n reactRoot = ReactDOM.createRoot(container);\n }\n return reactRoot;\n}\n\nexport interface NotificationData {\n title: string;\n body: string;\n /**\n * Same as body but can be a custom component.\n * Will be used over body if present.\n * Not supported on desktop notifications, those will fall back to body */\n richBody?: ReactNode;\n /** Small icon. This is for things like profile pictures and should be square */\n icon?: string;\n /** Large image. Optimally, this should be around 16x9 but it doesn't matter much. Desktop Notifications might not support this */\n image?: string;\n onClick?(): void;\n onClose?(): void;\n color?: string;\n /** Whether this notification should not have a timeout */\n permanent?: boolean;\n /** Whether this notification should not be persisted in the Notification Log */\n noPersist?: boolean;\n /** Whether this notification should be dismissed when clicked (defaults to true) */\n dismissOnClick?: boolean;\n}\n\nfunction _showNotification(notification: NotificationData, id: number) {\n const root = getRoot();\n return new Promise(resolve => {\n root.render(\n {\n notification.onClose?.();\n root.render(null);\n resolve();\n }} />,\n );\n });\n}\n\nfunction shouldBeNative() {\n if (typeof Notification === \"undefined\") return false;\n\n const { useNative } = Settings.notifications;\n if (useNative === \"always\") return true;\n if (useNative === \"not-focused\") return !document.hasFocus();\n return false;\n}\n\nexport async function requestPermission() {\n return (\n Notification.permission === \"granted\" ||\n (Notification.permission !== \"denied\" && (await Notification.requestPermission()) === \"granted\")\n );\n}\n\nexport async function showNotification(data: NotificationData) {\n persistNotification(data);\n\n if (shouldBeNative() && await requestPermission()) {\n const { title, body, icon, image, onClick = null, onClose = null } = data;\n const n = new Notification(title, {\n body,\n icon,\n image\n });\n n.onclick = onClick;\n n.onclose = onClose;\n } else {\n NotificationQueue.push(() => _showNotification(data, id++));\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport * from \"./Notifications\";\n", "// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\n// see fleb note\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new u32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return [b, r];\n};\nvar _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i) {\n if (cd[i])\n ++l[cd[i] - 1];\n }\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v.BYTES_PER_ELEMENT == 2 ? u16 : v.BYTES_PER_ELEMENT == 4 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e >= s) {\n // write final block\n w[pos >> 3] = lst;\n }\n pos = wfblk(w, pos + 1, dat.subarray(i, e));\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\\s+/g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k].buffer) {\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k, op = o;\n if (Array.isArray(val))\n op = mrg(o, val[1]), val = val[0];\n if (val instanceof u8)\n t[n] = [val, op];\n else {\n t[n += '/'] = [new u8(0), op];\n fltn(val, n, t, o);\n }\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != -1) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c < 0 ? -c - 2 : c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u, -1);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = lft = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport * as DataStore from \"@api/DataStore\";\nimport { showNotification } from \"@api/Notifications\";\nimport { Settings } from \"@api/Settings\";\nimport { findByProps } from \"@webpack\";\nimport { UserStore } from \"@webpack/common\";\n\nimport { Logger } from \"./Logger\";\nimport { openModal } from \"./modal\";\n\nexport const cloudLogger = new Logger(\"Cloud\", \"#39b7e0\");\nexport const getCloudUrl = () => new URL(Settings.cloud.url);\n\nconst cloudUrlOrigin = () => getCloudUrl().origin;\nconst getUserId = () => {\n const id = UserStore.getCurrentUser()?.id;\n if (!id) throw new Error(\"User not yet logged in\");\n return id;\n};\n\nexport async function getAuthorization() {\n const secrets = await DataStore.get>(\"Vencord_cloudSecret\") ?? {};\n\n const origin = cloudUrlOrigin();\n\n // we need to migrate from the old format here\n if (secrets[origin]) {\n await DataStore.update>(\"Vencord_cloudSecret\", secrets => {\n secrets ??= {};\n // use the current user ID\n secrets[`${origin}:${getUserId()}`] = secrets[origin];\n delete secrets[origin];\n return secrets;\n });\n\n // since this doesn't update the original object, we'll early return the existing authorization\n return secrets[origin];\n }\n\n return secrets[`${origin}:${getUserId()}`];\n}\n\nasync function setAuthorization(secret: string) {\n await DataStore.update>(\"Vencord_cloudSecret\", secrets => {\n secrets ??= {};\n secrets[`${cloudUrlOrigin()}:${getUserId()}`] = secret;\n return secrets;\n });\n}\n\nexport async function deauthorizeCloud() {\n await DataStore.update>(\"Vencord_cloudSecret\", secrets => {\n secrets ??= {};\n delete secrets[`${cloudUrlOrigin()}:${getUserId()}`];\n return secrets;\n });\n}\n\nexport async function authorizeCloud() {\n if (await getAuthorization() !== undefined) {\n Settings.cloud.authenticated = true;\n return;\n }\n\n try {\n const oauthConfiguration = await fetch(new URL(\"/v1/oauth/settings\", getCloudUrl()));\n var { clientId, redirectUri } = await oauthConfiguration.json();\n } catch {\n showNotification({\n title: \"Cloud Integration\",\n body: \"Setup failed (couldn't retrieve OAuth configuration).\"\n });\n Settings.cloud.authenticated = false;\n return;\n }\n\n const { OAuth2AuthorizeModal } = findByProps(\"OAuth2AuthorizeModal\");\n\n openModal((props: any) => {\n if (!location) {\n Settings.cloud.authenticated = false;\n return;\n }\n\n try {\n const res = await fetch(location, {\n headers: new Headers({ Accept: \"application/json\" })\n });\n const { secret } = await res.json();\n if (secret) {\n cloudLogger.info(\"Authorized with secret\");\n await setAuthorization(secret);\n showNotification({\n title: \"Cloud Integration\",\n body: \"Cloud integrations enabled!\"\n });\n Settings.cloud.authenticated = true;\n } else {\n showNotification({\n title: \"Cloud Integration\",\n body: \"Setup failed (no secret returned?).\"\n });\n Settings.cloud.authenticated = false;\n }\n } catch (e: any) {\n cloudLogger.error(\"Failed to authorize\", e);\n showNotification({\n title: \"Cloud Integration\",\n body: `Setup failed (${e.toString()}).`\n });\n Settings.cloud.authenticated = false;\n }\n }\n }\n />);\n}\n\nexport async function getCloudAuth() {\n const secret = await getAuthorization();\n\n return window.btoa(`${secret}:${getUserId()}`);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function relaunch() {\n if (IS_DISCORD_DESKTOP)\n window.DiscordNative.app.relaunch();\n else\n window.VesktopNative.app.relaunch();\n}\n\nexport function showItemInFolder(path: string) {\n if (IS_DISCORD_DESKTOP)\n window.DiscordNative.fileManager.showItemInFolder(path);\n else\n window.VesktopNative.fileManager.showItemInFolder(path);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n/**\n * Prompts the user to save a file to their system\n * @param file The file to save\n */\nexport function saveFile(file: File) {\n const a = document.createElement(\"a\");\n a.href = URL.createObjectURL(file);\n a.download = file.name;\n\n document.body.appendChild(a);\n a.click();\n setImmediate(() => {\n URL.revokeObjectURL(a.href);\n document.body.removeChild(a);\n });\n}\n\n/**\n * Prompts the user to choose a file from their system\n * @param mimeTypes A comma separated list of mime types to accept, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept#unique_file_type_specifiers\n * @returns A promise that resolves to the chosen file or null if the user cancels\n */\nexport function chooseFile(mimeTypes: string) {\n return new Promise(resolve => {\n const input = document.createElement(\"input\");\n input.type = \"file\";\n input.style.display = \"none\";\n input.accept = mimeTypes;\n input.onchange = async () => {\n resolve(input.files?.[0] ?? null);\n };\n\n document.body.appendChild(input);\n input.click();\n setImmediate(() => document.body.removeChild(input));\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { showNotification } from \"@api/Notifications\";\nimport { PlainSettings, Settings } from \"@api/Settings\";\nimport { Toasts } from \"@webpack/common\";\nimport { deflateSync, inflateSync } from \"fflate\";\n\nimport { getCloudAuth, getCloudUrl } from \"./cloud\";\nimport { Logger } from \"./Logger\";\nimport { relaunch } from \"./native\";\nimport { chooseFile, saveFile } from \"./web\";\n\nexport async function importSettings(data: string) {\n try {\n var parsed = JSON.parse(data);\n } catch (err) {\n console.log(data);\n throw new Error(\"Failed to parse JSON: \" + String(err));\n }\n\n if (\"settings\" in parsed && \"quickCss\" in parsed) {\n Object.assign(PlainSettings, parsed.settings);\n await VencordNative.settings.set(JSON.stringify(parsed.settings, null, 4));\n await VencordNative.quickCss.set(parsed.quickCss);\n } else\n throw new Error(\"Invalid Settings. Is this even a Vencord Settings file?\");\n}\n\nexport async function exportSettings({ minify }: { minify?: boolean; } = {}) {\n const settings = JSON.parse(VencordNative.settings.get());\n const quickCss = await VencordNative.quickCss.get();\n return JSON.stringify({ settings, quickCss }, null, minify ? undefined : 4);\n}\n\nexport async function downloadSettingsBackup() {\n const filename = \"vencord-settings-backup.json\";\n const backup = await exportSettings();\n const data = new TextEncoder().encode(backup);\n\n if (IS_DISCORD_DESKTOP) {\n DiscordNative.fileManager.saveWithDialog(data, filename);\n } else {\n saveFile(new File([data], filename, { type: \"application/json\" }));\n }\n}\n\nconst toast = (type: number, message: string) =>\n Toasts.show({\n type,\n message,\n id: Toasts.genId()\n });\n\nconst toastSuccess = () =>\n toast(Toasts.Type.SUCCESS, \"Settings successfully imported. Restart to apply changes!\");\n\nconst toastFailure = (err: any) =>\n toast(Toasts.Type.FAILURE, `Failed to import settings: ${String(err)}`);\n\nexport async function uploadSettingsBackup(showToast = true): Promise {\n if (IS_DISCORD_DESKTOP) {\n const [file] = await DiscordNative.fileManager.openFiles({\n filters: [\n { name: \"Vencord Settings Backup\", extensions: [\"json\"] },\n { name: \"all\", extensions: [\"*\"] }\n ]\n });\n\n if (file) {\n try {\n await importSettings(new TextDecoder().decode(file.data));\n if (showToast) toastSuccess();\n } catch (err) {\n new Logger(\"SettingsSync\").error(err);\n if (showToast) toastFailure(err);\n }\n }\n } else {\n const file = await chooseFile(\"application/json\");\n if (!file) return;\n\n const reader = new FileReader();\n reader.onload = async () => {\n try {\n await importSettings(reader.result as string);\n if (showToast) toastSuccess();\n } catch (err) {\n new Logger(\"SettingsSync\").error(err);\n if (showToast) toastFailure(err);\n }\n };\n reader.readAsText(file);\n }\n}\n\n// Cloud settings\nconst cloudSettingsLogger = new Logger(\"Cloud:Settings\", \"#39b7e0\");\n\nexport async function putCloudSettings(manual?: boolean) {\n const settings = await exportSettings({ minify: true });\n\n try {\n const res = await fetch(new URL(\"/v1/settings\", getCloudUrl()), {\n method: \"PUT\",\n headers: new Headers({\n Authorization: await getCloudAuth(),\n \"Content-Type\": \"application/octet-stream\"\n }),\n body: deflateSync(new TextEncoder().encode(settings))\n });\n\n if (!res.ok) {\n cloudSettingsLogger.error(`Failed to sync up, API returned ${res.status}`);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not synchronize settings to cloud (API returned ${res.status}).`,\n color: \"var(--red-360)\"\n });\n return;\n }\n\n const { written } = await res.json();\n PlainSettings.cloud.settingsSyncVersion = written;\n VencordNative.settings.set(JSON.stringify(PlainSettings, null, 4));\n\n cloudSettingsLogger.info(\"Settings uploaded to cloud successfully\");\n\n if (manual) {\n showNotification({\n title: \"Cloud Settings\",\n body: \"Synchronized settings to the cloud!\",\n noPersist: true,\n });\n }\n } catch (e: any) {\n cloudSettingsLogger.error(\"Failed to sync up\", e);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not synchronize settings to the cloud (${e.toString()}).`,\n color: \"var(--red-360)\"\n });\n }\n}\n\nexport async function getCloudSettings(shouldNotify = true, force = false) {\n try {\n const res = await fetch(new URL(\"/v1/settings\", getCloudUrl()), {\n method: \"GET\",\n headers: new Headers({\n Authorization: await getCloudAuth(),\n Accept: \"application/octet-stream\",\n \"If-None-Match\": Settings.cloud.settingsSyncVersion.toString()\n }),\n });\n\n if (res.status === 404) {\n cloudSettingsLogger.info(\"No settings on the cloud\");\n if (shouldNotify)\n showNotification({\n title: \"Cloud Settings\",\n body: \"There are no settings in the cloud.\",\n noPersist: true\n });\n return false;\n }\n\n if (res.status === 304) {\n cloudSettingsLogger.info(\"Settings up to date\");\n if (shouldNotify)\n showNotification({\n title: \"Cloud Settings\",\n body: \"Your settings are up to date.\",\n noPersist: true\n });\n return false;\n }\n\n if (!res.ok) {\n cloudSettingsLogger.error(`Failed to sync down, API returned ${res.status}`);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not synchronize settings from the cloud (API returned ${res.status}).`,\n color: \"var(--red-360)\"\n });\n return false;\n }\n\n const written = Number(res.headers.get(\"etag\")!);\n const localWritten = Settings.cloud.settingsSyncVersion;\n\n // don't need to check for written > localWritten because the server will return 304 due to if-none-match\n if (!force && written < localWritten) {\n if (shouldNotify)\n showNotification({\n title: \"Cloud Settings\",\n body: \"Your local settings are newer than the cloud ones.\",\n noPersist: true,\n });\n return;\n }\n\n const data = await res.arrayBuffer();\n\n const settings = new TextDecoder().decode(inflateSync(new Uint8Array(data)));\n await importSettings(settings);\n\n // sync with server timestamp instead of local one\n PlainSettings.cloud.settingsSyncVersion = written;\n VencordNative.settings.set(JSON.stringify(PlainSettings, null, 4));\n\n cloudSettingsLogger.info(\"Settings loaded from cloud successfully\");\n if (shouldNotify)\n showNotification({\n title: \"Cloud Settings\",\n body: \"Your settings have been updated! Click here to restart to fully apply changes!\",\n color: \"var(--green-360)\",\n onClick: IS_WEB ? () => location.reload() : relaunch,\n noPersist: true\n });\n\n return true;\n } catch (e: any) {\n cloudSettingsLogger.error(\"Failed to sync down\", e);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not synchronize settings from the cloud (${e.toString()}).`,\n color: \"var(--red-360)\"\n });\n\n return false;\n }\n}\n\nexport async function deleteCloudSettings() {\n try {\n const res = await fetch(new URL(\"/v1/settings\", getCloudUrl()), {\n method: \"DELETE\",\n headers: new Headers({\n Authorization: await getCloudAuth()\n }),\n });\n\n if (!res.ok) {\n cloudSettingsLogger.error(`Failed to delete, API returned ${res.status}`);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not delete settings (API returned ${res.status}).`,\n color: \"var(--red-360)\"\n });\n return;\n }\n\n cloudSettingsLogger.info(\"Settings deleted from cloud successfully\");\n showNotification({\n title: \"Cloud Settings\",\n body: \"Settings deleted from cloud!\",\n color: \"var(--green-360)\"\n });\n } catch (e: any) {\n cloudSettingsLogger.error(\"Failed to delete\", e);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not delete settings (${e.toString()}).`,\n color: \"var(--red-360)\"\n });\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { debounce } from \"@utils/debounce\";\nimport { localStorage } from \"@utils/localStorage\";\nimport { Logger } from \"@utils/Logger\";\nimport { mergeDefaults } from \"@utils/misc\";\nimport { putCloudSettings } from \"@utils/settingsSync\";\nimport { DefinedSettings, OptionType, SettingsChecks, SettingsDefinition } from \"@utils/types\";\nimport { React } from \"@webpack/common\";\n\nimport plugins from \"~plugins\";\n\nconst logger = new Logger(\"Settings\");\nexport interface Settings {\n notifyAboutUpdates: boolean;\n autoUpdate: boolean;\n autoUpdateNotification: boolean,\n useQuickCss: boolean;\n enableReactDevtools: boolean;\n themeLinks: string[];\n enabledThemes: string[];\n frameless: boolean;\n transparent: boolean;\n winCtrlQ: boolean;\n macosTranslucency: boolean;\n disableMinSize: boolean;\n winNativeTitleBar: boolean;\n plugins: {\n [plugin: string]: {\n enabled: boolean;\n [setting: string]: any;\n };\n };\n\n notifications: {\n timeout: number;\n position: \"top-right\" | \"bottom-right\";\n useNative: \"always\" | \"never\" | \"not-focused\";\n logLimit: number;\n };\n\n cloud: {\n authenticated: boolean;\n url: string;\n settingsSync: boolean;\n settingsSyncVersion: number;\n };\n}\n\nconst DefaultSettings: Settings = {\n notifyAboutUpdates: true,\n autoUpdate: false,\n autoUpdateNotification: true,\n useQuickCss: true,\n themeLinks: [],\n enabledThemes: [],\n enableReactDevtools: false,\n frameless: false,\n transparent: false,\n winCtrlQ: false,\n macosTranslucency: false,\n disableMinSize: false,\n winNativeTitleBar: false,\n plugins: {},\n\n notifications: {\n timeout: 5000,\n position: \"bottom-right\",\n useNative: \"not-focused\",\n logLimit: 50\n },\n\n cloud: {\n authenticated: false,\n url: \"https://api.vencord.dev/\",\n settingsSync: false,\n settingsSyncVersion: 0\n }\n};\n\ntry {\n var settings = JSON.parse(VencordNative.settings.get()) as Settings;\n mergeDefaults(settings, DefaultSettings);\n} catch (err) {\n var settings = mergeDefaults({} as Settings, DefaultSettings);\n logger.error(\"An error occurred while loading the settings. Corrupt settings file?\\n\", err);\n}\n\nconst saveSettingsOnFrequentAction = debounce(async () => {\n if (Settings.cloud.settingsSync && Settings.cloud.authenticated) {\n await putCloudSettings();\n delete localStorage.Vencord_settingsDirty;\n }\n}, 60_000);\n\ntype SubscriptionCallback = ((newValue: any, path: string) => void) & { _paths?: Array; };\nconst subscriptions = new Set();\n\nconst proxyCache = {} as Record;\n\n// Wraps the passed settings object in a Proxy to nicely handle change listeners and default values\nfunction makeProxy(settings: any, root = settings, path = \"\"): Settings {\n return proxyCache[path] ??= new Proxy(settings, {\n get(target, p: string) {\n const v = target[p];\n\n // using \"in\" is important in the following cases to properly handle falsy or nullish values\n if (!(p in target)) {\n // Return empty for plugins with no settings\n if (path === \"plugins\" && p in plugins)\n return target[p] = makeProxy({\n enabled: plugins[p].required ?? plugins[p].enabledByDefault ?? false\n }, root, `plugins.${p}`);\n\n // Since the property is not set, check if this is a plugin's setting and if so, try to resolve\n // the default value.\n if (path.startsWith(\"plugins.\")) {\n const plugin = path.slice(\"plugins.\".length);\n if (plugin in plugins) {\n const setting = plugins[plugin].options?.[p];\n if (!setting) return v;\n if (\"default\" in setting)\n // normal setting with a default value\n return (target[p] = setting.default);\n if (setting.type === OptionType.SELECT) {\n const def = setting.options.find(o => o.default);\n if (def)\n target[p] = def.value;\n return def?.value;\n }\n }\n }\n return v;\n }\n\n // Recursively proxy Objects with the updated property path\n if (typeof v === \"object\" && !Array.isArray(v) && v !== null)\n return makeProxy(v, root, `${path}${path && \".\"}${p}`);\n\n // primitive or similar, no need to proxy further\n return v;\n },\n\n set(target, p: string, v) {\n // avoid unnecessary updates to React Components and other listeners\n if (target[p] === v) return true;\n\n target[p] = v;\n // Call any listeners that are listening to a setting of this path\n const setPath = `${path}${path && \".\"}${p}`;\n delete proxyCache[setPath];\n for (const subscription of subscriptions) {\n if (!subscription._paths || subscription._paths.includes(setPath)) {\n subscription(v, setPath);\n }\n }\n // And don't forget to persist the settings!\n PlainSettings.cloud.settingsSyncVersion = Date.now();\n localStorage.Vencord_settingsDirty = true;\n saveSettingsOnFrequentAction();\n VencordNative.settings.set(JSON.stringify(root, null, 4));\n return true;\n }\n });\n}\n\n/**\n * Same as {@link Settings} but unproxied. You should treat this as readonly,\n * as modifying properties on this will not save to disk or call settings\n * listeners.\n * WARNING: default values specified in plugin.options will not be ensured here. In other words,\n * settings for which you specified a default value may be uninitialised. If you need proper\n * handling for default values, use {@link Settings}\n */\nexport const PlainSettings = settings;\n/**\n * A smart settings object. Altering props automagically saves\n * the updated settings to disk.\n * This recursively proxies objects. If you need the object non proxied, use {@link PlainSettings}\n */\nexport const Settings = makeProxy(settings);\n\n/**\n * Settings hook for React components. Returns a smart settings\n * object that automagically triggers a rerender if any properties\n * are altered\n * @param paths An optional list of paths to whitelist for rerenders\n * @returns Settings\n */\n// TODO: Representing paths as essentially \"string[].join('.')\" wont allow dots in paths, change to \"paths?: string[][]\" later\nexport function useSettings(paths?: UseSettings[]) {\n const [, forceUpdate] = React.useReducer(() => ({}), {});\n\n const onUpdate: SubscriptionCallback = paths\n ? (value, path) => paths.includes(path as UseSettings) && forceUpdate()\n : forceUpdate;\n\n React.useEffect(() => {\n subscriptions.add(onUpdate);\n return () => void subscriptions.delete(onUpdate);\n }, []);\n\n return Settings;\n}\n\n// Resolves a possibly nested prop in the form of \"some.nested.prop\" to type of T.some.nested.prop\ntype ResolvePropDeep = P extends \"\" ? T :\n P extends `${infer Pre}.${infer Suf}` ?\n Pre extends keyof T ? ResolvePropDeep : never : P extends keyof T ? T[P] : never;\n\n/**\n * Add a settings listener that will be invoked whenever the desired setting is updated\n * @param path Path to the setting that you want to watch, for example \"plugins.Unindent.enabled\" will fire your callback\n * whenever Unindent is toggled. Pass an empty string to get notified for all changes\n * @param onUpdate Callback function whenever a setting matching path is updated. It gets passed the new value and the path\n * to the updated setting. This path will be the same as your path argument, unless it was an empty string.\n *\n * @example addSettingsListener(\"\", (newValue, path) => console.log(`${path} is now ${newValue}`))\n * addSettingsListener(\"plugins.Unindent.enabled\", v => console.log(\"Unindent is now\", v ? \"enabled\" : \"disabled\"))\n */\nexport function addSettingsListener(path: Path, onUpdate: (newValue: Settings[Path], path: Path) => void): void;\nexport function addSettingsListener(path: Path, onUpdate: (newValue: Path extends \"\" ? any : ResolvePropDeep, path: Path extends \"\" ? string : Path) => void): void;\nexport function addSettingsListener(path: string, onUpdate: (newValue: any, path: string) => void) {\n if (path)\n ((onUpdate as SubscriptionCallback)._paths ??= []).push(path);\n subscriptions.add(onUpdate);\n}\n\nexport function migratePluginSettings(name: string, ...oldNames: string[]) {\n const { plugins } = settings;\n if (name in plugins) return;\n\n for (const oldName of oldNames) {\n if (oldName in plugins) {\n logger.info(`Migrating settings from old name ${oldName} to ${name}`);\n plugins[name] = plugins[oldName];\n delete plugins[oldName];\n VencordNative.settings.set(JSON.stringify(settings, null, 4));\n break;\n }\n }\n}\n\nexport function definePluginSettings<\n Def extends SettingsDefinition,\n Checks extends SettingsChecks,\n PrivateSettings extends object = {}\n>(def: Def, checks?: Checks) {\n const definedSettings: DefinedSettings = {\n get store() {\n if (!definedSettings.pluginName) throw new Error(\"Cannot access settings before plugin is initialized\");\n return Settings.plugins[definedSettings.pluginName] as any;\n },\n use: settings => useSettings(\n settings?.map(name => `plugins.${definedSettings.pluginName}.${name}`) as UseSettings[]\n ).plugins[definedSettings.pluginName] as any,\n def,\n checks: checks ?? {} as any,\n pluginName: \"\",\n\n withPrivateSettings() {\n return this as DefinedSettings;\n }\n };\n\n return definedSettings;\n}\n\ntype UseSettings = ResolveUseSettings[keyof T];\n\ntype ResolveUseSettings = {\n [Key in keyof T]:\n Key extends string\n ? T[Key] extends Record\n // @ts-ignore \"Type instantiation is excessively deep and possibly infinite\"\n ? UseSettings extends string ? `${Key}.${UseSettings}` : never\n : Key\n : never;\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport gitHash from \"~git-hash\";\n\nimport { Logger } from \"./Logger\";\nimport { relaunch } from \"./native\";\nimport { IpcRes } from \"./types\";\n\nexport const UpdateLogger = /* #__PURE__*/ new Logger(\"Updater\", \"white\");\nexport let isOutdated = false;\nexport let isNewer = false;\nexport let updateError: any;\nexport let changes: Record<\"hash\" | \"author\" | \"message\", string>[];\n\nasync function Unwrap(p: Promise>) {\n const res = await p;\n\n if (res.ok) return res.value;\n\n updateError = res.error;\n throw res.error;\n}\n\nexport async function checkForUpdates() {\n changes = await Unwrap(VencordNative.updater.getUpdates());\n if (changes.some(c => c.hash === gitHash)) {\n isNewer = true;\n return (isOutdated = false);\n }\n return (isOutdated = changes.length > 0);\n}\n\nexport async function update() {\n if (!isOutdated) return true;\n\n const res = await Unwrap(VencordNative.updater.update());\n\n if (res) {\n isOutdated = false;\n if (!await Unwrap(VencordNative.updater.rebuild()))\n throw new Error(\"The Build failed. Please try manually building the new update\");\n }\n\n return res;\n}\n\nexport const getRepo = () => Unwrap(VencordNative.updater.getRepo());\n\nexport async function maybePromptToUpdate(confirmMessage: string, checkForDev = false) {\n if (IS_WEB || IS_UPDATER_DISABLED) return;\n if (checkForDev && IS_DEV) return;\n\n try {\n const isOutdated = await checkForUpdates();\n if (isOutdated) {\n const wantsUpdate = confirm(confirmMessage);\n if (wantsUpdate && isNewer) return alert(\"Your local copy has more recent commits. Please stash or reset them.\");\n if (wantsUpdate) {\n await update();\n relaunch();\n }\n }\n } catch (err) {\n UpdateLogger.error(err);\n alert(\"That also failed :( Try updating or re-installing with the installer!\");\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { maybePromptToUpdate } from \"@utils/updater\";\n\nexport function handleComponentFailed() {\n maybePromptToUpdate(\n \"Uh Oh! Failed to render this Page.\" +\n \" However, there is an update available that might fix it.\" +\n \" Would you like to update and restart now?\"\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function onlyOnce(f: F): F {\n let called = false;\n let result: any;\n return function onlyOnceWrapper(this: unknown) {\n if (called) return result;\n\n called = true;\n\n return (result = f.apply(this, arguments));\n } as unknown as F;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./settingsStyles.css\";\nimport \"./themesStyles.css\";\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { handleComponentFailed } from \"@components/handleComponentFailed\";\nimport { Margins } from \"@utils/margins\";\nimport { onlyOnce } from \"@utils/onlyOnce\";\nimport { Forms, Text } from \"@webpack/common\";\nimport type { ComponentType, PropsWithChildren } from \"react\";\n\nexport function SettingsTab({ title, children }: PropsWithChildren<{ title: string; }>) {\n return (\n \n \n {title}\n \n\n {children}\n \n );\n}\n\nconst onError = onlyOnce(handleComponentFailed);\n\nexport function wrapTab(component: ComponentType, tab: string) {\n return ErrorBoundary.wrap(component, {\n message: `Failed to render the ${tab} tab. If this issue persists, try using the installer to reinstall!`,\n onError,\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { openNotificationLogModal } from \"@api/Notifications/notificationLog\";\nimport { Settings, useSettings } from \"@api/Settings\";\nimport { classNameFactory } from \"@api/Styles\";\nimport DonateButton from \"@components/DonateButton\";\nimport { ErrorCard } from \"@components/ErrorCard\";\nimport { Margins } from \"@utils/margins\";\nimport { identity } from \"@utils/misc\";\nimport { relaunch, showItemInFolder } from \"@utils/native\";\nimport { useAwaiter } from \"@utils/react\";\nimport { Button, Card, Forms, React, Select, Slider, Switch } from \"@webpack/common\";\n\nimport { SettingsTab, wrapTab } from \"./shared\";\n\nconst cl = classNameFactory(\"vc-settings-\");\n\nconst DEFAULT_DONATE_IMAGE = \"https://cdn.discordapp.com/emojis/1026533090627174460.png\";\nconst SHIGGY_DONATE_IMAGE = \"https://media.discordapp.net/stickers/1039992459209490513.png\";\n\ntype KeysOfType = {\n [K in keyof Object]: Object[K] extends Type ? K : never;\n}[keyof Object];\n\nfunction VencordSettings() {\n const [settingsDir, , settingsDirPending] = useAwaiter(VencordNative.settings.getSettingsDir, {\n fallbackValue: \"Loading...\"\n });\n const settings = useSettings();\n\n const donateImage = React.useMemo(() => Math.random() > 0.5 ? DEFAULT_DONATE_IMAGE : SHIGGY_DONATE_IMAGE, []);\n\n const isWindows = navigator.platform.toLowerCase().startsWith(\"win\");\n const isMac = navigator.platform.toLowerCase().startsWith(\"mac\");\n\n const Switches: Array;\n title: string;\n note: string;\n }> =\n [\n {\n key: \"useQuickCss\",\n title: \"Enable Custom CSS\",\n note: \"Loads your Custom CSS\"\n },\n !IS_WEB && {\n key: \"enableReactDevtools\",\n title: \"Enable React Developer Tools\",\n note: \"Requires a full restart\"\n },\n !IS_WEB && (!IS_DISCORD_DESKTOP || !isWindows ? {\n key: \"frameless\",\n title: \"Disable the window frame\",\n note: \"Requires a full restart\"\n } : {\n key: \"winNativeTitleBar\",\n title: \"Use Windows' native title bar instead of Discord's custom one\",\n note: \"Requires a full restart\"\n }),\n !IS_WEB && false /* This causes electron to freeze / white screen for some people */ && {\n key: \"transparent\",\n title: \"Enable window transparency\",\n note: \"Requires a full restart\"\n },\n !IS_WEB && isWindows && {\n key: \"winCtrlQ\",\n title: \"Register Ctrl+Q as shortcut to close Discord (Alternative to Alt+F4)\",\n note: \"Requires a full restart\"\n },\n IS_DISCORD_DESKTOP && {\n key: \"disableMinSize\",\n title: \"Disable minimum window size\",\n note: \"Requires a full restart\"\n },\n IS_DISCORD_DESKTOP && isMac && {\n key: \"macosTranslucency\",\n title: \"Enable translucent window\",\n note: \"Requires a full restart\"\n }\n ];\n\n return (\n \n \n \n \n \n {!IS_WEB && (\n \n Restart Client\n \n )}\n VencordNative.quickCss.openEditor()}\n size={Button.Sizes.SMALL}\n disabled={settingsDir === \"Loading...\"}>\n Open QuickCSS File\n \n {!IS_WEB && (\n showItemInFolder(settingsDir)}\n size={Button.Sizes.SMALL}\n disabled={settingsDirPending}>\n Open Settings Folder\n \n )}\n VencordNative.native.openExternal(\"https://github.com/Vendicated/Vencord\")}\n size={Button.Sizes.SMALL}\n disabled={settingsDirPending}>\n Open in GitHub\n \n \n \n \n\n \n\n \n \n Hint: You can change the position of this settings section in the settings of the \"Settings\" plugin!\n \n {Switches.map(s => s && (\n settings[s.key] = v}\n note={s.note}\n >\n {s.title}\n \n ))}\n \n\n\n {typeof Notification !== \"undefined\" && }\n \n );\n}\n\nfunction NotificationSection({ settings }: { settings: typeof Settings[\"notifications\"]; }) {\n return (\n <>\n Notification Style\n {settings.useNative !== \"never\" && Notification?.permission === \"denied\" && (\n \n Desktop Notification Permission denied\n You have denied Notification Permissions. Thus, Desktop notifications will not work!\n \n )}\n \n Some plugins may show you notifications. These come in two styles:\n
    \n
  • Vencord Notifications: These are in-app notifications
  • \n
  • Desktop Notifications: Native Desktop notifications (like when you get a ping)
  • \n
\n
\n >}\n closeOnSelect={true}\n select={v => settings.useNative = v}\n isSelected={v => v === settings.useNative}\n serialize={identity}\n />\n\n Notification Position\n >}\n select={v => settings.position = v}\n isSelected={v => v === settings.position}\n serialize={identity}\n />\n\n Notification Timeout\n Set to 0s to never automatically time out\n settings.timeout = v}\n onValueRender={v => (v / 1000).toFixed(2) + \"s\"}\n onMarkerRender={v => (v / 1000) + \"s\"}\n stickToMarkers={false}\n />\n\n Notification Log Limit\n \n The amount of notifications to save in the log until old ones are removed.\n Set to 0 to disable Notification log and \u221E to never automatically remove old Notifications\n \n settings.logLimit = v}\n onValueRender={v => v === 200 ? \"\u221E\" : v}\n onMarkerRender={v => v === 200 ? \"\u221E\" : v}\n />\n\n \n Open Notification Log\n \n \n );\n}\n\ninterface DonateCardProps {\n image: string;\n}\n\nfunction DonateCard({ image }: DonateCardProps) {\n return (\n \n
\n Support the Project\n Please consider supporting the development of Vencord by donating!\n \n
\n \n
\n );\n}\n\nexport default wrapTab(VencordSettings, \"Vencord Settings\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { waitFor } from \"@webpack\";\n\nlet NoticesModule: any;\nwaitFor(m => m.show && m.dismiss && !m.suppressAll, m => NoticesModule = m);\n\nexport const noticesQueue = [] as any[];\nexport let currentNotice: any = null;\n\nexport function popNotice() {\n NoticesModule.dismiss();\n}\n\nexport function nextNotice() {\n currentNotice = noticesQueue.shift();\n\n if (currentNotice) {\n NoticesModule.show(...currentNotice, \"VencordNotice\");\n }\n}\n\nexport function showNotice(message: string, buttonText: string, onOkClick: () => void) {\n noticesQueue.push([\"GENERIC\", message, buttonText, onOkClick]);\n if (!currentNotice) nextNotice();\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./iconStyles.css\";\n\nimport { classes } from \"@utils/misc\";\nimport { i18n } from \"@webpack/common\";\nimport type { PropsWithChildren, SVGProps } from \"react\";\n\ninterface BaseIconProps extends IconProps {\n viewBox: string;\n}\n\ninterface IconProps extends SVGProps {\n className?: string;\n height?: string | number;\n width?: string | number;\n}\n\nfunction Icon({ height = 24, width = 24, className, children, viewBox, ...svgProps }: PropsWithChildren) {\n return (\n \n {children}\n \n );\n}\n\n/**\n * Discord's link icon, as seen in the Message context menu \"Copy Message Link\" option\n */\nexport function LinkIcon({ height = 24, width = 24, className }: IconProps) {\n return (\n \n \n \n \n \n \n );\n}\n\n/**\n * Discord's copy icon, as seen in the user popout right of the username when clicking\n * your own username in the bottom left user panel\n */\nexport function CopyIcon(props: IconProps) {\n return (\n \n \n \n \n \n \n );\n}\n\n/**\n * Discord's open external icon, as seen in the user profile connections\n */\nexport function OpenExternalIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function ImageIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function InfoIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function OwnerCrownIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\n/**\n * Discord's screenshare icon, as seen in the connection panel\n */\nexport function ScreenshareIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function ImageVisible(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function ImageInvisible(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function Microphone(props: IconProps) {\n return (\n \n \n \n \n );\n}\n\nexport function CogWheel(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function ReplyIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function DeleteIcon(props: IconProps) {\n return (\n \n \n \n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { moment } from \"@webpack/common\";\n\n// Utils for readable text transformations eg: `toTitle(fromKebab())`\n\n// Case style to words\nexport const wordsFromCamel = (text: string) => text.split(/(?=[A-Z])/).map(w => w.toLowerCase());\nexport const wordsFromSnake = (text: string) => text.toLowerCase().split(\"_\");\nexport const wordsFromKebab = (text: string) => text.toLowerCase().split(\"-\");\nexport const wordsFromPascal = (text: string) => text.split(/(?=[A-Z])/).map(w => w.toLowerCase());\nexport const wordsFromTitle = (text: string) => text.toLowerCase().split(\" \");\n\n// Words to case style\nexport const wordsToCamel = (words: string[]) =>\n words.map((w, i) => (i ? w[0].toUpperCase() + w.slice(1) : w)).join(\"\");\nexport const wordsToSnake = (words: string[]) => words.join(\"_\").toUpperCase();\nexport const wordsToKebab = (words: string[]) => words.join(\"-\").toLowerCase();\nexport const wordsToPascal = (words: string[]) =>\n words.map(w => w[0].toUpperCase() + w.slice(1)).join(\"\");\nexport const wordsToTitle = (words: string[]) =>\n words.map(w => w[0].toUpperCase() + w.slice(1)).join(\" \");\n\nconst units = [\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\"] as const;\ntype Units = typeof units[number];\n\nfunction getUnitStr(unit: Units, isOne: boolean, short: boolean) {\n if (short === false) return isOne ? unit.slice(0, -1) : unit;\n\n return unit[0];\n}\n\n/**\n * Forms time into a human readable string link \"1 day, 2 hours, 3 minutes and 4 seconds\"\n * @param time The time on the specified unit\n * @param unit The unit the time is on\n * @param short Whether to use short units like \"d\" instead of \"days\"\n */\nexport function formatDuration(time: number, unit: Units, short: boolean = false) {\n const dur = moment.duration(time, unit);\n\n let unitsAmounts = units.map(unit => ({ amount: dur[unit](), unit }));\n\n let amountsToBeRemoved = 0;\n\n outer:\n for (let i = 0; i < unitsAmounts.length; i++) {\n if (unitsAmounts[i].amount === 0 || !(i + 1 < unitsAmounts.length)) continue;\n for (let v = i + 1; v < unitsAmounts.length; v++) {\n if (unitsAmounts[v].amount !== 0) continue outer;\n }\n\n amountsToBeRemoved = unitsAmounts.length - (i + 1);\n }\n unitsAmounts = amountsToBeRemoved === 0 ? unitsAmounts : unitsAmounts.slice(0, -amountsToBeRemoved);\n\n const daysAmountIndex = unitsAmounts.findIndex(({ unit }) => unit === \"days\");\n if (daysAmountIndex !== -1) {\n const daysAmount = unitsAmounts[daysAmountIndex];\n\n const daysMod = daysAmount.amount % 7;\n if (daysMod === 0) unitsAmounts.splice(daysAmountIndex, 1);\n else daysAmount.amount = daysMod;\n }\n\n let res: string = \"\";\n while (unitsAmounts.length) {\n const { amount, unit } = unitsAmounts.shift()!;\n\n if (res.length) res += unitsAmounts.length ? \", \" : \" and \";\n\n if (amount > 0 || res.length) {\n res += `${amount} ${getUnitStr(unit, amount === 1, short)}`;\n }\n }\n\n return res.length ? res : `0 ${getUnitStr(unit, false, short)}`;\n}\n\n/**\n * Join an array of strings in a human readable way (1, 2 and 3)\n * @param elements Elements\n */\nexport function humanFriendlyJoin(elements: string[]): string;\n/**\n * Join an array of strings in a human readable way (1, 2 and 3)\n * @param elements Elements\n * @param mapper Function that converts elements to a string\n */\nexport function humanFriendlyJoin(elements: T[], mapper: (e: T) => string): string;\nexport function humanFriendlyJoin(elements: any[], mapper: (e: any) => string = s => s): string {\n const { length } = elements;\n if (length === 0)\n return \"\";\n if (length === 1)\n return mapper(elements[0]);\n\n let s = \"\";\n\n for (let i = 0; i < length; i++) {\n s += mapper(elements[i]);\n if (length - i > 2)\n s += \", \";\n else if (length - i > 1)\n s += \" and \";\n }\n\n return s;\n}\n\n/**\n * Wrap the text in ``` with an optional language\n */\nexport function makeCodeblock(text: string, language?: string) {\n const chars = \"```\";\n return `${chars}${language || \"\"}\\n${text.replaceAll(\"```\", \"\\\\`\\\\`\\\\`\")}\\n${chars}`;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { mergeDefaults } from \"@utils/misc\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { SnowflakeUtils } from \"@webpack/common\";\nimport { Message } from \"discord-types/general\";\nimport type { PartialDeep } from \"type-fest\";\n\nimport { Argument } from \"./types\";\n\nconst MessageCreator = findByPropsLazy(\"createBotMessage\");\nconst MessageSender = findByPropsLazy(\"receiveMessage\");\n\nexport function generateId() {\n return `-${SnowflakeUtils.fromTimestamp(Date.now())}`;\n}\n\n/**\n * Send a message as Clyde\n * @param {string} channelId ID of channel to send message to\n * @param {Message} message Message to send\n * @returns {Message}\n */\nexport function sendBotMessage(channelId: string, message: PartialDeep): Message {\n const botMessage = MessageCreator.createBotMessage({ channelId, content: \"\", embeds: [] });\n\n MessageSender.receiveMessage(channelId, mergeDefaults(message, botMessage));\n\n return message as Message;\n}\n\n/**\n * Get the value of an option by name\n * @param args Arguments array (first argument passed to execute)\n * @param name Name of the argument\n * @param fallbackValue Fallback value in case this option wasn't passed\n * @returns Value\n */\nexport function findOption(args: Argument[], name: string): T & {} | undefined;\nexport function findOption(args: Argument[], name: string, fallbackValue: T): T & {};\nexport function findOption(args: Argument[], name: string, fallbackValue?: any) {\n return (args.find(a => a.name === name)?.value || fallbackValue) as any;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Channel, Guild } from \"discord-types/general\";\nimport { Promisable } from \"type-fest\";\n\nexport interface CommandContext {\n channel: Channel;\n guild?: Guild;\n}\n\nexport const enum ApplicationCommandOptionType {\n SUB_COMMAND = 1,\n SUB_COMMAND_GROUP = 2,\n STRING = 3,\n INTEGER = 4,\n BOOLEAN = 5,\n USER = 6,\n CHANNEL = 7,\n ROLE = 8,\n MENTIONABLE = 9,\n NUMBER = 10,\n ATTACHMENT = 11,\n}\n\nexport const enum ApplicationCommandInputType {\n BUILT_IN = 0,\n BUILT_IN_TEXT = 1,\n BUILT_IN_INTEGRATION = 2,\n BOT = 3,\n PLACEHOLDER = 4,\n}\n\nexport interface Option {\n name: string;\n displayName?: string;\n type: ApplicationCommandOptionType;\n description: string;\n displayDescription?: string;\n required?: boolean;\n options?: Option[];\n choices?: Array;\n}\n\nexport interface ChoicesOption {\n label: string;\n value: string;\n name: string;\n displayName?: string;\n}\n\nexport const enum ApplicationCommandType {\n CHAT_INPUT = 1,\n USER = 2,\n MESSAGE = 3,\n}\n\nexport interface CommandReturnValue {\n content: string;\n /** TODO: implement */\n cancel?: boolean;\n}\n\nexport interface Argument {\n type: ApplicationCommandOptionType;\n name: string;\n value: string;\n focused: undefined;\n options: Argument[];\n}\n\nexport interface Command {\n id?: string;\n applicationId?: string;\n type?: ApplicationCommandType;\n inputType?: ApplicationCommandInputType;\n plugin?: string;\n isVencordCommand?: boolean;\n\n name: string;\n displayName?: string;\n description: string;\n displayDescription?: string;\n\n options?: Option[];\n predicate?(ctx: CommandContext): boolean;\n\n execute(args: Argument[], ctx: CommandContext): Promisable;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { makeCodeblock } from \"@utils/text\";\n\nimport { sendBotMessage } from \"./commandHelpers\";\nimport { ApplicationCommandInputType, ApplicationCommandOptionType, ApplicationCommandType, Argument, Command, CommandContext, Option } from \"./types\";\n\nexport * from \"./commandHelpers\";\nexport * from \"./types\";\n\nexport let BUILT_IN: Command[];\nexport const commands = {} as Record;\n\n// hack for plugins being evaluated before we can grab these from webpack\nconst OptPlaceholder = Symbol(\"OptionalMessageOption\") as any as Option;\nconst ReqPlaceholder = Symbol(\"RequiredMessageOption\") as any as Option;\n/**\n * Optional message option named \"message\" you can use in commands.\n * Used in \"tableflip\" or \"shrug\"\n * @see {@link RequiredMessageOption}\n */\nexport let OptionalMessageOption: Option = OptPlaceholder;\n/**\n * Required message option named \"message\" you can use in commands.\n * Used in \"me\"\n * @see {@link OptionalMessageOption}\n */\nexport let RequiredMessageOption: Option = ReqPlaceholder;\n\nexport const _init = function (cmds: Command[]) {\n try {\n BUILT_IN = cmds;\n OptionalMessageOption = cmds.find(c => c.name === \"shrug\")!.options![0];\n RequiredMessageOption = cmds.find(c => c.name === \"me\")!.options![0];\n } catch (e) {\n console.error(\"Failed to load CommandsApi\");\n }\n return cmds;\n} as never;\n\nexport const _handleCommand = function (cmd: Command, args: Argument[], ctx: CommandContext) {\n if (!cmd.isVencordCommand)\n return cmd.execute(args, ctx);\n\n const handleError = (err: any) => {\n // TODO: cancel send if cmd.inputType === BUILT_IN_TEXT\n const msg = `An Error occurred while executing command \"${cmd.name}\"`;\n const reason = err instanceof Error ? err.stack || err.message : String(err);\n\n console.error(msg, err);\n sendBotMessage(ctx.channel.id, {\n content: `${msg}:\\n${makeCodeblock(reason)}`,\n author: {\n username: \"Vencord\"\n }\n });\n };\n\n try {\n const res = cmd.execute(args, ctx);\n return res instanceof Promise ? res.catch(handleError) : res;\n } catch (err) {\n return handleError(err);\n }\n} as never;\n\n\n/**\n * Prepare a Command Option for Discord by filling missing fields\n * @param opt\n */\nexport function prepareOption(opt: O): O {\n opt.displayName ||= opt.name;\n opt.displayDescription ||= opt.description;\n opt.options?.forEach((opt, i, opts) => {\n // See comment above Placeholders\n if (opt === OptPlaceholder) opts[i] = OptionalMessageOption;\n else if (opt === ReqPlaceholder) opts[i] = RequiredMessageOption;\n opt.choices?.forEach(x => x.displayName ||= x.name);\n\n prepareOption(opts[i]);\n });\n return opt;\n}\n\n// Yes, Discord registers individual commands for each subcommand\n// TODO: This probably doesn't support nested subcommands. If that is ever needed,\n// investigate\nfunction registerSubCommands(cmd: Command, plugin: string) {\n cmd.options?.forEach(o => {\n if (o.type !== ApplicationCommandOptionType.SUB_COMMAND)\n throw new Error(\"When specifying sub-command options, all options must be sub-commands.\");\n const subCmd = {\n ...cmd,\n ...o,\n type: ApplicationCommandType.CHAT_INPUT,\n name: `${cmd.name} ${o.name}`,\n id: `${o.name}-${cmd.id}`,\n displayName: `${cmd.name} ${o.name}`,\n subCommandPath: [{\n name: o.name,\n type: o.type,\n displayName: o.name\n }],\n rootCommand: cmd\n };\n registerCommand(subCmd as any, plugin);\n });\n}\n\nexport function registerCommand(command: C, plugin: string) {\n if (!BUILT_IN) {\n console.warn(\n \"[CommandsAPI]\",\n `Not registering ${command.name} as the CommandsAPI hasn't been initialised.`,\n \"Please restart to use commands\"\n );\n return;\n }\n\n if (BUILT_IN.some(c => c.name === command.name))\n throw new Error(`Command '${command.name}' already exists.`);\n\n command.isVencordCommand = true;\n command.id ??= `-${BUILT_IN.length + 1}`;\n command.applicationId ??= \"-1\"; // BUILT_IN;\n command.type ??= ApplicationCommandType.CHAT_INPUT;\n command.inputType ??= ApplicationCommandInputType.BUILT_IN_TEXT;\n command.plugin ||= plugin;\n\n prepareOption(command);\n\n if (command.options?.[0]?.type === ApplicationCommandOptionType.SUB_COMMAND) {\n registerSubCommands(command, plugin);\n return;\n }\n\n commands[command.name] = command;\n BUILT_IN.push(command);\n}\n\nexport function unregisterCommand(name: string) {\n const idx = BUILT_IN.findIndex(c => c.name === name);\n if (idx === -1)\n return false;\n\n BUILT_IN.splice(idx, 1);\n delete commands[name];\n\n return true;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function Badge({ text, color }): JSX.Element {\n return (\n
\n {text}\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { wordsFromCamel, wordsToTitle } from \"@utils/text\";\nimport { PluginOptionBoolean } from \"@utils/types\";\nimport { Forms, React, Switch } from \"@webpack/common\";\n\nimport { ISettingElementProps } from \".\";\n\nexport function SettingBooleanComponent({ option, pluginSettings, definedSettings, id, onChange, onError }: ISettingElementProps) {\n const def = pluginSettings[id] ?? option.default;\n\n const [state, setState] = React.useState(def ?? false);\n const [error, setError] = React.useState(null);\n\n React.useEffect(() => {\n onError(error !== null);\n }, [error]);\n\n function handleChange(newValue: boolean): void {\n const isValid = option.isValid?.call(definedSettings, newValue) ?? true;\n if (typeof isValid === \"string\") setError(isValid);\n else if (!isValid) setError(\"Invalid input provided.\");\n else {\n setError(null);\n setState(newValue);\n onChange(newValue);\n }\n }\n\n return (\n \n \n {wordsToTitle(wordsFromCamel(id))}\n \n {error && {error}}\n \n );\n}\n\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PluginOptionComponent } from \"@utils/types\";\n\nimport { ISettingElementProps } from \".\";\n\nexport function SettingCustomComponent({ option, onChange, onError }: ISettingElementProps) {\n return option.component({ setValue: onChange, setError: onError, option });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { OptionType, PluginOptionNumber } from \"@utils/types\";\nimport { Forms, React, TextInput } from \"@webpack/common\";\n\nimport { ISettingElementProps } from \".\";\n\nconst MAX_SAFE_NUMBER = BigInt(Number.MAX_SAFE_INTEGER);\n\nexport function SettingNumericComponent({ option, pluginSettings, definedSettings, id, onChange, onError }: ISettingElementProps) {\n function serialize(value: any) {\n if (option.type === OptionType.BIGINT) return BigInt(value);\n return Number(value);\n }\n\n const [state, setState] = React.useState(`${pluginSettings[id] ?? option.default ?? 0}`);\n const [error, setError] = React.useState(null);\n\n React.useEffect(() => {\n onError(error !== null);\n }, [error]);\n\n function handleChange(newValue) {\n const isValid = option.isValid?.call(definedSettings, newValue) ?? true;\n\n setError(null);\n if (typeof isValid === \"string\") setError(isValid);\n else if (!isValid) setError(\"Invalid input provided.\");\n\n if (option.type === OptionType.NUMBER && BigInt(newValue) >= MAX_SAFE_NUMBER) {\n setState(`${Number.MAX_SAFE_INTEGER}`);\n onChange(serialize(newValue));\n } else {\n setState(newValue);\n onChange(serialize(newValue));\n }\n }\n\n return (\n \n {option.description}\n \n {error && {error}}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PluginOptionSelect } from \"@utils/types\";\nimport { Forms, React, Select } from \"@webpack/common\";\n\nimport { ISettingElementProps } from \".\";\n\nexport function SettingSelectComponent({ option, pluginSettings, definedSettings, onChange, onError, id }: ISettingElementProps) {\n const def = pluginSettings[id] ?? option.options?.find(o => o.default)?.value;\n\n const [state, setState] = React.useState(def ?? null);\n const [error, setError] = React.useState(null);\n\n React.useEffect(() => {\n onError(error !== null);\n }, [error]);\n\n function handleChange(newValue) {\n const isValid = option.isValid?.call(definedSettings, newValue) ?? true;\n if (typeof isValid === \"string\") setError(isValid);\n else if (!isValid) setError(\"Invalid input provided.\");\n else {\n setError(null);\n setState(newValue);\n onChange(newValue);\n }\n }\n\n return (\n \n {option.description}\n v === state}\n serialize={v => String(v)}\n {...option.componentProps}\n />\n {error && {error}}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PluginOptionSlider } from \"@utils/types\";\nimport { Forms, React, Slider } from \"@webpack/common\";\n\nimport { ISettingElementProps } from \".\";\n\nexport function makeRange(start: number, end: number, step = 1) {\n const ranges: number[] = [];\n for (let value = start; value <= end; value += step) {\n ranges.push(Math.round(value * 100) / 100);\n }\n return ranges;\n}\n\nexport function SettingSliderComponent({ option, pluginSettings, definedSettings, id, onChange, onError }: ISettingElementProps) {\n const def = pluginSettings[id] ?? option.default;\n\n const [error, setError] = React.useState(null);\n\n React.useEffect(() => {\n onError(error !== null);\n }, [error]);\n\n function handleChange(newValue: number): void {\n const isValid = option.isValid?.call(definedSettings, newValue) ?? true;\n if (typeof isValid === \"string\") setError(isValid);\n else if (!isValid) setError(\"Invalid input provided.\");\n else {\n setError(null);\n onChange(newValue);\n }\n }\n\n return (\n \n {option.description}\n String(v.toFixed(2))}\n stickToMarkers={option.stickToMarkers ?? true}\n {...option.componentProps}\n />\n \n );\n}\n\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PluginOptionString } from \"@utils/types\";\nimport { Forms, React, TextInput } from \"@webpack/common\";\n\nimport { ISettingElementProps } from \".\";\n\nexport function SettingTextComponent({ option, pluginSettings, definedSettings, id, onChange, onError }: ISettingElementProps) {\n const [state, setState] = React.useState(pluginSettings[id] ?? option.default ?? null);\n const [error, setError] = React.useState(null);\n\n React.useEffect(() => {\n onError(error !== null);\n }, [error]);\n\n function handleChange(newValue) {\n const isValid = option.isValid?.call(definedSettings, newValue) ?? true;\n if (typeof isValid === \"string\") setError(isValid);\n else if (!isValid) setError(\"Invalid input provided.\");\n else setError(null);\n\n setState(newValue);\n onChange(newValue);\n }\n\n return (\n \n {option.description}\n \n {error && {error}}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { DefinedSettings, PluginOptionBase } from \"@utils/types\";\n\nexport interface ISettingElementProps {\n option: T;\n onChange(newValue: any): void;\n pluginSettings: {\n [setting: string]: any;\n enabled: boolean;\n };\n id: string;\n onError(hasError: boolean): void;\n definedSettings?: DefinedSettings;\n}\n\nexport * from \"../../Badge\";\nexport * from \"./SettingBooleanComponent\";\nexport * from \"./SettingCustomComponent\";\nexport * from \"./SettingNumericComponent\";\nexport * from \"./SettingSelectComponent\";\nexport * from \"./SettingSliderComponent\";\nexport * from \"./SettingTextComponent\";\n\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { MessageObject } from \"@api/MessageEvents\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ChannelStore, ComponentDispatch, FluxDispatcher, GuildStore, MaskedLink, ModalImageClasses, PrivateChannelsStore, RestAPI, SelectedChannelStore, SelectedGuildStore, UserProfileStore, UserSettingsActionCreators, UserUtils } from \"@webpack/common\";\nimport { Guild, Message, User } from \"discord-types/general\";\n\nimport { ImageModal, ModalRoot, ModalSize, openModal } from \"./modal\";\n\nconst MessageActions = findByPropsLazy(\"editMessage\", \"sendMessage\");\nconst UserProfileActions = findByPropsLazy(\"openUserProfileModal\", \"closeUserProfileModal\");\n\nexport function getCurrentChannel() {\n return ChannelStore.getChannel(SelectedChannelStore.getChannelId());\n}\n\nexport function getCurrentGuild(): Guild | undefined {\n return GuildStore.getGuild(getCurrentChannel()?.guild_id);\n}\n\nexport function openPrivateChannel(userId: string) {\n PrivateChannelsStore.openPrivateChannel(userId);\n}\n\nexport const enum Theme {\n Dark = 1,\n Light = 2\n}\n\nexport function getTheme(): Theme {\n return UserSettingsActionCreators.PreloadedUserSettingsActionCreators.getCurrentValue()?.appearance?.theme;\n}\n\nexport function insertTextIntoChatInputBox(text: string) {\n ComponentDispatch.dispatchToLastSubscribed(\"INSERT_TEXT\", {\n rawText: text,\n plainText: text\n });\n}\n\ninterface MessageExtra {\n messageReference: Message[\"messageReference\"];\n allowedMentions: {\n parse: string[];\n replied_user: boolean;\n };\n stickerIds: string[];\n}\n\nexport function sendMessage(\n channelId: string,\n data: Partial,\n waitForChannelReady?: boolean,\n extra?: Partial\n) {\n const messageData = {\n content: \"\",\n invalidEmojis: [],\n tts: false,\n validNonShortcutEmojis: [],\n ...data\n };\n\n return MessageActions.sendMessage(channelId, messageData, waitForChannelReady, extra);\n}\n\nexport function openImageModal(url: string, props?: Partial>): string {\n return openModal(modalProps => (\n \n }\n shouldHideMediaOptions={false}\n shouldAnimate\n {...props}\n />\n \n ));\n}\n\nexport async function openUserProfile(id: string) {\n const user = await UserUtils.getUser(id);\n if (!user) throw new Error(\"No such user: \" + id);\n\n const guildId = SelectedGuildStore.getGuildId();\n UserProfileActions.openUserProfileModal({\n userId: id,\n guildId,\n channelId: SelectedChannelStore.getChannelId(),\n analyticsLocation: {\n page: guildId ? \"Guild Channel\" : \"DM Channel\",\n section: \"Profile Popout\"\n }\n });\n}\n\ninterface FetchUserProfileOptions {\n friend_token?: string;\n connections_role_id?: string;\n guild_id?: string;\n with_mutual_guilds?: boolean;\n with_mutual_friends_count?: boolean;\n}\n\n/**\n * Fetch a user's profile\n */\nexport async function fetchUserProfile(id: string, options?: FetchUserProfileOptions) {\n const cached = UserProfileStore.getUserProfile(id);\n if (cached) return cached;\n\n FluxDispatcher.dispatch({ type: \"USER_PROFILE_FETCH_START\", userId: id });\n\n const { body } = await RestAPI.get({\n url: `/users/${id}/profile`,\n query: {\n with_mutual_guilds: false,\n with_mutual_friends_count: false,\n ...options\n },\n oldFormErrors: true,\n });\n\n FluxDispatcher.dispatch({ type: \"USER_UPDATE\", user: body.user });\n await FluxDispatcher.dispatch({ type: \"USER_PROFILE_FETCH_SUCCESS\", ...body });\n if (options?.guild_id && body.guild_member)\n FluxDispatcher.dispatch({ type: \"GUILD_MEMBER_PROFILE_UPDATE\", guildId: options.guild_id, guildMember: body.guild_member });\n\n return UserProfileStore.getUserProfile(id);\n}\n\n/**\n * Get the unique username for a user. Returns user.username for pomelo people, user.tag otherwise\n */\nexport function getUniqueUsername(user: User) {\n return user.discriminator === \"0\" ? user.username : user.tag;\n}\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport \"./contributorModal.css\";\n\nimport { useSettings } from \"@api/Settings\";\nimport { classNameFactory } from \"@api/Styles\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { DevsById } from \"@utils/constants\";\nimport { fetchUserProfile, getTheme, Theme } from \"@utils/discord\";\nimport { ModalContent, ModalRoot, openModal } from \"@utils/modal\";\nimport { Forms, MaskedLink, showToast, useEffect, useMemo, UserProfileStore, useStateFromStores } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\n\nimport Plugins from \"~plugins\";\n\nimport { PluginCard } from \".\";\n\nconst WebsiteIconDark = \"/assets/e1e96d89e192de1997f73730db26e94f.svg\";\nconst WebsiteIconLight = \"/assets/730f58bcfd5a57a5e22460c445a0c6cf.svg\";\nconst GithubIconLight = \"/assets/3ff98ad75ac94fa883af5ed62d17c459.svg\";\nconst GithubIconDark = \"/assets/6a853b4c87fce386cbfef4a2efbacb09.svg\";\n\nconst cl = classNameFactory(\"vc-author-modal-\");\n\nexport function openContributorModal(user: User) {\n openModal(modalProps =>\n \n \n \n \n \n \n \n );\n}\n\nfunction GithubIcon() {\n const src = getTheme() === Theme.Light ? GithubIconLight : GithubIconDark;\n return \"GitHub\";\n}\n\nfunction WebsiteIcon() {\n const src = getTheme() === Theme.Light ? WebsiteIconLight : WebsiteIconDark;\n return \"Website\";\n}\n\nfunction ContributorModal({ user }: { user: User; }) {\n useSettings();\n\n const profile = useStateFromStores([UserProfileStore], () => UserProfileStore.getUserProfile(user.id));\n\n useEffect(() => {\n if (!profile && !user.bot && user.id)\n fetchUserProfile(user.id);\n }, [user.id]);\n\n const githubName = profile?.connectedAccounts?.find(a => a.type === \"github\")?.name;\n const website = profile?.connectedAccounts?.find(a => a.type === \"domain\")?.name;\n\n const plugins = useMemo(() => {\n const allPlugins = Object.values(Plugins);\n const pluginsByAuthor = DevsById[user.id]\n ? allPlugins.filter(p => p.authors.includes(DevsById[user.id]))\n : allPlugins.filter(p => p.authors.some(a => a.name === user.username));\n\n return pluginsByAuthor\n .filter(p => !p.name.endsWith(\"API\"))\n .sort((a, b) => Number(a.required ?? false) - Number(b.required ?? false));\n }, [user.id, user.username]);\n\n return (\n <>\n
\n \n {user.username}\n\n
\n {website && (\n \n \n \n )}\n {githubName && (\n \n \n \n )}\n
\n
\n\n
\n {plugins.map(p =>\n showToast(\"Restart to apply changes!\")}\n />\n )}\n
\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { generateId } from \"@api/Commands\";\nimport { useSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { proxyLazy } from \"@utils/lazy\";\nimport { Margins } from \"@utils/margins\";\nimport { classes, isObjectEmpty } from \"@utils/misc\";\nimport { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize } from \"@utils/modal\";\nimport { LazyComponent } from \"@utils/react\";\nimport { OptionType, Plugin } from \"@utils/types\";\nimport { findByCode, findByPropsLazy } from \"@webpack\";\nimport { Button, Clickable, FluxDispatcher, Forms, React, Text, Tooltip, UserStore, UserUtils } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\nimport { Constructor } from \"type-fest\";\n\nimport {\n ISettingElementProps,\n SettingBooleanComponent,\n SettingCustomComponent,\n SettingNumericComponent,\n SettingSelectComponent,\n SettingSliderComponent,\n SettingTextComponent\n} from \"./components\";\nimport { openContributorModal } from \"./ContributorModal\";\n\nconst UserSummaryItem = LazyComponent(() => findByCode(\"defaultRenderUser\", \"showDefaultAvatarsForNullUsers\"));\nconst AvatarStyles = findByPropsLazy(\"moreUsers\", \"emptyUser\", \"avatarContainer\", \"clickableAvatar\");\nconst UserRecord: Constructor> = proxyLazy(() => UserStore.getCurrentUser().constructor) as any;\n\ninterface PluginModalProps extends ModalProps {\n plugin: Plugin;\n onRestartNeeded(): void;\n}\n\nfunction makeDummyUser(user: { username: string; id?: string; avatar?: string; }) {\n const newUser = new UserRecord({\n username: user.username,\n id: user.id ?? generateId(),\n avatar: user.avatar,\n /** To stop discord making unwanted requests... */\n bot: true,\n });\n FluxDispatcher.dispatch({\n type: \"USER_UPDATE\",\n user: newUser,\n });\n return newUser;\n}\n\nconst Components: Record>> = {\n [OptionType.STRING]: SettingTextComponent,\n [OptionType.NUMBER]: SettingNumericComponent,\n [OptionType.BIGINT]: SettingNumericComponent,\n [OptionType.BOOLEAN]: SettingBooleanComponent,\n [OptionType.SELECT]: SettingSelectComponent,\n [OptionType.SLIDER]: SettingSliderComponent,\n [OptionType.COMPONENT]: SettingCustomComponent\n};\n\nexport default function PluginModal({ plugin, onRestartNeeded, onClose, transitionState }: PluginModalProps) {\n const [authors, setAuthors] = React.useState[]>([]);\n\n const pluginSettings = useSettings().plugins[plugin.name];\n\n const [tempSettings, setTempSettings] = React.useState>({});\n\n const [errors, setErrors] = React.useState>({});\n const [saveError, setSaveError] = React.useState(null);\n\n const canSubmit = () => Object.values(errors).every(e => !e);\n\n const hasSettings = Boolean(pluginSettings && plugin.options && !isObjectEmpty(plugin.options));\n\n React.useEffect(() => {\n (async () => {\n for (const user of plugin.authors.slice(0, 6)) {\n const author = user.id\n ? await UserUtils.getUser(`${user.id}`)\n .catch(() => makeDummyUser({ username: user.name }))\n : makeDummyUser({ username: user.name });\n\n setAuthors(a => [...a, author]);\n }\n })();\n }, []);\n\n async function saveAndClose() {\n if (!plugin.options) {\n onClose();\n return;\n }\n\n if (plugin.beforeSave) {\n const result = await Promise.resolve(plugin.beforeSave(tempSettings));\n if (result !== true) {\n setSaveError(result);\n return;\n }\n }\n\n let restartNeeded = false;\n for (const [key, value] of Object.entries(tempSettings)) {\n const option = plugin.options[key];\n pluginSettings[key] = value;\n option?.onChange?.(value);\n if (option?.restartNeeded) restartNeeded = true;\n }\n if (restartNeeded) onRestartNeeded();\n onClose();\n }\n\n function renderSettings() {\n if (!hasSettings || !plugin.options) {\n return There are no settings for this plugin.;\n } else {\n const options = Object.entries(plugin.options).map(([key, setting]) => {\n if (setting.hidden) return null;\n\n function onChange(newValue: any) {\n setTempSettings(s => ({ ...s, [key]: newValue }));\n }\n\n function onError(hasError: boolean) {\n setErrors(e => ({ ...e, [key]: hasError }));\n }\n\n const Component = Components[setting.type];\n return (\n \n );\n });\n\n return {options};\n }\n }\n\n function renderMoreUsers(_label: string, count: number) {\n const sliceCount = plugin.authors.length - count;\n const sliceStart = plugin.authors.length - sliceCount;\n const sliceEnd = sliceStart + plugin.authors.length - count;\n\n return (\n u.name).join(\", \")}>\n {({ onMouseEnter, onMouseLeave }) => (\n \n +{sliceCount}\n
\n )}\n \n );\n }\n\n return (\n \n \n {plugin.name}\n \n \n \n \n About {plugin.name}\n {plugin.description}\n Authors\n
\n (\n openContributorModal(user)}\n >\n \n \n )}\n />\n
\n
\n {!!plugin.settingsAboutComponent && (\n
\n \n \n \n \n \n
\n )}\n \n Settings\n {renderSettings()}\n \n
\n {hasSettings && \n \n \n \n Cancel\n \n \n {({ onMouseEnter, onMouseLeave }) => (\n \n Save & Close\n \n )}\n \n \n {saveError && Error while saving: {saveError}}\n \n }\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./Switch.css\";\n\nimport { classes } from \"@utils/misc\";\nimport { findByPropsLazy } from \"@webpack\";\n\ninterface SwitchProps {\n checked: boolean;\n onChange: (checked: boolean) => void;\n disabled?: boolean;\n}\n\nconst SWITCH_ON = \"var(--green-360)\";\nconst SWITCH_OFF = \"var(--primary-400)\";\nconst SwitchClasses = findByPropsLazy(\"slider\", \"input\", \"container\");\n\nexport function Switch({ checked, onChange, disabled }: SwitchProps) {\n return (\n
\n
\n \n \n \n {checked ? (\n <>\n \n \n \n ) : (\n <>\n \n \n \n )}\n\n \n \n onChange(e.currentTarget.checked)}\n />\n
\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./addonCard.css\";\n\nimport { classNameFactory } from \"@api/Styles\";\nimport { Badge } from \"@components/Badge\";\nimport { Switch } from \"@components/Switch\";\nimport { Text } from \"@webpack/common\";\nimport type { MouseEventHandler, ReactNode } from \"react\";\n\nconst cl = classNameFactory(\"vc-addon-\");\n\ninterface Props {\n name: ReactNode;\n description: ReactNode;\n enabled: boolean;\n setEnabled: (enabled: boolean) => void;\n disabled?: boolean;\n isNew?: boolean;\n onMouseEnter?: MouseEventHandler;\n onMouseLeave?: MouseEventHandler;\n\n infoButton?: ReactNode;\n footer?: ReactNode;\n author?: ReactNode;\n}\n\nexport function AddonCard({ disabled, isNew, name, infoButton, footer, author, enabled, setEnabled, description, onMouseEnter, onMouseLeave }: Props) {\n return (\n \n
\n
\n \n {name}{isNew && }\n \n {!!author && (\n \n {author}\n \n )}\n
\n\n {infoButton}\n\n \n
\n\n {description}\n\n {footer}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport class ChangeList{\n private set = new Set();\n\n public get changeCount() {\n return this.set.size;\n }\n\n public get hasChanges() {\n return this.changeCount > 0;\n }\n\n public handleChange(item: T) {\n if (!this.set.delete(item))\n this.set.add(item);\n }\n\n public add(item: T) {\n return this.set.add(item);\n }\n\n public remove(item: T) {\n return this.set.delete(item);\n }\n\n public getChanges() {\n return this.set.values();\n }\n\n public map(mapper: (v: T, idx: number, arr: T[]) => R): R[] {\n return [...this.getChanges()].map(mapper);\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { registerCommand, unregisterCommand } from \"@api/Commands\";\nimport { Settings } from \"@api/Settings\";\nimport { Logger } from \"@utils/Logger\";\nimport { Patch, Plugin } from \"@utils/types\";\nimport { FluxDispatcher } from \"@webpack/common\";\nimport { FluxEvents } from \"@webpack/types\";\n\nimport Plugins from \"~plugins\";\n\nimport { traceFunction } from \"../debug/Tracer\";\n\nconst logger = new Logger(\"PluginManager\", \"#a6d189\");\n\nexport const PMLogger = logger;\nexport const plugins = Plugins;\nexport const patches = [] as Patch[];\n\nconst settings = Settings.plugins;\n\nexport function isPluginEnabled(p: string) {\n return (\n Plugins[p]?.required ||\n Plugins[p]?.isDependency ||\n settings[p]?.enabled\n ) ?? false;\n}\n\nconst pluginsValues = Object.values(Plugins);\n\n// First roundtrip to mark and force enable dependencies (only for enabled plugins)\n//\n// FIXME: might need to revisit this if there's ever nested (dependencies of dependencies) dependencies since this only\n// goes for the top level and their children, but for now this works okay with the current API plugins\nfor (const p of pluginsValues) if (settings[p.name]?.enabled) {\n p.dependencies?.forEach(d => {\n const dep = Plugins[d];\n if (dep) {\n settings[d].enabled = true;\n dep.isDependency = true;\n }\n else {\n const error = new Error(`Plugin ${p.name} has unresolved dependency ${d}`);\n if (IS_DEV)\n throw error;\n logger.warn(error);\n }\n });\n}\n\nfor (const p of pluginsValues) {\n if (p.settings) {\n p.settings.pluginName = p.name;\n p.options ??= {};\n for (const [name, def] of Object.entries(p.settings.def)) {\n const checks = p.settings.checks?.[name];\n p.options[name] = { ...def, ...checks };\n }\n }\n\n if (p.patches && isPluginEnabled(p.name)) {\n for (const patch of p.patches) {\n patch.plugin = p.name;\n if (!Array.isArray(patch.replacement))\n patch.replacement = [patch.replacement];\n patches.push(patch);\n }\n }\n}\n\nexport const startAllPlugins = traceFunction(\"startAllPlugins\", function startAllPlugins() {\n for (const name in Plugins)\n if (isPluginEnabled(name)) {\n startPlugin(Plugins[name]);\n }\n});\n\nexport function startDependenciesRecursive(p: Plugin) {\n let restartNeeded = false;\n const failures: string[] = [];\n p.dependencies?.forEach(dep => {\n if (!Settings.plugins[dep].enabled) {\n startDependenciesRecursive(Plugins[dep]);\n // If the plugin has patches, don't start the plugin, just enable it.\n Settings.plugins[dep].enabled = true;\n if (Plugins[dep].patches) {\n logger.warn(`Enabling dependency ${dep} requires restart.`);\n restartNeeded = true;\n return;\n }\n const result = startPlugin(Plugins[dep]);\n if (!result) failures.push(dep);\n }\n });\n return { restartNeeded, failures };\n}\n\nexport const startPlugin = traceFunction(\"startPlugin\", function startPlugin(p: Plugin) {\n const { name, commands, flux } = p;\n\n if (p.start) {\n logger.info(\"Starting plugin\", name);\n if (p.started) {\n logger.warn(`${name} already started`);\n return false;\n }\n try {\n p.start();\n p.started = true;\n } catch (e) {\n logger.error(`Failed to start ${name}\\n`, e);\n return false;\n }\n }\n\n if (commands?.length) {\n logger.info(\"Registering commands of plugin\", name);\n for (const cmd of commands) {\n try {\n registerCommand(cmd, name);\n } catch (e) {\n logger.error(`Failed to register command ${cmd.name}\\n`, e);\n return false;\n }\n }\n }\n\n if (flux) {\n for (const event in flux) {\n FluxDispatcher.subscribe(event as FluxEvents, flux[event]);\n }\n }\n\n return true;\n}, p => `startPlugin ${p.name}`);\n\nexport const stopPlugin = traceFunction(\"stopPlugin\", function stopPlugin(p: Plugin) {\n const { name, commands, flux } = p;\n if (p.stop) {\n logger.info(\"Stopping plugin\", name);\n if (!p.started) {\n logger.warn(`${name} already stopped`);\n return false;\n }\n try {\n p.stop();\n p.started = false;\n } catch (e) {\n logger.error(`Failed to stop ${name}\\n`, e);\n return false;\n }\n }\n\n if (commands?.length) {\n logger.info(\"Unregistering commands of plugin\", name);\n for (const cmd of commands) {\n try {\n unregisterCommand(cmd.name);\n } catch (e) {\n logger.error(`Failed to unregister command ${cmd.name}\\n`, e);\n return false;\n }\n }\n }\n\n if (flux) {\n for (const event in flux) {\n FluxDispatcher.unsubscribe(event as FluxEvents, flux[event]);\n }\n }\n\n return true;\n}, p => `stopPlugin ${p.name}`);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport * as DataStore from \"@api/DataStore\";\nimport { showNotice } from \"@api/Notices\";\nimport { Settings, useSettings } from \"@api/Settings\";\nimport { classNameFactory } from \"@api/Styles\";\nimport { CogWheel, InfoIcon } from \"@components/Icons\";\nimport PluginModal from \"@components/PluginSettings/PluginModal\";\nimport { AddonCard } from \"@components/VencordSettings/AddonCard\";\nimport { SettingsTab } from \"@components/VencordSettings/shared\";\nimport { ChangeList } from \"@utils/ChangeList\";\nimport { Logger } from \"@utils/Logger\";\nimport { Margins } from \"@utils/margins\";\nimport { classes, isObjectEmpty } from \"@utils/misc\";\nimport { openModalLazy } from \"@utils/modal\";\nimport { useAwaiter } from \"@utils/react\";\nimport { Plugin } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { Alerts, Button, Card, Forms, lodash, Parser, React, Select, Text, TextInput, Toasts, Tooltip } from \"@webpack/common\";\n\nimport Plugins from \"~plugins\";\n\nimport { startDependenciesRecursive, startPlugin, stopPlugin } from \"../../plugins\";\n\n\nconst cl = classNameFactory(\"vc-plugins-\");\nconst logger = new Logger(\"PluginSettings\", \"#a6d189\");\n\nconst InputStyles = findByPropsLazy(\"inputDefault\", \"inputWrapper\");\nconst ButtonClasses = findByPropsLazy(\"button\", \"disabled\", \"enabled\");\n\n\nfunction showErrorToast(message: string) {\n Toasts.show({\n message,\n type: Toasts.Type.FAILURE,\n id: Toasts.genId(),\n options: {\n position: Toasts.Position.BOTTOM\n }\n });\n}\n\nfunction ReloadRequiredCard({ required }: { required: boolean; }) {\n return (\n \n {required ? (\n <>\n Restart required!\n \n Restart now to apply new plugins and their settings\n \n \n \n ) : (\n <>\n Plugin Management\n Press the cog wheel or info icon to get more info on a plugin\n Plugins with a cog wheel have settings you can modify!\n \n )}\n \n );\n}\n\ninterface PluginCardProps extends React.HTMLProps {\n plugin: Plugin;\n disabled: boolean;\n onRestartNeeded(name: string): void;\n isNew?: boolean;\n}\n\nexport function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, onMouseLeave, isNew }: PluginCardProps) {\n const settings = Settings.plugins[plugin.name];\n\n const isEnabled = () => settings.enabled ?? false;\n\n function openModal() {\n openModalLazy(async () => {\n return modalProps => {\n return onRestartNeeded(plugin.name)} />;\n };\n });\n }\n\n function toggleEnabled() {\n const wasEnabled = isEnabled();\n\n // If we're enabling a plugin, make sure all deps are enabled recursively.\n if (!wasEnabled) {\n const { restartNeeded, failures } = startDependenciesRecursive(plugin);\n if (failures.length) {\n logger.error(`Failed to start dependencies for ${plugin.name}: ${failures.join(\", \")}`);\n showNotice(\"Failed to start dependencies: \" + failures.join(\", \"), \"Close\", () => null);\n return;\n } else if (restartNeeded) {\n // If any dependencies have patches, don't start the plugin yet.\n settings.enabled = true;\n onRestartNeeded(plugin.name);\n return;\n }\n }\n\n // if the plugin has patches, dont use stopPlugin/startPlugin. Wait for restart to apply changes.\n if (plugin.patches?.length) {\n settings.enabled = !wasEnabled;\n onRestartNeeded(plugin.name);\n return;\n }\n\n // If the plugin is enabled, but hasn't been started, then we can just toggle it off.\n if (wasEnabled && !plugin.started) {\n settings.enabled = !wasEnabled;\n return;\n }\n\n const result = wasEnabled ? stopPlugin(plugin) : startPlugin(plugin);\n\n if (!result) {\n settings.enabled = false;\n\n const msg = `Error while ${wasEnabled ? \"stopping\" : \"starting\"} plugin ${plugin.name}`;\n logger.error(msg);\n showErrorToast(msg);\n return;\n }\n\n settings.enabled = !wasEnabled;\n }\n\n return (\n openModal()} className={classes(ButtonClasses.button, cl(\"info-button\"))}>\n {plugin.options && !isObjectEmpty(plugin.options)\n ? \n : }\n \n }\n />\n );\n}\n\nconst enum SearchStatus {\n ALL,\n ENABLED,\n DISABLED,\n NEW\n}\n\nexport default function PluginSettings() {\n const settings = useSettings();\n const changes = React.useMemo(() => new ChangeList(), []);\n\n React.useEffect(() => {\n return () => void (changes.hasChanges && Alerts.show({\n title: \"Restart required\",\n body: (\n <>\n

The following plugins require a restart:

\n
{changes.map((s, i) => (\n <>\n {i > 0 && \", \"}\n {Parser.parse(\"`\" + s + \"`\")}\n \n ))}
\n \n ),\n confirmText: \"Restart now\",\n cancelText: \"Later!\",\n onConfirm: () => location.reload()\n }));\n }, []);\n\n const depMap = React.useMemo(() => {\n const o = {} as Record;\n for (const plugin in Plugins) {\n const deps = Plugins[plugin].dependencies;\n if (deps) {\n for (const dep of deps) {\n o[dep] ??= [];\n o[dep].push(plugin);\n }\n }\n }\n return o;\n }, []);\n\n const sortedPlugins = React.useMemo(() => Object.values(Plugins)\n .sort((a, b) => a.name.localeCompare(b.name)), []);\n\n const [searchValue, setSearchValue] = React.useState({ value: \"\", status: SearchStatus.ALL });\n\n const onSearch = (query: string) => setSearchValue(prev => ({ ...prev, value: query }));\n const onStatusChange = (status: SearchStatus) => setSearchValue(prev => ({ ...prev, status }));\n\n const pluginFilter = (plugin: typeof Plugins[keyof typeof Plugins]) => {\n const enabled = settings.plugins[plugin.name]?.enabled;\n if (enabled && searchValue.status === SearchStatus.DISABLED) return false;\n if (!enabled && searchValue.status === SearchStatus.ENABLED) return false;\n if (searchValue.status === SearchStatus.NEW && !newPlugins?.includes(plugin.name)) return false;\n if (!searchValue.value.length) return true;\n\n const v = searchValue.value.toLowerCase();\n return (\n plugin.name.toLowerCase().includes(v) ||\n plugin.description.toLowerCase().includes(v) ||\n plugin.tags?.some(t => t.toLowerCase().includes(v))\n );\n };\n\n const [newPlugins] = useAwaiter(() => DataStore.get(\"Vencord_existingPlugins\").then((cachedPlugins: Record | undefined) => {\n const now = Date.now() / 1000;\n const existingTimestamps: Record = {};\n const sortedPluginNames = Object.values(sortedPlugins).map(plugin => plugin.name);\n\n const newPlugins: string[] = [];\n for (const { name: p } of sortedPlugins) {\n const time = existingTimestamps[p] = cachedPlugins?.[p] ?? now;\n if ((time + 60 * 60 * 24 * 2) > now) {\n newPlugins.push(p);\n }\n }\n DataStore.set(\"Vencord_existingPlugins\", existingTimestamps);\n\n return lodash.isEqual(newPlugins, sortedPluginNames) ? [] : newPlugins;\n }));\n\n type P = JSX.Element | JSX.Element[];\n let plugins: P, requiredPlugins: P;\n if (sortedPlugins?.length) {\n plugins = [];\n requiredPlugins = [];\n\n for (const p of sortedPlugins) {\n if (!p.options && p.name.endsWith(\"API\") && searchValue.value !== \"API\")\n continue;\n\n if (!pluginFilter(p)) continue;\n\n const isRequired = p.required || depMap[p.name]?.some(d => settings.plugins[d].enabled);\n\n if (isRequired) {\n const tooltipText = p.required\n ? \"This plugin is required for Vencord to function.\"\n : makeDependencyList(depMap[p.name]?.filter(d => settings.plugins[d].enabled));\n\n requiredPlugins.push(\n \n {({ onMouseLeave, onMouseEnter }) => (\n changes.handleChange(name)}\n disabled={true}\n plugin={p}\n />\n )}\n \n );\n } else {\n plugins.push(\n changes.handleChange(name)}\n disabled={false}\n plugin={p}\n isNew={newPlugins?.includes(p.name)}\n key={p.name}\n />\n );\n }\n\n }\n } else {\n plugins = requiredPlugins = No plugins meet search criteria.;\n }\n\n return (\n \n \n\n \n Filters\n \n\n
\n \n
\n v === searchValue.status}\n closeOnSelect={true}\n />\n
\n
\n\n Plugins\n\n
\n {plugins}\n
\n\n \n\n \n Required Plugins\n \n
\n {requiredPlugins}\n
\n
\n );\n}\n\nfunction makeDependencyList(deps: string[]) {\n return (\n \n This plugin is required by:\n {deps.map((dep: string) => {dep})}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport PluginSettings from \"@components/PluginSettings\";\n\nimport { wrapTab } from \"./shared\";\n\nexport default wrapTab(PluginSettings, \"Plugins\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { React } from \"@webpack/common\";\n\ninterface Props extends React.DetailedHTMLProps, HTMLAnchorElement> {\n disabled?: boolean;\n}\n\nexport function Link(props: React.PropsWithChildren) {\n if (props.disabled) {\n props.style ??= {};\n props.style.pointerEvents = \"none\";\n props[\"aria-disabled\"] = true;\n }\n return (\n \n {props.children}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { useSettings } from \"@api/Settings\";\nimport { classNameFactory } from \"@api/Styles\";\nimport { Flex } from \"@components/Flex\";\nimport { DeleteIcon } from \"@components/Icons\";\nimport { Link } from \"@components/Link\";\nimport { Margins } from \"@utils/margins\";\nimport { classes } from \"@utils/misc\";\nimport { showItemInFolder } from \"@utils/native\";\nimport { useAwaiter } from \"@utils/react\";\nimport { findByPropsLazy, findLazy } from \"@webpack\";\nimport { Button, Card, FluxDispatcher, Forms, React, showToast, TabBar, TextArea, useEffect, useRef, useState } from \"@webpack/common\";\nimport { UserThemeHeader } from \"main/themes\";\nimport type { ComponentType, Ref, SyntheticEvent } from \"react\";\n\nimport { AddonCard } from \"./AddonCard\";\nimport { SettingsTab, wrapTab } from \"./shared\";\n\ntype FileInput = ComponentType<{\n ref: Ref;\n onChange: (e: SyntheticEvent) => void;\n multiple?: boolean;\n filters?: { name?: string; extensions: string[]; }[];\n}>;\n\nconst InviteActions = findByPropsLazy(\"resolveInvite\");\nconst FileInput: FileInput = findLazy(m => m.prototype?.activateUploadDialogue && m.prototype.setRef);\nconst TextAreaProps = findLazy(m => typeof m.textarea === \"string\");\n\nconst cl = classNameFactory(\"vc-settings-theme-\");\n\nfunction Validator({ link }: { link: string; }) {\n const [res, err, pending] = useAwaiter(() => fetch(link).then(res => {\n if (res.status > 300) throw `${res.status} ${res.statusText}`;\n const contentType = res.headers.get(\"Content-Type\");\n if (!contentType?.startsWith(\"text/css\") && !contentType?.startsWith(\"text/plain\"))\n throw \"Not a CSS file. Remember to use the raw link!\";\n\n return \"Okay!\";\n }));\n\n const text = pending\n ? \"Checking...\"\n : err\n ? `Error: ${err instanceof Error ? err.message : String(err)}`\n : \"Valid!\";\n\n return {text};\n}\n\nfunction Validators({ themeLinks }: { themeLinks: string[]; }) {\n if (!themeLinks.length) return null;\n\n return (\n <>\n Validator\n This section will tell you whether your themes can successfully be loaded\n
\n {themeLinks.map(link => (\n \n \n {link}\n \n \n \n ))}\n
\n \n );\n}\n\ninterface ThemeCardProps {\n theme: UserThemeHeader;\n enabled: boolean;\n onChange: (enabled: boolean) => void;\n onDelete: () => void;\n}\n\nfunction ThemeCard({ theme, enabled, onChange, onDelete }: ThemeCardProps) {\n return (\n \n \n \n )\n }\n footer={\n \n {!!theme.website && Website}\n {!!(theme.website && theme.invite) && \" \u2022 \"}\n {!!theme.invite && (\n {\n e.preventDefault();\n const { invite } = await InviteActions.resolveInvite(theme.invite, \"Desktop Modal\");\n if (!invite) return showToast(\"Invalid or expired invite\");\n\n FluxDispatcher.dispatch({\n type: \"INVITE_MODAL_OPEN\",\n invite,\n code: theme.invite,\n context: \"APP\"\n });\n }}\n >\n Discord Server\n \n )}\n \n }\n />\n );\n}\n\nenum ThemeTab {\n LOCAL,\n ONLINE\n}\n\nfunction ThemesTab() {\n const settings = useSettings([\"themeLinks\", \"enabledThemes\"]);\n\n const fileInputRef = useRef(null);\n const [currentTab, setCurrentTab] = useState(ThemeTab.LOCAL);\n const [themeText, setThemeText] = useState(settings.themeLinks.join(\"\\n\"));\n const [userThemes, setUserThemes] = useState(null);\n const [themeDir, , themeDirPending] = useAwaiter(VencordNative.themes.getThemesDir);\n\n useEffect(() => {\n refreshLocalThemes();\n }, []);\n\n async function refreshLocalThemes() {\n const themes = await VencordNative.themes.getThemesList();\n setUserThemes(themes);\n }\n\n // When a local theme is enabled/disabled, update the settings\n function onLocalThemeChange(fileName: string, value: boolean) {\n if (value) {\n if (settings.enabledThemes.includes(fileName)) return;\n settings.enabledThemes = [...settings.enabledThemes, fileName];\n } else {\n settings.enabledThemes = settings.enabledThemes.filter(f => f !== fileName);\n }\n }\n\n async function onFileUpload(e: SyntheticEvent) {\n e.stopPropagation();\n e.preventDefault();\n if (!e.currentTarget?.files?.length) return;\n const { files } = e.currentTarget;\n\n const uploads = Array.from(files, file => {\n const { name } = file;\n if (!name.endsWith(\".css\")) return;\n\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n VencordNative.themes.uploadTheme(name, reader.result as string)\n .then(resolve)\n .catch(reject);\n };\n reader.readAsText(file);\n });\n });\n\n await Promise.all(uploads);\n refreshLocalThemes();\n }\n\n function renderLocalThemes() {\n return (\n <>\n \n Find Themes:\n
\n \n BetterDiscord Themes\n \n GitHub\n
\n If using the BD site, click on \"Download\" and place the downloaded .theme.css file into your themes folder.\n
\n\n \n \n <>\n {IS_WEB ?\n (\n \n Upload Theme\n \n \n ) : (\n showItemInFolder(themeDir!)}\n size={Button.Sizes.SMALL}\n disabled={themeDirPending}\n >\n Open Themes Folder\n \n )}\n \n Load missing Themes\n \n VencordNative.quickCss.openEditor()}\n size={Button.Sizes.SMALL}\n >\n Edit QuickCSS\n \n \n \n\n
\n {userThemes?.map(theme => (\n onLocalThemeChange(theme.fileName, enabled)}\n onDelete={async () => {\n onLocalThemeChange(theme.fileName, false);\n await VencordNative.themes.deleteTheme(theme.fileName);\n refreshLocalThemes();\n }}\n theme={theme}\n />\n ))}\n
\n
\n \n );\n }\n\n // When the user leaves the online theme textbox, update the settings\n function onBlur() {\n settings.themeLinks = [...new Set(\n themeText\n .trim()\n .split(/\\n+/)\n .map(s => s.trim())\n .filter(Boolean)\n )];\n }\n\n function renderOnlineThemes() {\n return (\n <>\n \n Paste links to css files here\n One link per line\n Make sure to use direct links to files (raw or github.io)!\n \n\n \n \n \n \n \n );\n }\n\n return (\n \n \n \n Local Themes\n \n \n Online Themes\n \n \n\n {currentTab === ThemeTab.LOCAL && renderLocalThemes()}\n {currentTab === ThemeTab.ONLINE && renderOnlineThemes()}\n \n );\n}\n\nexport default wrapTab(ThemesTab, \"Themes\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { useSettings } from \"@api/Settings\";\nimport { ErrorCard } from \"@components/ErrorCard\";\nimport { Flex } from \"@components/Flex\";\nimport { Link } from \"@components/Link\";\nimport { Margins } from \"@utils/margins\";\nimport { classes } from \"@utils/misc\";\nimport { relaunch } from \"@utils/native\";\nimport { useAwaiter } from \"@utils/react\";\nimport { changes, checkForUpdates, getRepo, isNewer, update, updateError, UpdateLogger } from \"@utils/updater\";\nimport { Alerts, Button, Card, Forms, Parser, React, Switch, Toasts } from \"@webpack/common\";\n\nimport gitHash from \"~git-hash\";\n\nimport { SettingsTab, wrapTab } from \"./shared\";\n\nfunction withDispatcher(dispatcher: React.Dispatch>, action: () => any) {\n return async () => {\n dispatcher(true);\n try {\n await action();\n } catch (e: any) {\n UpdateLogger.error(\"Failed to update\", e);\n if (!e) {\n var err = \"An unknown error occurred (error is undefined).\\nPlease try again.\";\n } else if (e.code && e.cmd) {\n const { code, path, cmd, stderr } = e;\n\n if (code === \"ENOENT\")\n var err = `Command \\`${path}\\` not found.\\nPlease install it and try again`;\n else {\n var err = `An error occurred while running \\`${cmd}\\`:\\n`;\n err += stderr || `Code \\`${code}\\`. See the console for more info`;\n }\n\n } else {\n var err = \"An unknown error occurred. See the console for more info.\";\n }\n Alerts.show({\n title: \"Oops!\",\n body: (\n \n {err.split(\"\\n\").map(line =>
{Parser.parse(line)}
)}\n
\n )\n });\n }\n finally {\n dispatcher(false);\n }\n };\n}\n\ninterface CommonProps {\n repo: string;\n repoPending: boolean;\n}\n\nfunction HashLink({ repo, hash, disabled = false }: { repo: string, hash: string, disabled?: boolean; }) {\n return \n {hash}\n ;\n}\n\nfunction Changes({ updates, repo, repoPending }: CommonProps & { updates: typeof changes; }) {\n return (\n \n {updates.map(({ hash, author, message }) => (\n
\n \n {message} - {author}\n
\n ))}\n
\n );\n}\n\nfunction Updatable(props: CommonProps) {\n const [updates, setUpdates] = React.useState(changes);\n const [isChecking, setIsChecking] = React.useState(false);\n const [isUpdating, setIsUpdating] = React.useState(false);\n\n const isOutdated = (updates?.length ?? 0) > 0;\n\n return (\n <>\n {!updates && updateError ? (\n <>\n Failed to check updates. Check the console for more info\n \n

{updateError.stderr || updateError.stdout || \"An unknown error occurred\"}

\n
\n \n ) : (\n \n {isOutdated ? `There are ${updates.length} Updates` : \"Up to Date!\"}\n \n )}\n\n {isOutdated && }\n\n \n {isOutdated && {\n if (await update()) {\n setUpdates([]);\n await new Promise(r => {\n Alerts.show({\n title: \"Update Success!\",\n body: \"Successfully updated. Restart now to apply the changes?\",\n confirmText: \"Restart\",\n cancelText: \"Not now!\",\n onConfirm() {\n relaunch();\n r();\n },\n onCancel: r\n });\n });\n }\n })}\n >\n Update Now\n }\n {\n const outdated = await checkForUpdates();\n if (outdated) {\n setUpdates(changes);\n } else {\n setUpdates([]);\n Toasts.show({\n message: \"No updates found!\",\n id: Toasts.genId(),\n type: Toasts.Type.MESSAGE,\n options: {\n position: Toasts.Position.BOTTOM\n }\n });\n }\n })}\n >\n Check for Updates\n \n \n \n );\n}\n\nfunction Newer(props: CommonProps) {\n return (\n <>\n \n Your local copy has more recent commits. Please stash or reset them.\n \n \n \n );\n}\n\nfunction Updater() {\n const settings = useSettings([\"notifyAboutUpdates\", \"autoUpdate\", \"autoUpdateNotification\"]);\n\n const [repo, err, repoPending] = useAwaiter(getRepo, { fallbackValue: \"Loading...\" });\n\n React.useEffect(() => {\n if (err)\n UpdateLogger.error(\"Failed to retrieve repo\", err);\n }, [err]);\n\n const commonProps: CommonProps = {\n repo,\n repoPending\n };\n\n return (\n \n Updater Settings\n settings.notifyAboutUpdates = v}\n note=\"Shows a notification on startup\"\n disabled={settings.autoUpdate}\n >\n Get notified about new updates\n \n settings.autoUpdate = v}\n note=\"Automatically update Vencord without confirmation prompt\"\n >\n Automatically update\n \n settings.autoUpdateNotification = v}\n note=\"Shows a notification when Vencord automatically updates\"\n disabled={!settings.autoUpdate}\n >\n Get notified when an automatic update completes\n \n\n Repo\n\n \n {repoPending\n ? repo\n : err\n ? \"Failed to retrieve - check console\"\n : (\n \n {repo.split(\"/\").slice(-2).join(\"/\")}\n \n )\n }\n {\" \"}()\n \n\n \n\n Updates\n\n {isNewer ? : }\n \n );\n}\n\nexport default IS_UPDATER_DISABLED ? null : wrapTab(Updater, \"Updater\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { React, TextInput } from \"@webpack/common\";\n\n// TODO: Refactor settings to use this as well\ninterface TextInputProps {\n /**\n * WARNING: Changing this between renders will have no effect!\n */\n value: string;\n /**\n * This will only be called if the new value passed validate()\n */\n onChange(newValue: string): void;\n /**\n * Optionally validate the user input\n * Return true if the input is valid\n * Otherwise, return a string containing the reason for this input being invalid\n */\n validate(v: string): true | string;\n}\n\n/**\n * A very simple wrapper around Discord's TextInput that validates input and shows\n * the user an error message and only calls your onChange when the input is valid\n */\nexport function CheckedTextInput({ value: initialValue, onChange, validate }: TextInputProps) {\n const [value, setValue] = React.useState(initialValue);\n const [error, setError] = React.useState();\n\n function handleChange(v: string) {\n setValue(v);\n const res = validate(v);\n if (res === true) {\n setError(void 0);\n onChange(v);\n } else {\n setError(res);\n }\n }\n\n return (\n <>\n \n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { showNotification } from \"@api/Notifications\";\nimport { Settings, useSettings } from \"@api/Settings\";\nimport { CheckedTextInput } from \"@components/CheckedTextInput\";\nimport { Link } from \"@components/Link\";\nimport { authorizeCloud, cloudLogger, deauthorizeCloud, getCloudAuth, getCloudUrl } from \"@utils/cloud\";\nimport { Margins } from \"@utils/margins\";\nimport { deleteCloudSettings, getCloudSettings, putCloudSettings } from \"@utils/settingsSync\";\nimport { Alerts, Button, Forms, Switch, Tooltip } from \"@webpack/common\";\n\nimport { SettingsTab, wrapTab } from \"./shared\";\n\nfunction validateUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return \"Invalid URL\";\n }\n}\n\nasync function eraseAllData() {\n const res = await fetch(new URL(\"/v1/\", getCloudUrl()), {\n method: \"DELETE\",\n headers: new Headers({\n Authorization: await getCloudAuth()\n })\n });\n\n if (!res.ok) {\n cloudLogger.error(`Failed to erase data, API returned ${res.status}`);\n showNotification({\n title: \"Cloud Integrations\",\n body: `Could not erase all data (API returned ${res.status}), please contact support.`,\n color: \"var(--red-360)\"\n });\n return;\n }\n\n Settings.cloud.authenticated = false;\n await deauthorizeCloud();\n\n showNotification({\n title: \"Cloud Integrations\",\n body: \"Successfully erased all data.\",\n color: \"var(--green-360)\"\n });\n}\n\nfunction SettingsSyncSection() {\n const { cloud } = useSettings([\"cloud.authenticated\", \"cloud.settingsSync\"]);\n const sectionEnabled = cloud.authenticated && cloud.settingsSync;\n\n return (\n \n \n Synchronize your settings to the cloud. This allows easy synchronization across multiple devices with\n minimal effort.\n \n { cloud.settingsSync = v; }}\n >\n Settings Sync\n \n
\n putCloudSettings(true)}\n >Sync to Cloud\n \n {({ onMouseLeave, onMouseEnter }) => (\n getCloudSettings(true, true)}\n >Sync from Cloud\n )}\n \n deleteCloudSettings()}\n >Delete Cloud Settings\n
\n
\n );\n}\n\nfunction CloudTab() {\n const settings = useSettings([\"cloud.authenticated\", \"cloud.url\"]);\n\n return (\n \n \n \n Vencord comes with a cloud integration that adds goodies like settings sync across devices.\n It respects your privacy, and\n the source code is AGPL 3.0 licensed so you\n can host it yourself.\n \n { v && authorizeCloud(); if (!v) settings.cloud.authenticated = v; }}\n note=\"This will request authorization if you have not yet set up cloud integrations.\"\n >\n Enable Cloud Integrations\n \n Backend URL\n \n Which backend to use when using cloud integrations.\n \n { settings.cloud.url = v; settings.cloud.authenticated = false; deauthorizeCloud(); }}\n validate={validateUrl}\n />\n Alerts.show({\n title: \"Are you sure?\",\n body: \"Once your data is erased, we cannot recover it. There's no going back!\",\n onConfirm: eraseAllData,\n confirmText: \"Erase it!\",\n confirmColor: \"vc-cloud-erase-data-danger-btn\",\n cancelText: \"Nevermind\"\n })}\n >Erase All Data\n \n \n \n \n );\n}\n\nexport default wrapTab(CloudTab, \"Cloud\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Flex } from \"@components/Flex\";\nimport { Margins } from \"@utils/margins\";\nimport { classes } from \"@utils/misc\";\nimport { downloadSettingsBackup, uploadSettingsBackup } from \"@utils/settingsSync\";\nimport { Button, Card, Text } from \"@webpack/common\";\n\nimport { SettingsTab, wrapTab } from \"./shared\";\n\nfunction BackupRestoreTab() {\n return (\n \n \n \n Warning\n Importing a settings file will overwrite your current settings.\n \n \n \n You can import and export your Vencord settings as a JSON file.\n This allows you to easily transfer your settings to another device,\n or recover your settings after reinstalling Vencord or Discord.\n \n \n Settings Export contains:\n
    \n
  • — Custom QuickCSS
  • \n
  • — Theme Links
  • \n
  • — Plugin Settings
  • \n
\n
\n \n uploadSettingsBackup()}\n size={Button.Sizes.SMALL}\n >\n Import Settings\n \n \n Export Settings\n \n \n
\n );\n}\n\nexport default wrapTab(BackupRestoreTab, \"Backup & Restore\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and Megumin\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch } from \"@api/ContextMenu\";\nimport { Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { React, SettingsRouter } from \"@webpack/common\";\n\nimport gitHash from \"~git-hash\";\n\nexport default definePlugin({\n name: \"Settings\",\n description: \"Adds Settings UI and debug info\",\n authors: [Devs.Ven, Devs.Megu],\n required: true,\n\n start() {\n // The settings shortcuts in the user settings cog context menu\n // read the elements from a hardcoded map which for obvious reason\n // doesn't contain our sections. This patches the actions of our\n // sections to manually use SettingsRouter (which only works on desktop\n // but the context menu is usually not available on mobile anyway)\n addContextMenuPatch(\"user-settings-cog\", children => () => {\n const section = children.find(c => Array.isArray(c) && c.some(it => it?.props?.id === \"VencordSettings\")) as any;\n section?.forEach(c => {\n const id = c?.props?.id;\n if (id?.startsWith(\"Vencord\") || id?.startsWith(\"Vesktop\")) {\n c.props.action = () => SettingsRouter.open(id);\n }\n });\n });\n },\n\n patches: [{\n find: \".versionHash\",\n replacement: [\n {\n match: /\\[\\(0,.{1,3}\\.jsxs?\\)\\((.{1,10}),(\\{[^{}}]+\\{.{0,20}.versionHash,.+?\\})\\),\" \"/,\n replace: (m, component, props) => {\n props = props.replace(/children:\\[.+\\]/, \"\");\n return `${m},Vencord.Plugins.plugins.Settings.makeInfoElements(${component}, ${props})`;\n }\n }\n ]\n }, {\n find: \"Messages.ACTIVITY_SETTINGS\",\n replacement: {\n get match() {\n switch (Settings.plugins.Settings.settingsLocation) {\n case \"top\": return /\\{section:(\\i\\.\\i)\\.HEADER,\\s*label:(\\i)\\.\\i\\.Messages\\.USER_SETTINGS\\}/;\n case \"aboveNitro\": return /\\{section:(\\i\\.\\i)\\.HEADER,\\s*label:(\\i)\\.\\i\\.Messages\\.BILLING_SETTINGS\\}/;\n case \"belowNitro\": return /\\{section:(\\i\\.\\i)\\.HEADER,\\s*label:(\\i)\\.\\i\\.Messages\\.APP_SETTINGS\\}/;\n case \"belowActivity\": return /(?<=\\{section:(\\i\\.\\i)\\.DIVIDER},)\\{section:\"changelog\"/;\n case \"bottom\": return /\\{section:(\\i\\.\\i)\\.CUSTOM,\\s*element:.+?}/;\n case \"aboveActivity\":\n default:\n return /\\{section:(\\i\\.\\i)\\.HEADER,\\s*label:(\\i)\\.\\i\\.Messages\\.ACTIVITY_SETTINGS\\}/;\n }\n },\n replace: \"...$self.makeSettingsCategories($1),$&\"\n }\n }],\n\n customSections: [] as ((SectionTypes: Record) => any)[],\n\n makeSettingsCategories(SectionTypes: Record) {\n return [\n {\n section: SectionTypes.HEADER,\n label: \"Vencord\",\n className: \"vc-settings-header\"\n },\n {\n section: \"VencordSettings\",\n label: \"Vencord\",\n element: require(\"@components/VencordSettings/VencordTab\").default,\n className: \"vc-settings\"\n },\n {\n section: \"VencordPlugins\",\n label: \"Plugins\",\n element: require(\"@components/VencordSettings/PluginsTab\").default,\n className: \"vc-plugins\"\n },\n {\n section: \"VencordThemes\",\n label: \"Themes\",\n element: require(\"@components/VencordSettings/ThemesTab\").default,\n className: \"vc-themes\"\n },\n !IS_UPDATER_DISABLED && {\n section: \"VencordUpdater\",\n label: \"Updater\",\n element: require(\"@components/VencordSettings/UpdaterTab\").default,\n className: \"vc-updater\"\n },\n {\n section: \"VencordCloud\",\n label: \"Cloud\",\n element: require(\"@components/VencordSettings/CloudTab\").default,\n className: \"vc-cloud\"\n },\n {\n section: \"VencordSettingsSync\",\n label: \"Backup & Restore\",\n element: require(\"@components/VencordSettings/BackupAndRestoreTab\").default,\n className: \"vc-backup-restore\"\n },\n IS_DEV && {\n section: \"VencordPatchHelper\",\n label: \"Patch Helper\",\n element: require(\"@components/VencordSettings/PatchHelperTab\").default,\n className: \"vc-patch-helper\"\n },\n ...this.customSections.map(func => func(SectionTypes)),\n {\n section: SectionTypes.DIVIDER\n }\n ].filter(Boolean);\n },\n\n options: {\n settingsLocation: {\n type: OptionType.SELECT,\n description: \"Where to put the Vencord settings section\",\n options: [\n { label: \"At the very top\", value: \"top\" },\n { label: \"Above the Nitro section\", value: \"aboveNitro\" },\n { label: \"Below the Nitro section\", value: \"belowNitro\" },\n { label: \"Above Activity Settings\", value: \"aboveActivity\", default: true },\n { label: \"Below Activity Settings\", value: \"belowActivity\" },\n { label: \"At the very bottom\", value: \"bottom\" },\n ],\n restartNeeded: true\n },\n },\n\n get electronVersion() {\n return VencordNative.native.getVersions().electron || window.armcord?.electron || null;\n },\n\n get chromiumVersion() {\n try {\n return VencordNative.native.getVersions().chrome\n // @ts-ignore Typescript will add userAgentData IMMEDIATELY\n || navigator.userAgentData?.brands?.find(b => b.brand === \"Chromium\" || b.brand === \"Google Chrome\")?.version\n || null;\n } catch { // inb4 some stupid browser throws unsupported error for navigator.userAgentData, it's only in chromium\n return null;\n }\n },\n\n get additionalInfo() {\n if (IS_DEV) return \" (Dev)\";\n if (IS_WEB) return \" (Web)\";\n if (IS_VESKTOP) return ` (Vesktop v${VesktopNative.app.getVersion()})`;\n if (IS_STANDALONE) return \" (Standalone)\";\n return \"\";\n },\n\n makeInfoElements(Component: React.ComponentType, props: React.PropsWithChildren) {\n const { electronVersion, chromiumVersion, additionalInfo } = this;\n\n return (\n <>\n Vencord {gitHash}{additionalInfo}\n {electronVersion && Electron {electronVersion}}\n {chromiumVersion && Chromium {chromiumVersion}}\n \n );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { DataStore } from \"@api/index\";\nimport { Devs, SUPPORT_CHANNEL_ID } from \"@utils/constants\";\nimport { isPluginDev } from \"@utils/misc\";\nimport { makeCodeblock } from \"@utils/text\";\nimport definePlugin from \"@utils/types\";\nimport { isOutdated } from \"@utils/updater\";\nimport { Alerts, Forms, UserStore } from \"@webpack/common\";\n\nimport gitHash from \"~git-hash\";\nimport plugins from \"~plugins\";\n\nimport settings from \"./settings\";\n\nconst REMEMBER_DISMISS_KEY = \"Vencord-SupportHelper-Dismiss\";\n\nconst AllowedChannelIds = [\n SUPPORT_CHANNEL_ID,\n \"1024286218801926184\", // Vencord > #bot-spam\n \"1033680203433660458\", // Vencord > #v\n];\n\nexport default definePlugin({\n name: \"SupportHelper\",\n required: true,\n description: \"Helps us provide support to you\",\n authors: [Devs.Ven],\n dependencies: [\"CommandsAPI\"],\n\n commands: [{\n name: \"vencord-debug\",\n description: \"Send Vencord Debug info\",\n predicate: ctx => AllowedChannelIds.includes(ctx.channel.id),\n async execute() {\n const { RELEASE_CHANNEL } = window.GLOBAL_ENV;\n\n const client = (() => {\n if (IS_DISCORD_DESKTOP) return `Discord Desktop v${DiscordNative.app.getVersion()}`;\n if (IS_VESKTOP) return `Vesktop v${VesktopNative.app.getVersion()}`;\n if (\"armcord\" in window) return `ArmCord v${window.armcord.version}`;\n\n // @ts-expect-error\n const name = typeof unsafeWindow !== \"undefined\" ? \"UserScript\" : \"Web\";\n return `${name} (${navigator.userAgent})`;\n })();\n\n const isApiPlugin = (plugin: string) => plugin.endsWith(\"API\") || plugins[plugin].required;\n\n const enabledPlugins = Object.keys(plugins).filter(p => Vencord.Plugins.isPluginEnabled(p) && !isApiPlugin(p));\n const enabledApiPlugins = Object.keys(plugins).filter(p => Vencord.Plugins.isPluginEnabled(p) && isApiPlugin(p));\n\n const info = {\n Vencord: `v${VERSION} \u2022 ${gitHash}${settings.additionalInfo} - ${Intl.DateTimeFormat(\"en-GB\", { dateStyle: \"medium\" }).format(BUILD_TIMESTAMP)}`,\n \"Discord Branch\": RELEASE_CHANNEL,\n Client: client,\n Platform: window.navigator.platform,\n Outdated: isOutdated,\n OpenAsar: \"openasar\" in window,\n };\n\n if (IS_DISCORD_DESKTOP) {\n info[\"Last Crash Reason\"] = (await DiscordNative.processUtils.getLastCrash())?.rendererCrashReason ?? \"N/A\";\n }\n\n const debugInfo = `\n**Vencord Debug Info**\n>>> ${Object.entries(info).map(([k, v]) => `${k}: ${v}`).join(\"\\n\")}\n\nEnabled Plugins (${enabledPlugins.length + enabledApiPlugins.length}):\n${makeCodeblock(enabledPlugins.join(\", \") + \"\\n\\n\" + enabledApiPlugins.join(\", \"))}\n`;\n\n return {\n content: debugInfo.trim().replaceAll(\"```\\n\", \"```\")\n };\n }\n }],\n\n flux: {\n async CHANNEL_SELECT({ channelId }) {\n if (channelId !== SUPPORT_CHANNEL_ID) return;\n\n if (isPluginDev(UserStore.getCurrentUser().id)) return;\n\n if (isOutdated && gitHash !== await DataStore.get(REMEMBER_DISMISS_KEY)) {\n const rememberDismiss = () => DataStore.set(REMEMBER_DISMISS_KEY, gitHash);\n\n Alerts.show({\n title: \"Hold on!\",\n body:
\n You are using an outdated version of Vencord! Chances are, your issue is already fixed.\n \n Please first update using the Updater Page in Settings, or use the VencordInstaller (Update Vencord Button)\n to do so, in case you can't access the Updater page.\n \n
,\n onCancel: rememberDismiss,\n onConfirm: rememberDismiss\n });\n }\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"AlwaysAnimate\",\n description: \"Animates anything that can be animated\",\n authors: [Devs.FieryFlames],\n\n patches: [\n {\n find: \"canAnimate:\",\n all: true,\n // Some modules match the find but the replacement is returned untouched\n noWarn: true,\n replacement: {\n match: /canAnimate:.+?(?=([,}].*?\\)))/g,\n replace: (m, rest) => {\n const destructuringMatch = rest.match(/}=.+/);\n if (destructuringMatch == null) return \"canAnimate:!0\";\n return m;\n }\n }\n },\n {\n // Status emojis\n find: \".Messages.GUILD_OWNER,\",\n replacement: {\n match: /(?<=\\.activityEmoji,.+?animate:)\\i/,\n replace: \"!0\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"AlwaysTrust\",\n description: \"Removes the annoying untrusted domain and suspicious file popup\",\n authors: [Devs.zt],\n patches: [\n {\n find: \".displayName=\\\"MaskedLinkStore\\\"\",\n replacement: {\n match: /(?<=isTrustedDomain\\(\\i\\){)return \\i\\(\\i\\)/,\n replace: \"return true\"\n }\n },\n {\n find: \"isSuspiciousDownload:\",\n replacement: {\n match: /function \\i\\(\\i\\){(?=.{0,60}\\.parse\\(\\i\\))/,\n replace: \"$&return null;\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nconst enum Methods {\n Random,\n Consistent,\n Timestamp,\n}\n\nconst tarExtMatcher = /\\.tar\\.\\w+$/;\n\nexport default definePlugin({\n name: \"AnonymiseFileNames\",\n authors: [Devs.obscurity],\n description: \"Anonymise uploaded file names\",\n patches: [\n {\n find: \"instantBatchUpload:function\",\n replacement: {\n match: /uploadFiles:(.{1,2}),/,\n replace:\n \"uploadFiles:(...args)=>(args[0].uploads.forEach(f=>f.filename=$self.anonymise(f.filename)),$1(...args)),\",\n },\n },\n ],\n\n options: {\n method: {\n description: \"Anonymising method\",\n type: OptionType.SELECT,\n options: [\n { label: \"Random Characters\", value: Methods.Random, default: true },\n { label: \"Consistent\", value: Methods.Consistent },\n { label: \"Timestamp (4chan-like)\", value: Methods.Timestamp },\n ],\n },\n randomisedLength: {\n description: \"Random characters length\",\n type: OptionType.NUMBER,\n default: 7,\n disabled: () => Settings.plugins.AnonymiseFileNames.method !== Methods.Random,\n },\n consistent: {\n description: \"Consistent filename\",\n type: OptionType.STRING,\n default: \"image\",\n disabled: () => Settings.plugins.AnonymiseFileNames.method !== Methods.Consistent,\n },\n },\n\n anonymise(file: string) {\n let name = \"image\";\n const tarMatch = tarExtMatcher.exec(file);\n const extIdx = tarMatch?.index ?? file.lastIndexOf(\".\");\n const ext = extIdx !== -1 ? file.slice(extIdx) : \"\";\n\n switch (Settings.plugins.AnonymiseFileNames.method) {\n case Methods.Random:\n const chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n name = Array.from(\n { length: Settings.plugins.AnonymiseFileNames.randomisedLength },\n () => chars[Math.floor(Math.random() * chars.length)]\n ).join(\"\");\n break;\n case Methods.Consistent:\n name = Settings.plugins.AnonymiseFileNames.consistent;\n break;\n case Methods.Timestamp:\n // UNIX timestamp in nanos, i could not find a better dependency-less way\n name = `${Math.floor(Date.now() / 1000)}${Math.floor(window.performance.now())}`;\n break;\n }\n return name + ext;\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 OpenAsar\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { popNotice, showNotice } from \"@api/Notices\";\nimport { Link } from \"@components/Link\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ApplicationAssetUtils, FluxDispatcher, Forms, Toasts } from \"@webpack/common\";\n\nconst RpcUtils = findByPropsLazy(\"fetchApplicationsRPC\", \"getRemoteIconURL\");\n\nasync function lookupAsset(applicationId: string, key: string): Promise {\n return (await ApplicationAssetUtils.fetchAssetIds(applicationId, [key]))[0];\n}\n\nconst apps: any = {};\nasync function lookupApp(applicationId: string): Promise {\n const socket: any = {};\n await RpcUtils.fetchApplicationsRPC(socket, applicationId);\n return socket.application;\n}\n\nlet ws: WebSocket;\nexport default definePlugin({\n name: \"WebRichPresence (arRPC)\",\n description: \"Client plugin for arRPC to enable RPC on Discord Web (experimental)\",\n authors: [Devs.Ducko],\n\n settingsAboutComponent: () => (\n <>\n How to use arRPC\n \n Follow the instructions in the GitHub repo to get the server running, and then enable the plugin.\n \n \n ),\n\n async handleEvent(e: MessageEvent) {\n const data = JSON.parse(e.data);\n\n const { activity } = data;\n const assets = activity?.assets;\n\n if (assets?.large_image) assets.large_image = await lookupAsset(activity.application_id, assets.large_image);\n if (assets?.small_image) assets.small_image = await lookupAsset(activity.application_id, assets.small_image);\n\n if (activity) {\n const appId = activity.application_id;\n apps[appId] ||= await lookupApp(appId);\n\n const app = apps[appId];\n activity.name ||= app.name;\n }\n\n FluxDispatcher.dispatch({ type: \"LOCAL_ACTIVITY_UPDATE\", ...data });\n },\n\n async start() {\n // ArmCord comes with its own arRPC implementation, so this plugin just confuses users\n if (\"armcord\" in window) return;\n\n if (ws) ws.close();\n ws = new WebSocket(\"ws://127.0.0.1:1337\"); // try to open WebSocket\n\n ws.onmessage = this.handleEvent;\n\n const connectionSuccessful = await new Promise(res => setTimeout(() => res(ws.readyState === WebSocket.OPEN), 1000)); // check if open after 1s\n if (!connectionSuccessful) {\n showNotice(\"Failed to connect to arRPC, is it running?\", \"Retry\", () => { // show notice about failure to connect, with retry/ignore\n popNotice();\n this.start();\n });\n return;\n }\n\n Toasts.show({ // show toast on success\n message: \"Connected to arRPC\",\n type: Toasts.Type.SUCCESS,\n id: Toasts.genId(),\n options: {\n duration: 1000,\n position: Toasts.Position.BOTTOM\n }\n });\n },\n\n stop() {\n FluxDispatcher.dispatch({ type: \"LOCAL_ACTIVITY_UPDATE\", activity: null }); // clear status\n ws?.close(); // close WebSocket\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nexport default definePlugin({\n name: \"BANger\",\n description: \"Replaces the GIF in the ban dialogue with a custom one.\",\n authors: [Devs.Xinto, Devs.Glitch],\n patches: [\n {\n find: \"BAN_CONFIRM_TITLE.\",\n replacement: {\n match: /src:\\i\\(\"\\d+\"\\)/g,\n replace: \"src: Vencord.Settings.plugins.BANger.source\"\n }\n }\n ],\n options: {\n source: {\n description: \"Source to replace ban GIF with (Video or Gif)\",\n type: OptionType.STRING,\n default: \"https://i.imgur.com/wp5q52C.mp4\",\n restartNeeded: true,\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { LazyComponent } from \"@utils/react\";\nimport { find, findByPropsLazy, findStoreLazy } from \"@webpack\";\nimport { useStateFromStores } from \"@webpack/common\";\nimport type { CSSProperties } from \"react\";\n\nimport { ExpandedGuildFolderStore, settings } from \".\";\n\nconst ChannelRTCStore = findStoreLazy(\"ChannelRTCStore\");\nconst Animations = findByPropsLazy(\"a\", \"animated\", \"useTransition\");\nconst GuildsBar = LazyComponent(() => find(m => m.type?.toString().includes('(\"guildsnav\")')));\n\nexport default ErrorBoundary.wrap(guildsBarProps => {\n const expandedFolders = useStateFromStores([ExpandedGuildFolderStore], () => ExpandedGuildFolderStore.getExpandedFolders());\n const isFullscreen = useStateFromStores([ChannelRTCStore], () => ChannelRTCStore.isFullscreenInContext());\n\n const Sidebar = (\n \n );\n\n const visible = !!expandedFolders.size;\n const guilds = document.querySelector(guildsBarProps.className.split(\" \").map(c => `.${c}`).join(\"\"));\n\n // We need to display none if we are in fullscreen. Yes this seems horrible doing with css, but it's literally how Discord does it.\n // Also display flex otherwise to fix scrolling\n const barStyle = {\n display: isFullscreen ? \"none\" : \"flex\",\n } as CSSProperties;\n\n if (!guilds || !settings.store.sidebarAnim) {\n return visible\n ?
{Sidebar}
\n : null;\n }\n\n return (\n \n {(animationStyle, show) =>\n show && (\n \n {Sidebar}\n \n )\n }\n \n );\n}, { noop: true });\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport { proxyLazy } from \"@utils/lazy\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByProps, findByPropsLazy, findStoreLazy } from \"@webpack\";\nimport { FluxDispatcher, i18n } from \"@webpack/common\";\n\nimport FolderSideBar from \"./FolderSideBar\";\n\nenum FolderIconDisplay {\n Never,\n Always,\n MoreThanOneFolderExpanded\n}\n\nconst GuildsTree = proxyLazy(() => findByProps(\"GuildsTree\").GuildsTree);\nconst SortedGuildStore = findStoreLazy(\"SortedGuildStore\");\nexport const ExpandedGuildFolderStore = findStoreLazy(\"ExpandedGuildFolderStore\");\nconst FolderUtils = findByPropsLazy(\"move\", \"toggleGuildFolderExpand\");\n\nlet lastGuildId = null as string | null;\nlet dispatchingFoldersClose = false;\n\nfunction getGuildFolder(id: string) {\n return SortedGuildStore.getGuildFolders().find(folder => folder.guildIds.includes(id));\n}\n\nfunction closeFolders() {\n for (const id of ExpandedGuildFolderStore.getExpandedFolders())\n FolderUtils.toggleGuildFolderExpand(id);\n}\n\nexport const settings = definePluginSettings({\n sidebar: {\n type: OptionType.BOOLEAN,\n description: \"Display servers from folder on dedicated sidebar\",\n restartNeeded: true,\n default: true\n },\n sidebarAnim: {\n type: OptionType.BOOLEAN,\n description: \"Animate opening the folder sidebar\",\n default: true\n },\n closeAllFolders: {\n type: OptionType.BOOLEAN,\n description: \"Close all folders when selecting a server not in a folder\",\n default: false\n },\n closeAllHomeButton: {\n type: OptionType.BOOLEAN,\n description: \"Close all folders when clicking on the home button\",\n restartNeeded: true,\n default: false\n },\n closeOthers: {\n type: OptionType.BOOLEAN,\n description: \"Close other folders when opening a folder\",\n default: false\n },\n forceOpen: {\n type: OptionType.BOOLEAN,\n description: \"Force a folder to open when switching to a server of that folder\",\n default: false\n },\n keepIcons: {\n type: OptionType.BOOLEAN,\n description: \"Keep showing guild icons in the primary guild bar folder when it's open in the BetterFolders sidebar\",\n restartNeeded: true,\n default: false\n },\n showFolderIcon: {\n type: OptionType.SELECT,\n description: \"Show the folder icon above the folder guilds in the BetterFolders sidebar\",\n options: [\n { label: \"Never\", value: FolderIconDisplay.Never },\n { label: \"Always\", value: FolderIconDisplay.Always, default: true },\n { label: \"When more than one folder is expanded\", value: FolderIconDisplay.MoreThanOneFolderExpanded }\n ],\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"BetterFolders\",\n description: \"Shows server folders on dedicated sidebar and adds folder related improvements\",\n authors: [Devs.juby, Devs.AutumnVN, Devs.Nuckyz],\n\n settings,\n\n patches: [\n {\n find: '(\"guildsnav\")',\n predicate: () => settings.store.sidebar,\n replacement: [\n // Create the isBetterFolders variable in the GuildsBar component\n {\n match: /(?<=let{disableAppDownload:\\i=\\i\\.isPlatformEmbedded,isOverlay:.+?)(?=}=\\i,)/,\n replace: \",isBetterFolders\"\n },\n // If we are rendering the Better Folders sidebar, we filter out guilds that are not in folders and unexpanded folders\n {\n match: /(useStateFromStoresArray\\).{0,25}let \\i)=(\\i\\.\\i.getGuildsTree\\(\\))/,\n replace: (_, rest, guildsTree) => `${rest}=$self.getGuildTree(!!arguments[0].isBetterFolders,${guildsTree},arguments[0].betterFoldersExpandedIds)`\n },\n // If we are rendering the Better Folders sidebar, we filter out everything but the servers and folders from the GuildsBar Guild List children\n {\n match: /lastTargetNode:\\i\\[\\i\\.length-1\\].+?Fragment.+?\\]}\\)\\]/,\n replace: \"$&.filter($self.makeGuildsBarGuildListFilter(!!arguments[0].isBetterFolders))\"\n },\n // If we are rendering the Better Folders sidebar, we filter out everything but the scroller for the guild list from the GuildsBar Tree children\n {\n match: /unreadMentionsIndicatorBottom,barClassName.+?}\\)\\]/,\n replace: \"$&.filter($self.makeGuildsBarTreeFilter(!!arguments[0].isBetterFolders))\"\n },\n // Export the isBetterFolders variable to the folders component\n {\n match: /(?<=\\.Messages\\.SERVERS.+?switch\\((\\i)\\.type\\){case \\i\\.\\i\\.FOLDER:.+?folderNode:\\i,)/,\n replace: 'isBetterFolders:typeof isBetterFolders!==\"undefined\"?isBetterFolders:false,'\n }\n ]\n },\n {\n // This is the parent folder component\n find: \".MAX_GUILD_FOLDER_NAME_LENGTH,\",\n predicate: () => settings.store.sidebar && settings.store.showFolderIcon !== FolderIconDisplay.Always,\n replacement: [\n {\n // Modify the expanded state to instead return the list of expanded folders\n match: /(useStateFromStores\\).{0,20}=>)(\\i\\.\\i)\\.isFolderExpanded\\(\\i\\)/,\n replace: (_, rest, ExpandedGuildFolderStore) => `${rest}${ExpandedGuildFolderStore}.getExpandedFolders()`,\n },\n {\n // Modify the expanded prop to use the boolean if the above patch fails, or check if the folder is expanded from the list if it succeeds\n // Also export the list of expanded folders to the child folder component if the patch above succeeds, else export undefined\n match: /(?<=folderNode:(\\i),expanded:)\\i(?=,)/,\n replace: (isExpandedOrExpandedIds, folderNote) => \"\"\n + `typeof ${isExpandedOrExpandedIds}===\"boolean\"?${isExpandedOrExpandedIds}:${isExpandedOrExpandedIds}.has(${folderNote}.id),`\n + `betterFoldersExpandedIds:${isExpandedOrExpandedIds} instanceof Set?${isExpandedOrExpandedIds}:void 0`\n }\n ]\n },\n {\n find: \".FOLDER_ITEM_GUILD_ICON_MARGIN);\",\n predicate: () => settings.store.sidebar,\n replacement: [\n // We use arguments[0] to access the isBetterFolders variable in this nested folder component (the parent exports all the props so we don't have to patch it)\n\n // If we are rendering the normal GuildsBar sidebar, we make Discord think the folder is always collapsed to show better icons (the mini guild icons) and avoid transitions\n {\n predicate: () => settings.store.keepIcons,\n match: /(?<=let{folderNode:\\i,setNodeRef:\\i,.+?expanded:(\\i),.+?;)(?=let)/,\n replace: (_, isExpanded) => `${isExpanded}=!!arguments[0].isBetterFolders&&${isExpanded};`\n },\n // Disable expanding and collapsing folders transition in the normal GuildsBar sidebar\n {\n predicate: () => !settings.store.keepIcons,\n match: /(?<=\\.Messages\\.SERVER_FOLDER_PLACEHOLDER.+?useTransition\\)\\()/,\n replace: \"!!arguments[0].isBetterFolders&&\"\n },\n // If we are rendering the normal GuildsBar sidebar, we avoid rendering guilds from folders that are expanded\n {\n predicate: () => !settings.store.keepIcons,\n match: /expandedFolderBackground,.+?,(?=\\i\\(\\(\\i,\\i,\\i\\)=>{let{key.{0,45}ul)(?<=selected:\\i,expanded:(\\i),.+?)/,\n replace: (m, isExpanded) => `${m}!arguments[0].isBetterFolders&&${isExpanded}?null:`\n },\n {\n // Decide if we should render the expanded folder background if we are rendering the Better Folders sidebar\n predicate: () => settings.store.showFolderIcon !== FolderIconDisplay.Always,\n match: /(?<=\\.wrapper,children:\\[)/,\n replace: \"$self.shouldShowFolderIconAndBackground(!!arguments[0].isBetterFolders,arguments[0].betterFoldersExpandedIds)&&\"\n },\n {\n // Decide if we should render the expanded folder icon if we are rendering the Better Folders sidebar\n predicate: () => settings.store.showFolderIcon !== FolderIconDisplay.Always,\n match: /(?<=\\.expandedFolderBackground.+?}\\),)(?=\\i,)/,\n replace: \"!$self.shouldShowFolderIconAndBackground(!!arguments[0].isBetterFolders,arguments[0].betterFoldersExpandedIds)?null:\"\n }\n ]\n },\n {\n find: \"APPLICATION_LIBRARY,render\",\n predicate: () => settings.store.sidebar,\n replacement: {\n // Render the Better Folders sidebar\n match: /(?<=({className:\\i\\.guilds,themeOverride:\\i})\\))/,\n replace: \",$self.FolderSideBar($1)\"\n }\n },\n {\n find: \".Messages.DISCODO_DISABLED\",\n predicate: () => settings.store.closeAllHomeButton,\n replacement: {\n // Close all folders when clicking the home button\n match: /(?<=onClick:\\(\\)=>{)(?=.{0,200}\"discodo\")/,\n replace: \"$self.closeFolders();\"\n }\n }\n ],\n\n flux: {\n CHANNEL_SELECT(data) {\n if (!settings.store.closeAllFolders && !settings.store.forceOpen)\n return;\n\n if (lastGuildId !== data.guildId) {\n lastGuildId = data.guildId;\n const guildFolder = getGuildFolder(data.guildId);\n\n if (guildFolder?.folderId) {\n if (settings.store.forceOpen && !ExpandedGuildFolderStore.isFolderExpanded(guildFolder.folderId)) {\n FolderUtils.toggleGuildFolderExpand(guildFolder.folderId);\n }\n } else if (settings.store.closeAllFolders) {\n closeFolders();\n }\n }\n },\n\n TOGGLE_GUILD_FOLDER_EXPAND(data) {\n if (settings.store.closeOthers && !dispatchingFoldersClose) {\n dispatchingFoldersClose = true;\n\n FluxDispatcher.wait(() => {\n const expandedFolders = ExpandedGuildFolderStore.getExpandedFolders();\n\n if (expandedFolders.size > 1) {\n for (const id of expandedFolders) if (id !== data.folderId)\n FolderUtils.toggleGuildFolderExpand(id);\n }\n\n dispatchingFoldersClose = false;\n });\n }\n }\n },\n\n getGuildTree(isBetterFolders: boolean, oldTree: any, expandedFolderIds?: Set) {\n if (!isBetterFolders || expandedFolderIds == null) return oldTree;\n\n const newTree = new GuildsTree();\n // Children is every folder and guild which is not in a folder, this filters out only the expanded folders\n newTree.root.children = oldTree.root.children.filter(guildOrFolder => expandedFolderIds.has(guildOrFolder.id));\n // Nodes is every folder and guild, even if it's in a folder, this filters out only the expanded folders and guilds inside them\n newTree.nodes = Object.fromEntries(\n Object.entries(oldTree.nodes)\n .filter(([_, guildOrFolder]: any[]) => expandedFolderIds.has(guildOrFolder.id) || expandedFolderIds.has(guildOrFolder.parentId))\n );\n\n return newTree;\n },\n\n makeGuildsBarGuildListFilter(isBetterFolders: boolean) {\n return child => {\n if (isBetterFolders) {\n return child?.props?.[\"aria-label\"] === i18n.Messages.SERVERS;\n }\n return true;\n };\n },\n\n makeGuildsBarTreeFilter(isBetterFolders: boolean) {\n return child => {\n if (isBetterFolders) {\n return \"onScroll\" in child.props;\n }\n return true;\n };\n },\n\n shouldShowFolderIconAndBackground(isBetterFolders: boolean, expandedFolderIds?: Set) {\n if (!isBetterFolders) return true;\n\n switch (settings.store.showFolderIcon) {\n case FolderIconDisplay.Never:\n return false;\n case FolderIconDisplay.Always:\n return true;\n case FolderIconDisplay.MoreThanOneFolderExpanded:\n return (expandedFolderIds?.size ?? 0) > 1;\n default:\n return true;\n }\n },\n\n FolderSideBar: guildsBarProps => ,\n\n closeFolders\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"BetterGifAltText\",\n authors: [Devs.Ven],\n description:\n \"Change GIF alt text from simply being 'GIF' to containing the gif tags / filename\",\n patches: [\n {\n find: \"onCloseImage=\",\n replacement: {\n match: /(return.{0,10}\\.jsx.{0,50}isWindowFocused)/,\n replace:\n \"$self.altify(e);$1\",\n },\n },\n {\n find: \".Messages.GIF,\",\n replacement: {\n match: /alt:(\\i)=(\\i\\.default\\.Messages\\.GIF)(?=,[^}]*\\}=(\\i))/,\n replace:\n // rename prop so we can always use default value\n \"alt_$$:$1=$self.altify($3)||$2\",\n },\n },\n ],\n\n altify(props: any) {\n props.alt ??= \"GIF\";\n if (props.alt !== \"GIF\") return props.alt;\n\n let url: string = props.original || props.src;\n try {\n url = decodeURI(url);\n } catch { }\n\n let name = url\n .slice(url.lastIndexOf(\"/\") + 1)\n .replace(/\\d/g, \"\") // strip numbers\n .replace(/.gif$/, \"\") // strip extension\n .split(/[,\\-_ ]+/g)\n .slice(0, 20)\n .join(\" \");\n if (name.length > 300) {\n name = name.slice(0, 300) + \"...\";\n }\n\n if (name) props.alt += ` - ${name}`;\n\n return props.alt;\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\n\nconst UserPopoutSectionCssClasses = findByPropsLazy(\"section\", \"lastSection\");\n\nexport default definePlugin({\n name: \"BetterNotesBox\",\n description: \"Hide notes or disable spellcheck (Configure in settings!!)\",\n authors: [Devs.Ven],\n\n patches: [\n {\n find: \"hideNote:\",\n all: true,\n // Some modules match the find but the replacement is returned untouched\n noWarn: true,\n predicate: () => Vencord.Settings.plugins.BetterNotesBox.hide,\n replacement: {\n match: /hideNote:.+?(?=([,}].*?\\)))/g,\n replace: (m, rest) => {\n const destructuringMatch = rest.match(/}=.+/);\n if (destructuringMatch == null) return \"hideNote:!0\";\n return m;\n }\n }\n },\n {\n find: \"Messages.NOTE_PLACEHOLDER\",\n replacement: {\n match: /\\.NOTE_PLACEHOLDER,/,\n replace: \"$&spellCheck:!Vencord.Settings.plugins.BetterNotesBox.noSpellCheck,\"\n }\n },\n {\n find: \".Messages.NOTE}\",\n replacement: {\n match: /(?<=return \\i\\?)null(?=:\\(0,\\i\\.jsxs)/,\n replace: \"$self.patchPadding(arguments[0])\"\n }\n }\n ],\n\n options: {\n hide: {\n type: OptionType.BOOLEAN,\n description: \"Hide notes\",\n default: false,\n restartNeeded: true\n },\n noSpellCheck: {\n type: OptionType.BOOLEAN,\n description: \"Disable spellcheck in notes\",\n disabled: () => Settings.plugins.BetterNotesBox.hide,\n default: false\n }\n },\n\n patchPadding(e: any) {\n if (!e.lastSection) return;\n return (\n
\n );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Clipboard, Toasts } from \"@webpack/common\";\n\nexport default definePlugin({\n name: \"BetterRoleDot\",\n authors: [Devs.Ven, Devs.AutumnVN],\n description:\n \"Copy role colour on RoleDot (accessibility setting) click. Also allows using both RoleDot and coloured names simultaneously\",\n\n patches: [\n {\n find: \".dotBorderBase\",\n replacement: {\n match: /,viewBox:\"0 0 20 20\"/,\n replace: \"$&,onClick:()=>$self.copyToClipBoard(arguments[0].color),style:{cursor:'pointer'}\",\n },\n },\n {\n find: '\"dot\"===',\n all: true,\n noWarn: true,\n predicate: () => Settings.plugins.BetterRoleDot.bothStyles,\n replacement: {\n match: /\"(?:username|dot)\"===\\i(?!\\.\\i)/g,\n replace: \"true\",\n },\n },\n\n {\n find: \".ADD_ROLE_A11Y_LABEL\",\n predicate: () => Settings.plugins.BetterRoleDot.copyRoleColorInProfilePopout && !Settings.plugins.BetterRoleDot.bothStyles,\n noWarn: true,\n replacement: {\n match: /\"dot\"===\\i/,\n replace: \"true\"\n }\n },\n {\n find: \".roleVerifiedIcon\",\n predicate: () => Settings.plugins.BetterRoleDot.copyRoleColorInProfilePopout && !Settings.plugins.BetterRoleDot.bothStyles,\n noWarn: true,\n replacement: {\n match: /\"dot\"===\\i/,\n replace: \"true\"\n }\n }\n ],\n\n options: {\n bothStyles: {\n type: OptionType.BOOLEAN,\n description: \"Show both role dot and coloured names\",\n restartNeeded: true,\n default: false,\n },\n copyRoleColorInProfilePopout: {\n type: OptionType.BOOLEAN,\n description: \"Allow click on role dot in profile popout to copy role color\",\n restartNeeded: true,\n default: false\n }\n },\n\n copyToClipBoard(color: string) {\n Clipboard.copy(color);\n Toasts.show({\n message: \"Copied to Clipboard!\",\n type: Toasts.Type.SUCCESS,\n id: Toasts.genId(),\n options: {\n duration: 1000,\n position: Toasts.Position.BOTTOM\n }\n });\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"BetterUploadButton\",\n authors: [Devs.obscurity, Devs.Ven],\n description: \"Upload with a single click, open menu with right click\",\n patches: [\n {\n find: \"Messages.CHAT_ATTACH_UPLOAD_OR_INVITE\",\n replacement: {\n // Discord merges multiple props here with Object.assign()\n // This patch passes a third object to it with which we override onClick and onContextMenu\n match: /CHAT_ATTACH_UPLOAD_OR_INVITE,onDoubleClick:(.+?:void 0),\\.\\.\\.(\\i),/,\n replace: \"$&onClick:$1,onContextMenu:$2.onClick,\",\n },\n },\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { findStoreLazy } from \"@webpack\";\n\nimport * as t from \"./types/stores\";\n\nexport const ApplicationStreamPreviewStore: t.ApplicationStreamPreviewStore = findStoreLazy(\"ApplicationStreamPreviewStore\");\nexport const ApplicationStreamingStore: t.ApplicationStreamingStore = findStoreLazy(\"ApplicationStreamingStore\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { ScreenshareIcon } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport { openImageModal } from \"@utils/discord\";\nimport definePlugin from \"@utils/types\";\nimport { Menu } from \"@webpack/common\";\nimport { Channel, User } from \"discord-types/general\";\n\nimport { ApplicationStreamingStore, ApplicationStreamPreviewStore } from \"./webpack/stores\";\nimport { ApplicationStream, Stream } from \"./webpack/types/stores\";\n\nexport interface UserContextProps {\n channel: Channel,\n channelSelected: boolean,\n className: string,\n config: { context: string; };\n context: string,\n onHeightUpdate: Function,\n position: string,\n target: HTMLElement,\n theme: string,\n user: User;\n}\n\nexport interface StreamContextProps {\n appContext: string,\n className: string,\n config: { context: string; };\n context: string,\n exitFullscreen: Function,\n onHeightUpdate: Function,\n position: string,\n target: HTMLElement,\n stream: Stream,\n theme: string,\n}\n\nexport const handleViewPreview = async ({ guildId, channelId, ownerId }: ApplicationStream | Stream) => {\n const previewUrl = await ApplicationStreamPreviewStore.getPreviewURL(guildId, channelId, ownerId);\n if (!previewUrl) return;\n\n openImageModal(previewUrl);\n};\n\nexport const addViewStreamContext: NavContextMenuPatchCallback = (children, { userId }: { userId: string | bigint; }) => () => {\n const stream = ApplicationStreamingStore.getAnyStreamForUser(userId);\n if (!stream) return;\n\n const streamPreviewItem = (\n stream && handleViewPreview(stream)}\n disabled={!stream}\n />\n );\n\n children.push(, streamPreviewItem);\n};\n\nexport const streamContextPatch: NavContextMenuPatchCallback = (children, { stream }: StreamContextProps) => {\n return addViewStreamContext(children, { userId: stream.ownerId });\n};\n\nexport const userContextPatch: NavContextMenuPatchCallback = (children, { user }: UserContextProps) => {\n return addViewStreamContext(children, { userId: user.id });\n};\n\nexport default definePlugin({\n name: \"BiggerStreamPreview\",\n description: \"This plugin allows you to enlarge stream previews\",\n authors: [Devs.phil],\n start: () => {\n addContextMenuPatch(\"user-context\", userContextPatch);\n addContextMenuPatch(\"stream-context\", streamContextPatch);\n },\n stop: () => {\n removeContextMenuPatch(\"user-context\", userContextPatch);\n removeContextMenuPatch(\"stream-context\", streamContextPatch);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nlet style: HTMLStyleElement;\n\nfunction setCss() {\n style.textContent = `\n .vc-nsfw-img [class^=imageWrapper] img,\n .vc-nsfw-img [class^=wrapperPaused] video {\n filter: blur(${Settings.plugins.BlurNSFW.blurAmount}px);\n transition: filter 0.2s;\n }\n .vc-nsfw-img [class^=imageWrapper]:hover img,\n .vc-nsfw-img [class^=wrapperPaused]:hover video {\n filter: unset;\n }\n `;\n}\n\nexport default definePlugin({\n name: \"BlurNSFW\",\n description: \"Blur attachments in NSFW channels until hovered\",\n authors: [Devs.Ven],\n\n patches: [\n {\n find: \".embedWrapper,embed\",\n replacement: [{\n match: /\\.embedWrapper/g,\n replace: \"$&+(this.props.channel.nsfw?' vc-nsfw-img':'')\"\n }]\n }\n ],\n\n options: {\n blurAmount: {\n type: OptionType.NUMBER,\n description: \"Blur Amount\",\n default: 10,\n onChange: setCss\n }\n },\n\n start() {\n style = document.createElement(\"style\");\n style.id = \"VcBlurNsfw\";\n document.head.appendChild(style);\n\n setCss();\n },\n\n stop() {\n style?.remove();\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { useTimer } from \"@utils/react\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { React } from \"@webpack/common\";\n\nfunction formatDuration(ms: number) {\n // here be dragons (moment fucking sucks)\n const human = Settings.plugins.CallTimer.format === \"human\";\n\n const format = (n: number) => human ? n : n.toString().padStart(2, \"0\");\n const unit = (s: string) => human ? s : \"\";\n const delim = human ? \" \" : \":\";\n\n // thx copilot\n const d = Math.floor(ms / 86400000);\n const h = Math.floor((ms % 86400000) / 3600000);\n const m = Math.floor(((ms % 86400000) % 3600000) / 60000);\n const s = Math.floor((((ms % 86400000) % 3600000) % 60000) / 1000);\n\n let res = \"\";\n if (d) res += `${d}d `;\n if (h || res) res += `${format(h)}${unit(\"h\")}${delim}`;\n if (m || res || !human) res += `${format(m)}${unit(\"m\")}${delim}`;\n res += `${format(s)}${unit(\"s\")}`;\n\n return res;\n}\n\nexport default definePlugin({\n name: \"CallTimer\",\n description: \"Adds a timer to vcs\",\n authors: [Devs.Ven],\n\n startTime: 0,\n interval: void 0 as NodeJS.Timeout | undefined,\n\n options: {\n format: {\n type: OptionType.SELECT,\n description: \"The timer format. This can be any valid moment.js format\",\n options: [\n {\n label: \"30d 23:00:42\",\n value: \"stopwatch\",\n default: true\n },\n {\n label: \"30d 23h 00m 42s\",\n value: \"human\"\n }\n ]\n }\n },\n\n patches: [{\n find: \"renderConnectionStatus(){\",\n replacement: {\n match: /(?<=renderConnectionStatus\\(\\)\\{.+\\.channel,children:)\\i/,\n replace: \"[$&, $self.renderTimer(this.props.channel.id)]\"\n }\n }],\n renderTimer(channelId: string) {\n return \n \n ;\n },\n\n Timer({ channelId }: { channelId: string; }) {\n const time = useTimer({\n deps: [channelId]\n });\n\n return

Connected for {formatDuration(time)}

;\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Logger } from \"@utils/Logger\";\nimport { MessageStore } from \"@webpack/common\";\nimport { CustomEmoji } from \"@webpack/types\";\nimport type { Channel, Message } from \"discord-types/general\";\nimport type { Promisable } from \"type-fest\";\n\nconst MessageEventsLogger = new Logger(\"MessageEvents\", \"#e5c890\");\n\nexport interface MessageObject {\n content: string,\n validNonShortcutEmojis: CustomEmoji[];\n invalidEmojis: any[];\n tts: boolean;\n}\n\nexport interface Upload {\n classification: string;\n currentSize: number;\n description: string | null;\n filename: string;\n id: string;\n isImage: boolean;\n isVideo: boolean;\n item: {\n file: File;\n platform: number;\n };\n loaded: number;\n mimeType: string;\n preCompressionSize: number;\n responseUrl: string;\n sensitive: boolean;\n showLargeMessageDialog: boolean;\n spoiler: boolean;\n status: \"NOT_STARTED\" | \"STARTED\" | \"UPLOADING\" | \"ERROR\" | \"COMPLETED\" | \"CANCELLED\";\n uniqueId: string;\n uploadedFilename: string;\n}\n\nexport interface MessageReplyOptions {\n messageReference: Message[\"messageReference\"];\n allowedMentions?: {\n parse: Array;\n repliedUser: boolean;\n };\n}\n\nexport interface MessageExtra {\n stickers?: string[];\n uploads?: Upload[];\n replyOptions: MessageReplyOptions;\n content: string;\n channel: Channel;\n type?: any;\n openWarningPopout: (props: any) => any;\n}\n\nexport type SendListener = (channelId: string, messageObj: MessageObject, extra: MessageExtra) => Promisable;\nexport type EditListener = (channelId: string, messageId: string, messageObj: MessageObject) => Promisable;\n\nconst sendListeners = new Set();\nconst editListeners = new Set();\n\nexport async function _handlePreSend(channelId: string, messageObj: MessageObject, extra: MessageExtra, replyOptions: MessageReplyOptions) {\n extra.replyOptions = replyOptions;\n for (const listener of sendListeners) {\n try {\n const result = await listener(channelId, messageObj, extra);\n if (result && result.cancel === true) {\n return true;\n }\n } catch (e) {\n MessageEventsLogger.error(\"MessageSendHandler: Listener encountered an unknown error\\n\", e);\n }\n }\n return false;\n}\n\nexport async function _handlePreEdit(channelId: string, messageId: string, messageObj: MessageObject) {\n for (const listener of editListeners) {\n try {\n await listener(channelId, messageId, messageObj);\n } catch (e) {\n MessageEventsLogger.error(\"MessageEditHandler: Listener encountered an unknown error\\n\", e);\n }\n }\n}\n\n/**\n * Note: This event fires off before a message is sent, allowing you to edit the message.\n */\nexport function addPreSendListener(listener: SendListener) {\n sendListeners.add(listener);\n return listener;\n}\n/**\n * Note: This event fires off before a message's edit is applied, allowing you to further edit the message.\n */\nexport function addPreEditListener(listener: EditListener) {\n editListeners.add(listener);\n return listener;\n}\nexport function removePreSendListener(listener: SendListener) {\n return sendListeners.delete(listener);\n}\nexport function removePreEditListener(listener: EditListener) {\n return editListeners.delete(listener);\n}\n\n\n// Message clicks\ntype ClickListener = (message: Message, channel: Channel, event: MouseEvent) => void;\n\nconst listeners = new Set();\n\nexport function _handleClick(message: Message, channel: Channel, event: MouseEvent) {\n // message object may be outdated, so (try to) fetch latest one\n message = MessageStore.getMessage(channel.id, message.id) ?? message;\n for (const listener of listeners) {\n try {\n listener(message, channel, event);\n } catch (e) {\n MessageEventsLogger.error(\"MessageClickHandler: Listener encountered an unknown error\\n\", e);\n }\n }\n}\n\nexport function addClickListener(listener: ClickListener) {\n listeners.add(listener);\n return listener;\n}\n\nexport function removeClickListener(listener: ClickListener) {\n return listeners.delete(listener);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const defaultRules = [\n \"action_object_map\",\n \"action_type_map\",\n \"action_ref_map\",\n \"spm@*.aliexpress.com\",\n \"scm@*.aliexpress.com\",\n \"aff_platform\",\n \"aff_trace_key\",\n \"algo_expid@*.aliexpress.*\",\n \"algo_pvid@*.aliexpress.*\",\n \"btsid\",\n \"ws_ab_test\",\n \"pd_rd_*@amazon.*\",\n \"_encoding@amazon.*\",\n \"psc@amazon.*\",\n \"tag@amazon.*\",\n \"ref_@amazon.*\",\n \"pf_rd_*@amazon.*\",\n \"pf@amazon.*\",\n \"crid@amazon.*\",\n \"keywords@amazon.*\",\n \"sprefix@amazon.*\",\n \"sr@amazon.*\",\n \"ie@amazon.*\",\n \"node@amazon.*\",\n \"qid@amazon.*\",\n \"callback@bilibili.com\",\n \"cvid@bing.com\",\n \"form@bing.com\",\n \"sk@bing.com\",\n \"sp@bing.com\",\n \"sc@bing.com\",\n \"qs@bing.com\",\n \"pq@bing.com\",\n \"sc_cid\",\n \"mkt_tok\",\n \"trk\",\n \"trkCampaign\",\n \"ga_*\",\n \"gclid\",\n \"gclsrc\",\n \"hmb_campaign\",\n \"hmb_medium\",\n \"hmb_source\",\n \"spReportId\",\n \"spJobID\",\n \"spUserID\",\n \"spMailingID\",\n \"itm_*\",\n \"s_cid\",\n \"elqTrackId\",\n \"elqTrack\",\n \"assetType\",\n \"assetId\",\n \"recipientId\",\n \"campaignId\",\n \"siteId\",\n \"mc_cid\",\n \"mc_eid\",\n \"pk_*\",\n \"sc_campaign\",\n \"sc_channel\",\n \"sc_content\",\n \"sc_medium\",\n \"sc_outcome\",\n \"sc_geo\",\n \"sc_country\",\n \"nr_email_referer\",\n \"vero_conv\",\n \"vero_id\",\n \"yclid\",\n \"_openstat\",\n \"mbid\",\n \"cmpid\",\n \"cid\",\n \"c_id\",\n \"campaign_id\",\n \"Campaign\",\n \"hash@ebay.*\",\n \"fb_action_ids\",\n \"fb_action_types\",\n \"fb_ref\",\n \"fb_source\",\n \"fbclid\",\n \"refsrc@facebook.com\",\n \"hrc@facebook.com\",\n \"gs_l\",\n \"gs_lcp@google.*\",\n \"ved@google.*\",\n \"ei@google.*\",\n \"sei@google.*\",\n \"gws_rd@google.*\",\n \"gs_gbg@google.*\",\n \"gs_mss@google.*\",\n \"gs_rn@google.*\",\n \"_hsenc\",\n \"_hsmi\",\n \"__hssc\",\n \"__hstc\",\n \"hsCtaTracking\",\n \"source@sourceforge.net\",\n \"position@sourceforge.net\",\n \"t@*.twitter.com\",\n \"s@*.twitter.com\",\n \"ref_*@*.twitter.com\",\n \"tt_medium\",\n \"tt_content\",\n \"lr@yandex.*\",\n \"redircnt@yandex.*\",\n \"feature@youtube.com\",\n \"kw@youtube.com\",\n \"si@youtube.com\",\n \"pp@youtube.com\",\n \"si@youtu.be\",\n \"wt_zmc\",\n \"utm_source\",\n \"utm_content\",\n \"utm_medium\",\n \"utm_campaign\",\n \"utm_term\",\n \"si@open.spotify.com\",\n \"igshid\",\n \"share_id@reddit.com\",\n];\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport {\n addPreEditListener,\n addPreSendListener,\n MessageObject,\n removePreEditListener,\n removePreSendListener\n} from \"@api/MessageEvents\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nimport { defaultRules } from \"./defaultRules\";\n\n// From lodash\nconst reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\nconst reHasRegExpChar = RegExp(reRegExpChar.source);\n\nexport default definePlugin({\n name: \"ClearURLs\",\n description: \"Removes tracking garbage from URLs\",\n authors: [Devs.adryd],\n dependencies: [\"MessageEventsAPI\"],\n\n escapeRegExp(str: string) {\n return (str && reHasRegExpChar.test(str))\n ? str.replace(reRegExpChar, \"\\\\$&\")\n : (str || \"\");\n },\n\n createRules() {\n // Can be extended upon once user configs are available\n // Eg. (useDefaultRules: boolean, customRules: Array[string])\n const rules = defaultRules;\n\n this.universalRules = new Set();\n this.rulesByHost = new Map();\n this.hostRules = new Map();\n\n for (const rule of rules) {\n const splitRule = rule.split(\"@\");\n const paramRule = new RegExp(\n \"^\" +\n this.escapeRegExp(splitRule[0]).replace(/\\\\\\*/, \".+?\") +\n \"$\"\n );\n\n if (!splitRule[1]) {\n this.universalRules.add(paramRule);\n continue;\n }\n const hostRule = new RegExp(\n \"^(www\\\\.)?\" +\n this.escapeRegExp(splitRule[1])\n .replace(/\\\\\\./, \"\\\\.\")\n .replace(/^\\\\\\*\\\\\\./, \"(.+?\\\\.)?\")\n .replace(/\\\\\\*/, \".+?\") +\n \"$\"\n );\n const hostRuleIndex = hostRule.toString();\n\n this.hostRules.set(hostRuleIndex, hostRule);\n if (this.rulesByHost.get(hostRuleIndex) == null) {\n this.rulesByHost.set(hostRuleIndex, new Set());\n }\n this.rulesByHost.get(hostRuleIndex).add(paramRule);\n }\n },\n\n removeParam(rule: string | RegExp, param: string, parent: URLSearchParams) {\n if (param === rule || rule instanceof RegExp && rule.test(param)) {\n parent.delete(param);\n }\n },\n\n replacer(match: string) {\n // Parse URL without throwing errors\n try {\n var url = new URL(match);\n } catch (error) {\n // Don't modify anything if we can't parse the URL\n return match;\n }\n\n // Cheap way to check if there are any search params\n if (url.searchParams.entries().next().done) {\n // If there are none, we don't need to modify anything\n return match;\n }\n\n // Check all universal rules\n this.universalRules.forEach(rule => {\n url.searchParams.forEach((_value, param, parent) => {\n this.removeParam(rule, param, parent);\n });\n });\n\n // Check rules for each hosts that match\n this.hostRules.forEach((regex, hostRuleName) => {\n if (!regex.test(url.hostname)) return;\n this.rulesByHost.get(hostRuleName).forEach(rule => {\n url.searchParams.forEach((_value, param, parent) => {\n this.removeParam(rule, param, parent);\n });\n });\n });\n\n return url.toString();\n },\n\n onSend(msg: MessageObject) {\n // Only run on messages that contain URLs\n if (msg.content.match(/http(s)?:\\/\\//)) {\n msg.content = msg.content.replace(\n /(https?:\\/\\/[^\\s<]+[^<.,:;\"'>)|\\]\\s])/g,\n match => this.replacer(match)\n );\n }\n },\n\n start() {\n this.createRules();\n this.preSend = addPreSendListener((_, msg) => this.onSend(msg));\n this.preEdit = addPreEditListener((_cid, _mid, msg) =>\n this.onSend(msg)\n );\n },\n\n stop() {\n removePreSendListener(this.preSend);\n removePreEditListener(this.preEdit);\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"ColorSighted\",\n description: \"Removes the colorblind-friendly icons from statuses, just like 2015-2017 Discord\",\n authors: [Devs.lewisakura],\n patches: [\n {\n find: \"Masks.STATUS_ONLINE\",\n replacement: {\n match: /Masks\\.STATUS_(?:IDLE|DND|STREAMING|OFFLINE)/g,\n replace: \"Masks.STATUS_ONLINE\"\n }\n },\n {\n find: \".AVATAR_STATUS_MOBILE_16;\",\n replacement: {\n match: /(?<=fromIsMobile:\\i=!0,.+?)status:(\\i)/,\n // Rename field to force it to always use \"online\"\n replace: 'status_$:$1=\"online\"'\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PatchReplacement, ReplaceFn } from \"./types\";\n\nexport function canonicalizeMatch(match: RegExp | string) {\n if (typeof match === \"string\") return match;\n const canonSource = match.source\n .replaceAll(\"\\\\i\", \"[A-Za-z_$][\\\\w$]*\");\n return new RegExp(canonSource, match.flags);\n}\n\nexport function canonicalizeReplace(replace: string | ReplaceFn, pluginName: string): string | ReplaceFn {\n const self = `Vencord.Plugins.plugins[${JSON.stringify(pluginName)}]`;\n\n if (typeof replace !== \"function\")\n return replace.replaceAll(\"$self\", self);\n\n return (...args) => replace(...args).replaceAll(\"$self\", self);\n}\n\nexport function canonicalizeDescriptor(descriptor: TypedPropertyDescriptor, canonicalize: (value: T) => T) {\n if (descriptor.get) {\n const original = descriptor.get;\n descriptor.get = function () {\n return canonicalize(original.call(this));\n };\n } else if (descriptor.value) {\n descriptor.value = canonicalize(descriptor.value);\n }\n return descriptor;\n}\n\nexport function canonicalizeReplacement(replacement: Pick, plugin: string) {\n const descriptors = Object.getOwnPropertyDescriptors(replacement);\n descriptors.match = canonicalizeDescriptor(descriptors.match, canonicalizeMatch);\n descriptors.replace = canonicalizeDescriptor(\n descriptors.replace,\n replace => canonicalizeReplace(replace, plugin),\n );\n Object.defineProperties(replacement, descriptors);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport { relaunch } from \"@utils/native\";\nimport { canonicalizeMatch, canonicalizeReplace, canonicalizeReplacement } from \"@utils/patches\";\nimport definePlugin from \"@utils/types\";\nimport * as Webpack from \"@webpack\";\nimport { extract, filters, findAll, search } from \"@webpack\";\nimport { React, ReactDOM } from \"@webpack/common\";\nimport type { ComponentType } from \"react\";\n\nconst WEB_ONLY = (f: string) => () => {\n throw new Error(`'${f}' is Discord Desktop only.`);\n};\n\nexport default definePlugin({\n name: \"ConsoleShortcuts\",\n description: \"Adds shorter Aliases for many things on the window. Run `shortcutList` for a list.\",\n authors: [Devs.Ven],\n\n getShortcuts() {\n function newFindWrapper(filterFactory: (...props: any[]) => Webpack.FilterFn) {\n const cache = new Map();\n\n return function (...filterProps: unknown[]) {\n const cacheKey = String(filterProps);\n if (cache.has(cacheKey)) return cache.get(cacheKey);\n\n const matches = findAll(filterFactory(...filterProps));\n\n const result = (() => {\n switch (matches.length) {\n case 0: return null;\n case 1: return matches[0];\n default:\n const uniqueMatches = [...new Set(matches)];\n if (uniqueMatches.length > 1)\n console.warn(`Warning: This filter matches ${matches.length} modules. Make it more specific!\\n`, uniqueMatches);\n\n return matches[0];\n }\n })();\n if (result && cacheKey) cache.set(cacheKey, result);\n return result;\n };\n }\n\n let fakeRenderWin: WeakRef | undefined;\n return {\n wp: Vencord.Webpack,\n wpc: Webpack.wreq.c,\n wreq: Webpack.wreq,\n wpsearch: search,\n wpex: extract,\n wpexs: (code: string) => Vencord.Webpack.extract(Vencord.Webpack.findModuleId(code)!),\n find: newFindWrapper(f => f),\n findAll,\n findByProps: newFindWrapper(filters.byProps),\n findAllByProps: (...props: string[]) => findAll(filters.byProps(...props)),\n findByCode: newFindWrapper(filters.byCode),\n findAllByCode: (code: string) => findAll(filters.byCode(code)),\n findStore: newFindWrapper(filters.byStoreName),\n PluginsApi: Vencord.Plugins,\n plugins: Vencord.Plugins.plugins,\n React,\n Settings: Vencord.Settings,\n Api: Vencord.Api,\n reload: () => location.reload(),\n restart: IS_WEB ? WEB_ONLY(\"restart\") : relaunch,\n canonicalizeMatch,\n canonicalizeReplace,\n canonicalizeReplacement,\n fakeRender: (component: ComponentType, props: any) => {\n const prevWin = fakeRenderWin?.deref();\n const win = prevWin?.closed === false ? prevWin : window.open(\"about:blank\", \"Fake Render\", \"popup,width=500,height=500\")!;\n fakeRenderWin = new WeakRef(win);\n win.focus();\n\n ReactDOM.render(React.createElement(component, props), win.document.body);\n }\n };\n },\n\n start() {\n const shortcuts = this.getShortcuts();\n window.shortcutList = shortcuts;\n for (const [key, val] of Object.entries(shortcuts))\n window[key] = val;\n },\n\n stop() {\n delete window.shortcutList;\n for (const key in this.getShortcuts())\n delete window[key];\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { LinkIcon } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { Clipboard, Menu } from \"@webpack/common\";\nimport type { Channel, User } from \"discord-types/general\";\n\ninterface UserContextProps {\n channel: Channel;\n guildId?: string;\n user: User;\n}\n\nconst UserContextMenuPatch: NavContextMenuPatchCallback = (children, { user }: UserContextProps) => () => {\n children.push(\n Clipboard.copy(``)}\n icon={LinkIcon}\n />\n );\n};\n\nexport default definePlugin({\n name: \"CopyUserURLs\",\n authors: [Devs.castdrian],\n description: \"Adds a 'Copy User URL' option to the user context menu.\",\n\n start() {\n addContextMenuPatch(\"user-context\", UserContextMenuPatch);\n },\n\n stop() {\n removeContextMenuPatch(\"user-context\", UserContextMenuPatch);\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { showNotification } from \"@api/Notifications\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport { closeAllModals } from \"@utils/modal\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { maybePromptToUpdate } from \"@utils/updater\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { FluxDispatcher, NavigationRouter } from \"@webpack/common\";\nimport type { ReactElement } from \"react\";\n\nconst CrashHandlerLogger = new Logger(\"CrashHandler\");\nconst ModalStack = findByPropsLazy(\"pushLazy\", \"popAll\");\n\nconst settings = definePluginSettings({\n attemptToPreventCrashes: {\n type: OptionType.BOOLEAN,\n description: \"Whether to attempt to prevent Discord crashes.\",\n default: true\n },\n attemptToNavigateToHome: {\n type: OptionType.BOOLEAN,\n description: \"Whether to attempt to navigate to the home when preventing Discord crashes.\",\n default: false\n }\n});\n\nlet crashCount: number = 0;\nlet lastCrashTimestamp: number = 0;\nlet shouldAttemptNextHandle = false;\n\nexport default definePlugin({\n name: \"CrashHandler\",\n description: \"Utility plugin for handling and possibly recovering from Crashes without a restart\",\n authors: [Devs.Nuckyz],\n enabledByDefault: true,\n\n settings,\n\n patches: [\n {\n find: \".Messages.ERRORS_UNEXPECTED_CRASH\",\n replacement: {\n match: /(?=this\\.setState\\()/,\n replace: \"$self.handleCrash(this)||\"\n }\n }\n ],\n\n handleCrash(_this: ReactElement & { forceUpdate: () => void; }) {\n if (Date.now() - lastCrashTimestamp <= 1_000 && !shouldAttemptNextHandle) return true;\n\n shouldAttemptNextHandle = false;\n\n if (++crashCount > 5) {\n try {\n showNotification({\n color: \"#eed202\",\n title: \"Discord has crashed!\",\n body: \"Awn :( Discord has crashed more than five times, not attempting to recover.\",\n noPersist: true,\n });\n } catch { }\n\n lastCrashTimestamp = Date.now();\n return false;\n }\n\n setTimeout(() => crashCount--, 60_000);\n\n try {\n if (crashCount === 1) maybePromptToUpdate(\"Uh oh, Discord has just crashed... but good news, there is a Vencord update available that might fix this issue! Would you like to update now?\", true);\n\n if (settings.store.attemptToPreventCrashes) {\n this.handlePreventCrash(_this);\n return true;\n }\n\n return false;\n } catch (err) {\n CrashHandlerLogger.error(\"Failed to handle crash\", err);\n return false;\n } finally {\n lastCrashTimestamp = Date.now();\n }\n },\n\n handlePreventCrash(_this: ReactElement & { forceUpdate: () => void; }) {\n if (Date.now() - lastCrashTimestamp >= 1_000) {\n try {\n showNotification({\n color: \"#eed202\",\n title: \"Discord has crashed!\",\n body: \"Attempting to recover...\",\n noPersist: true,\n });\n } catch { }\n }\n\n try {\n FluxDispatcher.dispatch({ type: \"CONTEXT_MENU_CLOSE\" });\n } catch (err) {\n CrashHandlerLogger.debug(\"Failed to close open context menu.\", err);\n }\n try {\n ModalStack?.popAll();\n } catch (err) {\n CrashHandlerLogger.debug(\"Failed to close old modals.\", err);\n }\n try {\n closeAllModals();\n } catch (err) {\n CrashHandlerLogger.debug(\"Failed to close all open modals.\", err);\n }\n try {\n FluxDispatcher.dispatch({ type: \"USER_PROFILE_MODAL_CLOSE\" });\n } catch (err) {\n CrashHandlerLogger.debug(\"Failed to close user popout.\", err);\n }\n try {\n FluxDispatcher.dispatch({ type: \"LAYER_POP_ALL\" });\n } catch (err) {\n CrashHandlerLogger.debug(\"Failed to pop all layers.\", err);\n }\n if (settings.store.attemptToNavigateToHome) {\n try {\n NavigationRouter.transitionTo(\"/channels/@me\");\n } catch (err) {\n CrashHandlerLogger.debug(\"Failed to navigate to home\", err);\n }\n }\n\n try {\n shouldAttemptNextHandle = true;\n _this.forceUpdate();\n } catch (err) {\n CrashHandlerLogger.debug(\"Failed to update crash handler component.\", err);\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function isTruthy(item: T): item is Exclude {\n return Boolean(item);\n}\n\nexport function isNonNullish(item: T): item is Exclude {\n return item != null;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings, Settings } from \"@api/Settings\";\nimport { Link } from \"@components/Link\";\nimport { Devs } from \"@utils/constants\";\nimport { isTruthy } from \"@utils/guards\";\nimport { useAwaiter } from \"@utils/react\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByCodeLazy, findByPropsLazy } from \"@webpack\";\nimport { ApplicationAssetUtils, FluxDispatcher, Forms, GuildStore, React, SelectedChannelStore, SelectedGuildStore, UserStore } from \"@webpack/common\";\n\nconst ActivityComponent = findByCodeLazy(\"onOpenGameProfile\");\nconst ActivityClassName = findByPropsLazy(\"activity\", \"buttonColor\");\nconst Colors = findByPropsLazy(\"profileColors\");\n\nasync function getApplicationAsset(key: string): Promise {\n if (/https?:\\/\\/(cdn|media)\\.discordapp\\.(com|net)\\/attachments\\//.test(key)) return \"mp:\" + key.replace(/https?:\\/\\/(cdn|media)\\.discordapp\\.(com|net)\\//, \"\");\n return (await ApplicationAssetUtils.fetchAssetIds(settings.store.appID!, [key]))[0];\n}\n\ninterface ActivityAssets {\n large_image?: string;\n large_text?: string;\n small_image?: string;\n small_text?: string;\n}\n\ninterface Activity {\n state?: string;\n details?: string;\n timestamps?: {\n start?: number;\n end?: number;\n };\n assets?: ActivityAssets;\n buttons?: Array;\n name: string;\n application_id: string;\n metadata?: {\n button_urls?: Array;\n };\n type: ActivityType;\n url?: string;\n flags: number;\n}\n\nconst enum ActivityType {\n PLAYING = 0,\n STREAMING = 1,\n LISTENING = 2,\n WATCHING = 3,\n COMPETING = 5\n}\n\nconst enum TimestampMode {\n NONE,\n NOW,\n TIME,\n CUSTOM,\n}\n\nconst settings = definePluginSettings({\n appID: {\n type: OptionType.STRING,\n description: \"Application ID (required)\",\n onChange: onChange,\n isValid: (value: string) => {\n if (!value) return \"Application ID is required.\";\n if (value && !/^\\d+$/.test(value)) return \"Application ID must be a number.\";\n return true;\n }\n },\n appName: {\n type: OptionType.STRING,\n description: \"Application name (required)\",\n onChange: onChange,\n isValid: (value: string) => {\n if (!value) return \"Application name is required.\";\n if (value.length > 128) return \"Application name must be not longer than 128 characters.\";\n return true;\n }\n },\n details: {\n type: OptionType.STRING,\n description: \"Details (line 1)\",\n onChange: onChange,\n isValid: (value: string) => {\n if (value && value.length > 128) return \"Details (line 1) must be not longer than 128 characters.\";\n return true;\n }\n },\n state: {\n type: OptionType.STRING,\n description: \"State (line 2)\",\n onChange: onChange,\n isValid: (value: string) => {\n if (value && value.length > 128) return \"State (line 2) must be not longer than 128 characters.\";\n return true;\n }\n },\n type: {\n type: OptionType.SELECT,\n description: \"Activity type\",\n onChange: onChange,\n options: [\n {\n label: \"Playing\",\n value: ActivityType.PLAYING,\n default: true\n },\n {\n label: \"Streaming\",\n value: ActivityType.STREAMING\n },\n {\n label: \"Listening\",\n value: ActivityType.LISTENING\n },\n {\n label: \"Watching\",\n value: ActivityType.WATCHING\n },\n {\n label: \"Competing\",\n value: ActivityType.COMPETING\n }\n ]\n },\n streamLink: {\n type: OptionType.STRING,\n description: \"Twitch.tv or Youtube.com link (only for Streaming activity type)\",\n onChange: onChange,\n disabled: isStreamLinkDisabled,\n isValid: isStreamLinkValid\n },\n timestampMode: {\n type: OptionType.SELECT,\n description: \"Timestamp mode\",\n onChange: onChange,\n options: [\n {\n label: \"None\",\n value: TimestampMode.NONE,\n default: true\n },\n {\n label: \"Since discord open\",\n value: TimestampMode.NOW\n },\n {\n label: \"Same as your current time\",\n value: TimestampMode.TIME\n },\n {\n label: \"Custom\",\n value: TimestampMode.CUSTOM\n }\n ]\n },\n startTime: {\n type: OptionType.NUMBER,\n description: \"Start timestamp (only for custom timestamp mode)\",\n onChange: onChange,\n disabled: isTimestampDisabled,\n isValid: (value: number) => {\n if (value && value < 0) return \"Start timestamp must be greater than 0.\";\n return true;\n }\n },\n endTime: {\n type: OptionType.NUMBER,\n description: \"End timestamp (only for custom timestamp mode)\",\n onChange: onChange,\n disabled: isTimestampDisabled,\n isValid: (value: number) => {\n if (value && value < 0) return \"End timestamp must be greater than 0.\";\n return true;\n }\n },\n imageBig: {\n type: OptionType.STRING,\n description: \"Big image key/link\",\n onChange: onChange,\n isValid: isImageKeyValid\n },\n imageBigTooltip: {\n type: OptionType.STRING,\n description: \"Big image tooltip\",\n onChange: onChange,\n isValid: (value: string) => {\n if (value && value.length > 128) return \"Big image tooltip must be not longer than 128 characters.\";\n return true;\n }\n },\n imageSmall: {\n type: OptionType.STRING,\n description: \"Small image key/link\",\n onChange: onChange,\n isValid: isImageKeyValid\n },\n imageSmallTooltip: {\n type: OptionType.STRING,\n description: \"Small image tooltip\",\n onChange: onChange,\n isValid: (value: string) => {\n if (value && value.length > 128) return \"Small image tooltip must be not longer than 128 characters.\";\n return true;\n }\n },\n buttonOneText: {\n type: OptionType.STRING,\n description: \"Button 1 text\",\n onChange: onChange,\n isValid: (value: string) => {\n if (value && value.length > 31) return \"Button 1 text must be not longer than 31 characters.\";\n return true;\n }\n },\n buttonOneURL: {\n type: OptionType.STRING,\n description: \"Button 1 URL\",\n onChange: onChange\n },\n buttonTwoText: {\n type: OptionType.STRING,\n description: \"Button 2 text\",\n onChange: onChange,\n isValid: (value: string) => {\n if (value && value.length > 31) return \"Button 2 text must be not longer than 31 characters.\";\n return true;\n }\n },\n buttonTwoURL: {\n type: OptionType.STRING,\n description: \"Button 2 URL\",\n onChange: onChange\n }\n});\n\nfunction onChange() {\n setRpc(true);\n if (Settings.plugins.CustomRPC.enabled) setRpc();\n}\n\nfunction isStreamLinkDisabled() {\n return settings.store.type !== ActivityType.STREAMING;\n}\n\nfunction isStreamLinkValid(value: string) {\n if (!isStreamLinkDisabled() && !/https?:\\/\\/(www\\.)?(twitch\\.tv|youtube\\.com)\\/\\w+/.test(value)) return \"Streaming link must be a valid URL.\";\n return true;\n}\n\nfunction isTimestampDisabled() {\n return settings.store.timestampMode !== TimestampMode.CUSTOM;\n}\n\nfunction isImageKeyValid(value: string) {\n if (/https?:\\/\\/(?!i\\.)?imgur\\.com\\//.test(value)) return \"Imgur link must be a direct link to the image. (e.g. https://i.imgur.com/...)\";\n if (/https?:\\/\\/(?!media\\.)?tenor\\.com\\//.test(value)) return \"Tenor link must be a direct link to the image. (e.g. https://media.tenor.com/...)\";\n return true;\n}\n\nasync function createActivity(): Promise {\n const {\n appID,\n appName,\n details,\n state,\n type,\n streamLink,\n startTime,\n endTime,\n imageBig,\n imageBigTooltip,\n imageSmall,\n imageSmallTooltip,\n buttonOneText,\n buttonOneURL,\n buttonTwoText,\n buttonTwoURL\n } = settings.store;\n\n if (!appName) return;\n\n const activity: Activity = {\n application_id: appID || \"0\",\n name: appName,\n state,\n details,\n type,\n flags: 1 << 0,\n };\n\n if (type === ActivityType.STREAMING) activity.url = streamLink;\n\n switch (settings.store.timestampMode) {\n case TimestampMode.NOW:\n activity.timestamps = {\n start: Math.floor(Date.now() / 1000)\n };\n break;\n case TimestampMode.TIME:\n activity.timestamps = {\n start: Math.floor(Date.now() / 1000) - (new Date().getHours() * 3600) - (new Date().getMinutes() * 60) - new Date().getSeconds()\n };\n break;\n case TimestampMode.CUSTOM:\n if (startTime || endTime) {\n activity.timestamps = {};\n if (startTime) activity.timestamps.start = startTime;\n if (endTime) activity.timestamps.end = endTime;\n }\n break;\n case TimestampMode.NONE:\n default:\n break;\n }\n\n if (buttonOneText) {\n activity.buttons = [\n buttonOneText,\n buttonTwoText\n ].filter(isTruthy);\n\n activity.metadata = {\n button_urls: [\n buttonOneURL,\n buttonTwoURL\n ].filter(isTruthy)\n };\n }\n\n if (imageBig) {\n activity.assets = {\n large_image: await getApplicationAsset(imageBig),\n large_text: imageBigTooltip || undefined\n };\n }\n\n if (imageSmall) {\n activity.assets = {\n ...activity.assets,\n small_image: await getApplicationAsset(imageSmall),\n small_text: imageSmallTooltip || undefined\n };\n }\n\n\n for (const k in activity) {\n if (k === \"type\") continue;\n const v = activity[k];\n if (!v || v.length === 0)\n delete activity[k];\n }\n\n return activity;\n}\n\nasync function setRpc(disable?: boolean) {\n const activity: Activity | undefined = await createActivity();\n\n FluxDispatcher.dispatch({\n type: \"LOCAL_ACTIVITY_UPDATE\",\n activity: !disable ? activity : null,\n socketId: \"CustomRPC\",\n });\n}\n\nexport default definePlugin({\n name: \"CustomRPC\",\n description: \"Allows you to set a custom rich presence.\",\n authors: [Devs.captain, Devs.AutumnVN],\n start: setRpc,\n stop: () => setRpc(true),\n settings,\n\n settingsAboutComponent: () => {\n const activity = useAwaiter(createActivity);\n return (\n <>\n \n Go to Discord Developer Portal to create an application and\n get the application ID.\n \n \n Upload images in the Rich Presence tab to get the image keys.\n \n \n If you want to use image link, download your image and reupload the image to Imgur and get the image link by right-clicking the image and select \"Copy image address\".\n \n \n
\n {activity[0] && }\n
\n \n );\n }\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport \"./styles.css\";\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport definePlugin from \"@utils/types\";\nimport { Tooltip } from \"@webpack/common\";\nimport type { Component } from \"react\";\n\ninterface Props {\n embed: {\n rawTitle: string;\n provider?: {\n name: string;\n };\n thumbnail: {\n proxyURL: string;\n };\n video: {\n url: string;\n };\n\n dearrow: {\n enabled: boolean;\n oldTitle?: string;\n oldThumb?: string;\n };\n };\n}\n\nconst embedUrlRe = /https:\\/\\/www\\.youtube\\.com\\/embed\\/([a-zA-Z0-9_-]{11})/;\n\nasync function embedDidMount(this: Component) {\n try {\n const { embed } = this.props;\n if (!embed || embed.dearrow || embed.provider?.name !== \"YouTube\" || !embed.video?.url) return;\n\n const videoId = embedUrlRe.exec(embed.video.url)?.[1];\n if (!videoId) return;\n\n const res = await fetch(`https://sponsor.ajay.app/api/branding?videoID=${videoId}`);\n if (!res.ok) return;\n\n const { titles, thumbnails } = await res.json();\n\n const hasTitle = titles[0]?.votes >= 0;\n const hasThumb = thumbnails[0]?.votes >= 0;\n\n if (!hasTitle && !hasThumb) return;\n\n embed.dearrow = {\n enabled: true\n };\n\n if (titles[0]?.votes >= 0) {\n embed.dearrow.oldTitle = embed.rawTitle;\n embed.rawTitle = titles[0].title;\n }\n\n if (thumbnails[0]?.votes >= 0 && thumbnails[0].timestamp) {\n embed.dearrow.oldThumb = embed.thumbnail.proxyURL;\n embed.thumbnail.proxyURL = `https://dearrow-thumb.ajay.app/api/v1/getThumbnail?videoID=${videoId}&time=${thumbnails[0].timestamp}`;\n }\n\n this.forceUpdate();\n } catch (err) {\n new Logger(\"Dearrow\").error(\"Failed to dearrow embed\", err);\n }\n}\n\nfunction DearrowButton({ component }: { component: Component; }) {\n const { embed } = component.props;\n if (!embed?.dearrow) return null;\n\n return (\n \n {({ onMouseEnter, onMouseLeave }) => (\n {\n const { enabled, oldThumb, oldTitle } = embed.dearrow;\n embed.dearrow.enabled = !enabled;\n if (oldTitle) {\n embed.dearrow.oldTitle = embed.rawTitle;\n embed.rawTitle = oldTitle;\n }\n if (oldThumb) {\n embed.dearrow.oldThumb = embed.thumbnail.proxyURL;\n embed.thumbnail.proxyURL = oldThumb;\n }\n\n component.forceUpdate();\n }}\n >\n {/* Dearrow Icon, taken from https://dearrow.ajay.app/logo.svg (and optimised) */}\n \n \n \n \n \n\n \n )}\n \n );\n}\n\nexport default definePlugin({\n name: \"Dearrow\",\n description: \"Makes YouTube embed titles and thumbnails less sensationalist, powered by Dearrow\",\n authors: [Devs.Ven],\n\n embedDidMount,\n renderButton(component: Component) {\n return (\n \n \n \n );\n },\n\n patches: [{\n find: \"this.renderInlineMediaEmbed\",\n replacement: [\n // patch componentDidMount to replace embed thumbnail and title\n {\n match: /render\\(\\)\\{let\\{embed:/,\n replace: \"componentDidMount=$self.embedDidMount;$&\"\n },\n\n // add dearrow button\n {\n match: /children:\\[(?=null!=\\i\\?\\i\\.renderSuppressButton)/,\n replace: \"children:[$self.renderButton(this),\"\n }\n ]\n }],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"DisableDMCallIdle\",\n description: \"Disables automatically getting kicked from a DM voice call after 3 minutes.\",\n authors: [Devs.Nuckyz],\n patches: [\n {\n find: \".Messages.BOT_CALL_IDLE_DISCONNECT\",\n replacement: {\n match: /(?<=function \\i\\(\\){)(?=.{1,120}\\.Messages\\.BOT_CALL_IDLE_DISCONNECT)/,\n replace: \"return;\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { CheckedTextInput } from \"@components/CheckedTextInput\";\nimport { Devs } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport { Margins } from \"@utils/margins\";\nimport { ModalContent, ModalHeader, ModalRoot, openModalLazy } from \"@utils/modal\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy, findStoreLazy } from \"@webpack\";\nimport { EmojiStore, FluxDispatcher, Forms, GuildStore, Menu, PermissionsBits, PermissionStore, React, RestAPI, Toasts, Tooltip, UserStore } from \"@webpack/common\";\nimport { Promisable } from \"type-fest\";\n\nconst StickersStore = findStoreLazy(\"StickersStore\");\nconst EmojiManager = findByPropsLazy(\"fetchEmoji\", \"uploadEmoji\", \"deleteEmoji\");\n\ninterface Sticker {\n t: \"Sticker\";\n description: string;\n format_type: number;\n guild_id: string;\n id: string;\n name: string;\n tags: string;\n type: number;\n}\n\ninterface Emoji {\n t: \"Emoji\";\n id: string;\n name: string;\n isAnimated: boolean;\n}\n\ntype Data = Emoji | Sticker;\n\nconst StickerExt = [, \"png\", \"png\", \"json\", \"gif\"] as const;\n\nfunction getUrl(data: Data) {\n if (data.t === \"Emoji\")\n return `${location.protocol}//${window.GLOBAL_ENV.CDN_HOST}/emojis/${data.id}.${data.isAnimated ? \"gif\" : \"png\"}`;\n\n return `${location.origin}/stickers/${data.id}.${StickerExt[data.format_type]}`;\n}\n\nasync function fetchSticker(id: string) {\n const cached = StickersStore.getStickerById(id);\n if (cached) return cached;\n\n const { body } = await RestAPI.get({\n url: `/stickers/${id}`\n });\n\n FluxDispatcher.dispatch({\n type: \"STICKER_FETCH_SUCCESS\",\n sticker: body\n });\n\n return body as Sticker;\n}\n\nasync function cloneSticker(guildId: string, sticker: Sticker) {\n const data = new FormData();\n data.append(\"name\", sticker.name);\n data.append(\"tags\", sticker.tags);\n data.append(\"description\", sticker.description);\n data.append(\"file\", await fetchBlob(getUrl(sticker)));\n\n const { body } = await RestAPI.post({\n url: `/guilds/${guildId}/stickers`,\n body: data,\n });\n\n FluxDispatcher.dispatch({\n type: \"GUILD_STICKERS_CREATE_SUCCESS\",\n guildId,\n sticker: {\n ...body,\n user: UserStore.getCurrentUser()\n }\n });\n}\n\nasync function cloneEmoji(guildId: string, emoji: Emoji) {\n const data = await fetchBlob(getUrl(emoji));\n\n const dataUrl = await new Promise(resolve => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result as string);\n reader.readAsDataURL(data);\n });\n\n return EmojiManager.uploadEmoji({\n guildId,\n name: emoji.name.split(\"~\")[0],\n image: dataUrl\n });\n}\n\nfunction getGuildCandidates(data: Data) {\n const meId = UserStore.getCurrentUser().id;\n\n return Object.values(GuildStore.getGuilds()).filter(g => {\n const canCreate = g.ownerId === meId ||\n (PermissionStore.getGuildPermissions({ id: g.id }) & PermissionsBits.CREATE_GUILD_EXPRESSIONS) === PermissionsBits.CREATE_GUILD_EXPRESSIONS;\n if (!canCreate) return false;\n\n if (data.t === \"Sticker\") return true;\n\n const { isAnimated } = data as Emoji;\n\n const emojiSlots = g.getMaxEmojiSlots();\n const { emojis } = EmojiStore.getGuilds()[g.id];\n\n let count = 0;\n for (const emoji of emojis)\n if (emoji.animated === isAnimated) count++;\n return count < emojiSlots;\n }).sort((a, b) => a.name.localeCompare(b.name));\n}\n\nasync function fetchBlob(url: string) {\n const res = await fetch(url);\n if (!res.ok)\n throw new Error(`Failed to fetch ${url} - ${res.status}`);\n\n return res.blob();\n}\n\nasync function doClone(guildId: string, data: Sticker | Emoji) {\n try {\n if (data.t === \"Sticker\")\n await cloneSticker(guildId, data);\n else\n await cloneEmoji(guildId, data);\n\n Toasts.show({\n message: `Successfully cloned ${data.name} to ${GuildStore.getGuild(guildId)?.name ?? \"your server\"}!`,\n type: Toasts.Type.SUCCESS,\n id: Toasts.genId()\n });\n } catch (e: any) {\n let message = \"Something went wrong (check console!)\";\n try {\n message = JSON.parse(e.text).message;\n } catch { }\n\n new Logger(\"EmoteCloner\").error(\"Failed to clone\", data.name, \"to\", guildId, e);\n Toasts.show({\n message: \"Failed to clone: \" + message,\n type: Toasts.Type.FAILURE,\n id: Toasts.genId()\n });\n }\n}\n\nconst getFontSize = (s: string) => {\n // [18, 18, 16, 16, 14, 12, 10]\n const sizes = [20, 20, 18, 18, 16, 14, 12];\n return sizes[s.length] ?? 4;\n};\n\nconst nameValidator = /^\\w+$/i;\n\nfunction CloneModal({ data }: { data: Sticker | Emoji; }) {\n const [isCloning, setIsCloning] = React.useState(false);\n const [name, setName] = React.useState(data.name);\n\n const [x, invalidateMemo] = React.useReducer(x => x + 1, 0);\n\n const guilds = React.useMemo(() => getGuildCandidates(data), [data.id, x]);\n\n return (\n <>\n Custom Name\n {\n data.name = v;\n setName(v);\n }}\n validate={v =>\n (data.t === \"Emoji\" && v.length > 2 && v.length < 32 && nameValidator.test(v))\n || (data.t === \"Sticker\" && v.length > 2 && v.length < 30)\n || \"Name must be between 2 and 32 characters and only contain alphanumeric characters\"\n }\n />\n
\n {guilds.map(g => (\n \n {({ onMouseLeave, onMouseEnter }) => (\n {\n setIsCloning(true);\n doClone(g.id, data).finally(() => {\n invalidateMemo();\n setIsCloning(false);\n });\n }}\n >\n {g.icon ? (\n \n ) : (\n \n {g.acronym}\n \n )}\n
\n )}\n \n ))}\n \n \n );\n}\n\nfunction buildMenuItem(type: \"Emoji\" | \"Sticker\", fetchData: () => Promisable>) {\n return (\n \n openModalLazy(async () => {\n const res = await fetchData();\n const data = { t: type, ...res } as Sticker | Emoji;\n const url = getUrl(data);\n\n return modalProps => (\n \n \n \n Clone {data.name}\n \n \n \n \n \n );\n })\n }\n />\n );\n}\n\nfunction isGifUrl(url: string) {\n return new URL(url).pathname.endsWith(\".gif\");\n}\n\nconst messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) => () => {\n const { favoriteableId, itemHref, itemSrc, favoriteableType } = props ?? {};\n\n if (!favoriteableId) return;\n\n const menuItem = (() => {\n switch (favoriteableType) {\n case \"emoji\":\n const match = props.message.content.match(RegExp(`|https://cdn\\\\.discordapp\\\\.com/emojis/${favoriteableId}\\\\.`));\n if (!match) return;\n const name = match[1] ?? \"FakeNitroEmoji\";\n\n return buildMenuItem(\"Emoji\", () => ({\n id: favoriteableId,\n name,\n isAnimated: isGifUrl(itemHref ?? itemSrc)\n }));\n case \"sticker\":\n const sticker = props.message.stickerItems.find(s => s.id === favoriteableId);\n if (sticker?.format_type === 3 /* LOTTIE */) return;\n\n return buildMenuItem(\"Sticker\", () => fetchSticker(favoriteableId));\n }\n })();\n\n if (menuItem)\n findGroupChildrenByChildId(\"copy-link\", children)?.push(menuItem);\n};\n\nconst expressionPickerPatch: NavContextMenuPatchCallback = (children, props: { target: HTMLElement; }) => () => {\n const { id, name, type } = props?.target?.dataset ?? {};\n if (!id) return;\n\n if (type === \"emoji\" && name) {\n const firstChild = props.target.firstChild as HTMLImageElement;\n\n children.push(buildMenuItem(\"Emoji\", () => ({\n id,\n name,\n isAnimated: firstChild && isGifUrl(firstChild.src)\n })));\n } else if (type === \"sticker\" && !props.target.className?.includes(\"lottieCanvas\")) {\n children.push(buildMenuItem(\"Sticker\", () => fetchSticker(id)));\n }\n};\n\nexport default definePlugin({\n name: \"EmoteCloner\",\n description: \"Allows you to clone Emotes & Stickers to your own server (right click them)\",\n tags: [\"StickerCloner\"],\n authors: [Devs.Ven, Devs.Nuckyz],\n\n start() {\n addContextMenuPatch(\"message\", messageContextMenuPatch);\n addContextMenuPatch(\"expression-picker\", expressionPickerPatch);\n },\n\n stop() {\n removeContextMenuPatch(\"message\", messageContextMenuPatch);\n removeContextMenuPatch(\"expression-picker\", expressionPickerPatch);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { ErrorCard } from \"@components/ErrorCard\";\nimport { Devs } from \"@utils/constants\";\nimport { Margins } from \"@utils/margins\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { Forms, React } from \"@webpack/common\";\n\nconst KbdStyles = findByPropsLazy(\"key\", \"removeBuildOverride\");\n\nconst settings = definePluginSettings({\n enableIsStaff: {\n description: \"Enable isStaff\",\n type: OptionType.BOOLEAN,\n default: false,\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"Experiments\",\n description: \"Enable Access to Experiments in Discord!\",\n authors: [\n Devs.Megu,\n Devs.Ven,\n Devs.Nickyux,\n Devs.BanTheNons,\n Devs.Nuckyz\n ],\n settings,\n\n patches: [\n {\n find: \"Object.defineProperties(this,{isDeveloper\",\n replacement: {\n match: /(?<={isDeveloper:\\{[^}]+?,get:\\(\\)=>)\\i/,\n replace: \"true\"\n }\n },\n {\n find: 'type:\"user\",revision',\n replacement: {\n match: /!(\\i)&&\"CONNECTION_OPEN\".+?;/g,\n replace: \"$1=!0;\"\n }\n },\n {\n find: \".isStaff=()\",\n predicate: () => settings.store.enableIsStaff,\n replacement: [\n {\n match: /=>*?(\\i)\\.hasFlag\\((\\i\\.\\i)\\.STAFF\\)}/,\n replace: (_, user, flags) => `=>Vencord.Webpack.Common.UserStore.getCurrentUser()?.id===${user}.id||${user}.hasFlag(${flags}.STAFF)}`\n },\n {\n match: /hasFreePremium\\(\\){return this.isStaff\\(\\)\\s*?\\|\\|/,\n replace: \"hasFreePremium(){return \",\n }\n ]\n },\n // Fix search history being disabled / broken with isStaff\n {\n find: '(\"showNewSearch\")',\n predicate: () => settings.store.enableIsStaff,\n replacement: {\n match: /(?<=showNewSearch\"\\);return)\\s?/,\n replace: \"!1&&\"\n }\n },\n {\n find: 'H1,title:\"Experiments\"',\n replacement: {\n match: 'title:\"Experiments\",children:[',\n replace: \"$&$self.WarningCard(),\"\n }\n }\n ],\n\n settingsAboutComponent: () => {\n const isMacOS = navigator.platform.includes(\"Mac\");\n const modKey = isMacOS ? \"cmd\" : \"ctrl\";\n const altKey = isMacOS ? \"opt\" : \"alt\";\n return (\n \n More Information\n \n You can enable client DevTools{\" \"}\n {modKey} +{\" \"}\n {altKey} +{\" \"}\n O{\" \"}\n after enabling isStaff below\n \n \n and then toggling Enable DevTools in the Developer Options tab in settings.\n \n \n );\n },\n\n WarningCard: ErrorBoundary.wrap(() => (\n \n Hold on!!\n\n \n Experiments are unreleased Discord features. They might not work, or even break your client or get your account disabled.\n \n\n \n Only use experiments if you know what you're doing. Vencord is not responsible for any damage caused by enabling experiments.\n \n \n ), { noop: true })\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"F8Break\",\n description: \"Pause the client when you press F8 with DevTools (+ breakpoints) open.\",\n authors: [Devs.lewisakura],\n\n start() {\n window.addEventListener(\"keydown\", this.event);\n },\n\n stop() {\n window.removeEventListener(\"keydown\", this.event);\n },\n\n event(e: KeyboardEvent) {\n if (e.code === \"F8\") {\n // Hi! You've just paused the client. Pressing F8 in DevTools or in the main window will unpause it again.\n // It's up to you on what to do, friend. Happy travels!\n debugger;\n }\n }\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nexport let EXTENSION_BASE_URL: string;\nexport let EXTENSION_VERSION: string;\n\nif (IS_EXTENSION) {\n const script = document.querySelector(\"#vencord-script\") as HTMLScriptElement;\n EXTENSION_BASE_URL = script.dataset.extensionBaseUrl!;\n EXTENSION_VERSION = script.dataset.version!;\n}\n", "/* eslint-disable */\n\nconst self = module.exports;\n/**\n * apng-canvas v2.1.2\n *\n * @copyright 2011-2019 David Mzareulyan\n * @link https://github.com/davidmz/apng-canvas\n * @license MIT\n */\n!(function i(o, a, s) {\n function u(n, t) {\n if (!a[n]) {\n if (!o[n]) {\n var e = \"function\" == typeof require && require;\n if (!t && e) return e(n, !0);\n if (c) return c(n, !0);\n throw new Error(\"Cannot find module '\" + n + \"'\");\n }\n var r = (a[n] = { exports: {} });\n o[n][0].call(\n r.exports,\n function (t) {\n var e = o[n][1][t];\n return u(e || t);\n },\n r,\n r.exports,\n i,\n o,\n a,\n s\n );\n }\n return a[n].exports;\n }\n for (\n var c = \"function\" == typeof require && require, t = 0;\n t < s.length;\n t++\n )\n u(s[t]);\n return u;\n})(\n {\n 1: [\n function (Y, n, r) {\n (function (G, q) {\n var t, e;\n (t = this),\n (e = function () {\n \"use strict\";\n function u(t) {\n return \"function\" == typeof t;\n }\n var n = Array.isArray\n ? Array.isArray\n : function (t) {\n return (\n \"[object Array]\" ===\n Object.prototype.toString.call(t)\n );\n },\n r = 0,\n e = void 0,\n i = void 0,\n a = function (t, e) {\n (l[r] = t),\n (l[r + 1] = e),\n 2 === (r += 2) && (i ? i(d) : g());\n };\n var t =\n \"undefined\" != typeof window\n ? window\n : void 0,\n o = t || {},\n s =\n o.MutationObserver ||\n o.WebKitMutationObserver,\n c =\n \"undefined\" == typeof self &&\n void 0 !== G &&\n \"[object process]\" === {}.toString.call(G),\n f =\n \"undefined\" != typeof Uint8ClampedArray &&\n \"undefined\" != typeof importScripts &&\n \"undefined\" != typeof MessageChannel;\n function h() {\n var t = setTimeout;\n return function () {\n return t(d, 1);\n };\n }\n var l = new Array(1e3);\n function d() {\n for (var t = 0; t < r; t += 2) {\n (0, l[t])(l[t + 1]),\n (l[t] = void 0),\n (l[t + 1] = void 0);\n }\n r = 0;\n }\n var p,\n v,\n A,\n m,\n g = void 0;\n function w(t, e) {\n var n = this,\n r = new this.constructor(b);\n void 0 === r[_] && j(r);\n var i = n._state;\n if (i) {\n var o = arguments[i - 1];\n a(function () {\n return L(i, r, o, n._result);\n });\n } else U(n, r, t, e);\n return r;\n }\n function y(t) {\n if (\n t &&\n \"object\" == typeof t &&\n t.constructor === this\n )\n return t;\n var e = new this(b);\n return T(e, t), e;\n }\n g = c\n ? function () {\n return G.nextTick(d);\n }\n : s\n ? ((v = 0),\n (A = new s(d)),\n (m = document.createTextNode(\"\")),\n A.observe(m, { characterData: !0 }),\n function () {\n m.data = v = ++v % 2;\n })\n : f\n ? (((p = new MessageChannel()).port1.onmessage =\n d),\n function () {\n return p.port2.postMessage(0);\n })\n : void 0 === t && \"function\" == typeof Y\n ? (function () {\n try {\n var t =\n Function(\"return this\")().require(\n \"vertx\"\n );\n return void 0 !==\n (e =\n t.runOnLoop || t.runOnContext)\n ? function () {\n e(d);\n }\n : h();\n } catch (t) {\n return h();\n }\n })()\n : h();\n var _ = Math.random().toString(36).substring(2);\n function b() { }\n var E = void 0,\n P = 1,\n x = 2;\n function N(t, r, i) {\n a(function (e) {\n var n = !1,\n t = (function (t, e, n, r) {\n try {\n t.call(e, n, r);\n } catch (t) {\n return t;\n }\n })(\n i,\n r,\n function (t) {\n n ||\n ((n = !0),\n r !== t\n ? T(e, t)\n : O(e, t));\n },\n function (t) {\n n || ((n = !0), R(e, t));\n },\n e._label\n );\n !n && t && ((n = !0), R(e, t));\n }, t);\n }\n function C(t, e, n) {\n e.constructor === t.constructor &&\n n === w &&\n e.constructor.resolve === y\n ? (function (e, t) {\n t._state === P\n ? O(e, t._result)\n : t._state === x\n ? R(e, t._result)\n : U(\n t,\n void 0,\n function (t) {\n return T(e, t);\n },\n function (t) {\n return R(e, t);\n }\n );\n })(t, e)\n : void 0 === n\n ? O(t, e)\n : u(n)\n ? N(t, e, n)\n : O(t, e);\n }\n function T(e, t) {\n if (e === t)\n R(\n e,\n new TypeError(\n \"You cannot resolve a promise with itself\"\n )\n );\n else if (\n (function (t) {\n var e = typeof t;\n return (\n null !== t &&\n (\"object\" == e || \"function\" == e)\n );\n })(t)\n ) {\n var n = void 0;\n try {\n n = t.then;\n } catch (t) {\n return void R(e, t);\n }\n C(e, t, n);\n } else O(e, t);\n }\n function B(t) {\n t._onerror && t._onerror(t._result), I(t);\n }\n function O(t, e) {\n t._state === E &&\n ((t._result = e),\n (t._state = P),\n 0 !== t._subscribers.length && a(I, t));\n }\n function R(t, e) {\n t._state === E &&\n ((t._state = x), (t._result = e), a(B, t));\n }\n function U(t, e, n, r) {\n var i = t._subscribers,\n o = i.length;\n (t._onerror = null),\n (i[o] = e),\n (i[o + P] = n),\n (i[o + x] = r),\n 0 === o && t._state && a(I, t);\n }\n function I(t) {\n var e = t._subscribers,\n n = t._state;\n if (0 !== e.length) {\n for (\n var r = void 0,\n i = void 0,\n o = t._result,\n a = 0;\n a < e.length;\n a += 3\n )\n (r = e[a]),\n (i = e[a + n]),\n r ? L(n, r, i, o) : i(o);\n t._subscribers.length = 0;\n }\n }\n function L(t, e, n, r) {\n var i = u(n),\n o = void 0,\n a = void 0,\n s = !0;\n if (i) {\n try {\n o = n(r);\n } catch (t) {\n (s = !1), (a = t);\n }\n if (e === o)\n return void R(\n e,\n new TypeError(\n \"A promises callback cannot return that same promise.\"\n )\n );\n } else o = r;\n e._state !== E ||\n (i && s\n ? T(e, o)\n : !1 === s\n ? R(e, a)\n : t === P\n ? O(e, o)\n : t === x && R(e, o));\n }\n var D = 0;\n function j(t) {\n (t[_] = D++),\n (t._state = void 0),\n (t._result = void 0),\n (t._subscribers = []);\n }\n var k =\n ((F.prototype._enumerate = function (t) {\n for (\n var e = 0;\n this._state === E && e < t.length;\n e++\n )\n this._eachEntry(t[e], e);\n }),\n (F.prototype._eachEntry = function (e, t) {\n var n = this._instanceConstructor,\n r = n.resolve;\n if (r === y) {\n var i = void 0,\n o = void 0,\n a = !1;\n try {\n i = e.then;\n } catch (t) {\n (a = !0), (o = t);\n }\n if (i === w && e._state !== E)\n this._settledAt(\n e._state,\n t,\n e._result\n );\n else if (\"function\" != typeof i)\n this._remaining--,\n (this._result[t] = e);\n else if (n === S) {\n var s = new n(b);\n a ? R(s, o) : C(s, e, i),\n this._willSettleAt(s, t);\n } else\n this._willSettleAt(\n new n(function (t) {\n return t(e);\n }),\n t\n );\n } else this._willSettleAt(r(e), t);\n }),\n (F.prototype._settledAt = function (t, e, n) {\n var r = this.promise;\n r._state === E &&\n (this._remaining--,\n t === x\n ? R(r, n)\n : (this._result[e] = n)),\n 0 === this._remaining &&\n O(r, this._result);\n }),\n (F.prototype._willSettleAt = function (t, e) {\n var n = this;\n U(\n t,\n void 0,\n function (t) {\n return n._settledAt(P, e, t);\n },\n function (t) {\n return n._settledAt(x, e, t);\n }\n );\n }),\n F);\n function F(t, e) {\n (this._instanceConstructor = t),\n (this.promise = new t(b)),\n this.promise[_] || j(this.promise),\n n(e)\n ? ((this.length = e.length),\n (this._remaining = e.length),\n (this._result = new Array(\n this.length\n )),\n 0 === this.length\n ? O(this.promise, this._result)\n : ((this.length =\n this.length || 0),\n this._enumerate(e),\n 0 === this._remaining &&\n O(\n this.promise,\n this._result\n )))\n : R(\n this.promise,\n new Error(\n \"Array Methods must be provided an Array\"\n )\n );\n }\n var S =\n ((M.prototype.catch = function (t) {\n return this.then(null, t);\n }),\n (M.prototype.finally = function (e) {\n var n = this.constructor;\n return u(e)\n ? this.then(\n function (t) {\n return n\n .resolve(e())\n .then(function () {\n return t;\n });\n },\n function (t) {\n return n\n .resolve(e())\n .then(function () {\n throw t;\n });\n }\n )\n : this.then(e, e);\n }),\n M);\n function M(t) {\n (this[_] = D++),\n (this._result = this._state = void 0),\n (this._subscribers = []),\n b !== t &&\n (\"function\" != typeof t &&\n (function () {\n throw new TypeError(\n \"You must pass a resolver function as the first argument to the promise constructor\"\n );\n })(),\n this instanceof M\n ? (function (e, t) {\n try {\n t(\n function (t) {\n T(e, t);\n },\n function (t) {\n R(e, t);\n }\n );\n } catch (t) {\n R(e, t);\n }\n })(this, t)\n : (function () {\n throw new TypeError(\n \"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\"\n );\n })());\n }\n return (\n (S.prototype.then = w),\n (S.all = function (t) {\n return new k(this, t).promise;\n }),\n (S.race = function (i) {\n var o = this;\n return n(i)\n ? new o(function (t, e) {\n for (\n var n = i.length, r = 0;\n r < n;\n r++\n )\n o.resolve(i[r]).then(t, e);\n })\n : new o(function (t, e) {\n return e(\n new TypeError(\n \"You must pass an array to race.\"\n )\n );\n });\n }),\n (S.resolve = y),\n (S.reject = function (t) {\n var e = new this(b);\n return R(e, t), e;\n }),\n (S._setScheduler = function (t) {\n i = t;\n }),\n (S._setAsap = function (t) {\n a = t;\n }),\n (S._asap = a),\n (S.polyfill = function () {\n var t = void 0;\n if (void 0 !== q) t = q;\n else if (\"undefined\" != typeof self)\n t = self;\n else\n try {\n t = Function(\"return this\")();\n } catch (t) {\n throw new Error(\n \"polyfill failed because global object is unavailable in this environment\"\n );\n }\n var e = t.Promise;\n if (e) {\n var n = null;\n try {\n n = Object.prototype.toString.call(\n e.resolve()\n );\n } catch (t) { }\n if (\"[object Promise]\" === n && !e.cast)\n return;\n }\n t.Promise = S;\n }),\n (S.Promise = S)\n );\n }),\n \"object\" == typeof r && void 0 !== n\n ? (n.exports = e())\n : \"function\" == typeof define && define.amd\n ? define(e)\n : (t.ES6Promise = e());\n }).call(\n this,\n Y(\"VCmEsw\"),\n \"undefined\" != typeof self\n ? self\n : \"undefined\" != typeof window\n ? window\n : {}\n );\n },\n { VCmEsw: 2 },\n ],\n 2: [\n function (t, e, n) {\n var r = (e.exports = {});\n function i() { }\n (r.nextTick = (function () {\n var t = \"undefined\" != typeof window && window.setImmediate,\n e =\n \"undefined\" != typeof window &&\n window.postMessage &&\n window.addEventListener;\n if (t)\n return function (t) {\n return window.setImmediate(t);\n };\n if (e) {\n var n = [];\n return (\n window.addEventListener(\n \"message\",\n function (t) {\n var e = t.source;\n (e !== window && null !== e) ||\n \"process-tick\" !== t.data ||\n (t.stopPropagation(),\n 0 < n.length && n.shift()());\n },\n !0\n ),\n function (t) {\n n.push(t),\n window.postMessage(\"process-tick\", \"*\");\n }\n );\n }\n return function (t) {\n setTimeout(t, 0);\n };\n })()),\n (r.title = \"browser\"),\n (r.browser = !0),\n (r.env = {}),\n (r.argv = []),\n (r.on = i),\n (r.addListener = i),\n (r.once = i),\n (r.off = i),\n (r.removeListener = i),\n (r.removeAllListeners = i),\n (r.emit = i),\n (r.binding = function (t) {\n throw new Error(\"process.binding is not supported\");\n }),\n (r.cwd = function () {\n return \"/\";\n }),\n (r.chdir = function (t) {\n throw new Error(\"process.chdir is not supported\");\n });\n },\n {},\n ],\n 3: [\n function (t, e, n) {\n \"use strict\";\n e.exports = function () {\n (this.width = 0),\n (this.height = 0),\n (this.numPlays = 0),\n (this.playTime = 0),\n (this.frames = []),\n (this.play = function () {\n s ||\n u ||\n (this.rewind(),\n (s = !0),\n requestAnimationFrame(e));\n }),\n (this.rewind = function () {\n (o = i = 0), (a = null), (u = s = !1);\n }),\n (this.addContext = function (t) {\n if (0 < c.length) {\n var e = c[0].getImageData(\n 0,\n 0,\n this.width,\n this.height\n );\n t.putImageData(e, 0, 0);\n }\n c.push(t), (t._apng_animation = this);\n }),\n (this.removeContext = function (t) {\n var e = c.indexOf(t);\n -1 !== e &&\n (c.splice(e, 1),\n 0 === c.length && this.rewind(),\n \"_apng_animation\" in t &&\n delete t._apng_animation);\n }),\n (this.isPlayed = function () {\n return s;\n }),\n (this.isFinished = function () {\n return u;\n });\n var r = this,\n i = 0,\n o = 0,\n a = null,\n s = !1,\n u = !1,\n c = [],\n e = function (t) {\n for (; s && i <= t;) n(t);\n s && requestAnimationFrame(e);\n },\n n = function (t) {\n var e = o++ % r.frames.length,\n n = r.frames[e];\n if (\n 0 == r.numPlays ||\n o / r.frames.length <= r.numPlays\n ) {\n for (\n 0 == e &&\n (c.forEach(function (t) {\n t.clearRect(\n 0,\n 0,\n r.width,\n r.height\n );\n }),\n (a = null),\n 2 == n.disposeOp && (n.disposeOp = 1)),\n a && 1 == a.disposeOp\n ? c.forEach(function (t) {\n t.clearRect(\n a.left,\n a.top,\n a.width,\n a.height\n );\n })\n : a &&\n 2 == a.disposeOp &&\n c.forEach(function (t) {\n t.putImageData(\n a.iData,\n a.left,\n a.top\n );\n }),\n (a = n).iData = null,\n 2 == a.disposeOp &&\n (a.iData = c[0].getImageData(\n n.left,\n n.top,\n n.width,\n n.height\n )),\n 0 == n.blendOp &&\n c.forEach(function (t) {\n t.clearRect(\n n.left,\n n.top,\n n.width,\n n.height\n );\n }),\n c.forEach(function (t) {\n t.drawImage(n.img, n.left, n.top);\n }),\n 0 == i && (i = t);\n t > i + r.playTime;\n\n )\n i += r.playTime;\n i += n.delay;\n } else u = !(s = !1);\n };\n };\n },\n {},\n ],\n 4: [\n function (t, e, n) {\n \"use strict\";\n for (var a = new Uint32Array(256), r = 0; r < 256; r++) {\n for (var i = r, o = 0; o < 8; o++)\n i = 1 & i ? 3988292384 ^ (i >>> 1) : i >>> 1;\n a[r] = i;\n }\n e.exports = function (t, e, n) {\n for (\n var r = -1,\n i = (e = e || 0),\n o = e + (n = n || t.length - e);\n i < o;\n i++\n )\n r = (r >>> 8) ^ a[255 & (r ^ t[i])];\n return -1 ^ r;\n };\n },\n {},\n ],\n 5: [\n function (a, t, e) {\n (function (t) {\n \"use strict\";\n var e = a(\"./support-test\"),\n n = a(\"./parser\"),\n r = a(\"./loader\"),\n i = (t.APNG = {});\n (i.checkNativeFeatures = e.checkNativeFeatures),\n (i.ifNeeded = e.ifNeeded),\n (i.parseBuffer = function (t) {\n return n(t);\n });\n var o = {};\n (i.parseURL = function (t) {\n return t in o || (o[t] = r(t).then(n)), o[t];\n }),\n (i.animateContext = function (t, e) {\n return i.parseURL(t).then(function (t) {\n return t.addContext(e), t.play(), t;\n });\n }),\n (i.animateImage = function (s) {\n return (\n s.setAttribute(\"data-is-apng\", \"progress\"),\n i.parseURL(s.src).then(\n function (t) {\n s.setAttribute(\"data-is-apng\", \"yes\");\n var e =\n document.createElement(\"canvas\");\n (e.width = t.width),\n (e.height = t.height),\n Array.prototype.slice\n .call(s.attributes)\n .forEach(function (t) {\n -1 ==\n [\n \"alt\",\n \"src\",\n \"usemap\",\n \"ismap\",\n \"data-is-apng\",\n \"width\",\n \"height\",\n ].indexOf(t.nodeName) &&\n e.setAttributeNode(\n t.cloneNode(!1)\n );\n }),\n e.setAttribute(\n \"data-apng-src\",\n s.src\n ),\n \"\" != s.alt &&\n e.appendChild(\n document.createTextNode(\n s.alt\n )\n );\n var n = \"\",\n r = \"\",\n i = 0,\n o = \"\";\n \"\" != s.style.width &&\n \"auto\" != s.style.width\n ? (n = s.style.width)\n : s.hasAttribute(\"width\") &&\n (n =\n s.getAttribute(\"width\") +\n \"px\"),\n \"\" != s.style.height &&\n \"auto\" != s.style.height\n ? (r = s.style.height)\n : s.hasAttribute(\"height\") &&\n (r =\n s.getAttribute(\"height\") +\n \"px\"),\n \"\" != n &&\n \"\" == r &&\n ((i = parseFloat(n)),\n (o = n.match(/\\D+$/)[0]),\n (r =\n Math.round(\n (e.height * i) / e.width\n ) + o)),\n \"\" != r &&\n \"\" == n &&\n ((i = parseFloat(r)),\n (o = r.match(/\\D+$/)[0]),\n (n =\n Math.round(\n (e.width * i) / e.height\n ) + o)),\n (e.style.width = n),\n (e.style.height = r);\n var a = s.parentNode;\n a.insertBefore(e, s),\n a.removeChild(s),\n t.addContext(e.getContext(\"2d\")),\n t.play();\n },\n function () {\n s.setAttribute(\"data-is-apng\", \"no\");\n }\n )\n );\n }),\n (i.releaseCanvas = function (t) {\n var e = t.getContext(\"2d\");\n \"_apng_animation\" in e &&\n e._apng_animation.removeContext(e);\n });\n }).call(\n this,\n \"undefined\" != typeof self\n ? self\n : \"undefined\" != typeof window\n ? window\n : {}\n );\n },\n { \"./loader\": 6, \"./parser\": 7, \"./support-test\": 8 },\n ],\n 6: [\n function (t, e, n) {\n \"use strict\";\n var i = i || t(\"es6-promise\").Promise;\n e.exports = function (r) {\n return new i(function (t, e) {\n var n = new XMLHttpRequest();\n n.open(\"GET\", r),\n (n.responseType = \"arraybuffer\"),\n (n.onload = function () {\n 200 == this.status ? t(this.response) : e(this);\n }),\n n.send();\n });\n };\n },\n { \"es6-promise\": 1 },\n ],\n 7: [\n function (t, e, n) {\n \"use strict\";\n var r = r || t(\"es6-promise\").Promise,\n m = t(\"./animation\"),\n o = t(\"./crc32\"),\n g = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]);\n e.exports = function (t) {\n var A = new Uint8Array(t);\n return new r(function (t, e) {\n for (var n = 0; n < g.length; n++)\n if (g[n] != A[n])\n return void e(\n \"Not a PNG file (invalid file signature)\"\n );\n var r = !1;\n if (\n (w(A, function (t) {\n return \"acTL\" != t || !(r = !0);\n }),\n r)\n ) {\n var a = [],\n s = [],\n u = null,\n c = null,\n f = new m();\n if (\n (w(A, function (t, e, n, r) {\n switch (t) {\n case \"IHDR\":\n (u = e.subarray(n + 8, n + 8 + r)),\n (f.width = y(e, n + 8)),\n (f.height = y(e, n + 12));\n break;\n case \"acTL\":\n f.numPlays = y(e, n + 8 + 4);\n break;\n case \"fcTL\":\n c && f.frames.push(c),\n ((c = {}).width = y(\n e,\n n + 8 + 4\n )),\n (c.height = y(e, n + 8 + 8)),\n (c.left = y(e, n + 8 + 12)),\n (c.top = y(e, n + 8 + 16));\n var i = _(e, n + 8 + 20),\n o = _(e, n + 8 + 22);\n 0 == o && (o = 100),\n (c.delay = (1e3 * i) / o),\n c.delay <= 10 &&\n (c.delay = 100),\n (f.playTime += c.delay),\n (c.disposeOp = b(\n e,\n n + 8 + 24\n )),\n (c.blendOp = b(e, n + 8 + 25)),\n (c.dataParts = []);\n break;\n case \"fdAT\":\n c &&\n c.dataParts.push(\n e.subarray(\n n + 8 + 4,\n n + 8 + r\n )\n );\n break;\n case \"IDAT\":\n c &&\n c.dataParts.push(\n e.subarray(n + 8, n + 8 + r)\n );\n break;\n case \"IEND\":\n s.push(E(e, n, 12 + r));\n break;\n default:\n a.push(E(e, n, 12 + r));\n }\n }),\n c && f.frames.push(c),\n 0 != f.frames.length)\n )\n for (\n var i = 0,\n o = new Blob(a),\n h = new Blob(s),\n l = 0;\n l < f.frames.length;\n l++\n ) {\n c = f.frames[l];\n var d = [];\n d.push(g),\n u.set(P(c.width), 0),\n u.set(P(c.height), 4),\n d.push(x(\"IHDR\", u)),\n d.push(o);\n for (var p = 0; p < c.dataParts.length; p++)\n d.push(x(\"IDAT\", c.dataParts[p]));\n d.push(h);\n var v = URL.createObjectURL(\n new Blob(d, { type: \"image/png\" })\n );\n delete c.dataParts,\n (d = null),\n (c.img = document.createElement(\"img\")),\n (c.img.onload = function () {\n URL.revokeObjectURL(this.src),\n ++i == f.frames.length && t(f);\n }),\n (c.img.onerror = function () {\n e(\"Image creation error\");\n }),\n (c.img.src = v);\n }\n else e(\"Not an animated PNG\");\n } else e(\"Not an animated PNG\");\n });\n };\n var w = function (t, e) {\n var n = 8;\n do {\n var r = y(t, n),\n i = a(t, n + 4, 4),\n o = e(i, t, n, r);\n n += 12 + r;\n } while (!1 !== o && \"IEND\" != i && n < t.length);\n },\n y = function (t, e) {\n var n = 0;\n n += (t[0 + e] << 24) >>> 0;\n for (var r = 1; r < 4; r++)\n n += t[r + e] << (8 * (3 - r));\n return n;\n },\n _ = function (t, e) {\n for (var n = 0, r = 0; r < 2; r++)\n n += t[r + e] << (8 * (1 - r));\n return n;\n },\n b = function (t, e) {\n return t[e];\n },\n E = function (t, e, n) {\n var r = new Uint8Array(n);\n return r.set(t.subarray(e, e + n)), r;\n },\n a = function (t, e, n) {\n var r = Array.prototype.slice.call(\n t.subarray(e, e + n)\n );\n return String.fromCharCode.apply(String, r);\n },\n P = function (t) {\n return [\n (t >>> 24) & 255,\n (t >>> 16) & 255,\n (t >>> 8) & 255,\n 255 & t,\n ];\n },\n x = function (t, e) {\n var n = t.length + e.length,\n r = new Uint8Array(new ArrayBuffer(n + 8));\n r.set(P(e.length), 0),\n r.set(\n (function (t) {\n for (var e = [], n = 0; n < t.length; n++)\n e.push(t.charCodeAt(n));\n return e;\n })(t),\n 4\n ),\n r.set(e, 8);\n var i = o(r, 4, n);\n return r.set(P(i), n + 4), r;\n };\n },\n { \"./animation\": 3, \"./crc32\": 4, \"es6-promise\": 1 },\n ],\n 8: [\n function (o, a, t) {\n (function (t) {\n \"use strict\";\n var e,\n n,\n r = r || o(\"es6-promise\").Promise,\n i =\n ((e = function (e) {\n var n = document.createElement(\"canvas\"),\n r = {\n TypedArrays: \"ArrayBuffer\" in t,\n BlobURLs: \"URL\" in t,\n requestAnimationFrame:\n \"requestAnimationFrame\" in t,\n pageProtocol:\n \"http:\" == location.protocol ||\n \"https:\" == location.protocol,\n canvas:\n \"getContext\" in\n document.createElement(\"canvas\"),\n APNG: !1,\n };\n if (r.canvas) {\n var i = new Image();\n (i.onload = function () {\n var t = n.getContext(\"2d\");\n t.drawImage(i, 0, 0),\n (r.APNG =\n 0 ===\n t.getImageData(0, 0, 1, 1)\n .data[3]),\n e(r);\n }),\n (i.src =\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACGFjVEwAAAABAAAAAcMq2TYAAAANSURBVAiZY2BgYPgPAAEEAQB9ssjfAAAAGmZjVEwAAAAAAAAAAQAAAAEAAAAAAAAAAAD6A+gBAbNU+2sAAAARZmRBVAAAAAEImWNgYGBgAAAABQAB6MzFdgAAAABJRU5ErkJggg==\");\n } else e(r);\n }),\n (n = null),\n function (t) {\n return (n = n || new r(e)), t && n.then(t), n;\n });\n a.exports = {\n checkNativeFeatures: i,\n ifNeeded: function (r) {\n return (\n void 0 === r && (r = !1),\n i().then(function (t) {\n if (t.APNG && !r) reject();\n else {\n var e = !0;\n for (var n in t)\n t.hasOwnProperty(n) &&\n \"APNG\" != n &&\n (e = e && t[n]);\n }\n })\n );\n },\n };\n }).call(\n this,\n \"undefined\" != typeof self\n ? self\n : \"undefined\" != typeof window\n ? window\n : {}\n );\n },\n { \"es6-promise\": 1 },\n ],\n },\n {},\n [5]\n);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { makeLazy } from \"./lazy\";\nimport { EXTENSION_BASE_URL } from \"./web-metadata\";\n\n/*\n Add dynamically loaded dependencies for plugins here.\n */\n\n// needed to parse APNGs in the nitroBypass plugin\nexport const importApngJs = makeLazy(() => {\n return require(\"./apng-canvas\").APNG as { parseURL(url: string): Promise; };\n});\n\n// https://wiki.mozilla.org/APNG_Specification#.60fcTL.60:_The_Frame_Control_Chunk\nexport const enum ApngDisposeOp {\n /**\n * no disposal is done on this frame before rendering the next; the contents of the output buffer are left as is.\n */\n NONE,\n /**\n * the frame's region of the output buffer is to be cleared to fully transparent black before rendering the next frame.\n */\n BACKGROUND,\n /**\n * the frame's region of the output buffer is to be reverted to the previous contents before rendering the next frame.\n */\n PREVIOUS\n}\n\n// TODO: Might need to somehow implement this\nexport const enum ApngBlendOp {\n SOURCE,\n OVER\n}\nexport interface ApngFrame {\n left: number;\n top: number;\n width: number;\n height: number;\n img: HTMLImageElement;\n delay: number;\n blendOp: ApngBlendOp;\n disposeOp: ApngDisposeOp;\n}\n\nexport interface ApngFrameData {\n width: number;\n height: number;\n frames: ApngFrame[];\n playTime: number;\n}\n\n// On web (extensions), use extension uri as basepath (load files from extension)\n// On desktop (electron), load from cdn\nexport const rnnoiseDist = IS_EXTENSION\n ? new URL(\"/third-party/rnnoise\", EXTENSION_BASE_URL).toString()\n : \"https://unpkg.com/@sapphi-red/web-noise-suppressor@0.3.3/dist\";\nexport const rnnoiseWasmSrc = (simd = false) => `${rnnoiseDist}/rnnoise${simd ? \"_simd\" : \"\"}.wasm`;\nexport const rnnoiseWorkletSrc = `${rnnoiseDist}/rnnoise/workletProcessor.js`;\n\n\n// The below code is only used on the Desktop (electron) build of Vencord.\n// Browser (extension) builds do not contain these remote imports.\n\nexport const shikiWorkerSrc = `https://unpkg.com/@vap/shiki-worker@0.0.8/dist/${IS_DEV ? \"index.js\" : \"index.min.js\"}`;\nexport const shikiOnigasmSrc = \"https://unpkg.com/@vap/shiki@0.10.3/dist/onig.wasm\";\n\n// @ts-expect-error\nexport const getStegCloak = /* #__PURE__*/ makeLazy(() => import(\"https://unpkg.com/stegcloak-dist@1.0.0/index.js\"));\n", "import constants from \"./constants.js\";\nimport lzwEncode from \"./lzwEncode.js\";\nimport createStream from \"./stream.js\";\nimport quantize from \"./pnnquant2.js\";\n\nimport {\n prequantize,\n applyPalette,\n nearestColorIndex,\n nearestColor,\n nearestColorIndexWithDistance,\n snapColorsToPalette,\n} from \"./palettize.js\";\n\nfunction GIFEncoder(opt = {}) {\n const { initialCapacity = 4096, auto = true } = opt;\n\n // Stream all encoded data into this buffer\n const stream = createStream(initialCapacity);\n\n // Shared array data across all frames\n const HSIZE = 5003; // 80% occupancy\n const accum = new Uint8Array(256);\n const htab = new Int32Array(HSIZE);\n const codetab = new Int32Array(HSIZE);\n\n let hasInit = false;\n\n return {\n reset() {\n stream.reset();\n hasInit = false;\n },\n finish() {\n stream.writeByte(constants.trailer);\n },\n bytes() {\n return stream.bytes();\n },\n bytesView() {\n return stream.bytesView();\n },\n get buffer() {\n return stream.buffer;\n },\n get stream() {\n return stream;\n },\n writeHeader,\n writeFrame(index, width, height, opts = {}) {\n const {\n transparent = false,\n transparentIndex = 0x00,\n delay = 0,\n palette = null,\n repeat = 0, // -1=once, 0=forever, >0=count\n colorDepth = 8,\n dispose = -1,\n } = opts;\n\n let first = false;\n if (auto) {\n // In 'auto' mode, the first time we write a frame\n // we will write LSD/GCT/EXT\n if (!hasInit) {\n // have not yet init, we can consider this our first frame\n first = true;\n // in 'auto' mode, we also encode a header on first frame\n // this is different than manual mode where you must encode\n // header yoursef (or perhaps not write header altogether)\n writeHeader();\n hasInit = true;\n }\n } else {\n // in manual mode, the first frame is determined by the options only\n first = Boolean(opts.first);\n }\n\n width = Math.max(0, Math.floor(width));\n height = Math.max(0, Math.floor(height));\n\n // Write pre-frame details such as repeat count and global palette\n if (first) {\n if (!palette) {\n throw new Error(\"First frame must include a { palette } option\");\n }\n encodeLogicalScreenDescriptor(\n stream,\n width,\n height,\n palette,\n colorDepth\n );\n encodeColorTable(stream, palette);\n if (repeat >= 0) {\n encodeNetscapeExt(stream, repeat);\n }\n }\n\n const delayTime = Math.round(delay / 10);\n encodeGraphicControlExt(\n stream,\n dispose,\n delayTime,\n transparent,\n transparentIndex\n );\n\n const useLocalColorTable = Boolean(palette) && !first;\n encodeImageDescriptor(\n stream,\n width,\n height,\n useLocalColorTable ? palette : null\n );\n if (useLocalColorTable) encodeColorTable(stream, palette);\n encodePixels(\n stream,\n index,\n width,\n height,\n colorDepth,\n accum,\n htab,\n codetab\n );\n },\n };\n\n function writeHeader() {\n writeUTFBytes(stream, \"GIF89a\");\n }\n}\n\nfunction encodeGraphicControlExt(\n stream,\n dispose,\n delay,\n transparent,\n transparentIndex\n) {\n stream.writeByte(0x21); // extension introducer\n stream.writeByte(0xf9); // GCE label\n stream.writeByte(4); // data block size\n\n if (transparentIndex < 0) {\n transparentIndex = 0x00;\n transparent = false;\n }\n\n var transp, disp;\n if (!transparent) {\n transp = 0;\n disp = 0; // dispose = no action\n } else {\n transp = 1;\n disp = 2; // force clear if using transparent color\n }\n\n if (dispose >= 0) {\n disp = dispose & 7; // user override\n }\n\n disp <<= 2;\n\n const userInput = 0;\n\n // packed fields\n stream.writeByte(\n 0 | // 1:3 reserved\n disp | // 4:6 disposal\n userInput | // 7 user input - 0 = none\n transp // 8 transparency flag\n );\n\n writeUInt16(stream, delay); // delay x 1/100 sec\n stream.writeByte(transparentIndex || 0x00); // transparent color index\n stream.writeByte(0); // block terminator\n}\n\nfunction encodeLogicalScreenDescriptor(\n stream,\n width,\n height,\n palette,\n colorDepth = 8\n) {\n const globalColorTableFlag = 1;\n const sortFlag = 0;\n const globalColorTableSize = colorTableSize(palette.length) - 1;\n const fields =\n (globalColorTableFlag << 7) |\n ((colorDepth - 1) << 4) |\n (sortFlag << 3) |\n globalColorTableSize;\n const backgroundColorIndex = 0;\n const pixelAspectRatio = 0;\n writeUInt16(stream, width);\n writeUInt16(stream, height);\n stream.writeBytes([fields, backgroundColorIndex, pixelAspectRatio]);\n}\n\nfunction encodeNetscapeExt(stream, repeat) {\n stream.writeByte(0x21); // extension introducer\n stream.writeByte(0xff); // app extension label\n stream.writeByte(11); // block size\n writeUTFBytes(stream, \"NETSCAPE2.0\"); // app id + auth code\n stream.writeByte(3); // sub-block size\n stream.writeByte(1); // loop sub-block id\n writeUInt16(stream, repeat); // loop count (extra iterations, 0=repeat forever)\n stream.writeByte(0); // block terminator\n}\n\nfunction encodeColorTable(stream, palette) {\n const colorTableLength = 1 << colorTableSize(palette.length);\n for (let i = 0; i < colorTableLength; i++) {\n let color = [0, 0, 0];\n if (i < palette.length) {\n color = palette[i];\n }\n stream.writeByte(color[0]);\n stream.writeByte(color[1]);\n stream.writeByte(color[2]);\n }\n}\n\nfunction encodeImageDescriptor(stream, width, height, localPalette) {\n stream.writeByte(0x2c); // image separator\n\n writeUInt16(stream, 0); // x position\n writeUInt16(stream, 0); // y position\n writeUInt16(stream, width); // image size\n writeUInt16(stream, height);\n\n if (localPalette) {\n const interlace = 0;\n const sorted = 0;\n const palSize = colorTableSize(localPalette.length) - 1;\n // local palette\n stream.writeByte(\n 0x80 | // 1 local color table 1=yes\n interlace | // 2 interlace - 0=no\n sorted | // 3 sorted - 0=no\n 0 | // 4-5 reserved\n palSize // 6-8 size of color table\n );\n } else {\n // global palette\n stream.writeByte(0);\n }\n}\n\nfunction encodePixels(\n stream,\n index,\n width,\n height,\n colorDepth = 8,\n accum,\n htab,\n codetab\n) {\n lzwEncode(width, height, index, colorDepth, stream, accum, htab, codetab);\n}\n\n// Utilities\n\nfunction writeUInt16(stream, short) {\n stream.writeByte(short & 0xff);\n stream.writeByte((short >> 8) & 0xff);\n}\n\nfunction writeUTFBytes(stream, text) {\n for (var i = 0; i < text.length; i++) {\n stream.writeByte(text.charCodeAt(i));\n }\n}\n\nfunction colorTableSize(length) {\n return Math.max(Math.ceil(Math.log2(length)), 1);\n}\n\nexport {\n GIFEncoder,\n quantize,\n prequantize,\n applyPalette,\n nearestColorIndex,\n nearestColor,\n nearestColorIndexWithDistance,\n snapColorsToPalette,\n};\n\nexport default GIFEncoder;\n", "export default {\n signature: \"GIF\",\n version: \"89a\",\n trailer: 0x3B,\n extensionIntroducer: 0x21,\n applicationExtensionLabel: 0xFF,\n graphicControlExtensionLabel: 0xF9,\n imageSeparator: 0x2C,\n // Header\n signatureSize: 3,\n versionSize: 3,\n globalColorTableFlagMask: 0b10000000,\n colorResolutionMask: 0b01110000,\n sortFlagMask: 0b00001000,\n globalColorTableSizeMask: 0b00000111,\n // Application extension\n applicationIdentifierSize: 8,\n applicationAuthCodeSize: 3,\n // Graphic control extension\n disposalMethodMask: 0b00011100,\n userInputFlagMask: 0b00000010,\n transparentColorFlagMask: 0b00000001,\n // Image descriptor\n localColorTableFlagMask: 0b10000000,\n interlaceFlagMask: 0b01000000,\n idSortFlagMask: 0b00100000,\n localColorTableSizeMask: 0b00000111\n}\n", "export default function createStream(initialCapacity = 256) {\n let cursor = 0;\n let contents = new Uint8Array(initialCapacity);\n\n return {\n get buffer() {\n return contents.buffer;\n },\n reset() {\n cursor = 0;\n },\n bytesView() {\n return contents.subarray(0, cursor);\n },\n bytes() {\n return contents.slice(0, cursor);\n },\n writeByte(byte) {\n expand(cursor + 1);\n contents[cursor] = byte;\n cursor++;\n },\n writeBytes(data, offset = 0, byteLength = data.length) {\n expand(cursor + byteLength);\n for (let i = 0; i < byteLength; i++) {\n contents[cursor++] = data[i + offset];\n }\n },\n writeBytesView(data, offset = 0, byteLength = data.byteLength) {\n expand(cursor + byteLength);\n contents.set(data.subarray(offset, offset + byteLength), cursor);\n cursor += byteLength;\n },\n };\n\n function expand(newCapacity) {\n var prevCapacity = contents.length;\n if (prevCapacity >= newCapacity) return; // No need to expand, the storage was already large enough.\n // Don't expand strictly to the given requested limit if it's only a very small increase, but instead geometrically grow capacity.\n // For small filesizes (<1MB), perform size*2 geometric increase, but for large sizes, do a much more conservative size*1.125 increase to\n // avoid overshooting the allocation cap by a very large margin.\n var CAPACITY_DOUBLING_MAX = 1024 * 1024;\n newCapacity = Math.max(\n newCapacity,\n (prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2.0 : 1.125)) >>>\n 0\n );\n if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256); // At minimum allocate 256b for each file when expanding.\n const oldContents = contents;\n contents = new Uint8Array(newCapacity); // Allocate new storage.\n if (cursor > 0) contents.set(oldContents.subarray(0, cursor), 0);\n }\n}\n", "/*\n LZWEncoder.js\n Authors\n Kevin Weiner (original Java version - kweiner@fmsware.com)\n Thibault Imbert (AS3 version - bytearray.org)\n Johan Nordberg (JS version - code@johan-nordberg.com)\n Acknowledgements\n GIFCOMPR.C - GIF Image compression routines\n Lempel-Ziv compression based on 'compress'. GIF modifications by\n David Rowley (mgardi@watdcsu.waterloo.edu)\n GIF Image compression - modified 'compress'\n Based on: compress.c - File compression ala IEEE Computer, June 1984.\n By Authors: Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas)\n Jim McKie (decvax!mcvax!jim)\n Steve Davies (decvax!vax135!petsd!peora!srd)\n Ken Turkowski (decvax!decwrl!turtlevax!ken)\n James A. Woods (decvax!ihnp4!ames!jaw)\n Joe Orost (decvax!vax135!petsd!joe)\n Matt DesLauriers (@mattdesl - V8/JS optimizations)\n Mathieu Henri (@p01 - JS optimization)\n*/\n\nimport createStream from \"./stream.js\";\n\nconst EOF = -1;\nconst BITS = 12;\nconst DEFAULT_HSIZE = 5003; // 80% occupancy\nconst MASKS = [\n 0x0000,\n 0x0001,\n 0x0003,\n 0x0007,\n 0x000f,\n 0x001f,\n 0x003f,\n 0x007f,\n 0x00ff,\n 0x01ff,\n 0x03ff,\n 0x07ff,\n 0x0fff,\n 0x1fff,\n 0x3fff,\n 0x7fff,\n 0xffff,\n];\n\nfunction lzwEncode(\n width,\n height,\n pixels,\n colorDepth,\n outStream = createStream(512),\n accum = new Uint8Array(256),\n htab = new Int32Array(DEFAULT_HSIZE),\n codetab = new Int32Array(DEFAULT_HSIZE)\n) {\n const hsize = htab.length;\n const initCodeSize = Math.max(2, colorDepth);\n\n accum.fill(0);\n codetab.fill(0);\n htab.fill(-1);\n\n let cur_accum = 0;\n let cur_bits = 0;\n\n // Algorithm: use open addressing double hashing (no chaining) on the\n // prefix code / next character combination. We do a variant of Knuth's\n // algorithm D (vol. 3, sec. 6.4) along with G. Knott's relatively-prime\n // secondary probe. Here, the modular division first probe is gives way\n // to a faster exclusive-or manipulation. Also do block compression with\n // an adaptive reset, whereby the code table is cleared when the compression\n // ratio decreases, but after the table fills. The variable-length output\n // codes are re-sized at this point, and a special CLEAR code is generated\n // for the decompressor. Late addition: construct the table according to\n // file size for noticeable speed improvement on small files. Please direct\n // questions about this implementation to ames!jaw.\n\n // compress and write the pixel data\n const init_bits = initCodeSize + 1;\n\n // Set up the globals: g_init_bits - initial number of bits\n const g_init_bits = init_bits;\n\n // Set up the necessary values\n\n // block compression parameters -- after all codes are used up,\n // and compression rate changes, start over.\n let clear_flg = false;\n let n_bits = g_init_bits;\n let maxcode = (1 << n_bits) - 1;\n\n const ClearCode = 1 << (init_bits - 1);\n const EOFCode = ClearCode + 1;\n let free_ent = ClearCode + 2;\n let a_count = 0; // clear packet\n\n let ent = pixels[0];\n\n let hshift = 0;\n for (let fcode = hsize; fcode < 65536; fcode *= 2) {\n ++hshift;\n }\n hshift = 8 - hshift; // set hash code range bound\n\n outStream.writeByte(initCodeSize); // write \"initial code size\" byte\n\n output(ClearCode);\n\n const length = pixels.length;\n for (let idx = 1; idx < length; idx++) {\n next_block: {\n const c = pixels[idx];\n const fcode = (c << BITS) + ent;\n let i = (c << hshift) ^ ent; // xor hashing\n if (htab[i] === fcode) {\n ent = codetab[i];\n break next_block;\n }\n\n const disp = i === 0 ? 1 : hsize - i; // secondary hash (after G. Knott)\n while (htab[i] >= 0) {\n // non-empty slot\n i -= disp;\n if (i < 0) i += hsize;\n if (htab[i] === fcode) {\n ent = codetab[i];\n break next_block;\n }\n }\n output(ent);\n ent = c;\n if (free_ent < 1 << BITS) {\n codetab[i] = free_ent++; // code -> hashtable\n htab[i] = fcode;\n } else {\n // Clear out the hash table\n // table clear for block compress\n htab.fill(-1);\n free_ent = ClearCode + 2;\n clear_flg = true;\n output(ClearCode);\n }\n }\n }\n\n // Put out the final code.\n output(ent);\n output(EOFCode);\n\n outStream.writeByte(0); // write block terminator\n return outStream.bytesView();\n\n function output(code) {\n cur_accum &= MASKS[cur_bits];\n\n if (cur_bits > 0) cur_accum |= code << cur_bits;\n else cur_accum = code;\n\n cur_bits += n_bits;\n\n while (cur_bits >= 8) {\n // Add a character to the end of the current packet, and if it is 254\n // characters, flush the packet to disk.\n accum[a_count++] = cur_accum & 0xff;\n if (a_count >= 254) {\n outStream.writeByte(a_count);\n outStream.writeBytesView(accum, 0, a_count);\n a_count = 0;\n }\n cur_accum >>= 8;\n cur_bits -= 8;\n }\n\n // If the next entry is going to be too big for the code size,\n // then increase it, if possible.\n if (free_ent > maxcode || clear_flg) {\n if (clear_flg) {\n n_bits = g_init_bits;\n maxcode = (1 << n_bits) - 1;\n clear_flg = false;\n } else {\n ++n_bits;\n maxcode = n_bits === BITS ? (1 << n_bits) : (1 << n_bits) - 1;\n }\n }\n\n if (code == EOFCode) {\n // At EOF, write the rest of the buffer.\n while (cur_bits > 0) {\n // Add a character to the end of the current packet, and if it is 254\n // characters, flush the packet to disk.\n accum[a_count++] = cur_accum & 0xff;\n if (a_count >= 254) {\n outStream.writeByte(a_count);\n outStream.writeBytesView(accum, 0, a_count);\n a_count = 0;\n }\n cur_accum >>= 8;\n cur_bits -= 8;\n }\n // Flush the packet to disk, and reset the accumulator\n if (a_count > 0) {\n outStream.writeByte(a_count);\n outStream.writeBytesView(accum, 0, a_count);\n a_count = 0;\n }\n }\n }\n}\n\nexport default lzwEncode;\n", "export function uint32_to_rgba(color) {\n var a = (color >> 24) & 0xff;\n var b = (color >> 16) & 0xff;\n var g = (color >> 8) & 0xff;\n var r = color & 0xff;\n return [r, g, b, a];\n}\n\nexport function rgba_to_uint32(r, g, b, a) {\n return (a << 24) | (b << 16) | (g << 8) | r;\n}\n\nexport function rgb888_to_rgb565(r, g, b) {\n return ((r << 8) & 0xf800) | ((g << 2) & 0x03e0) | (b >> 3);\n}\n\nexport function rgba8888_to_rgba4444(r, g, b, a) {\n return (r >> 4) | (g & 0xf0) | ((b & 0xf0) << 4) | ((a & 0xf0) << 8);\n}\n\nexport function rgb888_to_rgb444(r, g, b) {\n return ((r >> 4) << 8) | (g & 0xf0) | (b >> 4);\n}\n\n// Alternative 565 ?\n// return ((r & 0xf8) << 8) + ((g & 0xfc) << 3) + (b >> 3);\n\n// Alternative 4444 ?\n// ((a & 0xf0) << 8) | ((r & 0xf0) << 4) | (g & 0xf0) | (b >> 4);\n", "// Modified from:\n// https://github.com/mcychan/PnnQuant.js/blob/master/src/pnnquant.js\n\n/* Fast pairwise nearest neighbor based algorithm for multilevel thresholding\nCopyright (C) 2004-2019 Mark Tyler and Dmitry Groshev\nCopyright (c) 2018-2021 Miller Cy Chan\n* error measure; time used is proportional to number of bins squared - WJ */\n\nimport {\n rgb888_to_rgb565,\n rgb888_to_rgb444,\n rgba8888_to_rgba4444,\n} from \"./rgb-packing.js\";\n\nfunction clamp(value, min, max) {\n return value < min ? min : value > max ? max : value;\n}\n\nfunction sqr(value) {\n return value * value;\n}\n\nfunction find_nn(bins, idx, hasAlpha) {\n var nn = 0;\n var err = 1e100;\n\n const bin1 = bins[idx];\n const n1 = bin1.cnt;\n const wa = bin1.ac;\n const wr = bin1.rc;\n const wg = bin1.gc;\n const wb = bin1.bc;\n for (var i = bin1.fw; i != 0; i = bins[i].fw) {\n const bin = bins[i];\n const n2 = bin.cnt;\n const nerr2 = (n1 * n2) / (n1 + n2);\n if (nerr2 >= err) continue;\n\n var nerr = 0;\n if (hasAlpha) {\n nerr += nerr2 * sqr(bin.ac - wa);\n if (nerr >= err) continue;\n }\n\n nerr += nerr2 * sqr(bin.rc - wr);\n if (nerr >= err) continue;\n\n nerr += nerr2 * sqr(bin.gc - wg);\n if (nerr >= err) continue;\n\n nerr += nerr2 * sqr(bin.bc - wb);\n if (nerr >= err) continue;\n err = nerr;\n nn = i;\n }\n bin1.err = err;\n bin1.nn = nn;\n}\n\nfunction create_bin() {\n return {\n ac: 0,\n rc: 0,\n gc: 0,\n bc: 0,\n cnt: 0,\n nn: 0,\n fw: 0,\n bk: 0,\n tm: 0,\n mtm: 0,\n err: 0,\n };\n}\n\nfunction bin_add_rgb(bin, r, g, b) {\n bin.rc += r;\n bin.gc += g;\n bin.bc += b;\n bin.cnt++;\n}\n\nfunction create_bin_list(data, format) {\n const bincount = format === \"rgb444\" ? 4096 : 65536;\n const bins = new Array(bincount);\n const size = data.length;\n\n /* Build histogram */\n // Note: Instead of introducing branching/conditions\n // within a very hot per-pixel iteration, we just duplicate the code\n // for each new condition\n if (format === \"rgba4444\") {\n for (let i = 0; i < size; ++i) {\n const color = data[i];\n const a = (color >> 24) & 0xff;\n const b = (color >> 16) & 0xff;\n const g = (color >> 8) & 0xff;\n const r = color & 0xff;\n\n // reduce to rgb4444 16-bit uint\n const index = rgba8888_to_rgba4444(r, g, b, a);\n let bin = index in bins ? bins[index] : (bins[index] = create_bin());\n bin.rc += r;\n bin.gc += g;\n bin.bc += b;\n bin.ac += a;\n bin.cnt++;\n }\n }\n \n else if (format === \"rgb444\") {\n for (let i = 0; i < size; ++i) {\n const color = data[i];\n const b = (color >> 16) & 0xff;\n const g = (color >> 8) & 0xff;\n const r = color & 0xff;\n\n // reduce to rgb444 12-bit uint\n const index = rgb888_to_rgb444(r, g, b);\n let bin = index in bins ? bins[index] : (bins[index] = create_bin());\n bin.rc += r;\n bin.gc += g;\n bin.bc += b;\n bin.cnt++;\n }\n } else {\n for (let i = 0; i < size; ++i) {\n const color = data[i];\n const b = (color >> 16) & 0xff;\n const g = (color >> 8) & 0xff;\n const r = color & 0xff;\n\n // reduce to rgb565 16-bit uint\n const index = rgb888_to_rgb565(r, g, b);\n let bin = index in bins ? bins[index] : (bins[index] = create_bin());\n bin.rc += r;\n bin.gc += g;\n bin.bc += b;\n bin.cnt++;\n }\n }\n return bins;\n}\n\nexport default function quantize(rgba, maxColors, opts = {}) {\n const {\n format = \"rgb565\",\n clearAlpha = true,\n clearAlphaColor = 0x00,\n clearAlphaThreshold = 0,\n oneBitAlpha = false,\n } = opts;\n\n if (!rgba || !rgba.buffer) {\n throw new Error('quantize() expected RGBA Uint8Array data');\n }\n if (!(rgba instanceof Uint8Array) && !(rgba instanceof Uint8ClampedArray)) {\n throw new Error('quantize() expected RGBA Uint8Array data');\n }\n \n const data = new Uint32Array(rgba.buffer);\n\n let useSqrt = opts.useSqrt !== false;\n\n // format can be:\n // rgb565 (default)\n // rgb444\n // rgba4444\n\n const hasAlpha = format === \"rgba4444\";\n const bins = create_bin_list(data, format);\n const bincount = bins.length;\n const bincountMinusOne = bincount - 1;\n const heap = new Uint32Array(bincount + 1);\n\n /* Cluster nonempty bins at one end of array */\n var maxbins = 0;\n for (var i = 0; i < bincount; ++i) {\n const bin = bins[i];\n if (bin != null) {\n var d = 1.0 / bin.cnt;\n if (hasAlpha) bin.ac *= d;\n bin.rc *= d;\n bin.gc *= d;\n bin.bc *= d;\n bins[maxbins++] = bin;\n }\n }\n\n if (sqr(maxColors) / maxbins < 0.022) {\n useSqrt = false;\n }\n\n var i = 0;\n for (; i < maxbins - 1; ++i) {\n bins[i].fw = i + 1;\n bins[i + 1].bk = i;\n if (useSqrt) bins[i].cnt = Math.sqrt(bins[i].cnt);\n }\n if (useSqrt) bins[i].cnt = Math.sqrt(bins[i].cnt);\n\n var h, l, l2;\n /* Initialize nearest neighbors and build heap of them */\n for (i = 0; i < maxbins; ++i) {\n find_nn(bins, i, false);\n /* Push slot on heap */\n var err = bins[i].err;\n for (l = ++heap[0]; l > 1; l = l2) {\n l2 = l >> 1;\n if (bins[(h = heap[l2])].err <= err) break;\n heap[l] = h;\n }\n heap[l] = i;\n }\n\n /* Merge bins which increase error the least */\n var extbins = maxbins - maxColors;\n for (i = 0; i < extbins; ) {\n var tb;\n /* Use heap to find which bins to merge */\n for (;;) {\n var b1 = heap[1];\n tb = bins[b1]; /* One with least error */\n /* Is stored error up to date? */\n if (tb.tm >= tb.mtm && bins[tb.nn].mtm <= tb.tm) break;\n if (tb.mtm == bincountMinusOne)\n /* Deleted node */ b1 = heap[1] = heap[heap[0]--];\n /* Too old error value */ else {\n find_nn(bins, b1, false);\n tb.tm = i;\n }\n /* Push slot down */\n var err = bins[b1].err;\n for (l = 1; (l2 = l + l) <= heap[0]; l = l2) {\n if (l2 < heap[0] && bins[heap[l2]].err > bins[heap[l2 + 1]].err) l2++;\n if (err <= bins[(h = heap[l2])].err) break;\n heap[l] = h;\n }\n heap[l] = b1;\n }\n\n /* Do a merge */\n var nb = bins[tb.nn];\n var n1 = tb.cnt;\n var n2 = nb.cnt;\n var d = 1.0 / (n1 + n2);\n if (hasAlpha) tb.ac = d * (n1 * tb.ac + n2 * nb.ac);\n tb.rc = d * (n1 * tb.rc + n2 * nb.rc);\n tb.gc = d * (n1 * tb.gc + n2 * nb.gc);\n tb.bc = d * (n1 * tb.bc + n2 * nb.bc);\n tb.cnt += nb.cnt;\n tb.mtm = ++i;\n\n /* Unchain deleted bin */\n bins[nb.bk].fw = nb.fw;\n bins[nb.fw].bk = nb.bk;\n nb.mtm = bincountMinusOne;\n }\n\n // let palette = new Uint32Array(maxColors);\n let palette = [];\n\n /* Fill palette */\n var k = 0;\n for (i = 0; ; ++k) {\n let r = clamp(Math.round(bins[i].rc), 0, 0xff);\n let g = clamp(Math.round(bins[i].gc), 0, 0xff);\n let b = clamp(Math.round(bins[i].bc), 0, 0xff);\n\n let a = 0xff;\n if (hasAlpha) {\n a = clamp(Math.round(bins[i].ac), 0, 0xff);\n if (oneBitAlpha) {\n const threshold = typeof oneBitAlpha === \"number\" ? oneBitAlpha : 127;\n a = a <= threshold ? 0x00 : 0xff;\n }\n if (clearAlpha && a <= clearAlphaThreshold) {\n r = g = b = clearAlphaColor;\n a = 0x00;\n }\n }\n\n const color = hasAlpha ? [r, g, b, a] : [r, g, b];\n const exists = existsInPalette(palette, color);\n if (!exists) palette.push(color);\n if ((i = bins[i].fw) == 0) break;\n }\n\n return palette;\n}\n\nfunction existsInPalette(palette, color) {\n for (let i = 0; i < palette.length; i++) {\n const p = palette[i];\n let matchesRGB =\n p[0] === color[0] && p[1] === color[1] && p[2] === color[2];\n let matchesAlpha =\n p.length >= 4 && color.length >= 4 ? p[3] === color[3] : true;\n if (matchesRGB && matchesAlpha) return true;\n }\n return false;\n}\n\n// TODO: Further 'clean' palette by merging nearly-identical colors?\n", "function rgb2y(r, g, b) {\n return r * 0.29889531 + g * 0.58662247 + b * 0.11448223;\n}\nfunction rgb2i(r, g, b) {\n return r * 0.59597799 - g * 0.2741761 - b * 0.32180189;\n}\nfunction rgb2q(r, g, b) {\n return r * 0.21147017 - g * 0.52261711 + b * 0.31114694;\n}\n\nexport function colorDifferenceYIQSquared(yiqA, yiqB) {\n const y = yiqA[0] - yiqB[0];\n const i = yiqA[1] - yiqB[1];\n const q = yiqA[2] - yiqB[2];\n const a = alpha(yiqA) - alpha(yiqB);\n return y * y * 0.5053 + i * i * 0.299 + q * q * 0.1957 + a * a;\n}\n\nfunction alpha(array) {\n return array[3] != null ? array[3] : 0xff;\n}\n\nexport function colorDifferenceYIQ(yiqA, yiqB) {\n return Math.sqrt(colorDifferenceYIQSquared(yiqA, yiqB));\n}\n\nexport function colorDifferenceRGBToYIQSquared(rgb1, rgb2) {\n const [r1, g1, b1] = rgb1;\n const [r2, g2, b2] = rgb2;\n const y = rgb2y(r1, g1, b1) - rgb2y(r2, g2, b2),\n i = rgb2i(r1, g1, b1) - rgb2i(r2, g2, b2),\n q = rgb2q(r1, g1, b1) - rgb2q(r2, g2, b2);\n const a = alpha(rgb1) - alpha(rgb2);\n return y * y * 0.5053 + i * i * 0.299 + q * q * 0.1957 + a * a;\n}\n\nexport function colorDifferenceRGBToYIQ(rgb1, rgb2) {\n return Math.sqrt(colorDifferenceRGBToYIQSquared(rgb1, rgb2));\n}\n\nexport function euclideanDistanceSquared(a, b) {\n var sum = 0;\n var n;\n for (n = 0; n < a.length; n++) {\n const dx = a[n] - b[n];\n sum += dx * dx;\n }\n return sum;\n}\n\nexport function euclideanDistance(a, b) {\n return Math.sqrt(euclideanDistanceSquared(a, b));\n}\n", "import {\n rgb888_to_rgb444,\n rgb888_to_rgb565,\n rgba8888_to_rgba4444,\n} from \"./rgb-packing.js\";\n\nimport { euclideanDistanceSquared } from \"./color.js\";\n\nfunction roundStep(byte, step) {\n return step > 1 ? Math.round(byte / step) * step : byte;\n}\n\nexport function prequantize(\n rgba,\n { roundRGB = 5, roundAlpha = 10, oneBitAlpha = null } = {}\n) {\n const data = new Uint32Array(rgba.buffer);\n for (let i = 0; i < data.length; i++) {\n const color = data[i];\n let a = (color >> 24) & 0xff;\n let b = (color >> 16) & 0xff;\n let g = (color >> 8) & 0xff;\n let r = color & 0xff;\n\n a = roundStep(a, roundAlpha);\n if (oneBitAlpha) {\n const threshold = typeof oneBitAlpha === \"number\" ? oneBitAlpha : 127;\n a = a <= threshold ? 0x00 : 0xff;\n }\n r = roundStep(r, roundRGB);\n g = roundStep(g, roundRGB);\n b = roundStep(b, roundRGB);\n\n data[i] = (a << 24) | (b << 16) | (g << 8) | (r << 0);\n }\n}\n\nexport function applyPalette(rgba, palette, format = \"rgb565\") {\n if (!rgba || !rgba.buffer) {\n throw new Error('quantize() expected RGBA Uint8Array data');\n }\n if (!(rgba instanceof Uint8Array) && !(rgba instanceof Uint8ClampedArray)) {\n throw new Error('quantize() expected RGBA Uint8Array data');\n }\n if (palette.length > 256) {\n throw new Error('applyPalette() only works with 256 colors or less');\n }\n\n const data = new Uint32Array(rgba.buffer);\n const length = data.length;\n const bincount = format === \"rgb444\" ? 4096 : 65536;\n const index = new Uint8Array(length);\n const cache = new Array(bincount);\n const hasAlpha = format === \"rgba4444\";\n\n // Some duplicate code below due to very hot code path\n // Introducing branching/conditions shows some significant impact\n if (format === \"rgba4444\") {\n for (let i = 0; i < length; i++) {\n const color = data[i];\n const a = (color >> 24) & 0xff;\n const b = (color >> 16) & 0xff;\n const g = (color >> 8) & 0xff;\n const r = color & 0xff;\n const key = rgba8888_to_rgba4444(r, g, b, a);\n const idx = key in cache ? cache[key] : (cache[key] = nearestColorIndexRGBA(r, g, b, a, palette));\n index[i] = idx;\n }\n } else {\n const rgb888_to_key = format === \"rgb444\" ? rgb888_to_rgb444 : rgb888_to_rgb565;\n for (let i = 0; i < length; i++) {\n const color = data[i];\n const b = (color >> 16) & 0xff;\n const g = (color >> 8) & 0xff;\n const r = color & 0xff;\n const key = rgb888_to_key(r, g, b);\n const idx = key in cache ? cache[key] : (cache[key] = nearestColorIndexRGB(r, g, b, palette));\n index[i] = idx;\n }\n }\n\n return index;\n}\n\nfunction nearestColorIndexRGBA(r, g, b, a, palette) {\n let k = 0;\n let mindist = 1e100;\n for (let i = 0; i < palette.length; i++) {\n const px2 = palette[i];\n const a2 = px2[3];\n let curdist = sqr(a2 - a);\n if (curdist > mindist) continue;\n const r2 = px2[0];\n curdist += sqr(r2 - r);\n if (curdist > mindist) continue;\n const g2 = px2[1];\n curdist += sqr(g2 - g);\n if (curdist > mindist) continue;\n const b2 = px2[2];\n curdist += sqr(b2 - b);\n if (curdist > mindist) continue;\n mindist = curdist;\n k = i;\n }\n return k;\n}\n\nfunction nearestColorIndexRGB(r, g, b, palette) {\n let k = 0;\n let mindist = 1e100;\n for (let i = 0; i < palette.length; i++) {\n const px2 = palette[i];\n const r2 = px2[0];\n let curdist = sqr(r2 - r);\n if (curdist > mindist) continue;\n const g2 = px2[1];\n curdist += sqr(g2 - g);\n if (curdist > mindist) continue;\n const b2 = px2[2];\n curdist += sqr(b2 - b);\n if (curdist > mindist) continue;\n mindist = curdist;\n k = i;\n }\n return k;\n}\n\nexport function snapColorsToPalette(palette, knownColors, threshold = 5) {\n if (!palette.length || !knownColors.length) return;\n\n const paletteRGB = palette.map((p) => p.slice(0, 3));\n const thresholdSq = threshold * threshold;\n const dim = palette[0].length;\n for (let i = 0; i < knownColors.length; i++) {\n let color = knownColors[i];\n if (color.length < dim) {\n // palette is RGBA, known is RGB\n color = [color[0], color[1], color[2], 0xff];\n } else if (color.length > dim) {\n // palette is RGB, known is RGBA\n color = color.slice(0, 3);\n } else {\n // make sure we always copy known colors\n color = color.slice();\n }\n const r = nearestColorIndexWithDistance(\n paletteRGB,\n color.slice(0, 3),\n euclideanDistanceSquared\n );\n const idx = r[0];\n const distanceSq = r[1];\n if (distanceSq > 0 && distanceSq <= thresholdSq) {\n palette[idx] = color;\n }\n }\n}\n\nfunction sqr(a) {\n return a * a;\n}\n\nexport function nearestColorIndex(\n colors,\n pixel,\n distanceFn = euclideanDistanceSquared\n) {\n let minDist = Infinity;\n let minDistIndex = -1;\n for (let j = 0; j < colors.length; j++) {\n const paletteColor = colors[j];\n const dist = distanceFn(pixel, paletteColor);\n if (dist < minDist) {\n minDist = dist;\n minDistIndex = j;\n }\n }\n return minDistIndex;\n}\n\nexport function nearestColorIndexWithDistance(\n colors,\n pixel,\n distanceFn = euclideanDistanceSquared\n) {\n let minDist = Infinity;\n let minDistIndex = -1;\n for (let j = 0; j < colors.length; j++) {\n const paletteColor = colors[j];\n const dist = distanceFn(pixel, paletteColor);\n if (dist < minDist) {\n minDist = dist;\n minDistIndex = j;\n }\n }\n return [minDistIndex, minDist];\n}\n\nexport function nearestColor(\n colors,\n pixel,\n distanceFn = euclideanDistanceSquared\n) {\n return colors[nearestColorIndex(colors, pixel, distanceFn)];\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addPreEditListener, addPreSendListener, removePreEditListener, removePreSendListener } from \"@api/MessageEvents\";\nimport { definePluginSettings, Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport { ApngBlendOp, ApngDisposeOp, importApngJs } from \"@utils/dependencies\";\nimport { getCurrentGuild } from \"@utils/discord\";\nimport { proxyLazy } from \"@utils/lazy\";\nimport { Logger } from \"@utils/Logger\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy, findStoreLazy } from \"@webpack\";\nimport { ChannelStore, EmojiStore, FluxDispatcher, lodash, Parser, PermissionStore, UploadHandler, UserSettingsActionCreators, UserStore } from \"@webpack/common\";\nimport type { Message } from \"discord-types/general\";\nimport { applyPalette, GIFEncoder, quantize } from \"gifenc\";\nimport type { ReactElement, ReactNode } from \"react\";\n\nconst DRAFT_TYPE = 0;\nconst StickerStore = findStoreLazy(\"StickersStore\") as {\n getPremiumPacks(): StickerPack[];\n getAllGuildStickers(): Map;\n getStickerById(id: string): Sticker | undefined;\n};\n\nconst UserSettingsProtoStore = findStoreLazy(\"UserSettingsProtoStore\");\nconst ProtoUtils = findByPropsLazy(\"BINARY_READ_OPTIONS\");\n\nfunction searchProtoClassField(localName: string, protoClass: any) {\n const field = protoClass?.fields?.find((field: any) => field.localName === localName);\n if (!field) return;\n\n const fieldGetter = Object.values(field).find(value => typeof value === \"function\") as any;\n return fieldGetter?.();\n}\n\nconst PreloadedUserSettingsActionCreators = proxyLazy(() => UserSettingsActionCreators.PreloadedUserSettingsActionCreators);\nconst AppearanceSettingsActionCreators = proxyLazy(() => searchProtoClassField(\"appearance\", PreloadedUserSettingsActionCreators.ProtoClass));\nconst ClientThemeSettingsActionsCreators = proxyLazy(() => searchProtoClassField(\"clientThemeSettings\", AppearanceSettingsActionCreators));\n\nconst USE_EXTERNAL_EMOJIS = 1n << 18n;\nconst USE_EXTERNAL_STICKERS = 1n << 37n;\n\nconst enum EmojiIntentions {\n REACTION = 0,\n STATUS = 1,\n COMMUNITY_CONTENT = 2,\n CHAT = 3,\n GUILD_STICKER_RELATED_EMOJI = 4,\n GUILD_ROLE_BENEFIT_EMOJI = 5,\n COMMUNITY_CONTENT_ONLY = 6,\n SOUNDBOARD = 7\n}\n\nconst enum StickerType {\n PNG = 1,\n APNG = 2,\n LOTTIE = 3,\n // don't think you can even have gif stickers but the docs have it\n GIF = 4\n}\n\ninterface BaseSticker {\n available: boolean;\n description: string;\n format_type: number;\n id: string;\n name: string;\n tags: string;\n type: number;\n}\ninterface GuildSticker extends BaseSticker {\n guild_id: string;\n}\ninterface DiscordSticker extends BaseSticker {\n pack_id: string;\n}\ntype Sticker = GuildSticker | DiscordSticker;\n\ninterface StickerPack {\n id: string;\n name: string;\n sku_id: string;\n description: string;\n cover_sticker_id: string;\n banner_asset_id: string;\n stickers: Sticker[];\n}\n\nconst enum FakeNoticeType {\n Sticker,\n Emoji\n}\n\nconst fakeNitroEmojiRegex = /\\/emojis\\/(\\d+?)\\.(png|webp|gif)/;\nconst fakeNitroStickerRegex = /\\/stickers\\/(\\d+?)\\./;\nconst fakeNitroGifStickerRegex = /\\/attachments\\/\\d+?\\/\\d+?\\/(\\d+?)\\.gif/;\n\nconst settings = definePluginSettings({\n enableEmojiBypass: {\n description: \"Allow sending fake emojis\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n },\n emojiSize: {\n description: \"Size of the emojis when sending\",\n type: OptionType.SLIDER,\n default: 48,\n markers: [32, 48, 64, 128, 160, 256, 512]\n },\n transformEmojis: {\n description: \"Whether to transform fake emojis into real ones\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n },\n enableStickerBypass: {\n description: \"Allow sending fake stickers\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n },\n stickerSize: {\n description: \"Size of the stickers when sending\",\n type: OptionType.SLIDER,\n default: 160,\n markers: [32, 64, 128, 160, 256, 512]\n },\n transformStickers: {\n description: \"Whether to transform fake stickers into real ones\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n },\n transformCompoundSentence: {\n description: \"Whether to transform fake stickers and emojis in compound sentences (sentences with more content than just the fake emoji or sticker link)\",\n type: OptionType.BOOLEAN,\n default: false\n },\n enableStreamQualityBypass: {\n description: \"Allow streaming in nitro quality\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"FakeNitro\",\n authors: [Devs.Arjix, Devs.D3SOX, Devs.Ven, Devs.obscurity, Devs.captain, Devs.Nuckyz, Devs.AutumnVN],\n description: \"Allows you to stream in nitro quality, send fake emojis/stickers and use client themes.\",\n dependencies: [\"MessageEventsAPI\"],\n\n settings,\n\n patches: [\n {\n find: \".PREMIUM_LOCKED;\",\n predicate: () => settings.store.enableEmojiBypass,\n replacement: [\n {\n // Create a variable for the intention of listing the emoji\n match: /(?<=,intention:(\\i).+?;)/,\n replace: (_, intention) => `let fakeNitroIntention=${intention};`\n },\n {\n // Send the intention of listing the emoji to the nitro permission check functions\n match: /\\.(?:canUseEmojisEverywhere|canUseAnimatedEmojis)\\(\\i(?=\\))/g,\n replace: '$&,typeof fakeNitroIntention!==\"undefined\"?fakeNitroIntention:void 0'\n },\n {\n // Disallow the emoji if the intention doesn't allow it\n match: /(&&!\\i&&)!(\\i)(?=\\)return \\i\\.\\i\\.DISALLOW_EXTERNAL;)/,\n replace: (_, rest, canUseExternal) => `${rest}(!${canUseExternal}&&(typeof fakeNitroIntention===\"undefined\"||![${EmojiIntentions.CHAT},${EmojiIntentions.GUILD_STICKER_RELATED_EMOJI}].includes(fakeNitroIntention)))`\n },\n {\n // Make the emoji always available if the intention allows it\n match: /if\\(!\\i\\.available/,\n replace: m => `${m}&&(typeof fakeNitroIntention===\"undefined\"||![${EmojiIntentions.CHAT},${EmojiIntentions.GUILD_STICKER_RELATED_EMOJI}].includes(fakeNitroIntention))`\n }\n ]\n },\n // Allow emojis and animated emojis to be sent everywhere\n {\n find: \"canUseAnimatedEmojis:function\",\n predicate: () => settings.store.enableEmojiBypass,\n replacement: {\n match: /((?:canUseEmojisEverywhere|canUseAnimatedEmojis):function\\(\\i)\\){(.+?\\))(?=})/g,\n replace: (_, rest, premiumCheck) => `${rest},fakeNitroIntention){${premiumCheck}||fakeNitroIntention==null||[${EmojiIntentions.CHAT},${EmojiIntentions.GUILD_STICKER_RELATED_EMOJI}].includes(fakeNitroIntention)`\n }\n },\n // Allow stickers to be sent everywhere\n {\n find: \"canUseCustomStickersEverywhere:function\",\n predicate: () => settings.store.enableStickerBypass,\n replacement: {\n match: /canUseCustomStickersEverywhere:function\\(\\i\\){/,\n replace: \"$&return true;\"\n },\n },\n // Make stickers always available\n {\n find: \"\\\"SENDABLE\\\"\",\n predicate: () => settings.store.enableStickerBypass,\n replacement: {\n match: /(\\w+)\\.available\\?/,\n replace: \"true?\"\n }\n },\n // Allow streaming with high quality\n {\n find: \"canUseHighVideoUploadQuality:function\",\n predicate: () => settings.store.enableStreamQualityBypass,\n replacement: [\n \"canUseHighVideoUploadQuality\",\n \"canStreamQuality\",\n ].map(func => {\n return {\n match: new RegExp(`${func}:function\\\\(\\\\i(?:,\\\\i)?\\\\){`, \"g\"),\n replace: \"$&return true;\"\n };\n })\n },\n // Remove boost requirements to stream with high quality\n {\n find: \"STREAM_FPS_OPTION.format\",\n predicate: () => settings.store.enableStreamQualityBypass,\n replacement: {\n match: /guildPremiumTier:\\i\\.\\i\\.TIER_\\d,?/g,\n replace: \"\"\n }\n },\n // Allow client themes to be changeable\n {\n find: \"canUseClientThemes:function\",\n replacement: {\n match: /canUseClientThemes:function\\(\\i\\){/,\n replace: \"$&return true;\"\n }\n },\n {\n find: '.displayName=\"UserSettingsProtoStore\"',\n replacement: [\n {\n // Overwrite incoming connection settings proto with our local settings\n match: /CONNECTION_OPEN:function\\((\\i)\\){/,\n replace: (m, props) => `${m}$self.handleProtoChange(${props}.userSettingsProto,${props}.user);`\n },\n {\n // Overwrite non local proto changes with our local settings\n match: /let{settings:/,\n replace: \"arguments[0].local||$self.handleProtoChange(arguments[0].settings.proto);$&\"\n }\n ]\n },\n // Call our function to handle changing the gradient theme when selecting a new one\n {\n find: \",updateTheme(\",\n replacement: {\n match: /(function \\i\\(\\i\\){let{backgroundGradientPresetId:(\\i).+?)(\\i\\.\\i\\.updateAsync.+?theme=(.+?),.+?},\\i\\))/,\n replace: (_, rest, backgroundGradientPresetId, originalCall, theme) => `${rest}$self.handleGradientThemeSelect(${backgroundGradientPresetId},${theme},()=>${originalCall});`\n }\n },\n {\n find: '[\"strong\",\"em\",\"u\",\"text\",\"inlineCode\",\"s\",\"spoiler\"]',\n replacement: [\n {\n // Call our function to decide whether the emoji link should be kept or not\n predicate: () => settings.store.transformEmojis,\n match: /1!==(\\i)\\.length\\|\\|1!==\\i\\.length/,\n replace: (m, content) => `${m}||$self.shouldKeepEmojiLink(${content}[0])`\n },\n {\n // Patch the rendered message content to add fake nitro emojis or remove sticker links\n predicate: () => settings.store.transformEmojis || settings.store.transformStickers,\n match: /(?=return{hasSpoilerEmbeds:\\i,content:(\\i)})/,\n replace: (_, content) => `${content}=$self.patchFakeNitroEmojisOrRemoveStickersLinks(${content},arguments[2]?.formatInline);`\n }\n ]\n },\n {\n find: \"renderEmbeds(\",\n replacement: [\n {\n // Call our function to decide whether the embed should be ignored or not\n predicate: () => settings.store.transformEmojis || settings.store.transformStickers,\n match: /(renderEmbeds\\((\\i)\\){)(.+?embeds\\.map\\((\\i)=>{)/,\n replace: (_, rest1, message, rest2, embed) => `${rest1}const fakeNitroMessage=${message};${rest2}if($self.shouldIgnoreEmbed(${embed},fakeNitroMessage))return null;`\n },\n {\n // Patch the stickers array to add fake nitro stickers\n predicate: () => settings.store.transformStickers,\n match: /(?<=renderStickersAccessories\\((\\i)\\){let (\\i)=\\(0,\\i\\.\\i\\)\\(\\i\\).+?;)/,\n replace: (_, message, stickers) => `${stickers}=$self.patchFakeNitroStickers(${stickers},${message});`\n },\n {\n // Filter attachments to remove fake nitro stickers or emojis\n predicate: () => settings.store.transformStickers,\n match: /renderAttachments\\(\\i\\){let{attachments:(\\i).+?;/,\n replace: (m, attachments) => `${m}${attachments}=$self.filterAttachments(${attachments});`\n }\n ]\n },\n {\n find: \".Messages.STICKER_POPOUT_UNJOINED_PRIVATE_GUILD_DESCRIPTION.format\",\n predicate: () => settings.store.transformStickers,\n replacement: [\n {\n // Export the renderable sticker to be used in the fake nitro sticker notice\n match: /let{renderableSticker:(\\i).{0,250}isGuildSticker.+?channel:\\i,/,\n replace: (m, renderableSticker) => `${m}fakeNitroRenderableSticker:${renderableSticker},`\n },\n {\n // Add the fake nitro sticker notice\n match: /(let \\i,{sticker:\\i,channel:\\i,closePopout:\\i.+?}=(\\i).+?;)(.+?description:)(\\i)(?=,sticker:\\i)/,\n replace: (_, rest, props, rest2, reactNode) => `${rest}let{fakeNitroRenderableSticker}=${props};${rest2}$self.addFakeNotice(${FakeNoticeType.Sticker},${reactNode},!!fakeNitroRenderableSticker?.fake)`\n }\n ]\n },\n {\n find: \".EMOJI_UPSELL_POPOUT_MORE_EMOJIS_OPENED,\",\n predicate: () => settings.store.transformEmojis,\n replacement: {\n // Export the emoji node to be used in the fake nitro emoji notice\n match: /isDiscoverable:\\i,shouldHideRoleSubscriptionCTA:\\i,(?<={node:(\\i),.+?)/,\n replace: (m, node) => `${m}fakeNitroNode:${node},`\n }\n },\n {\n find: \".Messages.EMOJI_POPOUT_UNJOINED_DISCOVERABLE_GUILD_DESCRIPTION\",\n predicate: () => settings.store.transformEmojis,\n replacement: {\n // Add the fake nitro emoji notice\n match: /(?<=isDiscoverable:\\i,emojiComesFromCurrentGuild:\\i,.+?}=(\\i).+?;)(.+?return )(.{0,1000}\\.Messages\\.EMOJI_POPOUT_UNJOINED_DISCOVERABLE_GUILD_DESCRIPTION.+?)(?=},)/,\n replace: (_, props, rest, reactNode) => `let{fakeNitroNode}=${props};${rest}$self.addFakeNotice(${FakeNoticeType.Emoji},${reactNode},!!fakeNitroNode?.fake)`\n }\n },\n // Allow using custom app icons\n {\n find: \"canUsePremiumAppIcons:function\",\n replacement: {\n match: /canUsePremiumAppIcons:function\\(\\i\\){/,\n replace: \"$&return true;\"\n }\n },\n // Separate patch for allowing using custom app icons\n {\n find: \"location:\\\"AppIconHome\\\"\",\n replacement: {\n match: /\\i\\.\\i\\.isPremium\\(\\i\\.\\i\\.getCurrentUser\\(\\)\\)/,\n replace: \"true\"\n }\n }\n ],\n\n get guildId() {\n return getCurrentGuild()?.id;\n },\n\n get canUseEmotes() {\n return (UserStore.getCurrentUser().premiumType ?? 0) > 0;\n },\n\n get canUseStickers() {\n return (UserStore.getCurrentUser().premiumType ?? 0) > 1;\n },\n\n handleProtoChange(proto: any, user: any) {\n if (proto == null || typeof proto === \"string\" || !UserSettingsProtoStore || !PreloadedUserSettingsActionCreators || !AppearanceSettingsActionCreators || !ClientThemeSettingsActionsCreators) return;\n\n const premiumType: number = user?.premium_type ?? UserStore?.getCurrentUser()?.premiumType ?? 0;\n\n if (premiumType !== 2) {\n proto.appearance ??= AppearanceSettingsActionCreators.create();\n\n if (UserSettingsProtoStore.settings.appearance?.theme != null) {\n const appearanceSettingsDummy = AppearanceSettingsActionCreators.create({\n theme: UserSettingsProtoStore.settings.appearance.theme\n });\n\n proto.appearance.theme = appearanceSettingsDummy.theme;\n }\n\n if (UserSettingsProtoStore.settings.appearance?.clientThemeSettings?.backgroundGradientPresetId?.value != null) {\n const clientThemeSettingsDummy = ClientThemeSettingsActionsCreators.create({\n backgroundGradientPresetId: {\n value: UserSettingsProtoStore.settings.appearance.clientThemeSettings.backgroundGradientPresetId.value\n }\n });\n\n proto.appearance.clientThemeSettings ??= clientThemeSettingsDummy;\n proto.appearance.clientThemeSettings.backgroundGradientPresetId = clientThemeSettingsDummy.backgroundGradientPresetId;\n }\n }\n },\n\n handleGradientThemeSelect(backgroundGradientPresetId: number | undefined, theme: number, original: () => void) {\n const premiumType = UserStore?.getCurrentUser()?.premiumType ?? 0;\n if (premiumType === 2 || backgroundGradientPresetId == null) return original();\n\n if (!PreloadedUserSettingsActionCreators || !AppearanceSettingsActionCreators || !ClientThemeSettingsActionsCreators || !ProtoUtils) return;\n\n const currentAppearanceSettings = PreloadedUserSettingsActionCreators.getCurrentValue().appearance;\n\n const newAppearanceProto = currentAppearanceSettings != null\n ? AppearanceSettingsActionCreators.fromBinary(AppearanceSettingsActionCreators.toBinary(currentAppearanceSettings), ProtoUtils.BINARY_READ_OPTIONS)\n : AppearanceSettingsActionCreators.create();\n\n newAppearanceProto.theme = theme;\n\n const clientThemeSettingsDummy = ClientThemeSettingsActionsCreators.create({\n backgroundGradientPresetId: {\n value: backgroundGradientPresetId\n }\n });\n\n newAppearanceProto.clientThemeSettings ??= clientThemeSettingsDummy;\n newAppearanceProto.clientThemeSettings.backgroundGradientPresetId = clientThemeSettingsDummy.backgroundGradientPresetId;\n\n const proto = PreloadedUserSettingsActionCreators.ProtoClass.create();\n proto.appearance = newAppearanceProto;\n\n FluxDispatcher.dispatch({\n type: \"USER_SETTINGS_PROTO_UPDATE\",\n local: true,\n partial: true,\n settings: {\n type: 1,\n proto\n }\n });\n },\n\n trimContent(content: Array) {\n const firstContent = content[0];\n if (typeof firstContent === \"string\") content[0] = firstContent.trimStart();\n if (content[0] === \"\") content.shift();\n\n const lastIndex = content.length - 1;\n const lastContent = content[lastIndex];\n if (typeof lastContent === \"string\") content[lastIndex] = lastContent.trimEnd();\n if (content[lastIndex] === \"\") content.pop();\n },\n\n clearEmptyArrayItems(array: Array) {\n return array.filter(item => item != null);\n },\n\n ensureChildrenIsArray(child: ReactElement) {\n if (!Array.isArray(child.props.children)) child.props.children = [child.props.children];\n },\n\n patchFakeNitroEmojisOrRemoveStickersLinks(content: Array, inline: boolean) {\n // If content has more than one child or it's a single ReactElement like a header or list\n if ((content.length > 1 || typeof content[0]?.type === \"string\") && !settings.store.transformCompoundSentence) return content;\n\n let nextIndex = content.length;\n\n const transformLinkChild = (child: ReactElement) => {\n if (settings.store.transformEmojis) {\n const fakeNitroMatch = child.props.href.match(fakeNitroEmojiRegex);\n if (fakeNitroMatch) {\n let url: URL | null = null;\n try {\n url = new URL(child.props.href);\n } catch { }\n\n const emojiName = EmojiStore.getCustomEmojiById(fakeNitroMatch[1])?.name ?? url?.searchParams.get(\"name\") ?? \"FakeNitroEmoji\";\n\n return Parser.defaultRules.customEmoji.react({\n jumboable: !inline && content.length === 1 && typeof content[0].type !== \"string\",\n animated: fakeNitroMatch[2] === \"gif\",\n emojiId: fakeNitroMatch[1],\n name: emojiName,\n fake: true\n }, void 0, { key: String(nextIndex++) });\n }\n }\n\n if (settings.store.transformStickers) {\n if (fakeNitroStickerRegex.test(child.props.href)) return null;\n\n const gifMatch = child.props.href.match(fakeNitroGifStickerRegex);\n if (gifMatch) {\n // There is no way to differentiate a regular gif attachment from a fake nitro animated sticker, so we check if the StickerStore contains the id of the fake sticker\n if (StickerStore.getStickerById(gifMatch[1])) return null;\n }\n }\n\n return child;\n };\n\n const transformChild = (child: ReactElement) => {\n if (child?.props?.trusted != null) return transformLinkChild(child);\n if (child?.props?.children != null) {\n if (!Array.isArray(child.props.children)) {\n child.props.children = modifyChild(child.props.children);\n return child;\n }\n\n child.props.children = modifyChildren(child.props.children);\n if (child.props.children.length === 0) return null;\n return child;\n }\n\n return child;\n };\n\n const modifyChild = (child: ReactElement) => {\n const newChild = transformChild(child);\n\n if (newChild?.type === \"ul\" || newChild?.type === \"ol\") {\n this.ensureChildrenIsArray(newChild);\n if (newChild.props.children.length === 0) return null;\n\n let listHasAnItem = false;\n for (const [index, child] of newChild.props.children.entries()) {\n if (child == null) {\n delete newChild.props.children[index];\n continue;\n }\n\n this.ensureChildrenIsArray(child);\n if (child.props.children.length > 0) listHasAnItem = true;\n else delete newChild.props.children[index];\n }\n\n if (!listHasAnItem) return null;\n\n newChild.props.children = this.clearEmptyArrayItems(newChild.props.children);\n }\n\n return newChild;\n };\n\n const modifyChildren = (children: Array) => {\n for (const [index, child] of children.entries()) children[index] = modifyChild(child);\n\n children = this.clearEmptyArrayItems(children);\n this.trimContent(children);\n\n return children;\n };\n\n try {\n return modifyChildren(lodash.cloneDeep(content));\n } catch (err) {\n new Logger(\"FakeNitro\").error(err);\n return content;\n }\n },\n\n patchFakeNitroStickers(stickers: Array, message: Message) {\n const itemsToMaybePush: Array = [];\n\n const contentItems = message.content.split(/\\s/);\n if (settings.store.transformCompoundSentence) itemsToMaybePush.push(...contentItems);\n else if (contentItems.length === 1) itemsToMaybePush.push(contentItems[0]);\n\n itemsToMaybePush.push(...message.attachments.filter(attachment => attachment.content_type === \"image/gif\").map(attachment => attachment.url));\n\n for (const item of itemsToMaybePush) {\n if (!settings.store.transformCompoundSentence && !item.startsWith(\"http\")) continue;\n\n const imgMatch = item.match(fakeNitroStickerRegex);\n if (imgMatch) {\n let url: URL | null = null;\n try {\n url = new URL(item);\n } catch { }\n\n const stickerName = StickerStore.getStickerById(imgMatch[1])?.name ?? url?.searchParams.get(\"name\") ?? \"FakeNitroSticker\";\n stickers.push({\n format_type: 1,\n id: imgMatch[1],\n name: stickerName,\n fake: true\n });\n\n continue;\n }\n\n const gifMatch = item.match(fakeNitroGifStickerRegex);\n if (gifMatch) {\n if (!StickerStore.getStickerById(gifMatch[1])) continue;\n\n const stickerName = StickerStore.getStickerById(gifMatch[1])?.name ?? \"FakeNitroSticker\";\n stickers.push({\n format_type: 2,\n id: gifMatch[1],\n name: stickerName,\n fake: true\n });\n }\n }\n\n return stickers;\n },\n\n shouldIgnoreEmbed(embed: Message[\"embeds\"][number], message: Message) {\n const contentItems = message.content.split(/\\s/);\n if (contentItems.length > 1 && !settings.store.transformCompoundSentence) return false;\n\n switch (embed.type) {\n case \"image\": {\n if (\n !settings.store.transformCompoundSentence\n && !contentItems.includes(embed.url!)\n && !contentItems.includes(embed.image?.proxyURL!)\n ) return false;\n\n if (settings.store.transformEmojis) {\n if (fakeNitroEmojiRegex.test(embed.url!)) return true;\n }\n\n if (settings.store.transformStickers) {\n if (fakeNitroStickerRegex.test(embed.url!)) return true;\n\n const gifMatch = embed.url!.match(fakeNitroGifStickerRegex);\n if (gifMatch) {\n // There is no way to differentiate a regular gif attachment from a fake nitro animated sticker, so we check if the StickerStore contains the id of the fake sticker\n if (StickerStore.getStickerById(gifMatch[1])) return true;\n }\n }\n\n break;\n }\n }\n\n return false;\n },\n\n filterAttachments(attachments: Message[\"attachments\"]) {\n return attachments.filter(attachment => {\n if (attachment.content_type !== \"image/gif\") return true;\n\n const match = attachment.url.match(fakeNitroGifStickerRegex);\n if (match) {\n // There is no way to differentiate a regular gif attachment from a fake nitro animated sticker, so we check if the StickerStore contains the id of the fake sticker\n if (StickerStore.getStickerById(match[1])) return false;\n }\n\n return true;\n });\n },\n\n shouldKeepEmojiLink(link: any) {\n return link.target && fakeNitroEmojiRegex.test(link.target);\n },\n\n addFakeNotice(type: FakeNoticeType, node: Array, fake: boolean) {\n if (!fake) return node;\n\n node = Array.isArray(node) ? node : [node];\n\n switch (type) {\n case FakeNoticeType.Sticker: {\n node.push(\" This is a FakeNitro sticker and renders like a real sticker only for you. Appears as a link to non-plugin users.\");\n\n return node;\n }\n case FakeNoticeType.Emoji: {\n node.push(\" This is a FakeNitro emoji and renders like a real emoji only for you. Appears as a link to non-plugin users.\");\n\n return node;\n }\n }\n },\n\n hasPermissionToUseExternalEmojis(channelId: string): boolean {\n const channel = ChannelStore.getChannel(channelId);\n\n if (!channel || channel.isDM() || channel.isGroupDM() || channel.isMultiUserDM()) return true;\n\n return PermissionStore.can(USE_EXTERNAL_EMOJIS, channel);\n },\n\n hasPermissionToUseExternalStickers(channelId: string) {\n const channel = ChannelStore.getChannel(channelId);\n\n if (!channel || channel.isDM() || channel.isGroupDM() || channel.isMultiUserDM()) return true;\n\n return PermissionStore.can(USE_EXTERNAL_STICKERS, channel);\n },\n\n getStickerLink(stickerId: string) {\n return `https://media.discordapp.net/stickers/${stickerId}.png?size=${Settings.plugins.FakeNitro.stickerSize}`;\n },\n\n async sendAnimatedSticker(stickerLink: string, stickerId: string, channelId: string) {\n const { parseURL } = importApngJs();\n\n const { frames, width, height } = await parseURL(stickerLink);\n\n const gif = GIFEncoder();\n const resolution = Settings.plugins.FakeNitro.stickerSize;\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = resolution;\n canvas.height = resolution;\n\n const ctx = canvas.getContext(\"2d\", {\n willReadFrequently: true\n })!;\n\n const scale = resolution / Math.max(width, height);\n ctx.scale(scale, scale);\n\n let previousFrameData: ImageData;\n\n for (const frame of frames) {\n const { left, top, width, height, img, delay, blendOp, disposeOp } = frame;\n\n previousFrameData = ctx.getImageData(left, top, width, height);\n\n if (blendOp === ApngBlendOp.SOURCE) {\n ctx.clearRect(left, top, width, height);\n }\n\n ctx.drawImage(img, left, top, width, height);\n\n const { data } = ctx.getImageData(0, 0, resolution, resolution);\n\n const palette = quantize(data, 256);\n const index = applyPalette(data, palette);\n\n gif.writeFrame(index, resolution, resolution, {\n transparent: true,\n palette,\n delay\n });\n\n if (disposeOp === ApngDisposeOp.BACKGROUND) {\n ctx.clearRect(left, top, width, height);\n } else if (disposeOp === ApngDisposeOp.PREVIOUS) {\n ctx.putImageData(previousFrameData, left, top);\n }\n }\n\n gif.finish();\n\n const file = new File([gif.bytesView()], `${stickerId}.gif`, { type: \"image/gif\" });\n UploadHandler.promptToUpload([file], ChannelStore.getChannel(channelId), DRAFT_TYPE);\n },\n\n start() {\n const s = settings.store;\n\n if (!s.enableEmojiBypass && !s.enableStickerBypass) {\n return;\n }\n\n function getWordBoundary(origStr: string, offset: number) {\n return (!origStr[offset] || /\\s/.test(origStr[offset])) ? \"\" : \" \";\n }\n\n this.preSend = addPreSendListener((channelId, messageObj, extra) => {\n const { guildId } = this;\n\n stickerBypass: {\n if (!s.enableStickerBypass)\n break stickerBypass;\n\n const sticker = StickerStore.getStickerById(extra.stickers?.[0]!);\n if (!sticker)\n break stickerBypass;\n\n // Discord Stickers are now free yayyy!! :D\n if (\"pack_id\" in sticker)\n break stickerBypass;\n\n const canUseStickers = this.canUseStickers && this.hasPermissionToUseExternalStickers(channelId);\n if (sticker.available !== false && (canUseStickers || sticker.guild_id === guildId))\n break stickerBypass;\n\n const link = this.getStickerLink(sticker.id);\n if (sticker.format_type === StickerType.APNG) {\n this.sendAnimatedSticker(link, sticker.id, channelId);\n return { cancel: true };\n } else {\n extra.stickers!.length = 0;\n messageObj.content += ` ${link}&name=${encodeURIComponent(sticker.name)}`;\n }\n }\n\n if (s.enableEmojiBypass) {\n const canUseEmotes = this.canUseEmotes && this.hasPermissionToUseExternalEmojis(channelId);\n\n for (const emoji of messageObj.validNonShortcutEmojis) {\n if (!emoji.require_colons) continue;\n if (emoji.available !== false && canUseEmotes) continue;\n if (emoji.guildId === guildId && !emoji.animated) continue;\n\n const emojiString = `<${emoji.animated ? \"a\" : \"\"}:${emoji.originalName || emoji.name}:${emoji.id}>`;\n const url = emoji.url.replace(/\\?size=\\d+/, \"?\" + new URLSearchParams({\n size: Settings.plugins.FakeNitro.emojiSize,\n name: encodeURIComponent(emoji.name)\n }));\n messageObj.content = messageObj.content.replace(emojiString, (match, offset, origStr) => {\n return `${getWordBoundary(origStr, offset - 1)}${url}${getWordBoundary(origStr, offset + match.length)}`;\n });\n }\n }\n\n return { cancel: false };\n });\n\n this.preEdit = addPreEditListener((channelId, __, messageObj) => {\n if (!s.enableEmojiBypass) return;\n\n const canUseEmotes = this.canUseEmotes && this.hasPermissionToUseExternalEmojis(channelId);\n\n const { guildId } = this;\n\n messageObj.content = messageObj.content.replace(/(?/ig, (emojiStr, emojiId, offset, origStr) => {\n const emoji = EmojiStore.getCustomEmojiById(emojiId);\n if (emoji == null) return emojiStr;\n if (!emoji.require_colons) return emojiStr;\n if (emoji.available !== false && canUseEmotes) return emojiStr;\n if (emoji.guildId === guildId && !emoji.animated) return emojiStr;\n\n const url = emoji.url.replace(/\\?size=\\d+/, \"?\" + new URLSearchParams({\n size: Settings.plugins.FakeNitro.emojiSize,\n name: encodeURIComponent(emoji.name)\n }));\n return `${getWordBoundary(origStr, offset - 1)}${url}${getWordBoundary(origStr, offset + emojiStr.length)}`;\n });\n });\n },\n\n stop() {\n removePreSendListener(this.preSend);\n removePreEditListener(this.preEdit);\n }\n});\n", "\"use strict\";\n/*!\n * virtual-merge\n * Copyright (c) 2023 Vendicated\n * SPDX-License-Identifier: MIT\n */\nfunction virtualMerge(...objects) {\n const fallback = {};\n function findObjectByProp(prop) {\n for (let i = objects.length - 1; i >= 0; i--) {\n if (prop in objects[i])\n return objects[i];\n }\n return fallback;\n }\n const handler = {\n ownKeys() {\n return objects.reduce((acc, obj) => {\n acc.push(...Reflect.ownKeys(obj));\n return acc;\n }, Reflect.ownKeys(fallback));\n }\n };\n for (const method of [\"defineProperty\", \"deleteProperty\", \"get\", \"getOwnPropertyDescriptor\", \"has\", \"set\"]) {\n handler[method] = function(_, ...args) {\n return Reflect[method](findObjectByProp(args[0]), ...args);\n };\n }\n return new Proxy(fallback, handler);\n}\nexport default virtualMerge;\nif (typeof module !== \"undefined\")\n module.exports = virtualMerge;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n// This plugin is a port from Alyxia's Vendetta plugin\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { Margins } from \"@utils/margins\";\nimport { copyWithToast } from \"@utils/misc\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Button, Forms } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\nimport virtualMerge from \"virtual-merge\";\n\ninterface UserProfile extends User {\n themeColors?: Array;\n}\n\ninterface Colors {\n primary: number;\n accent: number;\n}\n\nfunction encode(primary: number, accent: number): string {\n const message = `[#${primary.toString(16).padStart(6, \"0\")},#${accent.toString(16).padStart(6, \"0\")}]`;\n const padding = \"\";\n const encoded = Array.from(message)\n .map(x => x.codePointAt(0))\n .filter(x => x! >= 0x20 && x! <= 0x7f)\n .map(x => String.fromCodePoint(x! + 0xe0000))\n .join(\"\");\n\n return (padding || \"\") + \" \" + encoded;\n}\n\n// Courtesy of Cynthia.\nfunction decode(bio: string): Array | null {\n if (bio == null) return null;\n\n const colorString = bio.match(\n /\\u{e005b}\\u{e0023}([\\u{e0061}-\\u{e0066}\\u{e0041}-\\u{e0046}\\u{e0030}-\\u{e0039}]+?)\\u{e002c}\\u{e0023}([\\u{e0061}-\\u{e0066}\\u{e0041}-\\u{e0046}\\u{e0030}-\\u{e0039}]+?)\\u{e005d}/u,\n );\n if (colorString != null) {\n const parsed = [...colorString[0]]\n .map(x => String.fromCodePoint(x.codePointAt(0)! - 0xe0000))\n .join(\"\");\n const colors = parsed\n .substring(1, parsed.length - 1)\n .split(\",\")\n .map(x => parseInt(x.replace(\"#\", \"0x\"), 16));\n\n return colors;\n } else {\n return null;\n }\n}\n\nconst settings = definePluginSettings({\n nitroFirst: {\n description: \"Default color source if both are present\",\n type: OptionType.SELECT,\n options: [\n { label: \"Nitro colors\", value: true, default: true },\n { label: \"Fake colors\", value: false },\n ]\n }\n});\n\nexport default definePlugin({\n name: \"FakeProfileThemes\",\n description: \"Allows profile theming by hiding the colors in your bio thanks to invisible 3y3 encoding\",\n authors: [Devs.Alyxia, Devs.Remty],\n patches: [\n {\n find: \"UserProfileStore\",\n replacement: {\n match: /(?<=getUserProfile\\(\\i\\){return )(\\i\\[\\i\\])/,\n replace: \"$self.colorDecodeHook($1)\"\n }\n }, {\n find: \".USER_SETTINGS_PROFILE_THEME_ACCENT\",\n replacement: {\n match: /RESET_PROFILE_THEME}\\)(?<=color:(\\i),.{0,500}?color:(\\i),.{0,500}?)/,\n replace: \"$&,$self.addCopy3y3Button({primary:$1,accent:$2})\"\n }\n }\n ],\n settingsAboutComponent: () => (\n \n Usage\n \n After enabling this plugin, you will see custom colors in the profiles of other people using compatible plugins.
\n To set your own colors:\n
    \n
  • \u2022 go to your profile settings
  • \n
  • \u2022 choose your own colors in the Nitro preview
  • \n
  • \u2022 click the \"Copy 3y3\" button
  • \n
  • \u2022 paste the invisible text anywhere in your bio
  • \n

\n Please note: if you are using a theme which hides nitro ads, you should disable it temporarily to set colors.\n
\n
),\n settings,\n colorDecodeHook(user: UserProfile) {\n if (user) {\n // don't replace colors if already set with nitro\n if (settings.store.nitroFirst && user.themeColors) return user;\n const colors = decode(user.bio);\n if (colors) {\n return virtualMerge(user, {\n premiumType: 2,\n themeColors: colors\n });\n }\n }\n return user;\n },\n addCopy3y3Button: ErrorBoundary.wrap(function ({ primary, accent }: Colors) {\n return {\n const colorString = encode(primary, accent);\n copyWithToast(colorString);\n }}\n color={Button.Colors.PRIMARY}\n size={Button.Sizes.XLARGE}\n className={Margins.left16}\n >Copy 3y3\n ;\n }, { noop: true }),\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { EmojiStore } from \"@webpack/common\";\nimport { Emoji } from \"@webpack/types\";\n\ninterface EmojiAutocompleteState {\n query?: {\n type: string;\n typeInfo: {\n sentinel: string;\n };\n results: {\n emojis: Emoji[] & { sliceTo?: number; };\n };\n };\n}\n\nexport default definePlugin({\n name: \"FavoriteEmojiFirst\",\n authors: [Devs.Aria, Devs.Ven],\n description: \"Puts your favorite emoji first in the emoji autocomplete.\",\n patches: [\n {\n find: \"renderResults({results:\",\n replacement: [\n {\n // https://regex101.com/r/N7kpLM/1\n match: /let \\i=.{1,100}renderResults\\({results:(\\i)\\.query\\.results,/,\n replace: \"$self.sortEmojis($1);$&\"\n },\n ],\n },\n\n {\n find: \"MAX_AUTOCOMPLETE_RESULTS+\",\n replacement: [\n // set maxCount to Infinity so our sortEmojis callback gets the entire list, not just the first 10\n // and remove Discord's emojiResult slice, storing the endIndex on the array for us to use later\n {\n // https://regex101.com/r/x2mobQ/1\n // searchEmojis(...,maxCount: stuff) ... endEmojis = emojis.slice(0, maxCount - gifResults.length)\n match: /,maxCount:(\\i)(.{1,500}\\i)=(\\i)\\.slice\\(0,(\\i-\\i\\.length)\\)/,\n // ,maxCount:Infinity ... endEmojis = (emojis.sliceTo = n, emojis)\n replace: \",maxCount:Infinity$2=($3.sliceTo = $4, $3)\"\n }\n ]\n }\n ],\n\n sortEmojis({ query }: EmojiAutocompleteState) {\n if (\n query?.type !== \"EMOJIS_AND_STICKERS\"\n || query.typeInfo?.sentinel !== \":\"\n || !query.results?.emojis?.length\n ) return;\n\n const emojiContext = EmojiStore.getDisambiguatedEmojiContext();\n\n query.results.emojis = query.results.emojis.sort((a, b) => {\n const aIsFavorite = emojiContext.isFavoriteEmojiWithoutFetchingLatest(a);\n const bIsFavorite = emojiContext.isFavoriteEmojiWithoutFetchingLatest(b);\n\n if (aIsFavorite && !bIsFavorite) return -1;\n\n if (!aIsFavorite && bIsFavorite) return 1;\n\n return 0;\n }).slice(0, query.results.emojis.sliceTo ?? 10);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { useCallback, useEffect, useRef, useState } from \"@webpack/common\";\n\ninterface SearchBarComponentProps {\n ref?: React.MutableRefObject;\n autoFocus: boolean;\n className: string;\n size: string;\n onChange: (query: string) => void;\n onClear: () => void;\n query: string;\n placeholder: string;\n}\n\ntype TSearchBarComponent =\n React.FC & { Sizes: Record<\"SMALL\" | \"MEDIUM\" | \"LARGE\", string>; };\n\ninterface Gif {\n format: number;\n src: string;\n width: number;\n height: number;\n order: number;\n url: string;\n}\n\ninterface Instance {\n dead?: boolean;\n state: {\n resultType?: string;\n };\n props: {\n favCopy: Gif[],\n\n favorites: Gif[],\n },\n forceUpdate: () => void;\n}\n\n\nconst containerClasses: { searchBar: string; } = findByPropsLazy(\"searchBar\", \"searchBarFullRow\");\n\nexport const settings = definePluginSettings({\n searchOption: {\n type: OptionType.SELECT,\n description: \"The part of the url you want to search\",\n options: [\n {\n label: \"Entire Url\",\n value: \"url\"\n },\n {\n label: \"Path Only (/somegif.gif)\",\n value: \"path\"\n },\n {\n label: \"Host & Path (tenor.com somgif.gif)\",\n value: \"hostandpath\",\n default: true\n }\n ] as const\n }\n});\n\nexport default definePlugin({\n name: \"FavoriteGifSearch\",\n authors: [Devs.Aria],\n description: \"Adds a search bar to favorite gifs.\",\n\n patches: [\n {\n find: \"renderHeaderContent()\",\n replacement: [\n {\n // https://regex101.com/r/07gpzP/1\n // ($1 renderHeaderContent=function { ... switch (x) ... case FAVORITES:return) ($2) ($3 case default:return r.jsx(($), {...props}))\n match: /(renderHeaderContent\\(\\).{1,150}FAVORITES:return)(.{1,150});(case.{1,200}default:return\\(0,\\i\\.jsx\\)\\((?\\i\\..{1,10}),)/,\n replace: \"$1 this.state.resultType === 'Favorites' ? $self.renderSearchBar(this, $) : $2;$3\"\n },\n {\n // to persist filtered favorites when component re-renders.\n // when resizing the window the component rerenders and we loose the filtered favorites and have to type in the search bar to get them again\n match: /(,suggestions:\\i,favorites:)(\\i),/,\n replace: \"$1$self.getFav($2),favCopy:$2,\"\n }\n\n ]\n }\n ],\n\n settings,\n\n getTargetString,\n\n instance: null as Instance | null,\n renderSearchBar(instance: Instance, SearchBarComponent: TSearchBarComponent) {\n this.instance = instance;\n return (\n \n \n \n );\n },\n\n getFav(favorites: Gif[]) {\n if (!this.instance || this.instance.dead) return favorites;\n const { favorites: filteredFavorites } = this.instance.props;\n\n return filteredFavorites != null && filteredFavorites?.length !== favorites.length ? filteredFavorites : favorites;\n\n }\n});\n\n\nfunction SearchBar({ instance, SearchBarComponent }: { instance: Instance; SearchBarComponent: TSearchBarComponent; }) {\n const [query, setQuery] = useState(\"\");\n const ref = useRef<{ containerRef?: React.MutableRefObject; } | null>(null);\n\n const onChange = useCallback((searchQuery: string) => {\n setQuery(searchQuery);\n const { props } = instance;\n\n // return early\n if (searchQuery === \"\") {\n props.favorites = props.favCopy;\n instance.forceUpdate();\n return;\n }\n\n\n // scroll back to top\n ref.current?.containerRef?.current\n .closest(\"#gif-picker-tab-panel\")\n ?.querySelector(\"[class|=\\\"content\\\"]\")\n ?.firstElementChild?.scrollTo(0, 0);\n\n\n const result =\n props.favCopy\n .map(gif => ({\n score: fuzzySearch(searchQuery.toLowerCase(), getTargetString(gif.url ?? gif.src).replace(/(%20|[_-])/g, \" \").toLowerCase()),\n gif,\n }))\n .filter(m => m.score != null) as { score: number; gif: Gif; }[];\n\n result.sort((a, b) => b.score - a.score);\n props.favorites = result.map(e => e.gif);\n\n instance.forceUpdate();\n }, [instance.state]);\n\n useEffect(() => {\n return () => {\n instance.dead = true;\n };\n }, []);\n\n return (\n {\n setQuery(\"\");\n if (instance.props.favCopy != null) {\n instance.props.favorites = instance.props.favCopy;\n instance.forceUpdate();\n }\n }}\n query={query}\n placeholder=\"Search Favorite Gifs\"\n />\n );\n}\n\n\n\nexport function getTargetString(urlStr: string) {\n const url = new URL(urlStr);\n switch (settings.store.searchOption) {\n case \"url\":\n return url.href;\n case \"path\":\n if (url.host === \"media.discordapp.net\" || url.host === \"tenor.com\")\n // /attachments/899763415290097664/1095711736461537381/attachment-1.gif -> attachment-1.gif\n // /view/some-gif-hi-24248063 -> some-gif-hi-24248063\n return url.pathname.split(\"/\").at(-1) ?? url.pathname;\n return url.pathname;\n case \"hostandpath\":\n if (url.host === \"media.discordapp.net\" || url.host === \"tenor.com\")\n return `${url.host} ${url.pathname.split(\"/\").at(-1) ?? url.pathname}`;\n return `${url.host} ${url.pathname}`;\n\n default:\n return \"\";\n }\n}\n\nfunction fuzzySearch(searchQuery: string, searchString: string) {\n let searchIndex = 0;\n let score = 0;\n\n for (let i = 0; i < searchString.length; i++) {\n if (searchString[i] === searchQuery[searchIndex]) {\n score++;\n searchIndex++;\n } else {\n score--;\n }\n\n if (searchIndex === searchQuery.length) {\n return score;\n }\n }\n\n return null;\n}\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { makeRange } from \"@components/PluginSettings/components\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\n// The entire code of this plugin can be found in ipcPlugins\nexport default definePlugin({\n name: \"FixSpotifyEmbeds\",\n description: \"Fixes spotify embeds being incredibly loud by letting you customise the volume\",\n authors: [Devs.Ven],\n settings: definePluginSettings({\n volume: {\n type: OptionType.SLIDER,\n description: \"The volume % to set for spotify embeds. Anything above 10% is veeeery loud\",\n markers: makeRange(0, 100, 10),\n stickToMarkers: false,\n default: 10\n }\n })\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { GuildStore } from \"@webpack/common\";\nimport { Channel, User } from \"discord-types/general\";\n\nexport default definePlugin({\n name: \"ForceOwnerCrown\",\n description: \"Force the owner crown next to usernames even if the server is large.\",\n authors: [Devs.D3SOX, Devs.Nickyux],\n patches: [\n {\n find: \"AVATAR_DECORATION_PADDING:\",\n replacement: {\n match: /,isOwner:(\\i),/,\n replace: \",_isOwner:$1=$self.isGuildOwner(e),\"\n }\n }\n ],\n isGuildOwner(props: { user: User, channel: Channel, isOwner: boolean, guildId?: string; }) {\n if (!props?.user?.id) return props.isOwner;\n if (props.channel?.type === 3 /* GROUP_DM */)\n return props.isOwner;\n\n // guild id is in props twice, fallback if the first is undefined\n const guildId = props.guildId ?? props.channel?.guild_id;\n const userId = props.user.id;\n\n return GuildStore.getGuild(guildId)?.ownerId === userId;\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from \"@api/Commands\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { RestAPI, UserStore } from \"@webpack/common\";\n\nconst FriendInvites = findByPropsLazy(\"createFriendInvite\");\nconst uuid = findByPropsLazy(\"v4\", \"v1\");\n\nexport default definePlugin({\n name: \"FriendInvites\",\n description: \"Create and manage friend invite links via slash commands (/create friend invite, /view friend invites, /revoke friend invites).\",\n authors: [Devs.afn, Devs.Dziurwa],\n dependencies: [\"CommandsAPI\"],\n commands: [\n {\n name: \"create friend invite\",\n description: \"Generates a friend invite link.\",\n inputType: ApplicationCommandInputType.BOT,\n options: [{\n name: \"Uses\",\n description: \"How many uses?\",\n choices: [\n { label: \"1\", name: \"1\", value: \"1\" },\n { label: \"5\", name: \"5\", value: \"5\" }\n ],\n required: false,\n type: ApplicationCommandOptionType.INTEGER\n }],\n\n execute: async (args, ctx) => {\n const uses = findOption(args, \"Uses\", 5);\n\n if (uses === 1 && !UserStore.getCurrentUser().phone)\n return sendBotMessage(ctx.channel.id, {\n content: \"You need to have a phone number connected to your account to create a friend invite with 1 use!\"\n });\n\n let invite: any;\n if (uses === 1) {\n const random = uuid.v4();\n const { body: { invite_suggestions } } = await RestAPI.post({\n url: \"/friend-finder/find-friends\",\n body: {\n modified_contacts: {\n [random]: [1, \"\", \"\"]\n },\n phone_contact_methods_count: 1\n }\n });\n invite = await FriendInvites.createFriendInvite({\n code: invite_suggestions[0][3],\n recipient_phone_number_or_email: random,\n contact_visibility: 1,\n filter_visibilities: [],\n filtered_invite_suggestions_index: 1\n });\n } else {\n invite = await FriendInvites.createFriendInvite();\n }\n\n sendBotMessage(ctx.channel.id, {\n content: `\n discord.gg/${invite.code} \u00B7\n Expires: \u00B7\n Max uses: \\`${invite.max_uses}\\`\n `.trim().replace(/\\s+/g, \" \")\n });\n }\n },\n {\n name: \"view friend invites\",\n description: \"View a list of all generated friend invites.\",\n inputType: ApplicationCommandInputType.BOT,\n execute: async (_, ctx) => {\n const invites = await FriendInvites.getAllFriendInvites();\n const friendInviteList = invites.map(i =>\n `\n _discord.gg/${i.code}_ \u00B7\n Expires: \u00B7\n Times used: \\`${i.uses}/${i.max_uses}\\`\n `.trim().replace(/\\s+/g, \" \")\n );\n\n sendBotMessage(ctx.channel.id, {\n content: friendInviteList.join(\"\\n\") || \"You have no active friend invites!\"\n });\n },\n },\n {\n name: \"revoke friend invites\",\n description: \"Revokes all generated friend invites.\",\n inputType: ApplicationCommandInputType.BOT,\n execute: async (_, ctx) => {\n await FriendInvites.revokeFriendInvites();\n\n sendBotMessage(ctx.channel.id, {\n content: \"All friend invites have been revoked.\"\n });\n },\n },\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n(window.VencordStyles ??= new Map()).set(\"src/plugins/gameActivityToggle/style.css\", {\n name: \"src/plugins/gameActivityToggle/style.css\",\n source: \"[class*=\\\"withTagAsButton\\\"] {\\n min-width: 88px !important;\\n}\\n\",\n classNames: {},\n dom: null,\n});\n\nexport default \"src/plugins/gameActivityToggle/style.css\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { disableStyle, enableStyle } from \"@api/Styles\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findByCodeLazy } from \"@webpack\";\nimport { StatusSettingsStores } from \"@webpack/common\";\n\nimport style from \"./style.css?managed\";\n\nconst Button = findByCodeLazy(\"Button.Sizes.NONE,disabled:\");\n\nfunction makeIcon(showCurrentGame?: boolean) {\n return function () {\n return (\n \n \n {!showCurrentGame && <>\n \n \n \n \n \n }\n \n );\n };\n}\n\nfunction GameActivityToggleButton() {\n const showCurrentGame = StatusSettingsStores.ShowCurrentGame.useSetting();\n\n return (\n StatusSettingsStores.ShowCurrentGame.updateSetting(old => !old)}\n />\n );\n}\n\nexport default definePlugin({\n name: \"GameActivityToggle\",\n description: \"Adds a button next to the mic and deafen button to toggle game activity.\",\n authors: [Devs.Nuckyz, Devs.RuukuLada],\n\n patches: [\n {\n find: \".Messages.ACCOUNT_SPEAKING_WHILE_MUTED\",\n replacement: {\n match: /this\\.renderNameZone\\(\\).+?children:\\[/,\n replace: \"$&$self.GameActivityToggleButton(),\"\n }\n }\n ],\n\n GameActivityToggleButton: ErrorBoundary.wrap(GameActivityToggleButton, { noop: true }),\n\n start() {\n enableStyle(style);\n },\n\n stop() {\n disableStyle(style);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport { insertTextIntoChatInputBox } from \"@utils/discord\";\nimport definePlugin from \"@utils/types\";\nimport { filters, mapMangledModuleLazy } from \"@webpack\";\n\nconst ExpressionPickerState = mapMangledModuleLazy('name:\"expression-picker-last-active-view\"', {\n close: filters.byCode(\"activeView:null\", \"setState\")\n});\n\nexport default definePlugin({\n name: \"GifPaste\",\n description: \"Makes picking a gif in the gif picker insert a link into the chatbox instead of instantly sending it\",\n authors: [Devs.Ven],\n\n patches: [{\n find: \".handleSelectGIF=\",\n replacement: {\n match: /\\.handleSelectGIF=(\\i)=>\\{/,\n replace: \".handleSelectGIF=$1=>{if (!this.props.className) return $self.handleSelect($1);\"\n }\n }],\n\n handleSelect(gif?: { url: string; }) {\n if (gif) {\n insertTextIntoChatInputBox(gif.url + \" \");\n ExpressionPickerState.close();\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport { proxyLazy } from \"@utils/lazy\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByProps, findByPropsLazy } from \"@webpack\";\nimport { ContextMenu, FluxDispatcher, Menu } from \"@webpack/common\";\nimport { Channel, Message } from \"discord-types/general\";\n\ninterface Sticker {\n id: string;\n format_type: number;\n description: string;\n name: string;\n}\n\nenum GreetMode {\n Greet = \"Greet\",\n NormalMessage = \"Message\"\n}\n\nconst settings = definePluginSettings({\n greetMode: {\n type: OptionType.SELECT,\n options: [\n { label: \"Greet (you can only greet 3 times)\", value: GreetMode.Greet, default: true },\n { label: \"Normal Message (you can greet spam)\", value: GreetMode.NormalMessage }\n ],\n description: \"Choose the greet mode\"\n }\n}).withPrivateSettings<{\n multiGreetChoices?: string[];\n unholyMultiGreetEnabled?: boolean;\n}>();\n\nconst MessageActions = findByPropsLazy(\"sendGreetMessage\");\nconst WELCOME_STICKERS = proxyLazy(() => findByProps(\"WELCOME_STICKERS\")?.WELCOME_STICKERS);\n\nfunction greet(channel: Channel, message: Message, stickers: string[]) {\n const options = MessageActions.getSendMessageOptionsForReply({\n channel,\n message,\n shouldMention: true,\n showMentionToggle: true\n });\n\n if (settings.store.greetMode === GreetMode.NormalMessage || stickers.length > 1) {\n options.stickerIds = stickers;\n const msg = {\n content: \"\",\n tts: false,\n invalidEmojis: [],\n validNonShortcutEmojis: []\n };\n\n MessageActions._sendMessage(channel.id, msg, options);\n } else {\n MessageActions.sendGreetMessage(channel.id, stickers[0], options);\n }\n}\n\n\nfunction GreetMenu({ channel, message }: { message: Message, channel: Channel; }) {\n const s = settings.use([\"greetMode\", \"multiGreetChoices\"]);\n const { greetMode, multiGreetChoices = [] } = s;\n\n return (\n FluxDispatcher.dispatch({ type: \"CONTEXT_MENU_CLOSE\" })}\n aria-label=\"Greet Sticker Picker\"\n >\n \n {Object.values(GreetMode).map(mode => (\n s.greetMode = mode}\n />\n ))}\n \n\n \n\n \n {WELCOME_STICKERS.map(sticker => (\n greet(channel, message, [sticker.id])}\n />\n ))}\n \n\n {!settings.store.unholyMultiGreetEnabled ? null : (\n <>\n \n\n \n {WELCOME_STICKERS.map(sticker => {\n const checked = multiGreetChoices.some(s => s === sticker.id);\n\n return (\n = 3}\n action={() => {\n s.multiGreetChoices = checked\n ? multiGreetChoices.filter(s => s !== sticker.id)\n : [...multiGreetChoices, sticker.id];\n }}\n />\n );\n })}\n\n \n greet(channel, message, multiGreetChoices!)}\n disabled={multiGreetChoices.length === 0}\n />\n\n \n \n )}\n \n );\n}\n\nexport default definePlugin({\n name: \"GreetStickerPicker\",\n description: \"Allows you to use any greet sticker instead of only the random one by right-clicking the 'Wave to say hi!' button\",\n authors: [Devs.Ven],\n\n settings,\n\n patches: [\n {\n find: \"Messages.WELCOME_CTA_LABEL\",\n replacement: {\n match: /innerClassName:\\i\\.welcomeCTAButton,(?<={channel:\\i,message:\\i}=(\\i).{0,400}?)/,\n replace: \"$&onContextMenu:(vcEvent)=>$self.pickSticker(vcEvent, $1),\"\n }\n }\n ],\n\n pickSticker(\n event: React.UIEvent,\n props: {\n channel: Channel,\n message: Message;\n }\n ) {\n if (!(props.message as any).deleted)\n ContextMenu.open(event, () => );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Logger } from \"@utils/Logger\";\nimport { Channel, Message } from \"discord-types/general\";\nimport type { MouseEventHandler } from \"react\";\n\nconst logger = new Logger(\"MessagePopover\");\n\nexport interface ButtonItem {\n key?: string,\n label: string,\n icon: React.ComponentType,\n message: Message,\n channel: Channel,\n onClick?: MouseEventHandler,\n onContextMenu?: MouseEventHandler;\n}\n\nexport type getButtonItem = (message: Message) => ButtonItem | null;\n\nexport const buttons = new Map();\n\nexport function addButton(\n identifier: string,\n item: getButtonItem,\n) {\n buttons.set(identifier, item);\n}\n\nexport function removeButton(identifier: string) {\n buttons.delete(identifier);\n}\n\nexport function _buildPopoverElements(\n msg: Message,\n makeButton: (item: ButtonItem) => React.ComponentType\n) {\n const items = [] as React.ComponentType[];\n\n for (const [identifier, getItem] of buttons.entries()) {\n try {\n const item = getItem(msg);\n if (item) {\n item.key ??= identifier;\n items.push(makeButton(item));\n }\n } catch (err) {\n logger.error(`[${identifier}]`, err);\n }\n }\n\n return items;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { get, set } from \"@api/DataStore\";\nimport { addButton, removeButton } from \"@api/MessagePopover\";\nimport { ImageInvisible, ImageVisible } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { ChannelStore } from \"@webpack/common\";\n\nlet style: HTMLStyleElement;\n\nconst KEY = \"HideAttachments_HiddenIds\";\n\nlet hiddenMessages: Set = new Set();\nconst getHiddenMessages = () => get(KEY).then(set => {\n hiddenMessages = set ?? new Set();\n return hiddenMessages;\n});\nconst saveHiddenMessages = (ids: Set) => set(KEY, ids);\n\nexport default definePlugin({\n name: \"HideAttachments\",\n description: \"Hide attachments and Embeds for individual messages via hover button\",\n authors: [Devs.Ven],\n dependencies: [\"MessagePopoverAPI\"],\n\n async start() {\n style = document.createElement(\"style\");\n style.id = \"VencordHideAttachments\";\n document.head.appendChild(style);\n\n await getHiddenMessages();\n await this.buildCss();\n\n addButton(\"HideAttachments\", msg => {\n if (!msg.attachments.length && !msg.embeds.length && !msg.stickerItems.length) return null;\n\n const isHidden = hiddenMessages.has(msg.id);\n\n return {\n label: isHidden ? \"Show Attachments\" : \"Hide Attachments\",\n icon: isHidden ? ImageVisible : ImageInvisible,\n message: msg,\n channel: ChannelStore.getChannel(msg.channel_id),\n onClick: () => this.toggleHide(msg.id)\n };\n });\n },\n\n stop() {\n style.remove();\n hiddenMessages.clear();\n removeButton(\"HideAttachments\");\n },\n\n async buildCss() {\n const elements = [...hiddenMessages].map(id => `#message-accessories-${id}`).join(\",\");\n style.textContent = `\n :is(${elements}) :is([class*=\"embedWrapper\"], [class*=\"clickableSticker\"]) {\n /* important is not necessary, but add it to make sure bad themes won't break it */\n display: none !important;\n }\n :is(${elements})::after {\n content: \"Attachments hidden\";\n color: var(--text-muted);\n font-size: 80%;\n }\n `;\n },\n\n async toggleHide(id: string) {\n const ids = await getHiddenMessages();\n if (!ids.delete(id))\n ids.add(id);\n\n await saveHiddenMessages(ids);\n await this.buildCss();\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"iLoveSpam\",\n description: \"Do not hide messages from 'likely spammers'\",\n authors: [Devs.botato, Devs.Animal],\n patches: [\n {\n find: \"hasFlag:{writable\",\n replacement: {\n match: /if\\((\\i)<=(?:1<<30|1073741824)\\)return/,\n replace: \"if($1===(1<<20))return false;$&\",\n },\n },\n ],\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport * as DataStore from \"@api/DataStore\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { useForceUpdater } from \"@utils/react\";\nimport definePlugin from \"@utils/types\";\nimport { findStoreLazy } from \"@webpack\";\nimport { StatusSettingsStores, Tooltip } from \"webpack/common\";\n\nconst enum ActivitiesTypes {\n Game,\n Embedded\n}\n\ninterface IgnoredActivity {\n id: string;\n name: string;\n type: ActivitiesTypes;\n}\n\nconst RunningGameStore = findStoreLazy(\"RunningGameStore\");\n\nfunction ToggleIcon(activity: IgnoredActivity, tooltipText: string, path: string, fill: string) {\n const forceUpdate = useForceUpdater();\n\n return (\n \n {tooltipProps => (\n handleActivityToggle(e, activity, forceUpdate)}\n style={{ all: \"unset\", cursor: \"pointer\", display: \"flex\", justifyContent: \"center\", alignItems: \"center\" }}\n >\n \n \n \n \n )}\n \n );\n}\n\nconst ToggleIconOn = (activity: IgnoredActivity, fill: string) => ToggleIcon(activity, \"Disable Activity\", \"M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z\", fill);\nconst ToggleIconOff = (activity: IgnoredActivity, fill: string) => ToggleIcon(activity, \"Enable Activity\", \"m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z\", fill);\n\nfunction ToggleActivityComponent(activity: IgnoredActivity, isPlaying = false) {\n if (getIgnoredActivities().some(act => act.id === activity.id)) return ToggleIconOff(activity, \"var(--status-danger)\");\n return ToggleIconOn(activity, isPlaying ? \"var(--green-300)\" : \"var(--primary-400)\");\n}\n\nfunction handleActivityToggle(e: React.MouseEvent, activity: IgnoredActivity, forceUpdateButton: () => void) {\n e.stopPropagation();\n\n const ignoredActivityIndex = getIgnoredActivities().findIndex(act => act.id === activity.id);\n if (ignoredActivityIndex === -1) settings.store.ignoredActivities = getIgnoredActivities().concat(activity);\n else settings.store.ignoredActivities = getIgnoredActivities().filter((_, index) => index !== ignoredActivityIndex);\n\n // Trigger activities recalculation\n StatusSettingsStores.ShowCurrentGame.updateSetting(old => old);\n forceUpdateButton();\n}\n\nconst settings = definePluginSettings({}).withPrivateSettings<{\n ignoredActivities: IgnoredActivity[];\n}>();\n\nfunction getIgnoredActivities() {\n return settings.store.ignoredActivities ??= [];\n}\n\nexport default definePlugin({\n name: \"IgnoreActivities\",\n authors: [Devs.Nuckyz],\n description: \"Ignore activities from showing up on your status ONLY. You can configure which ones are ignored from the Registered Games and Activities tabs.\",\n\n settings,\n\n patches: [\n {\n find: '.displayName=\"LocalActivityStore\"',\n replacement: [\n {\n match: /LISTENING.+?}\\),(?<=(\\i)\\.push.+?)/,\n replace: (m, activities) => `${m}${activities}=${activities}.filter($self.isActivityNotIgnored),`\n }\n ]\n },\n {\n find: \".Messages.SETTINGS_GAMES_TOGGLE_OVERLAY\",\n replacement: {\n match: /\\.Messages\\.SETTINGS_GAMES_TOGGLE_OVERLAY.+?}\\(\\),(?<={overlay:\\i,.+?=(\\i),.+?)(?=!(\\i))/,\n replace: (m, props, nowPlaying) => `${m}$self.renderToggleGameActivityButton(${props},${nowPlaying}),`\n }\n },\n {\n find: \".activityTitleText,variant\",\n replacement: {\n match: /(?<=\\i\\.activityTitleText.+?children:(\\i)\\.name.*?}\\),)/,\n replace: (_, props) => `$self.renderToggleActivityButton(${props}),`\n },\n },\n {\n find: \".activityCardDetails,children\",\n replacement: {\n match: /(?<=\\i\\.activityCardDetails.+?children:(\\i\\.application)\\.name.*?}\\),)/,\n replace: (_, props) => `$self.renderToggleActivityButton(${props}),`\n }\n }\n ],\n\n async start() {\n const oldIgnoredActivitiesData = await DataStore.get>(\"IgnoreActivities_ignoredActivities\");\n\n if (oldIgnoredActivitiesData != null) {\n settings.store.ignoredActivities = Array.from(oldIgnoredActivitiesData.values())\n .map(activity => ({ ...activity, name: \"Unknown Name\" }));\n\n DataStore.del(\"IgnoreActivities_ignoredActivities\");\n }\n\n if (getIgnoredActivities().length !== 0) {\n const gamesSeen = RunningGameStore.getGamesSeen() as { id?: string; exePath: string; }[];\n\n for (const [index, ignoredActivity] of getIgnoredActivities().entries()) {\n if (ignoredActivity.type !== ActivitiesTypes.Game) continue;\n\n if (!gamesSeen.some(game => game.id === ignoredActivity.id || game.exePath === ignoredActivity.id)) {\n getIgnoredActivities().splice(index, 1);\n }\n }\n }\n },\n\n isActivityNotIgnored(props: { type: number; application_id?: string; name?: string; }) {\n if (props.type === 0 || props.type === 3) {\n if (props.application_id != null) return !getIgnoredActivities().some(activity => activity.id === props.application_id);\n else {\n const exePath = RunningGameStore.getRunningGames().find(game => game.name === props.name)?.exePath;\n if (exePath) return !getIgnoredActivities().some(activity => activity.id === exePath);\n }\n }\n return true;\n },\n\n renderToggleGameActivityButton(props: { id?: string; name: string, exePath: string; }, nowPlaying: boolean) {\n return (\n \n
\n {ToggleActivityComponent({ id: props.id ?? props.exePath, name: props.name, type: ActivitiesTypes.Game }, nowPlaying)}\n
\n
\n );\n },\n\n renderToggleActivityButton(props: { id: string; name: string; }) {\n return (\n \n {ToggleActivityComponent({ id: props.id, name: props.name, type: ActivitiesTypes.Embedded })}\n \n );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const ELEMENT_ID = \"vc-imgzoom-magnify-modal\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function waitFor(condition: () => boolean, cb: () => void) {\n if (condition()) cb();\n else requestAnimationFrame(() => waitFor(condition, cb));\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { classNameFactory } from \"@api/Styles\";\nimport { FluxDispatcher, React, useRef, useState } from \"@webpack/common\";\n\nimport { ELEMENT_ID } from \"../constants\";\nimport { settings } from \"../index\";\nimport { waitFor } from \"../utils/waitFor\";\n\ninterface Vec2 {\n x: number,\n y: number;\n}\n\nexport interface MagnifierProps {\n zoom: number;\n size: number,\n instance: any;\n}\n\nconst cl = classNameFactory(\"vc-imgzoom-\");\n\nexport const Magnifier: React.FC = ({ instance, size: initialSize, zoom: initalZoom }) => {\n const [ready, setReady] = useState(false);\n\n const [lensPosition, setLensPosition] = useState({ x: 0, y: 0 });\n const [imagePosition, setImagePosition] = useState({ x: 0, y: 0 });\n const [opacity, setOpacity] = useState(0);\n\n const isShiftDown = useRef(false);\n\n const zoom = useRef(initalZoom);\n const size = useRef(initialSize);\n\n const element = useRef(null);\n const currentVideoElementRef = useRef(null);\n const originalVideoElementRef = useRef(null);\n const imageRef = useRef(null);\n\n // since we accessing document im gonna use useLayoutEffect\n React.useLayoutEffect(() => {\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Shift\") {\n isShiftDown.current = true;\n }\n };\n const onKeyUp = (e: KeyboardEvent) => {\n if (e.key === \"Shift\") {\n isShiftDown.current = false;\n }\n };\n const syncVideos = () => {\n currentVideoElementRef.current!.currentTime = originalVideoElementRef.current!.currentTime;\n };\n\n const updateMousePosition = (e: MouseEvent) => {\n if (instance.state.mouseOver && instance.state.mouseDown) {\n const offset = size.current / 2;\n const pos = { x: e.pageX, y: e.pageY };\n const x = -((pos.x - element.current!.getBoundingClientRect().left) * zoom.current - offset);\n const y = -((pos.y - element.current!.getBoundingClientRect().top) * zoom.current - offset);\n setLensPosition({ x: e.x - offset, y: e.y - offset });\n setImagePosition({ x, y });\n setOpacity(1);\n } else {\n setOpacity(0);\n }\n\n };\n\n const onMouseDown = (e: MouseEvent) => {\n if (instance.state.mouseOver && e.button === 0 /* left click */) {\n zoom.current = settings.store.zoom;\n size.current = settings.store.size;\n\n // close context menu if open\n if (document.getElementById(\"image-context\")) {\n FluxDispatcher.dispatch({ type: \"CONTEXT_MENU_CLOSE\" });\n }\n\n updateMousePosition(e);\n setOpacity(1);\n }\n };\n\n const onMouseUp = () => {\n setOpacity(0);\n if (settings.store.saveZoomValues) {\n settings.store.zoom = zoom.current;\n settings.store.size = size.current;\n }\n };\n\n const onWheel = async (e: WheelEvent) => {\n if (instance.state.mouseOver && instance.state.mouseDown && !isShiftDown.current) {\n const val = zoom.current + ((e.deltaY / 100) * (settings.store.invertScroll ? -1 : 1)) * settings.store.zoomSpeed;\n zoom.current = val <= 1 ? 1 : val;\n updateMousePosition(e);\n }\n if (instance.state.mouseOver && instance.state.mouseDown && isShiftDown.current) {\n const val = size.current + (e.deltaY * (settings.store.invertScroll ? -1 : 1)) * settings.store.zoomSpeed;\n size.current = val <= 50 ? 50 : val;\n updateMousePosition(e);\n }\n };\n\n waitFor(() => instance.state.readyState === \"READY\", () => {\n const elem = document.getElementById(ELEMENT_ID) as HTMLDivElement;\n element.current = elem;\n elem.firstElementChild!.setAttribute(\"draggable\", \"false\");\n if (instance.props.animated) {\n originalVideoElementRef.current = elem!.querySelector(\"video\")!;\n originalVideoElementRef.current.addEventListener(\"timeupdate\", syncVideos);\n setReady(true);\n } else {\n setReady(true);\n }\n });\n document.addEventListener(\"keydown\", onKeyDown);\n document.addEventListener(\"keyup\", onKeyUp);\n document.addEventListener(\"mousemove\", updateMousePosition);\n document.addEventListener(\"mousedown\", onMouseDown);\n document.addEventListener(\"mouseup\", onMouseUp);\n document.addEventListener(\"wheel\", onWheel);\n return () => {\n document.removeEventListener(\"keydown\", onKeyDown);\n document.removeEventListener(\"keyup\", onKeyUp);\n document.removeEventListener(\"mousemove\", updateMousePosition);\n document.removeEventListener(\"mousedown\", onMouseDown);\n document.removeEventListener(\"mouseup\", onMouseUp);\n document.removeEventListener(\"wheel\", onWheel);\n\n if (settings.store.saveZoomValues) {\n settings.store.zoom = zoom.current;\n settings.store.size = size.current;\n }\n };\n }, []);\n\n if (!ready) return null;\n\n const box = element.current!.getBoundingClientRect();\n\n return (\n \n {instance.props.animated ?\n (\n \n ) : (\n \n )}\n \n );\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n(window.VencordStyles ??= new Map()).set(\"src/plugins/imageZoom/styles.css\", {\n name: \"src/plugins/imageZoom/styles.css\",\n source: \".vc-imgzoom-lens {\\n position: absolute;\\n inset: 0;\\n z-index: 9999;\\n border: 2px solid grey;\\n border-radius: 50%;\\n overflow: hidden;\\n cursor: none;\\n box-shadow: inset 0 0 10px 2px grey;\\n filter: drop-shadow(0 0 2px grey);\\n pointer-events: none;\\n}\\n\\n.vc-imgzoom-square {\\n border-radius: 0;\\n}\\n\\n.vc-imgzoom-nearest-neighbor>img {\\n image-rendering: pixelated;\\n\\n /* https://googlechrome.github.io/samples/image-rendering-pixelated/index.html */\\n}\\n\\n/* make the carousel take up less space so we can click the backdrop and exit out of it */\\n[class*=\\\"modalCarouselWrapper_\\\"] {\\n top: 0 !important;\\n}\\n\\n[class*=\\\"carouselModal_\\\"] {\\n height: 0 !important;\\n}\\n\",\n classNames: {},\n dom: null,\n});\n\nexport default \"src/plugins/imageZoom/styles.css\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport { disableStyle, enableStyle } from \"@api/Styles\";\nimport { makeRange } from \"@components/PluginSettings/components\";\nimport { Devs } from \"@utils/constants\";\nimport { debounce } from \"@utils/debounce\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { ContextMenu, Menu, React, ReactDOM } from \"@webpack/common\";\nimport type { Root } from \"react-dom/client\";\n\nimport { Magnifier, MagnifierProps } from \"./components/Magnifier\";\nimport { ELEMENT_ID } from \"./constants\";\nimport styles from \"./styles.css?managed\";\n\nexport const settings = definePluginSettings({\n saveZoomValues: {\n type: OptionType.BOOLEAN,\n description: \"Whether to save zoom and lens size values\",\n default: true,\n },\n\n invertScroll: {\n type: OptionType.BOOLEAN,\n description: \"Invert scroll\",\n default: true,\n },\n\n nearestNeighbour: {\n type: OptionType.BOOLEAN,\n description: \"Use Nearest Neighbour Interpolation when scaling images\",\n default: false,\n },\n\n square: {\n type: OptionType.BOOLEAN,\n description: \"Make the lens square\",\n default: false,\n },\n\n zoom: {\n description: \"Zoom of the lens\",\n type: OptionType.SLIDER,\n markers: makeRange(1, 50, 4),\n default: 2,\n stickToMarkers: false,\n },\n size: {\n description: \"Radius / Size of the lens\",\n type: OptionType.SLIDER,\n markers: makeRange(50, 1000, 50),\n default: 100,\n stickToMarkers: false,\n },\n\n zoomSpeed: {\n description: \"How fast the zoom / lens size changes\",\n type: OptionType.SLIDER,\n markers: makeRange(0.1, 5, 0.2),\n default: 0.5,\n stickToMarkers: false,\n },\n});\n\n\nconst imageContextMenuPatch: NavContextMenuPatchCallback = children => () => {\n children.push(\n \n {\n settings.store.square = !settings.store.square;\n ContextMenu.close();\n }}\n />\n {\n settings.store.nearestNeighbour = !settings.store.nearestNeighbour;\n ContextMenu.close();\n }}\n />\n (\n settings.store.zoom = value, 100)}\n />\n )}\n />\n (\n settings.store.size = value, 100)}\n />\n )}\n />\n (\n settings.store.zoomSpeed = value, 100)}\n renderValue={(value: number) => `${value.toFixed(3)}x`}\n />\n )}\n />\n \n );\n};\n\nexport default definePlugin({\n name: \"ImageZoom\",\n description: \"Lets you zoom in to images and gifs. Use scroll wheel to zoom in and shift + scroll wheel to increase lens radius / size\",\n authors: [Devs.Aria],\n tags: [\"ImageUtilities\"],\n\n patches: [\n {\n find: \"Messages.OPEN_IN_BROWSER\",\n replacement: {\n // there are 2 image thingies. one for carosuel and one for the single image.\n // so thats why i added global flag.\n // also idk if this patch is good, should it be more specific?\n // https://regex101.com/r/xfvNvV/1\n match: /return.{1,200}\\.wrapper.{1,200}src:\\i,/g,\n replace: `$&id: '${ELEMENT_ID}',`\n }\n },\n\n {\n find: \"handleImageLoad=\",\n replacement: [\n {\n match: /showThumbhashPlaceholder:\\i,/,\n replace: \"...$self.makeProps(this),$&\"\n },\n\n {\n match: /componentDidMount\\(\\){/,\n replace: \"$&$self.renderMagnifier(this);\",\n },\n\n {\n match: /componentWillUnmount\\(\\){/,\n replace: \"$&$self.unMountMagnifier();\"\n }\n ]\n },\n {\n find: \".carouselModal\",\n replacement: {\n match: /(?<=\\.carouselModal.{0,100}onClick:)\\i,/,\n replace: \"()=>{},\"\n }\n }\n ],\n\n settings,\n\n // to stop from rendering twice /shrug\n currentMagnifierElement: null as React.FunctionComponentElement | null,\n element: null as HTMLDivElement | null,\n\n Magnifier,\n root: null as Root | null,\n makeProps(instance) {\n return {\n onMouseOver: () => this.onMouseOver(instance),\n onMouseOut: () => this.onMouseOut(instance),\n onMouseDown: (e: React.MouseEvent) => this.onMouseDown(e, instance),\n onMouseUp: () => this.onMouseUp(instance),\n id: instance.props.id,\n };\n },\n\n renderMagnifier(instance) {\n if (instance.props.id === ELEMENT_ID) {\n if (!this.currentMagnifierElement) {\n this.currentMagnifierElement = ;\n this.root = ReactDOM.createRoot(this.element!);\n this.root.render(this.currentMagnifierElement);\n }\n }\n },\n\n unMountMagnifier() {\n this.root?.unmount();\n this.currentMagnifierElement = null;\n this.root = null;\n },\n\n onMouseOver(instance) {\n instance.setState((state: any) => ({ ...state, mouseOver: true }));\n },\n onMouseOut(instance) {\n instance.setState((state: any) => ({ ...state, mouseOver: false }));\n },\n onMouseDown(e: React.MouseEvent, instance) {\n if (e.button === 0 /* left */)\n instance.setState((state: any) => ({ ...state, mouseDown: true }));\n },\n onMouseUp(instance) {\n instance.setState((state: any) => ({ ...state, mouseDown: false }));\n },\n\n start() {\n enableStyle(styles);\n addContextMenuPatch(\"image-context\", imageContextMenuPatch);\n this.element = document.createElement(\"div\");\n this.element.classList.add(\"MagnifierContainer\");\n document.body.appendChild(this.element);\n },\n\n stop() {\n disableStyle(styles);\n // so componenetWillUnMount gets called if Magnifier component is still alive\n this.root && this.root.unmount();\n this.element?.remove();\n removeContextMenuPatch(\"image-context\", imageContextMenuPatch);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport {\n ModalContent,\n ModalFooter,\n ModalHeader,\n ModalRoot,\n openModal,\n} from \"@utils/modal\";\nimport { Button, Forms, React, TextInput } from \"@webpack/common\";\n\nimport { decrypt } from \"../index\";\n\nexport function DecModal(props: any) {\n const encryptedMessage: string = props?.message?.content;\n const [password, setPassword] = React.useState(\"password\");\n\n return (\n \n \n Decrypt Message\n \n\n \n Message with Encryption\n \n Password\n \n \n\n \n {\n const toSend = decrypt(encryptedMessage, password, true);\n if (!toSend || !props?.message) return;\n // @ts-expect-error\n Vencord.Plugins.plugins.InvisibleChat.buildEmbed(props?.message, toSend);\n props.onClose();\n }}>\n Decrypt\n \n \n Cancel\n \n \n \n );\n}\n\nexport function buildDecModal(msg: any): any {\n openModal((props: any) => );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { insertTextIntoChatInputBox } from \"@utils/discord\";\nimport {\n ModalContent,\n ModalFooter,\n ModalHeader,\n ModalProps,\n ModalRoot,\n openModal,\n} from \"@utils/modal\";\nimport { Button, Forms, React, Switch, TextInput } from \"@webpack/common\";\n\nimport { encrypt } from \"../index\";\n\nfunction EncModal(props: ModalProps) {\n const [secret, setSecret] = React.useState(\"\");\n const [cover, setCover] = React.useState(\"\");\n const [password, setPassword] = React.useState(\"password\");\n const [noCover, setNoCover] = React.useState(false);\n\n const isValid = secret && (noCover || (cover && cover.trim().split(\" \").length > 1));\n\n return (\n \n \n Encrypt Message\n \n\n \n Secret\n {\n setSecret(e);\n }}\n />\n Cover (2 or more Words!!)\n {\n setCover(e);\n }}\n />\n Password\n {\n setPassword(e);\n }}\n />\n {\n setNoCover(e);\n }}\n >\n Don't use a Cover\n \n \n\n \n {\n if (!isValid) return;\n const encrypted = encrypt(secret, password, noCover ? \"d d\" : cover);\n const toSend = noCover ? encrypted.replaceAll(\"d\", \"\") : encrypted;\n if (!toSend) return;\n\n insertTextIntoChatInputBox(toSend);\n\n props.onClose();\n }}\n >\n Send\n \n {\n props.onClose();\n }}\n >\n Cancel\n \n \n \n );\n}\n\nexport function buildEncModal(): any {\n openModal(props => );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addButton, removeButton } from \"@api/MessagePopover\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { getStegCloak } from \"@utils/dependencies\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Button, ButtonLooks, ButtonWrapperClasses, ChannelStore, FluxDispatcher, RestAPI, Tooltip } from \"@webpack/common\";\nimport { Message } from \"discord-types/general\";\n\nimport { buildDecModal } from \"./components/DecryptionModal\";\nimport { buildEncModal } from \"./components/EncryptionModal\";\n\nlet steggo: any;\n\nfunction PopOverIcon() {\n return (\n\n \n \n \n );\n}\n\n\nfunction Indicator() {\n return (\n \n\n );\n\n}\n\nfunction ChatBarIcon(chatBoxProps: {\n type: {\n analyticsName: string;\n };\n}) {\n if (chatBoxProps.type.analyticsName !== \"normal\") return null;\n\n return (\n \n {({ onMouseEnter, onMouseLeave }) => (\n // size=\"\" = Button.Sizes.NONE\n /*\n many themes set \"> button\" to display: none, as the gift button is\n the only directly descending button (all the other elements are divs.)\n Thus, wrap in a div here to avoid getting hidden by that.\n flex is for some reason necessary as otherwise the button goes flying off\n */\n
\n buildEncModal()}\n style={{ padding: \"0 2px\", scale: \"0.9\" }}\n >\n
\n \n \n \n
\n \n
\n )\n }\n
\n );\n}\n\nconst settings = definePluginSettings({\n savedPasswords: {\n type: OptionType.STRING,\n default: \"password, Password\",\n description: \"Saved Passwords (Seperated with a , )\"\n }\n});\n\nexport default definePlugin({\n name: \"InvisibleChat\",\n description: \"Encrypt your Messages in a non-suspicious way!\",\n authors: [Devs.SammCheese],\n dependencies: [\"MessagePopoverAPI\"],\n patches: [\n {\n // Indicator\n find: \".Messages.MESSAGE_EDITED,\",\n replacement: {\n match: /let\\{className:\\i,message:\\i[^}]*\\}=(\\i)/,\n replace: \"try {$1 && $self.INV_REGEX.test($1.message.content) ? $1.content.push($self.indicator()) : null } catch {};$&\"\n }\n },\n {\n find: \"ChannelTextAreaButtons\",\n replacement: {\n match: /(\\i)\\.push.{1,30}disabled:(\\i),.{1,20}\\},\"gift\"\\)\\)/,\n replace: \"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()\",\n }\n },\n ],\n\n EMBED_API_URL: \"https://embed.sammcheese.net\",\n INV_REGEX: new RegExp(/( \\u200c|\\u200d |[\\u2060-\\u2064])[^\\u200b]/),\n URL_REGEX: new RegExp(\n /(http(s)?:\\/\\/.)?(www\\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/,\n ),\n settings,\n async start() {\n const { default: StegCloak } = await getStegCloak();\n steggo = new StegCloak(true, false);\n\n addButton(\"invDecrypt\", message => {\n return this.INV_REGEX.test(message?.content)\n ? {\n label: \"Decrypt Message\",\n icon: this.popOverIcon,\n message: message,\n channel: ChannelStore.getChannel(message.channel_id),\n onClick: async () => {\n await iteratePasswords(message).then((res: string | false) => {\n if (res) return void this.buildEmbed(message, res);\n return void buildDecModal({ message });\n });\n }\n }\n : null;\n });\n },\n\n stop() {\n removeButton(\"invDecrypt\");\n },\n\n // Gets the Embed of a Link\n async getEmbed(url: URL): Promise {\n const { body } = await RestAPI.post({\n url: \"/unfurler/embed-urls\",\n body: {\n urls: [url]\n }\n });\n return await body.embeds[0];\n },\n\n async buildEmbed(message: any, revealed: string): Promise {\n const urlCheck = revealed.match(this.URL_REGEX);\n\n message.embeds.push({\n type: \"rich\",\n title: \"Decrypted Message\",\n color: \"0x45f5f5\",\n description: revealed,\n footer: {\n text: \"Made with \u2764\uFE0F by c0dine and Sammy!\",\n },\n });\n\n if (urlCheck?.length) {\n const embed = await this.getEmbed(new URL(urlCheck[0]));\n if (embed)\n message.embeds.push(embed);\n }\n\n this.updateMessage(message);\n },\n\n updateMessage: (message: any) => {\n FluxDispatcher.dispatch({\n type: \"MESSAGE_UPDATE\",\n message,\n });\n },\n\n chatBarIcon: ErrorBoundary.wrap(ChatBarIcon, { noop: true }),\n popOverIcon: () => ,\n indicator: ErrorBoundary.wrap(Indicator, { noop: true })\n});\n\nexport function encrypt(secret: string, password: string, cover: string): string {\n return steggo.hide(secret + \"\\u200b\", password, cover);\n}\n\nexport function decrypt(encrypted: string, password: string, removeIndicator: boolean): string {\n const decrypted = steggo.reveal(encrypted, password);\n return removeIndicator ? decrypted.replace(\"\\u200b\", \"\") : decrypted;\n}\n\nexport function isCorrectPassword(result: string): boolean {\n return result.endsWith(\"\\u200b\");\n}\n\nexport async function iteratePasswords(message: Message): Promise {\n const passwords = settings.store.savedPasswords.split(\",\").map(s => s.trim());\n\n if (!message?.content || !passwords?.length) return false;\n\n let { content } = message;\n\n // we use an extra variable so we dont have to edit the message content directly\n if (/^\\W/.test(message.content)) content = `d ${message.content}d`;\n\n for (let i = 0; i < passwords.length; i++) {\n const result = decrypt(content, passwords[i], false);\n if (isCorrectPassword(result)) {\n return result;\n }\n }\n\n return false;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport * as DataStore from \"@api/DataStore\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { ChannelStore, NavigationRouter, SelectedChannelStore, SelectedGuildStore } from \"@webpack/common\";\n\nexport interface LogoutEvent {\n type: \"LOGOUT\";\n isSwitchingAccount: boolean;\n}\n\ninterface ChannelSelectEvent {\n type: \"CHANNEL_SELECT\";\n channelId: string | null;\n guildId: string | null;\n}\n\ninterface PreviousChannel {\n guildId: string | null;\n channelId: string | null;\n}\n\nlet isSwitchingAccount = false;\nlet previousCache: PreviousChannel | undefined;\n\nfunction attemptToNavigateToChannel(guildId: string | null, channelId: string) {\n if (!ChannelStore.hasChannel(channelId)) return;\n NavigationRouter.transitionTo(`/channels/${guildId ?? \"@me\"}/${channelId}`);\n}\n\nexport default definePlugin({\n name: \"KeepCurrentChannel\",\n description: \"Attempt to navigate to the channel you were in before switching accounts or loading Discord.\",\n authors: [Devs.Nuckyz],\n\n flux: {\n LOGOUT(e: LogoutEvent) {\n ({ isSwitchingAccount } = e);\n },\n\n CONNECTION_OPEN() {\n if (!isSwitchingAccount) return;\n isSwitchingAccount = false;\n\n if (previousCache?.channelId)\n attemptToNavigateToChannel(previousCache.guildId, previousCache.channelId);\n },\n\n async CHANNEL_SELECT({ guildId, channelId }: ChannelSelectEvent) {\n if (isSwitchingAccount) return;\n\n previousCache = {\n guildId,\n channelId\n };\n await DataStore.set(\"KeepCurrentChannel_previousData\", previousCache);\n }\n },\n\n async start() {\n previousCache = await DataStore.get(\"KeepCurrentChannel_previousData\");\n if (!previousCache) {\n previousCache = {\n guildId: SelectedGuildStore.getGuildId(),\n channelId: SelectedChannelStore.getChannelId() ?? null\n };\n\n await DataStore.set(\"KeepCurrentChannel_previousData\", previousCache);\n } else if (previousCache.channelId) {\n attemptToNavigateToChannel(previousCache.guildId, previousCache.channelId);\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Sofia Lima\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Link } from \"@components/Link\";\nimport { Devs } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ApplicationAssetUtils, FluxDispatcher, Forms } from \"@webpack/common\";\n\ninterface ActivityAssets {\n large_image?: string;\n large_text?: string;\n small_image?: string;\n small_text?: string;\n}\n\n\ninterface ActivityButton {\n label: string;\n url: string;\n}\n\ninterface Activity {\n state: string;\n details?: string;\n timestamps?: {\n start?: number;\n };\n assets?: ActivityAssets;\n buttons?: Array;\n name: string;\n application_id: string;\n metadata?: {\n button_urls?: Array;\n };\n type: number;\n flags: number;\n}\n\ninterface TrackData {\n name: string;\n album: string;\n artist: string;\n url: string;\n imageUrl?: string;\n}\n\n// only relevant enum values\nconst enum ActivityType {\n PLAYING = 0,\n LISTENING = 2,\n}\n\nconst enum ActivityFlag {\n INSTANCE = 1 << 0,\n}\n\nconst enum NameFormat {\n StatusName = \"status-name\",\n ArtistFirst = \"artist-first\",\n SongFirst = \"song-first\",\n ArtistOnly = \"artist\",\n SongOnly = \"song\"\n}\n\nconst applicationId = \"1108588077900898414\";\nconst placeholderId = \"2a96cbd8b46e442fc41c2b86b821562f\";\n\nconst logger = new Logger(\"LastFMRichPresence\");\n\nconst presenceStore = findByPropsLazy(\"getLocalPresence\");\n\nasync function getApplicationAsset(key: string): Promise {\n return (await ApplicationAssetUtils.fetchAssetIds(applicationId, [key]))[0];\n}\n\nfunction setActivity(activity: Activity | null) {\n FluxDispatcher.dispatch({\n type: \"LOCAL_ACTIVITY_UPDATE\",\n activity,\n socketId: \"LastFM\",\n });\n}\n\nconst settings = definePluginSettings({\n username: {\n description: \"last.fm username\",\n type: OptionType.STRING,\n },\n apiKey: {\n description: \"last.fm api key\",\n type: OptionType.STRING,\n },\n shareUsername: {\n description: \"show link to last.fm profile\",\n type: OptionType.BOOLEAN,\n default: false,\n },\n hideWithSpotify: {\n description: \"hide last.fm presence if spotify is running\",\n type: OptionType.BOOLEAN,\n default: true,\n },\n statusName: {\n description: \"custom status text\",\n type: OptionType.STRING,\n default: \"some music\",\n },\n nameFormat: {\n description: \"Show name of song and artist in status name\",\n type: OptionType.SELECT,\n options: [\n {\n label: \"Use custom status name\",\n value: NameFormat.StatusName,\n default: true\n },\n {\n label: \"Use format 'artist - song'\",\n value: NameFormat.ArtistFirst\n },\n {\n label: \"Use format 'song - artist'\",\n value: NameFormat.SongFirst\n },\n {\n label: \"Use artist name only\",\n value: NameFormat.ArtistOnly\n },\n {\n label: \"Use song name only\",\n value: NameFormat.SongOnly\n }\n ],\n },\n useListeningStatus: {\n description: 'show \"Listening to\" status instead of \"Playing\"',\n type: OptionType.BOOLEAN,\n default: false,\n },\n missingArt: {\n description: \"When album or album art is missing\",\n type: OptionType.SELECT,\n options: [\n {\n label: \"Use large Last.fm logo\",\n value: \"lastfmLogo\",\n default: true\n },\n {\n label: \"Use generic placeholder\",\n value: \"placeholder\"\n }\n ],\n },\n});\n\nexport default definePlugin({\n name: \"LastFMRichPresence\",\n description: \"Little plugin for Last.fm rich presence\",\n authors: [Devs.dzshn, Devs.RuiNtD, Devs.blahajZip, Devs.archeruwu],\n\n settingsAboutComponent: () => (\n <>\n How to get an API key\n \n An API key is required to fetch your current track. To get one, you can\n visit this page and\n fill in the following information:

\n\n Application name: Discord Rich Presence
\n Application description: (personal use)

\n\n And copy the API key (not the shared secret!)\n
\n \n ),\n\n settings,\n\n start() {\n this.updatePresence();\n this.updateInterval = setInterval(() => { this.updatePresence(); }, 16000);\n },\n\n stop() {\n clearInterval(this.updateInterval);\n },\n\n async fetchTrackData(): Promise {\n if (!settings.store.username || !settings.store.apiKey)\n return null;\n\n try {\n const params = new URLSearchParams({\n method: \"user.getrecenttracks\",\n api_key: settings.store.apiKey,\n user: settings.store.username,\n limit: \"1\",\n format: \"json\"\n });\n\n const res = await fetch(`https://ws.audioscrobbler.com/2.0/?${params}`);\n if (!res.ok) throw `${res.status} ${res.statusText}`;\n\n const json = await res.json();\n if (json.error) {\n logger.error(\"Error from Last.fm API\", `${json.error}: ${json.message}`);\n return null;\n }\n\n const trackData = json.recenttracks?.track[0];\n\n if (!trackData?.[\"@attr\"]?.nowplaying)\n return null;\n\n // why does the json api have xml structure\n return {\n name: trackData.name || \"Unknown\",\n album: trackData.album[\"#text\"],\n artist: trackData.artist[\"#text\"] || \"Unknown\",\n url: trackData.url,\n imageUrl: trackData.image?.find((x: any) => x.size === \"large\")?.[\"#text\"]\n };\n } catch (e) {\n logger.error(\"Failed to query Last.fm API\", e);\n // will clear the rich presence if API fails\n return null;\n }\n },\n\n async updatePresence() {\n setActivity(await this.getActivity());\n },\n\n getLargeImage(track: TrackData): string | undefined {\n if (track.imageUrl && !track.imageUrl.includes(placeholderId))\n return track.imageUrl;\n\n if (settings.store.missingArt === \"placeholder\")\n return \"placeholder\";\n },\n\n async getActivity(): Promise {\n if (settings.store.hideWithSpotify) {\n for (const activity of presenceStore.getActivities()) {\n if (activity.type === ActivityType.LISTENING && activity.application_id !== applicationId) {\n // there is already music status because of Spotify or richerCider (probably more)\n return null;\n }\n }\n }\n\n const trackData = await this.fetchTrackData();\n if (!trackData) return null;\n\n const largeImage = this.getLargeImage(trackData);\n const assets: ActivityAssets = largeImage ?\n {\n large_image: await getApplicationAsset(largeImage),\n large_text: trackData.album || undefined,\n small_image: await getApplicationAsset(\"lastfm-small\"),\n small_text: \"Last.fm\",\n } : {\n large_image: await getApplicationAsset(\"lastfm-large\"),\n large_text: trackData.album || undefined,\n };\n\n const buttons: ActivityButton[] = [\n {\n label: \"View Song\",\n url: trackData.url,\n },\n ];\n\n if (settings.store.shareUsername)\n buttons.push({\n label: \"Last.fm Profile\",\n url: `https://www.last.fm/user/${settings.store.username}`,\n });\n\n const statusName = (() => {\n switch (settings.store.nameFormat) {\n case NameFormat.ArtistFirst:\n return trackData.artist + \" - \" + trackData.name;\n case NameFormat.SongFirst:\n return trackData.name + \" - \" + trackData.artist;\n case NameFormat.ArtistOnly:\n return trackData.artist;\n case NameFormat.SongOnly:\n return trackData.name;\n default:\n return settings.store.statusName;\n }\n })();\n\n return {\n application_id: applicationId,\n name: statusName,\n\n details: trackData.name,\n state: trackData.artist,\n assets,\n\n buttons: buttons.map(v => v.label),\n metadata: {\n button_urls: buttons.map(v => v.url),\n },\n\n type: settings.store.useListeningStatus ? ActivityType.LISTENING : ActivityType.PLAYING,\n flags: ActivityFlag.INSTANCE,\n };\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\n// These are Xor encrypted to prevent you from spoiling yourself when you read the source code.\n// don't worry about it :P\nconst quotes = [\n \"Eyrokac\",\n \"Rdcg$l`'k|~n\",\n 'H`tf$d&iajo+d`{\"',\n \"Sucqplh`(Eclhualva()&\",\n \"Lncgmka'8KNMDC,shpanf'`x./,\",\n \"Ioqweijnfn*IeuvfvAotkfxo./,\",\n 'Hd{#cp\\x7Ft$)nbd!{lq%mig~*\\x7Fh`v#mk&sm{gx nd#idjb(a\\x7Ffao\"bja&amdkge!Rlo\u00ECkhf)hyedfjjb*\\'^hzdrdmm$lu\\'|ao+mnqw$fijxh~bbmg#Tjm\u00EEefd+fnp#lpkffz5',\n \"h\",\n \"sijklm&cam*rot\\\"hjjq'|ak\\x7F xmv#wc'ep*mawmvvlrb(|ynr>\\\"Aqq&cgg-\\x7F ugoh%rom)e\\x7Fhdpp%$\",\n 'Tnfb}\"u\\'~`nno!kp$vvhfzeyee\"a}%Tfam*Xh`fls%Jboldos-\"lj`&hn)~ce!`jcbct|)gdbhnf$wikm$zgaxkmc%afely+og\"144?\\'ign+iu%p$qisiefr gpfa$',\n \"Ndtfv%ahfgk+ghtf$|ir(|z' Oguaw&`ggdj mgw$|ir(me|n\",\n \"(!\u0363\u00B3$\u0359\u0290'\u0369\u00B9#\",\n \"(\uFF88\u25D7\u30ED\u25D1,\uFF8F-2\uFF6C\uFF95\u272C\",\n \"Ynw#hjil(ze+psgwp|&sgmkr!\",\n \"Tikmolh`(fl+a!dvjk\\x7F'y|e\\x7Fe/,-\",\n \"3/3750?5><9>885:7\",\n \"mdmt\",\n \"Wdn`khc+(oxbeof\",\n 'Ig\"zkp*\\'g{*xolglj`&~g|*gowg/$mgt(Eclm`.#ticf{l*xed\"wl`&Kangj igbhqn\\'d`dn `v#lqrw{3%$bhv-h|)kangj_imwhlhb',\n \"Tscmw%Tnoa~x\",\n \"I\u2018f#npus(ec`e!vl$lhsm{`ncu\\\"ekw&f(defeov-$Rnf|)sdu\u2018pf$wcam{ceg!vl$du'D`d~x-\\\"jw%oi(okht-\\\"DJP)Kag\u007Fs,!mq$du'A\u2010|n sg`akrkq)~jkdl#pj&diefbnf\\\"jp)&@F\\\\*{ltq#Hlhrp'\",\n \"Ynw$v`&cg`dl fml`%rhlhs*\",\n \"Dnl$p%qhz{s' hv$w%hh|aceg!;#gpvt(fl+cndea`&dg|fon&v#wjjqm(\",\n \"\\ud83d)pft`gs(ec`e!13$qojmz#\",\n \"a!njcmr'ide~nu\\\"lb%rheoedldpz$lu'gbkr\",\n \"dn\\\"zkp&kg\u007Fo4\",\n \"hnpqkw\",\n \"sn\\\"fau\u007F\",\n \"Sn\\\"tmqnh}}*musvkaw&flf&+ldv$w%lr{}*aulr#vlao|)cetn\\\"jp$\",\n \"Dxkmc%ot(hhxomwwai\u007F'{hln\",\n \"hd{#}js&(pe~'sg#gprb(3#\\\"\",\n \"hd{b${\",\n \"<;vqkijbq33271:56<3799?24944:\",\n \"Thof$lu'ofdn,!qsefc'az*bnrcma+&Om{o+iu\\\"`khct$)bnrd\\\"bcdoi&\",\n \"snofplkb{)c\u007F'r\\\"lod\u007F'|f*aurv#cpno`abchijklmno\",\n \"Wdn`khc'|f*eghl{%\"\n];\n\nconst settings = definePluginSettings({\n replaceEvents: {\n description: \"Replace Event Quotes too\",\n type: OptionType.BOOLEAN,\n default: true\n }\n});\n\nexport default definePlugin({\n name: \"LoadingQuotes\",\n description: \"Replace Discords loading quotes\",\n authors: [Devs.Ven, Devs.KraXen72],\n\n settings,\n\n patches: [\n {\n find: \".LOADING_DID_YOU_KNOW}\",\n replacement: [\n {\n match: /\\._loadingText=function\\(\\)\\{/,\n replace: \"$&return $self.quote;\",\n },\n {\n match: /\\._eventLoadingText=function\\(\\)\\{/,\n replace: \"$&return $self.quote;\",\n predicate: () => settings.store.replaceEvents\n }\n ],\n },\n ],\n\n xor(quote: string) {\n const key = \"read if cute\";\n const codes = Array.from(quote, (s, i) => s.charCodeAt(0) ^ (i % key.length));\n return String.fromCharCode(...codes);\n },\n\n get quote() {\n return this.xor(quotes[Math.floor(Math.random() * quotes.length)]);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { Devs } from \"@utils/constants\";\nimport { getCurrentChannel } from \"@utils/discord\";\nimport definePlugin from \"@utils/types\";\nimport { findStoreLazy } from \"@webpack\";\nimport { SelectedChannelStore, Tooltip, useStateFromStores } from \"@webpack/common\";\nimport { FluxStore } from \"@webpack/types\";\n\nconst GuildMemberCountStore = findStoreLazy(\"GuildMemberCountStore\") as FluxStore & { getMemberCount(guildId: string): number | null; };\nconst ChannelMemberStore = findStoreLazy(\"ChannelMemberStore\") as FluxStore & {\n getProps(guildId: string, channelId: string): { groups: { count: number; id: string; }[]; };\n};\n\nconst sharedIntlNumberFormat = new Intl.NumberFormat();\nconst numberFormat = (value: number) => sharedIntlNumberFormat.format(value);\n\nfunction MemberCount() {\n const { id: channelId, guild_id: guildId } = useStateFromStores([SelectedChannelStore], () => getCurrentChannel());\n const { groups } = useStateFromStores(\n [ChannelMemberStore],\n () => ChannelMemberStore.getProps(guildId, channelId)\n );\n const total = useStateFromStores(\n [GuildMemberCountStore],\n () => GuildMemberCountStore.getMemberCount(guildId)\n );\n\n if (total == null)\n return null;\n\n const online =\n (groups.length === 1 && groups[0].id === \"unknown\")\n ? 0\n : groups.reduce((count, curr) => count + (curr.id === \"offline\" ? 0 : curr.count), 0);\n\n return (\n \n \n {props => (\n
\n \n {numberFormat(online)}\n
\n )}\n
\n \n {props => (\n
\n \n {numberFormat(total)}\n
\n )}\n
\n
\n );\n}\n\nexport default definePlugin({\n name: \"MemberCount\",\n description: \"Shows the amount of online & total members in the server member list\",\n authors: [Devs.Ven, Devs.Commandtechno],\n\n patches: [{\n find: \"{isSidebarVisible:\",\n replacement: {\n match: /(?<=let\\{className:(\\i),.+?children):\\[(\\i\\.useMemo[^}]+\"aria-multiselectable\")/,\n replace: \":[$1?.startsWith('members')?$self.render():null,$2\"\n }\n }],\n\n render: ErrorBoundary.wrap(MemberCount, { noop: true })\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addClickListener, removeClickListener } from \"@api/MessageEvents\";\nimport { definePluginSettings, Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { FluxDispatcher, PermissionsBits, PermissionStore, UserStore } from \"@webpack/common\";\n\nlet isDeletePressed = false;\nconst keydown = (e: KeyboardEvent) => e.key === \"Backspace\" && (isDeletePressed = true);\nconst keyup = (e: KeyboardEvent) => e.key === \"Backspace\" && (isDeletePressed = false);\n\n\nconst settings = definePluginSettings({\n enableDeleteOnClick: {\n type: OptionType.BOOLEAN,\n description: \"Enable delete on click while holding backspace\",\n default: true\n },\n enableDoubleClickToEdit: {\n type: OptionType.BOOLEAN,\n description: \"Enable double click to edit\",\n default: true\n },\n enableDoubleClickToReply: {\n type: OptionType.BOOLEAN,\n description: \"Enable double click to reply\",\n default: true\n },\n requireModifier: {\n type: OptionType.BOOLEAN,\n description: \"Only do double click actions when shift/ctrl is held\",\n default: false\n }\n});\n\nexport default definePlugin({\n name: \"MessageClickActions\",\n description: \"Hold Backspace and click to delete, double click to edit/reply\",\n authors: [Devs.Ven],\n dependencies: [\"MessageEventsAPI\"],\n\n settings,\n\n start() {\n const MessageActions = findByPropsLazy(\"deleteMessage\", \"startEditMessage\");\n const EditStore = findByPropsLazy(\"isEditing\", \"isEditingAny\");\n\n document.addEventListener(\"keydown\", keydown);\n document.addEventListener(\"keyup\", keyup);\n\n this.onClick = addClickListener((msg: any, channel, event) => {\n const isMe = msg.author.id === UserStore.getCurrentUser().id;\n if (!isDeletePressed) {\n if (event.detail < 2) return;\n if (settings.store.requireModifier && !event.ctrlKey && !event.shiftKey) return;\n if (channel.guild_id && !PermissionStore.can(PermissionsBits.SEND_MESSAGES, channel)) return;\n\n if (isMe) {\n if (!settings.store.enableDoubleClickToEdit || EditStore.isEditing(channel.id, msg.id)) return;\n\n MessageActions.startEditMessage(channel.id, msg.id, msg.content);\n event.preventDefault();\n } else {\n if (!settings.store.enableDoubleClickToReply) return;\n\n FluxDispatcher.dispatch({\n type: \"CREATE_PENDING_REPLY\",\n channel,\n message: msg,\n shouldMention: !Settings.plugins.NoReplyMention.enabled,\n showMentionToggle: channel.guild_id !== null\n });\n }\n } else if (settings.store.enableDeleteOnClick && (isMe || PermissionStore.can(PermissionsBits.MANAGE_MESSAGES, channel))) {\n if (msg.deleted) {\n FluxDispatcher.dispatch({\n type: \"MESSAGE_DELETE\",\n channelId: channel.id,\n id: msg.id,\n mlDeleted: true\n });\n } else {\n MessageActions.deleteMessage(channel.id, msg.id);\n }\n event.preventDefault();\n }\n });\n },\n\n stop() {\n removeClickListener(this.onClick);\n document.removeEventListener(\"keydown\", keydown);\n document.removeEventListener(\"keyup\", keyup);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport type AccessoryCallback = (props: Record) => JSX.Element | null | Array;\nexport type Accessory = {\n callback: AccessoryCallback;\n position?: number;\n};\n\nexport const accessories = new Map();\n\nexport function addAccessory(\n identifier: string,\n callback: AccessoryCallback,\n position?: number\n) {\n accessories.set(identifier, {\n callback,\n position,\n });\n}\n\nexport function removeAccessory(identifier: string) {\n accessories.delete(identifier);\n}\n\nexport function _modifyAccessories(\n elements: JSX.Element[],\n props: Record\n) {\n for (const accessory of accessories.values()) {\n let accessories = accessory.callback(props);\n if (accessories == null)\n continue;\n\n if (!Array.isArray(accessories))\n accessories = [accessories];\n else if (accessories.length === 0)\n continue;\n\n elements.splice(\n accessory.position != null\n ? accessory.position < 0\n ? elements.length + accessory.position\n : accessory.position\n : elements.length,\n 0,\n ...accessories.filter(e => e != null) as JSX.Element[]\n );\n }\n\n return elements;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addAccessory } from \"@api/MessageAccessories\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants.js\";\nimport { classes } from \"@utils/misc\";\nimport { Queue } from \"@utils/Queue\";\nimport { LazyComponent } from \"@utils/react\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { find, findByCode, findByPropsLazy } from \"@webpack\";\nimport {\n Button,\n ChannelStore,\n FluxDispatcher,\n GuildStore,\n MessageStore,\n Parser,\n PermissionStore,\n RestAPI,\n Text,\n TextAndImagesSettingsStores,\n UserStore\n} from \"@webpack/common\";\nimport { Channel, Guild, Message } from \"discord-types/general\";\n\nconst messageCache = new Map();\n\nconst Embed = LazyComponent(() => findByCode(\".inlineMediaEmbed\"));\nconst AutoModEmbed = LazyComponent(() => findByCode(\".withFooter]:\", \"childrenMessageContent:\"));\nconst ChannelMessage = LazyComponent(() => find(m => m.type?.toString()?.includes(\"renderSimpleAccessories)\")));\n\nconst SearchResultClasses = findByPropsLazy(\"message\", \"searchResult\");\n\nconst messageLinkRegex = /(?\n \n }\n});\n\n\nasync function fetchMessage(channelID: string, messageID: string) {\n const cached = messageCache.get(messageID);\n if (cached) return cached.message;\n\n messageCache.set(messageID, { fetched: false });\n\n const res = await RestAPI.get({\n url: `/channels/${channelID}/messages`,\n query: {\n limit: 1,\n around: messageID\n },\n retries: 2\n }).catch(() => null);\n\n const msg = res?.body?.[0];\n if (!msg) return;\n\n const message: Message = MessageStore.getMessages(msg.channel_id).receiveMessage(msg).get(msg.id);\n\n messageCache.set(message.id, {\n message,\n fetched: true\n });\n\n return message;\n}\n\n\nfunction getImages(message: Message): Attachment[] {\n const attachments: Attachment[] = [];\n\n for (const { content_type, height, width, url, proxy_url } of message.attachments ?? []) {\n if (content_type?.startsWith(\"image/\"))\n attachments.push({\n height: height!,\n width: width!,\n url: url,\n proxyURL: proxy_url!\n });\n }\n\n for (const { type, image, thumbnail, url } of message.embeds ?? []) {\n if (type === \"image\")\n attachments.push({ ...(image ?? thumbnail!) });\n else if (url && type === \"gifv\" && !tenorRegex.test(url))\n attachments.push({\n height: thumbnail!.height,\n width: thumbnail!.width,\n url\n });\n }\n\n return attachments;\n}\n\nfunction noContent(attachments: number, embeds: number) {\n if (!attachments && !embeds) return \"\";\n if (!attachments) return `[no content, ${embeds} embed${embeds !== 1 ? \"s\" : \"\"}]`;\n if (!embeds) return `[no content, ${attachments} attachment${attachments !== 1 ? \"s\" : \"\"}]`;\n return `[no content, ${attachments} attachment${attachments !== 1 ? \"s\" : \"\"} and ${embeds} embed${embeds !== 1 ? \"s\" : \"\"}]`;\n}\n\nfunction requiresRichEmbed(message: Message) {\n if (message.components.length) return true;\n if (message.attachments.some(a => !a.content_type?.startsWith(\"image/\"))) return true;\n if (message.embeds.some(e => e.type !== \"image\" && (e.type !== \"gifv\" || tenorRegex.test(e.url!)))) return true;\n\n return false;\n}\n\nfunction computeWidthAndHeight(width: number, height: number) {\n const maxWidth = 400;\n const maxHeight = 300;\n\n if (width > height) {\n const adjustedWidth = Math.min(width, maxWidth);\n return { width: adjustedWidth, height: Math.round(height / (width / adjustedWidth)) };\n }\n\n const adjustedHeight = Math.min(height, maxHeight);\n return { width: Math.round(width / (height / adjustedHeight)), height: adjustedHeight };\n}\n\nfunction withEmbeddedBy(message: Message, embeddedBy: string[]) {\n return new Proxy(message, {\n get(_, prop) {\n if (prop === \"vencordEmbeddedBy\") return embeddedBy;\n // @ts-ignore ts so bad\n return Reflect.get(...arguments);\n }\n });\n}\n\n\nfunction MessageEmbedAccessory({ message }: { message: Message; }) {\n // @ts-ignore\n const embeddedBy: string[] = message.vencordEmbeddedBy ?? [];\n\n const accessories = [] as (JSX.Element | null)[];\n\n let match = null as RegExpMatchArray | null;\n while ((match = messageLinkRegex.exec(message.content!)) !== null) {\n const [_, guildID, channelID, messageID] = match;\n if (embeddedBy.includes(messageID)) {\n continue;\n }\n\n const linkedChannel = ChannelStore.getChannel(channelID);\n if (!linkedChannel || (guildID !== \"@me\" && !PermissionStore.can(1024n /* view channel */, linkedChannel))) {\n continue;\n }\n\n const { listMode, idList } = settings.store;\n\n const isListed = [guildID, channelID, message.author.id].some(id => id && idList.includes(id));\n\n if (listMode === \"blacklist\" && isListed) continue;\n if (listMode === \"whitelist\" && !isListed) continue;\n\n let linkedMessage = messageCache.get(messageID)?.message;\n if (!linkedMessage) {\n linkedMessage ??= MessageStore.getMessage(channelID, messageID);\n if (linkedMessage) {\n messageCache.set(messageID, { message: linkedMessage, fetched: true });\n } else {\n const msg = { ...message } as any;\n delete msg.embeds;\n delete msg.interaction;\n\n messageFetchQueue.push(() => fetchMessage(channelID, messageID)\n .then(m => m && FluxDispatcher.dispatch({\n type: \"MESSAGE_UPDATE\",\n message: msg\n }))\n );\n continue;\n }\n }\n\n const messageProps: MessageEmbedProps = {\n message: withEmbeddedBy(linkedMessage, [...embeddedBy, message.id]),\n channel: linkedChannel,\n guildID\n };\n\n const type = settings.store.automodEmbeds;\n accessories.push(\n type === \"always\" || (type === \"prefer\" && !requiresRichEmbed(linkedMessage))\n ? \n : \n );\n }\n\n return accessories.length ? <>{accessories} : null;\n}\n\nfunction ChannelMessageEmbedAccessory({ message, channel, guildID }: MessageEmbedProps): JSX.Element | null {\n const isDM = guildID === \"@me\";\n\n const guild = !isDM && GuildStore.getGuild(channel.guild_id);\n const dmReceiver = UserStore.getUser(ChannelStore.getChannel(channel.id).recipients?.[0]);\n\n\n return \n {isDM ? \"Direct Message - \" : (guild as Guild).name + \" - \"}\n {isDM\n ? Parser.parse(`<@${dmReceiver.id}>`)\n : Parser.parse(`<#${channel.id}>`)\n }\n ,\n iconProxyURL: guild\n ? `https://${window.GLOBAL_ENV.CDN_HOST}/icons/${guild.id}/${guild.icon}.png`\n : `https://${window.GLOBAL_ENV.CDN_HOST}/avatars/${dmReceiver.id}/${dmReceiver.avatar}`\n }\n }}\n renderDescription={() => (\n
\n \n
\n )}\n />;\n}\n\nfunction AutomodEmbedAccessory(props: MessageEmbedProps): JSX.Element | null {\n const { message, channel, guildID } = props;\n const compact = TextAndImagesSettingsStores.MessageDisplayCompact.useSetting();\n const isDM = guildID === \"@me\";\n const images = getImages(message);\n const { parse } = Parser;\n\n return \n {isDM\n ? parse(`<@${ChannelStore.getChannel(channel.id).recipients[0]}>`)\n : parse(`<#${channel.id}>`)\n }\n {isDM ? \" - Direct Message\" : \" - \" + GuildStore.getGuild(channel.guild_id)?.name}\n \n }\n compact={compact}\n content={\n <>\n {message.content || message.attachments.length <= images.length\n ? parse(message.content)\n : [noContent(message.attachments.length, message.embeds.length)]\n }\n {images.map(a => {\n const { width, height } = computeWidthAndHeight(a.width, a.height);\n return (\n
\n \n
\n );\n })}\n \n }\n hideTimestamp={false}\n message={message}\n _messageEmbed=\"automod\"\n />;\n}\n\nexport default definePlugin({\n name: \"MessageLinkEmbeds\",\n description: \"Adds a preview to messages that link another message\",\n authors: [Devs.TheSun, Devs.Ven, Devs.RyanCaoDev],\n dependencies: [\"MessageAccessoriesAPI\"],\n\n settings,\n\n start() {\n addAccessory(\"messageLinkEmbed\", props => {\n if (!messageLinkRegex.test(props.message.content))\n return null;\n\n // need to reset the regex because it's global\n messageLinkRegex.lastIndex = 0;\n\n return (\n \n \n \n );\n }, 4 /* just above rich embeds */);\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n(window.VencordStyles ??= new Map()).set(\"src/plugins/messageLogger/deleteStyleOverlay.css\", {\n name: \"src/plugins/messageLogger/deleteStyleOverlay.css\",\n source: \".messagelogger-deleted {\\n background-color: rgba(240 71 71 / 15%) !important;\\n}\\n\",\n classNames: {},\n dom: null,\n});\n\nexport default \"src/plugins/messageLogger/deleteStyleOverlay.css\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n(window.VencordStyles ??= new Map()).set(\"src/plugins/messageLogger/deleteStyleText.css\", {\n name: \"src/plugins/messageLogger/deleteStyleText.css\",\n source: \"/* Message content highlighting */\\n.messagelogger-deleted [class*=\\\"contents\\\"] > :is(div, h1, h2, h3, p) {\\n color: #f04747 !important;\\n}\\n\\n/* Bot \\\"thinking\\\" text highlighting */\\n.messagelogger-deleted [class*=\\\"colorStandard\\\"] {\\n color: #f04747 !important;\\n}\\n\\n/* Embed highlighting */\\n.messagelogger-deleted article :is(div, span, h1, h2, h3, p) {\\n color: #f04747 !important;\\n}\\n\\n.messagelogger-deleted a {\\n color: #be3535 !important;\\n text-decoration: underline;\\n}\\n\",\n classNames: {},\n dom: null,\n});\n\nexport default \"src/plugins/messageLogger/deleteStyleText.css\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./messageLogger.css\";\n\nimport { addContextMenuPatch, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { Settings } from \"@api/Settings\";\nimport { disableStyle, enableStyle } from \"@api/Styles\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ChannelStore, FluxDispatcher, i18n, Menu, moment, Parser, Timestamp, UserStore } from \"@webpack/common\";\n\nimport overlayStyle from \"./deleteStyleOverlay.css?managed\";\nimport textStyle from \"./deleteStyleText.css?managed\";\n\nconst styles = findByPropsLazy(\"edited\", \"communicationDisabled\", \"isSystemMessage\");\n\nfunction addDeleteStyle() {\n if (Settings.plugins.MessageLogger.deleteStyle === \"text\") {\n enableStyle(textStyle);\n disableStyle(overlayStyle);\n } else {\n disableStyle(textStyle);\n enableStyle(overlayStyle);\n }\n}\n\nconst REMOVE_HISTORY_ID = \"ml-remove-history\";\nconst TOGGLE_DELETE_STYLE_ID = \"ml-toggle-style\";\nconst patchMessageContextMenu: NavContextMenuPatchCallback = (children, props) => () => {\n const { message } = props;\n const { deleted, editHistory, id, channel_id } = message;\n\n if (!deleted && !editHistory?.length) return;\n\n toggle: {\n if (!deleted) break toggle;\n\n const domElement = document.getElementById(`chat-messages-${channel_id}-${id}`);\n if (!domElement) break toggle;\n\n children.push((\n domElement.classList.toggle(\"messagelogger-deleted\")}\n />\n ));\n }\n\n children.push((\n {\n if (deleted) {\n FluxDispatcher.dispatch({\n type: \"MESSAGE_DELETE\",\n channelId: channel_id,\n id,\n mlDeleted: true\n });\n } else {\n message.editHistory = [];\n }\n }}\n />\n ));\n};\n\nexport default definePlugin({\n name: \"MessageLogger\",\n description: \"Temporarily logs deleted and edited messages.\",\n authors: [Devs.rushii, Devs.Ven, Devs.AutumnVN],\n\n start() {\n addDeleteStyle();\n addContextMenuPatch(\"message\", patchMessageContextMenu);\n },\n\n stop() {\n removeContextMenuPatch(\"message\", patchMessageContextMenu);\n },\n\n renderEdit(edit: { timestamp: any, content: string; }) {\n return (\n \n
\n {Parser.parse(edit.content)}\n \n {\" \"}({i18n.Messages.MESSAGE_EDITED})\n \n
\n
\n );\n },\n\n makeEdit(newMessage: any, oldMessage: any): any {\n return {\n timestamp: moment?.call(newMessage.edited_timestamp),\n content: oldMessage.content\n };\n },\n\n options: {\n deleteStyle: {\n type: OptionType.SELECT,\n description: \"The style of deleted messages\",\n default: \"text\",\n options: [\n { label: \"Red text\", value: \"text\", default: true },\n { label: \"Red overlay\", value: \"overlay\" }\n ],\n onChange: () => addDeleteStyle()\n },\n ignoreBots: {\n type: OptionType.BOOLEAN,\n description: \"Whether to ignore messages by bots\",\n default: false\n },\n ignoreSelf: {\n type: OptionType.BOOLEAN,\n description: \"Whether to ignore messages by yourself\",\n default: false\n },\n ignoreUsers: {\n type: OptionType.STRING,\n description: \"Comma-separated list of user IDs to ignore\",\n default: \"\"\n },\n ignoreChannels: {\n type: OptionType.STRING,\n description: \"Comma-separated list of channel IDs to ignore\",\n default: \"\"\n },\n ignoreGuilds: {\n type: OptionType.STRING,\n description: \"Comma-separated list of guild IDs to ignore\",\n default: \"\"\n },\n },\n\n handleDelete(cache: any, data: { ids: string[], id: string; mlDeleted?: boolean; }, isBulk: boolean) {\n try {\n if (cache == null || (!isBulk && !cache.has(data.id))) return cache;\n\n const mutate = (id: string) => {\n const msg = cache.get(id);\n if (!msg) return;\n\n const EPHEMERAL = 64;\n const shouldIgnore = data.mlDeleted ||\n (msg.flags & EPHEMERAL) === EPHEMERAL ||\n this.shouldIgnore(msg);\n\n if (shouldIgnore) {\n cache = cache.remove(id);\n } else {\n cache = cache.update(id, m => m\n .set(\"deleted\", true)\n .set(\"attachments\", m.attachments.map(a => (a.deleted = true, a))));\n }\n };\n\n if (isBulk) {\n data.ids.forEach(mutate);\n } else {\n mutate(data.id);\n }\n } catch (e) {\n new Logger(\"MessageLogger\").error(\"Error during handleDelete\", e);\n }\n return cache;\n },\n\n shouldIgnore(message: any) {\n const { ignoreBots, ignoreSelf, ignoreUsers, ignoreChannels, ignoreGuilds } = Settings.plugins.MessageLogger;\n const myId = UserStore.getCurrentUser().id;\n\n return ignoreBots && message.author?.bot ||\n ignoreSelf && message.author?.id === myId ||\n ignoreUsers.includes(message.author?.id) ||\n ignoreChannels.includes(message.channel_id) ||\n ignoreChannels.includes(ChannelStore.getChannel(message.channel_id)?.parent_id) ||\n ignoreGuilds.includes(ChannelStore.getChannel(message.channel_id)?.guild_id);\n },\n\n // Based on canary 63b8f1b4f2025213c5cf62f0966625bee3d53136\n patches: [\n {\n // MessageStore\n // Module 171447\n find: \"displayName=\\\"MessageStore\\\"\",\n replacement: [\n {\n // Add deleted=true to all target messages in the MESSAGE_DELETE event\n match: /MESSAGE_DELETE:function\\((\\i)\\){let.+?((?:\\i\\.){2})getOrCreate.+?},/,\n replace:\n \"MESSAGE_DELETE:function($1){\" +\n \" var cache = $2getOrCreate($1.channelId);\" +\n \" cache = $self.handleDelete(cache, $1, false);\" +\n \" $2commit(cache);\" +\n \"},\"\n },\n {\n // Add deleted=true to all target messages in the MESSAGE_DELETE_BULK event\n match: /MESSAGE_DELETE_BULK:function\\((\\i)\\){let.+?((?:\\i\\.){2})getOrCreate.+?},/,\n replace:\n \"MESSAGE_DELETE_BULK:function($1){\" +\n \" var cache = $2getOrCreate($1.channelId);\" +\n \" cache = $self.handleDelete(cache, $1, true);\" +\n \" $2commit(cache);\" +\n \"},\"\n },\n {\n // Add current cached content + new edit time to cached message's editHistory\n match: /(MESSAGE_UPDATE:function\\((\\i)\\).+?)\\.update\\((\\i)/,\n replace: \"$1\" +\n \".update($3,m =>\" +\n \" (($2.message.flags & 64) === 64 || $self.shouldIgnore($2.message)) ? m :\" +\n \" $2.message.content !== m.editHistory?.[0]?.content && $2.message.content !== m.content ?\" +\n \" m.set('editHistory',[...(m.editHistory || []), $self.makeEdit($2.message, m)]) :\" +\n \" m\" +\n \")\" +\n \".update($3\"\n },\n {\n // fix up key (edit last message) attempting to edit a deleted message\n match: /(?<=getLastEditableMessage\\(\\i\\)\\{.{0,200}\\.find\\((\\i)=>)/,\n replace: \"!$1.deleted &&\"\n }\n ]\n },\n\n {\n // Message domain model\n // Module 451\n find: \"}addReaction(\",\n replacement: [\n {\n match: /this\\.customRenderedContent=(\\i)\\.customRenderedContent,/,\n replace: \"this.customRenderedContent = $1.customRenderedContent,\" +\n \"this.deleted = $1.deleted || false,\" +\n \"this.editHistory = $1.editHistory || [],\"\n }\n ]\n },\n\n {\n // Updated message transformer(?)\n // Module 819525\n find: \"THREAD_STARTER_MESSAGE?null===\",\n replacement: [\n // {\n // // DEBUG: Log the params of the target function to the patch below\n // match: /function N\\(e,t\\){/,\n // replace: \"function L(e,t){console.log('pre-transform', e, t);\"\n // },\n {\n // Pass through editHistory & deleted & original attachments to the \"edited message\" transformer\n match: /interactionData:(\\i)\\.interactionData/,\n replace:\n \"interactionData:$1.interactionData,\" +\n \"deleted:$1.deleted,\" +\n \"editHistory:$1.editHistory,\" +\n \"attachments:$1.attachments\"\n },\n\n // {\n // // DEBUG: Log the params of the target function to the patch below\n // match: /function R\\(e\\){/,\n // replace: \"function R(e){console.log('after-edit-transform', arguments);\"\n // },\n {\n // Construct new edited message and add editHistory & deleted (ref above)\n // Pass in custom data to attachment parser to mark attachments deleted as well\n match: /attachments:(\\i)\\((\\i)\\)/,\n replace:\n \"attachments: $1((() => {\" +\n \" let old = arguments[1]?.attachments;\" +\n \" if (!old) return $2;\" +\n \" let new_ = $2.attachments?.map(a => a.id) ?? [];\" +\n \" let diff = old.filter(a => !new_.includes(a.id));\" +\n \" old.forEach(a => a.deleted = true);\" +\n \" $2.attachments = [...diff, ...$2.attachments];\" +\n \" return $2;\" +\n \"})()),\" +\n \"deleted: arguments[1]?.deleted,\" +\n \"editHistory: arguments[1]?.editHistory\"\n },\n {\n // Preserve deleted attribute on attachments\n match: /(\\((\\i)\\){return null==\\2\\.attachments.+?)spoiler:/,\n replace:\n \"$1deleted: arguments[0]?.deleted,\" +\n \"spoiler:\"\n }\n ]\n },\n\n {\n // Attachment renderer\n // Module 96063\n find: \".removeAttachmentHoverButton\",\n replacement: [\n {\n match: /(className:\\i,attachment:\\i),/,\n replace: \"$1,attachment: {deleted},\"\n },\n {\n match: /\\[\\i\\.obscured\\]:.+?,/,\n replace: \"$& 'messagelogger-deleted-attachment': deleted,\"\n }\n ]\n },\n\n {\n // Base message component renderer\n // Module 748241\n find: \"Message must not be a thread starter message\",\n replacement: [\n {\n // Append messagelogger-deleted to classNames if deleted\n match: /\\)\\(\"li\",\\{(.+?),className:/,\n replace: \")(\\\"li\\\",{$1,className:(arguments[0].message.deleted ? \\\"messagelogger-deleted \\\" : \\\"\\\")+\"\n }\n ]\n },\n\n {\n // Message content renderer\n // Module 43016\n find: \"Messages.MESSAGE_EDITED,\\\")\\\"\",\n replacement: [\n {\n // Render editHistory in the deepest div for message content\n match: /(\\)\\(\"div\",\\{id:.+?children:\\[)/,\n replace: \"$1 (arguments[0].message.editHistory?.length > 0 ? arguments[0].message.editHistory.map(edit => $self.renderEdit(edit)) : null), \"\n }\n ]\n },\n\n {\n // ReferencedMessageStore\n // Module 778667\n find: \"displayName=\\\"ReferencedMessageStore\\\"\",\n replacement: [\n {\n match: /MESSAGE_DELETE:function\\((\\i)\\).+?},/,\n replace: \"MESSAGE_DELETE:function($1){},\"\n },\n {\n match: /MESSAGE_DELETE_BULK:function\\((\\i)\\).+?},/,\n replace: \"MESSAGE_DELETE_BULK:function($1){},\"\n }\n ]\n },\n\n {\n // Message context base menu\n // Module 600300\n find: \"useMessageMenu:\",\n replacement: [\n {\n // Remove the first section if message is deleted\n match: /children:(\\[\"\"===.+?\\])/,\n replace: \"children:arguments[0].message.deleted?[]:$1\"\n }\n ]\n }\n\n // {\n // // MessageStore caching internals\n // // Module 819525\n // find: \"e.getOrCreate=function(t)\",\n // replacement: [\n // // {\n // // // DEBUG: log getOrCreate return values from MessageStore caching internals\n // // match: /getOrCreate=function(.+?)return/,\n // // replace: \"getOrCreate=function$1console.log('getOrCreate',n);return\"\n // // }\n // ]\n // }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, registerCommand, sendBotMessage, unregisterCommand } from \"@api/Commands\";\nimport * as DataStore from \"@api/DataStore\";\nimport { Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nconst EMOTE = \"<:luna:1035316192220553236>\";\nconst DATA_KEY = \"MessageTags_TAGS\";\nconst MessageTagsMarker = Symbol(\"MessageTags\");\nconst author = {\n id: \"821472922140803112\",\n bot: false\n};\n\ninterface Tag {\n name: string;\n message: string;\n enabled: boolean;\n}\n\nconst getTags = () => DataStore.get(DATA_KEY).then(t => t ?? []);\nconst getTag = (name: string) => DataStore.get(DATA_KEY).then((t: Tag[]) => (t ?? []).find((tt: Tag) => tt.name === name) ?? null);\nconst addTag = async (tag: Tag) => {\n const tags = await getTags();\n tags.push(tag);\n DataStore.set(DATA_KEY, tags);\n return tags;\n};\nconst removeTag = async (name: string) => {\n let tags = await getTags();\n tags = await tags.filter((t: Tag) => t.name !== name);\n DataStore.set(DATA_KEY, tags);\n return tags;\n};\n\nfunction createTagCommand(tag: Tag) {\n registerCommand({\n name: tag.name,\n description: tag.name,\n inputType: ApplicationCommandInputType.BUILT_IN_TEXT,\n execute: async (_, ctx) => {\n if (!await getTag(tag.name)) {\n sendBotMessage(ctx.channel.id, {\n author,\n content: `${EMOTE} The tag **${tag.name}** does not exist anymore! Please reload ur Discord to fix :)`\n });\n return { content: `/${tag.name}` };\n }\n\n if (Settings.plugins.MessageTags.clyde) sendBotMessage(ctx.channel.id, {\n author,\n content: `${EMOTE} The tag **${tag.name}** has been sent!`\n });\n return { content: tag.message.replaceAll(\"\\\\n\", \"\\n\") };\n },\n [MessageTagsMarker]: true,\n }, \"CustomTags\");\n}\n\n\nexport default definePlugin({\n name: \"MessageTags\",\n description: \"Allows you to save messages and to use them with a simple command.\",\n authors: [Devs.Luna],\n options: {\n clyde: {\n name: \"Clyde message on send\",\n description: \"If enabled, clyde will send you an ephemeral message when a tag was used.\",\n type: OptionType.BOOLEAN,\n default: true\n }\n },\n dependencies: [\"CommandsAPI\"],\n\n async start() {\n for (const tag of await getTags()) createTagCommand(tag);\n },\n\n commands: [\n {\n name: \"tags\",\n description: \"Manage all the tags for yourself\",\n inputType: ApplicationCommandInputType.BUILT_IN,\n options: [\n {\n name: \"create\",\n description: \"Create a new tag\",\n type: ApplicationCommandOptionType.SUB_COMMAND,\n options: [\n {\n name: \"tag-name\",\n description: \"The name of the tag to trigger the response\",\n type: ApplicationCommandOptionType.STRING,\n required: true\n },\n {\n name: \"message\",\n description: \"The message that you will send when using this tag\",\n type: ApplicationCommandOptionType.STRING,\n required: true\n }\n ]\n },\n {\n name: \"list\",\n description: \"List all tags from yourself\",\n type: ApplicationCommandOptionType.SUB_COMMAND,\n options: []\n },\n {\n name: \"delete\",\n description: \"Remove a tag from your yourself\",\n type: ApplicationCommandOptionType.SUB_COMMAND,\n options: [\n {\n name: \"tag-name\",\n description: \"The name of the tag to trigger the response\",\n type: ApplicationCommandOptionType.STRING,\n required: true\n }\n ]\n },\n {\n name: \"preview\",\n description: \"Preview a tag without sending it publicly\",\n type: ApplicationCommandOptionType.SUB_COMMAND,\n options: [\n {\n name: \"tag-name\",\n description: \"The name of the tag to trigger the response\",\n type: ApplicationCommandOptionType.STRING,\n required: true\n }\n ]\n }\n ],\n\n async execute(args, ctx) {\n\n switch (args[0].name) {\n case \"create\": {\n const name: string = findOption(args[0].options, \"tag-name\", \"\");\n const message: string = findOption(args[0].options, \"message\", \"\");\n\n if (await getTag(name))\n return sendBotMessage(ctx.channel.id, {\n author,\n content: `${EMOTE} A Tag with the name **${name}** already exists!`\n });\n\n const tag = {\n name: name,\n enabled: true,\n message: message\n };\n\n createTagCommand(tag);\n await addTag(tag);\n\n sendBotMessage(ctx.channel.id, {\n author,\n content: `${EMOTE} Successfully created the tag **${name}**!`\n });\n break; // end 'create'\n }\n case \"delete\": {\n const name: string = findOption(args[0].options, \"tag-name\", \"\");\n\n if (!await getTag(name))\n return sendBotMessage(ctx.channel.id, {\n author,\n content: `${EMOTE} A Tag with the name **${name}** does not exist!`\n });\n\n unregisterCommand(name);\n await removeTag(name);\n\n sendBotMessage(ctx.channel.id, {\n author,\n content: `${EMOTE} Successfully deleted the tag **${name}**!`\n });\n break; // end 'delete'\n }\n case \"list\": {\n sendBotMessage(ctx.channel.id, {\n author,\n embeds: [\n {\n // @ts-ignore\n title: \"All Tags:\",\n // @ts-ignore\n description: (await getTags())\n .map(tag => `\\`${tag.name}\\`: ${tag.message.slice(0, 72).replaceAll(\"\\\\n\", \" \")}${tag.message.length > 72 ? \"...\" : \"\"}`)\n .join(\"\\n\") || `${EMOTE} Woops! There are no tags yet, use \\`/tags create\\` to create one!`,\n // @ts-ignore\n color: 0xd77f7f,\n type: \"rich\",\n }\n ]\n });\n break; // end 'list'\n }\n case \"preview\": {\n const name: string = findOption(args[0].options, \"tag-name\", \"\");\n const tag = await getTag(name);\n\n if (!tag)\n return sendBotMessage(ctx.channel.id, {\n author,\n content: `${EMOTE} A Tag with the name **${name}** does not exist!`\n });\n\n sendBotMessage(ctx.channel.id, {\n author,\n content: tag.message.replaceAll(\"\\\\n\", \"\\n\")\n });\n break; // end 'preview'\n }\n\n default: {\n sendBotMessage(ctx.channel.id, {\n author,\n content: \"Invalid sub-command\"\n });\n break;\n }\n }\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated, Samu and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ApplicationCommandInputType, findOption, OptionalMessageOption, RequiredMessageOption, sendBotMessage } from \"@api/Commands\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\n\nfunction mock(input: string): string {\n let output = \"\";\n for (let i = 0; i < input.length; i++) {\n output += i % 2 ? input[i].toUpperCase() : input[i].toLowerCase();\n }\n return output;\n}\n\nexport default definePlugin({\n name: \"MoreCommands\",\n description: \"echo, lenny, mock\",\n authors: [Devs.Arjix, Devs.echo, Devs.Samu],\n dependencies: [\"CommandsAPI\"],\n commands: [\n {\n name: \"echo\",\n description: \"Sends a message as Clyde (locally)\",\n options: [OptionalMessageOption],\n inputType: ApplicationCommandInputType.BOT,\n execute: (opts, ctx) => {\n const content = findOption(opts, \"message\", \"\");\n\n sendBotMessage(ctx.channel.id, { content });\n },\n },\n {\n name: \"lenny\",\n description: \"Sends a lenny face\",\n options: [OptionalMessageOption],\n execute: opts => ({\n content: findOption(opts, \"message\", \"\") + \" ( \u0361\u00B0 \u035C\u0296 \u0361\u00B0)\"\n }),\n },\n {\n name: \"mock\",\n description: \"mOcK PeOpLe\",\n options: [RequiredMessageOption],\n execute: opts => ({\n content: mock(findOption(opts, \"message\", \"\"))\n }),\n },\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { findOption, OptionalMessageOption } from \"@api/Commands\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"MoreKaomoji\",\n description: \"Adds more Kaomoji to discord. \u30FD(\u00B4\u25BD`)/\",\n authors: [Devs.JacobTm],\n dependencies: [\"CommandsAPI\"],\n commands: [\n { name: \"dissatisfaction\", description: \" \uFF1E\uFE4F\uFF1C\" },\n { name: \"smug\", description: \" \u0CA0_\u0CA0\" },\n { name: \"happy\", description: \" \u30FD(\u00B4\u25BD`)/\" },\n { name: \"crying\", description: \" \u0CA5_\u0CA5\" },\n { name: \"angry\", description: \" \u30FD(\uFF40\u0414\u00B4)\uFF89\" },\n { name: \"anger\", description: \" \u30FD(\uFF4F`\u76BF\u2032\uFF4F)\uFF89\" },\n { name: \"joy\", description: \" <(\uFFE3\uFE36\uFFE3)>\" },\n { name: \"blush\", description: \"\u0AEE \u02F6\u1D54 \u1D55 \u1D54\u02F6 \u10D0\" },\n { name: \"confused\", description: \"(\u2022\u0E34_\u2022\u0E34)?\" },\n { name: \"sleeping\", description: \"(\u1D17_\u1D17)\" },\n { name: \"laughing\", description: \"o(\u2267\u25BD\u2266)o\" },\n\n ].map(data => ({\n ...data,\n options: [OptionalMessageOption],\n execute: opts => ({\n content: findOption(opts, \"message\", \"\") + data.description\n })\n }))\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Flex } from \"@components/Flex\";\nimport { Devs } from \"@utils/constants\";\nimport { Margins } from \"@utils/margins\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy, findLazy } from \"@webpack\";\nimport { Card, ChannelStore, Forms, GuildStore, PermissionsBits, Switch, TextInput, Tooltip, useState } from \"@webpack/common\";\nimport { RC } from \"@webpack/types\";\nimport { Channel, Message, User } from \"discord-types/general\";\n\ntype PermissionName = \"CREATE_INSTANT_INVITE\" | \"KICK_MEMBERS\" | \"BAN_MEMBERS\" | \"ADMINISTRATOR\" | \"MANAGE_CHANNELS\" | \"MANAGE_GUILD\" | \"CHANGE_NICKNAME\" | \"MANAGE_NICKNAMES\" | \"MANAGE_ROLES\" | \"MANAGE_WEBHOOKS\" | \"MANAGE_GUILD_EXPRESSIONS\" | \"CREATE_GUILD_EXPRESSIONS\" | \"VIEW_AUDIT_LOG\" | \"VIEW_CHANNEL\" | \"VIEW_GUILD_ANALYTICS\" | \"VIEW_CREATOR_MONETIZATION_ANALYTICS\" | \"MODERATE_MEMBERS\" | \"SEND_MESSAGES\" | \"SEND_TTS_MESSAGES\" | \"MANAGE_MESSAGES\" | \"EMBED_LINKS\" | \"ATTACH_FILES\" | \"READ_MESSAGE_HISTORY\" | \"MENTION_EVERYONE\" | \"USE_EXTERNAL_EMOJIS\" | \"ADD_REACTIONS\" | \"USE_APPLICATION_COMMANDS\" | \"MANAGE_THREADS\" | \"CREATE_PUBLIC_THREADS\" | \"CREATE_PRIVATE_THREADS\" | \"USE_EXTERNAL_STICKERS\" | \"SEND_MESSAGES_IN_THREADS\" | \"CONNECT\" | \"SPEAK\" | \"MUTE_MEMBERS\" | \"DEAFEN_MEMBERS\" | \"MOVE_MEMBERS\" | \"USE_VAD\" | \"PRIORITY_SPEAKER\" | \"STREAM\" | \"USE_EMBEDDED_ACTIVITIES\" | \"USE_SOUNDBOARD\" | \"USE_EXTERNAL_SOUNDS\" | \"REQUEST_TO_SPEAK\" | \"MANAGE_EVENTS\" | \"CREATE_EVENTS\";\n\ninterface Tag {\n // name used for identifying, must be alphanumeric + underscores\n name: string;\n // name shown on the tag itself, can be anything probably; automatically uppercase'd\n displayName: string;\n description: string;\n permissions?: PermissionName[];\n condition?(message: Message | null, user: User, channel: Channel): boolean;\n}\n\ninterface TagSetting {\n text: string;\n showInChat: boolean;\n showInNotChat: boolean;\n}\ninterface TagSettings {\n WEBHOOK: TagSetting,\n OWNER: TagSetting,\n ADMINISTRATOR: TagSetting,\n MODERATOR_STAFF: TagSetting,\n MODERATOR: TagSetting,\n VOICE_MODERATOR: TagSetting,\n [k: string]: TagSetting;\n}\n\n// PermissionStore.computePermissions is not the same function and doesn't work here\nconst PermissionUtil = findByPropsLazy(\"computePermissions\", \"canEveryoneRole\") as {\n computePermissions({ ...args }): bigint;\n};\n\nconst Tag = findLazy(m => m.Types?.[0] === \"BOT\") as RC<{ type?: number, className?: string, useRemSizes?: boolean; }> & { Types: Record; };\n\nconst isWebhook = (message: Message, user: User) => !!message?.webhookId && user.isNonUserBot();\n\nconst tags: Tag[] = [\n {\n name: \"WEBHOOK\",\n displayName: \"Webhook\",\n description: \"Messages sent by webhooks\",\n condition: isWebhook\n }, {\n name: \"OWNER\",\n displayName: \"Owner\",\n description: \"Owns the server\",\n condition: (_, user, channel) => GuildStore.getGuild(channel?.guild_id)?.ownerId === user.id\n }, {\n name: \"ADMINISTRATOR\",\n displayName: \"Admin\",\n description: \"Has the administrator permission\",\n permissions: [\"ADMINISTRATOR\"]\n }, {\n name: \"MODERATOR_STAFF\",\n displayName: \"Staff\",\n description: \"Can manage the server, channels or roles\",\n permissions: [\"MANAGE_GUILD\", \"MANAGE_CHANNELS\", \"MANAGE_ROLES\"]\n }, {\n name: \"MODERATOR\",\n displayName: \"Mod\",\n description: \"Can manage messages or kick/ban people\",\n permissions: [\"MANAGE_MESSAGES\", \"KICK_MEMBERS\", \"BAN_MEMBERS\"]\n }, {\n name: \"VOICE_MODERATOR\",\n displayName: \"VC Mod\",\n description: \"Can manage voice chats\",\n permissions: [\"MOVE_MEMBERS\", \"MUTE_MEMBERS\", \"DEAFEN_MEMBERS\"]\n }\n];\nconst defaultSettings = Object.fromEntries(\n tags.map(({ name, displayName }) => [name, { text: displayName, showInChat: true, showInNotChat: true }])\n) as TagSettings;\n\nfunction SettingsComponent(props: { setValue(v: any): void; }) {\n settings.store.tagSettings ??= defaultSettings;\n\n const [tagSettings, setTagSettings] = useState(settings.store.tagSettings as TagSettings);\n const setValue = (v: TagSettings) => {\n setTagSettings(v);\n props.setValue(v);\n };\n\n return (\n \n {tags.map(t => (\n \n \n \n {({ onMouseEnter, onMouseLeave }) => (\n \n {t.displayName} Tag \n \n )}\n \n \n\n {\n tagSettings[t.name].text = v;\n setValue(tagSettings);\n }}\n className={Margins.bottom16}\n />\n\n {\n tagSettings[t.name].showInChat = v;\n setValue(tagSettings);\n }}\n hideBorder\n >\n Show in messages\n \n\n {\n tagSettings[t.name].showInNotChat = v;\n setValue(tagSettings);\n }}\n hideBorder\n >\n Show in member list and profiles\n \n \n ))}\n \n );\n}\n\nconst settings = definePluginSettings({\n dontShowForBots: {\n description: \"Don't show extra tags for bots (excluding webhooks)\",\n type: OptionType.BOOLEAN\n },\n dontShowBotTag: {\n description: \"Only show extra tags for bots / Hide [BOT] text\",\n type: OptionType.BOOLEAN\n },\n tagSettings: {\n type: OptionType.COMPONENT,\n component: SettingsComponent,\n description: \"fill me\",\n }\n});\n\nexport default definePlugin({\n name: \"MoreUserTags\",\n description: \"Adds tags for webhooks and moderative roles (owner, admin, etc.)\",\n authors: [Devs.Cyn, Devs.TheSun, Devs.RyanCaoDev, Devs.LordElias, Devs.AutumnVN],\n settings,\n patches: [\n // add tags to the tag list\n {\n find: \"BotTagTypes:\",\n replacement: {\n match: /\\((\\i)=\\{\\}\\)\\)\\[(\\i)\\.BOT/,\n replace: \"($1=$self.getTagTypes()))[$2.BOT\"\n }\n },\n {\n find: \".DISCORD_SYSTEM_MESSAGE_BOT_TAG_TOOLTIP,\",\n replacement: [\n // make the tag show the right text\n {\n match: /(switch\\((\\i)\\){.+?)case (\\i(?:\\.\\i)?)\\.BOT:default:(\\i)=(\\i\\.\\i\\.Messages)\\.BOT_TAG_BOT/,\n replace: (_, origSwitch, variant, tags, displayedText, strings) =>\n `${origSwitch}default:{${displayedText} = $self.getTagText(${tags}[${variant}], ${strings})}`\n },\n // show OP tags correctly\n {\n match: /(\\i)=(\\i)===\\i(?:\\.\\i)?\\.ORIGINAL_POSTER/,\n replace: \"$1=$self.isOPTag($2)\"\n },\n // add HTML data attributes (for easier theming)\n {\n match: /.botText,children:(\\i)}\\)]/,\n replace: \"$&,'data-tag':$1.toLowerCase()\"\n }\n ],\n },\n // in messages\n {\n find: \"renderSystemTag:\",\n replacement: {\n match: /;return\\((\\(null==\\i\\?void 0:\\i\\.isSystemDM\\(\\).+?.Types.ORIGINAL_POSTER\\)),null==(\\i)\\)/,\n replace: \";$1;$2=$self.getTag({...arguments[0],origType:$2,location:'chat'});return $2 == null\"\n }\n },\n // in the member list\n {\n find: \".Messages.GUILD_OWNER,\",\n replacement: {\n match: /(?\\i)=\\(null==.{0,100}\\.BOT;return null!=(?\\i)&&\\i\\.bot/,\n replace: \"$ = $self.getTag({user: $, channel: arguments[0].channel, origType: $.bot ? 0 : null, location: 'not-chat' }); return typeof $ === 'number'\"\n }\n },\n // pass channel id down props to be used in profiles\n {\n find: \".hasAvatarForGuild(null==\",\n replacement: {\n match: /(?=usernameIcon:)/,\n replace: \"moreTags_channelId:arguments[0].channelId,\"\n }\n },\n {\n find: 'copyMetaData:\"User Tag\"',\n replacement: {\n match: /(?=,botClass:)/,\n replace: \",moreTags_channelId:arguments[0].moreTags_channelId\"\n }\n },\n // in profiles\n {\n find: \",overrideDiscriminator:\",\n replacement: [\n {\n // prevent channel id from getting ghosted\n // it's either this or extremely long lookbehind\n match: /user:\\i,nick:\\i,/,\n replace: \"$&moreTags_channelId,\"\n }, {\n match: /,botType:(\\i\\((\\i)\\)),/g,\n replace: \",botType:$self.getTag({user:$2,channelId:moreTags_channelId,origType:$1,location:'not-chat'}),\"\n }\n ]\n },\n ],\n\n start() {\n if (settings.store.tagSettings) return;\n // @ts-ignore\n if (!settings.store.visibility_WEBHOOK) settings.store.tagSettings = defaultSettings;\n else {\n const newSettings = { ...defaultSettings };\n Object.entries(Vencord.PlainSettings.plugins.MoreUserTags).forEach(([name, value]) => {\n const [setting, tag] = name.split(\"_\");\n if (setting === \"visibility\") {\n switch (value) {\n case \"always\":\n // its the default\n break;\n case \"chat\":\n newSettings[tag].showInNotChat = false;\n break;\n case \"not-chat\":\n newSettings[tag].showInChat = false;\n break;\n case \"never\":\n newSettings[tag].showInChat = false;\n newSettings[tag].showInNotChat = false;\n break;\n }\n }\n settings.store.tagSettings = newSettings;\n delete Vencord.Settings.plugins.MoreUserTags[name];\n });\n }\n },\n\n getPermissions(user: User, channel: Channel): string[] {\n const guild = GuildStore.getGuild(channel?.guild_id);\n if (!guild) return [];\n\n const permissions = PermissionUtil.computePermissions({ user, context: guild, overwrites: channel.permissionOverwrites });\n return Object.entries(PermissionsBits)\n .map(([perm, permInt]) =>\n permissions & permInt ? perm : \"\"\n )\n .filter(Boolean);\n },\n\n getTagTypes() {\n const obj = {};\n let i = 100;\n tags.forEach(({ name }) => {\n obj[name] = ++i;\n obj[i] = name;\n obj[`${name}-BOT`] = ++i;\n obj[i] = `${name}-BOT`;\n obj[`${name}-OP`] = ++i;\n obj[i] = `${name}-OP`;\n });\n return obj;\n },\n\n isOPTag: (tag: number) => tag === Tag.Types.ORIGINAL_POSTER || tags.some(t => tag === Tag.Types[`${t.name}-OP`]),\n\n getTagText(passedTagName: string, strings: Record) {\n if (!passedTagName) return strings.BOT_TAG_BOT;\n const [tagName, variant] = passedTagName.split(\"-\");\n const tag = tags.find(({ name }) => tagName === name);\n if (!tag) return strings.BOT_TAG_BOT;\n if (variant === \"BOT\" && tagName !== \"WEBHOOK\" && this.settings.store.dontShowForBots) return strings.BOT_TAG_BOT;\n\n const tagText = settings.store.tagSettings?.[tag.name]?.text || tag.displayName;\n switch (variant) {\n case \"OP\":\n return `${strings.BOT_TAG_FORUM_ORIGINAL_POSTER} \u2022 ${tagText}`;\n case \"BOT\":\n return `${strings.BOT_TAG_BOT} \u2022 ${tagText}`;\n default:\n return tagText;\n }\n },\n\n getTag({\n message, user, channelId, origType, location, channel\n }: {\n message?: Message,\n user: User & { isClyde(): boolean; },\n channel?: Channel & { isForumPost(): boolean; },\n channelId?: string;\n origType?: number;\n location: \"chat\" | \"not-chat\";\n }): number | null {\n if (!user)\n return null;\n if (location === \"chat\" && user.id === \"1\")\n return Tag.Types.OFFICIAL;\n if (user.isClyde())\n return Tag.Types.AI;\n\n let type = typeof origType === \"number\" ? origType : null;\n\n channel ??= ChannelStore.getChannel(channelId!) as any;\n if (!channel) return type;\n\n const settings = this.settings.store;\n const perms = this.getPermissions(user, channel);\n\n for (const tag of tags) {\n if (location === \"chat\" && !settings.tagSettings[tag.name].showInChat) continue;\n if (location === \"not-chat\" && !settings.tagSettings[tag.name].showInNotChat) continue;\n\n if (\n tag.permissions?.some(perm => perms.includes(perm)) ||\n (tag.condition?.(message!, user, channel))\n ) {\n if (channel.isForumPost() && channel.ownerId === user.id)\n type = Tag.Types[`${tag.name}-OP`];\n else if (user.bot && !isWebhook(message!, user) && !settings.dontShowBotTag)\n type = Tag.Types[`${tag.name}-BOT`];\n else\n type = Tag.Types[tag.name];\n break;\n }\n }\n return type;\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { makeRange } from \"@components/PluginSettings/components/SettingSliderComponent\";\nimport { Devs } from \"@utils/constants\";\nimport { sleep } from \"@utils/misc\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { RelationshipStore, SelectedChannelStore, UserStore } from \"@webpack/common\";\nimport { Message, ReactionEmoji } from \"discord-types/general\";\n\ninterface IMessageCreate {\n type: \"MESSAGE_CREATE\";\n optimistic: boolean;\n isPushNotification: boolean;\n channelId: string;\n message: Message;\n}\n\ninterface IReactionAdd {\n type: \"MESSAGE_REACTION_ADD\";\n optimistic: boolean;\n channelId: string;\n messageId: string;\n messageAuthorId: string;\n userId: \"195136840355807232\";\n emoji: ReactionEmoji;\n}\n\ninterface IVoiceChannelEffectSendEvent {\n type: string;\n emoji?: ReactionEmoji; // Just in case...\n channelId: string;\n userId: string;\n animationType: number;\n animationId: number;\n}\n\nconst MOYAI = \"\uD83D\uDDFF\";\nconst MOYAI_URL =\n \"https://raw.githubusercontent.com/MeguminSama/VencordPlugins/main/plugins/moyai/moyai.mp3\";\nconst MOYAI_URL_HD =\n \"https://raw.githubusercontent.com/MeguminSama/VencordPlugins/main/plugins/moyai/moyai_hd.wav\";\n\nconst settings = definePluginSettings({\n volume: {\n description: \"Volume of the \uD83D\uDDFF\uD83D\uDDFF\uD83D\uDDFF\",\n type: OptionType.SLIDER,\n markers: makeRange(0, 1, 0.1),\n default: 0.5,\n stickToMarkers: false\n },\n quality: {\n description: \"Quality of the \uD83D\uDDFF\uD83D\uDDFF\uD83D\uDDFF\",\n type: OptionType.SELECT,\n options: [\n { label: \"Normal\", value: \"Normal\", default: true },\n { label: \"HD\", value: \"HD\" }\n ],\n },\n triggerWhenUnfocused: {\n description: \"Trigger the \uD83D\uDDFF even when the window is unfocused\",\n type: OptionType.BOOLEAN,\n default: true\n },\n ignoreBots: {\n description: \"Ignore bots\",\n type: OptionType.BOOLEAN,\n default: true\n },\n ignoreBlocked: {\n description: \"Ignore blocked users\",\n type: OptionType.BOOLEAN,\n default: true\n }\n});\n\nexport default definePlugin({\n name: \"Moyai\",\n authors: [Devs.Megu, Devs.Nuckyz],\n description: \"\uD83D\uDDFF\uD83D\uDDFF\uD83D\uDDFF\uD83D\uDDFF\uD83D\uDDFF\uD83D\uDDFF\uD83D\uDDFF\uD83D\uDDFF\",\n settings,\n\n flux: {\n async MESSAGE_CREATE({ optimistic, type, message, channelId }: IMessageCreate) {\n if (optimistic || type !== \"MESSAGE_CREATE\") return;\n if (message.state === \"SENDING\") return;\n if (settings.store.ignoreBots && message.author?.bot) return;\n if (settings.store.ignoreBlocked && RelationshipStore.isBlocked(message.author?.id)) return;\n if (!message.content) return;\n if (channelId !== SelectedChannelStore.getChannelId()) return;\n\n const moyaiCount = getMoyaiCount(message.content);\n\n for (let i = 0; i < moyaiCount; i++) {\n boom();\n await sleep(300);\n }\n },\n\n MESSAGE_REACTION_ADD({ optimistic, type, channelId, userId, messageAuthorId, emoji }: IReactionAdd) {\n if (optimistic || type !== \"MESSAGE_REACTION_ADD\") return;\n if (settings.store.ignoreBots && UserStore.getUser(userId)?.bot) return;\n if (settings.store.ignoreBlocked && RelationshipStore.isBlocked(messageAuthorId)) return;\n if (channelId !== SelectedChannelStore.getChannelId()) return;\n\n const name = emoji.name.toLowerCase();\n if (name !== MOYAI && !name.includes(\"moyai\") && !name.includes(\"moai\")) return;\n\n boom();\n },\n\n VOICE_CHANNEL_EFFECT_SEND({ emoji }: IVoiceChannelEffectSendEvent) {\n if (!emoji?.name) return;\n const name = emoji.name.toLowerCase();\n if (name !== MOYAI && !name.includes(\"moyai\") && !name.includes(\"moai\")) return;\n\n boom();\n }\n }\n});\n\nfunction countOccurrences(sourceString: string, subString: string) {\n let i = 0;\n let lastIdx = 0;\n while ((lastIdx = sourceString.indexOf(subString, lastIdx) + 1) !== 0)\n i++;\n\n return i;\n}\n\nfunction countMatches(sourceString: string, pattern: RegExp) {\n if (!pattern.global)\n throw new Error(\"pattern must be global\");\n\n let i = 0;\n while (pattern.test(sourceString))\n i++;\n\n return i;\n}\n\nconst customMoyaiRe = //gi;\n\nfunction getMoyaiCount(message: string) {\n const count = countOccurrences(message, MOYAI)\n + countMatches(message, customMoyaiRe);\n\n return Math.min(count, 10);\n}\n\nfunction boom() {\n if (!settings.store.triggerWhenUnfocused && !document.hasFocus()) return;\n const audioElement = document.createElement(\"audio\");\n\n audioElement.src = settings.store.quality === \"HD\"\n ? MOYAI_URL_HD\n : MOYAI_URL;\n\n audioElement.volume = settings.store.volume;\n audioElement.play();\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByProps } from \"@webpack\";\n\nconst settings = definePluginSettings({\n guild: {\n description: \"Mute Guild\",\n type: OptionType.BOOLEAN,\n default: true\n },\n everyone: {\n description: \"Suppress @everyone and @here\",\n type: OptionType.BOOLEAN,\n default: true\n },\n role: {\n description: \"Suppress All Role @mentions\",\n type: OptionType.BOOLEAN,\n default: true\n }\n});\n\nexport default definePlugin({\n name: \"MuteNewGuild\",\n description: \"Mutes newly joined guilds\",\n authors: [Devs.Glitch, Devs.Nuckyz, Devs.carince],\n patches: [\n {\n find: \",acceptInvite(\",\n replacement: {\n match: /INVITE_ACCEPT_SUCCESS.+?,(\\i)=null!==.+?;/,\n replace: (m, guildId) => `${m}$self.handleMute(${guildId});`\n }\n },\n {\n find: \"{joinGuild:\",\n replacement: {\n match: /guildId:(\\i),lurker:(\\i).{0,20}}\\)\\);/,\n replace: (m, guildId, lurker) => `${m}if(!${lurker})$self.handleMute(${guildId});`\n }\n }\n ],\n settings,\n\n handleMute(guildId: string | null) {\n if (guildId === \"@me\" || guildId === \"null\" || guildId == null) return;\n findByProps(\"updateGuildNotificationSettings\").updateGuildNotificationSettings(guildId,\n {\n muted: settings.store.guild,\n suppress_everyone: settings.store.everyone,\n suppress_roles: settings.store.role\n }\n );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport { isNonNullish } from \"@utils/guards\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { Avatar, ChannelStore, Clickable, RelationshipStore, ScrollerThin, UserStore } from \"@webpack/common\";\nimport { Channel, User } from \"discord-types/general\";\n\nconst SelectedChannelActionCreators = findByPropsLazy(\"selectPrivateChannel\");\nconst AvatarUtils = findByPropsLazy(\"getChannelIconURL\");\nconst UserUtils = findByPropsLazy(\"getGlobalName\");\n\nconst ProfileListClasses = findByPropsLazy(\"emptyIconFriends\", \"emptyIconGuilds\");\nconst GuildLabelClasses = findByPropsLazy(\"guildNick\", \"guildAvatarWithoutIcon\");\n\nfunction getGroupDMName(channel: Channel) {\n return channel.name ||\n channel.recipients\n .map(UserStore.getUser)\n .filter(isNonNullish)\n .map(c => RelationshipStore.getNickname(c.id) || UserUtils.getName(c))\n .join(\", \");\n}\n\nexport default definePlugin({\n name: \"MutualGroupDMs\",\n description: \"Shows mutual group dms in profiles\",\n authors: [Devs.amia],\n\n patches: [\n {\n find: \".Messages.USER_PROFILE_MODAL\", // Note: the module is lazy-loaded\n replacement: {\n match: /(?<=\\.MUTUAL_GUILDS\\}\\),)(?=(\\i\\.bot).{0,20}(\\(0,\\i\\.jsx\\)\\(.{0,100}id:))/,\n replace: '($1||arguments[0].isCurrentUser)?null:$2\"MUTUAL_GDMS\",children:\"Mutual Groups\"}),'\n }\n },\n {\n find: \".UserProfileSections.USER_INFO_CONNECTIONS:\",\n replacement: {\n match: /(?<={user:(\\i),onClose:(\\i)}\\);)(?=case \\i\\.\\i\\.MUTUAL_FRIENDS)/,\n replace: \"case \\\"MUTUAL_GDMS\\\":return $self.renderMutualGDMs($1,$2);\"\n }\n }\n ],\n\n renderMutualGDMs(user: User, onClose: () => void) {\n const entries = ChannelStore.getSortedPrivateChannels().filter(c => c.isGroupDM() && c.recipients.includes(user.id)).map(c => (\n {\n onClose();\n SelectedChannelActionCreators.selectPrivateChannel(c.id);\n }}\n >\n \n \n
\n
{getGroupDMName(c)}
\n
{c.recipients.length + 1} Members
\n
\n \n ));\n\n return (\n \n {entries.length > 0\n ? entries\n : (\n
\n
\n
No group dms in common
\n
\n )\n }\n \n );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\n\nconst RelationshipStore = findByPropsLazy(\"getRelationships\", \"isBlocked\");\n\nexport default definePlugin({\n name: \"NoBlockedMessages\",\n description: \"Hides all blocked messages from chat completely.\",\n authors: [Devs.rushii, Devs.Samu],\n patches: [\n {\n find: \"Messages.BLOCKED_MESSAGES_HIDE\",\n replacement: [\n {\n match: /let\\{[^}]*collapsedReason[^}]*\\}/,\n replace: \"return null;$&\"\n }\n ]\n },\n ...[\n 'displayName=\"MessageStore\"',\n 'displayName=\"ReadStateStore\"'\n ].map(find => ({\n find,\n predicate: () => Settings.plugins.NoBlockedMessages.ignoreBlockedMessages === true,\n replacement: [\n {\n match: /(?<=MESSAGE_CREATE:function\\((\\i)\\){)/,\n replace: (_, props) => `if($self.isBlocked(${props}.message))return;`\n }\n ]\n }))\n ],\n options: {\n ignoreBlockedMessages: {\n description: \"Completely ignores (recent) incoming messages from blocked users (locally).\",\n type: OptionType.BOOLEAN,\n default: false,\n restartNeeded: true,\n },\n },\n isBlocked: message =>\n RelationshipStore.isBlocked(message.author.id)\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NoDevtoolsWarning\",\n description: \"Disables the 'HOLD UP' banner in the console. As a side effect, also prevents Discord from hiding your token, which prevents random logouts.\",\n authors: [Devs.Ven],\n patches: [{\n find: \"setDevtoolsCallbacks\",\n replacement: {\n match: /if\\(null!=\\i&&\"0.0.0\"===\\i\\.remoteApp\\.getVersion\\(\\)\\)/,\n replace: \"if(true)\"\n }\n }]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NoF1\",\n description: \"Disables F1 help bind.\",\n authors: [Devs.Cyn],\n patches: [\n {\n find: ',\"f1\"],comboKeysBindGlobal:',\n replacement: {\n match: ',\"f1\"],comboKeysBindGlobal:',\n replace: \"],comboKeysBindGlobal:\",\n },\n },\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n(window.VencordStyles ??= new Map()).set(\"src/plugins/noMosaic/styles.css\", {\n name: \"src/plugins/noMosaic/styles.css\",\n source: \"[class^=\\\"nonMediaAttachmentsContainer_\\\"] [class*=\\\"messageAttachment_\\\"] {\\n position: relative;\\n}\\n\",\n classNames: {},\n dom: null,\n});\n\nexport default \"src/plugins/noMosaic/styles.css\";\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { disableStyle, enableStyle } from \"@api/Styles\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nimport style from \"./styles.css?managed\";\n\nconst settings = definePluginSettings({\n inlineVideo: {\n description: \"Play videos without carousel modal\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n },\n mediaLayoutType: {\n description: \"Choose media layout type\",\n type: OptionType.SELECT,\n restartNeeded: true,\n options: [\n { label: \"STATIC, render loading image but image isn't resposive, no problem unless discord window width is too small\", value: \"STATIC\", default: true },\n { label: \"RESPONSIVE, image is responsive but not render loading image, cause messages shift when loaded\", value: \"RESPONSIVE\" },\n ]\n }\n});\n\nexport default definePlugin({\n name: \"NoMosaic\",\n authors: [Devs.AutumnVN],\n description: \"Removes Discord new image mosaic\",\n tags: [\"image\", \"mosaic\", \"media\"],\n\n settings,\n\n patches: [\n {\n find: \".oneByTwoLayoutThreeGrid\",\n replacement: [{\n match: /mediaLayoutType:\\i\\.\\i\\.MOSAIC/,\n replace: \"mediaLayoutType:$self.mediaLayoutType()\",\n },\n {\n match: /null!==\\(\\i=\\i\\.get\\(\\i\\)\\)&&void 0!==\\i\\?\\i:\"INVALID\"/,\n replace: '\"INVALID\"',\n }]\n },\n {\n find: \"renderAttachments(\",\n predicate: () => settings.store.inlineVideo,\n replacement: {\n match: /url:(\\i)\\.url\\}\\);return /,\n replace: \"$&$1.content_type?.startsWith('image/')&&\"\n }\n },\n {\n find: \"Messages.REMOVE_ATTACHMENT_TOOLTIP_TEXT\",\n replacement: {\n match: /\\i===\\i\\.\\i\\.MOSAIC/,\n replace: \"true\"\n }\n }\n ],\n\n mediaLayoutType() {\n return settings.store.mediaLayoutType;\n },\n\n start() {\n enableStyle(style);\n },\n\n stop() {\n disableStyle(style);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\n\nconst MessageRequestStore = findByPropsLazy(\"getMessageRequestsCount\");\n\nconst settings = definePluginSettings({\n hideFriendRequestsCount: {\n type: OptionType.BOOLEAN,\n description: \"Hide incoming friend requests count\",\n default: true,\n restartNeeded: true\n },\n hideMessageRequestsCount: {\n type: OptionType.BOOLEAN,\n description: \"Hide message requests count\",\n default: true,\n restartNeeded: true\n },\n hidePremiumOffersCount: {\n type: OptionType.BOOLEAN,\n description: \"Hide nitro offers count\",\n default: true,\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"NoPendingCount\",\n description: \"Removes the ping count of incoming friend requests, message requests, and nitro offers.\",\n authors: [Devs.amia],\n\n settings: settings,\n\n // Functions used to determine the top left count indicator can be found in the single module that calls getUnacknowledgedOffers(...)\n // or by searching for \"showProgressBadge:\"\n patches: [\n {\n find: \"getPendingCount(){\",\n predicate: () => settings.store.hideFriendRequestsCount,\n replacement: {\n match: /(?<=getPendingCount\\(\\)\\{)/,\n replace: \"return 0;\"\n }\n },\n {\n find: \"getMessageRequestsCount(){\",\n predicate: () => settings.store.hideMessageRequestsCount,\n replacement: {\n match: /(?<=getMessageRequestsCount\\(\\)\\{)/,\n replace: \"return 0;\"\n }\n },\n // This prevents the Message Requests tab from always hiding due to the previous patch (and is compatible with spam requests)\n // In short, only the red badge is hidden. Button visibility behavior isn't changed.\n {\n find: \".getSpamChannelsCount(),\",\n predicate: () => settings.store.hideMessageRequestsCount,\n replacement: {\n match: /(?<=getSpamChannelsCount\\(\\),\\i=)\\i\\.getMessageRequestsCount\\(\\)/,\n replace: \"$self.getRealMessageRequestCount()\"\n }\n },\n {\n find: \"showProgressBadge:\",\n predicate: () => settings.store.hidePremiumOffersCount,\n replacement: {\n // The two groups inside the first group grab the minified names of the variables,\n // they are then referenced later to find unviewedTrialCount + unviewedDiscountCount.\n match: /(?<=\\{unviewedTrialCount:(\\i),unviewedDiscountCount:(\\i)\\}.{0,200}\\i=)\\1\\+\\2/,\n replace: \"0\"\n }\n }\n ],\n\n getRealMessageRequestCount() {\n return MessageRequestStore.getMessageRequestChannelIds().size;\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NoProfileThemes\",\n description: \"Completely removes Nitro profile themes\",\n authors: [Devs.TheKodeToad],\n patches: [\n {\n find: \".NITRO_BANNER,\",\n replacement: {\n // = isPremiumAtLeast(user.premiumType, TIER_2)\n match: /=(?=\\i\\.\\i\\.isPremiumAtLeast\\(null==(\\i))/,\n // = user.banner && isPremiumAtLeast(user.premiumType, TIER_2)\n replace: \"=(arguments[0]?.bannerSrc||$1?.banner)&&\"\n }\n },\n {\n find: \".avatarPositionPremiumNoBanner,default:\",\n replacement: {\n // premiumUserWithoutBanner: foo().avatarPositionPremiumNoBanner, default: foo().avatarPositionNormal\n match: /\\.avatarPositionPremiumNoBanner(?=,default:\\i\\.(\\i))/,\n // premiumUserWithoutBanner: foo().avatarPositionNormal...\n replace: \".$1\"\n }\n },\n {\n find: \"hasThemeColors(){\",\n replacement: {\n match: /get canUsePremiumProfileCustomization\\(\\){return /,\n replace: \"$&false &&\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport type { Message } from \"discord-types/general\";\n\nconst settings = definePluginSettings({\n userList: {\n description:\n \"List of users to allow or exempt pings for (separated by commas or spaces)\",\n type: OptionType.STRING,\n default: \"1234567890123445,1234567890123445\",\n },\n shouldPingListed: {\n description: \"Behaviour\",\n type: OptionType.SELECT,\n options: [\n {\n label: \"Do not ping the listed users\",\n value: false,\n },\n {\n label: \"Only ping the listed users\",\n value: true,\n default: true,\n },\n ],\n },\n inverseShiftReply: {\n description: \"Invert Discord's shift replying behaviour (enable to make shift reply mention user)\",\n type: OptionType.BOOLEAN,\n default: false,\n }\n});\n\nexport default definePlugin({\n name: \"NoReplyMention\",\n description: \"Disables reply pings by default\",\n authors: [Devs.DustyAngel47, Devs.axyie, Devs.pylix, Devs.outfoxxed],\n settings,\n\n shouldMention(message: Message, isHoldingShift: boolean) {\n const isListed = settings.store.userList.includes(message.author.id);\n const isExempt = settings.store.shouldPingListed ? isListed : !isListed;\n return settings.store.inverseShiftReply ? isHoldingShift !== isExempt : !isHoldingShift && isExempt;\n },\n\n patches: [\n {\n find: \",\\\"Message\\\")}function\",\n replacement: {\n match: /:(\\i),shouldMention:!(\\i)\\.shiftKey/,\n replace: \":$1,shouldMention:$self.shouldMention($1,$2.shiftKey)\"\n }\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NoScreensharePreview\",\n description: \"Disables screenshare previews from being sent.\",\n authors: [Devs.Nuckyz],\n patches: [\n {\n find: '\"ApplicationStreamPreviewUploadManager\"',\n replacement: {\n match: /await \\i\\.\\i\\.(makeChunkedRequest\\(|post\\(\\{url:)\\i\\.\\i\\.STREAM_PREVIEW.+?\\}\\)/g,\n replace: \"0\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NoTypingAnimation\",\n authors: [Devs.AutumnVN],\n description: \"Disables the CPU-intensive typing dots animation\",\n patches: [{\n find: \"dotCycle\",\n replacement: {\n match: /document.hasFocus\\(\\)/,\n replace: \"false\"\n }\n }]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Sofia Lima\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\n\nexport default definePlugin({\n name: \"NoUnblockToJump\",\n description: \"Allows you to jump to messages of blocked users without unblocking them\",\n authors: [Devs.dzshn],\n patches: [\n {\n find: '.id,\"Search Results\"',\n replacement: {\n match: /if\\(.{1,10}\\)(.{1,10}\\.show\\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/,\n replace: \"if(false)$1\"\n }\n },\n {\n find: \"renderJumpButton()\",\n replacement: {\n match: /if\\(.{1,10}\\)(.{1,10}\\.show\\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/,\n replace: \"if(false)$1\"\n }\n },\n {\n find: \"flash:!0,returnMessageId\",\n replacement: {\n match: /.\\?(.{1,10}\\.show\\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/,\n replace: \"false?$1\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NormalizeMessageLinks\",\n description: \"Strip canary/ptb from message links\",\n authors: [Devs.bb010g],\n patches: [\n {\n find: \".Messages.COPY_MESSAGE_LINK,\",\n replacement: {\n match: /\\.concat\\(location\\.host\\)/,\n replace: \".concat($self.normalizeHost(location.host))\",\n },\n },\n ],\n normalizeHost(host: string) {\n return host.replace(/(^|\\b)(canary\\.|ptb\\.)(discord.com)$/, \"$1$3\");\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NSFWGateBypass\",\n description: \"Allows you to access NSFW channels without setting/verifying your age\",\n authors: [Devs.Commandtechno],\n patches: [\n {\n find: \".nsfwAllowed=null\",\n replacement: {\n match: /(\\w+)\\.nsfwAllowed=/,\n replace: \"$1.nsfwAllowed=true;\",\n },\n },\n ],\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { ChannelStore, ReadStateStore, UserStore } from \"@webpack/common\";\nimport { MessageJSON } from \"discord-types/general\";\n\nconst enum ChannelType {\n DM = 1,\n GROUP_DM = 3\n}\n\nconst settings = definePluginSettings({\n channelToAffect: {\n type: OptionType.SELECT,\n description: \"Select the type of DM for the plugin to affect\",\n options: [\n { label: \"Both\", value: \"both_dms\", default: true },\n { label: \"User DMs\", value: \"user_dm\" },\n { label: \"Group DMs\", value: \"group_dm\" },\n ]\n },\n allowMentions: {\n type: OptionType.BOOLEAN,\n description: \"Receive audio pings for @mentions\",\n default: false,\n },\n allowEveryone: {\n type: OptionType.BOOLEAN,\n description: \"Receive audio pings for @everyone and @here in group DMs\",\n default: false,\n },\n});\n\nexport default definePlugin({\n name: \"OnePingPerDM\",\n description: \"If unread messages are sent by a user in DMs multiple times, you'll only receive one audio ping. Read the messages to reset the limit\",\n authors: [Devs.ProffDea],\n settings,\n patches: [{\n find: \".getDesktopType()===\",\n replacement: [{\n match: /(\\i\\.\\i\\.getDesktopType\\(\\)===\\i\\.\\i\\.NEVER)\\)/,\n replace: \"$&if(!$self.isPrivateChannelRead(arguments[0]?.message))return;else \"\n },\n {\n match: /sound:(\\i\\?\\i:void 0,volume:\\i,onClick)/,\n replace: \"sound:!$self.isPrivateChannelRead(arguments[0]?.message)?undefined:$1\"\n }]\n }],\n isPrivateChannelRead(message: MessageJSON) {\n const channelType = ChannelStore.getChannel(message.channel_id)?.type;\n if (\n (channelType !== ChannelType.DM && channelType !== ChannelType.GROUP_DM) ||\n (channelType === ChannelType.DM && settings.store.channelToAffect === \"group_dm\") ||\n (channelType === ChannelType.GROUP_DM && settings.store.channelToAffect === \"user_dm\") ||\n (settings.store.allowMentions && message.mentions.some(m => m.id === UserStore.getCurrentUser().id)) ||\n (settings.store.allowEveryone && message.mention_everyone)\n ) {\n return true;\n }\n return ReadStateStore.getOldestUnreadMessageId(message.channel_id) === message.id;\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"oneko\",\n description: \"cat follow mouse (real)\",\n // Listing adryd here because this literally just evals her script\n authors: [Devs.Ven, Devs.adryd],\n\n start() {\n fetch(\"https://raw.githubusercontent.com/adryd325/oneko.js/5977144dce83e4d71af1de005d16e38eebeb7b72/oneko.js\")\n .then(x => x.text())\n .then(s => s.replace(\"./oneko.gif\", \"https://raw.githubusercontent.com/adryd325/oneko.js/14bab15a755d0e35cd4ae19c931d96d306f99f42/oneko.gif\"))\n .then(eval);\n },\n\n stop() {\n clearInterval(window.onekoInterval);\n delete window.onekoInterval;\n document.getElementById(\"oneko\")?.remove();\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType, PluginNative } from \"@utils/types\";\nimport { showToast, Toasts } from \"@webpack/common\";\nimport type { MouseEvent } from \"react\";\n\nconst ShortUrlMatcher = /^https:\\/\\/(spotify\\.link|s\\.team)\\/.+$/;\nconst SpotifyMatcher = /^https:\\/\\/open\\.spotify\\.com\\/(track|album|artist|playlist|user|episode)\\/(.+)(?:\\?.+?)?$/;\nconst SteamMatcher = /^https:\\/\\/(steamcommunity\\.com|(?:help|store)\\.steampowered\\.com)\\/.+$/;\nconst EpicMatcher = /^https:\\/\\/store\\.epicgames\\.com\\/(.+)$/;\n\nconst settings = definePluginSettings({\n spotify: {\n type: OptionType.BOOLEAN,\n description: \"Open Spotify links in the Spotify app\",\n default: true,\n },\n steam: {\n type: OptionType.BOOLEAN,\n description: \"Open Steam links in the Steam app\",\n default: true,\n },\n epic: {\n type: OptionType.BOOLEAN,\n description: \"Open Epic Games links in the Epic Games Launcher\",\n default: true,\n }\n});\n\nconst Native = VencordNative.pluginHelpers.OpenInApp as PluginNative;\n\nexport default definePlugin({\n name: \"OpenInApp\",\n description: \"Open Spotify, Steam and Epic Games URLs in their respective apps instead of your browser\",\n authors: [Devs.Ven],\n settings,\n\n patches: [\n {\n find: \"trackAnnouncementMessageLinkClicked({\",\n replacement: {\n match: /(?<=handleClick:function\\(\\)\\{return (\\i)\\}.+?)function \\1\\(.+?\\)\\{/,\n replace: \"async $& if(await $self.handleLink(...arguments)) return;\"\n }\n },\n // Make Spotify profile activity links open in app on web\n {\n find: \"WEB_OPEN(\",\n predicate: () => !IS_DISCORD_DESKTOP && settings.store.spotify,\n replacement: {\n match: /\\i\\.\\i\\.isProtocolRegistered\\(\\)(.{0,100})window.open/g,\n replace: \"true$1VencordNative.native.openExternal\"\n }\n },\n {\n find: \".CONNECTED_ACCOUNT_VIEWED,\",\n replacement: {\n match: /(?<=href:\\i,onClick:\\i=>\\{)(?=.{0,10}\\i=(\\i)\\.type,.{0,100}CONNECTED_ACCOUNT_VIEWED)/,\n replace: \"$self.handleAccountView(arguments[0],$1.type,$1.id);\"\n }\n }\n ],\n\n async handleLink(data: { href: string; }, event?: MouseEvent) {\n if (!data) return false;\n\n let url = data.href;\n if (!IS_WEB && ShortUrlMatcher.test(url)) {\n event?.preventDefault();\n // CORS jumpscare\n url = await Native.resolveRedirect(url);\n }\n\n spotify: {\n if (!settings.store.spotify) break spotify;\n\n const match = SpotifyMatcher.exec(url);\n if (!match) break spotify;\n\n const [, type, id] = match;\n VencordNative.native.openExternal(`spotify:${type}:${id}`);\n\n event?.preventDefault();\n return true;\n }\n\n steam: {\n if (!settings.store.steam) break steam;\n\n if (!SteamMatcher.test(url)) break steam;\n\n VencordNative.native.openExternal(`steam://openurl/${url}`);\n event?.preventDefault();\n\n // Steam does not focus itself so show a toast so it's slightly less confusing\n showToast(\"Opened link in Steam\", Toasts.Type.SUCCESS);\n return true;\n }\n\n epic: {\n if (!settings.store.epic) break epic;\n\n const match = EpicMatcher.exec(url);\n if (!match) break epic;\n\n VencordNative.native.openExternal(`com.epicgames.launcher://store/${match[1]}`);\n event?.preventDefault();\n\n return true;\n }\n\n // in case short url didn't end up being something we can handle\n if (event?.defaultPrevented) {\n window.open(url, \"_blank\");\n return true;\n }\n\n return false;\n },\n\n handleAccountView(event: { preventDefault(): void; }, platformType: string, userId: string) {\n if (platformType === \"spotify\" && settings.store.spotify) {\n VencordNative.native.openExternal(`spotify:user:${userId}`);\n event.preventDefault();\n } else if (platformType === \"steam\" && settings.store.steam) {\n VencordNative.native.openExternal(`steam://openurl/https://steamcommunity.com/profiles/${userId}`);\n showToast(\"Opened link in Steam\", Toasts.Type.SUCCESS);\n event.preventDefault();\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { FluxDispatcher } from \"@webpack/common\";\n\nconst enum Intensity {\n Normal,\n Better,\n ProjectX,\n}\n\nconst settings = definePluginSettings({\n superIntensePartyMode: {\n description: \"Party intensity\",\n type: OptionType.SELECT,\n options: [\n { label: \"Normal\", value: Intensity.Normal, default: true },\n { label: \"Better\", value: Intensity.Better },\n { label: \"Project X\", value: Intensity.ProjectX },\n ],\n restartNeeded: false,\n onChange: setSettings\n },\n});\n\nexport default definePlugin({\n name: \"Party mode \uD83C\uDF89\",\n description: \"Allows you to use party mode cause the party never ends \u2728\",\n authors: [Devs.UwUDev],\n settings,\n\n start() {\n setPoggerState(true);\n setSettings(settings.store.superIntensePartyMode);\n },\n\n stop() {\n setPoggerState(false);\n },\n});\n\nfunction setPoggerState(state: boolean) {\n FluxDispatcher.dispatch({\n type: \"POGGERMODE_SETTINGS_UPDATE\",\n settings: {\n enabled: state,\n settingsVisible: state\n }\n });\n}\n\nfunction setSettings(intensity: Intensity) {\n const state = {\n screenshakeEnabledLocations: { 0: true, 1: true, 2: true },\n shakeIntensity: 1,\n confettiSize: 16,\n confettiCount: 5,\n combosRequiredCount: 1\n };\n\n switch (intensity) {\n case Intensity.Normal: {\n Object.assign(state, {\n screenshakeEnabledLocations: { 0: true, 1: false, 2: false },\n combosRequiredCount: 5\n });\n break;\n }\n case Intensity.Better: {\n Object.assign(state, {\n confettiSize: 12,\n confettiCount: 8,\n });\n break;\n }\n case Intensity.ProjectX: {\n Object.assign(state, {\n shakeIntensity: 20,\n confettiSize: 25,\n confettiCount: 15,\n });\n break;\n }\n }\n\n FluxDispatcher.dispatch({\n type: \"POGGERMODE_SETTINGS_UPDATE\",\n settings: state\n });\n}\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nconst settings = definePluginSettings({\n lockout: {\n type: OptionType.BOOLEAN,\n default: true,\n description: 'Bypass the permission lockout prevention (\"Pretty sure you don\\'t want to do this\")',\n restartNeeded: true\n },\n onboarding: {\n type: OptionType.BOOLEAN,\n default: true,\n description: 'Bypass the onboarding requirements (\"Making this change will make your server incompatible [...]\")',\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"PermissionFreeWill\",\n description: \"Disables the client-side restrictions for channel permission management.\",\n authors: [Devs.lewisakura],\n\n patches: [\n // Permission lockout, just set the check to true\n {\n find: \".showPermissionLockoutModal(\",\n replacement: [\n {\n match: /case\"DENY\":.{0,50}if\\((?=\\i\\.\\i\\.can)/,\n replace: \"$&true||\"\n }\n ],\n predicate: () => settings.store.lockout\n },\n // Onboarding, same thing but we need to prevent the check\n {\n find: \".ONBOARDING_CHANNEL_THRESHOLD_WARNING\",\n replacement: [\n {\n // are we java yet?\n match: /(?<=(?:isDefaultChannelThresholdMetAfterDelete|checkDefaultChannelThresholdMetAfterChannelPermissionDeny):function\\(\\)\\{)return \\i(?=\\})/g,\n replace: \"return () => true\"\n }\n ],\n predicate: () => settings.store.onboarding\n }\n ],\n settings\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { classNameFactory } from \"@api/Styles\";\nimport { wordsToTitle } from \"@utils/text\";\nimport { GuildStore, i18n, Parser } from \"@webpack/common\";\nimport { Guild, GuildMember, Role } from \"discord-types/general\";\nimport type { ReactNode } from \"react\";\n\nimport { PermissionsSortOrder, settings } from \".\";\nimport { PermissionType } from \"./components/RolesAndUsersPermissions\";\n\nexport const cl = classNameFactory(\"vc-permviewer-\");\n\nfunction formatPermissionWithoutMatchingString(permission: string) {\n return wordsToTitle(permission.toLowerCase().split(\"_\"));\n}\n\n// because discord is unable to be consistent with their names\nconst PermissionKeyMap = {\n MANAGE_GUILD: \"MANAGE_SERVER\",\n MANAGE_GUILD_EXPRESSIONS: \"MANAGE_EXPRESSIONS\",\n CREATE_GUILD_EXPRESSIONS: \"CREATE_EXPRESSIONS\",\n MODERATE_MEMBERS: \"MODERATE_MEMBER\", // HELLOOOO ??????\n STREAM: \"VIDEO\",\n SEND_VOICE_MESSAGES: \"ROLE_PERMISSIONS_SEND_VOICE_MESSAGE\",\n} as const;\n\nexport function getPermissionString(permission: string) {\n permission = PermissionKeyMap[permission] || permission;\n\n return i18n.Messages[permission] ||\n // shouldn't get here but just in case\n formatPermissionWithoutMatchingString(permission);\n}\n\nexport function getPermissionDescription(permission: string): ReactNode {\n // DISCORD PLEEEEEEEEAAAAASE IM BEGGING YOU :(\n if (permission === \"USE_APPLICATION_COMMANDS\")\n permission = \"USE_APPLICATION_COMMANDS_GUILD\";\n else if (permission === \"SEND_VOICE_MESSAGES\")\n permission = \"SEND_VOICE_MESSAGE_GUILD\";\n else if (permission !== \"STREAM\")\n permission = PermissionKeyMap[permission] || permission;\n\n const msg = i18n.Messages[`ROLE_PERMISSIONS_${permission}_DESCRIPTION`] as any;\n if (msg?.hasMarkdown)\n return Parser.parse(msg.message);\n\n if (typeof msg === \"string\") return msg;\n\n return \"\";\n}\n\nexport function getSortedRoles({ roles, id }: Guild, member: GuildMember) {\n return [...member.roles, id]\n .map(id => roles[id])\n .sort((a, b) => b.position - a.position);\n}\n\nexport function sortUserRoles(roles: Role[]) {\n switch (settings.store.permissionsSortOrder) {\n case PermissionsSortOrder.HighestRole:\n return roles.sort((a, b) => b.position - a.position);\n case PermissionsSortOrder.LowestRole:\n return roles.sort((a, b) => a.position - b.position);\n default:\n return roles;\n }\n}\n\nexport function sortPermissionOverwrites(overwrites: T[], guildId: string) {\n const guild = GuildStore.getGuild(guildId);\n\n return overwrites.sort((a, b) => {\n if (a.type !== PermissionType.Role || b.type !== PermissionType.Role) return 0;\n\n const roleA = guild.roles[a.id];\n const roleB = guild.roles[b.id];\n\n return roleB.position - roleA.position;\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function PermissionDeniedIcon() {\n return (\n \n Denied\n \n \n );\n}\n\nexport function PermissionAllowedIcon() {\n return (\n \n Allowed\n \n \n );\n}\n\nexport function PermissionDefaultIcon() {\n return (\n \n \n Not overwritten\n \n \n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { InfoIcon, OwnerCrownIcon } from \"@components/Icons\";\nimport { getUniqueUsername } from \"@utils/discord\";\nimport { ModalCloseButton, ModalContent, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from \"@utils/modal\";\nimport { ContextMenu, FluxDispatcher, GuildMemberStore, Menu, PermissionsBits, Text, Tooltip, useEffect, UserStore, useState, useStateFromStores } from \"@webpack/common\";\nimport type { Guild } from \"discord-types/general\";\n\nimport { settings } from \"..\";\nimport { cl, getPermissionDescription, getPermissionString } from \"../utils\";\nimport { PermissionAllowedIcon, PermissionDefaultIcon, PermissionDeniedIcon } from \"./icons\";\n\nexport const enum PermissionType {\n Role = 0,\n User = 1,\n Owner = 2\n}\n\nexport interface RoleOrUserPermission {\n type: PermissionType;\n id?: string;\n permissions?: bigint;\n overwriteAllow?: bigint;\n overwriteDeny?: bigint;\n}\n\nfunction openRolesAndUsersPermissionsModal(permissions: Array, guild: Guild, header: string) {\n return openModal(modalProps => (\n \n ));\n}\n\nfunction RolesAndUsersPermissionsComponent({ permissions, guild, modalProps, header }: { permissions: Array; guild: Guild; modalProps: ModalProps; header: string; }) {\n permissions.sort((a, b) => a.type - b.type);\n\n useStateFromStores(\n [GuildMemberStore],\n () => GuildMemberStore.getMemberIds(guild.id),\n null,\n (old, current) => old.length === current.length\n );\n\n useEffect(() => {\n const usersToRequest = permissions\n .filter(p => p.type === PermissionType.User && !GuildMemberStore.isMember(guild.id, p.id!))\n .map(({ id }) => id);\n\n FluxDispatcher.dispatch({\n type: \"GUILD_MEMBERS_REQUEST\",\n guildIds: [guild.id],\n userIds: usersToRequest\n });\n }, []);\n\n const [selectedItemIndex, selectItem] = useState(0);\n const selectedItem = permissions[selectedItemIndex];\n\n return (\n \n \n {header} permissions:\n \n \n\n \n {!selectedItem && (\n
\n No permissions to display!\n
\n )}\n\n {selectedItem && (\n
\n
\n {permissions.map((permission, index) => {\n const user = UserStore.getUser(permission.id ?? \"\");\n const role = guild.roles[permission.id ?? \"\"];\n\n return (\n selectItem(index)}\n >\n {\n if ((settings.store as any).unsafeViewAsRole && permission.type === PermissionType.Role)\n ContextMenu.open(e, () => (\n \n ));\n }}\n >\n {(permission.type === PermissionType.Role || permission.type === PermissionType.Owner) && (\n \n )}\n {permission.type === PermissionType.User && user !== undefined && (\n \n )}\n \n {\n permission.type === PermissionType.Role\n ? role?.name ?? \"Unknown Role\"\n : permission.type === PermissionType.User\n ? (user && getUniqueUsername(user)) ?? \"Unknown User\"\n : (\n \n @owner\n \n \n )\n }\n \n
\n \n );\n })}\n
\n
\n {Object.entries(PermissionsBits).map(([permissionName, bit]) => (\n
\n
\n {(() => {\n const { permissions, overwriteAllow, overwriteDeny } = selectedItem;\n\n if (permissions)\n return (permissions & bit) === bit\n ? PermissionAllowedIcon()\n : PermissionDeniedIcon();\n\n if (overwriteAllow && (overwriteAllow & bit) === bit)\n return PermissionAllowedIcon();\n if (overwriteDeny && (overwriteDeny & bit) === bit)\n return PermissionDeniedIcon();\n\n return PermissionDefaultIcon();\n })()}\n
\n {getPermissionString(permissionName)}\n\n \n {props => }\n \n
\n ))}\n
\n \n )}\n
\n \n );\n}\n\nfunction RoleContextMenu({ guild, roleId, onClose }: { guild: Guild; roleId: string; onClose: () => void; }) {\n return (\n \n {\n const role = guild.roles[roleId];\n if (!role) return;\n\n onClose();\n\n FluxDispatcher.dispatch({\n type: \"IMPERSONATE_UPDATE\",\n guildId: guild.id,\n data: {\n type: \"ROLES\",\n roles: {\n [roleId]: role\n }\n }\n });\n }}\n />\n \n );\n}\n\nconst RolesAndUsersPermissions = ErrorBoundary.wrap(RolesAndUsersPermissionsComponent);\n\nexport default openRolesAndUsersPermissionsModal;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { classNameFactory } from \"@api/Styles\";\nimport { Text, Tooltip, useState } from \"@webpack/common\";\nexport const cl = classNameFactory(\"vc-expandableheader-\");\nimport \"./ExpandableHeader.css\";\n\nexport interface ExpandableHeaderProps {\n onMoreClick?: () => void;\n moreTooltipText?: string;\n onDropDownClick?: (state: boolean) => void;\n defaultState?: boolean;\n headerText: string;\n children: React.ReactNode;\n buttons?: React.ReactNode[];\n}\n\nexport default function ExpandableHeader({ children, onMoreClick, buttons, moreTooltipText, defaultState = false, onDropDownClick, headerText }: ExpandableHeaderProps) {\n const [showContent, setShowContent] = useState(defaultState);\n\n return (\n <>\n
\n \n {headerText}\n \n\n
\n {\n buttons ?? null\n }\n\n {\n onMoreClick && // only show more button if callback is provided\n \n {tooltipProps => (\n \n \n \n \n \n )}\n \n }\n\n\n \n {tooltipProps => (\n {\n setShowContent(v => !v);\n onDropDownClick?.(showContent);\n }}\n >\n \n \n \n \n )}\n \n
\n
\n {showContent && children}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport ExpandableHeader from \"@components/ExpandableHeader\";\nimport { proxyLazy } from \"@utils/lazy\";\nimport { classes } from \"@utils/misc\";\nimport { filters, findBulk } from \"@webpack\";\nimport { i18n, PermissionsBits, Text, Tooltip, useMemo, UserStore } from \"@webpack/common\";\nimport type { Guild, GuildMember } from \"discord-types/general\";\n\nimport { PermissionsSortOrder, settings } from \"..\";\nimport { cl, getPermissionString, getSortedRoles, sortUserRoles } from \"../utils\";\nimport openRolesAndUsersPermissionsModal, { PermissionType, type RoleOrUserPermission } from \"./RolesAndUsersPermissions\";\n\ninterface UserPermission {\n permission: string;\n roleColor: string;\n rolePosition: number;\n}\n\ntype UserPermissions = Array;\n\nconst Classes = proxyLazy(() => {\n const modules = findBulk(\n filters.byProps(\"roles\", \"rolePill\", \"rolePillBorder\"),\n filters.byProps(\"roleCircle\", \"dotBorderBase\", \"dotBorderColor\"),\n filters.byProps(\"roleNameOverflow\", \"root\", \"roleName\", \"roleRemoveButton\")\n );\n\n return Object.assign({}, ...modules);\n}) as Record<\"roles\" | \"rolePill\" | \"rolePillBorder\" | \"desaturateUserColors\" | \"flex\" | \"alignCenter\" | \"justifyCenter\" | \"svg\" | \"background\" | \"dot\" | \"dotBorderColor\" | \"roleCircle\" | \"dotBorderBase\" | \"flex\" | \"alignCenter\" | \"justifyCenter\" | \"wrap\" | \"root\" | \"role\" | \"roleRemoveButton\" | \"roleDot\" | \"roleFlowerStar\" | \"roleRemoveIcon\" | \"roleRemoveIconFocused\" | \"roleVerifiedIcon\" | \"roleName\" | \"roleNameOverflow\" | \"actionButton\" | \"overflowButton\" | \"addButton\" | \"addButtonIcon\" | \"overflowRolesPopout\" | \"overflowRolesPopoutArrowWrapper\" | \"overflowRolesPopoutArrow\" | \"popoutBottom\" | \"popoutTop\" | \"overflowRolesPopoutHeader\" | \"overflowRolesPopoutHeaderIcon\" | \"overflowRolesPopoutHeaderText\" | \"roleIcon\", string>;\n\nfunction UserPermissionsComponent({ guild, guildMember }: { guild: Guild; guildMember: GuildMember; }) {\n const stns = settings.use([\"permissionsSortOrder\"]);\n\n const [rolePermissions, userPermissions] = useMemo(() => {\n const userPermissions: UserPermissions = [];\n\n const userRoles = getSortedRoles(guild, guildMember);\n\n const rolePermissions: Array = userRoles.map(role => ({\n type: PermissionType.Role,\n ...role\n }));\n\n if (guild.ownerId === guildMember.userId) {\n rolePermissions.push({\n type: PermissionType.Owner,\n permissions: Object.values(PermissionsBits).reduce((prev, curr) => prev | curr, 0n)\n });\n\n const OWNER = i18n.Messages.GUILD_OWNER || \"Server Owner\";\n userPermissions.push({\n permission: OWNER,\n roleColor: \"var(--primary-300)\",\n rolePosition: Infinity\n });\n }\n\n sortUserRoles(userRoles);\n\n for (const [permission, bit] of Object.entries(PermissionsBits)) {\n for (const { permissions, colorString, position, name } of userRoles) {\n if ((permissions & bit) === bit) {\n userPermissions.push({\n permission: getPermissionString(permission),\n roleColor: colorString || \"var(--primary-300)\",\n rolePosition: position\n });\n\n break;\n }\n }\n }\n\n userPermissions.sort((a, b) => b.rolePosition - a.rolePosition);\n\n return [rolePermissions, userPermissions];\n }, [stns.permissionsSortOrder]);\n\n const { root, role, roleRemoveButton, roleNameOverflow, roles, rolePill, rolePillBorder, roleCircle, roleName } = Classes;\n\n return (\n \n openRolesAndUsersPermissionsModal(\n rolePermissions,\n guild,\n guildMember.nick || UserStore.getUser(guildMember.userId).username\n )\n }\n defaultState={settings.store.defaultPermissionsDropdownState}\n buttons={[\n (\n {tooltipProps => (\n {\n stns.permissionsSortOrder = stns.permissionsSortOrder === PermissionsSortOrder.HighestRole ? PermissionsSortOrder.LowestRole : PermissionsSortOrder.HighestRole;\n }}\n >\n \n \n \n \n )}\n )\n ]}>\n {userPermissions.length > 0 && (\n
\n {userPermissions.map(({ permission, roleColor }) => (\n
\n
\n \n
\n
\n \n {permission}\n \n
\n
\n ))}\n
\n )}\n \n );\n}\n\nexport default ErrorBoundary.wrap(UserPermissionsComponent, { noop: true });\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { ChannelStore, GuildMemberStore, GuildStore, Menu, PermissionsBits, UserStore } from \"@webpack/common\";\nimport type { Guild, GuildMember } from \"discord-types/general\";\n\nimport openRolesAndUsersPermissionsModal, { PermissionType, RoleOrUserPermission } from \"./components/RolesAndUsersPermissions\";\nimport UserPermissions from \"./components/UserPermissions\";\nimport { getSortedRoles, sortPermissionOverwrites } from \"./utils\";\n\nexport const enum PermissionsSortOrder {\n HighestRole,\n LowestRole\n}\n\nconst enum MenuItemParentType {\n User,\n Channel,\n Guild\n}\n\nexport const settings = definePluginSettings({\n permissionsSortOrder: {\n description: \"The sort method used for defining which role grants an user a certain permission\",\n type: OptionType.SELECT,\n options: [\n { label: \"Highest Role\", value: PermissionsSortOrder.HighestRole, default: true },\n { label: \"Lowest Role\", value: PermissionsSortOrder.LowestRole }\n ],\n },\n defaultPermissionsDropdownState: {\n description: \"Whether the permissions dropdown on user popouts should be open by default\",\n type: OptionType.BOOLEAN,\n default: false,\n }\n});\n\nfunction MenuItem(guildId: string, id?: string, type?: MenuItemParentType) {\n if (type === MenuItemParentType.User && !GuildMemberStore.isMember(guildId, id!)) return null;\n\n return (\n {\n const guild = GuildStore.getGuild(guildId);\n\n let permissions: RoleOrUserPermission[];\n let header: string;\n\n switch (type) {\n case MenuItemParentType.User: {\n const member = GuildMemberStore.getMember(guildId, id!);\n\n permissions = getSortedRoles(guild, member)\n .map(role => ({\n type: PermissionType.Role,\n ...role\n }));\n\n if (guild.ownerId === id) {\n permissions.push({\n type: PermissionType.Owner,\n permissions: Object.values(PermissionsBits).reduce((prev, curr) => prev | curr, 0n)\n });\n }\n\n header = member.nick ?? UserStore.getUser(member.userId).username;\n\n break;\n }\n\n case MenuItemParentType.Channel: {\n const channel = ChannelStore.getChannel(id!);\n\n permissions = sortPermissionOverwrites(Object.values(channel.permissionOverwrites).map(({ id, allow, deny, type }) => ({\n type: type as PermissionType,\n id,\n overwriteAllow: allow,\n overwriteDeny: deny\n })), guildId);\n\n header = channel.name;\n\n break;\n }\n\n default: {\n permissions = Object.values(guild.roles).map(role => ({\n type: PermissionType.Role,\n ...role\n }));\n\n header = guild.name;\n\n break;\n }\n }\n\n openRolesAndUsersPermissionsModal(permissions, guild, header);\n }}\n />\n );\n}\n\nfunction makeContextMenuPatch(childId: string | string[], type?: MenuItemParentType): NavContextMenuPatchCallback {\n return (children, props) => () => {\n if (!props || (type === MenuItemParentType.User && !props.user) || (type === MenuItemParentType.Guild && !props.guild)) return children;\n\n const group = findGroupChildrenByChildId(childId, children);\n\n const item = (() => {\n switch (type) {\n case MenuItemParentType.User:\n return MenuItem(props.guildId, props.user.id, type);\n case MenuItemParentType.Channel:\n return MenuItem(props.guild.id, props.channel.id, type);\n case MenuItemParentType.Guild:\n return MenuItem(props.guild.id);\n default:\n return null;\n }\n })();\n\n if (item == null) return;\n\n if (group)\n group.push(item);\n else if (childId === \"roles\" && props.guildId)\n // \"roles\" may not be present due to the member not having any roles. In that case, add it above \"Copy ID\"\n children.splice(-1, 0, {item});\n };\n}\n\nexport default definePlugin({\n name: \"PermissionsViewer\",\n description: \"View the permissions a user or channel has, and the roles of a server\",\n authors: [Devs.Nuckyz, Devs.Ven],\n settings,\n\n patches: [\n {\n find: \".popularApplicationCommandIds,\",\n replacement: {\n match: /showBorder:.{0,60}}\\),(?<=guild:(\\i),guildMember:(\\i),.+?)/,\n replace: (m, guild, guildMember) => `${m}$self.UserPermissions(${guild},${guildMember}),`\n }\n }\n ],\n\n UserPermissions: (guild: Guild, guildMember?: GuildMember) => !!guildMember && ,\n\n userContextMenuPatch: makeContextMenuPatch(\"roles\", MenuItemParentType.User),\n channelContextMenuPatch: makeContextMenuPatch([\"mute-channel\", \"unmute-channel\"], MenuItemParentType.Channel),\n guildContextMenuPatch: makeContextMenuPatch(\"privacy\", MenuItemParentType.Guild),\n\n start() {\n addContextMenuPatch(\"user-context\", this.userContextMenuPatch);\n addContextMenuPatch(\"channel-context\", this.channelContextMenuPatch);\n addContextMenuPatch([\"guild-context\", \"guild-header-popout\"], this.guildContextMenuPatch);\n },\n\n stop() {\n removeContextMenuPatch(\"user-context\", this.userContextMenuPatch);\n removeContextMenuPatch(\"channel-context\", this.channelContextMenuPatch);\n removeContextMenuPatch([\"guild-context\", \"guild-header-popout\"], this.guildContextMenuPatch);\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ApplicationCommandInputType, ApplicationCommandOptionType, Argument, CommandContext, findOption, sendBotMessage } from \"@api/Commands\";\nimport { Devs } from \"@utils/constants\";\nimport { makeLazy } from \"@utils/lazy\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { UploadHandler, UserUtils } from \"@webpack/common\";\nimport { applyPalette, GIFEncoder, quantize } from \"gifenc\";\n\nconst DRAFT_TYPE = 0;\nconst DEFAULT_DELAY = 20;\nconst DEFAULT_RESOLUTION = 128;\nconst FRAMES = 10;\n\nconst getFrames = makeLazy(() => Promise.all(\n Array.from(\n { length: FRAMES },\n (_, i) => loadImage(`https://raw.githubusercontent.com/VenPlugs/petpet/main/frames/pet${i}.gif`)\n ))\n);\n\nconst UploadStore = findByPropsLazy(\"getUploads\");\n\nfunction loadImage(source: File | string) {\n const isFile = source instanceof File;\n const url = isFile ? URL.createObjectURL(source) : source;\n\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => {\n if (isFile)\n URL.revokeObjectURL(url);\n resolve(img);\n };\n img.onerror = (event, _source, _lineno, _colno, err) => reject(err || event);\n img.crossOrigin = \"Anonymous\";\n img.src = url;\n });\n}\n\nasync function resolveImage(options: Argument[], ctx: CommandContext, noServerPfp: boolean): Promise {\n for (const opt of options) {\n switch (opt.name) {\n case \"image\":\n const upload = UploadStore.getUploads(ctx.channel.id, DRAFT_TYPE)[0];\n if (upload) {\n if (!upload.isImage) throw \"Upload is not an image\";\n return upload.item.file;\n }\n break;\n case \"url\":\n return opt.value;\n case \"user\":\n try {\n const user = await UserUtils.getUser(opt.value);\n return user.getAvatarURL(noServerPfp ? void 0 : ctx.guild?.id, 2048).replace(/\\?size=\\d+$/, \"?size=2048\");\n } catch (err) {\n console.error(\"[petpet] Failed to fetch user\\n\", err);\n throw \"Failed to fetch user. Check the console for more info.\";\n }\n }\n }\n return null;\n}\n\nexport default definePlugin({\n name: \"petpet\",\n description: \"Adds a /petpet slash command to create headpet gifs from any image\",\n authors: [Devs.Ven],\n dependencies: [\"CommandsAPI\"],\n commands: [\n {\n inputType: ApplicationCommandInputType.BUILT_IN,\n name: \"petpet\",\n description: \"Create a petpet gif. You can only specify one of the image options\",\n options: [\n {\n name: \"delay\",\n description: \"The delay between each frame. Defaults to 20.\",\n type: ApplicationCommandOptionType.INTEGER\n },\n {\n name: \"resolution\",\n description: \"Resolution for the gif. Defaults to 120. If you enter an insane number and it freezes Discord that's your fault.\",\n type: ApplicationCommandOptionType.INTEGER\n },\n {\n name: \"image\",\n description: \"Image attachment to use\",\n type: ApplicationCommandOptionType.ATTACHMENT\n },\n {\n name: \"url\",\n description: \"URL to fetch image from\",\n type: ApplicationCommandOptionType.STRING\n },\n {\n name: \"user\",\n description: \"User whose avatar to use as image\",\n type: ApplicationCommandOptionType.USER\n },\n {\n name: \"no-server-pfp\",\n description: \"Use the normal avatar instead of the server specific one when using the 'user' option\",\n type: ApplicationCommandOptionType.BOOLEAN\n }\n ],\n execute: async (opts, cmdCtx) => {\n const frames = await getFrames();\n\n const noServerPfp = findOption(opts, \"no-server-pfp\", false);\n try {\n var url = await resolveImage(opts, cmdCtx, noServerPfp);\n if (!url) throw \"No Image specified!\";\n } catch (err) {\n sendBotMessage(cmdCtx.channel.id, {\n content: String(err),\n });\n return;\n }\n\n const avatar = await loadImage(url);\n\n const delay = findOption(opts, \"delay\", DEFAULT_DELAY);\n const resolution = findOption(opts, \"resolution\", DEFAULT_RESOLUTION);\n\n const gif = GIFEncoder();\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = resolution;\n const ctx = canvas.getContext(\"2d\")!;\n\n for (let i = 0; i < FRAMES; i++) {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n const j = i < FRAMES / 2 ? i : FRAMES - i;\n const width = 0.8 + j * 0.02;\n const height = 0.8 - j * 0.05;\n const offsetX = (1 - width) * 0.5 + 0.1;\n const offsetY = 1 - height - 0.08;\n\n ctx.drawImage(avatar, offsetX * resolution, offsetY * resolution, width * resolution, height * resolution);\n ctx.drawImage(frames[i], 0, 0, resolution, resolution);\n\n const { data } = ctx.getImageData(0, 0, resolution, resolution);\n const palette = quantize(data, 256);\n const index = applyPalette(data, palette);\n\n gif.writeFrame(index, resolution, resolution, {\n transparent: true,\n palette,\n delay,\n });\n }\n\n gif.finish();\n const file = new File([gif.bytesView()], \"petpet.gif\", { type: \"image/gif\" });\n // Immediately after the command finishes, Discord clears all input, including pending attachments.\n // Thus, setTimeout is needed to make this execute after Discord cleared the input\n setTimeout(() => UploadHandler.promptToUpload([file], cmdCtx.channel, DRAFT_TYPE), 10);\n },\n },\n ]\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport \"./styles.css\";\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { React, Tooltip } from \"@webpack/common\";\n\nconst settings = definePluginSettings({\n loop: {\n description: \"Whether to make the PiP video loop or not\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: false\n }\n});\n\nexport default definePlugin({\n name: \"PictureInPicture\",\n description: \"Adds picture in picture to videos (next to the Download button)\",\n authors: [Devs.Lumap],\n settings,\n patches: [\n {\n find: \".nonMediaAttachment]\",\n replacement: {\n match: /\\.nonMediaAttachment\\]:!(\\i).{0,10}children:\\[(\\S)/,\n replace: \"$&,$1&&$2&&$self.renderPiPButton(),\"\n },\n },\n ],\n\n renderPiPButton: ErrorBoundary.wrap(() => {\n return (\n \n {tooltipProps => (\n {\n const video = e.currentTarget.parentNode!.parentNode!.querySelector(\"video\")!;\n const videoClone = document.body.appendChild(video.cloneNode(true)) as HTMLVideoElement;\n\n videoClone.loop = settings.store.loop;\n videoClone.style.display = \"none\";\n videoClone.onleavepictureinpicture = () => videoClone.remove();\n\n function launchPiP() {\n videoClone.currentTime = video.currentTime;\n videoClone.requestPictureInPicture();\n video.pause();\n videoClone.play();\n }\n\n if (videoClone.readyState === 4 /* HAVE_ENOUGH_DATA */)\n launchPiP();\n else\n videoClone.onloadedmetadata = launchPiP;\n }}\n >\n \n \n \n \n )}\n \n );\n }, { noop: true })\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings, Settings, useSettings } from \"@api/Settings\";\nimport { OptionType } from \"@utils/types\";\nimport { findStoreLazy } from \"@webpack\";\n\nexport const enum PinOrder {\n LastMessage,\n Custom\n}\n\nexport const settings = definePluginSettings({\n pinOrder: {\n type: OptionType.SELECT,\n description: \"Which order should pinned DMs be displayed in?\",\n options: [\n { label: \"Most recent message\", value: PinOrder.LastMessage, default: true },\n { label: \"Custom (right click channels to reorder)\", value: PinOrder.Custom }\n ]\n }\n});\n\nconst PrivateChannelSortStore = findStoreLazy(\"PrivateChannelSortStore\");\n\nexport let snapshotArray: string[];\nlet snapshot: Set | undefined;\n\nconst getArray = () => (Settings.plugins.PinDMs.pinnedDMs || void 0)?.split(\",\") as string[] | undefined;\nconst save = (pins: string[]) => {\n snapshot = void 0;\n Settings.plugins.PinDMs.pinnedDMs = pins.join(\",\");\n};\nconst takeSnapshot = () => {\n snapshotArray = getArray() ?? [];\n return snapshot = new Set(snapshotArray);\n};\nconst requireSnapshot = () => snapshot ?? takeSnapshot();\n\nexport function usePinnedDms() {\n useSettings([\"plugins.PinDMs.pinnedDMs\"]);\n\n return requireSnapshot();\n}\n\nexport function isPinned(id: string) {\n return requireSnapshot().has(id);\n}\n\nexport function togglePin(id: string) {\n const snapshot = requireSnapshot();\n if (!snapshot.delete(id)) {\n snapshot.add(id);\n }\n\n save([...snapshot]);\n}\n\nexport function sortedSnapshot() {\n requireSnapshot();\n if (settings.store.pinOrder === PinOrder.LastMessage)\n return PrivateChannelSortStore.getPrivateChannelIds().filter(isPinned);\n\n return snapshotArray;\n}\n\nexport function getPinAt(idx: number) {\n return sortedSnapshot()[idx];\n}\n\nexport function movePin(id: string, direction: -1 | 1) {\n const pins = getArray()!;\n const a = pins.indexOf(id);\n const b = a + direction;\n\n [pins[a], pins[b]] = [pins[b], pins[a]];\n\n save(pins);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { Menu } from \"@webpack/common\";\n\nimport { isPinned, movePin, PinOrder, settings, snapshotArray, togglePin } from \"./settings\";\n\nfunction PinMenuItem(channelId: string) {\n const pinned = isPinned(channelId);\n const canMove = pinned && settings.store.pinOrder === PinOrder.Custom;\n\n return (\n <>\n togglePin(channelId)}\n />\n {canMove && snapshotArray[0] !== channelId && (\n movePin(channelId, -1)}\n />\n )}\n {canMove && snapshotArray[snapshotArray.length - 1] !== channelId && (\n movePin(channelId, +1)}\n />\n )}\n \n );\n}\n\nconst GroupDMContext: NavContextMenuPatchCallback = (children, props) => () => {\n const container = findGroupChildrenByChildId(\"leave-channel\", children);\n if (container)\n container.unshift(PinMenuItem(props.channel.id));\n};\n\nconst UserContext: NavContextMenuPatchCallback = (children, props) => () => {\n const container = findGroupChildrenByChildId(\"close-dm\", children);\n if (container) {\n const idx = container.findIndex(c => c?.props?.id === \"close-dm\");\n container.splice(idx, 0, PinMenuItem(props.channel.id));\n }\n};\n\nexport function addContextMenus() {\n addContextMenuPatch(\"gdm-context\", GroupDMContext);\n addContextMenuPatch(\"user-context\", UserContext);\n}\n\nexport function removeContextMenus() {\n removeContextMenuPatch(\"gdm-context\", GroupDMContext);\n removeContextMenuPatch(\"user-context\", UserContext);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { Channel } from \"discord-types/general\";\n\nimport { addContextMenus, removeContextMenus } from \"./contextMenus\";\nimport { getPinAt, isPinned, settings, snapshotArray, sortedSnapshot, usePinnedDms } from \"./settings\";\n\nexport default definePlugin({\n name: \"PinDMs\",\n description: \"Allows you to pin private channels to the top of your DM list. To pin/unpin or reorder pins, right click DMs\",\n authors: [Devs.Ven, Devs.Strencher],\n\n settings,\n\n start: addContextMenus,\n stop: removeContextMenus,\n\n usePinCount(channelIds: string[]) {\n const pinnedDms = usePinnedDms();\n // See comment on 2nd patch for reasoning\n return channelIds.length ? [pinnedDms.size] : [];\n },\n\n getChannel(channels: Record, idx: number) {\n return channels[getPinAt(idx)];\n },\n\n isPinned,\n getSnapshot: sortedSnapshot,\n\n getScrollOffset(channelId: string, rowHeight: number, padding: number, preRenderedChildren: number, originalOffset: number) {\n if (!isPinned(channelId))\n return (\n (rowHeight + padding) * 2 // header\n + rowHeight * snapshotArray.length // pins\n + originalOffset // original pin offset minus pins\n );\n\n return rowHeight * (snapshotArray.indexOf(channelId) + preRenderedChildren) + padding;\n },\n\n patches: [\n // Patch DM list\n {\n find: \".privateChannelsHeaderContainer,\",\n replacement: [\n {\n // filter Discord's privateChannelIds list to remove pins, and pass\n // pinCount as prop. This needs to be here so that the entire DM list receives\n // updates on pin/unpin\n match: /(?<=\\i,{channels:\\i,)privateChannelIds:(\\i),/,\n replace: \"privateChannelIds:$1.filter(c=>!$self.isPinned(c)),pinCount:$self.usePinCount($1),\"\n },\n {\n // sections is an array of numbers, where each element is a section and\n // the number is the amount of rows. Add our pinCount in second place\n // - Section 1: buttons for pages like Friends & Library\n // - Section 2: our pinned dms\n // - Section 3: the normal dm list\n match: /(?<=renderRow:this\\.renderRow,)sections:\\[\\i,/,\n // For some reason, adding our sections when no private channels are ready yet\n // makes DMs infinitely load. Thus usePinCount returns either a single element\n // array with the count, or an empty array. Due to spreading, only in the former\n // case will an element be added to the outer array\n // Thanks for the fix, Strencher!\n replace: \"$&...this.props.pinCount??[],\"\n },\n {\n // Patch renderSection (renders the header) to set the text to \"Pinned DMs\" instead of \"Direct Messages\"\n // lookbehind is used to lookup parameter name. We could use arguments[0], but\n // if children ever is wrapped in an iife, it will break\n match: /children:(\\i\\.\\i\\.Messages.DIRECT_MESSAGES)(?<=renderSection=(\\i)=>{.+?)/,\n replace: \"children:$2.section===1?'Pinned DMs':$1\"\n },\n {\n // Patch channel lookup inside renderDM\n // channel=channels[channelIds[row]];\n match: /(?<=renderDM=\\((\\i),(\\i)\\)=>{.*?this.state,\\i=\\i\\[\\i\\],\\i=)((\\i)\\[\\i\\]);/,\n // section 1 is us, manually get our own channel\n // section === 1 ? getChannel(channels, row) : channels[channelIds[row]];\n replace: \"$1===1?$self.getChannel($4,$2):$3;\"\n },\n {\n // Fix getRowHeight's check for whether this is the DMs section\n // section === DMS\n match: /===\\i\\.DMS&&0/,\n // section -1 === DMS\n replace: \"-1$&\"\n },\n {\n // Override scrollToChannel to properly account for pinned channels\n match: /(?<=scrollTo\\(\\{to:\\i\\}\\):\\(\\i\\+=)(\\d+)\\*\\(.+?(?=,)/,\n replace: \"$self.getScrollOffset(arguments[0],$1,this.props.padding,this.state.preRenderedChildren,$&)\"\n }\n ]\n },\n\n // Fix Alt Up/Down navigation\n {\n find: \".Routes.APPLICATION_STORE&&\",\n replacement: {\n // channelIds = __OVERLAY__ ? stuff : [...getStaticPaths(),...channelIds)]\n match: /(?<=\\i=__OVERLAY__\\?\\i:\\[\\.\\.\\.\\i\\(\\),\\.\\.\\.)\\i/,\n // ....concat(pins).concat(toArray(channelIds).filter(c => !isPinned(c)))\n replace: \"$self.getSnapshot().concat($&.filter(c=>!$self.isPinned(c)))\"\n }\n },\n // fix alt+shift+up/down\n {\n find: \".getFlattenedGuildIds()],\",\n replacement: {\n match: /(?<=\\i===\\i\\.ME\\?)\\i\\.\\i\\.getPrivateChannelIds\\(\\)/,\n replace: \"$self.getSnapshot().concat($&.filter(c=>!$self.isPinned(c)))\"\n }\n },\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"PlainFolderIcon\",\n description: \"Doesn't show the small guild icons in folders\",\n authors: [Devs.botato],\n patches: [{\n find: \".expandedFolderIconWrapper\",\n replacement: [{\n match: /\\(\\w\\|\\|\\w\\)&&(\\(.{0,40}\\(.{1,3}\\.animated)/,\n replace: \"$1\",\n }]\n }]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Channel, User } from \"discord-types/general/index.js\";\n\ninterface DecoratorProps {\n activities: any[];\n channel: Channel;\n /**\n * Only for DM members\n */\n channelName?: string;\n /**\n * Only for server members\n */\n currentUser?: User;\n guildId?: string;\n isMobile: boolean;\n isOwner?: boolean;\n isTyping: boolean;\n selected: boolean;\n status: string;\n user: User;\n [key: string]: any;\n}\nexport type Decorator = (props: DecoratorProps) => JSX.Element | null;\ntype OnlyIn = \"guilds\" | \"dms\";\n\nexport const decorators = new Map();\n\nexport function addDecorator(identifier: string, decorator: Decorator, onlyIn?: OnlyIn) {\n decorators.set(identifier, { decorator, onlyIn });\n}\n\nexport function removeDecorator(identifier: string) {\n decorators.delete(identifier);\n}\n\nexport function __getDecorators(props: DecoratorProps): (JSX.Element | null)[] {\n const isInGuild = !!(props.guildId);\n return Array.from(decorators.values(), decoratorObj => {\n const { decorator, onlyIn } = decoratorObj;\n // this can most likely be done cleaner\n if (!onlyIn || (onlyIn === \"guilds\" && isInGuild) || (onlyIn === \"dms\" && !isInGuild)) {\n return decorator(props);\n }\n return null;\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Channel, Message } from \"discord-types/general/index.js\";\n\ninterface DecorationProps {\n author: {\n /**\n * Will be username if the user has no nickname\n */\n nick: string;\n iconRoleId: string;\n guildMemberAvatar: string;\n colorRoleName: string;\n colorString: string;\n };\n channel: Channel;\n compact: boolean;\n decorations: {\n /**\n * Element for the [BOT] tag if there is one\n */\n 0: JSX.Element | null;\n /**\n * Other decorations (including ones added with this api)\n */\n 1: JSX.Element[];\n };\n message: Message;\n [key: string]: any;\n}\nexport type Decoration = (props: DecorationProps) => JSX.Element | null;\n\nexport const decorations = new Map();\n\nexport function addDecoration(identifier: string, decoration: Decoration) {\n decorations.set(identifier, decoration);\n}\n\nexport function removeDecoration(identifier: string) {\n decorations.delete(identifier);\n}\n\nexport function __addDecorationsToMessage(props: DecorationProps): (JSX.Element | null)[] {\n return [...decorations.values()].map(decoration => {\n return decoration(props);\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addBadge, BadgePosition, ProfileBadge, removeBadge } from \"@api/Badges\";\nimport { addDecorator, removeDecorator } from \"@api/MemberListDecorators\";\nimport { addDecoration, removeDecoration } from \"@api/MessageDecorations\";\nimport { Settings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy, findStoreLazy } from \"@webpack\";\nimport { PresenceStore, Tooltip, UserStore } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\n\nconst SessionsStore = findStoreLazy(\"SessionsStore\");\n\nfunction Icon(path: string, opts?: { viewBox?: string; width?: number; height?: number; }) {\n return ({ color, tooltip, small }: { color: string; tooltip: string; small: boolean; }) => (\n \n {(tooltipProps: any) => (\n \n \n \n )}\n \n );\n}\n\nconst Icons = {\n desktop: Icon(\"M4 2.5c-1.103 0-2 .897-2 2v11c0 1.104.897 2 2 2h7v2H7v2h10v-2h-4v-2h7c1.103 0 2-.896 2-2v-11c0-1.103-.897-2-2-2H4Zm16 2v9H4v-9h16Z\"),\n web: Icon(\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2Zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93Zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39Z\"),\n mobile: Icon(\"M 187 0 L 813 0 C 916.277 0 1000 83.723 1000 187 L 1000 1313 C 1000 1416.277 916.277 1500 813 1500 L 187 1500 C 83.723 1500 0 1416.277 0 1313 L 0 187 C 0 83.723 83.723 0 187 0 Z M 125 1000 L 875 1000 L 875 250 L 125 250 Z M 500 1125 C 430.964 1125 375 1180.964 375 1250 C 375 1319.036 430.964 1375 500 1375 C 569.036 1375 625 1319.036 625 1250 C 625 1180.964 569.036 1125 500 1125 Z\", { viewBox: \"0 0 1000 1500\", height: 17, width: 17 }),\n console: Icon(\"M14.8 2.7 9 3.1V47h3.3c1.7 0 6.2.3 10 .7l6.7.6V2l-4.2.2c-2.4.1-6.9.3-10 .5zm1.8 6.4c1 1.7-1.3 3.6-2.7 2.2C12.7 10.1 13.5 8 15 8c.5 0 1.2.5 1.6 1.1zM16 33c0 6-.4 10-1 10s-1-4-1-10 .4-10 1-10 1 4 1 10zm15-8v23.3l3.8-.7c2-.3 4.7-.6 6-.6H43V3h-2.2c-1.3 0-4-.3-6-.6L31 1.7V25z\", { viewBox: \"0 0 50 50\" }),\n};\ntype Platform = keyof typeof Icons;\n\nconst StatusUtils = findByPropsLazy(\"getStatusColor\", \"StatusTypes\");\n\nconst PlatformIcon = ({ platform, status, small }: { platform: Platform, status: string; small: boolean; }) => {\n const tooltip = platform[0].toUpperCase() + platform.slice(1);\n const Icon = Icons[platform] ?? Icons.desktop;\n\n return ;\n};\n\nconst getStatus = (id: string): Record => PresenceStore.getState()?.clientStatuses?.[id];\n\nconst PlatformIndicator = ({ user, wantMargin = true, wantTopMargin = false, small = false }: { user: User; wantMargin?: boolean; wantTopMargin?: boolean; small?: boolean; }) => {\n if (!user || user.bot) return null;\n\n if (user.id === UserStore.getCurrentUser().id) {\n const sessions = SessionsStore.getSessions();\n if (typeof sessions !== \"object\") return null;\n const sortedSessions = Object.values(sessions).sort(({ status: a }: any, { status: b }: any) => {\n if (a === b) return 0;\n if (a === \"online\") return 1;\n if (b === \"online\") return -1;\n if (a === \"idle\") return 1;\n if (b === \"idle\") return -1;\n return 0;\n });\n\n const ownStatus = Object.values(sortedSessions).reduce((acc: any, curr: any) => {\n if (curr.clientInfo.client !== \"unknown\")\n acc[curr.clientInfo.client] = curr.status;\n return acc;\n }, {});\n\n const { clientStatuses } = PresenceStore.getState();\n clientStatuses[UserStore.getCurrentUser().id] = ownStatus;\n }\n\n const status = PresenceStore.getState()?.clientStatuses?.[user.id] as Record;\n if (!status) return null;\n\n const icons = Object.entries(status).map(([platform, status]) => (\n \n ));\n\n if (!icons.length) return null;\n\n return (\n \n {icons}\n \n );\n};\n\nconst badge: ProfileBadge = {\n component: p => ,\n position: BadgePosition.START,\n shouldShow: userInfo => !!Object.keys(getStatus(userInfo.user.id) ?? {}).length,\n key: \"indicator\"\n};\n\nconst indicatorLocations = {\n list: {\n description: \"In the member list\",\n onEnable: () => addDecorator(\"platform-indicator\", props =>\n \n \n \n ),\n onDisable: () => removeDecorator(\"platform-indicator\")\n },\n badges: {\n description: \"In user profiles, as badges\",\n onEnable: () => addBadge(badge),\n onDisable: () => removeBadge(badge)\n },\n messages: {\n description: \"Inside messages\",\n onEnable: () => addDecoration(\"platform-indicator\", props =>\n \n \n \n ),\n onDisable: () => removeDecoration(\"platform-indicator\")\n }\n};\n\nexport default definePlugin({\n name: \"PlatformIndicators\",\n description: \"Adds platform indicators (Desktop, Mobile, Web...) to users\",\n authors: [Devs.kemo, Devs.TheSun, Devs.Nuckyz, Devs.Ven],\n dependencies: [\"MessageDecorationsAPI\", \"MemberListDecoratorsAPI\"],\n\n start() {\n const settings = Settings.plugins.PlatformIndicators;\n const { displayMode } = settings;\n\n // transfer settings from the old ones, which had a select menu instead of booleans\n if (displayMode) {\n if (displayMode !== \"both\") settings[displayMode] = true;\n else {\n settings.list = true;\n settings.badges = true;\n }\n settings.messages = true;\n delete settings.displayMode;\n }\n\n Object.entries(indicatorLocations).forEach(([key, value]) => {\n if (settings[key]) value.onEnable();\n });\n },\n\n stop() {\n Object.entries(indicatorLocations).forEach(([_, value]) => {\n value.onDisable();\n });\n },\n\n patches: [\n {\n find: \".Masks.STATUS_ONLINE_MOBILE\",\n predicate: () => Settings.plugins.PlatformIndicators.colorMobileIndicator,\n replacement: [\n {\n // Return the STATUS_ONLINE_MOBILE mask if the user is on mobile, no matter the status\n match: /\\.STATUS_TYPING;switch(?=.+?(if\\(\\i\\)return \\i\\.\\i\\.Masks\\.STATUS_ONLINE_MOBILE))/,\n replace: \".STATUS_TYPING;$1;switch\"\n },\n {\n // Return the STATUS_ONLINE_MOBILE mask if the user is on mobile, no matter the status\n match: /switch\\(\\i\\)\\{case \\i\\.\\i\\.ONLINE:(if\\(\\i\\)return\\{[^}]+\\})/,\n replace: \"$1;$&\"\n }\n ]\n },\n {\n find: \".AVATAR_STATUS_MOBILE_16;\",\n predicate: () => Settings.plugins.PlatformIndicators.colorMobileIndicator,\n replacement: [\n {\n // Return the AVATAR_STATUS_MOBILE size mask if the user is on mobile, no matter the status\n match: /\\i===\\i\\.\\i\\.ONLINE&&(?=.{0,70}\\.AVATAR_STATUS_MOBILE_16;)/,\n replace: \"\"\n },\n {\n // Fix sizes for mobile indicators which aren't online\n match: /(?<=\\(\\i\\.status,)(\\i)(?=,(\\i),\\i\\))/,\n replace: (_, userStatus, isMobile) => `${isMobile}?\"online\":${userStatus}`\n },\n {\n // Make isMobile true no matter the status\n match: /(?<=\\i&&!\\i)&&\\i===\\i\\.\\i\\.ONLINE/,\n replace: \"\"\n }\n ]\n },\n {\n find: \"}isMobileOnline(\",\n predicate: () => Settings.plugins.PlatformIndicators.colorMobileIndicator,\n replacement: {\n // Make isMobileOnline return true no matter what is the user status\n match: /(?<=\\i\\[\\i\\.\\i\\.MOBILE\\])===\\i\\.\\i\\.ONLINE/,\n replace: \"!= null\"\n }\n }\n ],\n\n options: {\n ...Object.fromEntries(\n Object.entries(indicatorLocations).map(([key, value]) => {\n return [key, {\n type: OptionType.BOOLEAN,\n description: `Show indicators ${value.description.toLowerCase()}`,\n // onChange doesn't give any way to know which setting was changed, so restart required\n restartNeeded: true,\n default: true\n }];\n })\n ),\n colorMobileIndicator: {\n type: OptionType.BOOLEAN,\n description: \"Whether to make the mobile indicator match the color of the user status.\",\n default: true,\n restartNeeded: true\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { generateId, sendBotMessage } from \"@api/Commands\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { Button, ButtonLooks, ButtonWrapperClasses, DraftStore, DraftType, SelectedChannelStore, Tooltip, UserStore, useStateFromStores } from \"@webpack/common\";\nimport { MessageAttachment } from \"discord-types/general\";\n\ninterface Props {\n type: {\n analyticsName: string;\n isEmpty: boolean;\n attachments: boolean;\n };\n}\n\nconst UploadStore = findByPropsLazy(\"getUploads\");\n\nconst getDraft = (channelId: string) => DraftStore.getDraft(channelId, DraftType.ChannelMessage);\n\n\nconst getImageBox = (url: string): Promise<{ width: number, height: number; } | null> =>\n new Promise(res => {\n const img = new Image();\n img.onload = () =>\n res({ width: img.width, height: img.height });\n\n img.onerror = () =>\n res(null);\n\n img.src = url;\n });\n\n\nconst getAttachments = async (channelId: string) =>\n await Promise.all(\n UploadStore.getUploads(channelId, DraftType.ChannelMessage)\n .map(async (upload: any) => {\n const { isImage, filename, spoiler, item: { file } } = upload;\n const url = URL.createObjectURL(file);\n const attachment: MessageAttachment = {\n id: generateId(),\n filename: spoiler ? \"SPOILER_\" + filename : filename,\n // weird eh? if i give it the normal content type the preview doenst work\n content_type: undefined,\n size: await upload.getSize(),\n spoiler,\n // discord adds query params to the url, so we need to add a hash to prevent that\n url: url + \"#\",\n proxy_url: url + \"#\",\n };\n\n if (isImage) {\n const box = await getImageBox(url);\n if (!box) return attachment;\n\n attachment.width = box.width;\n attachment.height = box.height;\n }\n\n return attachment;\n })\n );\n\n\nexport function PreviewButton(chatBoxProps: Props) {\n const { isEmpty, attachments } = chatBoxProps.type;\n\n const channelId = SelectedChannelStore.getChannelId();\n const draft = useStateFromStores([DraftStore], () => getDraft(channelId));\n\n if (chatBoxProps.type.analyticsName !== \"normal\") return null;\n\n const hasAttachments = attachments && UploadStore.getUploads(channelId, DraftType.ChannelMessage).length > 0;\n const hasContent = !isEmpty && draft?.length > 0;\n\n if (!hasContent && !hasAttachments) return null;\n\n return (\n \n {tooltipProps => (\n \n sendBotMessage(\n channelId,\n {\n content: getDraft(channelId),\n author: UserStore.getCurrentUser(),\n attachments: hasAttachments ? await getAttachments(channelId) : undefined,\n }\n )}\n size=\"\"\n look={ButtonLooks.BLANK}\n innerClassName={ButtonWrapperClasses.button}\n style={{ padding: \"0 2px\", height: \"100%\" }}\n >\n
\n \n
\n \n )}\n
\n );\n\n}\n\nexport default definePlugin({\n name: \"PreviewMessage\",\n description: \"Lets you preview your message before sending it.\",\n authors: [Devs.Aria],\n patches: [\n {\n find: \"ChannelTextAreaButtons\",\n replacement: {\n match: /(\\i)\\.push.{1,30}disabled:(\\i),.{1,20}\\},\"gift\"\\)\\)/,\n replace: \"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()\",\n }\n },\n ],\n\n chatBarIcon: ErrorBoundary.wrap(PreviewButton, { noop: true }),\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Link } from \"@components/Link\";\nimport { Forms, React } from \"@webpack/common\";\n\nexport default function PronounsAboutComponent() {\n return (\n \n More Information\n To add your own pronouns, visit{\" \"}\n pronoundb.org\n \n \n \n The two pronoun formats are lowercase and capitalized. Example:\n
    \n
  • Lowercase: they/them
  • \n
  • Capitalized: They/Them
  • \n
\n Text like \"Ask me my pronouns\" or \"Any pronouns\" will always be capitalized.

\n You can also configure whether or not to display pronouns for the current user (since you probably already know them)\n
\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { OptionType } from \"@utils/types\";\n\nimport { PronounsFormat, PronounSource } from \"./pronoundbUtils\";\n\nexport const settings = definePluginSettings({\n pronounsFormat: {\n type: OptionType.SELECT,\n description: \"The format for pronouns to appear in chat\",\n options: [\n {\n label: \"Lowercase\",\n value: PronounsFormat.Lowercase,\n default: true\n },\n {\n label: \"Capitalized\",\n value: PronounsFormat.Capitalized\n }\n ]\n },\n pronounSource: {\n type: OptionType.SELECT,\n description: \"Where to source pronouns from\",\n options: [\n {\n label: \"Prefer PronounDB, fall back to Discord\",\n value: PronounSource.PreferPDB,\n default: true\n },\n {\n label: \"Prefer Discord, fall back to PronounDB (might lead to inconsistency between pronouns in chat and profile)\",\n value: PronounSource.PreferDiscord\n }\n ]\n },\n showSelf: {\n type: OptionType.BOOLEAN,\n description: \"Enable or disable showing pronouns for the current user\",\n default: true\n },\n showInMessages: {\n type: OptionType.BOOLEAN,\n description: \"Show in messages\",\n default: true\n },\n showInProfile: {\n type: OptionType.BOOLEAN,\n description: \"Show in profile\",\n default: true\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport interface UserProfileProps {\n userId: string;\n}\n\nexport interface UserProfilePronounsProps {\n currentPronouns: string | null;\n hidePersonalInformation: boolean;\n}\n\nexport interface PronounsResponse {\n [id: string]: PronounCode;\n}\n\nexport type PronounCode = keyof typeof PronounMapping;\n\nexport const PronounMapping = {\n hh: \"He/Him\",\n hi: \"He/It\",\n hs: \"He/She\",\n ht: \"He/They\",\n ih: \"It/Him\",\n ii: \"It/Its\",\n is: \"It/She\",\n it: \"It/They\",\n shh: \"She/He\",\n sh: \"She/Her\",\n si: \"She/It\",\n st: \"She/They\",\n th: \"They/He\",\n ti: \"They/It\",\n ts: \"They/She\",\n tt: \"They/Them\",\n any: \"Any pronouns\",\n other: \"Other pronouns\",\n ask: \"Ask me my pronouns\",\n avoid: \"Avoid pronouns, use my name\",\n unspecified: \"Unspecified\"\n} as const;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { VENCORD_USER_AGENT } from \"@utils/constants\";\nimport { debounce } from \"@utils/debounce\";\nimport { getCurrentChannel } from \"@utils/discord\";\nimport { useAwaiter } from \"@utils/react\";\nimport { UserProfileStore, UserStore } from \"@webpack/common\";\n\nimport { settings } from \"./settings\";\nimport { PronounCode, PronounMapping, PronounsResponse } from \"./types\";\n\ntype PronounsWithSource = [string | null, string];\nconst EmptyPronouns: PronounsWithSource = [null, \"\"];\n\nexport const enum PronounsFormat {\n Lowercase = \"LOWERCASE\",\n Capitalized = \"CAPITALIZED\"\n}\n\nexport const enum PronounSource {\n PreferPDB,\n PreferDiscord\n}\n\n// A map of cached pronouns so the same request isn't sent twice\nconst cache: Record = {};\n// A map of ids and callbacks that should be triggered on fetch\nconst requestQueue: Record void)[]> = {};\n\n// Executes all queued requests and calls their callbacks\nconst bulkFetch = debounce(async () => {\n const ids = Object.keys(requestQueue);\n const pronouns = await bulkFetchPronouns(ids);\n for (const id of ids) {\n // Call all callbacks for the id\n requestQueue[id]?.forEach(c => c(pronouns[id]));\n delete requestQueue[id];\n }\n});\n\nfunction getDiscordPronouns(id: string, useGlobalProfile: boolean = false) {\n const globalPronouns = UserProfileStore.getUserProfile(id)?.pronouns;\n\n if (useGlobalProfile) return globalPronouns;\n\n return (\n UserProfileStore.getGuildMemberProfile(id, getCurrentChannel()?.guild_id)?.pronouns\n || globalPronouns\n );\n}\n\nexport function useFormattedPronouns(id: string, useGlobalProfile: boolean = false): PronounsWithSource {\n // Discord is so stupid you can put tons of newlines in pronouns\n const discordPronouns = getDiscordPronouns(id, useGlobalProfile)?.trim().replace(NewLineRe, \" \");\n\n const [result] = useAwaiter(() => fetchPronouns(id), {\n fallbackValue: getCachedPronouns(id),\n onError: e => console.error(\"Fetching pronouns failed: \", e)\n });\n\n if (settings.store.pronounSource === PronounSource.PreferDiscord && discordPronouns)\n return [discordPronouns, \"Discord\"];\n\n if (result && result !== \"unspecified\")\n return [formatPronouns(result), \"PronounDB\"];\n\n return [discordPronouns, \"Discord\"];\n}\n\nexport function useProfilePronouns(id: string, useGlobalProfile: boolean = false): PronounsWithSource {\n const pronouns = useFormattedPronouns(id, useGlobalProfile);\n\n if (!settings.store.showInProfile) return EmptyPronouns;\n if (!settings.store.showSelf && id === UserStore.getCurrentUser().id) return EmptyPronouns;\n\n return pronouns;\n}\n\n\nconst NewLineRe = /\\n+/g;\n\n// Gets the cached pronouns, if you're too impatient for a promise!\nexport function getCachedPronouns(id: string): string | null {\n const cached = cache[id];\n if (cached && cached !== \"unspecified\") return cached;\n\n return cached || null;\n}\n\n// Fetches the pronouns for one id, returning a promise that resolves if it was cached, or once the request is completed\nexport function fetchPronouns(id: string): Promise {\n return new Promise(res => {\n const cached = getCachedPronouns(id);\n if (cached) return res(cached);\n\n // If there is already a request added, then just add this callback to it\n if (id in requestQueue) return requestQueue[id].push(res);\n\n // If not already added, then add it and call the debounced function to make sure the request gets executed\n requestQueue[id] = [res];\n bulkFetch();\n });\n}\n\nasync function bulkFetchPronouns(ids: string[]): Promise {\n const params = new URLSearchParams();\n params.append(\"platform\", \"discord\");\n params.append(\"ids\", ids.join(\",\"));\n\n try {\n const req = await fetch(\"https://pronoundb.org/api/v1/lookup-bulk?\" + params.toString(), {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"X-PronounDB-Source\": VENCORD_USER_AGENT\n }\n });\n return await req.json()\n .then((res: PronounsResponse) => {\n Object.assign(cache, res);\n return res;\n });\n } catch (e) {\n // If the request errors, treat it as if no pronouns were found for all ids, and log it\n console.error(\"PronounDB fetching failed: \", e);\n const dummyPronouns = Object.fromEntries(ids.map(id => [id, \"unspecified\"] as const));\n Object.assign(cache, dummyPronouns);\n return dummyPronouns;\n }\n}\n\nexport function formatPronouns(pronouns: string): string {\n const { pronounsFormat } = Settings.plugins.PronounDB as { pronounsFormat: PronounsFormat, enabled: boolean; };\n // For capitalized pronouns, just return the mapping (it is by default capitalized)\n if (pronounsFormat === PronounsFormat.Capitalized) return PronounMapping[pronouns];\n // If it is set to lowercase and a special code (any, ask, avoid), then just return the capitalized text\n else if (\n pronounsFormat === PronounsFormat.Lowercase\n && [\"any\", \"ask\", \"avoid\", \"other\"].includes(pronouns)\n ) return PronounMapping[pronouns];\n // Otherwise (lowercase and not a special code), then convert the mapping to lowercase\n else return PronounMapping[pronouns].toLowerCase();\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { classes } from \"@utils/misc\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { UserStore } from \"@webpack/common\";\nimport { Message } from \"discord-types/general\";\n\nimport { useFormattedPronouns } from \"../pronoundbUtils\";\nimport { settings } from \"../settings\";\n\nconst styles: Record = findByPropsLazy(\"timestampInline\");\n\nconst AUTO_MODERATION_ACTION = 24;\n\nfunction shouldShow(message: Message): boolean {\n if (!settings.store.showInMessages)\n return false;\n if (message.author.bot || message.author.system || message.type === AUTO_MODERATION_ACTION)\n return false;\n if (!settings.store.showSelf && message.author.id === UserStore.getCurrentUser().id)\n return false;\n\n return true;\n}\n\nexport const PronounsChatComponentWrapper = ErrorBoundary.wrap(({ message }: { message: Message; }) => {\n return shouldShow(message)\n ? \n : null;\n}, { noop: true });\n\nexport const CompactPronounsChatComponentWrapper = ErrorBoundary.wrap(({ message }: { message: Message; }) => {\n return shouldShow(message)\n ? \n : null;\n}, { noop: true });\n\nfunction PronounsChatComponent({ message }: { message: Message; }) {\n const [result] = useFormattedPronouns(message.author.id);\n\n return result\n ? (\n \u2022 {result}\n )\n : null;\n}\n\nexport const CompactPronounsChatComponent = ErrorBoundary.wrap(({ message }: { message: Message; }) => {\n const [result] = useFormattedPronouns(message.author.id);\n\n return result\n ? (\n \u2022 {result}\n )\n : null;\n}, { noop: true });\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nimport PronounsAboutComponent from \"./components/PronounsAboutComponent\";\nimport { CompactPronounsChatComponentWrapper, PronounsChatComponentWrapper } from \"./components/PronounsChatComponent\";\nimport { useProfilePronouns } from \"./pronoundbUtils\";\nimport { settings } from \"./settings\";\n\nconst PRONOUN_TOOLTIP_PATCH = {\n match: /text:(.{0,10}.Messages\\.USER_PROFILE_PRONOUNS)(?=,)/,\n replace: '$& + (typeof vcPronounSource !== \"undefined\" ? ` (${vcPronounSource})` : \"\")'\n};\n\nexport default definePlugin({\n name: \"PronounDB\",\n authors: [Devs.Tyman, Devs.TheKodeToad, Devs.Ven],\n description: \"Adds pronouns to user messages using pronoundb\",\n patches: [\n // Add next to username (compact mode)\n {\n find: \"showCommunicationDisabledStyles\",\n replacement: {\n match: /(\"span\",{id:\\i,className:\\i,children:\\i}\\))/,\n replace: \"$1, $self.CompactPronounsChatComponentWrapper(arguments[0])\"\n }\n },\n // Patch the chat timestamp element (normal mode)\n {\n find: \"showCommunicationDisabledStyles\",\n replacement: {\n match: /(?<=return\\s*\\(0,\\i\\.jsxs?\\)\\(.+!\\i&&)(\\(0,\\i.jsxs?\\)\\(.+?\\{.+?\\}\\))/,\n replace: \"[$1, $self.PronounsChatComponentWrapper(arguments[0])]\"\n }\n },\n // Patch the profile popout username header to use our pronoun hook instead of Discord's pronouns\n {\n find: \".userTagNoNickname\",\n replacement: [\n {\n match: /{user:(\\i),[^}]*,pronouns:(\\i),[^}]*}=\\i;/,\n replace: \"$&let vcPronounSource;[$2,vcPronounSource]=$self.useProfilePronouns($1.id);\"\n },\n PRONOUN_TOOLTIP_PATCH\n ]\n },\n // Patch the profile modal username header to use our pronoun hook instead of Discord's pronouns\n {\n find: \".nameTagSmall)\",\n replacement: [\n {\n match: /\\.getName\\(\\i\\);(?<=displayProfile.{0,200})/,\n replace: \"$&const [vcPronounce,vcPronounSource]=$self.useProfilePronouns(arguments[0].user.id,true);if(arguments[0].displayProfile&&vcPronounce)arguments[0].displayProfile.pronouns=vcPronounce;\"\n },\n PRONOUN_TOOLTIP_PATCH\n ]\n }\n ],\n\n settings,\n\n settingsAboutComponent: PronounsAboutComponent,\n\n // Re-export the components on the plugin object so it is easily accessible in patches\n PronounsChatComponentWrapper,\n CompactPronounsChatComponentWrapper,\n useProfilePronouns\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addButton, removeButton } from \"@api/MessagePopover\";\nimport { Devs } from \"@utils/constants\";\nimport { insertTextIntoChatInputBox } from \"@utils/discord\";\nimport definePlugin from \"@utils/types\";\nimport { ChannelStore, PermissionsBits, PermissionStore } from \"@webpack/common\";\n\nexport default definePlugin({\n name: \"QuickMention\",\n authors: [Devs.kemo],\n description: \"Adds a quick mention button to the message actions bar\",\n dependencies: [\"MessagePopoverAPI\"],\n\n start() {\n addButton(\"QuickMention\", msg => {\n const channel = ChannelStore.getChannel(msg.channel_id);\n if (!PermissionStore.can(PermissionsBits.SEND_MESSAGES, channel)) return null;\n\n return {\n label: \"Quick Mention\",\n icon: this.Icon,\n message: msg,\n channel,\n onClick: () => insertTextIntoChatInputBox(`<@${msg.author.id}> `)\n };\n });\n },\n stop() {\n removeButton(\"QuickMention\");\n },\n\n Icon: () => (\n \n \n \n ),\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings, Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ChannelStore, FluxDispatcher as Dispatcher, MessageStore, PermissionsBits, PermissionStore, SelectedChannelStore, UserStore } from \"@webpack/common\";\nimport { Message } from \"discord-types/general\";\n\nconst Kangaroo = findByPropsLazy(\"jumpToMessage\");\n\nconst isMac = navigator.platform.includes(\"Mac\"); // bruh\nlet replyIdx = -1;\nlet editIdx = -1;\n\n\nconst enum MentionOptions {\n DISABLED,\n ENABLED,\n NO_REPLY_MENTION_PLUGIN\n}\n\nconst settings = definePluginSettings({\n shouldMention: {\n type: OptionType.SELECT,\n description: \"Ping reply by default\",\n options: [\n {\n label: \"Follow NoReplyMention\",\n value: MentionOptions.NO_REPLY_MENTION_PLUGIN,\n default: true\n },\n { label: \"Enabled\", value: MentionOptions.ENABLED },\n { label: \"Disabled\", value: MentionOptions.DISABLED },\n ]\n }\n});\n\nexport default definePlugin({\n name: \"QuickReply\",\n authors: [Devs.obscurity, Devs.Ven, Devs.pylix],\n description: \"Reply to (ctrl + up/down) and edit (ctrl + shift + up/down) messages via keybinds\",\n settings,\n\n start() {\n Dispatcher.subscribe(\"DELETE_PENDING_REPLY\", onDeletePendingReply);\n Dispatcher.subscribe(\"MESSAGE_END_EDIT\", onEndEdit);\n Dispatcher.subscribe(\"MESSAGE_START_EDIT\", onStartEdit);\n Dispatcher.subscribe(\"CREATE_PENDING_REPLY\", onCreatePendingReply);\n document.addEventListener(\"keydown\", onKeydown);\n },\n\n stop() {\n Dispatcher.unsubscribe(\"DELETE_PENDING_REPLY\", onDeletePendingReply);\n Dispatcher.unsubscribe(\"MESSAGE_END_EDIT\", onEndEdit);\n Dispatcher.unsubscribe(\"MESSAGE_START_EDIT\", onStartEdit);\n Dispatcher.unsubscribe(\"CREATE_PENDING_REPLY\", onCreatePendingReply);\n document.removeEventListener(\"keydown\", onKeydown);\n },\n});\n\nconst onDeletePendingReply = () => replyIdx = -1;\nconst onEndEdit = () => editIdx = -1;\n\nfunction calculateIdx(messages: Message[], id: string) {\n const idx = messages.findIndex(m => m.id === id);\n return idx === -1\n ? idx\n : messages.length - idx - 1;\n}\n\nfunction onStartEdit({ channelId, messageId, _isQuickEdit }: any) {\n if (_isQuickEdit) return;\n\n const meId = UserStore.getCurrentUser().id;\n\n const messages = MessageStore.getMessages(channelId)._array.filter(m => m.author.id === meId);\n editIdx = calculateIdx(messages, messageId);\n}\n\nfunction onCreatePendingReply({ message, _isQuickReply }: { message: Message; _isQuickReply: boolean; }) {\n if (_isQuickReply) return;\n\n replyIdx = calculateIdx(MessageStore.getMessages(message.channel_id)._array, message.id);\n}\n\nconst isCtrl = (e: KeyboardEvent) => isMac ? e.metaKey : e.ctrlKey;\nconst isAltOrMeta = (e: KeyboardEvent) => e.altKey || (!isMac && e.metaKey);\n\nfunction onKeydown(e: KeyboardEvent) {\n const isUp = e.key === \"ArrowUp\";\n if (!isUp && e.key !== \"ArrowDown\") return;\n if (!isCtrl(e) || isAltOrMeta(e)) return;\n\n if (e.shiftKey)\n nextEdit(isUp);\n else\n nextReply(isUp);\n}\n\nfunction jumpIfOffScreen(channelId: string, messageId: string) {\n const element = document.getElementById(\"message-content-\" + messageId);\n if (!element) return;\n\n const vh = Math.max(document.documentElement.clientHeight, window.innerHeight);\n const rect = element.getBoundingClientRect();\n const isOffscreen = rect.bottom < 200 || rect.top - vh >= -200;\n\n if (isOffscreen) {\n Kangaroo.jumpToMessage({\n channelId,\n messageId,\n flash: false,\n jumpType: \"INSTANT\"\n });\n }\n}\n\nfunction getNextMessage(isUp: boolean, isReply: boolean) {\n let messages: Array = MessageStore.getMessages(SelectedChannelStore.getChannelId())._array;\n if (!isReply) { // we are editing so only include own\n const meId = UserStore.getCurrentUser().id;\n messages = messages.filter(m => m.author.id === meId);\n }\n\n const mutate = (i: number) => isUp\n ? Math.min(messages.length - 1, i + 1)\n : Math.max(-1, i - 1);\n\n const findNextNonDeleted = (i: number) => {\n do {\n i = mutate(i);\n } while (i !== -1 && messages[messages.length - i - 1]?.deleted === true);\n return i;\n };\n\n let i: number;\n if (isReply)\n replyIdx = i = findNextNonDeleted(replyIdx);\n else\n editIdx = i = findNextNonDeleted(editIdx);\n\n return i === - 1 ? undefined : messages[messages.length - i - 1];\n}\n\nfunction shouldMention(message) {\n const { enabled, userList, shouldPingListed } = Settings.plugins.NoReplyMention;\n const shouldPing = !enabled || (shouldPingListed === userList.includes(message.author.id));\n\n switch (settings.store.shouldMention) {\n case MentionOptions.NO_REPLY_MENTION_PLUGIN: return shouldPing;\n case MentionOptions.DISABLED: return false;\n default: return true;\n }\n}\n\n// handle next/prev reply\nfunction nextReply(isUp: boolean) {\n const currChannel = ChannelStore.getChannel(SelectedChannelStore.getChannelId());\n if (currChannel.guild_id && !PermissionStore.can(PermissionsBits.SEND_MESSAGES, currChannel)) return;\n const message = getNextMessage(isUp, true);\n\n if (!message)\n return void Dispatcher.dispatch({\n type: \"DELETE_PENDING_REPLY\",\n channelId: SelectedChannelStore.getChannelId(),\n });\n const channel = ChannelStore.getChannel(message.channel_id);\n const meId = UserStore.getCurrentUser().id;\n\n Dispatcher.dispatch({\n type: \"CREATE_PENDING_REPLY\",\n channel,\n message,\n shouldMention: shouldMention(message),\n showMentionToggle: channel.guild_id !== null && message.author.id !== meId,\n _isQuickReply: true\n });\n jumpIfOffScreen(channel.id, message.id);\n}\n\n// handle next/prev edit\nfunction nextEdit(isUp: boolean) {\n const currChannel = ChannelStore.getChannel(SelectedChannelStore.getChannelId());\n if (currChannel.guild_id && !PermissionStore.can(PermissionsBits.SEND_MESSAGES, currChannel)) return;\n const message = getNextMessage(isUp, false);\n\n if (!message)\n return Dispatcher.dispatch({\n type: \"MESSAGE_END_EDIT\",\n channelId: SelectedChannelStore.getChannelId()\n });\n Dispatcher.dispatch({\n type: \"MESSAGE_START_EDIT\",\n channelId: message.channel_id,\n messageId: message.id,\n content: message.content,\n _isQuickEdit: true\n });\n jumpIfOffScreen(message.channel_id, message.id);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nlet ERROR_CODES: any;\nconst CODES_URL =\n \"https://raw.githubusercontent.com/facebook/react/17.0.2/scripts/error-codes/codes.json\";\n\nexport default definePlugin({\n name: \"ReactErrorDecoder\",\n description: 'Replaces \"Minifed React Error\" with the actual error.',\n authors: [Devs.Cyn],\n patches: [\n {\n find: '\"https://reactjs.org/docs/error-decoder.html?invariant=\"',\n replacement: {\n match: /(function .\\(.\\)){(for\\(var .=\"https:\\/\\/reactjs\\.org\\/docs\\/error-decoder\\.html\\?invariant=\"\\+.,.=1;.\n `${func}{var decoded=Vencord.Plugins.plugins.ReactErrorDecoder.decodeError.apply(null, arguments);if(decoded)return decoded;${original}}`,\n },\n },\n ],\n\n async start() {\n ERROR_CODES = await fetch(CODES_URL)\n .then(res => res.json())\n .catch(e => console.error(\"[ReactErrorDecoder] Failed to fetch React error codes\\n\", e));\n },\n\n stop() {\n ERROR_CODES = undefined;\n },\n\n decodeError(code: number, ...args: any) {\n let index = 0;\n return ERROR_CODES?.[code]?.replace(/%s/g, () => {\n const arg = args[index];\n index++;\n return arg;\n });\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Logger } from \"@utils/Logger\";\n\nconst logger = new Logger(\"ServerListAPI\");\n\nexport const enum ServerListRenderPosition {\n Above,\n In,\n}\n\nconst renderFunctionsAbove = new Set();\nconst renderFunctionsIn = new Set();\n\nfunction getRenderFunctions(position: ServerListRenderPosition) {\n return position === ServerListRenderPosition.Above ? renderFunctionsAbove : renderFunctionsIn;\n}\n\nexport function addServerListElement(position: ServerListRenderPosition, renderFunction: Function) {\n getRenderFunctions(position).add(renderFunction);\n}\n\nexport function removeServerListElement(position: ServerListRenderPosition, renderFunction: Function) {\n getRenderFunctions(position).delete(renderFunction);\n}\n\nexport const renderAll = (position: ServerListRenderPosition) => {\n const ret: Array = [];\n\n for (const renderFunction of getRenderFunctions(position)) {\n try {\n ret.unshift(renderFunction());\n } catch (e) {\n logger.error(\"Failed to render server list element:\", e);\n }\n }\n\n return ret;\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addServerListElement, removeServerListElement, ServerListRenderPosition } from \"@api/ServerList\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { Button, FluxDispatcher, GuildChannelStore, GuildStore, React, ReadStateStore } from \"@webpack/common\";\n\nfunction onClick() {\n const channels: Array = [];\n\n Object.values(GuildStore.getGuilds()).forEach(guild => {\n GuildChannelStore.getChannels(guild.id).SELECTABLE.forEach((c: { channel: { id: string; }; }) => {\n if (!ReadStateStore.hasUnread(c.channel.id)) return;\n\n channels.push({\n channelId: c.channel.id,\n // messageId: c.channel?.lastMessageId,\n messageId: ReadStateStore.lastMessageId(c.channel.id),\n readStateType: 0\n });\n });\n });\n\n FluxDispatcher.dispatch({\n type: \"BULK_ACK\",\n context: \"APP\",\n channels: channels\n });\n}\n\nconst ReadAllButton = () => (\n Read all\n);\n\nexport default definePlugin({\n name: \"ReadAllNotificationsButton\",\n description: \"Read all server notifications with a single button click!\",\n authors: [Devs.kemo],\n dependencies: [\"ServerListAPI\"],\n\n renderReadAllButton: () => ,\n\n start() {\n addServerListElement(ServerListRenderPosition.Above, this.renderReadAllButton);\n },\n\n stop() {\n removeServerListElement(ServerListRenderPosition.Above, this.renderReadAllButton);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { OptionType } from \"@utils/types\";\n\nexport default definePluginSettings({\n notices: {\n type: OptionType.BOOLEAN,\n description: \"Also show a notice at the top of your screen when removed (use this if you don't want to miss any notifications).\",\n default: false\n },\n offlineRemovals: {\n type: OptionType.BOOLEAN,\n description: \"Notify you when starting discord if you were removed while offline.\",\n default: true\n },\n friends: {\n type: OptionType.BOOLEAN,\n description: \"Notify when a friend removes you\",\n default: true\n },\n friendRequestCancels: {\n type: OptionType.BOOLEAN,\n description: \"Notify when a friend request is cancelled\",\n default: true\n },\n servers: {\n type: OptionType.BOOLEAN,\n description: \"Notify when removed from a server\",\n default: true\n },\n groups: {\n type: OptionType.BOOLEAN,\n description: \"Notify when removed from a group chat\",\n default: true\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Channel } from \"discord-types/general\";\n\nexport interface ChannelDelete {\n type: \"CHANNEL_DELETE\";\n channel: Channel;\n}\n\nexport interface GuildDelete {\n type: \"GUILD_DELETE\";\n guild: {\n id: string;\n unavailable?: boolean;\n };\n}\n\nexport interface RelationshipRemove {\n type: \"RELATIONSHIP_REMOVE\";\n relationship: {\n id: string;\n nickname: string;\n type: number;\n };\n}\n\nexport interface SimpleGroupChannel {\n id: string;\n name: string;\n iconURL?: string;\n}\n\nexport interface SimpleGuild {\n id: string;\n name: string;\n iconURL?: string;\n}\n\nexport const enum ChannelType {\n GROUP_DM = 3,\n}\n\nexport const enum RelationshipType {\n FRIEND = 1,\n BLOCKED = 2,\n INCOMING_REQUEST = 3,\n OUTGOING_REQUEST = 4,\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { DataStore, Notices } from \"@api/index\";\nimport { showNotification } from \"@api/Notifications\";\nimport { getUniqueUsername, openUserProfile } from \"@utils/discord\";\nimport { ChannelStore, GuildMemberStore, GuildStore, RelationshipStore, UserStore, UserUtils } from \"@webpack/common\";\n\nimport settings from \"./settings\";\nimport { ChannelType, RelationshipType, SimpleGroupChannel, SimpleGuild } from \"./types\";\n\nconst guilds = new Map();\nconst groups = new Map();\nconst friends = {\n friends: [] as string[],\n requests: [] as string[]\n};\n\nconst guildsKey = () => `relationship-notifier-guilds-${UserStore.getCurrentUser().id}`;\nconst groupsKey = () => `relationship-notifier-groups-${UserStore.getCurrentUser().id}`;\nconst friendsKey = () => `relationship-notifier-friends-${UserStore.getCurrentUser().id}`;\n\nasync function runMigrations() {\n DataStore.delMany([\"relationship-notifier-guilds\", \"relationship-notifier-groups\", \"relationship-notifier-friends\"]);\n}\n\nexport async function syncAndRunChecks() {\n await runMigrations();\n const [oldGuilds, oldGroups, oldFriends] = await DataStore.getMany([\n guildsKey(),\n groupsKey(),\n friendsKey()\n ]) as [Map | undefined, Map | undefined, Record<\"friends\" | \"requests\", string[]> | undefined];\n\n await Promise.all([syncGuilds(), syncGroups(), syncFriends()]);\n\n if (settings.store.offlineRemovals) {\n if (settings.store.groups && oldGroups?.size) {\n for (const [id, group] of oldGroups) {\n if (!groups.has(id))\n notify(`You are no longer in the group ${group.name}.`, group.iconURL);\n }\n }\n\n if (settings.store.servers && oldGuilds?.size) {\n for (const [id, guild] of oldGuilds) {\n if (!guilds.has(id))\n notify(`You are no longer in the server ${guild.name}.`, guild.iconURL);\n }\n }\n\n if (settings.store.friends && oldFriends?.friends.length) {\n for (const id of oldFriends.friends) {\n if (friends.friends.includes(id)) continue;\n\n const user = await UserUtils.getUser(id).catch(() => void 0);\n if (user)\n notify(\n `You are no longer friends with ${getUniqueUsername(user)}.`,\n user.getAvatarURL(undefined, undefined, false),\n () => openUserProfile(user.id)\n );\n }\n }\n\n if (settings.store.friendRequestCancels && oldFriends?.requests?.length) {\n for (const id of oldFriends.requests) {\n if (\n friends.requests.includes(id) ||\n [RelationshipType.FRIEND, RelationshipType.BLOCKED, RelationshipType.OUTGOING_REQUEST].includes(RelationshipStore.getRelationshipType(id))\n ) continue;\n\n const user = await UserUtils.getUser(id).catch(() => void 0);\n if (user)\n notify(\n `Friend request from ${getUniqueUsername(user)} has been revoked.`,\n user.getAvatarURL(undefined, undefined, false),\n () => openUserProfile(user.id)\n );\n }\n }\n }\n}\n\nexport function notify(text: string, icon?: string, onClick?: () => void) {\n if (settings.store.notices)\n Notices.showNotice(text, \"OK\", () => Notices.popNotice());\n\n showNotification({\n title: \"Relationship Notifier\",\n body: text,\n icon,\n onClick\n });\n}\n\nexport function getGuild(id: string) {\n return guilds.get(id);\n}\n\nexport function deleteGuild(id: string) {\n guilds.delete(id);\n syncGuilds();\n}\n\nexport async function syncGuilds() {\n guilds.clear();\n\n const me = UserStore.getCurrentUser().id;\n for (const [id, { name, icon }] of Object.entries(GuildStore.getGuilds())) {\n if (GuildMemberStore.isMember(id, me))\n guilds.set(id, {\n id,\n name,\n iconURL: icon && `https://cdn.discordapp.com/icons/${id}/${icon}.png`\n });\n }\n await DataStore.set(guildsKey(), guilds);\n}\n\nexport function getGroup(id: string) {\n return groups.get(id);\n}\n\nexport function deleteGroup(id: string) {\n groups.delete(id);\n syncGroups();\n}\n\nexport async function syncGroups() {\n groups.clear();\n\n for (const { type, id, name, rawRecipients, icon } of ChannelStore.getSortedPrivateChannels()) {\n if (type === ChannelType.GROUP_DM)\n groups.set(id, {\n id,\n name: name || rawRecipients.map(r => r.username).join(\", \"),\n iconURL: icon && `https://cdn.discordapp.com/channel-icons/${id}/${icon}.png`\n });\n }\n\n await DataStore.set(groupsKey(), groups);\n}\n\nexport async function syncFriends() {\n friends.friends = [];\n friends.requests = [];\n\n const relationShips = RelationshipStore.getRelationships();\n for (const id in relationShips) {\n switch (relationShips[id]) {\n case RelationshipType.FRIEND:\n friends.friends.push(id);\n break;\n case RelationshipType.INCOMING_REQUEST:\n friends.requests.push(id);\n break;\n }\n }\n\n await DataStore.set(friendsKey(), friends);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { getUniqueUsername, openUserProfile } from \"@utils/discord\";\nimport { UserUtils } from \"@webpack/common\";\n\nimport settings from \"./settings\";\nimport { ChannelDelete, ChannelType, GuildDelete, RelationshipRemove, RelationshipType } from \"./types\";\nimport { deleteGroup, deleteGuild, getGroup, getGuild, notify } from \"./utils\";\n\nlet manuallyRemovedFriend: string | undefined;\nlet manuallyRemovedGuild: string | undefined;\nlet manuallyRemovedGroup: string | undefined;\n\nexport const removeFriend = (id: string) => manuallyRemovedFriend = id;\nexport const removeGuild = (id: string) => manuallyRemovedGuild = id;\nexport const removeGroup = (id: string) => manuallyRemovedGroup = id;\n\nexport async function onRelationshipRemove({ relationship: { type, id } }: RelationshipRemove) {\n if (manuallyRemovedFriend === id) {\n manuallyRemovedFriend = undefined;\n return;\n }\n\n const user = await UserUtils.getUser(id)\n .catch(() => null);\n if (!user) return;\n\n switch (type) {\n case RelationshipType.FRIEND:\n if (settings.store.friends)\n notify(\n `${getUniqueUsername(user)} removed you as a friend.`,\n user.getAvatarURL(undefined, undefined, false),\n () => openUserProfile(user.id)\n );\n break;\n case RelationshipType.INCOMING_REQUEST:\n if (settings.store.friendRequestCancels)\n notify(\n `A friend request from ${getUniqueUsername(user)} has been removed.`,\n user.getAvatarURL(undefined, undefined, false),\n () => openUserProfile(user.id)\n );\n break;\n }\n}\n\nexport function onGuildDelete({ guild: { id, unavailable } }: GuildDelete) {\n if (!settings.store.servers) return;\n if (unavailable) return;\n\n if (manuallyRemovedGuild === id) {\n deleteGuild(id);\n manuallyRemovedGuild = undefined;\n return;\n }\n\n const guild = getGuild(id);\n if (guild) {\n deleteGuild(id);\n notify(`You were removed from the server ${guild.name}.`, guild.iconURL);\n }\n}\n\nexport function onChannelDelete({ channel: { id, type } }: ChannelDelete) {\n if (!settings.store.groups) return;\n if (type !== ChannelType.GROUP_DM) return;\n\n if (manuallyRemovedGroup === id) {\n deleteGroup(id);\n manuallyRemovedGroup = undefined;\n return;\n }\n\n const group = getGroup(id);\n if (group) {\n deleteGroup(id);\n notify(`You were removed from the group ${group.name}.`, group.iconURL);\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nimport { onChannelDelete, onGuildDelete, onRelationshipRemove, removeFriend, removeGroup, removeGuild } from \"./functions\";\nimport settings from \"./settings\";\nimport { syncAndRunChecks, syncFriends, syncGroups, syncGuilds } from \"./utils\";\n\nexport default definePlugin({\n name: \"RelationshipNotifier\",\n description: \"Notifies you when a friend, group chat, or server removes you.\",\n authors: [Devs.nick],\n settings,\n\n patches: [\n {\n find: \"removeRelationship:(\",\n replacement: {\n match: /(removeRelationship:\\((\\i),\\i,\\i\\)=>)/,\n replace: \"$1($self.removeFriend($2),0)||\"\n }\n },\n {\n find: \"async leaveGuild(\",\n replacement: {\n match: /(leaveGuild\\((\\i)\\){)/,\n replace: \"$1$self.removeGuild($2);\"\n }\n },\n {\n find: \"},closePrivateChannel(\",\n replacement: {\n match: /(closePrivateChannel\\((\\i)\\){)/,\n replace: \"$1$self.removeGroup($2);\"\n }\n }\n ],\n\n flux: {\n GUILD_CREATE: syncGuilds,\n GUILD_DELETE: onGuildDelete,\n CHANNEL_CREATE: syncGroups,\n CHANNEL_DELETE: onChannelDelete,\n RELATIONSHIP_ADD: syncFriends,\n RELATIONSHIP_UPDATE: syncFriends,\n RELATIONSHIP_REMOVE(e) {\n onRelationshipRemove(e);\n syncFriends();\n },\n CONNECTION_OPEN: syncAndRunChecks\n },\n\n async start() {\n setTimeout(() => {\n syncAndRunChecks();\n }, 5000);\n },\n\n removeFriend,\n removeGroup,\n removeGuild\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\n\nconst SpoilerClasses = findByPropsLazy(\"spoilerContent\");\nconst MessagesClasses = findByPropsLazy(\"messagesWrapper\", \"messages\");\n\nexport default definePlugin({\n name: \"RevealAllSpoilers\",\n description: \"Reveal all spoilers in a message by Ctrl-clicking a spoiler, or in the chat with Ctrl+Shift-click\",\n authors: [Devs.whqwert],\n\n patches: [\n {\n find: \".removeObscurity=\",\n replacement: {\n match: /(?<=\\.removeObscurity=(\\i)=>{)/,\n replace: (_, event) => `$self.reveal(${event});`\n }\n }\n ],\n\n reveal(event: MouseEvent) {\n const { ctrlKey, shiftKey, target } = event;\n\n if (!ctrlKey) { return; }\n\n const { spoilerContent, hidden } = SpoilerClasses;\n const { messagesWrapper } = MessagesClasses;\n\n const parent = shiftKey\n ? document.querySelector(`div.${messagesWrapper}`)\n : (target as HTMLSpanElement).parentElement;\n\n for (const spoiler of parent!.querySelectorAll(`span.${spoilerContent}.${hidden}`)) {\n (spoiler as HTMLSpanElement).click();\n }\n }\n\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { Flex } from \"@components/Flex\";\nimport { OpenExternalIcon } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { Menu } from \"@webpack/common\";\n\nconst Engines = {\n Google: \"https://lens.google.com/uploadbyurl?url=\",\n Yandex: \"https://yandex.com/images/search?rpt=imageview&url=\",\n SauceNAO: \"https://saucenao.com/search.php?url=\",\n IQDB: \"https://iqdb.org/?url=\",\n TinEye: \"https://www.tineye.com/search?url=\",\n ImgOps: \"https://imgops.com/start?url=\"\n} as const;\n\nfunction search(src: string, engine: string) {\n open(engine + encodeURIComponent(src), \"_blank\");\n}\n\nconst imageContextMenuPatch: NavContextMenuPatchCallback = (children, props) => () => {\n if (!props) return;\n const { reverseImageSearchType, itemHref, itemSrc } = props;\n\n if (!reverseImageSearchType || reverseImageSearchType !== \"img\") return;\n\n const src = itemHref ?? itemSrc;\n\n const group = findGroupChildrenByChildId(\"copy-link\", children);\n if (group) {\n group.push((\n \n {Object.keys(Engines).map((engine, i) => {\n const key = \"search-image-\" + engine;\n return (\n \n = 3 // Do not round Google, Yandex & SauceNAO\n ? \"50%\"\n : void 0\n }}\n aria-hidden=\"true\"\n height={16}\n width={16}\n src={new URL(\"/favicon.ico\", Engines[engine]).toString().replace(\"lens.\", \"\")}\n />\n {engine}\n \n }\n action={() => search(src, Engines[engine])}\n />\n );\n })}\n \n \n All\n \n }\n action={() => Object.values(Engines).forEach(e => search(src, e))}\n />\n \n ));\n }\n};\n\nexport default definePlugin({\n name: \"ReverseImageSearch\",\n description: \"Adds ImageSearch to image context menus\",\n authors: [Devs.Ven, Devs.Nuckyz],\n tags: [\"ImageUtilities\"],\n\n patches: [\n {\n find: \".Messages.MESSAGE_ACTIONS_MENU_LABEL\",\n replacement: {\n match: /favoriteableType:\\i,(?<=(\\i)\\.getAttribute\\(\"data-type\"\\).+?)/,\n replace: (m, target) => `${m}reverseImageSearchType:${target}.getAttribute(\"data-role\"),`\n }\n }\n ],\n\n start() {\n addContextMenuPatch(\"message\", imageContextMenuPatch);\n },\n\n stop() {\n removeContextMenuPatch(\"message\", imageContextMenuPatch);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { ChannelStore, GuildMemberStore, GuildStore } from \"@webpack/common\";\n\nconst settings = definePluginSettings({\n chatMentions: {\n type: OptionType.BOOLEAN,\n default: true,\n description: \"Show role colors in chat mentions (including in the message box)\",\n restartNeeded: true\n },\n memberList: {\n type: OptionType.BOOLEAN,\n default: true,\n description: \"Show role colors in member list role headers\",\n restartNeeded: true\n },\n voiceUsers: {\n type: OptionType.BOOLEAN,\n default: true,\n description: \"Show role colors in the voice chat user list\",\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"RoleColorEverywhere\",\n authors: [Devs.KingFish, Devs.lewisakura, Devs.AutumnVN],\n description: \"Adds the top role color anywhere possible\",\n patches: [\n // Chat Mentions\n {\n find: \"CLYDE_AI_MENTION_COLOR:null,\",\n replacement: [\n {\n match: /user:(\\i),channel:(\\i).{0,400}?\"@\"\\.concat\\(.+?\\)/,\n replace: \"$&,color:$self.getUserColor($1?.id,{channelId:$2?.id})\"\n }\n ],\n predicate: () => settings.store.chatMentions,\n },\n // Slate\n {\n find: \".userTooltip,children\",\n replacement: [\n {\n match: /let\\{id:(\\i),guildId:(\\i)[^}]*\\}.*?\\.default,{(?=children)/,\n replace: \"$&color:$self.getUserColor($1,{guildId:$2}),\"\n }\n ],\n predicate: () => settings.store.chatMentions,\n },\n {\n find: 'tutorialId:\"whos-online',\n replacement: [\n {\n match: /\\i.roleIcon,\\.\\.\\.\\i/,\n replace: \"$&,color:$self.roleGroupColor(arguments[0])\"\n },\n {\n match: /null,\\i,\" \u2014 \",\\i\\]/,\n replace: \"null,$self.roleGroupColor(arguments[0])]\"\n },\n ],\n predicate: () => settings.store.memberList,\n },\n {\n find: \"renderPrioritySpeaker\",\n replacement: [\n {\n match: /renderName\\(\\).{0,100}speaking:.{50,100}jsx.{5,10}{/,\n replace: \"$&...$self.getVoiceProps(this.props),\"\n }\n ],\n predicate: () => settings.store.voiceUsers,\n }\n ],\n settings,\n\n getColor(userId: string, { channelId, guildId }: { channelId?: string; guildId?: string; }) {\n if (!(guildId ??= ChannelStore.getChannel(channelId!)?.guild_id)) return null;\n return GuildMemberStore.getMember(guildId, userId)?.colorString ?? null;\n },\n\n getUserColor(userId: string, ids: { channelId?: string; guildId?: string; }) {\n const colorString = this.getColor(userId, ids);\n return colorString && parseInt(colorString.slice(1), 16);\n },\n\n roleGroupColor({ id, count, title, guildId, label }: { id: string; count: number; title: string; guildId: string; label: string; }) {\n const guild = GuildStore.getGuild(guildId);\n const role = guild?.roles[id];\n\n return (\n \n {title ?? label} — {count}\n \n );\n },\n\n getVoiceProps({ user: { id: userId }, guildId }: { user: { id: string; }; guildId: string; }) {\n return {\n style: {\n color: this.getColor(userId, { guildId })\n }\n };\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { ReplyIcon } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ChannelStore, i18n, Menu, PermissionsBits, PermissionStore, SelectedChannelStore } from \"@webpack/common\";\nimport { Message } from \"discord-types/general\";\n\n\nconst messageUtils = findByPropsLazy(\"replyToMessage\");\n\nconst messageContextMenuPatch: NavContextMenuPatchCallback = (children, { message }: { message: Message; }) => () => {\n // make sure the message is in the selected channel\n if (SelectedChannelStore.getChannelId() !== message.channel_id) return;\n const channel = ChannelStore.getChannel(message?.channel_id);\n if (!channel) return;\n if (channel.guild_id && !PermissionStore.can(PermissionsBits.SEND_MESSAGES, channel)) return;\n\n // dms and group chats\n const dmGroup = findGroupChildrenByChildId(\"pin\", children);\n if (dmGroup && !dmGroup.some(child => child?.props?.id === \"reply\")) {\n const pinIndex = dmGroup.findIndex(c => c?.props.id === \"pin\");\n return dmGroup.splice(pinIndex + 1, 0, (\n messageUtils.replyToMessage(channel, message, e)}\n />\n ));\n }\n\n // servers\n const serverGroup = findGroupChildrenByChildId(\"mark-unread\", children);\n if (serverGroup && !serverGroup.some(child => child?.props?.id === \"reply\")) {\n return serverGroup.unshift((\n messageUtils.replyToMessage(channel, message, e)}\n />\n ));\n }\n};\n\n\nexport default definePlugin({\n name: \"SearchReply\",\n description: \"Adds a reply button to search results\",\n authors: [Devs.Aria],\n\n start() {\n addContextMenuPatch(\"message\", messageContextMenuPatch);\n },\n\n stop() {\n removeContextMenuPatch(\"message\", messageContextMenuPatch);\n }\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\n// NOTE - Ultimately should probably be turned into a ringtone picker plugin\nexport default definePlugin({\n name: \"SecretRingToneEnabler\",\n description: \"Always play the secret version of the discord ringtone (except during special ringtone events)\",\n authors: [Devs.AndrewDLO, Devs.FieryFlames],\n patches: [\n {\n find: \"call_ringing_beat\\\"\",\n replacement: {\n match: /500===\\i\\.random\\(1,1e3\\)/,\n replace: \"true\"\n }\n },\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport { addPreSendListener, removePreSendListener } from \"@api/MessageEvents\";\nimport { classNameFactory } from \"@api/Styles\";\nimport { Devs } from \"@utils/constants\";\nimport { getTheme, insertTextIntoChatInputBox, Theme } from \"@utils/discord\";\nimport { Margins } from \"@utils/margins\";\nimport { closeModal, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, openModal } from \"@utils/modal\";\nimport definePlugin from \"@utils/types\";\nimport { Button, ButtonLooks, ButtonWrapperClasses, Forms, Parser, Select, Tooltip, useMemo, useState } from \"@webpack/common\";\n\nfunction parseTime(time: string) {\n const cleanTime = time.slice(1, -1).replace(/(\\d)(AM|PM)$/i, \"$1 $2\");\n\n let ms = new Date(`${new Date().toDateString()} ${cleanTime}`).getTime() / 1000;\n if (isNaN(ms)) return time;\n\n // add 24h if time is in the past\n if (Date.now() / 1000 > ms) ms += 86400;\n\n return ``;\n}\n\nconst Formats = [\"\", \"t\", \"T\", \"d\", \"D\", \"f\", \"F\", \"R\"] as const;\ntype Format = typeof Formats[number];\n\nconst cl = classNameFactory(\"vc-st-\");\n\nfunction PickerModal({ rootProps, close }: { rootProps: ModalProps, close(): void; }) {\n const [value, setValue] = useState();\n const [format, setFormat] = useState(\"\");\n const time = Math.round((new Date(value!).getTime() || Date.now()) / 1000);\n\n const formatTimestamp = (time: number, format: Format) => ``;\n\n const [formatted, rendered] = useMemo(() => {\n const formatted = formatTimestamp(time, format);\n return [formatted, Parser.parse(formatted)];\n }, [time, format]);\n\n return (\n \n \n \n Timestamp Picker\n \n\n \n \n\n \n setValue(e.currentTarget.value)}\n style={{\n colorScheme: getTheme() === Theme.Light ? \"light\" : \"dark\",\n }}\n />\n\n Timestamp Format\n ({\n label: m,\n value: m\n }))\n }\n isSelected={v => v === format}\n select={v => setFormat(v)}\n serialize={v => v}\n renderOptionLabel={o => (\n
\n {Parser.parse(formatTimestamp(time, o.value))}\n
\n )}\n renderOptionValue={() => rendered}\n />\n\n Preview\n \n {rendered} ({formatted})\n \n
\n\n \n {\n insertTextIntoChatInputBox(formatted + \" \");\n close();\n }}\n >Insert\n \n
\n );\n}\n\nexport default definePlugin({\n name: \"SendTimestamps\",\n description: \"Send timestamps easily via chat box button & text shortcuts. Read the extended description!\",\n authors: [Devs.Ven, Devs.Tyler],\n dependencies: [\"MessageEventsAPI\"],\n\n patches: [\n {\n find: \"ChannelTextAreaButtons\",\n replacement: {\n match: /(\\i)\\.push.{1,30}disabled:(\\i),.{1,20}\\},\"gift\"\\)\\)/,\n replace: \"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()\",\n }\n },\n ],\n\n start() {\n this.listener = addPreSendListener((_, msg) => {\n msg.content = msg.content.replace(/`\\d{1,2}:\\d{2} ?(?:AM|PM)?`/gi, parseTime);\n });\n },\n\n stop() {\n removePreSendListener(this.listener);\n },\n\n chatBarIcon(chatBoxProps: { type: { analyticsName: string; }; }) {\n if (chatBoxProps.type.analyticsName !== \"normal\") return null;\n\n return (\n \n {({ onMouseEnter, onMouseLeave }) => (\n
\n {\n const key = openModal(props => (\n closeModal(key)}\n />\n ));\n }}\n className={cl(\"button\")}\n >\n
\n \n \n \n \n \n \n
\n \n
\n )\n }\n
\n );\n },\n\n settingsAboutComponent() {\n const samples = [\n \"12:00\",\n \"3:51\",\n \"17:59\",\n \"24:00\",\n \"12:00 AM\",\n \"0:13PM\"\n ].map(s => `\\`${s}\\``);\n\n return (\n <>\n \n To quickly send send time only timestamps, include timestamps formatted as `HH:MM` (including the backticks!) in your message\n \n \n See below for examples.\n If you need anything more specific, use the Date button in the chat bar!\n \n \n Examples:\n
    \n {samples.map(s => (\n
  • \n {s} {\"->\"} {Parser.parse(parseTime(s))}\n
  • \n ))}\n
\n
\n \n );\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Sofia Lima\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addServerListElement, removeServerListElement, ServerListRenderPosition } from \"@api/ServerList\";\nimport { Settings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { useForceUpdater } from \"@utils/react\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { GuildStore, PresenceStore, RelationshipStore } from \"@webpack/common\";\n\nconst enum IndicatorType {\n SERVER = 1 << 0,\n FRIEND = 1 << 1,\n BOTH = SERVER | FRIEND,\n}\n\nlet onlineFriends = 0;\nlet guildCount = 0;\nlet forceUpdateFriendCount: () => void;\nlet forceUpdateGuildCount: () => void;\n\nfunction FriendsIndicator() {\n forceUpdateFriendCount = useForceUpdater();\n\n return (\n \n {onlineFriends} online\n \n );\n}\n\nfunction ServersIndicator() {\n forceUpdateGuildCount = useForceUpdater();\n\n return (\n \n {guildCount} servers\n \n );\n}\n\nfunction handlePresenceUpdate() {\n onlineFriends = 0;\n const relations = RelationshipStore.getRelationships();\n for (const id of Object.keys(relations)) {\n const type = relations[id];\n // FRIEND relationship type\n if (type === 1 && PresenceStore.getStatus(id) !== \"offline\") {\n onlineFriends += 1;\n }\n }\n forceUpdateFriendCount?.();\n}\n\nfunction handleGuildUpdate() {\n guildCount = GuildStore.getGuildCount();\n forceUpdateGuildCount?.();\n}\n\nexport default definePlugin({\n name: \"ServerListIndicators\",\n description: \"Add online friend count or server count in the server list\",\n authors: [Devs.dzshn],\n dependencies: [\"ServerListAPI\"],\n\n options: {\n mode: {\n description: \"mode\",\n type: OptionType.SELECT,\n options: [\n { label: \"Only online friend count\", value: IndicatorType.FRIEND, default: true },\n { label: \"Only server count\", value: IndicatorType.SERVER },\n { label: \"Both server and online friend counts\", value: IndicatorType.BOTH },\n ]\n }\n },\n\n renderIndicator: () => {\n const { mode } = Settings.plugins.ServerListIndicators;\n return \n
\n {!!(mode & IndicatorType.FRIEND) && }\n {!!(mode & IndicatorType.SERVER) && }\n
\n
;\n },\n\n flux: {\n PRESENCE_UPDATES: handlePresenceUpdate,\n GUILD_CREATE: handleGuildUpdate,\n GUILD_DELETE: handleGuildUpdate,\n },\n\n\n start() {\n addServerListElement(ServerListRenderPosition.Above, this.renderIndicator);\n\n handlePresenceUpdate();\n handleGuildUpdate();\n },\n\n stop() {\n removeServerListElement(ServerListRenderPosition.Above, this.renderIndicator);\n }\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport \"./styles.css\";\n\nimport { classNameFactory } from \"@api/Styles\";\nimport { openImageModal, openUserProfile } from \"@utils/discord\";\nimport { classes } from \"@utils/misc\";\nimport { ModalRoot, ModalSize, openModal } from \"@utils/modal\";\nimport { LazyComponent, useAwaiter } from \"@utils/react\";\nimport { findByProps, findByPropsLazy } from \"@webpack\";\nimport { FluxDispatcher, Forms, GuildChannelStore, GuildMemberStore, moment, Parser, PresenceStore, RelationshipStore, ScrollerThin, SnowflakeUtils, TabBar, Timestamp, useEffect, UserStore, UserUtils, useState, useStateFromStores } from \"@webpack/common\";\nimport { Guild, User } from \"discord-types/general\";\n\nconst IconUtils = findByPropsLazy(\"getGuildBannerURL\");\nconst IconClasses = findByPropsLazy(\"icon\", \"acronym\", \"childWrapper\");\nconst FriendRow = LazyComponent(() => findByProps(\"FriendRow\").FriendRow);\n\nconst cl = classNameFactory(\"vc-gp-\");\n\nexport function openGuildProfileModal(guild: Guild) {\n openModal(props =>\n \n \n \n );\n}\n\nconst enum Tabs {\n ServerInfo,\n Friends,\n BlockedUsers\n}\n\ninterface GuildProps {\n guild: Guild;\n}\n\ninterface RelationshipProps extends GuildProps {\n setCount(count: number): void;\n}\n\nconst fetched = {\n friends: false,\n blocked: false\n};\n\nfunction renderTimestamp(timestamp: number) {\n return (\n \n );\n}\n\nfunction GuildProfileModal({ guild }: GuildProps) {\n const [friendCount, setFriendCount] = useState();\n const [blockedCount, setBlockedCount] = useState();\n\n useEffect(() => {\n fetched.friends = false;\n fetched.blocked = false;\n }, []);\n\n const [currentTab, setCurrentTab] = useState(Tabs.ServerInfo);\n\n const bannerUrl = guild.banner && IconUtils.getGuildBannerURL({\n id: guild.id,\n banner: guild.banner\n }, true).replace(/\\?size=\\d+$/, \"?size=1024\");\n\n const iconUrl = guild.icon && IconUtils.getGuildIconURL({\n id: guild.id,\n icon: guild.icon,\n canAnimate: true,\n size: 512\n });\n\n return (\n
\n {bannerUrl && currentTab === Tabs.ServerInfo && (\n openImageModal(bannerUrl)}\n />\n )}\n\n
\n {guild.icon\n ? openImageModal(iconUrl)}\n />\n :
{guild.acronym}
\n }\n\n
\n {guild.name}\n {guild.description && {guild.description}}\n
\n
\n\n \n \n Server Info\n \n \n Friends{friendCount !== undefined ? ` (${friendCount})` : \"\"}\n \n \n Blocked Users{blockedCount !== undefined ? ` (${blockedCount})` : \"\"}\n \n \n\n
\n {currentTab === Tabs.ServerInfo && }\n {currentTab === Tabs.Friends && }\n {currentTab === Tabs.BlockedUsers && }\n
\n
\n );\n}\n\n\nfunction Owner(guildId: string, owner: User) {\n const guildAvatar = GuildMemberStore.getMember(guildId, owner.id)?.avatar;\n const ownerAvatarUrl =\n guildAvatar\n ? IconUtils.getGuildMemberAvatarURLSimple({\n userId: owner!.id,\n avatar: guildAvatar,\n guildId,\n canAnimate: true\n }, true)\n : IconUtils.getUserAvatarURL(owner, true);\n\n return (\n
\n \"\" openImageModal(ownerAvatarUrl)} />\n {Parser.parse(`<@${owner.id}>`)}\n
\n );\n}\n\nfunction ServerInfoTab({ guild }: GuildProps) {\n const [owner] = useAwaiter(() => UserUtils.getUser(guild.ownerId), {\n deps: [guild.ownerId],\n fallbackValue: null\n });\n\n const Fields = {\n \"Server Owner\": owner ? Owner(guild.id, owner) : \"Loading...\",\n \"Created At\": renderTimestamp(SnowflakeUtils.extractTimestamp(guild.id)),\n \"Joined At\": guild.joinedAt ? renderTimestamp(guild.joinedAt.getTime()) : \"-\", // Not available in lurked guild\n \"Vanity Link\": guild.vanityURLCode ? ({`discord.gg/${guild.vanityURLCode}`}) : \"-\", // Making the anchor href valid would cause Discord to reload\n \"Preferred Locale\": guild.preferredLocale || \"-\",\n \"Verification Level\": [\"None\", \"Low\", \"Medium\", \"High\", \"Highest\"][guild.verificationLevel] || \"?\",\n \"Nitro Boosts\": `${guild.premiumSubscriberCount ?? 0} (Level ${guild.premiumTier ?? 0})`,\n \"Channels\": GuildChannelStore.getChannels(guild.id)?.count - 1 || \"?\", // - null category\n \"Roles\": Object.keys(guild.roles).length - 1, // - @everyone\n };\n\n return (\n
\n {Object.entries(Fields).map(([name, node]) =>\n
\n {name}\n {typeof node === \"string\" ? {node} : node}\n
\n )}\n
\n );\n}\n\nfunction FriendsTab({ guild, setCount }: RelationshipProps) {\n return UserList(\"friends\", guild, RelationshipStore.getFriendIDs(), setCount);\n}\n\nfunction BlockedUsersTab({ guild, setCount }: RelationshipProps) {\n const blockedIds = Object.keys(RelationshipStore.getRelationships()).filter(id => RelationshipStore.isBlocked(id));\n return UserList(\"blocked\", guild, blockedIds, setCount);\n}\n\nfunction UserList(type: \"friends\" | \"blocked\", guild: Guild, ids: string[], setCount: (count: number) => void) {\n const missing = [] as string[];\n const members = [] as string[];\n\n for (const id of ids) {\n if (GuildMemberStore.isMember(guild.id, id))\n members.push(id);\n else\n missing.push(id);\n }\n\n // Used for side effects (rerender on member request success)\n useStateFromStores(\n [GuildMemberStore],\n () => GuildMemberStore.getMemberIds(guild.id),\n null,\n (old, curr) => old.length === curr.length\n );\n\n useEffect(() => {\n if (!fetched[type] && missing.length) {\n fetched[type] = true;\n FluxDispatcher.dispatch({\n type: \"GUILD_MEMBERS_REQUEST\",\n guildIds: [guild.id],\n userIds: missing\n });\n }\n }, []);\n\n useEffect(() => setCount(members.length), [members.length]);\n\n return (\n \n {members.map(id =>\n openUserProfile(id)}\n onContextMenu={() => { }}\n />\n )}\n \n );\n}\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { Menu } from \"@webpack/common\";\nimport { Guild } from \"discord-types/general\";\n\nimport { openGuildProfileModal } from \"./GuildProfileModal\";\n\nconst Patch: NavContextMenuPatchCallback = (children, { guild }: { guild: Guild; }) => () => {\n const group = findGroupChildrenByChildId(\"privacy\", children);\n\n group?.push(\n openGuildProfileModal(guild)}\n />\n );\n};\n\nexport default definePlugin({\n name: \"ServerProfile\",\n description: \"Allows you to view info about a server by right clicking it in the server list\",\n authors: [Devs.Ven, Devs.Nuckyz],\n tags: [\"guild\", \"info\"],\n\n start() {\n addContextMenuPatch([\"guild-context\", \"guild-header-popout\"], Patch);\n },\n\n stop() {\n removeContextMenuPatch([\"guild-context\", \"guild-header-popout\"], Patch);\n }\n});\n", "export default \"/* eslint-disable simple-header/header */\\nimport React from \\\"react\\\";\\n\\nconst handleClick = async () =>\\n console.log((await import(\\\"@webpack/common\\\")).Clipboard.copy(\\\"\\\\u200b\\\"));\\n\\nexport const Example: React.FC<{\\n real: boolean,\\n shigged?: number,\\n}> = ({ real, shigged }) => <>\\n

{`Shigg${real ? `ies${shigged === 0x1B ? \\\"t\\\" : \\\"\\\"}` : \\\"y\\\"}`}

\\n \\n;\\n\"", "'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Channel = exports.ChannelPort = void 0;\nconst eventemitter3_1 = require(\"eventemitter3\");\nconst ipcPrefix = 'vapIpc';\nconst kEdgeCreate = Symbol.for('vapIpc.edgeCreate');\n/** A port essentially a broadcast network for pipes,\n * meaning that emissions from one pipe are sent to all other pipes.\n */\nclass ChannelPort {\n _pipes = new Map();\n _listeners = new Map();\n _createListenerMap() {\n return new Map();\n }\n _emit(sourceName, event, ...data) {\n for (const [pipeName, listenerMap] of this._listeners.entries()) {\n if (pipeName === sourceName)\n continue;\n const listener = listenerMap.get(event);\n if (listener)\n listener(...data);\n }\n }\n createPipe(name) {\n const existingPipe = this.getPipe(name);\n if (existingPipe)\n return existingPipe;\n const listenerMap = this._createListenerMap();\n this._listeners.set(name, listenerMap);\n const pipe = {\n emit: this._emit.bind(this, name),\n listen: (event, fn) => void listenerMap.set(event, fn),\n };\n this._pipes.set(name, pipe);\n return pipe;\n }\n getPipe(name) {\n return this._pipes.get(name) ?? null;\n }\n}\nexports.ChannelPort = ChannelPort;\n/** A channel is a node in a decentralized ipc network.\n * Each channel can talk to other channels through pipes,\n * and channels identify each other through handshakes.\n * The handshake will also let other channels know which channels\n * they can redirect messages to.\n * This implementation does **NOT** account for [ring topologies](https://en.wikipedia.org/wiki/Ring_network).\n **/\nclass Channel {\n id;\n // TODO: better debug logs\n /** edge id -> edge */\n _edges = new Map();\n /** nonce -> callback */\n _callbacks = new Map();\n /** message name -> caller */\n _callers = new Map();\n /** edge id -> pipe */\n _edgePipes = new Map();\n _pipes = [];\n _emitter = new eventemitter3_1.EventEmitter();\n _logger;\n _destroyed = false;\n constructor(id) {\n this.id = id;\n }\n addPipe(pipe) {\n pipe.listen(`${ipcPrefix}:handshake`, (edge) => {\n this._handleHandshake(pipe, edge);\n });\n pipe.listen(`${ipcPrefix}:message`, (message) => {\n this._handleMessage(pipe, message);\n });\n this._pipes.push(pipe);\n this._logger?.log(`Adding pipe to channel \"${this.id}\"`);\n }\n setLogger(logger) {\n this._logger = logger;\n }\n _handleHandshake(pipe, edge) {\n if (this.id === edge.id)\n return;\n // TODO: improve the way channels store edges\n this._logger?.log(`\uD83E\uDD1D \"${edge.id}\" -> \"${this.id}\" (edges: [${edge.channelIds.join(', ')}])`);\n const prevEdge = this._edges.get(edge.id);\n if (prevEdge) {\n const newEdgeIds = edge.channelIds.filter((edgeId) => !prevEdge?.channelIds.includes(edgeId));\n if (newEdgeIds.includes(this.id)) {\n newEdgeIds.splice(newEdgeIds.indexOf(this.id), 1);\n }\n if (!newEdgeIds.length)\n return;\n this._edges.set(edge.id, {\n ...edge,\n channelIds: [...prevEdge.channelIds, ...newEdgeIds],\n });\n }\n else {\n const edgeIds = [...edge.channelIds].filter((edgeId) => edgeId !== this.id);\n this._edges.set(edge.id, {\n ...edge,\n channelIds: edgeIds,\n });\n this._edgePipes.set(edge.id, pipe);\n }\n this._emitter.emit(kEdgeCreate, edge);\n this.handshakeAll();\n }\n _handleMessage(pipe, message) {\n if (message.proxiedBy === this.id)\n return;\n if (message.destination !== this.id) {\n return this._emitMessage({\n ...message,\n proxiedBy: this.id,\n });\n }\n // Event\n if (!message.nonce)\n return void this._emitter.emit(message.name, message.data);\n // Response\n const callback = this._callbacks.get(message.nonce);\n if (callback)\n return void callback(message.data);\n // Call\n const caller = this._callers.get(message.name);\n if (caller) {\n caller(message.data)\n .catch((error) => {\n console.error(error);\n return new Error(error?.message ?? `${error}`);\n })\n .then((data) => {\n this._emitMessage({\n name: message.name,\n source: this.id,\n destination: message.source,\n data,\n nonce: message.nonce,\n });\n });\n return;\n }\n }\n _emitHandshake(pipe) {\n const edge = this.getEdge();\n pipe.emit(`${ipcPrefix}:handshake`, edge);\n }\n _emitMessage(message) {\n const edgeId = this.findEdgeId(message.destination);\n if (!edgeId)\n return; // TODO: bucket edge emissions until handshake?\n const pipe = this._edgePipes.get(edgeId);\n pipe?.emit(`${ipcPrefix}:message`, message);\n }\n getEdge() {\n const edgeIds = [\n ...this._edges.keys(),\n ...[...this._edges.values()].map((edge) => edge.channelIds).flat(),\n ].filter((id, index, arr) => arr.indexOf(id) === index);\n return {\n id: this.id,\n channelIds: edgeIds,\n };\n }\n findEdgeId(destinaton) {\n for (const edge of this._edges.values()) {\n if (edge.id === destinaton || edge.channelIds.includes(destinaton)) {\n return edge.id;\n }\n }\n return null;\n }\n waitForEdge(destination) {\n const edgeId = this.findEdgeId(destination);\n if (edgeId)\n return Promise.resolve(edgeId);\n return new Promise((resolve) => {\n const checkEdge = (edge) => {\n if (edge.id === destination || edge.channelIds.includes(destination)) {\n this._emitter.off(kEdgeCreate, checkEdge);\n resolve(edge.id);\n }\n };\n this._emitter.on(kEdgeCreate, checkEdge);\n });\n }\n createNonce() {\n return Math.random().toString(16).slice(2);\n }\n send(messageData) {\n this._emitMessage({\n ...messageData,\n source: this.id,\n });\n }\n call(messageData, opts = {\n timeout: 10000,\n }) {\n const nonce = this.createNonce();\n const promise = new Promise((resolve, reject) => {\n const timeout = setTimeout(() => {\n this._callbacks.delete(nonce);\n reject(new Error('Call timed out'));\n }, opts.timeout);\n this._callbacks.set(nonce, (data) => {\n this._callbacks.delete(nonce);\n clearTimeout(timeout);\n if (opts.signal?.aborted) {\n if (opts.signal.reason instanceof Error)\n reject(opts.signal.reason);\n }\n else {\n if (data instanceof Error)\n reject(data);\n else\n resolve(data);\n }\n });\n });\n this._emitMessage({\n ...messageData,\n source: this.id,\n nonce,\n });\n return promise;\n }\n on(name, fn) {\n this._emitter.on(name, fn);\n return this;\n }\n off(name, fn) {\n this._emitter.off(name, fn);\n return this;\n }\n once(name, fn) {\n this._emitter.once(name, fn);\n return;\n }\n onCall(name, caller) {\n this._callers.set(name, async (...data) => await caller(...data));\n }\n removeCaller() { }\n handshakeAll() {\n this._pipes.forEach((pipe) => this._emitHandshake(pipe));\n }\n destroy() {\n this._emitter.removeAllListeners();\n this._callbacks.clear();\n this._callers.clear();\n this._edgePipes.clear();\n this._pipes = [];\n this._destroyed = true;\n }\n}\nexports.Channel = Channel;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RemoteClient = exports.RemoteHost = void 0;\n/** An RPC host, can be connected to by multiple clients */\nclass RemoteHost {\n channel;\n constructor(channel, spec) {\n this.channel = channel;\n for (const [name, fn] of Object.entries(spec)) {\n channel.onCall(name, async (input) => {\n const result = await fn(...input);\n return result;\n });\n }\n channel.handshakeAll();\n }\n}\nexports.RemoteHost = RemoteHost;\nclass RemoteClient {\n hostName;\n channel;\n constructor(hostName, channel) {\n this.hostName = hostName;\n this.channel = channel;\n }\n async connect() {\n await this.channel.waitForEdge(this.hostName);\n }\n run(name, ...output) {\n return this.channel.call({\n name,\n destination: this.hostName,\n data: output,\n });\n }\n}\nexports.RemoteClient = RemoteClient;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkerClient = exports.createWorkerHost = void 0;\nconst channel_1 = require(\"./channel\");\nconst rpc_1 = require(\"./rpc\");\nconst createWorkerHost = (name, spec) => {\n const channel = new channel_1.Channel(name);\n channel.addPipe({\n emit: (event, data) => postMessage({ event, data }),\n listen: (event, callback) => addEventListener('message', ({ data }) => {\n if (data.event === event)\n callback(data.data);\n }),\n });\n return new rpc_1.RemoteHost(channel, spec);\n};\nexports.createWorkerHost = createWorkerHost;\nclass WorkerClient extends rpc_1.RemoteClient {\n workerOpts;\n worker;\n workerListeners = [];\n url;\n constructor(name, hostName, source, workerOpts = {}) {\n const channel = new channel_1.Channel(name);\n super(hostName, channel);\n this.workerOpts = workerOpts;\n if (source instanceof Blob) {\n const blob = new Blob([source], { type: 'text/javascript' });\n this.url = URL.createObjectURL(blob);\n }\n else\n this.url = source;\n }\n async init() {\n const worker = (this.worker = new Worker(this.url, this.workerOpts));\n this.channel.addPipe({\n emit: (event, data) => worker.postMessage({ event, data }),\n listen: (event, callback) => {\n const listener = (ev) => {\n const { event: evName, data } = ev.data;\n if (evName === event)\n callback(data);\n };\n this.workerListeners.push(listener);\n worker.addEventListener('message', listener);\n },\n });\n await this.connect();\n }\n destroy() {\n if (this.worker) {\n for (const listener of this.workerListeners)\n this.worker.removeEventListener('message', listener);\n this.worker.terminate();\n }\n this.channel.destroy();\n if (this.url.startsWith('blob:'))\n URL.revokeObjectURL(this.url);\n }\n}\nexports.WorkerClient = WorkerClient;\n", "\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./channel\"), exports);\n__exportStar(require(\"./rpc\"), exports);\n__exportStar(require(\"./worker\"), exports);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { React } from \"@webpack/common\";\n\ntype Shiki = typeof import(\"../api/shiki\").shiki;\ninterface ThemeState {\n id: Shiki[\"currentThemeUrl\"],\n theme: Shiki[\"currentTheme\"],\n}\n\nconst currentTheme: ThemeState = {\n id: null,\n theme: null,\n};\n\nconst themeSetters = new Set>>();\n\nexport const useTheme = (): ThemeState => {\n const [, setTheme] = React.useState(currentTheme);\n\n React.useEffect(() => {\n themeSetters.add(setTheme);\n return () => void themeSetters.delete(setTheme);\n }, []);\n\n return currentTheme;\n};\n\nexport function dispatchTheme(state: ThemeState) {\n if (currentTheme.id === state.id) return;\n Object.assign(currentTheme, state);\n themeSetters.forEach(setTheme => setTheme(state));\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ILanguageRegistration } from \"@vap/shiki\";\n\nexport const VPC_REPO = \"Vap0r1ze/vapcord\";\nexport const VPC_REPO_COMMIT = \"88a7032a59cca40da170926651b08201ea3b965a\";\nexport const vpcRepoAssets = `https://raw.githubusercontent.com/${VPC_REPO}/${VPC_REPO_COMMIT}/assets/shiki-codeblocks`;\nexport const vpcRepoGrammar = (fileName: string) => `${vpcRepoAssets}/${fileName}`;\nexport const vpcRepoLanguages = `${vpcRepoAssets}/languages.json`;\n\nexport interface Language {\n name: string;\n id: string;\n devicon?: string;\n grammarUrl: string,\n grammar?: ILanguageRegistration[\"grammar\"];\n scopeName: string;\n aliases?: string[];\n custom?: boolean;\n}\nexport interface LanguageJson {\n name: string;\n id: string;\n fileName: string;\n devicon?: string;\n scopeName: string;\n aliases?: string[];\n}\n\nexport const languages: Record = {};\n\nexport const loadLanguages = async () => {\n const langsJson: LanguageJson[] = await fetch(vpcRepoLanguages).then(res => res.json());\n const loadedLanguages = Object.fromEntries(\n langsJson.map(lang => [lang.id, {\n ...lang,\n grammarUrl: vpcRepoGrammar(lang.fileName),\n }])\n );\n Object.assign(languages, loadedLanguages);\n};\n\nexport const getGrammar = (lang: Language): Promise> => {\n if (lang.grammar) return Promise.resolve(lang.grammar);\n return fetch(lang.grammarUrl).then(res => res.json());\n};\n\nconst aliasCache = new Map();\nexport function resolveLang(idOrAlias: string) {\n if (Object.prototype.hasOwnProperty.call(languages, idOrAlias)) return languages[idOrAlias];\n\n const lang = Object.values(languages).find(lang => lang.aliases?.includes(idOrAlias));\n\n if (!lang) return null;\n\n aliasCache.set(idOrAlias, lang);\n return lang;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { IShikiTheme } from \"@vap/shiki\";\n\nexport const SHIKI_REPO = \"shikijs/shiki\";\nexport const SHIKI_REPO_COMMIT = \"0b28ad8ccfbf2615f2d9d38ea8255416b8ac3043\";\nexport const shikiRepoTheme = (name: string) => `https://raw.githubusercontent.com/${SHIKI_REPO}/${SHIKI_REPO_COMMIT}/packages/shiki/themes/${name}.json`;\n\nexport const themes = {\n // Default\n DarkPlus: shikiRepoTheme(\"dark-plus\"),\n\n // Dev Choices\n MaterialCandy: \"https://raw.githubusercontent.com/millsp/material-candy/master/material-candy.json\",\n\n // More from Shiki repo\n DraculaSoft: shikiRepoTheme(\"dracula-soft\"),\n Dracula: shikiRepoTheme(\"dracula\"),\n GithubDarkDimmed: shikiRepoTheme(\"github-dark-dimmed\"),\n GithubDark: shikiRepoTheme(\"github-dark\"),\n GithubLight: shikiRepoTheme(\"github-light\"),\n LightPlus: shikiRepoTheme(\"light-plus\"),\n MaterialDarker: shikiRepoTheme(\"material-darker\"),\n MaterialDefault: shikiRepoTheme(\"material-default\"),\n MaterialLighter: shikiRepoTheme(\"material-lighter\"),\n MaterialOcean: shikiRepoTheme(\"material-ocean\"),\n MaterialPalenight: shikiRepoTheme(\"material-palenight\"),\n MinDark: shikiRepoTheme(\"min-dark\"),\n MinLight: shikiRepoTheme(\"min-light\"),\n Monokai: shikiRepoTheme(\"monokai\"),\n Nord: shikiRepoTheme(\"nord\"),\n OneDarkPro: shikiRepoTheme(\"one-dark-pro\"),\n Poimandres: shikiRepoTheme(\"poimandres\"),\n RosePineDawn: shikiRepoTheme(\"rose-pine-dawn\"),\n RosePineMoon: shikiRepoTheme(\"rose-pine-moon\"),\n RosePine: shikiRepoTheme(\"rose-pine\"),\n SlackDark: shikiRepoTheme(\"slack-dark\"),\n SlackOchin: shikiRepoTheme(\"slack-ochin\"),\n SolarizedDark: shikiRepoTheme(\"solarized-dark\"),\n SolarizedLight: shikiRepoTheme(\"solarized-light\"),\n VitesseDark: shikiRepoTheme(\"vitesse-dark\"),\n VitesseLight: shikiRepoTheme(\"vitesse-light\"),\n CssVariables: shikiRepoTheme(\"css-variables\"),\n};\n\nexport const themeCache = new Map();\n\nexport const getTheme = (url: string): Promise => {\n if (themeCache.has(url)) return Promise.resolve(themeCache.get(url)!);\n return fetch(url).then(res => res.json());\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { shikiOnigasmSrc, shikiWorkerSrc } from \"@utils/dependencies\";\nimport { WorkerClient } from \"@vap/core/ipc\";\nimport type { IShikiTheme, IThemedToken } from \"@vap/shiki\";\n\nimport { dispatchTheme } from \"../hooks/useTheme\";\nimport type { ShikiSpec } from \"../types\";\nimport { getGrammar, languages, loadLanguages, resolveLang } from \"./languages\";\nimport { themes } from \"./themes\";\n\nconst themeUrls = Object.values(themes);\n\nlet resolveClient: (client: WorkerClient) => void;\n\nexport const shiki = {\n client: null as WorkerClient | null,\n currentTheme: null as IShikiTheme | null,\n currentThemeUrl: null as string | null,\n timeoutMs: 10000,\n languages,\n themes,\n loadedThemes: new Set(),\n loadedLangs: new Set(),\n clientPromise: new Promise>(resolve => resolveClient = resolve),\n\n init: async (initThemeUrl: string | undefined) => {\n /** https://stackoverflow.com/q/58098143 */\n const workerBlob = await fetch(shikiWorkerSrc).then(res => res.blob());\n\n const client = shiki.client = new WorkerClient(\n \"shiki-client\",\n \"shiki-host\",\n workerBlob,\n { name: \"ShikiWorker\" },\n );\n await client.init();\n\n const themeUrl = initThemeUrl || themeUrls[0];\n\n await loadLanguages();\n await client.run(\"setOnigasm\", { wasm: shikiOnigasmSrc });\n await client.run(\"setHighlighter\", { theme: themeUrl, langs: [] });\n shiki.loadedThemes.add(themeUrl);\n await shiki._setTheme(themeUrl);\n resolveClient(client);\n },\n _setTheme: async (themeUrl: string) => {\n shiki.currentThemeUrl = themeUrl;\n const { themeData } = await shiki.client!.run(\"getTheme\", { theme: themeUrl });\n shiki.currentTheme = JSON.parse(themeData);\n dispatchTheme({ id: themeUrl, theme: shiki.currentTheme });\n },\n loadTheme: async (themeUrl: string) => {\n const client = await shiki.clientPromise;\n if (shiki.loadedThemes.has(themeUrl)) return;\n\n await client.run(\"loadTheme\", { theme: themeUrl });\n\n shiki.loadedThemes.add(themeUrl);\n },\n setTheme: async (themeUrl: string) => {\n await shiki.clientPromise;\n themeUrl ||= themeUrls[0];\n if (!shiki.loadedThemes.has(themeUrl)) await shiki.loadTheme(themeUrl);\n\n await shiki._setTheme(themeUrl);\n },\n loadLang: async (langId: string) => {\n const client = await shiki.clientPromise;\n const lang = resolveLang(langId);\n\n if (!lang || shiki.loadedLangs.has(lang.id)) return;\n\n await client.run(\"loadLanguage\", {\n lang: {\n ...lang,\n grammar: lang.grammar ?? await getGrammar(lang),\n }\n });\n shiki.loadedLangs.add(lang.id);\n },\n tokenizeCode: async (code: string, langId: string): Promise => {\n const client = await shiki.clientPromise;\n const lang = resolveLang(langId);\n if (!lang) return [];\n\n if (!shiki.loadedLangs.has(lang.id)) await shiki.loadLang(lang.id);\n\n return await client.run(\"codeToThemedTokens\", {\n code,\n lang: langId,\n theme: shiki.currentThemeUrl ?? themeUrls[0],\n });\n },\n destroy() {\n shiki.currentTheme = null;\n shiki.currentThemeUrl = null;\n dispatchTheme({ id: null, theme: null });\n shiki.client?.destroy();\n }\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n(window.VencordStyles ??= new Map()).set(\"src/plugins/shikiCodeblocks.desktop/devicon.css\", {\n name: \"src/plugins/shikiCodeblocks.desktop/devicon.css\",\n source: \"@import url(\\\"https://cdn.jsdelivr.net/gh/devicons/devicon@v2.10.1/devicon.min.css\\\");\\n\",\n classNames: {},\n dom: null,\n});\n\nexport default \"src/plugins/shikiCodeblocks.desktop/devicon.css\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type {\n ILanguageRegistration,\n IShikiTheme,\n IThemedToken,\n IThemeRegistration,\n} from \"@vap/shiki\";\n\n/** This must be atleast a subset of the `@vap/shiki-worker` spec */\nexport type ShikiSpec = {\n setOnigasm: ({ wasm }: { wasm: string; }) => Promise;\n setHighlighter: ({ theme, langs }: {\n theme: IThemeRegistration | void;\n langs: ILanguageRegistration[];\n }) => Promise;\n loadTheme: ({ theme }: {\n theme: string | IShikiTheme;\n }) => Promise;\n getTheme: ({ theme }: { theme: string; }) => Promise<{ themeData: string; }>;\n loadLanguage: ({ lang }: { lang: ILanguageRegistration; }) => Promise;\n codeToThemedTokens: ({\n code,\n lang,\n theme,\n }: {\n code: string;\n lang?: string;\n theme?: string;\n }) => Promise;\n};\n\nexport const enum StyleSheets {\n Main = \"MAIN\",\n DevIcons = \"DEVICONS\",\n}\n\nexport const enum HljsSetting {\n Never = \"NEVER\",\n Secondary = \"SECONDARY\",\n Primary = \"PRIMARY\",\n Always = \"ALWAYS\",\n}\nexport const enum DeviconSetting {\n Disabled = \"DISABLED\",\n Greyscale = \"GREYSCALE\",\n Color = \"COLOR\"\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { disableStyle, enableStyle } from \"@api/Styles\";\nimport { parseUrl } from \"@utils/misc\";\nimport { wordsFromPascal, wordsToTitle } from \"@utils/text\";\nimport { OptionType } from \"@utils/types\";\n\nimport { shiki } from \"./api/shiki\";\nimport { themes } from \"./api/themes\";\nimport deviconStyle from \"./devicon.css?managed\";\nimport { DeviconSetting, HljsSetting } from \"./types\";\n\nconst themeNames = Object.keys(themes) as (keyof typeof themes)[];\n\nexport type ShikiSettings = typeof settings.store;\nexport const settings = definePluginSettings({\n theme: {\n type: OptionType.SELECT,\n description: \"Default themes\",\n options: themeNames.map(themeName => ({\n label: wordsToTitle(wordsFromPascal(themeName)),\n value: themes[themeName],\n default: themes[themeName] === themes.DarkPlus,\n })),\n onChange: shiki.setTheme,\n },\n customTheme: {\n type: OptionType.STRING,\n description: \"A link to a custom vscode theme\",\n placeholder: themes.MaterialCandy,\n onChange: value => {\n shiki.setTheme(value || settings.store.theme);\n },\n },\n tryHljs: {\n type: OptionType.SELECT,\n description: \"Use the more lightweight default Discord highlighter and theme.\",\n options: [\n {\n label: \"Never\",\n value: HljsSetting.Never,\n },\n {\n label: \"Prefer Shiki instead of Highlight.js\",\n value: HljsSetting.Secondary,\n default: true,\n },\n {\n label: \"Prefer Highlight.js instead of Shiki\",\n value: HljsSetting.Primary,\n },\n {\n label: \"Always\",\n value: HljsSetting.Always,\n },\n ],\n },\n useDevIcon: {\n type: OptionType.SELECT,\n description: \"How to show language icons on codeblocks\",\n options: [\n {\n label: \"Disabled\",\n value: DeviconSetting.Disabled,\n },\n {\n label: \"Colorless\",\n value: DeviconSetting.Greyscale,\n default: true,\n },\n {\n label: \"Colored\",\n value: DeviconSetting.Color,\n },\n ],\n onChange: (newValue: DeviconSetting) => {\n if (newValue === DeviconSetting.Disabled) disableStyle(deviconStyle);\n else enableStyle(deviconStyle);\n },\n },\n bgOpacity: {\n type: OptionType.SLIDER,\n description: \"Background opacity\",\n markers: [0, 20, 40, 60, 80, 100],\n default: 100,\n componentProps: {\n stickToMarkers: false,\n onValueRender: null, // Defaults to percentage\n },\n },\n}, {\n theme: {\n disabled() { return !!this.store.customTheme; },\n },\n customTheme: {\n isValid(value) {\n if (!value) return true;\n const url = parseUrl(value);\n if (!url) return \"Must be a valid URL\";\n\n if (!url.pathname.endsWith(\".json\")) return \"Must be a json file\";\n\n return true;\n },\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PartialExcept } from \"@utils/types\";\nimport { React } from \"@webpack/common\";\n\nimport { shiki } from \"../api/shiki\";\nimport { settings as pluginSettings, ShikiSettings } from \"../settings\";\n\nexport function useShikiSettings(settingKeys: F[], overrides?: Partial) {\n const settings: Partial = pluginSettings.use(settingKeys);\n const [isLoading, setLoading] = React.useState(false);\n\n const withOverrides = { ...settings, ...overrides } as PartialExcept;\n const themeUrl = withOverrides.customTheme || withOverrides.theme;\n\n if (overrides) {\n const willChangeTheme = shiki.currentThemeUrl && themeUrl && themeUrl !== shiki.currentThemeUrl;\n const noOverrides = Object.keys(overrides).length === 0;\n\n if (isLoading && (!willChangeTheme || noOverrides)) setLoading(false);\n if (!isLoading && willChangeTheme) {\n setLoading(true);\n shiki.setTheme(themeUrl);\n }\n }\n\n return {\n ...withOverrides,\n isThemeLoading: themeUrl !== shiki.currentThemeUrl,\n };\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function hex2Rgb(hex: string) {\n hex = hex.slice(1);\n if (hex.length < 6)\n hex = hex\n .split(\"\")\n .map(c => c + c)\n .join(\"\");\n if (hex.length === 6) hex += \"ff\";\n if (hex.length > 6) hex = hex.slice(0, 6);\n return hex\n .split(/(..)/)\n .filter(Boolean)\n .map(c => parseInt(c, 16));\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { classNameFactory } from \"@api/Styles\";\nimport { hljs } from \"@webpack/common\";\n\nimport { resolveLang } from \"../api/languages\";\nimport { HighlighterProps } from \"../components/Highlighter\";\nimport { HljsSetting } from \"../types\";\n\nexport const cl = classNameFactory(\"shiki-\");\n\nexport const shouldUseHljs = ({\n lang,\n tryHljs,\n}: {\n lang: HighlighterProps[\"lang\"],\n tryHljs: HljsSetting,\n}) => {\n const hljsLang = lang ? hljs?.getLanguage?.(lang) : null;\n const shikiLang = lang ? resolveLang(lang) : null;\n const langName = shikiLang?.name;\n\n switch (tryHljs) {\n case HljsSetting.Always:\n return true;\n case HljsSetting.Primary:\n return !!hljsLang || lang === \"\";\n case HljsSetting.Secondary:\n return !langName && !!hljsLang;\n case HljsSetting.Never:\n return false;\n default: return false;\n }\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Clipboard, React } from \"@webpack/common\";\n\nexport function useCopyCooldown(cooldown: number) {\n const [copyCooldown, setCopyCooldown] = React.useState(false);\n\n function copy(text: string) {\n Clipboard.copy(text);\n setCopyCooldown(true);\n\n setTimeout(() => {\n setCopyCooldown(false);\n }, cooldown);\n }\n\n return [copyCooldown, copy] as const;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { useCopyCooldown } from \"../hooks/useCopyCooldown\";\n\nexport interface CopyButtonProps extends React.DetailedHTMLProps, HTMLButtonElement> {\n content: string;\n}\n\nexport function CopyButton({ content, ...props }: CopyButtonProps) {\n const [copyCooldown, copy] = useCopyCooldown(1000);\n\n return (\n copy(content)}\n >\n {copyCooldown ? \"Copied!\" : \"Copy\"}\n \n\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Clipboard } from \"@webpack/common\";\n\nimport { cl } from \"../utils/misc\";\nimport { CopyButton } from \"./CopyButton\";\n\nexport interface ButtonRowProps {\n theme: import(\"./Highlighter\").ThemeBase;\n content: string;\n}\n\nexport function ButtonRow({ content, theme }: ButtonRowProps) {\n const buttons: JSX.Element[] = [];\n\n if (Clipboard.SUPPORTS_COPY) {\n buttons.push(\n \n );\n }\n\n return
{buttons}
;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { IThemedToken } from \"@vap/shiki\";\nimport { hljs } from \"@webpack/common\";\n\nimport { cl } from \"../utils/misc\";\nimport { ThemeBase } from \"./Highlighter\";\n\nexport interface CodeProps {\n theme: ThemeBase;\n useHljs: boolean;\n lang?: string;\n content: string;\n tokens: IThemedToken[][] | null;\n}\n\nexport const Code = ({\n theme,\n useHljs,\n lang,\n content,\n tokens,\n}: CodeProps) => {\n let lines!: JSX.Element[];\n\n if (useHljs) {\n try {\n const { value: hljsHtml } = hljs.highlight(lang!, content, true);\n lines = hljsHtml\n .split(\"\\n\")\n .map((line, i) => );\n } catch {\n lines = content.split(\"\\n\").map(line => {line});\n }\n } else {\n const renderTokens =\n tokens ??\n content\n .split(\"\\n\")\n .map(line => [{ color: theme.plainColor, content: line } as IThemedToken]);\n\n lines = renderTokens.map(line => {\n // [Cynthia] this makes it so when you highlight the codeblock\n // empty lines are also selected and copied when you Ctrl+C.\n if (line.length === 0) {\n return {\"\\n\"};\n }\n\n return (\n <>\n {line.map(({ content, color, fontStyle }, i) => (\n \n {content}\n \n ))}\n \n );\n });\n }\n\n const codeTableRows = lines.map((line, i) => (\n \n {i + 1}\n {line}\n \n ));\n\n return {...codeTableRows}
;\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Language } from \"../api/languages\";\nimport { DeviconSetting } from \"../types\";\nimport { cl } from \"../utils/misc\";\n\nexport interface HeaderProps {\n langName?: string;\n useDevIcon: DeviconSetting;\n shikiLang: Language | null;\n}\n\nexport function Header({ langName, useDevIcon, shikiLang }: HeaderProps) {\n if (!langName) return <>;\n\n return (\n
\n {useDevIcon !== DeviconSetting.Disabled && shikiLang?.devicon && (\n \n )}\n {langName}\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { useAwaiter, useIntersection } from \"@utils/react\";\nimport { hljs, React } from \"@webpack/common\";\n\nimport { resolveLang } from \"../api/languages\";\nimport { shiki } from \"../api/shiki\";\nimport { useShikiSettings } from \"../hooks/useShikiSettings\";\nimport { useTheme } from \"../hooks/useTheme\";\nimport { hex2Rgb } from \"../utils/color\";\nimport { cl, shouldUseHljs } from \"../utils/misc\";\nimport { ButtonRow } from \"./ButtonRow\";\nimport { Code } from \"./Code\";\nimport { Header } from \"./Header\";\n\nexport interface ThemeBase {\n plainColor: string;\n accentBgColor: string;\n accentFgColor: string;\n backgroundColor: string;\n}\n\nexport interface HighlighterProps {\n lang?: string;\n content: string;\n isPreview: boolean;\n tempSettings?: Record;\n}\n\nexport const createHighlighter = (props: HighlighterProps) => (\n
\n        \n            \n        \n    
\n);\nexport const Highlighter = ({\n lang,\n content,\n isPreview,\n tempSettings,\n}: HighlighterProps) => {\n const {\n tryHljs,\n useDevIcon,\n bgOpacity,\n } = useShikiSettings([\"tryHljs\", \"useDevIcon\", \"bgOpacity\"], tempSettings);\n const { id: currentThemeId, theme: currentTheme } = useTheme();\n\n const shikiLang = lang ? resolveLang(lang) : null;\n const useHljs = shouldUseHljs({ lang, tryHljs });\n\n const [rootRef, isIntersecting] = useIntersection(true);\n\n const [tokens] = useAwaiter(async () => {\n if (!shikiLang || useHljs || !isIntersecting) return null;\n return await shiki.tokenizeCode(content, lang!);\n }, {\n fallbackValue: null,\n deps: [lang, content, currentThemeId, isIntersecting],\n });\n\n const themeBase: ThemeBase = {\n plainColor: currentTheme?.fg || \"var(--text-normal)\",\n accentBgColor:\n currentTheme?.colors?.[\"statusBar.background\"] || (useHljs ? \"#7289da\" : \"#007BC8\"),\n accentFgColor: currentTheme?.colors?.[\"statusBar.foreground\"] || \"#FFF\",\n backgroundColor:\n currentTheme?.colors?.[\"editor.background\"] || \"var(--background-secondary)\",\n };\n\n let langName;\n if (lang) langName = useHljs ? hljs?.getLanguage?.(lang)?.name : shikiLang?.name;\n\n return (\n \n \n \n \n {!isPreview && }\n \n \n );\n};\n\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nconst styles = new Map();\n\nexport function setStyle(css: string, id: string) {\n const style = document.createElement(\"style\");\n style.innerText = css;\n document.head.appendChild(style);\n styles.set(id, style);\n}\n\nexport function removeStyle(id: string) {\n styles.get(id)?.remove();\n return styles.delete(id);\n}\n\nexport const clearStyles = () => {\n styles.forEach(style => style.remove());\n styles.clear();\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./shiki.css\";\n\nimport { enableStyle } from \"@api/Styles\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nimport previewExampleText from \"~fileContent/previewExample.tsx\";\n\nimport { shiki } from \"./api/shiki\";\nimport { createHighlighter } from \"./components/Highlighter\";\nimport deviconStyle from \"./devicon.css?managed\";\nimport { settings } from \"./settings\";\nimport { DeviconSetting } from \"./types\";\nimport { clearStyles } from \"./utils/createStyle\";\n\nexport default definePlugin({\n name: \"ShikiCodeblocks\",\n description: \"Brings vscode-style codeblocks into Discord, powered by Shiki\",\n authors: [Devs.Vap],\n patches: [\n {\n find: \"codeBlock:{react(\",\n replacement: {\n match: /codeBlock:\\{react\\((\\i),(\\i),(\\i)\\)\\{/,\n replace: \"$&return $self.renderHighlighter($1,$2,$3);\"\n }\n }\n ],\n start: async () => {\n if (settings.store.useDevIcon !== DeviconSetting.Disabled)\n enableStyle(deviconStyle);\n\n await shiki.init(settings.store.customTheme || settings.store.theme);\n },\n stop: () => {\n shiki.destroy();\n clearStyles();\n },\n settingsAboutComponent: ({ tempSettings }) => createHighlighter({\n lang: \"tsx\",\n content: previewExampleText,\n isPreview: true,\n tempSettings,\n }),\n settings,\n\n // exports\n shiki,\n createHighlighter,\n renderHighlighter: ({ lang, content }: { lang: string; content: string; }) => {\n return createHighlighter({\n lang,\n content,\n isPreview: false,\n });\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"ShowAllMessageButtons\",\n description: \"Always show all message buttons no matter if you are holding the shift key or not.\",\n authors: [Devs.Nuckyz],\n\n patches: [\n {\n find: \".Messages.MESSAGE_UTILITIES_A11Y_LABEL\",\n replacement: {\n match: /isExpanded:\\i&&(.+?),/,\n replace: \"isExpanded:$1,\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { LazyComponent } from \"@utils/react\";\nimport { findByCode, findLazy } from \"@webpack\";\nimport { i18n, useToken } from \"@webpack/common\";\n\nconst ColorMap = findLazy(m => m.colors?.INTERACTIVE_MUTED?.css);\nconst VerifiedIconComponent = LazyComponent(() => findByCode(\".CONNECTIONS_ROLE_OFFICIAL_ICON_TOOLTIP\"));\n\nexport function VerifiedIcon() {\n const color = useToken(ColorMap.colors.INTERACTIVE_MUTED).hex();\n const forcedIconColor = useToken(ColorMap.colors.INTERACTIVE_ACTIVE).hex();\n\n return (\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { CopyIcon, LinkIcon } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport { copyWithToast } from \"@utils/misc\";\nimport { LazyComponent } from \"@utils/react\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByCode, findByCodeLazy, findByPropsLazy, findStoreLazy } from \"@webpack\";\nimport { Text, Tooltip, UserProfileStore } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\n\nimport { VerifiedIcon } from \"./VerifiedIcon\";\n\nconst Section = LazyComponent(() => findByCode(\".lastSection]:\"));\nconst ThemeStore = findStoreLazy(\"ThemeStore\");\nconst platforms: { get(type: string): ConnectionPlatform; } = findByPropsLazy(\"isSupported\", \"getByUrl\");\nconst getTheme: (user: User, displayProfile: any) => any = findByCodeLazy(',\"--profile-gradient-primary-color\"');\n\nconst enum Spacing {\n COMPACT,\n COZY,\n ROOMY\n}\nconst getSpacingPx = (spacing: Spacing | undefined) => (spacing ?? Spacing.COMPACT) * 2 + 4;\n\nconst settings = definePluginSettings({\n iconSize: {\n type: OptionType.NUMBER,\n description: \"Icon size (px)\",\n default: 32\n },\n iconSpacing: {\n type: OptionType.SELECT,\n description: \"Icon margin\",\n default: Spacing.COZY,\n options: [\n { label: \"Compact\", value: Spacing.COMPACT },\n { label: \"Cozy\", value: Spacing.COZY }, // US Spelling :/\n { label: \"Roomy\", value: Spacing.ROOMY }\n ]\n }\n});\n\ninterface Connection {\n type: string;\n id: string;\n name: string;\n verified: boolean;\n}\n\ninterface ConnectionPlatform {\n getPlatformUserUrl(connection: Connection): string;\n icon: { lightSVG: string, darkSVG: string; };\n}\n\nconst profilePopoutComponent = ErrorBoundary.wrap(({ user, displayProfile }: { user: User, displayProfile; }) =>\n \n);\n\nconst profilePanelComponent = ErrorBoundary.wrap(({ id }: { id: string; }) =>\n \n);\n\nfunction ConnectionsComponent({ id, theme }: { id: string, theme: string; }) {\n const profile = UserProfileStore.getUserProfile(id);\n if (!profile)\n return null;\n\n const connections: Connection[] = profile.connectedAccounts;\n if (!connections?.length)\n return null;\n\n return (\n
\n \n Connections\n \n \n {connections.map(connection => )}\n \n
\n );\n}\n\nfunction CompactConnectionComponent({ connection, theme }: { connection: Connection, theme: string; }) {\n const platform = platforms.get(connection.type);\n const url = platform.getPlatformUserUrl?.(connection);\n\n const img = (\n \n );\n\n const TooltipIcon = url ? LinkIcon : CopyIcon;\n\n return (\n \n {connection.name}\n {connection.verified && }\n \n \n }\n key={connection.id}\n >\n {tooltipProps =>\n url\n ? {\n if (Vencord.Plugins.isPluginEnabled(\"OpenInApp\")) {\n const OpenInApp = Vencord.Plugins.plugins.OpenInApp as any as typeof import(\"../openInApp\").default;\n // handleLink will .preventDefault() if applicable\n OpenInApp.handleLink(e.currentTarget, e);\n }\n }}\n >\n {img}\n \n : copyWithToast(connection.name)}\n >\n {img}\n \n\n }\n \n );\n}\n\nexport default definePlugin({\n name: \"ShowConnections\",\n description: \"Show connected accounts in user popouts\",\n authors: [Devs.TheKodeToad],\n patches: [\n {\n find: \"{isUsingGuildBio:null!==(\",\n replacement: {\n match: /,theme:\\i\\}\\)(?=,.{0,150}setNote:)/,\n replace: \"$&,$self.profilePopoutComponent({ user: arguments[0].user, displayProfile: arguments[0].displayProfile })\"\n }\n },\n {\n find: \"\\\"Profile Panel: user cannot be undefined\\\"\",\n replacement: {\n // createElement(Divider, {}), createElement(NoteComponent)\n match: /\\(0,\\i\\.jsx\\)\\(\\i\\.\\i,\\{\\}\\).{0,100}setNote:(?=.+?channelId:(\\i).id)/,\n replace: \"$self.profilePanelComponent({ id: $1.recipients[0] }),$&\"\n }\n }\n ],\n settings,\n profilePopoutComponent,\n profilePanelComponent\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { LazyComponent } from \"@utils/react\";\nimport { formatDuration } from \"@utils/text\";\nimport { find, findByCode, findByPropsLazy } from \"@webpack\";\nimport { EmojiStore, FluxDispatcher, GuildMemberStore, GuildStore, moment, Parser, PermissionsBits, PermissionStore, SnowflakeUtils, Text, Timestamp, Tooltip, useEffect, useState } from \"@webpack/common\";\nimport type { Channel } from \"discord-types/general\";\n\nimport openRolesAndUsersPermissionsModal, { PermissionType, RoleOrUserPermission } from \"../../permissionsViewer/components/RolesAndUsersPermissions\";\nimport { sortPermissionOverwrites } from \"../../permissionsViewer/utils\";\nimport { settings } from \"..\";\n\nconst enum SortOrderTypes {\n LATEST_ACTIVITY = 0,\n CREATION_DATE = 1\n}\n\nconst enum ForumLayoutTypes {\n DEFAULT = 0,\n LIST = 1,\n GRID = 2\n}\n\ninterface DefaultReaction {\n emojiId: string | null;\n emojiName: string | null;\n}\n\ninterface Tag {\n id: string;\n name: string;\n emojiId: string | null;\n emojiName: string | null;\n moderated: boolean;\n}\n\ninterface ExtendedChannel extends Channel {\n defaultThreadRateLimitPerUser?: number;\n defaultSortOrder?: SortOrderTypes | null;\n defaultForumLayout?: ForumLayoutTypes;\n defaultReactionEmoji?: DefaultReaction | null;\n availableTags?: Array;\n}\n\nconst enum ChannelTypes {\n GUILD_TEXT = 0,\n GUILD_VOICE = 2,\n GUILD_ANNOUNCEMENT = 5,\n GUILD_STAGE_VOICE = 13,\n GUILD_FORUM = 15\n}\n\nconst enum VideoQualityModes {\n AUTO = 1,\n FULL = 2\n}\n\nconst enum ChannelFlags {\n PINNED = 1 << 1,\n REQUIRE_TAG = 1 << 4\n}\n\n\nconst ChatScrollClasses = findByPropsLazy(\"auto\", \"content\", \"scrollerBase\");\nconst ChatClasses = findByPropsLazy(\"chat\", \"content\", \"noChat\", \"chatContent\");\nconst ChannelBeginHeader = LazyComponent(() => findByCode(\".Messages.ROLE_REQUIRED_SINGLE_USER_MESSAGE\"));\nconst TagComponent = LazyComponent(() => find(m => {\n if (typeof m !== \"function\") return false;\n\n const code = Function.prototype.toString.call(m);\n // Get the component which doesn't include increasedActivity\n return code.includes(\".Messages.FORUM_TAG_A11Y_FILTER_BY_TAG\") && !code.includes(\"increasedActivityPill\");\n}));\n\nconst EmojiParser = findByPropsLazy(\"convertSurrogateToName\");\nconst EmojiUtils = findByPropsLazy(\"getURL\", \"buildEmojiReactionColorsPlatformed\");\n\nconst ChannelTypesToChannelNames = {\n [ChannelTypes.GUILD_TEXT]: \"text\",\n [ChannelTypes.GUILD_ANNOUNCEMENT]: \"announcement\",\n [ChannelTypes.GUILD_FORUM]: \"forum\",\n [ChannelTypes.GUILD_VOICE]: \"voice\",\n [ChannelTypes.GUILD_STAGE_VOICE]: \"stage\"\n};\n\nconst SortOrderTypesToNames = {\n [SortOrderTypes.LATEST_ACTIVITY]: \"Latest activity\",\n [SortOrderTypes.CREATION_DATE]: \"Creation date\"\n};\n\nconst ForumLayoutTypesToNames = {\n [ForumLayoutTypes.DEFAULT]: \"Not set\",\n [ForumLayoutTypes.LIST]: \"List view\",\n [ForumLayoutTypes.GRID]: \"Gallery view\"\n};\n\nconst VideoQualityModesToNames = {\n [VideoQualityModes.AUTO]: \"Automatic\",\n [VideoQualityModes.FULL]: \"720p\"\n};\n\n// Icon from the modal when clicking a message link you don't have access to view\nconst HiddenChannelLogo = \"/assets/433e3ec4319a9d11b0cbe39342614982.svg\";\n\nfunction HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) {\n const [viewAllowedUsersAndRoles, setViewAllowedUsersAndRoles] = useState(settings.store.defaultAllowedUsersAndRolesDropdownState);\n const [permissions, setPermissions] = useState([]);\n\n const {\n type,\n topic,\n lastMessageId,\n defaultForumLayout,\n lastPinTimestamp,\n defaultAutoArchiveDuration,\n availableTags,\n id: channelId,\n rateLimitPerUser,\n defaultThreadRateLimitPerUser,\n defaultSortOrder,\n defaultReactionEmoji,\n bitrate,\n rtcRegion,\n videoQualityMode,\n permissionOverwrites,\n guild_id\n } = channel;\n\n useEffect(() => {\n const membersToFetch: Array = [];\n\n const guildOwnerId = GuildStore.getGuild(guild_id).ownerId;\n if (!GuildMemberStore.getMember(guild_id, guildOwnerId)) membersToFetch.push(guildOwnerId);\n\n Object.values(permissionOverwrites).forEach(({ type, id: userId }) => {\n if (type === 1 && !GuildMemberStore.getMember(guild_id, userId)) {\n membersToFetch.push(userId);\n }\n });\n\n if (membersToFetch.length > 0) {\n FluxDispatcher.dispatch({\n type: \"GUILD_MEMBERS_REQUEST\",\n guildIds: [guild_id],\n userIds: membersToFetch\n });\n }\n\n if (Settings.plugins.PermissionsViewer.enabled) {\n setPermissions(sortPermissionOverwrites(Object.values(permissionOverwrites).map(overwrite => ({\n type: overwrite.type as PermissionType,\n id: overwrite.id,\n overwriteAllow: overwrite.allow,\n overwriteDeny: overwrite.deny\n })), guild_id));\n }\n }, [channelId]);\n\n return (\n
\n
\n \n\n
\n This is a {!PermissionStore.can(PermissionsBits.VIEW_CHANNEL, channel) ? \"hidden\" : \"locked\"} {ChannelTypesToChannelNames[type]} channel.\n {channel.isNSFW() &&\n \n {({ onMouseLeave, onMouseEnter }) => (\n \n \n \n )}\n \n }\n
\n\n {(!channel.isGuildVoice() && !channel.isGuildStageVoice()) && (\n \n You can not see the {channel.isForumChannel() ? \"posts\" : \"messages\"} of this channel.\n {channel.isForumChannel() && topic && topic.length > 0 && \" However you may see its guidelines:\"}\n \n )}\n\n {channel.isForumChannel() && topic && topic.length > 0 && (\n
\n {Parser.parseTopic(topic, false, { channelId })}\n
\n )}\n\n {lastMessageId &&\n \n Last {channel.isForumChannel() ? \"post\" : \"message\"} created:\n \n \n }\n\n {lastPinTimestamp &&\n Last message pin: \n }\n {(rateLimitPerUser ?? 0) > 0 &&\n Slowmode: {formatDuration(rateLimitPerUser!, \"seconds\")}\n }\n {(defaultThreadRateLimitPerUser ?? 0) > 0 &&\n \n Default thread slowmode: {formatDuration(defaultThreadRateLimitPerUser!, \"seconds\")}\n \n }\n {((channel.isGuildVoice() || channel.isGuildStageVoice()) && bitrate != null) &&\n Bitrate: {bitrate} bits\n }\n {rtcRegion !== undefined &&\n Region: {rtcRegion ?? \"Automatic\"}\n }\n {(channel.isGuildVoice() || channel.isGuildStageVoice()) &&\n Video quality mode: {VideoQualityModesToNames[videoQualityMode ?? VideoQualityModes.AUTO]}\n }\n {(defaultAutoArchiveDuration ?? 0) > 0 &&\n \n Default inactivity duration before archiving {channel.isForumChannel() ? \"posts\" : \"threads\"}:\n {\" \" + formatDuration(defaultAutoArchiveDuration!, \"minutes\")}\n \n }\n {defaultForumLayout != null &&\n Default layout: {ForumLayoutTypesToNames[defaultForumLayout]}\n }\n {defaultSortOrder != null &&\n Default sort order: {SortOrderTypesToNames[defaultSortOrder]}\n }\n {defaultReactionEmoji != null &&\n
\n Default reaction emoji:\n {Parser.defaultRules[defaultReactionEmoji.emojiName ? \"emoji\" : \"customEmoji\"].react({\n name: defaultReactionEmoji.emojiName\n ? EmojiParser.convertSurrogateToName(defaultReactionEmoji.emojiName)\n : EmojiStore.getCustomEmojiById(defaultReactionEmoji.emojiId)?.name ?? \"\",\n emojiId: defaultReactionEmoji.emojiId ?? void 0,\n surrogate: defaultReactionEmoji.emojiName ?? void 0,\n src: defaultReactionEmoji.emojiName\n ? EmojiUtils.getURL(defaultReactionEmoji.emojiName)\n : void 0\n }, void 0, { key: \"0\" })}\n
\n }\n {channel.hasFlag(ChannelFlags.REQUIRE_TAG) &&\n Posts on this forum require a tag to be set.\n }\n {availableTags && availableTags.length > 0 &&\n
\n Available tags:\n
\n {availableTags.map(tag => )}\n
\n
\n }\n
\n
\n {Settings.plugins.PermissionsViewer.enabled && (\n \n {({ onMouseLeave, onMouseEnter }) => (\n openRolesAndUsersPermissionsModal(permissions, GuildStore.getGuild(channel.guild_id), channel.name)}\n >\n \n \n \n \n )}\n \n )}\n Allowed users and roles:\n \n {({ onMouseLeave, onMouseEnter }) => (\n setViewAllowedUsersAndRoles(v => !v)}\n >\n \n \n \n \n )}\n \n
\n {viewAllowedUsersAndRoles && }\n
\n
\n
\n );\n}\n\nexport default ErrorBoundary.wrap(HiddenChannelLockScreen);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./style.css\";\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { canonicalizeMatch } from \"@utils/patches\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ChannelStore, PermissionsBits, PermissionStore, Tooltip } from \"@webpack/common\";\nimport type { Channel, Role } from \"discord-types/general\";\n\nimport HiddenChannelLockScreen from \"./components/HiddenChannelLockScreen\";\n\nconst ChannelListClasses = findByPropsLazy(\"channelEmoji\", \"unread\", \"icon\");\n\nconst enum ShowMode {\n LockIcon,\n HiddenIconWithMutedStyle\n}\n\nexport const settings = definePluginSettings({\n hideUnreads: {\n description: \"Hide Unreads\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n },\n showMode: {\n description: \"The mode used to display hidden channels.\",\n type: OptionType.SELECT,\n options: [\n { label: \"Plain style with Lock Icon instead\", value: ShowMode.LockIcon, default: true },\n { label: \"Muted style with hidden eye icon on the right\", value: ShowMode.HiddenIconWithMutedStyle },\n ],\n restartNeeded: true\n },\n defaultAllowedUsersAndRolesDropdownState: {\n description: \"Whether the allowed users and roles dropdown on hidden channels should be open by default\",\n type: OptionType.BOOLEAN,\n default: true\n }\n});\n\nexport default definePlugin({\n name: \"ShowHiddenChannels\",\n description: \"Show channels that you do not have access to view.\",\n authors: [Devs.BigDuck, Devs.AverageReactEnjoyer, Devs.D3SOX, Devs.Ven, Devs.Nuckyz, Devs.Nickyux, Devs.dzshn],\n settings,\n\n patches: [\n {\n // RenderLevel defines if a channel is hidden, collapsed in category, visible, etc\n find: \".CannotShow=\",\n replacement: [\n // Remove the special logic for channels we don't have access to\n {\n match: /if\\(!\\i\\.\\i\\.can\\(\\i\\.\\i\\.VIEW_CHANNEL.+?{if\\(this\\.id===\\i\\).+?threadIds:\\i}}/,\n replace: \"\"\n },\n // Do not check for unreads when selecting the render level if the channel is hidden\n {\n match: /(?=!1===\\i.\\i\\.hasRelevantUnread\\(this\\.record\\))/,\n replace: \"$self.isHiddenChannel(this.record)||\"\n },\n // Make channels we dont have access to be the same level as normal ones\n {\n match: /(?<=renderLevel:(\\i\\(this,\\i\\)\\?\\i\\.Show:\\i\\.WouldShowIfUncollapsed).+?renderLevel:).+?(?=,)/,\n replace: (_, renderLevelExpression) => renderLevelExpression\n },\n // Make channels we dont have access to be the same level as normal ones\n {\n match: /(?<=activeJoinedRelevantThreads.+?renderLevel:.+?,threadIds:\\i\\(this.record.+?renderLevel:)(\\i)\\..+?(?=,)/,\n replace: (_, RenderLevels) => `${RenderLevels}.Show`\n },\n // Remove permission checking for getRenderLevel function\n {\n match: /(?<=getRenderLevel\\(\\i\\){.+?return)!\\i\\.\\i\\.can\\(\\i\\.\\i\\.VIEW_CHANNEL,this\\.record\\)\\|\\|/,\n replace: \" \"\n }\n ]\n },\n {\n find: \"VoiceChannel, transitionTo: Channel does not have a guildId\",\n replacement: [\n {\n // Do not show confirmation to join a voice channel when already connected to another if clicking on a hidden voice channel\n match: /(?<=getCurrentClientVoiceChannelId\\((\\i)\\.guild_id\\);return)/,\n replace: (_, channel) => `!$self.isHiddenChannel(${channel})&&`\n },\n {\n // Prevent Discord from trying to connect to hidden voice channels\n match: /(?=&&\\i\\.\\i\\.selectVoiceChannel\\((\\i)\\.id\\))/,\n replace: (_, channel) => `&&!$self.isHiddenChannel(${channel})`\n },\n {\n // Make Discord show inside the channel if clicking on a hidden or locked channel\n match: /!__OVERLAY__&&\\((?<=selectVoiceChannel\\((\\i)\\.id\\).+?)/,\n replace: (m, channel) => `${m}$self.isHiddenChannel(${channel},true)||`\n }\n ]\n },\n // Prevent Discord from trying to connect to hidden stage channels\n {\n find: \".MAX_STAGE_VOICE_USER_LIMIT})\",\n replacement: {\n match: /!(\\i)\\.isRoleSubscriptionTemplatePreviewChannel\\(\\)/,\n replace: (m, channel) => `${m}&&!$self.isHiddenChannel(${channel})`\n }\n },\n {\n find: \"ChannelItemEditButton:function(){\",\n replacement: [\n // Render null instead of the buttons if the channel is hidden\n ...[\n \"renderEditButton\",\n \"renderInviteButton\",\n ].map(func => ({\n match: new RegExp(`(?<=${func}\\\\(\\\\){)`, \"g\"), // Global because Discord has multiple declarations of the same functions\n replace: \"if($self.isHiddenChannel(this.props.channel))return null;\"\n }))\n ]\n },\n {\n find: \"VoiceChannel.renderPopout: There must always be something to render\",\n all: true,\n // Render null instead of the buttons if the channel is hidden\n replacement: {\n match: /(?<=renderOpenChatButton=\\(\\)=>{)/,\n replace: \"if($self.isHiddenChannel(this.props.channel))return null;\"\n }\n },\n {\n find: \".Messages.CHANNEL_TOOLTIP_DIRECTORY\",\n predicate: () => settings.store.showMode === ShowMode.LockIcon,\n replacement: {\n // Lock Icon\n match: /(?=switch\\((\\i)\\.type\\).{0,30}\\.GUILD_ANNOUNCEMENT.{0,70}\\(0,\\i\\.\\i\\))/,\n replace: (_, channel) => `if($self.isHiddenChannel(${channel}))return $self.LockIcon;`\n }\n },\n {\n find: \".UNREAD_HIGHLIGHT\",\n predicate: () => settings.store.showMode === ShowMode.HiddenIconWithMutedStyle,\n replacement: [\n // Make the channel appear as muted if it's hidden\n {\n match: /(?<={channel:(\\i),name:\\i,muted:(\\i).+?;)/,\n replace: (_, channel, muted) => `${muted}=$self.isHiddenChannel(${channel})?true:${muted};`\n },\n // Add the hidden eye icon if the channel is hidden\n {\n match: /\\i\\.children.+?:null(?<=,channel:(\\i).+?)/,\n replace: (m, channel) => `${m},$self.isHiddenChannel(${channel})?$self.HiddenChannelIcon():null`\n },\n // Make voice channels also appear as muted if they are muted\n {\n match: /(?<=\\.wrapper:\\i\\.notInteractive,)(.+?)if\\((\\i)\\)return (\\i\\.MUTED);/,\n replace: (_, otherClasses, isMuted, mutedClassExpression) => `${isMuted}?${mutedClassExpression}:\"\",${otherClasses}if(${isMuted})return \"\";`\n }\n ]\n },\n {\n find: \".UNREAD_HIGHLIGHT\",\n replacement: [\n {\n // Make muted channels also appear as unread if hide unreads is false, using the HiddenIconWithMutedStyle and the channel is hidden\n predicate: () => settings.store.hideUnreads === false && settings.store.showMode === ShowMode.HiddenIconWithMutedStyle,\n match: /\\.LOCKED;if\\((?<={channel:(\\i).+?)/,\n replace: (m, channel) => `${m}!$self.isHiddenChannel(${channel})&&`\n },\n {\n // Hide unreads\n predicate: () => settings.store.hideUnreads === true,\n match: /(?<={channel:(\\i),name:\\i,.+?unread:(\\i).+?;)/,\n replace: (_, channel, unread) => `${unread}=$self.isHiddenChannel(${channel})?false:${unread};`\n }\n ]\n },\n {\n // Hide the new version of unreads box for hidden channels\n find: '.displayName=\"ChannelListUnreadsStore\"',\n replacement: {\n match: /(?<=if\\(null==(\\i))(?=.{0,160}?hasRelevantUnread\\(\\i\\))/g, // Global because Discord has multiple methods like that in the same module\n replace: (_, channel) => `||$self.isHiddenChannel(${channel})`\n }\n },\n {\n // Make the old version of unreads box not visible for hidden channels\n find: \"renderBottomUnread(){\",\n replacement: {\n match: /(?=&&\\i\\.\\i\\.hasRelevantUnread\\((\\i\\.record)\\))/,\n replace: \"&&!$self.isHiddenChannel($1)\"\n }\n },\n {\n // Make the state of the old version of unreads box not include hidden channels\n find: \".useFlattenedChannelIdListWithThreads)\",\n replacement: {\n match: /(?=&&\\i\\.\\i\\.hasRelevantUnread\\((\\i)\\))/,\n replace: \"&&!$self.isHiddenChannel($1)\"\n }\n },\n // Only render the channel header and buttons that work when transitioning to a hidden channel\n {\n find: \"Missing channel in Channel.renderHeaderToolbar\",\n replacement: [\n {\n match: /(?<=renderHeaderToolbar=\\(\\)=>{.+?case \\i\\.\\i\\.GUILD_TEXT:)(?=.+?(\\i\\.push.{0,50}channel:(\\i)},\"notifications\"\\)\\)))(?<=isLurking:(\\i).+?)/,\n replace: (_, pushNotificationButtonExpression, channel, isLurking) => `if(!${isLurking}&&$self.isHiddenChannel(${channel})){${pushNotificationButtonExpression};break;}`\n },\n {\n match: /(?<=renderHeaderToolbar=\\(\\)=>{.+?case \\i\\.\\i\\.GUILD_MEDIA:)(?=.+?(\\i\\.push.{0,40}channel:(\\i)},\"notifications\"\\)\\)))(?<=isLurking:(\\i).+?)/,\n replace: (_, pushNotificationButtonExpression, channel, isLurking) => `if(!${isLurking}&&$self.isHiddenChannel(${channel})){${pushNotificationButtonExpression};break;}`\n },\n {\n match: /renderMobileToolbar=\\(\\)=>{.+?case \\i\\.\\i\\.GUILD_DIRECTORY:(?<=let{channel:(\\i).+?)/,\n replace: (m, channel) => `${m}if($self.isHiddenChannel(${channel}))break;`\n },\n {\n match: /(?<=renderHeaderBar=\\(\\)=>{.+?hideSearch:(\\i)\\.isDirectory\\(\\))/,\n replace: (_, channel) => `||$self.isHiddenChannel(${channel})`\n },\n {\n match: /(?<=renderSidebar\\(\\){)/,\n replace: \"if($self.isHiddenChannel(this.props.channel))return null;\"\n },\n {\n match: /(?<=renderChat\\(\\){)/,\n replace: \"if($self.isHiddenChannel(this.props.channel))return $self.HiddenChannelLockScreen(this.props.channel);\"\n }\n ]\n },\n // Avoid trying to fetch messages from hidden channels\n {\n find: '\"MessageManager\"',\n replacement: {\n match: /\"Skipping fetch because channelId is a static route\"\\);return}(?=.+?getChannel\\((\\i)\\))/,\n replace: (m, channelId) => `${m}if($self.isHiddenChannel({channelId:${channelId}}))return;`\n }\n },\n // Patch keybind handlers so you can't accidentally jump to hidden channels\n {\n find: '\"alt+shift+down\"',\n replacement: {\n match: /(?<=getChannel\\(\\i\\);return null!=(\\i))(?=.{0,150}?hasRelevantUnread\\(\\i\\))/,\n replace: (_, channel) => `&&!$self.isHiddenChannel(${channel})`\n }\n },\n // Patch keybind handlers so you can't accidentally jump to hidden channels\n {\n find: \".APPLICATION_STORE&&null!=\",\n replacement: {\n match: /(?<=getState\\(\\)\\.channelId.{0,30}?\\(0,\\i\\.\\i\\)\\(\\i\\))(?=\\.map\\()/,\n replace: \".filter(e=>!$self.isHiddenChannel(e))\"\n }\n },\n {\n find: \".Messages.ROLE_REQUIRED_SINGLE_USER_MESSAGE\",\n replacement: [\n {\n // Change the role permission check to CONNECT if the channel is locked\n match: /ADMINISTRATOR\\)\\|\\|(?<=context:(\\i)}.+?)(?=(.+?)VIEW_CHANNEL)/,\n replace: (m, channel, permCheck) => `${m}!Vencord.Webpack.Common.PermissionStore.can(${PermissionsBits.CONNECT}n,${channel})?${permCheck}CONNECT):`\n },\n {\n // Change the permissionOverwrite check to CONNECT if the channel is locked\n match: /permissionOverwrites\\[.+?\\i=(?<=context:(\\i)}.+?)(?=(.+?)VIEW_CHANNEL)/,\n replace: (m, channel, permCheck) => `${m}!Vencord.Webpack.Common.PermissionStore.can(${PermissionsBits.CONNECT}n,${channel})?${permCheck}CONNECT):`\n },\n {\n // Include the @everyone role in the allowed roles list for Hidden Channels\n match: /sortBy.{0,30}?\\.filter\\(\\i=>(?<=channel:(\\i).+?)/,\n replace: (m, channel) => `${m}$self.isHiddenChannel(${channel})?true:`\n },\n {\n // If the @everyone role has the required permissions, make the array only contain it\n match: /computePermissionsForRoles.+?.value\\(\\)(?<=channel:(\\i).+?)/,\n replace: (m, channel) => `${m}.reduce(...$self.makeAllowedRolesReduce(${channel}.guild_id))`\n },\n {\n // Patch the header to only return allowed users and roles if it's a hidden channel or locked channel (Like when it's used on the HiddenChannelLockScreen)\n match: /MANAGE_ROLES.{0,90}?return(?=\\(.+?(\\(0,\\i\\.jsxs\\)\\(\"div\",{className:\\i\\.members.+?guildId:(\\i)\\.guild_id.+?roleColor.+?\\]}\\)))/,\n replace: (m, component, channel) => {\n // Export the channel for the users allowed component patch\n component = component.replace(canonicalizeMatch(/(?<=users:\\i)/), `,shcChannel:${channel}`);\n // Always render the component for multiple allowed users\n component = component.replace(canonicalizeMatch(/1!==\\i\\.length/), \"true\");\n\n return `${m} $self.isHiddenChannel(${channel},true)?${component}:`;\n }\n }\n ]\n },\n {\n find: \".avatars),children\",\n replacement: [\n {\n // Create a variable for the channel prop\n match: /maxUsers:\\i,users:\\i.+?=(\\i).+?;/,\n replace: (m, props) => `${m}let{shcChannel}=${props};`\n },\n {\n // Make Discord always render the plus button if the component is used inside the HiddenChannelLockScreen\n match: /\\i>0(?=&&.{0,60}renderPopout)/,\n replace: m => `($self.isHiddenChannel(shcChannel,true)?true:${m})`\n },\n {\n // Prevent Discord from overwriting the last children with the plus button if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen\n match: /(?<=\\.value\\(\\),(\\i)=.+?length-)1(?=\\]=.{0,60}renderPopout)/,\n replace: (_, amount) => `($self.isHiddenChannel(shcChannel,true)&&${amount}<=0?0:1)`\n },\n {\n // Show only the plus text without overflowed children amount if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen\n match: /(?<=\"\\+\",)(\\i)\\+1/,\n replace: (m, amount) => `$self.isHiddenChannel(shcChannel,true)&&${amount}<=0?\"\":${m}`\n }\n ]\n },\n {\n find: \".Messages.CHANNEL_CALL_CURRENT_SPEAKER.format\",\n replacement: [\n {\n // Remove the divider and the open chat button for the HiddenChannelLockScreen\n match: /\"more-options-popout\"\\)\\),(?<=let{channel:(\\i).+?inCall:(\\i).+?)/,\n replace: (m, channel, inCall) => `${m}${inCall}||!$self.isHiddenChannel(${channel},true)&&`\n },\n {\n // Remove invite users button for the HiddenChannelLockScreen\n match: /\"popup\".{0,100}?if\\((?<=let{channel:(\\i).+?inCall:(\\i).+?)/,\n replace: (m, channel, inCall) => `${m}(${inCall}||!$self.isHiddenChannel(${channel},true))&&`\n },\n ]\n },\n {\n find: \".Messages.EMBEDDED_ACTIVITIES_DEVELOPER_ACTIVITY_SHELF_FETCH_ERROR\",\n replacement: [\n {\n // Render our HiddenChannelLockScreen component instead of the main voice channel component\n match: /renderContent\\(\\i\\){.+?this\\.renderVoiceChannelEffects.+?children:/,\n replace: \"$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)?$self.HiddenChannelLockScreen(this.props.channel):\"\n },\n {\n // Disable gradients for the HiddenChannelLockScreen of voice channels\n match: /renderContent\\(\\i\\){.+?disableGradients:/,\n replace: \"$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)||\"\n },\n {\n // Disable useless components for the HiddenChannelLockScreen of voice channels\n match: /(?:{|,)render(?!Header|ExternalHeader).{0,30}?:/g,\n replace: \"$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)?()=>null:\"\n },\n {\n // Disable bad CSS class which mess up hidden voice channels styling\n match: /callContainer,(?<=\\i\\.callContainer,)/,\n replace: '$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)?\"\":'\n }\n ]\n },\n {\n find: '\"HasBeenInStageChannel\"',\n replacement: [\n {\n // Render our HiddenChannelLockScreen component instead of the main stage channel component\n match: /\"124px\".+?children:(?<=let \\i,{channel:(\\i).+?)(?=.{0,20}?}\\)}function)/,\n replace: (m, channel) => `${m}$self.isHiddenChannel(${channel})?$self.HiddenChannelLockScreen(${channel}):`\n },\n {\n // Disable useless components for the HiddenChannelLockScreen of stage channels\n match: /render(?:BottomLeft|BottomCenter|BottomRight|ChatToasts):\\(\\)=>(?<=let \\i,{channel:(\\i).+?)/g,\n replace: (m, channel) => `${m}$self.isHiddenChannel(${channel})?null:`\n },\n {\n // Disable gradients for the HiddenChannelLockScreen of stage channels\n match: /\"124px\".+?disableGradients:(?<=let \\i,{channel:(\\i).+?)/,\n replace: (m, channel) => `${m}$self.isHiddenChannel(${channel})||`\n },\n {\n // Disable strange styles applied to the header for the HiddenChannelLockScreen of stage channels\n match: /\"124px\".+?style:(?<=let \\i,{channel:(\\i).+?)/,\n replace: (m, channel) => `${m}$self.isHiddenChannel(${channel})?void 0:`\n }\n ]\n },\n {\n find: \".Messages.STAGE_FULL_MODERATOR_TITLE\",\n replacement: [\n {\n // Remove the divider and amount of users in stage channel components for the HiddenChannelLockScreen\n match: /\\(0,\\i\\.jsx\\)\\(\\i\\.\\i\\.Divider.+?}\\)]}\\)(?=.+?:(\\i)\\.guild_id)/,\n replace: (m, channel) => `$self.isHiddenChannel(${channel})?null:(${m})`\n },\n {\n // Remove the open chat button for the HiddenChannelLockScreen\n match: /\"recents\".+?&&(?=\\(.+?channelId:(\\i)\\.id,showRequestToSpeakSidebar)/,\n replace: (m, channel) => `${m}!$self.isHiddenChannel(${channel})&&`\n }\n ]\n },\n {\n // Make the chat input bar channel list contain hidden channels\n find: \",queryStaticRouteChannels(\",\n replacement: [\n {\n // Make the getChannels call to GuildChannelStore return hidden channels\n match: /(?<=queryChannels\\(\\i\\){.+?getChannels\\(\\i)(?=\\))/,\n replace: \",true\"\n },\n {\n // Avoid filtering out hidden channels from the channel list\n match: /(?<=queryChannels\\(\\i\\){.+?isGuildChannelType\\)\\((\\i)\\.type\\))(?=&&!\\i\\.\\i\\.can\\()/,\n replace: \"&&!$self.isHiddenChannel($1)\"\n }\n ]\n },\n {\n find: \"\\\"^/guild-stages/(\\\\\\\\d+)(?:/)?(\\\\\\\\d+)?\\\"\",\n replacement: {\n // Make mentions of hidden channels work\n match: /\\i\\.\\i\\.can\\(\\i\\.\\i\\.VIEW_CHANNEL,\\i\\)/,\n replace: \"true\"\n },\n },\n {\n find: \".shouldCloseDefaultModals\",\n replacement: {\n // Show inside voice channel instead of trying to join them when clicking on a channel mention\n match: /(?<=getChannel\\(\\i\\);if\\(null!=(\\i))(?=.{0,100}?selectVoiceChannel)/,\n replace: (_, channel) => `&&!$self.isHiddenChannel(${channel})`\n }\n },\n {\n find: '.displayName=\"GuildChannelStore\"',\n replacement: [\n {\n // Make GuildChannelStore contain hidden channels\n match: /isChannelGated\\(.+?\\)(?=&&)/,\n replace: m => `${m}&&false`\n },\n {\n // Filter hidden channels from GuildChannelStore.getChannels unless told otherwise\n match: /(?<=getChannels\\(\\i)(\\){.+?)return (.+?)}/,\n replace: (_, rest, channels) => `,shouldIncludeHidden${rest}return $self.resolveGuildChannels(${channels},shouldIncludeHidden??false);}`\n }\n ]\n },\n {\n find: \".Messages.FORM_LABEL_MUTED\",\n replacement: {\n // Make GuildChannelStore.getChannels return hidden channels\n match: /(?<=getChannels\\(\\i)(?=\\))/,\n replace: \",true\"\n }\n },\n {\n find: '.displayName=\"NowPlayingViewStore\"',\n replacement: {\n // Make active now voice states on hidden channels\n match: /(getVoiceStateForUser.{0,150}?)&&\\i\\.\\i\\.canWithPartialContext.{0,20}VIEW_CHANNEL.+?}\\)(?=\\?)/,\n replace: \"$1\"\n }\n }\n ],\n\n isHiddenChannel(channel: Channel & { channelId?: string; }, checkConnect = false) {\n if (!channel) return false;\n\n if (channel.channelId) channel = ChannelStore.getChannel(channel.channelId);\n if (!channel || channel.isDM() || channel.isGroupDM() || channel.isMultiUserDM()) return false;\n\n return !PermissionStore.can(PermissionsBits.VIEW_CHANNEL, channel) || checkConnect && !PermissionStore.can(PermissionsBits.CONNECT, channel);\n },\n\n resolveGuildChannels(channels: Record | string | number>, shouldIncludeHidden: boolean) {\n if (shouldIncludeHidden) return channels;\n\n const res = {};\n for (const [key, maybeObjChannels] of Object.entries(channels)) {\n if (!Array.isArray(maybeObjChannels)) {\n res[key] = maybeObjChannels;\n continue;\n }\n\n res[key] ??= [];\n\n for (const objChannel of maybeObjChannels) {\n if (objChannel.channel.id === null || !this.isHiddenChannel(objChannel.channel)) res[key].push(objChannel);\n }\n }\n\n return res;\n },\n\n makeAllowedRolesReduce(guildId: string) {\n return [\n (prev: Array, _: Role, index: number, originalArray: Array) => {\n if (index !== 0) return prev;\n\n const everyoneRole = originalArray.find(role => role.id === guildId);\n\n if (everyoneRole) return [everyoneRole];\n return originalArray;\n },\n [] as Array\n ];\n },\n\n HiddenChannelLockScreen: (channel: any) => ,\n\n LockIcon: ErrorBoundary.wrap(() => (\n \n \n \n ), { noop: true }),\n\n HiddenChannelIcon: ErrorBoundary.wrap(() => (\n \n {({ onMouseLeave, onMouseEnter }) => (\n \n \n \n )}\n \n ), { noop: true })\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 rini\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport \"./styles.css\";\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Message, User } from \"discord-types/general\";\n\ninterface UsernameProps {\n author: { nick: string; };\n message: Message;\n withMentionPrefix?: boolean;\n isRepliedMessage: boolean;\n userOverride?: User;\n}\n\nconst settings = definePluginSettings({\n mode: {\n type: OptionType.SELECT,\n description: \"How to display usernames and nicks\",\n options: [\n { label: \"Username then nickname\", value: \"user-nick\", default: true },\n { label: \"Nickname then username\", value: \"nick-user\" },\n { label: \"Username only\", value: \"user\" },\n ],\n },\n displayNames: {\n type: OptionType.BOOLEAN,\n description: \"Use display names in place of usernames\",\n default: false\n },\n inReplies: {\n type: OptionType.BOOLEAN,\n default: false,\n description: \"Also apply functionality to reply previews\",\n },\n});\n\nexport default definePlugin({\n name: \"ShowMeYourName\",\n description: \"Display usernames next to nicks, or no nicks at all\",\n authors: [Devs.Rini, Devs.TheKodeToad],\n patches: [\n {\n find: \".useCanSeeRemixBadge)\",\n replacement: {\n match: /(?<=onContextMenu:\\i,children:).*?\\}/,\n replace: \"$self.renderUsername(arguments[0])}\"\n }\n },\n ],\n settings,\n\n renderUsername: ({ author, message, isRepliedMessage, withMentionPrefix, userOverride }: UsernameProps) => {\n try {\n const user = userOverride ?? message.author;\n let { username } = user;\n if (settings.store.displayNames)\n username = (user as any).globalName || username;\n\n const { nick } = author;\n const prefix = withMentionPrefix ? \"@\" : \"\";\n if (username === nick || isRepliedMessage && !settings.store.inReplies)\n return prefix + nick;\n if (settings.store.mode === \"user-nick\")\n return <>{prefix}{username} {nick};\n if (settings.store.mode === \"nick-user\")\n return <>{prefix}{nick} {username};\n return prefix + username;\n } catch {\n return author?.nick;\n }\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"ShowTimeouts\",\n description: \"Display member timeout icons in chat regardless of permissions.\",\n authors: [Devs.Dolfies],\n patches: [\n {\n find: \"showCommunicationDisabledStyles\",\n replacement: {\n match: /&&\\i\\.\\i\\.canManageUser\\(\\i\\.\\i\\.MODERATE_MEMBERS,\\i\\.author,\\i\\)/,\n replace: \"\",\n },\n },\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addPreSendListener, removePreSendListener, SendListener } from \"@api/MessageEvents\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Button, ButtonLooks, ButtonWrapperClasses, React, Tooltip } from \"@webpack/common\";\n\nlet lastState = false;\n\nconst settings = definePluginSettings({\n persistState: {\n type: OptionType.BOOLEAN,\n description: \"Whether to persist the state of the silent message toggle when changing channels\",\n default: false,\n onChange(newValue: boolean) {\n if (newValue === false) lastState = false;\n }\n },\n autoDisable: {\n type: OptionType.BOOLEAN,\n description: \"Automatically disable the silent message toggle again after sending one\",\n default: true\n }\n});\n\nfunction SilentMessageToggle(chatBoxProps: {\n type: {\n analyticsName: string;\n };\n}) {\n const [enabled, setEnabled] = React.useState(lastState);\n\n function setEnabledValue(value: boolean) {\n if (settings.store.persistState) lastState = value;\n setEnabled(value);\n }\n\n React.useEffect(() => {\n const listener: SendListener = (_, message) => {\n if (enabled) {\n if (settings.store.autoDisable) setEnabledValue(false);\n if (!message.content.startsWith(\"@silent \")) message.content = \"@silent \" + message.content;\n }\n };\n\n addPreSendListener(listener);\n return () => void removePreSendListener(listener);\n }, [enabled]);\n\n if (chatBoxProps.type.analyticsName !== \"normal\") return null;\n\n return (\n \n {tooltipProps => (\n
\n setEnabledValue(!enabled)}\n size=\"\"\n look={ButtonLooks.BLANK}\n innerClassName={ButtonWrapperClasses.button}\n style={{ padding: \"0 6px\" }}\n >\n
\n \n \n \n \n {!enabled && }\n \n \n
\n \n
\n )}\n
\n );\n}\n\nexport default definePlugin({\n name: \"SilentMessageToggle\",\n authors: [Devs.Nuckyz, Devs.CatNoir],\n description: \"Adds a button to the chat bar to toggle sending a silent message.\",\n dependencies: [\"MessageEventsAPI\"],\n\n settings,\n patches: [\n {\n find: \"ChannelTextAreaButtons\",\n replacement: {\n match: /(\\i)\\.push.{1,30}disabled:(\\i),.{1,20}\\},\"gift\"\\)\\)/,\n replace: \"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()\",\n }\n },\n ],\n\n chatBarIcon: ErrorBoundary.wrap(SilentMessageToggle, { noop: true }),\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from \"@api/Commands\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Button, ButtonLooks, ButtonWrapperClasses, FluxDispatcher, React, Tooltip } from \"@webpack/common\";\n\nconst settings = definePluginSettings({\n showIcon: {\n type: OptionType.BOOLEAN,\n default: false,\n description: \"Show an icon for toggling the plugin\",\n restartNeeded: true,\n },\n isEnabled: {\n type: OptionType.BOOLEAN,\n description: \"Toggle functionality\",\n default: true,\n }\n});\n\nfunction SilentTypingToggle(chatBoxProps: {\n type: {\n analyticsName: string;\n };\n}) {\n const { isEnabled } = settings.use([\"isEnabled\"]);\n const toggle = () => settings.store.isEnabled = !settings.store.isEnabled;\n\n if (chatBoxProps.type.analyticsName !== \"normal\") return null;\n\n return (\n \n {(tooltipProps: any) => (\n
\n \n
\n \n \n {isEnabled && }\n \n
\n \n
\n )}\n
\n );\n}\n\nexport default definePlugin({\n name: \"SilentTyping\",\n authors: [Devs.Ven, Devs.Rini],\n description: \"Hide that you are typing\",\n patches: [\n {\n find: '.dispatch({type:\"TYPING_START_LOCAL\"',\n replacement: {\n match: /startTyping\\(\\i\\){.+?},stop/,\n replace: \"startTyping:$self.startTyping,stop\"\n }\n },\n {\n find: \"ChannelTextAreaButtons\",\n predicate: () => settings.store.showIcon,\n replacement: {\n match: /(\\i)\\.push.{1,30}disabled:(\\i),.{1,20}\\},\"gift\"\\)\\)/,\n replace: \"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()\",\n }\n },\n ],\n dependencies: [\"CommandsAPI\"],\n settings,\n commands: [{\n name: \"silenttype\",\n description: \"Toggle whether you're hiding that you're typing or not.\",\n inputType: ApplicationCommandInputType.BUILT_IN,\n options: [\n {\n name: \"value\",\n description: \"whether to hide or not that you're typing (default is toggle)\",\n required: false,\n type: ApplicationCommandOptionType.BOOLEAN,\n },\n ],\n execute: async (args, ctx) => {\n settings.store.isEnabled = !!findOption(args, \"value\", !settings.store.isEnabled);\n sendBotMessage(ctx.channel.id, {\n content: settings.store.isEnabled ? \"Silent typing enabled!\" : \"Silent typing disabled!\",\n });\n },\n }],\n\n async startTyping(channelId: string) {\n if (settings.store.isEnabled) return;\n FluxDispatcher.dispatch({ type: \"TYPING_START_LOCAL\", channelId });\n },\n\n chatBarIcon: ErrorBoundary.wrap(SilentTypingToggle, { noop: true }),\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Flex } from \"@components/Flex\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { RelationshipStore } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\nimport { Settings } from \"Vencord\";\n\nexport default definePlugin({\n name: \"SortFriendRequests\",\n authors: [Devs.Megu],\n description: \"Sorts friend requests by date of receipt\",\n\n patches: [{\n find: \"getRelationshipCounts(){\",\n replacement: {\n match: /\\.sortBy\\(\\i=>\\i\\.comparator\\)/,\n replace: \".sortBy((row) => $self.sortList(row))\"\n }\n }, {\n find: \"RelationshipTypes.PENDING_INCOMING?\",\n replacement: {\n predicate: () => Settings.plugins.SortFriendRequests.showDates,\n match: /(user:(\\i),.{10,50}),subText:(\\i),(className:\\i\\.userInfo}\\))/,\n replace: (_, pre, user, subtext, post) => `${pre},\n subText: $self.makeSubtext(${subtext}, ${user}),\n ${post}`\n }\n }],\n\n sortList(row: any) {\n return row.type === 3 || row.type === 4\n ? -this.getSince(row.user)\n : row.comparator;\n },\n\n getSince(user: User) {\n return new Date(RelationshipStore.getSince(user.id));\n },\n\n makeSubtext(text: string, user: User) {\n const since = this.getSince(user);\n return (\n \n {text}\n {!isNaN(since.getTime()) && Received — {since.toDateString()}}\n \n );\n },\n\n options: {\n showDates: {\n type: OptionType.BOOLEAN,\n description: \"Show dates on friend requests\",\n default: false,\n restartNeeded: true\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n(window.VencordStyles ??= new Map()).set(\"src/plugins/spotifyControls/hoverOnly.css\", {\n name: \"src/plugins/spotifyControls/hoverOnly.css\",\n source: \".vc-spotify-button-row {\\n height: 0;\\n opacity: 0;\\n pointer-events: none;\\n transition: 0.2s;\\n transition-property: height;\\n}\\n\\n#vc-spotify-player:hover .vc-spotify-button-row {\\n opacity: 1;\\n height: 32px;\\n pointer-events: auto;\\n\\n /* only transition opacity on show to prevent clipping */\\n transition-property: height, opacity;\\n}\\n\",\n classNames: {},\n dom: null,\n});\n\nexport default \"src/plugins/spotifyControls/hoverOnly.css\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { proxyLazy } from \"@utils/lazy\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { Flux, FluxDispatcher } from \"@webpack/common\";\n\nexport interface Track {\n id: string;\n name: string;\n duration: number;\n isLocal: boolean;\n album: {\n id: string;\n name: string;\n image: {\n height: number;\n width: number;\n url: string;\n };\n };\n artists: {\n id: string;\n href: string;\n name: string;\n type: string;\n uri: string;\n }[];\n}\n\ninterface PlayerState {\n accountId: string;\n track: Track | null;\n volumePercent: number,\n isPlaying: boolean,\n repeat: boolean,\n position: number,\n context?: any;\n device?: Device;\n\n // added by patch\n actual_repeat: Repeat;\n}\n\ninterface Device {\n id: string;\n is_active: boolean;\n}\n\ntype Repeat = \"off\" | \"track\" | \"context\";\n\n// Don't wanna run before Flux and Dispatcher are ready!\nexport const SpotifyStore = proxyLazy(() => {\n // For some reason ts hates extends Flux.Store\n const { Store } = Flux;\n\n const SpotifySocket = findByPropsLazy(\"getActiveSocketAndDevice\");\n const SpotifyUtils = findByPropsLazy(\"SpotifyAPI\");\n\n const API_BASE = \"https://api.spotify.com/v1/me/player\";\n\n class SpotifyStore extends Store {\n public mPosition = 0;\n private start = 0;\n\n public track: Track | null = null;\n public device: Device | null = null;\n public isPlaying = false;\n public repeat: Repeat = \"off\";\n public shuffle = false;\n public volume = 0;\n\n public isSettingPosition = false;\n\n public openExternal(path: string) {\n const url = Settings.plugins.SpotifyControls.useSpotifyUris || Vencord.Plugins.isPluginEnabled(\"OpenInApp\")\n ? \"spotify:\" + path.replaceAll(\"/\", (_, idx) => idx === 0 ? \"\" : \":\")\n : \"https://open.spotify.com\" + path;\n\n VencordNative.native.openExternal(url);\n }\n\n // Need to keep track of this manually\n public get position(): number {\n let pos = this.mPosition;\n if (this.isPlaying) {\n pos += Date.now() - this.start;\n }\n return pos;\n }\n\n public set position(p: number) {\n this.mPosition = p;\n this.start = Date.now();\n }\n\n prev() {\n this.req(\"post\", \"/previous\");\n }\n\n next() {\n this.req(\"post\", \"/next\");\n }\n\n setVolume(percent: number) {\n this.req(\"put\", \"/volume\", {\n query: {\n volume_percent: Math.round(percent)\n }\n\n }).then(() => {\n this.volume = percent;\n this.emitChange();\n });\n }\n\n setPlaying(playing: boolean) {\n this.req(\"put\", playing ? \"/play\" : \"/pause\");\n }\n\n setRepeat(state: Repeat) {\n this.req(\"put\", \"/repeat\", {\n query: { state }\n });\n }\n\n setShuffle(state: boolean) {\n this.req(\"put\", \"/shuffle\", {\n query: { state }\n }).then(() => {\n this.shuffle = state;\n this.emitChange();\n });\n }\n\n seek(ms: number) {\n if (this.isSettingPosition) return Promise.resolve();\n\n this.isSettingPosition = true;\n\n return this.req(\"put\", \"/seek\", {\n query: {\n position_ms: Math.round(ms)\n }\n }).catch((e: any) => {\n console.error(\"[VencordSpotifyControls] Failed to seek\", e);\n this.isSettingPosition = false;\n });\n }\n\n private req(method: \"post\" | \"get\" | \"put\", route: string, data: any = {}) {\n if (this.device?.is_active)\n (data.query ??= {}).device_id = this.device.id;\n\n const { socket } = SpotifySocket.getActiveSocketAndDevice();\n return SpotifyUtils.SpotifyAPI[method](socket.accountId, socket.accessToken, {\n url: API_BASE + route,\n ...data\n });\n }\n }\n\n const store = new SpotifyStore(FluxDispatcher, {\n SPOTIFY_PLAYER_STATE(e: PlayerState) {\n store.track = e.track;\n store.device = e.device ?? null;\n store.isPlaying = e.isPlaying ?? false;\n store.volume = e.volumePercent ?? 0;\n store.repeat = e.actual_repeat || \"off\";\n store.position = e.position ?? 0;\n store.isSettingPosition = false;\n store.emitChange();\n },\n SPOTIFY_SET_DEVICES({ devices }: { devices: Device[]; }) {\n store.device = devices.find(d => d.is_active) ?? devices[0] ?? null;\n store.emitChange();\n }\n });\n\n return store;\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./spotifyStyles.css\";\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { ImageIcon, LinkIcon, OpenExternalIcon } from \"@components/Icons\";\nimport { debounce } from \"@utils/debounce\";\nimport { openImageModal } from \"@utils/discord\";\nimport { classes, copyWithToast } from \"@utils/misc\";\nimport { ContextMenu, FluxDispatcher, Forms, Menu, React, useEffect, useState, useStateFromStores } from \"@webpack/common\";\n\nimport { SpotifyStore, Track } from \"./SpotifyStore\";\n\nconst cl = (className: string) => `vc-spotify-${className}`;\n\nfunction msToHuman(ms: number) {\n const minutes = ms / 1000 / 60;\n const m = Math.floor(minutes);\n const s = Math.floor((minutes - m) * 60);\n return `${m.toString().padStart(2, \"0\")}:${s.toString().padStart(2, \"0\")}`;\n}\n\nfunction Svg(path: string, label: string) {\n return () => (\n \n \n \n );\n}\n\n// KraXen's icons :yesyes:\n// from https://fonts.google.com/icons?icon.style=Rounded&icon.set=Material+Icons\n// older material icon style, but still really good\nconst PlayButton = Svg(\"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18c.62-.39.62-1.29 0-1.69L9.54 5.98C8.87 5.55 8 6.03 8 6.82z\", \"play\");\nconst PauseButton = Svg(\"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z\", \"pause\");\nconst SkipPrev = Svg(\"M7 6c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1s-1-.45-1-1V7c0-.55.45-1 1-1zm3.66 6.82l5.77 4.07c.66.47 1.58-.01 1.58-.82V7.93c0-.81-.91-1.28-1.58-.82l-5.77 4.07c-.57.4-.57 1.24 0 1.64z\", \"previous\");\nconst SkipNext = Svg(\"M7.58 16.89l5.77-4.07c.56-.4.56-1.24 0-1.63L7.58 7.11C6.91 6.65 6 7.12 6 7.93v8.14c0 .81.91 1.28 1.58.82zM16 7v10c0 .55.45 1 1 1s1-.45 1-1V7c0-.55-.45-1-1-1s-1 .45-1 1z\", \"next\");\nconst Repeat = Svg(\"M7 7h10v1.79c0 .45.54.67.85.35l2.79-2.79c.2-.2.2-.51 0-.71l-2.79-2.79c-.31-.31-.85-.09-.85.36V5H6c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1V7zm10 10H7v-1.79c0-.45-.54-.67-.85-.35l-2.79 2.79c-.2.2-.2.51 0 .71l2.79 2.79c.31.31.85.09.85-.36V19h11c.55 0 1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1v3z\", \"repeat\");\nconst Shuffle = Svg(\"M10.59 9.17L6.12 4.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41l4.46 4.46 1.42-1.4zm4.76-4.32l1.19 1.19L4.7 17.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L17.96 7.46l1.19 1.19c.31.31.85.09.85-.36V4.5c0-.28-.22-.5-.5-.5h-3.79c-.45 0-.67.54-.36.85zm-.52 8.56l-1.41 1.41 3.13 3.13-1.2 1.2c-.31.31-.09.85.36.85h3.79c.28 0 .5-.22.5-.5v-3.79c0-.45-.54-.67-.85-.35l-1.19 1.19-3.13-3.14z\", \"shuffle\");\n\nfunction Button(props: React.ButtonHTMLAttributes) {\n return (\n \n {props.children}\n \n );\n}\n\nfunction CopyContextMenu({ name, path }: { name: string; path: string; }) {\n const copyId = `spotify-copy-${name}`;\n const openId = `spotify-open-${name}`;\n\n return (\n FluxDispatcher.dispatch({ type: \"CONTEXT_MENU_CLOSE\" })}\n aria-label={`Spotify ${name} Menu`}\n >\n copyWithToast(\"https://open.spotify.com\" + path)}\n icon={LinkIcon}\n />\n SpotifyStore.openExternal(path)}\n icon={OpenExternalIcon}\n />\n \n );\n}\n\nfunction makeContextMenu(name: string, path: string) {\n return (e: React.MouseEvent) =>\n ContextMenu.open(e, () => );\n}\n\nfunction Controls() {\n const [isPlaying, shuffle, repeat] = useStateFromStores(\n [SpotifyStore],\n () => [SpotifyStore.isPlaying, SpotifyStore.shuffle, SpotifyStore.repeat]\n );\n\n const [nextRepeat, repeatClassName] = (() => {\n switch (repeat) {\n case \"off\": return [\"context\", \"repeat-off\"] as const;\n case \"context\": return [\"track\", \"repeat-context\"] as const;\n case \"track\": return [\"off\", \"repeat-track\"] as const;\n default: throw new Error(`Invalid repeat state ${repeat}`);\n }\n })();\n\n // the 1 is using position absolute so it does not make the button jump around\n return (\n \n SpotifyStore.setShuffle(!shuffle)}\n >\n \n \n \n \n \n SpotifyStore.setRepeat(nextRepeat)}\n style={{ position: \"relative\" }}\n >\n {repeat === \"track\" && 1}\n \n \n \n );\n}\n\nconst seek = debounce((v: number) => {\n SpotifyStore.seek(v);\n});\n\nfunction SeekBar() {\n const { duration } = SpotifyStore.track!;\n\n const [storePosition, isSettingPosition, isPlaying] = useStateFromStores(\n [SpotifyStore],\n () => [SpotifyStore.mPosition, SpotifyStore.isSettingPosition, SpotifyStore.isPlaying]\n );\n\n const [position, setPosition] = useState(storePosition);\n\n // eslint-disable-next-line consistent-return\n useEffect(() => {\n if (isPlaying && !isSettingPosition) {\n setPosition(SpotifyStore.position);\n const interval = setInterval(() => {\n setPosition(p => p + 1000);\n }, 1000);\n\n return () => clearInterval(interval);\n }\n }, [storePosition, isSettingPosition, isPlaying]);\n\n return (\n
\n \n {msToHuman(position)}\n \n {\n if (isSettingPosition) return;\n setPosition(v);\n seek(v);\n }}\n renderValue={msToHuman}\n />\n \n {msToHuman(duration)}\n \n
\n );\n}\n\n\nfunction AlbumContextMenu({ track }: { track: Track; }) {\n const volume = useStateFromStores([SpotifyStore], () => SpotifyStore.volume);\n\n return (\n FluxDispatcher.dispatch({ type: \"CONTEXT_MENU_CLOSE\" })}\n aria-label=\"Spotify Album Menu\"\n >\n SpotifyStore.openExternal(`/album/${track.album.id}`)}\n icon={OpenExternalIcon}\n />\n openImageModal(track.album.image.url)}\n icon={ImageIcon}\n />\n (\n SpotifyStore.setVolume(v))}\n />\n )}\n />\n \n );\n}\n\nfunction makeLinkProps(name: string, condition: unknown, path: string) {\n if (!condition) return {};\n\n return {\n role: \"link\",\n onClick: () => SpotifyStore.openExternal(path),\n onContextMenu: makeContextMenu(name, path)\n } satisfies React.HTMLAttributes;\n}\n\nfunction Info({ track }: { track: Track; }) {\n const img = track?.album?.image;\n\n const [coverExpanded, setCoverExpanded] = useState(false);\n\n const i = (\n <>\n {img && (\n setCoverExpanded(!coverExpanded)}\n onContextMenu={e => {\n ContextMenu.open(e, () => );\n }}\n />\n )}\n \n );\n\n if (coverExpanded && img) return (\n
\n {i}\n
\n );\n\n return (\n
\n {i}\n
\n \n {track.name}\n \n {track.artists.some(a => a.name) && (\n \n by \n {track.artists.map((a, i) => (\n \n \n {a.name}\n \n {i !== track.artists.length - 1 && {\", \"}}\n \n ))}\n \n )}\n {track.album.name && (\n \n on \n \n {track.album.name}\n \n \n )}\n
\n
\n );\n}\n\nexport function Player() {\n const track = useStateFromStores(\n [SpotifyStore],\n () => SpotifyStore.track,\n null,\n (prev, next) => prev?.id ? (prev.id === next?.id) : prev?.name === next?.name\n );\n\n const device = useStateFromStores(\n [SpotifyStore],\n () => SpotifyStore.device,\n null,\n (prev, next) => prev?.id === next?.id\n );\n\n const isPlaying = useStateFromStores([SpotifyStore], () => SpotifyStore.isPlaying);\n const [shouldHide, setShouldHide] = useState(false);\n\n // Hide player after 5 minutes of inactivity\n // eslint-disable-next-line consistent-return\n React.useEffect(() => {\n setShouldHide(false);\n if (!isPlaying) {\n const timeout = setTimeout(() => setShouldHide(true), 1000 * 60 * 5);\n return () => clearTimeout(timeout);\n }\n }, [isPlaying]);\n\n if (!track || !device?.is_active || shouldHide)\n return null;\n\n return (\n (\n
\n

Failed to render Spotify Modal :(

\n

Check the console for errors

\n
\n )}>\n
\n \n \n \n
\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { disableStyle, enableStyle } from \"@api/Styles\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nimport hoverOnlyStyle from \"./hoverOnly.css?managed\";\nimport { Player } from \"./PlayerComponent\";\n\nfunction toggleHoverControls(value: boolean) {\n (value ? enableStyle : disableStyle)(hoverOnlyStyle);\n}\n\nexport default definePlugin({\n name: \"SpotifyControls\",\n description: \"Adds a Spotify player above the account panel\",\n authors: [Devs.Ven, Devs.afn, Devs.KraXen72],\n options: {\n hoverControls: {\n description: \"Show controls on hover\",\n type: OptionType.BOOLEAN,\n default: false,\n onChange: v => toggleHoverControls(v)\n },\n useSpotifyUris: {\n type: OptionType.BOOLEAN,\n description: \"Open Spotify URIs instead of Spotify URLs. Will only work if you have Spotify installed and might not work on all platforms\",\n default: false\n }\n },\n patches: [\n {\n find: \"showTaglessAccountPanel:\",\n replacement: {\n // return React.createElement(AccountPanel, { ..., showTaglessAccountPanel: blah })\n match: /return ?(.{0,30}\\(.{1,3},\\{[^}]+?,showTaglessAccountPanel:.+?\\}\\))/,\n // return [Player, Panel]\n replace: \"return [$self.renderPlayer(),$1]\"\n }\n },\n // Adds POST and a Marker to the SpotifyAPI (so we can easily find it)\n {\n find: \".PLAYER_DEVICES\",\n replacement: {\n match: /get:(\\i)\\.bind\\(null,(\\i\\.\\i)\\.get\\)/,\n replace: \"post:$1.bind(null,$2.post),$&\"\n }\n },\n // Discord doesn't give you the repeat kind, only a boolean\n {\n find: 'repeat:\"off\"!==',\n replacement: {\n match: /repeat:\"off\"!==(.{1,3}),/,\n replace: \"actual_repeat:$1,$&\"\n }\n }\n ],\n start: () => toggleHoverControls(Settings.plugins.SpotifyControls.hoverControls),\n renderPlayer: () => \n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nconst settings = definePluginSettings({\n noSpotifyAutoPause: {\n description: \"Disable Spotify auto-pause\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n },\n keepSpotifyActivityOnIdle: {\n description: \"Keep Spotify activity playing when idling\",\n type: OptionType.BOOLEAN,\n default: false,\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"SpotifyCrack\",\n description: \"Free listen along, no auto-pausing in voice chat, and allows activity to continue playing when idling\",\n authors: [Devs.Cyn, Devs.Nuckyz],\n settings,\n\n patches: [\n {\n\n find: 'dispatch({type:\"SPOTIFY_PROFILE_UPDATE\"',\n replacement: {\n match: /SPOTIFY_PROFILE_UPDATE.+?isPremium:(?=\"premium\"===(\\i)\\.body\\.product)/,\n replace: (m, req) => `${m}(${req}.body.product=\"premium\")&&`\n },\n },\n {\n find: '.displayName=\"SpotifyStore\"',\n replacement: [\n {\n predicate: () => settings.store.noSpotifyAutoPause,\n match: /(?<=function \\i\\(\\){)(?=.{0,200}SPOTIFY_AUTO_PAUSED\\))/,\n replace: \"return;\"\n },\n {\n predicate: () => settings.store.keepSpotifyActivityOnIdle,\n match: /(?<=shouldShowActivity\\(\\){.{0,50})&&!\\i\\.\\i\\.isIdle\\(\\)/,\n replace: \"\"\n }\n ]\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ApplicationCommandInputType, sendBotMessage } from \"@api/Commands\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { FluxDispatcher } from \"@webpack/common\";\n\ninterface Album {\n id: string;\n image: {\n height: number;\n width: number;\n url: string;\n };\n name: string;\n}\n\ninterface Artist {\n external_urls: {\n spotify: string;\n };\n href: string;\n id: string;\n name: string;\n type: \"artist\" | string;\n uri: string;\n}\n\ninterface Track {\n id: string;\n album: Album;\n artists: Artist[];\n duration: number;\n isLocal: boolean;\n name: string;\n}\n\nconst Spotify = findByPropsLazy(\"getPlayerState\");\nconst MessageCreator = findByPropsLazy(\"getSendMessageOptionsForReply\", \"sendMessage\");\nconst PendingReplyStore = findByPropsLazy(\"getPendingReply\");\n\nfunction sendMessage(channelId, message) {\n message = {\n // The following are required to prevent Discord from throwing an error\n invalidEmojis: [],\n tts: false,\n validNonShortcutEmojis: [],\n ...message\n };\n const reply = PendingReplyStore.getPendingReply(channelId);\n MessageCreator.sendMessage(channelId, message, void 0, MessageCreator.getSendMessageOptionsForReply(reply))\n .then(() => {\n if (reply) {\n FluxDispatcher.dispatch({ type: \"DELETE_PENDING_REPLY\", channelId });\n }\n });\n}\n\nexport default definePlugin({\n name: \"SpotifyShareCommands\",\n description: \"Share your current Spotify track, album or artist via slash command (/track, /album, /artist)\",\n authors: [Devs.katlyn],\n dependencies: [\"CommandsAPI\"],\n commands: [\n {\n name: \"track\",\n description: \"Send your current Spotify track to chat\",\n inputType: ApplicationCommandInputType.BUILT_IN,\n options: [],\n execute: (_, ctx) => {\n const track: Track | null = Spotify.getTrack();\n if (track === null) {\n sendBotMessage(ctx.channel.id, {\n content: \"You're not listening to any music.\"\n });\n return;\n }\n // Note: Due to how Discord handles commands, we need to manually create and send the message\n sendMessage(ctx.channel.id, {\n content: `https://open.spotify.com/track/${track.id}`\n });\n }\n },\n {\n name: \"album\",\n description: \"Send your current Spotify album to chat\",\n inputType: ApplicationCommandInputType.BUILT_IN,\n options: [],\n execute: (_, ctx) => {\n const track: Track | null = Spotify.getTrack();\n if (track === null) {\n sendBotMessage(ctx.channel.id, {\n content: \"You're not listening to any music.\"\n });\n return;\n }\n sendMessage(ctx.channel.id, {\n content: `https://open.spotify.com/album/${track.album.id}`\n });\n }\n },\n {\n name: \"artist\",\n description: \"Send your current Spotify artist to chat\",\n inputType: ApplicationCommandInputType.BUILT_IN,\n options: [],\n execute: (_, ctx) => {\n const track: Track | null = Spotify.getTrack();\n if (track === null) {\n sendBotMessage(ctx.channel.id, {\n content: \"You're not listening to any music.\"\n });\n return;\n }\n sendMessage(ctx.channel.id, {\n content: track.artists[0].external_urls.spotify\n });\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { Forms, React } from \"@webpack/common\";\n\ninterface AppStartPerformance {\n prefix: string;\n logs: Log[];\n logGroups: LogGroup[];\n endTime_: number;\n isTracing_: boolean;\n}\n\ninterface LogGroup {\n index: number;\n timestamp: number;\n logs: Log[];\n nativeLogs: any[];\n serverTrace: string;\n}\n\ninterface Log {\n emoji: string;\n prefix: string;\n log: string;\n timestamp?: number;\n delta?: number;\n}\n\nconst AppStartPerformance = findByPropsLazy(\"markWithDelta\", \"markAndLog\", \"markAt\") as AppStartPerformance;\n\ninterface TimerItemProps extends Log {\n instance: {\n sinceStart: number;\n sinceLast: number;\n };\n}\n\nfunction TimerItem({ emoji, prefix, log, delta, instance }: TimerItemProps) {\n return (\n \n {instance.sinceStart.toFixed(3)}s\n {instance.sinceLast.toFixed(3)}s\n {delta?.toFixed(0) ?? \"\"}\n
{emoji} {prefix ?? \" \"}{log}
\n
\n );\n}\n\ninterface TimingSectionProps {\n title: string;\n logs: Log[];\n traceEnd?: number;\n}\n\nfunction TimingSection({ title, logs, traceEnd }: TimingSectionProps) {\n const startTime = logs.find(l => l.timestamp)?.timestamp ?? 0;\n\n let lastTimestamp = startTime;\n const timings = logs.map(log => {\n // Get last log entry with valid timestamp\n const timestamp = log.timestamp ?? lastTimestamp;\n\n const sinceStart = (timestamp - startTime) / 1000;\n const sinceLast = (timestamp - lastTimestamp) / 1000;\n\n lastTimestamp = timestamp;\n\n return { sinceStart, sinceLast };\n });\n\n return (\n \n \n {traceEnd && (\n
\n Trace ended at: {(new Date(traceEnd)).toTimeString()}\n
\n )}\n
\n Start\n Interval\n Delta\n Event\n {AppStartPerformance.logs.map((log, i) => (\n \n ))}\n
\n
\n
\n );\n}\n\ninterface ServerTraceProps {\n trace: string;\n}\n\nfunction ServerTrace({ trace }: ServerTraceProps) {\n const lines = trace.split(\"\\n\");\n\n return (\n \n \n \n {lines.map(line => (\n {line}\n ))}\n \n \n \n );\n}\n\nfunction StartupTimingPage() {\n if (!AppStartPerformance?.logs) return
Loading...
;\n\n const serverTrace = AppStartPerformance.logGroups.find(g => g.serverTrace)?.serverTrace;\n\n return (\n \n \n {/* Lazy Divider */}\n
 
\n {serverTrace && }\n
\n );\n}\n\nexport default ErrorBoundary.wrap(StartupTimingPage);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport { LazyComponent } from \"@utils/react\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"StartupTimings\",\n description: \"Adds Startup Timings to the Settings menu\",\n authors: [Devs.Megu],\n patches: [{\n find: \"UserSettingsSections.PAYMENT_FLOW_MODAL_TEST_PAGE,\",\n replacement: {\n match: /{section:\\i\\.UserSettingsSections\\.PAYMENT_FLOW_MODAL_TEST_PAGE/,\n replace: '{section:\"StartupTimings\",label:\"Startup Timings\",element:$self.StartupTimingPage},$&'\n }\n }],\n StartupTimingPage: LazyComponent(() => require(\"./StartupTimingPage\").default)\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated, ant0n, FieryFlames and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nexport const settings = definePluginSettings({\n superReactByDefault: {\n type: OptionType.BOOLEAN,\n description: \"Reaction picker will default to Super Reactions\",\n default: true,\n },\n unlimitedSuperReactionPlaying: {\n type: OptionType.BOOLEAN,\n description: \"Remove the limit on Super Reactions playing at once\",\n default: false,\n },\n\n superReactionPlayingLimit: {\n description: \"Max Super Reactions to play at once\",\n type: OptionType.SLIDER,\n default: 20,\n markers: [5, 10, 20, 40, 60, 80, 100],\n stickToMarkers: true,\n },\n}, {\n superReactionPlayingLimit: {\n disabled() { return this.store.unlimitedSuperReactionPlaying; },\n }\n});\n\nexport default definePlugin({\n name: \"SuperReactionTweaks\",\n description: \"Customize the limit of Super Reactions playing at once, and super react by default\",\n authors: [Devs.FieryFlames, Devs.ant0n],\n patches: [\n {\n find: \",BURST_REACTION_EFFECT_PLAY\",\n replacement: {\n match: /(?<=BURST_REACTION_EFFECT_PLAY:\\i=>{.{50,100})(\\i\\(\\i,\\i\\))>=\\d+/,\n replace: \"!$self.shouldPlayBurstReaction($1)\"\n }\n },\n {\n find: \".hasAvailableBurstCurrency)\",\n replacement: {\n match: /(?<=\\.useBurstReactionsExperiment.{0,20})useState\\(!1\\)(?=.+?(\\i===\\i\\.EmojiIntention.REACTION))/,\n replace: \"useState($self.settings.store.superReactByDefault && $1)\"\n }\n }\n ],\n settings,\n\n shouldPlayBurstReaction(playingCount: number) {\n if (settings.store.unlimitedSuperReactionPlaying) return true;\n if (playingCount <= settings.store.superReactionPlayingLimit) return true;\n return false;\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { DataStore } from \"@api/index\";\nimport { addPreSendListener, removePreSendListener } from \"@api/MessageEvents\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Flex } from \"@components/Flex\";\nimport { DeleteIcon } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport { useForceUpdater } from \"@utils/react\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Button, Forms, React, TextInput, useState } from \"@webpack/common\";\n\nconst STRING_RULES_KEY = \"TextReplace_rulesString\";\nconst REGEX_RULES_KEY = \"TextReplace_rulesRegex\";\n\ntype Rule = Record<\"find\" | \"replace\" | \"onlyIfIncludes\", string>;\n\ninterface TextReplaceProps {\n title: string;\n rulesArray: Rule[];\n rulesKey: string;\n update: () => void;\n}\n\nconst makeEmptyRule: () => Rule = () => ({\n find: \"\",\n replace: \"\",\n onlyIfIncludes: \"\"\n});\nconst makeEmptyRuleArray = () => [makeEmptyRule()];\n\nlet stringRules = makeEmptyRuleArray();\nlet regexRules = makeEmptyRuleArray();\n\nconst settings = definePluginSettings({\n replace: {\n type: OptionType.COMPONENT,\n description: \"\",\n component: () => {\n const update = useForceUpdater();\n return (\n <>\n \n \n \n \n );\n }\n },\n});\n\nfunction stringToRegex(str: string) {\n const match = str.match(/^(\\/)?(.+?)(?:\\/([gimsuy]*))?$/); // Regex to match regex\n return match\n ? new RegExp(\n match[2], // Pattern\n match[3]\n ?.split(\"\") // Remove duplicate flags\n .filter((char, pos, flagArr) => flagArr.indexOf(char) === pos)\n .join(\"\")\n ?? \"g\"\n )\n : new RegExp(str); // Not a regex, return string\n}\n\nfunction renderFindError(find: string) {\n try {\n stringToRegex(find);\n return null;\n } catch (e) {\n return (\n \n {String(e)}\n \n );\n }\n}\n\nfunction Input({ initialValue, onChange, placeholder }: {\n placeholder: string;\n initialValue: string;\n onChange(value: string): void;\n}) {\n const [value, setValue] = useState(initialValue);\n return (\n value !== initialValue && onChange(value)}\n />\n );\n}\n\nfunction TextReplace({ title, rulesArray, rulesKey, update }: TextReplaceProps) {\n const isRegexRules = title === \"Using Regex\";\n\n async function onClickRemove(index: number) {\n if (index === rulesArray.length - 1) return;\n rulesArray.splice(index, 1);\n\n await DataStore.set(rulesKey, rulesArray);\n update();\n }\n\n async function onChange(e: string, index: number, key: string) {\n if (index === rulesArray.length - 1)\n rulesArray.push(makeEmptyRule());\n\n rulesArray[index][key] = e;\n\n if (rulesArray[index].find === \"\" && rulesArray[index].replace === \"\" && rulesArray[index].onlyIfIncludes === \"\" && index !== rulesArray.length - 1)\n rulesArray.splice(index, 1);\n\n await DataStore.set(rulesKey, rulesArray);\n update();\n }\n\n return (\n <>\n {title}\n \n {\n rulesArray.map((rule, index) =>\n \n \n \n onChange(e, index, \"find\")}\n />\n onChange(e, index, \"replace\")}\n />\n onChange(e, index, \"onlyIfIncludes\")}\n />\n \n onClickRemove(index)}\n style={{\n background: \"none\",\n color: \"var(--status-danger)\",\n ...(index === rulesArray.length - 1\n ? {\n visibility: \"hidden\",\n pointerEvents: \"none\"\n }\n : {}\n )\n }}\n >\n \n \n \n {isRegexRules && renderFindError(rule.find)}\n \n )\n }\n \n \n );\n}\n\nfunction TextReplaceTesting() {\n const [value, setValue] = useState(\"\");\n return (\n <>\n Test Rules\n \n \n \n );\n}\n\nfunction applyRules(content: string): string {\n if (content.length === 0)\n return content;\n\n if (stringRules) {\n for (const rule of stringRules) {\n if (!rule.find || !rule.replace) continue;\n if (rule.onlyIfIncludes && !content.includes(rule.onlyIfIncludes)) continue;\n\n content = ` ${content} `.replaceAll(rule.find, rule.replace.replaceAll(\"\\\\n\", \"\\n\")).replace(/^\\s|\\s$/g, \"\");\n }\n }\n\n if (regexRules) {\n for (const rule of regexRules) {\n if (!rule.find || !rule.replace) continue;\n if (rule.onlyIfIncludes && !content.includes(rule.onlyIfIncludes)) continue;\n\n try {\n const regex = stringToRegex(rule.find);\n content = content.replace(regex, rule.replace.replaceAll(\"\\\\n\", \"\\n\"));\n } catch (e) {\n new Logger(\"TextReplace\").error(`Invalid regex: ${rule.find}`);\n }\n }\n }\n\n content = content.trim();\n return content;\n}\n\nconst TEXT_REPLACE_RULES_CHANNEL_ID = \"1102784112584040479\";\n\nexport default definePlugin({\n name: \"TextReplace\",\n description: \"Replace text in your messages. You can find pre-made rules in the #textreplace-rules channel in Vencord's Server\",\n authors: [Devs.AutumnVN, Devs.TheKodeToad],\n dependencies: [\"MessageEventsAPI\"],\n\n settings,\n\n async start() {\n stringRules = await DataStore.get(STRING_RULES_KEY) ?? makeEmptyRuleArray();\n regexRules = await DataStore.get(REGEX_RULES_KEY) ?? makeEmptyRuleArray();\n\n this.preSend = addPreSendListener((channelId, msg) => {\n // Channel used for sharing rules, applying rules here would be messy\n if (channelId === TEXT_REPLACE_RULES_CHANNEL_ID) return;\n msg.content = applyRules(msg.content);\n });\n },\n\n stop() {\n removePreSendListener(this.preSend);\n }\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { UserStore } from \"@webpack/common\";\nimport { Message } from \"discord-types/general\";\n\nexport default definePlugin({\n name: \"ThemeAttributes\",\n description: \"Adds data attributes to various elements for theming purposes\",\n authors: [Devs.Ven],\n\n patches: [\n // Add data-tab-id to all tab bar items\n // This for examples applies to the User and Server settings sidebars\n {\n find: \".tabBarRef\",\n replacement: {\n match: /style:this\\.getStyle\\(\\),role:\"tab\"/,\n replace: \"$&,'data-tab-id':this.props.id\"\n }\n },\n\n // Add data-author-id and data-is-self to all messages\n {\n find: \".messageListItem\",\n replacement: {\n match: /\\.messageListItem(?=,\"aria)/,\n replace: \"$&,...$self.getMessageProps(arguments[0])\"\n }\n }\n ],\n\n getMessageProps(props: { message: Message; }) {\n const authorId = props.message?.author?.id;\n return {\n \"data-author-id\": authorId,\n \"data-is-self\": authorId && authorId === UserStore.getCurrentUser()?.id\n };\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"TimeBarAllActivities\",\n description: \"Adds the Spotify time bar to all activities if they have start and end timestamps\",\n authors: [Devs.obscurity],\n patches: [\n {\n find: \"}renderTimeBar(\",\n replacement: {\n match: /renderTimeBar\\((.{1,3})\\){.{0,50}?let/,\n replace: \"renderTimeBar($1){let\"\n }\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { OptionType } from \"@utils/types\";\n\nexport const settings = definePluginSettings({\n receivedInput: {\n type: OptionType.STRING,\n description: \"Input language for received messages\",\n default: \"auto\",\n hidden: true\n },\n receivedOutput: {\n type: OptionType.STRING,\n description: \"Output language for received messages\",\n default: \"en\",\n hidden: true\n },\n sentInput: {\n type: OptionType.STRING,\n description: \"Input language for sent messages\",\n default: \"auto\",\n hidden: true\n },\n sentOutput: {\n type: OptionType.STRING,\n description: \"Output language for sent messages\",\n default: \"en\",\n hidden: true\n },\n autoTranslate: {\n type: OptionType.BOOLEAN,\n description: \"Automatically translate your messages before sending. You can also shift/right click the translate button to toggle this\",\n default: false\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n/*\nTo generate:\n- Visit https://translate.google.com/?sl=auto&tl=en&op=translate\n- Open Language dropdown\n- Open Devtools and use the element picker to pick the root of the language picker\n- Right click on the element in devtools and click \"Store as global variable\"\n\ncopy(Object.fromEntries(\n Array.from(\n temp1.querySelectorAll(\"[data-language-code]\"),\n e => [e.dataset.languageCode, e.children[1].textContent]\n ).sort((a, b) => a[1] === \"Detect language\" ? -1 : b[1] === \"Detect language\" ? 1 : a[1].localeCompare(b[1]))\n))\n*/\n\nexport type Language = keyof typeof Languages;\n\nexport const Languages = {\n \"auto\": \"Detect language\",\n \"af\": \"Afrikaans\",\n \"sq\": \"Albanian\",\n \"am\": \"Amharic\",\n \"ar\": \"Arabic\",\n \"hy\": \"Armenian\",\n \"as\": \"Assamese\",\n \"ay\": \"Aymara\",\n \"az\": \"Azerbaijani\",\n \"bm\": \"Bambara\",\n \"eu\": \"Basque\",\n \"be\": \"Belarusian\",\n \"bn\": \"Bengali\",\n \"bho\": \"Bhojpuri\",\n \"bs\": \"Bosnian\",\n \"bg\": \"Bulgarian\",\n \"ca\": \"Catalan\",\n \"ceb\": \"Cebuano\",\n \"ny\": \"Chichewa\",\n \"zh-CN\": \"Chinese (Simplified)\",\n \"zh-TW\": \"Chinese (Traditional)\",\n \"co\": \"Corsican\",\n \"hr\": \"Croatian\",\n \"cs\": \"Czech\",\n \"da\": \"Danish\",\n \"dv\": \"Dhivehi\",\n \"doi\": \"Dogri\",\n \"nl\": \"Dutch\",\n \"en\": \"English\",\n \"eo\": \"Esperanto\",\n \"et\": \"Estonian\",\n \"ee\": \"Ewe\",\n \"tl\": \"Filipino\",\n \"fi\": \"Finnish\",\n \"fr\": \"French\",\n \"fy\": \"Frisian\",\n \"gl\": \"Galician\",\n \"ka\": \"Georgian\",\n \"de\": \"German\",\n \"el\": \"Greek\",\n \"gn\": \"Guarani\",\n \"gu\": \"Gujarati\",\n \"ht\": \"Haitian Creole\",\n \"ha\": \"Hausa\",\n \"haw\": \"Hawaiian\",\n \"iw\": \"Hebrew\",\n \"hi\": \"Hindi\",\n \"hmn\": \"Hmong\",\n \"hu\": \"Hungarian\",\n \"is\": \"Icelandic\",\n \"ig\": \"Igbo\",\n \"ilo\": \"Ilocano\",\n \"id\": \"Indonesian\",\n \"ga\": \"Irish\",\n \"it\": \"Italian\",\n \"ja\": \"Japanese\",\n \"jw\": \"Javanese\",\n \"kn\": \"Kannada\",\n \"kk\": \"Kazakh\",\n \"km\": \"Khmer\",\n \"rw\": \"Kinyarwanda\",\n \"gom\": \"Konkani\",\n \"ko\": \"Korean\",\n \"kri\": \"Krio\",\n \"ku\": \"Kurdish (Kurmanji)\",\n \"ckb\": \"Kurdish (Sorani)\",\n \"ky\": \"Kyrgyz\",\n \"lo\": \"Lao\",\n \"la\": \"Latin\",\n \"lv\": \"Latvian\",\n \"ln\": \"Lingala\",\n \"lt\": \"Lithuanian\",\n \"lg\": \"Luganda\",\n \"lb\": \"Luxembourgish\",\n \"mk\": \"Macedonian\",\n \"mai\": \"Maithili\",\n \"mg\": \"Malagasy\",\n \"ms\": \"Malay\",\n \"ml\": \"Malayalam\",\n \"mt\": \"Maltese\",\n \"mi\": \"Maori\",\n \"mr\": \"Marathi\",\n \"mni-Mtei\": \"Meiteilon (Manipuri)\",\n \"lus\": \"Mizo\",\n \"mn\": \"Mongolian\",\n \"my\": \"Myanmar (Burmese)\",\n \"ne\": \"Nepali\",\n \"no\": \"Norwegian\",\n \"or\": \"Odia (Oriya)\",\n \"om\": \"Oromo\",\n \"ps\": \"Pashto\",\n \"fa\": \"Persian\",\n \"pl\": \"Polish\",\n \"pt\": \"Portuguese\",\n \"pa\": \"Punjabi\",\n \"qu\": \"Quechua\",\n \"ro\": \"Romanian\",\n \"ru\": \"Russian\",\n \"sm\": \"Samoan\",\n \"sa\": \"Sanskrit\",\n \"gd\": \"Scots Gaelic\",\n \"nso\": \"Sepedi\",\n \"sr\": \"Serbian\",\n \"st\": \"Sesotho\",\n \"sn\": \"Shona\",\n \"sd\": \"Sindhi\",\n \"si\": \"Sinhala\",\n \"sk\": \"Slovak\",\n \"sl\": \"Slovenian\",\n \"so\": \"Somali\",\n \"es\": \"Spanish\",\n \"su\": \"Sundanese\",\n \"sw\": \"Swahili\",\n \"sv\": \"Swedish\",\n \"tg\": \"Tajik\",\n \"ta\": \"Tamil\",\n \"tt\": \"Tatar\",\n \"te\": \"Telugu\",\n \"th\": \"Thai\",\n \"ti\": \"Tigrinya\",\n \"ts\": \"Tsonga\",\n \"tr\": \"Turkish\",\n \"tk\": \"Turkmen\",\n \"ak\": \"Twi\",\n \"uk\": \"Ukrainian\",\n \"ur\": \"Urdu\",\n \"ug\": \"Uyghur\",\n \"uz\": \"Uzbek\",\n \"vi\": \"Vietnamese\",\n \"cy\": \"Welsh\",\n \"xh\": \"Xhosa\",\n \"yi\": \"Yiddish\",\n \"yo\": \"Yoruba\",\n \"zu\": \"Zulu\"\n} as const;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { classNameFactory } from \"@api/Styles\";\n\nimport { settings } from \"./settings\";\n\nexport const cl = classNameFactory(\"vc-trans-\");\n\ninterface TranslationData {\n src: string;\n sentences: {\n // \uD83C\uDFF3\uFE0F\u200D\u26A7\uFE0F\n trans: string;\n }[];\n}\n\nexport interface TranslationValue {\n src: string;\n text: string;\n}\n\nexport async function translate(kind: \"received\" | \"sent\", text: string): Promise {\n const sourceLang = settings.store[kind + \"Input\"];\n const targetLang = settings.store[kind + \"Output\"];\n\n const url = \"https://translate.googleapis.com/translate_a/single?\" + new URLSearchParams({\n // see https://stackoverflow.com/a/29537590 for more params\n // holy shidd nvidia\n client: \"gtx\",\n // source language\n sl: sourceLang,\n // target language\n tl: targetLang,\n // what to return, t = translation probably\n dt: \"t\",\n // Send json object response instead of weird array\n dj: \"1\",\n source: \"input\",\n // query, duh\n q: text\n });\n\n const res = await fetch(url);\n if (!res.ok)\n throw new Error(\n `Failed to translate \"${text}\" (${sourceLang} -> ${targetLang})`\n + `\\n${res.status} ${res.statusText}`\n );\n\n const { src, sentences }: TranslationData = await res.json();\n\n return {\n src,\n text: sentences.\n map(s => s?.trans).\n filter(Boolean).\n join(\"\")\n };\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Margins } from \"@utils/margins\";\nimport { ModalCloseButton, ModalContent, ModalHeader, ModalProps, ModalRoot } from \"@utils/modal\";\nimport { Forms, SearchableSelect, Switch, useMemo } from \"@webpack/common\";\n\nimport { Languages } from \"./languages\";\nimport { settings } from \"./settings\";\nimport { cl } from \"./utils\";\n\nconst LanguageSettingKeys = [\"receivedInput\", \"receivedOutput\", \"sentInput\", \"sentOutput\"] as const;\n\nfunction LanguageSelect({ settingsKey, includeAuto }: { settingsKey: typeof LanguageSettingKeys[number]; includeAuto: boolean; }) {\n const currentValue = settings.use([settingsKey])[settingsKey];\n\n const options = useMemo(\n () => {\n const options = Object.entries(Languages).map(([value, label]) => ({ value, label }));\n if (!includeAuto)\n options.shift();\n\n return options;\n }, []\n );\n\n return (\n
\n \n {settings.def[settingsKey].description}\n \n\n o.value === currentValue)}\n placeholder={\"Select a language\"}\n maxVisibleItems={5}\n closeOnSelect={true}\n onChange={v => settings.store[settingsKey] = v}\n />\n
\n );\n}\n\nfunction AutoTranslateToggle() {\n const value = settings.use([\"autoTranslate\"]).autoTranslate;\n\n return (\n settings.store.autoTranslate = v}\n note={settings.def.autoTranslate.description}\n hideBorder\n >\n Auto Translate\n \n );\n}\n\n\nexport function TranslateModal({ rootProps }: { rootProps: ModalProps; }) {\n return (\n \n \n \n Translate\n \n \n \n\n \n {LanguageSettingKeys.map(s => (\n \n ))}\n\n \n\n \n \n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { classes } from \"@utils/misc\";\nimport { openModal } from \"@utils/modal\";\nimport { Button, ButtonLooks, ButtonWrapperClasses, Tooltip } from \"@webpack/common\";\n\nimport { settings } from \"./settings\";\nimport { TranslateModal } from \"./TranslateModal\";\nimport { cl } from \"./utils\";\n\nexport function TranslateIcon({ height = 24, width = 24, className }: { height?: number; width?: number; className?: string; }) {\n return (\n \n \n \n );\n}\n\nexport function TranslateChatBarIcon({ slateProps }: { slateProps: { type: { analyticsName: string; }; }; }) {\n const { autoTranslate } = settings.use([\"autoTranslate\"]);\n\n if (slateProps.type.analyticsName !== \"normal\")\n return null;\n\n const toggle = () => settings.store.autoTranslate = !autoTranslate;\n\n return (\n \n {({ onMouseEnter, onMouseLeave }) => (\n
\n {\n if (e.shiftKey) return toggle();\n\n openModal(props => (\n \n ));\n }}\n onContextMenu={() => toggle()}\n style={{ padding: \"0 4px\" }}\n >\n
\n \n
\n \n
\n )}\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Parser, useEffect, useState } from \"@webpack/common\";\nimport { Message } from \"discord-types/general\";\n\nimport { Languages } from \"./languages\";\nimport { TranslateIcon } from \"./TranslateIcon\";\nimport { cl, TranslationValue } from \"./utils\";\n\nconst TranslationSetters = new Map void>();\n\nexport function handleTranslate(messageId: string, data: TranslationValue) {\n TranslationSetters.get(messageId)!(data);\n}\n\nfunction Dismiss({ onDismiss }: { onDismiss: () => void; }) {\n return (\n \n Dismiss\n \n );\n}\n\nexport function TranslationAccessory({ message }: { message: Message; }) {\n const [translation, setTranslation] = useState();\n\n useEffect(() => {\n // Ignore MessageLinkEmbeds messages\n if ((message as any).vencordEmbeddedBy) return;\n\n TranslationSetters.set(message.id, setTranslation);\n\n return () => void TranslationSetters.delete(message.id);\n }, []);\n\n if (!translation) return null;\n\n return (\n \n \n {Parser.parse(translation.text)}\n {\" \"}\n (translated from {Languages[translation.src] ?? translation.src} - setTranslation(undefined)} />)\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { addAccessory, removeAccessory } from \"@api/MessageAccessories\";\nimport { addPreSendListener, removePreSendListener } from \"@api/MessageEvents\";\nimport { addButton, removeButton } from \"@api/MessagePopover\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { ChannelStore, Menu } from \"@webpack/common\";\n\nimport { settings } from \"./settings\";\nimport { TranslateChatBarIcon, TranslateIcon } from \"./TranslateIcon\";\nimport { handleTranslate, TranslationAccessory } from \"./TranslationAccessory\";\nimport { translate } from \"./utils\";\n\nconst messageCtxPatch: NavContextMenuPatchCallback = (children, { message }) => () => {\n if (!message.content) return;\n\n const group = findGroupChildrenByChildId(\"copy-text\", children);\n if (!group) return;\n\n group.splice(group.findIndex(c => c?.props?.id === \"copy-text\") + 1, 0, (\n {\n const trans = await translate(\"received\", message.content);\n handleTranslate(message.id, trans);\n }}\n />\n ));\n};\n\nexport default definePlugin({\n name: \"Translate\",\n description: \"Translate messages with Google Translate\",\n authors: [Devs.Ven],\n dependencies: [\"MessageAccessoriesAPI\", \"MessagePopoverAPI\", \"MessageEventsAPI\"],\n settings,\n // not used, just here in case some other plugin wants it or w/e\n translate,\n\n patches: [\n {\n find: \"ChannelTextAreaButtons\",\n replacement: {\n match: /(\\i)\\.push.{1,30}disabled:(\\i),.{1,20}\\},\"gift\"\\)\\)/,\n replace: \"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()\",\n }\n },\n ],\n\n start() {\n addAccessory(\"vc-translation\", props => );\n\n addContextMenuPatch(\"message\", messageCtxPatch);\n\n addButton(\"vc-translate\", message => {\n if (!message.content) return null;\n\n return {\n label: \"Translate\",\n icon: TranslateIcon,\n message,\n channel: ChannelStore.getChannel(message.channel_id),\n onClick: async () => {\n const trans = await translate(\"received\", message.content);\n handleTranslate(message.id, trans);\n }\n };\n });\n\n this.preSend = addPreSendListener(async (_, message) => {\n if (!settings.store.autoTranslate) return;\n if (!message.content) return;\n\n message.content = (await translate(\"sent\", message.content)).text;\n });\n },\n\n stop() {\n removePreSendListener(this.preSend);\n removeContextMenuPatch(\"message\", messageCtxPatch);\n removeButton(\"vc-translate\");\n removeAccessory(\"vc-translation\");\n },\n\n chatBarIcon: (slateProps: any) => (\n \n \n \n )\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { openUserProfile } from \"@utils/discord\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Avatar, GuildMemberStore, React, RelationshipStore } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\n\nconst settings = definePluginSettings({\n showAvatars: {\n type: OptionType.BOOLEAN,\n default: true,\n description: \"Show avatars in the typing indicator\"\n },\n showRoleColors: {\n type: OptionType.BOOLEAN,\n default: true,\n description: \"Show role colors in the typing indicator\"\n },\n alternativeFormatting: {\n type: OptionType.BOOLEAN,\n default: true,\n description: \"Show a more useful message when several users are typing\"\n }\n});\n\nexport function buildSeveralUsers({ a, b, count }: { a: string, b: string, count: number; }) {\n return [\n {a},\n \", \",\n {b},\n `, and ${count} others are typing...`\n ];\n}\n\ninterface Props {\n user: User;\n guildId: string;\n}\n\nconst TypingUser = ErrorBoundary.wrap(function ({ user, guildId }: Props) {\n return (\n {\n openUserProfile(user.id);\n }}\n style={{\n display: \"grid\",\n gridAutoFlow: \"column\",\n gap: \"4px\",\n color: settings.store.showRoleColors ? GuildMemberStore.getMember(guildId, user.id)?.colorString : undefined,\n cursor: \"pointer\"\n }}\n >\n {settings.store.showAvatars && (\n
\n \n
\n )}\n {GuildMemberStore.getNick(guildId!, user.id)\n || (!guildId && RelationshipStore.getNickname(user.id))\n || (user as any).globalName\n || user.username\n }\n \n );\n}, { noop: true });\n\nexport default definePlugin({\n name: \"TypingTweaks\",\n description: \"Show avatars and role colours in the typing indicator\",\n authors: [Devs.zt],\n patches: [\n // Style the indicator and add function call to modify the children before rendering\n {\n find: \"getCooldownTextStyle\",\n replacement: {\n match: /(?<=children:\\[(\\i)\\.length>0.{0,200}?\"aria-atomic\":!0,children:)\\i/,\n replace: \"$self.mutateChildren(this.props, $1, $&), style: $self.TYPING_TEXT_STYLE\"\n }\n },\n // Changes the indicator to keep the user object when creating the list of typing users\n {\n find: \"getCooldownTextStyle\",\n replacement: {\n match: /(?<=map\\(\\i=>)\\i\\.\\i\\.getName\\(\\i,this\\.props\\.channel\\.id,(\\i)\\)/,\n replace: \"$1\"\n }\n },\n // Adds the alternative formatting for several users typing\n {\n find: \"getCooldownTextStyle\",\n replacement: {\n match: /(?<=(\\i)\\.length\\?\\i.\\i\\.Messages.THREE_USERS_TYPING\\.format\\({\\i:(\\i),(?:\\i:)?(\\i),\\i:\\i}\\):)\\i\\.\\i\\.Messages\\.SEVERAL_USERS_TYPING/,\n replace: (_, users, a, b) => `$self.buildSeveralUsers({ a: ${a}, b: ${b}, count: ${users}.length - 2 })`\n },\n predicate: () => settings.store.alternativeFormatting\n }\n ],\n settings,\n\n TYPING_TEXT_STYLE: {\n display: \"grid\",\n gridAutoFlow: \"column\",\n gridGap: \"0.25em\"\n },\n\n buildSeveralUsers,\n\n mutateChildren(props: any, users: User[], children: any) {\n if (!Array.isArray(children)) return children;\n\n let element = 0;\n\n return children.map(c =>\n c.type === \"strong\"\n ? \n : c\n );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings, Settings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { LazyComponent } from \"@utils/react\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { find, findLazy, findStoreLazy } from \"@webpack\";\nimport { ChannelStore, GuildMemberStore, RelationshipStore, Tooltip, UserStore, useStateFromStores } from \"@webpack/common\";\n\nimport { buildSeveralUsers } from \"../typingTweaks\";\n\nconst ThreeDots = LazyComponent(() => {\n // This doesn't really need to explicitly find Dots' own module, but it's fine\n const res = find(m => m.Dots && !m.Menu);\n\n return res?.Dots;\n});\n\nconst TypingStore = findStoreLazy(\"TypingStore\");\nconst UserGuildSettingsStore = findStoreLazy(\"UserGuildSettingsStore\");\n\nconst Formatters = findLazy(m => m.Messages?.SEVERAL_USERS_TYPING);\n\nfunction getDisplayName(guildId: string, userId: string) {\n return GuildMemberStore.getNick(guildId, userId) ?? UserStore.getUser(userId).username;\n}\n\nfunction TypingIndicator({ channelId }: { channelId: string; }) {\n const typingUsers: Record = useStateFromStores(\n [TypingStore],\n () => ({ ...TypingStore.getTypingUsers(channelId) as Record }),\n null,\n (old, current) => {\n const oldKeys = Object.keys(old);\n const currentKeys = Object.keys(current);\n\n return oldKeys.length === currentKeys.length && JSON.stringify(oldKeys) === JSON.stringify(currentKeys);\n }\n );\n\n const guildId = ChannelStore.getChannel(channelId).guild_id;\n\n if (!settings.store.includeMutedChannels) {\n const isChannelMuted = UserGuildSettingsStore.isChannelMuted(guildId, channelId);\n if (isChannelMuted) return null;\n }\n\n const myId = UserStore.getCurrentUser()?.id;\n\n const typingUsersArray = Object.keys(typingUsers).filter(id => id !== myId && !(RelationshipStore.isBlocked(id) && !settings.store.includeBlockedUsers));\n let tooltipText: string;\n\n switch (typingUsersArray.length) {\n case 0: break;\n case 1: {\n tooltipText = Formatters.Messages.ONE_USER_TYPING.format({ a: getDisplayName(guildId, typingUsersArray[0]) });\n break;\n }\n case 2: {\n tooltipText = Formatters.Messages.TWO_USERS_TYPING.format({ a: getDisplayName(guildId, typingUsersArray[0]), b: getDisplayName(guildId, typingUsersArray[1]) });\n break;\n }\n case 3: {\n tooltipText = Formatters.Messages.THREE_USERS_TYPING.format({ a: getDisplayName(guildId, typingUsersArray[0]), b: getDisplayName(guildId, typingUsersArray[1]), c: getDisplayName(guildId, typingUsersArray[2]) });\n break;\n }\n default: {\n tooltipText = Settings.plugins.TypingTweaks.enabled\n ? buildSeveralUsers({ a: getDisplayName(guildId, typingUsersArray[0]), b: getDisplayName(guildId, typingUsersArray[1]), count: typingUsersArray.length - 2 })\n : Formatters.Messages.SEVERAL_USERS_TYPING;\n break;\n }\n }\n\n if (typingUsersArray.length > 0) {\n return (\n \n {({ onMouseLeave, onMouseEnter }) => (\n \n \n \n )}\n \n );\n }\n\n return null;\n}\n\nconst settings = definePluginSettings({\n includeMutedChannels: {\n type: OptionType.BOOLEAN,\n description: \"Whether to show the typing indicator for muted channels.\",\n default: false\n },\n includeBlockedUsers: {\n type: OptionType.BOOLEAN,\n description: \"Whether to show the typing indicator for blocked users.\",\n default: false\n }\n});\n\nexport default definePlugin({\n name: \"TypingIndicator\",\n description: \"Adds an indicator if someone is typing on a channel.\",\n authors: [Devs.Nuckyz, Devs.obscurity],\n settings,\n\n patches: [\n {\n find: \".UNREAD_HIGHLIGHT\",\n replacement: {\n match: /channel:(\\i).{0,100}?channelEmoji,.{0,250}?\\.children.{0,50}?:null/,\n replace: \"$&,$self.TypingIndicator($1.id)\"\n }\n }\n ],\n\n TypingIndicator: (channelId: string) => (\n \n \n \n ),\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addPreEditListener, addPreSendListener, MessageObject, removePreEditListener, removePreSendListener } from \"@api/MessageEvents\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"Unindent\",\n description: \"Trims leading indentation from codeblocks\",\n authors: [Devs.Ven],\n dependencies: [\"MessageEventsAPI\"],\n patches: [\n {\n find: \"inQuote:\",\n replacement: {\n match: /,content:([^,]+),inQuote/,\n replace: (_, content) => `,content:Vencord.Plugins.plugins.Unindent.unindent(${content}),inQuote`\n }\n }\n ],\n\n unindent(str: string) {\n // Users cannot send tabs, they get converted to spaces. However, a bot may send tabs, so convert them to 4 spaces first\n str = str.replace(/\\t/g, \" \");\n const minIndent = str.match(/^ *(?=\\S)/gm)\n ?.reduce((prev, curr) => Math.min(prev, curr.length), Infinity) ?? 0;\n\n if (!minIndent) return str;\n return str.replace(new RegExp(`^ {${minIndent}}`, \"gm\"), \"\");\n },\n\n unindentMsg(msg: MessageObject) {\n msg.content = msg.content.replace(/```(.|\\n)*?```/g, m => {\n const lines = m.split(\"\\n\");\n if (lines.length < 2) return m; // Do not affect inline codeblocks\n let suffix = \"\";\n if (lines[lines.length - 1] === \"```\") suffix = lines.pop()!;\n return `${lines[0]}\\n${this.unindent(lines.slice(1).join(\"\\n\"))}\\n${suffix}`;\n });\n },\n\n start() {\n this.preSend = addPreSendListener((_, msg) => this.unindentMsg(msg));\n this.preEdit = addPreEditListener((_cid, _mid, msg) => this.unindentMsg(msg));\n },\n\n stop() {\n removePreSendListener(this.preSend);\n removePreEditListener(this.preEdit);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { ImageInvisible, ImageVisible } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { Menu, PermissionsBits, PermissionStore, RestAPI, UserStore } from \"@webpack/common\";\n\nconst EMBED_SUPPRESSED = 1 << 2;\n\nconst messageContextMenuPatch: NavContextMenuPatchCallback = (children, { channel, message: { author, embeds, flags, id: messageId } }) => () => {\n const isEmbedSuppressed = (flags & EMBED_SUPPRESSED) !== 0;\n if (!isEmbedSuppressed && !embeds.length) return;\n\n const hasEmbedPerms = channel.isPrivate() || !!(PermissionStore.getChannelPermissions({ id: channel.id }) & PermissionsBits.EMBED_LINKS);\n if (author.id === UserStore.getCurrentUser().id && !hasEmbedPerms) return;\n\n const menuGroup = findGroupChildrenByChildId(\"delete\", children);\n const deleteIndex = menuGroup?.findIndex(i => i?.props?.id === \"delete\");\n if (!deleteIndex || !menuGroup) return;\n\n menuGroup.splice(deleteIndex - 1, 0, (\n \n RestAPI.patch({\n url: `/channels/${channel.id}/messages/${messageId}`,\n body: { flags: isEmbedSuppressed ? flags & ~EMBED_SUPPRESSED : flags | EMBED_SUPPRESSED }\n })\n }\n />\n ));\n};\n\nexport default definePlugin({\n name: \"UnsuppressEmbeds\",\n authors: [Devs.rad, Devs.HypedDomi],\n description: \"Allows you to unsuppress embeds in messages\",\n\n start() {\n addContextMenuPatch(\"message\", messageContextMenuPatch);\n },\n\n stop() {\n removeContextMenuPatch(\"message\", messageContextMenuPatch);\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ApplicationCommandOptionType, sendBotMessage } from \"@api/Commands\";\nimport { ApplicationCommandInputType } from \"@api/Commands/types\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"UrbanDictionary\",\n description: \"Search for a word on Urban Dictionary via /urban slash command\",\n authors: [Devs.jewdev],\n dependencies: [\"CommandsAPI\"],\n commands: [\n {\n name: \"urban\",\n description: \"Returns the definition of a word from Urban Dictionary\",\n inputType: ApplicationCommandInputType.BUILT_IN,\n options: [\n {\n type: ApplicationCommandOptionType.STRING,\n name: \"word\",\n description: \"The word to search for on Urban Dictionary\",\n required: true\n }\n ],\n execute: async (args, ctx) => {\n try {\n const query = encodeURIComponent(args[0].value);\n const { list: [definition] } = await (await fetch(`https://api.urbandictionary.com/v0/define?term=${query}`)).json();\n\n if (!definition)\n return void sendBotMessage(ctx.channel.id, { content: \"No results found.\" });\n\n const linkify = (text: string) => text\n .replaceAll(\"\\r\\n\", \"\\n\")\n .replace(/([*>_`~\\\\])/gsi, \"\\\\$1\")\n .replace(/\\[(.+?)\\]/g, (_, word) => `[${word}](https://www.urbandictionary.com/define.php?term=${encodeURIComponent(word)} \"Define '${word}' on Urban Dictionary\")`)\n .trim();\n\n return void sendBotMessage(ctx.channel.id, {\n embeds: [\n {\n type: \"rich\",\n author: {\n name: `Uploaded by \"${definition.author}\"`,\n url: `https://www.urbandictionary.com/author.php?author=${encodeURIComponent(definition.author)}`,\n },\n title: definition.word,\n url: `https://www.urbandictionary.com/define.php?term=${encodeURIComponent(definition.word)}`,\n description: linkify(definition.definition),\n fields: [\n {\n name: \"Example\",\n value: linkify(definition.example),\n },\n {\n name: \"Want more definitions?\",\n value: `Check out [more definitions](https://www.urbandictionary.com/define.php?term=${query} \"Define \"${args[0].value}\" on Urban Dictionary\") on Urban Dictionary.`,\n },\n ],\n color: 0xFF9900,\n footer: { text: `\uD83D\uDC4D ${definition.thumbs_up.toString()} | \uD83D\uDC4E ${definition.thumbs_down.toString()}`, icon_url: \"https://www.urbandictionary.com/favicon.ico\" },\n timestamp: new Date(definition.written_on).toISOString(),\n },\n ] as any,\n });\n } catch (error) {\n sendBotMessage(ctx.channel.id, {\n content: `Something went wrong: \\`${error}\\``,\n });\n }\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./VoiceChannelSection.css\";\n\nimport { findByCodeLazy, findByPropsLazy } from \"@webpack\";\nimport { Button, Forms, PermissionStore, Toasts } from \"@webpack/common\";\nimport { Channel } from \"discord-types/general\";\n\nconst ChannelActions = findByPropsLazy(\"selectChannel\", \"selectVoiceChannel\");\nconst UserPopoutSection = findByCodeLazy(\".lastSection\", \"children:\");\n\nconst CONNECT = 1n << 20n;\n\ninterface VoiceChannelFieldProps {\n channel: Channel;\n label: string;\n showHeader: boolean;\n}\n\nexport const VoiceChannelSection = ({ channel, label, showHeader }: VoiceChannelFieldProps) => (\n \n {showHeader && In a voice channel}\n {\n if (PermissionStore.can(CONNECT, channel))\n ChannelActions.selectVoiceChannel(channel.id);\n else\n Toasts.show({\n message: \"Insufficient permissions to enter the channel.\",\n id: \"user-voice-show-insufficient-permissions\",\n type: Toasts.Type.FAILURE,\n options: {\n position: Toasts.Position.BOTTOM,\n }\n });\n }}\n >\n {label}\n \n \n);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findStoreLazy } from \"@webpack\";\nimport { ChannelStore, GuildStore, UserStore } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\n\nimport { VoiceChannelSection } from \"./components/VoiceChannelSection\";\n\nconst VoiceStateStore = findStoreLazy(\"VoiceStateStore\");\n\nconst settings = definePluginSettings({\n showInUserProfileModal: {\n type: OptionType.BOOLEAN,\n description: \"Show a user's voice channel in their profile modal\",\n default: true,\n },\n showVoiceChannelSectionHeader: {\n type: OptionType.BOOLEAN,\n description: 'Whether to show \"IN A VOICE CHANNEL\" above the join button',\n default: true,\n }\n});\n\ninterface UserProps {\n user: User;\n}\n\nconst VoiceChannelField = ErrorBoundary.wrap(({ user }: UserProps) => {\n const { channelId } = VoiceStateStore.getVoiceStateForUser(user.id) ?? {};\n if (!channelId) return null;\n\n const channel = ChannelStore.getChannel(channelId);\n if (!channel) return null;\n\n const guild = GuildStore.getGuild(channel.guild_id);\n\n if (!guild) return null; // When in DM call\n\n const result = `${guild.name} | ${channel.name}`;\n\n return (\n \n );\n});\n\nexport default definePlugin({\n name: \"UserVoiceShow\",\n description: \"Shows whether a User is currently in a voice channel somewhere in their profile\",\n authors: [Devs.LordElias],\n settings,\n\n patchModal({ user }: UserProps) {\n if (!settings.store.showInUserProfileModal)\n return null;\n\n return (\n
\n \n
\n );\n },\n\n patchPopout: ({ user }: UserProps) => {\n const isSelfUser = user.id === UserStore.getCurrentUser().id;\n return (\n
\n \n
\n );\n },\n\n patches: [\n // above message box\n {\n find: \".lastEditedByContainer\",\n replacement: {\n match: /\\(0,\\i\\.jsx\\)\\(\\i\\.\\i,{user:\\i,setNote/,\n replace: \"$self.patchPopout(arguments[0]),$&\",\n }\n },\n // below username\n {\n find: \".USER_PROFILE_MODAL\",\n replacement: {\n match: /\\.body.+?displayProfile:\\i}\\),/,\n replace: \"$&$self.patchModal(arguments[0]),\",\n }\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n(window.VencordStyles ??= new Map()).set(\"src/plugins/usrbg/index.css\", {\n name: \"src/plugins/usrbg/index.css\",\n source: \":is([class*=\\\"userProfile\\\"], [class*=\\\"userPopout\\\"]) [class*=\\\"bannerPremium\\\"] {\\n background: center / cover no-repeat;\\n}\\n\\n[class*=\\\"NonPremium\\\"]:has([class*=\\\"bannerPremium\\\"]) [class*=\\\"avatarPositionNormal\\\"],\\n[class*=\\\"PremiumWithoutBanner\\\"]:has([class*=\\\"bannerPremium\\\"]) [class*=\\\"avatarPositionPremiumNoBanner\\\"] {\\n top: 76px;\\n}\\n\\n[style*=\\\"background-image\\\"] [class*=\\\"background_\\\"] {\\n background-color: transparent !important;\\n}\\n\",\n classNames: {},\n dom: null,\n});\n\nexport default \"src/plugins/usrbg/index.css\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { enableStyle } from \"@api/Styles\";\nimport { Link } from \"@components/Link\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nimport style from \"./index.css?managed\";\n\nconst BASE_URL = \"https://raw.githubusercontent.com/AutumnVN/usrbg/main/usrbg.json\";\n\nlet data = {} as Record;\n\nconst settings = definePluginSettings({\n nitroFirst: {\n description: \"Banner to use if both Nitro and USRBG banners are present\",\n type: OptionType.SELECT,\n options: [\n { label: \"Nitro banner\", value: true, default: true },\n { label: \"USRBG banner\", value: false },\n ]\n },\n voiceBackground: {\n description: \"Use USRBG banners as voice chat backgrounds\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"USRBG\",\n description: \"Displays user banners from USRBG, allowing anyone to get a banner without Nitro\",\n authors: [Devs.AutumnVN, Devs.pylix, Devs.TheKodeToad],\n settings,\n patches: [\n {\n find: \".NITRO_BANNER,\",\n replacement: [\n {\n match: /(\\i)\\.premiumType/,\n replace: \"$self.premiumHook($1)||$&\"\n },\n {\n match: /(?<=function \\i\\((\\i)\\)\\{)(?=var.{30,50},bannerSrc:)/,\n replace: \"$1.bannerSrc=$self.useBannerHook($1);\"\n },\n {\n match: /\\?\\(0,\\i\\.jsx\\)\\(\\i,{type:\\i,shown/,\n replace: \"&&$self.shouldShowBadge(arguments[0])$&\"\n }\n ]\n },\n {\n find: \"\\\"data-selenium-video-tile\\\":\",\n predicate: () => settings.store.voiceBackground,\n replacement: [\n {\n match: /(?<=function\\((\\i),\\i\\)\\{)(?=let.{20,40},style:)/,\n replace: \"$1.style=$self.voiceBackgroundHook($1);\"\n }\n ]\n }\n ],\n\n\n data,\n\n settingsAboutComponent: () => {\n return (\n CLICK HERE TO GET YOUR OWN BANNER\n );\n },\n\n voiceBackgroundHook({ className, participantUserId }: any) {\n if (className.includes(\"tile_\")) {\n if (data[participantUserId]) {\n return {\n backgroundImage: `url(${data[participantUserId]})`,\n backgroundSize: \"cover\",\n backgroundPosition: \"center\",\n backgroundRepeat: \"no-repeat\"\n };\n }\n }\n },\n\n useBannerHook({ displayProfile, user }: any) {\n if (displayProfile?.banner && settings.store.nitroFirst) return;\n if (data[user.id]) return data[user.id];\n },\n\n premiumHook({ userId }: any) {\n if (data[userId]) return 2;\n },\n\n shouldShowBadge({ displayProfile, user }: any) {\n return displayProfile?.banner && (!data[user.id] || settings.store.nitroFirst);\n },\n\n async start() {\n enableStyle(style);\n\n const res = await fetch(BASE_URL);\n if (res.ok) {\n data = await res.json();\n this.data = data;\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { sleep } from \"@utils/misc\";\nimport { Queue } from \"@utils/Queue\";\nimport definePlugin from \"@utils/types\";\nimport { UserStore, UserUtils, useState } from \"@webpack/common\";\nimport type { ComponentType, ReactNode } from \"react\";\n\nconst fetching = new Set();\nconst queue = new Queue(5);\n\ninterface MentionProps {\n data: {\n userId?: string;\n channelId?: string;\n content: any;\n };\n parse: (content: any, props: MentionProps[\"props\"]) => ReactNode;\n props: {\n key: string;\n formatInline: boolean;\n noStyleAndInteraction: boolean;\n };\n RoleMention: ComponentType;\n UserMention: ComponentType;\n}\n\nfunction MentionWrapper({ data, UserMention, RoleMention, parse, props }: MentionProps) {\n const [userId, setUserId] = useState(data.userId);\n\n // if userId is set it means the user is cached. Uncached users have userId set to undefined\n if (userId)\n return (\n \n );\n\n // Parses the raw text node array data.content into a ReactNode[]: [\"<@userid>\"]\n const children = parse(data.content, props);\n\n return (\n // Discord is deranged and renders unknown user mentions as role mentions\n \n {\n const mention = children?.[0]?.props?.children;\n if (typeof mention !== \"string\") return;\n\n const id = mention.match(/<@!?(\\d+)>/)?.[1];\n if (!id) return;\n\n if (fetching.has(id))\n return;\n\n if (UserStore.getUser(id))\n return setUserId(id);\n\n const fetch = () => {\n fetching.add(id);\n\n queue.unshift(() =>\n UserUtils.getUser(id)\n .then(() => {\n setUserId(id);\n fetching.delete(id);\n })\n .catch(e => {\n if (e?.status === 429) {\n queue.unshift(() => sleep(1000).then(fetch));\n fetching.delete(id);\n }\n })\n .finally(() => sleep(300))\n );\n };\n\n fetch();\n }}\n >\n {children}\n \n \n );\n}\n\nexport default definePlugin({\n name: \"ValidUser\",\n description: \"Fix mentions for unknown users showing up as '<@343383572805058560>' (hover over a mention to fix it)\",\n authors: [Devs.Ven],\n tags: [\"MentionCacheFix\"],\n\n patches: [{\n find: 'className:\"mention\"',\n replacement: {\n // mention = { react: function (data, parse, props) { if (data.userId == null) return RoleMention() else return UserMention()\n match: /react(?=\\(\\i,\\i,\\i\\).{0,50}return null==\\i\\?\\(0,\\i\\.jsx\\)\\((\\i\\.\\i),.+?jsx\\)\\((\\i\\.\\i),\\{className:\"mention\")/,\n // react: (...args) => OurWrapper(RoleMention, UserMention, ...args), originalReact: theirFunc\n replace: \"react:(...args)=>$self.renderMention($1,$2,...args),originalReact\"\n }\n }],\n\n renderMention(RoleMention, UserMention, data, parse, props) {\n return (\n \n \n \n );\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { ChannelStore, SelectedChannelStore } from \"@webpack/common\";\n\nconst timers = {} as Record;\n\nexport default definePlugin({\n name: \"VoiceChatDoubleClick\",\n description: \"Join voice chats via double click instead of single click\",\n authors: [Devs.Ven, Devs.D3SOX],\n patches: [\n ...[\n \".handleVoiceStatusClick\", // voice channels\n \".handleClickChat\" // stage channels\n ].map(find => ({\n find,\n // hack: these are not React onClick, it is a custom prop handled by Discord\n // thus, replacing this with onDoubleClick won't work, and you also cannot check\n // e.detail since instead of the event they pass the channel.\n // do this timer workaround instead\n replacement: [\n {\n match: /onClick:\\(\\)=>\\{this.handleClick\\(\\)/g,\n replace: \"onClick:()=>{$self.schedule(()=>{this.handleClick()},this)\",\n },\n ]\n })),\n {\n // channel mentions\n find: \".shouldCloseDefaultModals\",\n replacement: {\n match: /onClick:(\\i)(?=,.{0,30}className:\"channelMention\".+?(\\i)\\.inContent)/,\n replace: (_, onClick, props) => \"\"\n + `onClick:(vcDoubleClickEvt)=>$self.shouldRunOnClick(vcDoubleClickEvt,${props})&&${onClick}()`,\n }\n }\n ],\n\n shouldRunOnClick(e: MouseEvent, { channelId }) {\n const channel = ChannelStore.getChannel(channelId);\n if (!channel || ![2, 13].includes(channel.type)) return true;\n return e.detail >= 2;\n },\n\n schedule(cb: () => void, e: any) {\n const id = e.props.channel.id as string;\n if (SelectedChannelStore.getVoiceChannelId() === id) {\n cb();\n return;\n }\n // use a different counter for each channel\n const data = (timers[id] ??= { timeout: void 0, i: 0 });\n // clear any existing timer\n clearTimeout(data.timeout);\n\n // if we already have 2 or more clicks, run the callback immediately\n if (++data.i >= 2) {\n cb();\n delete timers[id];\n } else {\n // else reset the counter in 500ms\n data.timeout = setTimeout(() => {\n delete timers[id];\n }, 500);\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { ErrorCard } from \"@components/ErrorCard\";\nimport { Devs } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport { Margins } from \"@utils/margins\";\nimport { wordsToTitle } from \"@utils/text\";\nimport definePlugin, { OptionType, PluginOptionsItem } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { Button, ChannelStore, Forms, GuildMemberStore, SelectedChannelStore, SelectedGuildStore, useMemo, UserStore } from \"@webpack/common\";\n\ninterface VoiceState {\n userId: string;\n channelId?: string;\n oldChannelId?: string;\n deaf: boolean;\n mute: boolean;\n selfDeaf: boolean;\n selfMute: boolean;\n}\n\nconst VoiceStateStore = findByPropsLazy(\"getVoiceStatesForChannel\", \"getCurrentClientVoiceChannelId\");\n\n// Mute/Deaf for other people than you is commented out, because otherwise someone can spam it and it will be annoying\n// Filtering out events is not as simple as just dropping duplicates, as otherwise mute, unmute, mute would\n// not say the second mute, which would lead you to believe they're unmuted\n\nfunction speak(text: string, settings: any = Settings.plugins.VcNarrator) {\n if (!text) return;\n\n const speech = new SpeechSynthesisUtterance(text);\n let voice = speechSynthesis.getVoices().find(v => v.voiceURI === settings.voice);\n if (!voice) {\n new Logger(\"VcNarrator\").error(`Voice \"${settings.voice}\" not found. Resetting to default.`);\n voice = speechSynthesis.getVoices().find(v => v.default);\n settings.voice = voice?.voiceURI;\n if (!voice) return; // This should never happen\n }\n speech.voice = voice!;\n speech.volume = settings.volume;\n speech.rate = settings.rate;\n speechSynthesis.speak(speech);\n}\n\nfunction clean(str: string) {\n const replacer = Settings.plugins.VcNarrator.latinOnly\n ? /[^\\p{Script=Latin}\\p{Number}\\p{Punctuation}\\s]/gu\n : /[^\\p{Letter}\\p{Number}\\p{Punctuation}\\s]/gu;\n\n return str.normalize(\"NFKC\")\n .replace(replacer, \"\")\n .replace(/_{2,}/g, \"_\")\n .trim();\n}\n\nfunction formatText(str: string, user: string, channel: string, displayName: string, nickname: string) {\n return str\n .replaceAll(\"{{USER}}\", clean(user) || (user ? \"Someone\" : \"\"))\n .replaceAll(\"{{CHANNEL}}\", clean(channel) || \"channel\")\n .replaceAll(\"{{DISPLAY_NAME}}\", clean(displayName) || (displayName ? \"Someone\" : \"\"))\n .replaceAll(\"{{NICKNAME}}\", clean(nickname) || (nickname ? \"Someone\" : \"\"));\n}\n\n/*\nlet StatusMap = {} as Record;\n*/\n\n// For every user, channelId and oldChannelId will differ when moving channel.\n// Only for the local user, channelId and oldChannelId will be the same when moving channel,\n// for some ungodly reason\nlet myLastChannelId: string | undefined;\n\nfunction getTypeAndChannelId({ channelId, oldChannelId }: VoiceState, isMe: boolean) {\n if (isMe && channelId !== myLastChannelId) {\n oldChannelId = myLastChannelId;\n myLastChannelId = channelId;\n }\n\n if (channelId !== oldChannelId) {\n if (channelId) return [oldChannelId ? \"move\" : \"join\", channelId];\n if (oldChannelId) return [\"leave\", oldChannelId];\n }\n /*\n if (channelId) {\n if (deaf || selfDeaf) return [\"deafen\", channelId];\n if (mute || selfMute) return [\"mute\", channelId];\n const oldStatus = StatusMap[userId];\n if (oldStatus.deaf) return [\"undeafen\", channelId];\n if (oldStatus.mute) return [\"unmute\", channelId];\n }\n */\n return [\"\", \"\"];\n}\n\n/*\nfunction updateStatuses(type: string, { deaf, mute, selfDeaf, selfMute, userId, channelId }: VoiceState, isMe: boolean) {\n if (isMe && (type === \"join\" || type === \"move\")) {\n StatusMap = {};\n const states = VoiceStateStore.getVoiceStatesForChannel(channelId!) as Record;\n for (const userId in states) {\n const s = states[userId];\n StatusMap[userId] = {\n mute: s.mute || s.selfMute,\n deaf: s.deaf || s.selfDeaf\n };\n }\n return;\n }\n\n if (type === \"leave\" || (type === \"move\" && channelId !== SelectedChannelStore.getVoiceChannelId())) {\n if (isMe)\n StatusMap = {};\n else\n delete StatusMap[userId];\n\n return;\n }\n\n StatusMap[userId] = {\n deaf: deaf || selfDeaf,\n mute: mute || selfMute\n };\n}\n*/\n\nfunction playSample(tempSettings: any, type: string) {\n const settings = Object.assign({}, Settings.plugins.VcNarrator, tempSettings);\n const currentUser = UserStore.getCurrentUser();\n const myGuildId = SelectedGuildStore.getGuildId();\n\n speak(formatText(settings[type + \"Message\"], currentUser.username, \"general\", (currentUser as any).globalName ?? currentUser.username, GuildMemberStore.getNick(myGuildId, currentUser.id) ?? currentUser.username), settings);\n}\n\nexport default definePlugin({\n name: \"VcNarrator\",\n description: \"Announces when users join, leave, or move voice channels via narrator\",\n authors: [Devs.Ven],\n\n flux: {\n VOICE_STATE_UPDATES({ voiceStates }: { voiceStates: VoiceState[]; }) {\n const myGuildId = SelectedGuildStore.getGuildId();\n const myChanId = SelectedChannelStore.getVoiceChannelId();\n const myId = UserStore.getCurrentUser().id;\n\n if (ChannelStore.getChannel(myChanId!)?.type === 13 /* Stage Channel */) return;\n\n for (const state of voiceStates) {\n const { userId, channelId, oldChannelId } = state;\n const isMe = userId === myId;\n if (!isMe) {\n if (!myChanId) continue;\n if (channelId !== myChanId && oldChannelId !== myChanId) continue;\n }\n\n const [type, id] = getTypeAndChannelId(state, isMe);\n if (!type) continue;\n\n const template = Settings.plugins.VcNarrator[type + \"Message\"];\n const user = isMe && !Settings.plugins.VcNarrator.sayOwnName ? \"\" : UserStore.getUser(userId).username;\n const displayName = user && ((UserStore.getUser(userId) as any).globalName ?? user);\n const nickname = user && (GuildMemberStore.getNick(myGuildId, userId) ?? user);\n const channel = ChannelStore.getChannel(id).name;\n\n speak(formatText(template, user, channel, displayName, nickname));\n\n // updateStatuses(type, state, isMe);\n }\n },\n\n AUDIO_TOGGLE_SELF_MUTE() {\n const chanId = SelectedChannelStore.getVoiceChannelId()!;\n const s = VoiceStateStore.getVoiceStateForChannel(chanId) as VoiceState;\n if (!s) return;\n\n const event = s.mute || s.selfMute ? \"unmute\" : \"mute\";\n speak(formatText(Settings.plugins.VcNarrator[event + \"Message\"], \"\", ChannelStore.getChannel(chanId).name, \"\", \"\"));\n },\n\n AUDIO_TOGGLE_SELF_DEAF() {\n const chanId = SelectedChannelStore.getVoiceChannelId()!;\n const s = VoiceStateStore.getVoiceStateForChannel(chanId) as VoiceState;\n if (!s) return;\n\n const event = s.deaf || s.selfDeaf ? \"undeafen\" : \"deafen\";\n speak(formatText(Settings.plugins.VcNarrator[event + \"Message\"], \"\", ChannelStore.getChannel(chanId).name, \"\", \"\"));\n }\n },\n\n start() {\n if (typeof speechSynthesis === \"undefined\" || speechSynthesis.getVoices().length === 0) {\n new Logger(\"VcNarrator\").warn(\n \"SpeechSynthesis not supported or no Narrator voices found. Thus, this plugin will not work. Check my Settings for more info\"\n );\n return;\n }\n\n },\n\n optionsCache: null as Record | null,\n\n get options() {\n return this.optionsCache ??= {\n voice: {\n type: OptionType.SELECT,\n description: \"Narrator Voice\",\n options: window.speechSynthesis?.getVoices().map(v => ({\n label: v.name,\n value: v.voiceURI,\n default: v.default\n })) ?? []\n },\n volume: {\n type: OptionType.SLIDER,\n description: \"Narrator Volume\",\n default: 1,\n markers: [0, 0.25, 0.5, 0.75, 1],\n stickToMarkers: false\n },\n rate: {\n type: OptionType.SLIDER,\n description: \"Narrator Speed\",\n default: 1,\n markers: [0.1, 0.5, 1, 2, 5, 10],\n stickToMarkers: false\n },\n sayOwnName: {\n description: \"Say own name\",\n type: OptionType.BOOLEAN,\n default: false\n },\n latinOnly: {\n description: \"Strip non latin characters from names before saying them\",\n type: OptionType.BOOLEAN,\n default: false\n },\n joinMessage: {\n type: OptionType.STRING,\n description: \"Join Message\",\n default: \"{{USER}} joined\"\n },\n leaveMessage: {\n type: OptionType.STRING,\n description: \"Leave Message\",\n default: \"{{USER}} left\"\n },\n moveMessage: {\n type: OptionType.STRING,\n description: \"Move Message\",\n default: \"{{USER}} moved to {{CHANNEL}}\"\n },\n muteMessage: {\n type: OptionType.STRING,\n description: \"Mute Message (only self for now)\",\n default: \"{{USER}} Muted\"\n },\n unmuteMessage: {\n type: OptionType.STRING,\n description: \"Unmute Message (only self for now)\",\n default: \"{{USER}} unmuted\"\n },\n deafenMessage: {\n type: OptionType.STRING,\n description: \"Deafen Message (only self for now)\",\n default: \"{{USER}} deafened\"\n },\n undeafenMessage: {\n type: OptionType.STRING,\n description: \"Undeafen Message (only self for now)\",\n default: \"{{USER}} undeafened\"\n }\n };\n },\n\n settingsAboutComponent({ tempSettings: s }) {\n const [hasVoices, hasEnglishVoices] = useMemo(() => {\n const voices = speechSynthesis.getVoices();\n return [voices.length !== 0, voices.some(v => v.lang.startsWith(\"en\"))];\n }, []);\n\n const types = useMemo(\n () => Object.keys(Vencord.Plugins.plugins.VcNarrator.options!).filter(k => k.endsWith(\"Message\")).map(k => k.slice(0, -7)),\n [],\n );\n\n let errorComponent: React.ReactElement | null = null;\n if (!hasVoices) {\n let error = \"No narrator voices found. \";\n error += navigator.platform?.toLowerCase().includes(\"linux\")\n ? \"Install speech-dispatcher or espeak and run Discord with the --enable-speech-dispatcher flag\"\n : \"Try installing some in the Narrator settings of your Operating System\";\n errorComponent = {error};\n } else if (!hasEnglishVoices) {\n errorComponent = You don't have any English voices installed, so the narrator might sound weird;\n }\n\n return (\n \n \n You can customise the spoken messages below. You can disable specific messages by setting them to nothing\n \n \n The special placeholders {\"{{USER}}\"}, {\"{{DISPLAY_NAME}}\"}, {\"{{NICKNAME}}\"} and {\"{{CHANNEL}}\"}{\" \"}\n will be replaced with the user's name (nothing if it's yourself), the user's display name, the user's nickname on current server and the channel's name respectively\n \n {hasEnglishVoices && (\n <>\n Play Example Sounds\n \n {types.map(t => (\n \n ))}\n \n \n )}\n {errorComponent}\n \n );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./index.css\";\n\nimport { openNotificationLogModal } from \"@api/Notifications/notificationLog\";\nimport { Settings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { LazyComponent } from \"@utils/react\";\nimport definePlugin from \"@utils/types\";\nimport { filters, find } from \"@webpack\";\nimport { Menu, Popout, useState } from \"@webpack/common\";\nimport type { ReactNode } from \"react\";\n\nconst HeaderBarIcon = LazyComponent(() => {\n const filter = filters.byCode(\".HEADER_BAR_BADGE\");\n return find(m => m.Icon && filter(m.Icon)).Icon;\n});\n\nfunction VencordPopout(onClose: () => void) {\n const pluginEntries = [] as ReactNode[];\n\n for (const plugin of Object.values(Vencord.Plugins.plugins)) {\n if (plugin.toolboxActions) {\n pluginEntries.push(\n \n {Object.entries(plugin.toolboxActions).map(([text, action]) => {\n const key = `vc-toolbox-${plugin.name}-${text}`;\n\n return (\n \n );\n })}\n \n );\n }\n }\n\n return (\n \n \n {\n Settings.useQuickCss = !Settings.useQuickCss;\n onClose();\n }}\n />\n VencordNative.quickCss.openEditor()}\n />\n {...pluginEntries}\n \n );\n}\n\nfunction VencordPopoutIcon(isShown: boolean) {\n return (\n \n \n \n );\n}\n\nfunction VencordPopoutButton() {\n const [show, setShow] = useState(false);\n\n return (\n setShow(false)}\n renderPopout={() => VencordPopout(() => setShow(false))}\n >\n {(_, { isShown }) => (\n setShow(v => !v)}\n tooltip={isShown ? null : \"Vencord Toolbox\"}\n icon={() => VencordPopoutIcon(isShown)}\n selected={isShown}\n />\n )}\n \n );\n}\n\nfunction ToolboxFragmentWrapper({ children }: { children: ReactNode[]; }) {\n children.splice(\n children.length - 1, 0,\n \n \n \n );\n\n return <>{children};\n}\n\nexport default definePlugin({\n name: \"VencordToolbox\",\n description: \"Adds a button next to the inbox button in the channel header that houses Vencord quick actions\",\n authors: [Devs.Ven, Devs.AutumnVN],\n\n patches: [\n {\n find: \"toolbar:function\",\n replacement: {\n match: /(?<=toolbar:function.{0,100}\\()\\i.Fragment,/,\n replace: \"$self.ToolboxFragmentWrapper,\"\n }\n }\n ],\n\n ToolboxFragmentWrapper: ErrorBoundary.wrap(ToolboxFragmentWrapper, {\n fallback: () =>

Failed to render :(

\n })\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport { ImageIcon } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport { openImageModal } from \"@utils/discord\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { GuildMemberStore, Menu } from \"@webpack/common\";\nimport type { Channel, Guild, User } from \"discord-types/general\";\n\nconst BannerStore = findByPropsLazy(\"getGuildBannerURL\");\n\ninterface UserContextProps {\n channel: Channel;\n guildId?: string;\n user: User;\n}\n\ninterface GuildContextProps {\n guild?: Guild;\n}\n\nconst settings = definePluginSettings({\n format: {\n type: OptionType.SELECT,\n description: \"Choose the image format to use for non animated images. Animated images will always use .gif\",\n options: [\n {\n label: \"webp\",\n value: \"webp\",\n default: true\n },\n {\n label: \"png\",\n value: \"png\",\n },\n {\n label: \"jpg\",\n value: \"jpg\",\n }\n ]\n },\n imgSize: {\n type: OptionType.SELECT,\n description: \"The image size to use\",\n options: [\"128\", \"256\", \"512\", \"1024\", \"2048\", \"4096\"].map(n => ({ label: n, value: n, default: n === \"1024\" }))\n }\n});\n\nfunction openImage(url: string) {\n const format = url.startsWith(\"/\") ? \"png\" : settings.store.format;\n\n const u = new URL(url, window.location.href);\n u.searchParams.set(\"size\", settings.store.imgSize);\n u.pathname = u.pathname.replace(/\\.(png|jpe?g|webp)$/, `.${format}`);\n url = u.toString();\n\n u.searchParams.set(\"size\", \"4096\");\n const originalUrl = u.toString();\n\n openImageModal(url, {\n original: originalUrl,\n height: 256\n });\n}\n\nconst UserContext: NavContextMenuPatchCallback = (children, { user, guildId }: UserContextProps) => () => {\n if (!user) return;\n const memberAvatar = GuildMemberStore.getMember(guildId!, user.id)?.avatar || null;\n\n children.splice(-1, 0, (\n \n openImage(BannerStore.getUserAvatarURL(user, true))}\n icon={ImageIcon}\n />\n {memberAvatar && (\n openImage(BannerStore.getGuildMemberAvatarURLSimple({\n userId: user.id,\n avatar: memberAvatar,\n guildId,\n canAnimate: true\n }, true))}\n icon={ImageIcon}\n />\n )}\n \n ));\n};\n\nconst GuildContext: NavContextMenuPatchCallback = (children, { guild }: GuildContextProps) => () => {\n if (!guild) return;\n\n const { id, icon, banner } = guild;\n if (!banner && !icon) return;\n\n children.splice(-1, 0, (\n \n {icon ? (\n \n openImage(BannerStore.getGuildIconURL({\n id,\n icon,\n canAnimate: true\n }))\n }\n icon={ImageIcon}\n />\n ) : null}\n {banner ? (\n \n openImage(BannerStore.getGuildBannerURL({\n id,\n banner,\n }, true))\n }\n icon={ImageIcon}\n />\n ) : null}\n \n ));\n};\n\nexport default definePlugin({\n name: \"ViewIcons\",\n authors: [Devs.Ven, Devs.TheKodeToad, Devs.Nuckyz],\n description: \"Makes avatars and banners in user profiles clickable, and adds View Icon/Banner entries in the user and server context menu\",\n tags: [\"ImageUtilities\"],\n\n settings,\n\n openImage,\n\n start() {\n addContextMenuPatch(\"user-context\", UserContext);\n addContextMenuPatch(\"guild-context\", GuildContext);\n },\n\n stop() {\n removeContextMenuPatch(\"user-context\", UserContext);\n removeContextMenuPatch(\"guild-context\", GuildContext);\n },\n\n patches: [\n // Make pfps clickable\n {\n find: \"User Profile Modal - Context Menu\",\n replacement: {\n match: /\\{src:(\\i)(?=,avatarDecoration)/,\n replace: \"{src:$1,onClick:()=>$self.openImage($1)\"\n }\n },\n // Make banners clickable\n {\n find: \".NITRO_BANNER,\",\n replacement: {\n // style: { backgroundImage: shouldShowBanner ? \"url(\".concat(bannerUrl,\n match: /style:\\{(?=backgroundImage:(\\i&&\\i)\\?\"url\\(\"\\.concat\\((\\i),)/,\n replace:\n // onClick: () => shouldShowBanner && ev.target.style.backgroundImage && openImage(bannerUrl), style: { cursor: shouldShowBanner ? \"pointer\" : void 0,\n 'onClick:ev=>$1&&ev.target.style.backgroundImage&&$self.openImage($2),style:{cursor:$1?\"pointer\":void 0,'\n }\n },\n {\n find: \".avatarPositionPanel\",\n replacement: {\n match: /(?<=avatarWrapperNonUserBot.{0,50})onClick:(\\i\\|\\|\\i)\\?void 0(?<=,avatarSrc:(\\i).+?)/,\n replace: \"style:($1)?{cursor:\\\"pointer\\\"}:{},onClick:$1?()=>{$self.openImage($2)}\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { findByPropsLazy } from \"@webpack\";\nimport { Parser } from \"@webpack/common\";\n\nconst CodeContainerClasses = findByPropsLazy(\"markup\", \"codeContainer\");\n\n/**\n * Renders code in a Discord codeblock\n */\nexport function CodeBlock(props: { content?: string, lang: string; }) {\n return (\n
\n {Parser.defaultRules.codeBlock.react(props, null, {})}\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addContextMenuPatch, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { addButton, removeButton } from \"@api/MessagePopover\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport { CodeBlock } from \"@components/CodeBlock\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { Devs } from \"@utils/constants\";\nimport { Margins } from \"@utils/margins\";\nimport { copyWithToast } from \"@utils/misc\";\nimport { closeModal, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalRoot, ModalSize, openModal } from \"@utils/modal\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Button, ChannelStore, Forms, Menu, Text } from \"@webpack/common\";\nimport { Message } from \"discord-types/general\";\n\n\nconst CopyIcon = () => {\n return \n \n \n ;\n};\n\nfunction sortObject(obj: T): T {\n return Object.fromEntries(Object.entries(obj).sort(([k1], [k2]) => k1.localeCompare(k2))) as T;\n}\n\nfunction cleanMessage(msg: Message) {\n const clone = sortObject(JSON.parse(JSON.stringify(msg)));\n for (const key of [\n \"email\",\n \"phone\",\n \"mfaEnabled\",\n \"personalConnectionId\"\n ]) delete clone.author[key];\n\n // message logger added properties\n const cloneAny = clone as any;\n delete cloneAny.editHistory;\n delete cloneAny.deleted;\n cloneAny.attachments?.forEach(a => delete a.deleted);\n\n return clone;\n}\n\nfunction openViewRawModal(json: string, type: string, msgContent?: string) {\n const key = openModal(props => (\n \n \n \n View Raw\n closeModal(key)} />\n \n \n
\n {!!msgContent && (\n <>\n Content\n \n \n \n )}\n\n {type} Data\n \n
\n
\n \n \n \n {!!msgContent && (\n \n )}\n \n \n
\n
\n ));\n}\n\nfunction openViewRawModalMessage(msg: Message) {\n msg = cleanMessage(msg);\n const msgJson = JSON.stringify(msg, null, 4);\n\n return openViewRawModal(msgJson, \"Message\", msg.content);\n}\n\nconst settings = definePluginSettings({\n clickMethod: {\n description: \"Change the button to view the raw content/data of any message.\",\n type: OptionType.SELECT,\n options: [\n { label: \"Left Click to view the raw content.\", value: \"Left\", default: true },\n { label: \"Right click to view the raw content.\", value: \"Right\" }\n ]\n }\n});\n\nfunction MakeContextCallback(name: string) {\n const callback: NavContextMenuPatchCallback = (children, props) => () => {\n if ((name === \"Guild\" && !props.guild) || (name === \"User\" && !props.user)) return;\n const lastChild = children.at(-1);\n if (lastChild?.key === \"developer-actions\") {\n const p = lastChild.props;\n if (!Array.isArray(p.children))\n p.children = [p.children];\n ({ children } = p);\n }\n\n children.splice(-1, 0,\n openViewRawModal(JSON.stringify(props[name.toLowerCase()], null, 4), name)}\n icon={CopyIcon}\n />\n );\n };\n return callback;\n}\n\n\nexport default definePlugin({\n name: \"ViewRaw\",\n description: \"Copy and view the raw content/data of any message, channel or guild\",\n authors: [Devs.KingFish, Devs.Ven, Devs.rad, Devs.ImLvna],\n dependencies: [\"MessagePopoverAPI\"],\n settings,\n\n start() {\n addButton(\"ViewRaw\", msg => {\n const handleClick = () => {\n if (settings.store.clickMethod === \"Right\") {\n copyWithToast(msg.content);\n } else {\n openViewRawModalMessage(msg);\n }\n };\n\n const handleContextMenu = e => {\n if (settings.store.clickMethod === \"Left\") {\n e.preventDefault();\n e.stopPropagation();\n copyWithToast(msg.content);\n } else {\n e.preventDefault();\n e.stopPropagation();\n openViewRawModalMessage(msg);\n }\n };\n\n const label = settings.store.clickMethod === \"Right\"\n ? \"Copy Raw (Left Click) / View Raw (Right Click)\"\n : \"View Raw (Left Click) / Copy Raw (Right Click)\";\n\n return {\n label,\n icon: CopyIcon,\n message: msg,\n channel: ChannelStore.getChannel(msg.channel_id),\n onClick: handleClick,\n onContextMenu: handleContextMenu\n };\n });\n\n addContextMenuPatch(\"guild-context\", MakeContextCallback(\"Guild\"));\n addContextMenuPatch(\"channel-context\", MakeContextCallback(\"Channel\"));\n addContextMenuPatch(\"user-context\", MakeContextCallback(\"User\"));\n },\n\n stop() {\n removeButton(\"CopyRawMessage\");\n removeContextMenuPatch(\"guild-context\", MakeContextCallback(\"Guild\"));\n removeContextMenuPatch(\"channel-context\", MakeContextCallback(\"Channel\"));\n removeContextMenuPatch(\"user-context\", MakeContextCallback(\"User\"));\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { OptionType } from \"@utils/types\";\n\nexport const settings = definePluginSettings({\n noiseSuppression: {\n type: OptionType.BOOLEAN,\n description: \"Noise Suppression\",\n default: true,\n },\n echoCancellation: {\n type: OptionType.BOOLEAN,\n description: \"Echo Cancellation\",\n default: true,\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PluginNative } from \"@utils/types\";\nimport { Button, showToast, Toasts, useState } from \"@webpack/common\";\n\nimport type { VoiceRecorder } from \".\";\nimport { settings } from \"./settings\";\n\nconst Native = VencordNative.pluginHelpers.VoiceMessages as PluginNative;\n\nexport const VoiceRecorderDesktop: VoiceRecorder = ({ setAudioBlob, onRecordingChange }) => {\n const [recording, setRecording] = useState(false);\n\n const changeRecording = (recording: boolean) => {\n setRecording(recording);\n onRecordingChange?.(recording);\n };\n\n function toggleRecording() {\n const discordVoice = DiscordNative.nativeModules.requireModule(\"discord_voice\");\n const nowRecording = !recording;\n\n if (nowRecording) {\n discordVoice.startLocalAudioRecording(\n {\n echoCancellation: settings.store.echoCancellation,\n noiseCancellation: settings.store.noiseSuppression,\n },\n (success: boolean) => {\n if (success)\n changeRecording(true);\n else\n showToast(\"Failed to start recording\", Toasts.Type.FAILURE);\n }\n );\n } else {\n discordVoice.stopLocalAudioRecording(async (filePath: string) => {\n if (filePath) {\n const buf = await Native.readRecording(filePath);\n if (buf)\n setAudioBlob(new Blob([buf], { type: \"audio/ogg; codecs=opus\" }));\n else\n showToast(\"Failed to finish recording\", Toasts.Type.FAILURE);\n }\n changeRecording(false);\n });\n }\n }\n\n return (\n \n );\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { classNameFactory } from \"@api/Styles\";\n\nexport const cl = classNameFactory(\"vc-vmsg-\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { LazyComponent, useTimer } from \"@utils/react\";\nimport { find } from \"@webpack\";\n\nimport { cl } from \"./utils\";\n\ninterface VoiceMessageProps {\n src: string;\n waveform: string;\n}\nconst VoiceMessage = LazyComponent(() => find(m => m.type?.toString().includes(\"waveform:\")));\n\nexport type VoicePreviewOptions = {\n src?: string;\n waveform: string;\n recording?: boolean;\n};\nexport const VoicePreview = ({\n src,\n waveform,\n recording,\n}: VoicePreviewOptions) => {\n const durationMs = useTimer({\n deps: [recording]\n });\n\n const durationSeconds = recording ? Math.floor(durationMs / 1000) : 0;\n const durationDisplay = Math.floor(durationSeconds / 60) + \":\" + (durationSeconds % 60).toString().padStart(2, \"0\");\n\n if (src && !recording)\n return ;\n\n return (\n
\n
\n
{durationDisplay}
\n
{recording ? \"RECORDING\" : \"----\"}
\n
\n );\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Button, useState } from \"@webpack/common\";\n\nimport type { VoiceRecorder } from \".\";\nimport { settings } from \"./settings\";\n\nexport const VoiceRecorderWeb: VoiceRecorder = ({ setAudioBlob, onRecordingChange }) => {\n const [recording, setRecording] = useState(false);\n const [paused, setPaused] = useState(false);\n const [recorder, setRecorder] = useState();\n const [chunks, setChunks] = useState([]);\n\n const changeRecording = (recording: boolean) => {\n setRecording(recording);\n onRecordingChange?.(recording);\n };\n\n function toggleRecording() {\n const nowRecording = !recording;\n\n if (nowRecording) {\n navigator.mediaDevices.getUserMedia({\n audio: {\n echoCancellation: settings.store.echoCancellation,\n noiseSuppression: settings.store.noiseSuppression,\n }\n }).then(stream => {\n const chunks = [] as Blob[];\n setChunks(chunks);\n\n const recorder = new MediaRecorder(stream);\n setRecorder(recorder);\n recorder.addEventListener(\"dataavailable\", e => {\n chunks.push(e.data);\n });\n recorder.start();\n\n changeRecording(true);\n });\n } else {\n if (recorder) {\n recorder.addEventListener(\"stop\", () => {\n setAudioBlob(new Blob(chunks, { type: \"audio/ogg; codecs=opus\" }));\n\n changeRecording(false);\n });\n recorder.stop();\n }\n }\n }\n\n return (\n <>\n \n\n {\n setPaused(!paused);\n if (paused) recorder?.resume();\n else recorder?.pause();\n }}\n >\n {paused ? \"Resume\" : \"Pause\"} recording\n \n \n );\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport { addContextMenuPatch, NavContextMenuPatchCallback, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { Microphone } from \"@components/Icons\";\nimport { Devs } from \"@utils/constants\";\nimport { ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, openModal } from \"@utils/modal\";\nimport { useAwaiter } from \"@utils/react\";\nimport definePlugin from \"@utils/types\";\nimport { chooseFile } from \"@utils/web\";\nimport { findByPropsLazy, findStoreLazy } from \"@webpack\";\nimport { Button, FluxDispatcher, Forms, lodash, Menu, PermissionsBits, PermissionStore, RestAPI, SelectedChannelStore, showToast, SnowflakeUtils, Toasts, useEffect, useState } from \"@webpack/common\";\nimport { ComponentType } from \"react\";\n\nimport { VoiceRecorderDesktop } from \"./DesktopRecorder\";\nimport { settings } from \"./settings\";\nimport { cl } from \"./utils\";\nimport { VoicePreview } from \"./VoicePreview\";\nimport { VoiceRecorderWeb } from \"./WebRecorder\";\n\nconst CloudUtils = findByPropsLazy(\"CloudUpload\");\nconst MessageCreator = findByPropsLazy(\"getSendMessageOptionsForReply\", \"sendMessage\");\nconst PendingReplyStore = findStoreLazy(\"PendingReplyStore\");\nconst OptionClasses = findByPropsLazy(\"optionName\", \"optionIcon\", \"optionLabel\");\n\nexport type VoiceRecorder = ComponentType<{\n setAudioBlob(blob: Blob): void;\n onRecordingChange?(recording: boolean): void;\n}>;\n\nconst VoiceRecorder = IS_DISCORD_DESKTOP ? VoiceRecorderDesktop : VoiceRecorderWeb;\n\nexport default definePlugin({\n name: \"VoiceMessages\",\n description: \"Allows you to send voice messages like on mobile. To do so, right click the upload button and click Send Voice Message\",\n authors: [Devs.Ven, Devs.Vap, Devs.Nickyux],\n settings,\n\n start() {\n addContextMenuPatch(\"channel-attach\", ctxMenuPatch);\n },\n\n stop() {\n removeContextMenuPatch(\"channel-attach\", ctxMenuPatch);\n }\n});\n\ntype AudioMetadata = {\n waveform: string,\n duration: number,\n};\nconst EMPTY_META: AudioMetadata = {\n waveform: \"AAAAAAAAAAAA\",\n duration: 1,\n};\n\nfunction sendAudio(blob: Blob, meta: AudioMetadata) {\n const channelId = SelectedChannelStore.getChannelId();\n const reply = PendingReplyStore.getPendingReply(channelId);\n if (reply) FluxDispatcher.dispatch({ type: \"DELETE_PENDING_REPLY\", channelId });\n\n const upload = new CloudUtils.CloudUpload({\n file: new File([blob], \"voice-message.ogg\", { type: \"audio/ogg; codecs=opus\" }),\n isClip: false,\n isThumbnail: false,\n platform: 1,\n }, channelId, false, 0);\n\n upload.on(\"complete\", () => {\n RestAPI.post({\n url: `/channels/${channelId}/messages`,\n body: {\n flags: 1 << 13,\n channel_id: channelId,\n content: \"\",\n nonce: SnowflakeUtils.fromTimestamp(Date.now()),\n sticker_ids: [],\n type: 0,\n attachments: [{\n id: \"0\",\n filename: upload.filename,\n uploaded_filename: upload.uploadedFilename,\n waveform: meta.waveform,\n duration_secs: meta.duration,\n }],\n message_reference: reply ? MessageCreator.getSendMessageOptionsForReply(reply)?.messageReference : null,\n }\n });\n });\n upload.on(\"error\", () => showToast(\"Failed to upload voice message\", Toasts.Type.FAILURE));\n\n upload.upload();\n}\n\nfunction useObjectUrl() {\n const [url, setUrl] = useState();\n const setWithFree = (blob: Blob) => {\n if (url)\n URL.revokeObjectURL(url);\n setUrl(URL.createObjectURL(blob));\n };\n\n return [url, setWithFree] as const;\n}\n\nfunction Modal({ modalProps }: { modalProps: ModalProps; }) {\n const [isRecording, setRecording] = useState(false);\n const [blob, setBlob] = useState();\n const [blobUrl, setBlobUrl] = useObjectUrl();\n\n useEffect(() => () => {\n if (blobUrl)\n URL.revokeObjectURL(blobUrl);\n }, [blobUrl]);\n\n const [meta] = useAwaiter(async () => {\n if (!blob) return EMPTY_META;\n\n const audioContext = new AudioContext();\n const audioBuffer = await audioContext.decodeAudioData(await blob.arrayBuffer());\n const channelData = audioBuffer.getChannelData(0);\n\n // average the samples into much lower resolution bins, maximum of 256 total bins\n const bins = new Uint8Array(lodash.clamp(Math.floor(audioBuffer.duration * 10), Math.min(32, channelData.length), 256));\n const samplesPerBin = Math.floor(channelData.length / bins.length);\n\n // Get root mean square of each bin\n for (let binIdx = 0; binIdx < bins.length; binIdx++) {\n let squares = 0;\n for (let sampleOffset = 0; sampleOffset < samplesPerBin; sampleOffset++) {\n const sampleIdx = binIdx * samplesPerBin + sampleOffset;\n squares += channelData[sampleIdx] ** 2;\n }\n bins[binIdx] = ~~(Math.sqrt(squares / samplesPerBin) * 0xFF);\n }\n\n // Normalize bins with easing\n const maxBin = Math.max(...bins);\n const ratio = 1 + (0xFF / maxBin - 1) * Math.min(1, 100 * (maxBin / 0xFF) ** 3);\n for (let i = 0; i < bins.length; i++) bins[i] = Math.min(0xFF, ~~(bins[i] * ratio));\n\n return {\n waveform: window.btoa(String.fromCharCode(...bins)),\n duration: audioBuffer.duration,\n };\n }, {\n deps: [blob],\n fallbackValue: EMPTY_META,\n });\n\n return (\n \n \n Record Voice Message\n \n\n \n
\n {\n setBlob(blob);\n setBlobUrl(blob);\n }}\n onRecordingChange={setRecording}\n />\n\n {\n const file = await chooseFile(\"audio/*\");\n if (file) {\n setBlob(file);\n setBlobUrl(file);\n }\n }}\n >\n Upload File\n \n
\n\n Preview\n \n\n
\n\n \n {\n sendAudio(blob!, meta);\n modalProps.onClose();\n showToast(\"Now sending voice message... Please be patient\", Toasts.Type.MESSAGE);\n }}\n >\n Send\n \n \n
\n );\n}\n\nconst ctxMenuPatch: NavContextMenuPatchCallback = (children, props) => () => {\n if (props.channel.guild_id && !(PermissionStore.can(PermissionsBits.SEND_VOICE_MESSAGES, props.channel) && PermissionStore.can(PermissionsBits.SEND_MESSAGES, props.channel))) return;\n\n children.push(\n \n \n
Send voice message
\n
\n }\n action={() => openModal(modalProps => )}\n />\n );\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { saveFile } from \"@utils/web\";\nimport { findByProps, findLazy } from \"@webpack\";\nimport { Clipboard } from \"@webpack/common\";\n\nasync function fetchImage(url: string) {\n const res = await fetch(url);\n if (res.status !== 200) return;\n\n return await res.blob();\n}\n\nconst MiniDispatcher = findLazy(m => m.emitter?._events?.INSERT_TEXT);\n\nconst settings = definePluginSettings({\n // This needs to be all in one setting because to enable any of these, we need to make Discord use their desktop context\n // menu handler instead of the web one, which breaks the other menus that aren't enabled\n addBack: {\n type: OptionType.BOOLEAN,\n description: \"Add back the Discord context menus for images, links and the chat input bar\",\n // Web slate menu has proper spellcheck suggestions and image context menu is also pretty good,\n // so disable this by default. Vesktop just doesn't, so enable by default\n default: IS_VESKTOP,\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"WebContextMenus\",\n description: \"Re-adds context menus missing in the web version of Discord: Links & Images (Copy/Open Link/Image), Text Area (Copy, Cut, Paste, SpellCheck)\",\n authors: [Devs.Ven],\n enabledByDefault: true,\n required: IS_VESKTOP,\n\n settings,\n\n start() {\n if (settings.store.addBack) {\n const ctxMenuCallbacks = findByProps(\"contextMenuCallbackNative\");\n window.removeEventListener(\"contextmenu\", ctxMenuCallbacks.contextMenuCallbackWeb);\n window.addEventListener(\"contextmenu\", ctxMenuCallbacks.contextMenuCallbackNative);\n this.changedListeners = true;\n }\n },\n\n stop() {\n if (this.changedListeners) {\n const ctxMenuCallbacks = findByProps(\"contextMenuCallbackNative\");\n window.removeEventListener(\"contextmenu\", ctxMenuCallbacks.contextMenuCallbackNative);\n window.addEventListener(\"contextmenu\", ctxMenuCallbacks.contextMenuCallbackWeb);\n }\n },\n\n patches: [\n // Add back Copy & Open Link\n {\n // There is literally no reason for Discord to make this Desktop only.\n // The only thing broken is copy, but they already have a different copy function\n // with web support????\n find: \"open-native-link\",\n replacement: [\n {\n // if (IS_DESKTOP || null == ...)\n match: /if\\(!\\i\\.\\i\\|\\|null==/,\n replace: \"if(null==\"\n },\n // Fix silly Discord calling the non web support copy\n {\n match: /\\i\\.\\i\\.copy/,\n replace: \"Vencord.Webpack.Common.Clipboard.copy\"\n }\n ]\n },\n\n // Add back Copy & Save Image\n {\n find: 'id:\"copy-image\"',\n replacement: [\n {\n // if (!IS_WEB || null ==\n match: /!\\i\\.isPlatformEmbedded/,\n replace: \"false\"\n },\n {\n match: /return\\s*?\\[\\i\\.\\i\\.canCopyImage\\(\\)/,\n replace: \"return [true\"\n },\n {\n match: /(?<=COPY_IMAGE_MENU_ITEM,)action:/,\n replace: \"action:()=>$self.copyImage(arguments[0]),oldAction:\"\n },\n {\n match: /(?<=SAVE_IMAGE_MENU_ITEM,)action:/,\n replace: \"action:()=>$self.saveImage(arguments[0]),oldAction:\"\n },\n ]\n },\n\n // Add back image context menu\n {\n find: 'navId:\"image-context\"',\n predicate: () => settings.store.addBack,\n replacement: {\n // return IS_DESKTOP ? React.createElement(Menu, ...)\n match: /return \\i\\.\\i\\?/,\n replace: \"return true?\"\n }\n },\n\n // Add back link context menu\n {\n find: '\"interactionUsernameProfile\"',\n predicate: () => settings.store.addBack,\n replacement: {\n match: /if\\((?=\"A\"===\\i\\.tagName&&\"\"!==\\i\\.textContent)/,\n replace: \"if(false&&\"\n }\n },\n\n // Add back slate / text input context menu\n {\n find: 'getElementById(\"slate-toolbar\"',\n predicate: () => settings.store.addBack,\n replacement: {\n match: /(?<=handleContextMenu\\(\\i\\)\\{.{0,200}isPlatformEmbedded)\\?/,\n replace: \"||true?\"\n }\n },\n {\n find: \".SLASH_COMMAND_SUGGESTIONS_TOGGLED,{\",\n predicate: () => settings.store.addBack,\n replacement: [\n {\n // if (!IS_DESKTOP) return null;\n match: /if\\(!\\i\\.\\i\\)return null;/,\n replace: \"\"\n },\n {\n // Change calls to DiscordNative.clipboard to us instead\n match: /\\b\\i\\.\\i\\.(copy|cut|paste)/g,\n replace: \"$self.$1\"\n }\n ]\n },\n {\n find: '\"add-to-dictionary\"',\n predicate: () => settings.store.addBack,\n replacement: {\n match: /let\\{text:\\i=\"\"/,\n replace: \"return [null,null];$&\"\n }\n }\n ],\n\n async copyImage(url: string) {\n // Clipboard only supports image/png, jpeg and similar won't work. Thus, we need to convert it to png\n // via canvas first\n const img = new Image();\n img.onload = () => {\n const canvas = document.createElement(\"canvas\");\n canvas.width = img.naturalWidth;\n canvas.height = img.naturalHeight;\n canvas.getContext(\"2d\")!.drawImage(img, 0, 0);\n\n canvas.toBlob(data => {\n navigator.clipboard.write([\n new ClipboardItem({\n \"image/png\": data!\n })\n ]);\n }, \"image/png\");\n };\n img.crossOrigin = \"anonymous\";\n img.src = url;\n },\n\n async saveImage(url: string) {\n const data = await fetchImage(url);\n if (!data) return;\n\n const name = new URL(url).pathname.split(\"/\").pop()!;\n const file = new File([data], name, { type: data.type });\n\n saveFile(file);\n },\n\n copy() {\n const selection = document.getSelection();\n if (!selection) return;\n\n Clipboard.copy(selection.toString());\n },\n\n cut() {\n this.copy();\n MiniDispatcher.dispatch(\"INSERT_TEXT\", { rawText: \"\" });\n },\n\n async paste() {\n const clip = (await navigator.clipboard.read())[0];\n if (!clip) return;\n\n const data = new DataTransfer();\n for (const type of clip.types) {\n if (type === \"image/png\") {\n const file = new File([await clip.getType(type)], \"unknown.png\", { type });\n data.items.add(file);\n } else if (type === \"text/plain\") {\n const blob = await clip.getType(type);\n data.setData(type, await blob.text());\n }\n }\n\n document.dispatchEvent(\n new ClipboardEvent(\"paste\", {\n clipboardData: data\n })\n );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ComponentDispatch, FluxDispatcher, NavigationRouter, SelectedGuildStore, SettingsRouter } from \"@webpack/common\";\n\nconst KeyBinds = findByPropsLazy(\"JUMP_TO_GUILD\", \"SERVER_NEXT\");\n\nexport default definePlugin({\n name: \"WebKeybinds\",\n description: \"Re-adds keybinds missing in the web version of Discord: ctrl+t, ctrl+shift+t, ctrl+tab, ctrl+shift+tab, ctrl+1-9, ctrl+,. Only works fully on Vesktop/ArmCord, not inside your browser\",\n authors: [Devs.Ven],\n enabledByDefault: true,\n\n onKey(e: KeyboardEvent) {\n const hasCtrl = e.ctrlKey || (e.metaKey && navigator.platform.includes(\"Mac\"));\n\n if (hasCtrl) switch (e.key) {\n case \"t\":\n case \"T\":\n e.preventDefault();\n if (e.shiftKey) {\n if (SelectedGuildStore.getGuildId()) NavigationRouter.transitionToGuild(\"@me\");\n ComponentDispatch.safeDispatch(\"TOGGLE_DM_CREATE\");\n } else {\n FluxDispatcher.dispatch({\n type: \"QUICKSWITCHER_SHOW\",\n query: \"\",\n queryMode: null\n });\n }\n break;\n case \",\":\n e.preventDefault();\n SettingsRouter.open(\"My Account\");\n break;\n case \"Tab\":\n const handler = e.shiftKey ? KeyBinds.SERVER_PREV : KeyBinds.SERVER_NEXT;\n handler.action(e);\n break;\n default:\n if (e.key >= \"1\" && e.key <= \"9\") {\n e.preventDefault();\n KeyBinds.JUMP_TO_GUILD.action(e, `mod+${e.key}`);\n }\n break;\n }\n },\n\n start() {\n document.addEventListener(\"keydown\", this.onKey);\n },\n\n stop() {\n document.removeEventListener(\"keydown\", this.onKey);\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport { sleep } from \"@utils/misc\";\nimport { Queue } from \"@utils/Queue\";\nimport { LazyComponent, useForceUpdater } from \"@utils/react\";\nimport definePlugin from \"@utils/types\";\nimport { findByCode, findByPropsLazy } from \"@webpack\";\nimport { ChannelStore, FluxDispatcher, React, RestAPI, Tooltip } from \"@webpack/common\";\nimport { CustomEmoji } from \"@webpack/types\";\nimport { Message, ReactionEmoji, User } from \"discord-types/general\";\n\nconst UserSummaryItem = LazyComponent(() => findByCode(\"defaultRenderUser\", \"showDefaultAvatarsForNullUsers\"));\nconst AvatarStyles = findByPropsLazy(\"moreUsers\", \"emptyUser\", \"avatarContainer\", \"clickableAvatar\");\n\nconst queue = new Queue();\nlet reactions: Record;\n\nfunction fetchReactions(msg: Message, emoji: ReactionEmoji, type: number) {\n const key = emoji.name + (emoji.id ? `:${emoji.id}` : \"\");\n return RestAPI.get({\n url: `/channels/${msg.channel_id}/messages/${msg.id}/reactions/${key}`,\n query: {\n limit: 100,\n type\n },\n oldFormErrors: true\n })\n .then(res => FluxDispatcher.dispatch({\n type: \"MESSAGE_REACTION_ADD_USERS\",\n channelId: msg.channel_id,\n messageId: msg.id,\n users: res.body,\n emoji,\n reactionType: type\n }))\n .catch(console.error)\n .finally(() => sleep(250));\n}\n\nfunction getReactionsWithQueue(msg: Message, e: ReactionEmoji, type: number) {\n const key = `${msg.id}:${e.name}:${e.id ?? \"\"}:${type}`;\n const cache = reactions[key] ??= { fetched: false, users: {} };\n if (!cache.fetched) {\n queue.unshift(() => fetchReactions(msg, e, type));\n cache.fetched = true;\n }\n\n return cache.users;\n}\n\nfunction makeRenderMoreUsers(users: User[]) {\n return function renderMoreUsers(_label: string, _count: number) {\n return (\n u.username).join(\", \")} >\n {({ onMouseEnter, onMouseLeave }) => (\n \n +{users.length - 5}\n \n )}\n \n );\n };\n}\n\nfunction handleClickAvatar(event: React.MouseEvent) {\n event.stopPropagation();\n}\n\nexport default definePlugin({\n name: \"WhoReacted\",\n description: \"Renders the avatars of users who reacted to a message\",\n authors: [Devs.Ven, Devs.KannaDev],\n\n patches: [{\n find: \",reactionRef:\",\n replacement: {\n match: /(\\i)\\?null:\\(0,\\i\\.jsx\\)\\(\\i\\.\\i,{className:\\i\\.reactionCount,.*?}\\),/,\n replace: \"$&$1?null:$self.renderUsers(this.props),\"\n }\n }, {\n find: '.displayName=\"MessageReactionsStore\";',\n replacement: {\n match: /(?<=CONNECTION_OPEN:function\\(\\){)(\\i)={}/,\n replace: \"$&;$self.reactions=$1\"\n }\n }],\n\n renderUsers(props: RootObject) {\n return props.message.reactions.length > 10 ? null : (\n \n \n \n );\n },\n\n _renderUsers({ message, emoji, type }: RootObject) {\n const forceUpdate = useForceUpdater();\n React.useEffect(() => {\n const cb = (e: any) => {\n if (e.messageId === message.id)\n forceUpdate();\n };\n FluxDispatcher.subscribe(\"MESSAGE_REACTION_ADD_USERS\", cb);\n\n return () => FluxDispatcher.unsubscribe(\"MESSAGE_REACTION_ADD_USERS\", cb);\n }, [message.id]);\n\n const reactions = getReactionsWithQueue(message, emoji, type);\n const users = Object.values(reactions).filter(Boolean) as User[];\n\n for (const user of users) {\n FluxDispatcher.dispatch({\n type: \"USER_UPDATE\",\n user\n });\n }\n\n return (\n \n
\n \n
\n \n );\n },\n\n set reactions(value: any) {\n reactions = value;\n }\n});\n\ninterface ReactionCacheEntry {\n fetched: boolean;\n users: Record;\n}\n\ninterface RootObject {\n message: Message;\n readOnly: boolean;\n isLurking: boolean;\n isPendingMember: boolean;\n useChatFontScaling: boolean;\n emoji: CustomEmoji;\n count: number;\n burst_user_ids: any[];\n burst_count: number;\n burst_colors: any[];\n burst_me: boolean;\n me: boolean;\n type: number;\n hideEmoji: boolean;\n remainingBurstCurrency: number;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from \"@api/Commands\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"Wikisearch\",\n description: \"Searches Wikipedia for your requested query. (/wikisearch)\",\n authors: [Devs.Samu],\n dependencies: [\"CommandsAPI\"],\n commands: [\n {\n name: \"wikisearch\",\n description: \"Searches Wikipedia for your request.\",\n inputType: ApplicationCommandInputType.BUILT_IN,\n options: [\n {\n name: \"search\",\n description: \"Word to search for\",\n type: ApplicationCommandOptionType.STRING,\n required: true\n },\n ],\n execute: async (_, ctx) => {\n const word = findOption(_, \"search\", \"\");\n\n if (!word) {\n return sendBotMessage(ctx.channel.id, {\n content: \"No word was defined!\"\n });\n }\n\n const dataSearchParams = new URLSearchParams({\n action: \"query\",\n format: \"json\",\n list: \"search\",\n formatversion: \"2\",\n origin: \"*\",\n srsearch: word\n });\n\n const data = await fetch(\"https://en.wikipedia.org/w/api.php?\" + dataSearchParams).then(response => response.json())\n .catch(err => {\n console.log(err);\n sendBotMessage(ctx.channel.id, { content: \"There was an error. Check the console for more info\" });\n return null;\n });\n\n if (!data) return;\n\n if (!data.query?.search?.length) {\n console.log(data);\n return sendBotMessage(ctx.channel.id, { content: \"No results given\" });\n }\n\n const altData = await fetch(`https://en.wikipedia.org/w/api.php?action=query&format=json&prop=info%7Cdescription%7Cimages%7Cimageinfo%7Cpageimages&list=&meta=&indexpageids=1&pageids=${data.query.search[0].pageid}&formatversion=2&origin=*`)\n .then(res => res.json())\n .then(data => data.query.pages[0])\n .catch(err => {\n console.log(err);\n sendBotMessage(ctx.channel.id, { content: \"There was an error. Check the console for more info\" });\n return null;\n });\n\n if (!altData) return;\n\n const thumbnailData = altData.thumbnail;\n\n const thumbnail = thumbnailData && {\n url: thumbnailData.source.replace(/(50px-)/ig, \"1000px-\"),\n height: thumbnailData.height * 100,\n width: thumbnailData.width * 100\n };\n\n sendBotMessage(ctx.channel.id, {\n embeds: [\n {\n type: \"rich\",\n title: data.query.search[0].title,\n url: `https://wikipedia.org/w/index.php?curid=${data.query.search[0].pageid}`,\n color: \"0x8663BE\",\n description: data.query.search[0].snippet.replace(/( |<([^>]+)>)/ig, \"\").replace(/(")/ig, \"\\\"\") + \"...\",\n image: thumbnail,\n footer: {\n text: \"Powered by the Wikimedia API\",\n },\n }\n ] as any\n });\n }\n }\n ]\n});\n", "import p0 from \"./plugins/_api/badges\";\nimport p1 from \"./plugins/_api/commands\";\nimport p2 from \"./plugins/_api/contextMenu\";\nimport p3 from \"./plugins/_api/memberListDecorators\";\nimport p4 from \"./plugins/_api/messageAccessories\";\nimport p5 from \"./plugins/_api/messageDecorations\";\nimport p6 from \"./plugins/_api/messageEvents\";\nimport p7 from \"./plugins/_api/messagePopover\";\nimport p8 from \"./plugins/_api/notices\";\nimport p9 from \"./plugins/_api/serverList\";\nimport p10 from \"./plugins/_core/noTrack\";\nimport p11 from \"./plugins/_core/settings\";\nimport p12 from \"./plugins/_core/supportHelper\";\nimport p13 from \"./plugins/alwaysAnimate\";\nimport p14 from \"./plugins/alwaysTrust\";\nimport p15 from \"./plugins/anonymiseFileNames\";\nimport p16 from \"./plugins/arRPC.web\";\nimport p17 from \"./plugins/banger\";\nimport p18 from \"./plugins/betterFolders\";\nimport p19 from \"./plugins/betterGifAltText\";\nimport p20 from \"./plugins/betterNotes\";\nimport p21 from \"./plugins/betterRoleDot\";\nimport p22 from \"./plugins/betterUploadButton\";\nimport p23 from \"./plugins/biggerStreamPreview\";\nimport p24 from \"./plugins/blurNsfw\";\nimport p25 from \"./plugins/callTimer\";\nimport p26 from \"./plugins/clearURLs\";\nimport p27 from \"./plugins/colorSighted\";\nimport p28 from \"./plugins/consoleShortcuts\";\nimport p29 from \"./plugins/copyUserURLs\";\nimport p30 from \"./plugins/crashHandler\";\nimport p31 from \"./plugins/customRPC\";\nimport p32 from \"./plugins/dearrow\";\nimport p33 from \"./plugins/disableDMCallIdle\";\nimport p34 from \"./plugins/emoteCloner\";\nimport p35 from \"./plugins/experiments\";\nimport p36 from \"./plugins/f8break\";\nimport p37 from \"./plugins/fakeNitro\";\nimport p38 from \"./plugins/fakeProfileThemes\";\nimport p39 from \"./plugins/favEmojiFirst\";\nimport p40 from \"./plugins/favGifSearch\";\nimport p41 from \"./plugins/fixSpotifyEmbeds.desktop\";\nimport p42 from \"./plugins/forceOwnerCrown\";\nimport p43 from \"./plugins/friendInvites\";\nimport p44 from \"./plugins/gameActivityToggle\";\nimport p45 from \"./plugins/gifPaste\";\nimport p46 from \"./plugins/greetStickerPicker\";\nimport p47 from \"./plugins/hideAttachments\";\nimport p48 from \"./plugins/iLoveSpam\";\nimport p49 from \"./plugins/ignoreActivities\";\nimport p50 from \"./plugins/imageZoom\";\nimport p51 from \"./plugins/invisibleChat.desktop\";\nimport p52 from \"./plugins/keepCurrentChannel\";\nimport p53 from \"./plugins/lastfm\";\nimport p54 from \"./plugins/loadingQuotes\";\nimport p55 from \"./plugins/memberCount\";\nimport p56 from \"./plugins/messageClickActions\";\nimport p57 from \"./plugins/messageLinkEmbeds\";\nimport p58 from \"./plugins/messageLogger\";\nimport p59 from \"./plugins/messageTags\";\nimport p60 from \"./plugins/moreCommands\";\nimport p61 from \"./plugins/moreKaomoji\";\nimport p62 from \"./plugins/moreUserTags\";\nimport p63 from \"./plugins/moyai\";\nimport p64 from \"./plugins/muteNewGuild\";\nimport p65 from \"./plugins/mutualGroupDMs\";\nimport p66 from \"./plugins/noBlockedMessages\";\nimport p67 from \"./plugins/noDevtoolsWarning\";\nimport p68 from \"./plugins/noF1\";\nimport p69 from \"./plugins/noMosaic\";\nimport p70 from \"./plugins/noPendingCount\";\nimport p71 from \"./plugins/noProfileThemes\";\nimport p72 from \"./plugins/noReplyMention\";\nimport p73 from \"./plugins/noScreensharePreview\";\nimport p74 from \"./plugins/noTypingAnimation\";\nimport p75 from \"./plugins/noUnblockToJump\";\nimport p76 from \"./plugins/normalizeMessageLinks\";\nimport p77 from \"./plugins/nsfwGateBypass\";\nimport p78 from \"./plugins/onePingPerDM\";\nimport p79 from \"./plugins/oneko\";\nimport p80 from \"./plugins/openInApp\";\nimport p81 from \"./plugins/partyMode\";\nimport p82 from \"./plugins/permissionFreeWill\";\nimport p83 from \"./plugins/permissionsViewer\";\nimport p84 from \"./plugins/petpet\";\nimport p85 from \"./plugins/pictureInPicture\";\nimport p86 from \"./plugins/pinDms\";\nimport p87 from \"./plugins/plainFolderIcon\";\nimport p88 from \"./plugins/platformIndicators\";\nimport p89 from \"./plugins/previewMessage\";\nimport p90 from \"./plugins/pronoundb\";\nimport p91 from \"./plugins/quickMention\";\nimport p92 from \"./plugins/quickReply\";\nimport p93 from \"./plugins/reactErrorDecoder\";\nimport p94 from \"./plugins/readAllNotificationsButton\";\nimport p95 from \"./plugins/relationshipNotifier\";\nimport p96 from \"./plugins/revealAllSpoilers\";\nimport p97 from \"./plugins/reverseImageSearch\";\nimport p98 from \"./plugins/roleColorEverywhere\";\nimport p99 from \"./plugins/searchReply\";\nimport p100 from \"./plugins/secretRingTone\";\nimport p101 from \"./plugins/sendTimestamps\";\nimport p102 from \"./plugins/serverListIndicators\";\nimport p103 from \"./plugins/serverProfile\";\nimport p104 from \"./plugins/shikiCodeblocks.desktop\";\nimport p105 from \"./plugins/showAllMessageButtons\";\nimport p106 from \"./plugins/showConnections\";\nimport p107 from \"./plugins/showHiddenChannels\";\nimport p108 from \"./plugins/showMeYourName\";\nimport p109 from \"./plugins/showTimeouts\";\nimport p110 from \"./plugins/silentMessageToggle\";\nimport p111 from \"./plugins/silentTyping\";\nimport p112 from \"./plugins/sortFriendRequests\";\nimport p113 from \"./plugins/spotifyControls\";\nimport p114 from \"./plugins/spotifyCrack\";\nimport p115 from \"./plugins/spotifyShareCommands\";\nimport p116 from \"./plugins/startupTimings\";\nimport p117 from \"./plugins/superReactionTweaks\";\nimport p118 from \"./plugins/textReplace\";\nimport p119 from \"./plugins/themeAttributes\";\nimport p120 from \"./plugins/timeBarAllActivities\";\nimport p121 from \"./plugins/translate\";\nimport p122 from \"./plugins/typingIndicator\";\nimport p123 from \"./plugins/typingTweaks\";\nimport p124 from \"./plugins/unindent\";\nimport p125 from \"./plugins/unsuppressEmbeds\";\nimport p126 from \"./plugins/urbanDictionary\";\nimport p127 from \"./plugins/userVoiceShow\";\nimport p128 from \"./plugins/usrbg\";\nimport p129 from \"./plugins/validUser\";\nimport p130 from \"./plugins/vcDoubleClick\";\nimport p131 from \"./plugins/vcNarrator\";\nimport p132 from \"./plugins/vencordToolbox\";\nimport p133 from \"./plugins/viewIcons\";\nimport p134 from \"./plugins/viewRaw\";\nimport p135 from \"./plugins/voiceMessages\";\nimport p136 from \"./plugins/webContextMenus.web\";\nimport p137 from \"./plugins/webKeybinds.web\";\nimport p138 from \"./plugins/whoReacted\";\nimport p139 from \"./plugins/wikisearch\";\nexport default {\n[p0.name]:p0,\n[p1.name]:p1,\n[p2.name]:p2,\n[p3.name]:p3,\n[p4.name]:p4,\n[p5.name]:p5,\n[p6.name]:p6,\n[p7.name]:p7,\n[p8.name]:p8,\n[p9.name]:p9,\n[p10.name]:p10,\n[p11.name]:p11,\n[p12.name]:p12,\n[p13.name]:p13,\n[p14.name]:p14,\n[p15.name]:p15,\n[p16.name]:p16,\n[p17.name]:p17,\n[p18.name]:p18,\n[p19.name]:p19,\n[p20.name]:p20,\n[p21.name]:p21,\n[p22.name]:p22,\n[p23.name]:p23,\n[p24.name]:p24,\n[p25.name]:p25,\n[p26.name]:p26,\n[p27.name]:p27,\n[p28.name]:p28,\n[p29.name]:p29,\n[p30.name]:p30,\n[p31.name]:p31,\n[p32.name]:p32,\n[p33.name]:p33,\n[p34.name]:p34,\n[p35.name]:p35,\n[p36.name]:p36,\n[p37.name]:p37,\n[p38.name]:p38,\n[p39.name]:p39,\n[p40.name]:p40,\n[p41.name]:p41,\n[p42.name]:p42,\n[p43.name]:p43,\n[p44.name]:p44,\n[p45.name]:p45,\n[p46.name]:p46,\n[p47.name]:p47,\n[p48.name]:p48,\n[p49.name]:p49,\n[p50.name]:p50,\n[p51.name]:p51,\n[p52.name]:p52,\n[p53.name]:p53,\n[p54.name]:p54,\n[p55.name]:p55,\n[p56.name]:p56,\n[p57.name]:p57,\n[p58.name]:p58,\n[p59.name]:p59,\n[p60.name]:p60,\n[p61.name]:p61,\n[p62.name]:p62,\n[p63.name]:p63,\n[p64.name]:p64,\n[p65.name]:p65,\n[p66.name]:p66,\n[p67.name]:p67,\n[p68.name]:p68,\n[p69.name]:p69,\n[p70.name]:p70,\n[p71.name]:p71,\n[p72.name]:p72,\n[p73.name]:p73,\n[p74.name]:p74,\n[p75.name]:p75,\n[p76.name]:p76,\n[p77.name]:p77,\n[p78.name]:p78,\n[p79.name]:p79,\n[p80.name]:p80,\n[p81.name]:p81,\n[p82.name]:p82,\n[p83.name]:p83,\n[p84.name]:p84,\n[p85.name]:p85,\n[p86.name]:p86,\n[p87.name]:p87,\n[p88.name]:p88,\n[p89.name]:p89,\n[p90.name]:p90,\n[p91.name]:p91,\n[p92.name]:p92,\n[p93.name]:p93,\n[p94.name]:p94,\n[p95.name]:p95,\n[p96.name]:p96,\n[p97.name]:p97,\n[p98.name]:p98,\n[p99.name]:p99,\n[p100.name]:p100,\n[p101.name]:p101,\n[p102.name]:p102,\n[p103.name]:p103,\n[p104.name]:p104,\n[p105.name]:p105,\n[p106.name]:p106,\n[p107.name]:p107,\n[p108.name]:p108,\n[p109.name]:p109,\n[p110.name]:p110,\n[p111.name]:p111,\n[p112.name]:p112,\n[p113.name]:p113,\n[p114.name]:p114,\n[p115.name]:p115,\n[p116.name]:p116,\n[p117.name]:p117,\n[p118.name]:p118,\n[p119.name]:p119,\n[p120.name]:p120,\n[p121.name]:p121,\n[p122.name]:p122,\n[p123.name]:p123,\n[p124.name]:p124,\n[p125.name]:p125,\n[p126.name]:p126,\n[p127.name]:p127,\n[p128.name]:p128,\n[p129.name]:p129,\n[p130.name]:p130,\n[p131.name]:p131,\n[p132.name]:p132,\n[p133.name]:p133,\n[p134.name]:p134,\n[p135.name]:p135,\n[p136.name]:p136,\n[p137.name]:p137,\n[p138.name]:p138,\n[p139.name]:p139,\n};", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { User } from \"discord-types/general\";\nimport { ComponentType, HTMLProps } from \"react\";\n\nimport Plugins from \"~plugins\";\n\nexport const enum BadgePosition {\n START,\n END\n}\n\nexport interface ProfileBadge {\n /** The tooltip to show on hover. Required for image badges */\n description?: string;\n /** Custom component for the badge (tooltip not included) */\n component?: ComponentType;\n /** The custom image to use */\n image?: string;\n link?: string;\n /** Action to perform when you click the badge */\n onClick?(): void;\n /** Should the user display this badge? */\n shouldShow?(userInfo: BadgeUserArgs): boolean;\n /** Optional props (e.g. style) for the badge, ignored for component badges */\n props?: HTMLProps;\n /** Insert at start or end? */\n position?: BadgePosition;\n /** The badge name to display, Discord uses this. Required for component badges */\n key?: string;\n}\n\nconst Badges = new Set();\n\n/**\n * Register a new badge with the Badges API\n * @param badge The badge to register\n */\nexport function addBadge(badge: ProfileBadge) {\n badge.component &&= ErrorBoundary.wrap(badge.component, { noop: true });\n Badges.add(badge);\n}\n\n/**\n * Unregister a badge from the Badges API\n * @param badge The badge to remove\n */\nexport function removeBadge(badge: ProfileBadge) {\n return Badges.delete(badge);\n}\n\n/**\n * Inject badges into the profile badges array.\n * You probably don't need to use this.\n */\nexport function _getBadges(args: BadgeUserArgs) {\n const badges = [] as ProfileBadge[];\n for (const badge of Badges) {\n if (!badge.shouldShow || badge.shouldShow(args)) {\n badge.position === BadgePosition.START\n ? badges.unshift({ ...badge, ...args })\n : badges.push({ ...badge, ...args });\n }\n }\n const donorBadges = (Plugins.BadgeAPI as unknown as typeof import(\"../plugins/_api/badges\").default).getDonorBadges(args.user.id);\n if (donorBadges) badges.unshift(...donorBadges);\n\n return badges;\n}\n\nexport interface BadgeUserArgs {\n user: User;\n profile: Profile;\n premiumSince: Date;\n premiumGuildSince?: Date;\n}\n\ninterface ConnectedAccount {\n type: string;\n id: string;\n name: string;\n verified: boolean;\n}\n\ninterface Profile {\n connectedAccounts: ConnectedAccount[];\n premiumType: number;\n premiumSince: string;\n premiumGuildSince?: any;\n lastFetched: number;\n profileFetchFailed: boolean;\n application?: any;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport * as $Badges from \"./Badges\";\nimport * as $Commands from \"./Commands\";\nimport * as $ContextMenu from \"./ContextMenu\";\nimport * as $DataStore from \"./DataStore\";\nimport * as $MemberListDecorators from \"./MemberListDecorators\";\nimport * as $MessageAccessories from \"./MessageAccessories\";\nimport * as $MessageDecorations from \"./MessageDecorations\";\nimport * as $MessageEventsAPI from \"./MessageEvents\";\nimport * as $MessagePopover from \"./MessagePopover\";\nimport * as $Notices from \"./Notices\";\nimport * as $Notifications from \"./Notifications\";\nimport * as $ServerList from \"./ServerList\";\nimport * as $Settings from \"./Settings\";\nimport * as $Styles from \"./Styles\";\n\n/**\n * An API allowing you to listen to Message Clicks or run your own logic\n * before a message is sent\n *\n * If your plugin uses this, you must add MessageEventsAPI to its dependencies\n */\nexport const MessageEvents = $MessageEventsAPI;\n/**\n * An API allowing you to create custom notices\n * (snackbars on the top, like the Update prompt)\n */\nexport const Notices = $Notices;\n/**\n * An API allowing you to register custom commands\n */\nexport const Commands = $Commands;\n/**\n * A wrapper around IndexedDB. This can store arbitrarily\n * large data and supports a lot of datatypes (Blob, Map, ...).\n * For a full list, see the mdn link below\n *\n * This should always be preferred over the Settings API if possible, as\n * localstorage has very strict size restrictions and blocks the event loop\n *\n * Make sure your keys are unique (tip: prefix them with ur plugin name)\n * and please clean up no longer needed entries.\n *\n * This is actually just idb-keyval, so if you're familiar with that, you're golden!\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#supported_types}\n */\nexport const DataStore = $DataStore;\n/**\n * An API allowing you to add custom components as message accessories\n */\nexport const MessageAccessories = $MessageAccessories;\n/**\n * An API allowing you to add custom buttons in the message popover\n */\nexport const MessagePopover = $MessagePopover;\n/**\n * An API allowing you to add badges to user profiles\n */\nexport const Badges = $Badges;\n/**\n * An API allowing you to add custom elements to the server list\n */\nexport const ServerList = $ServerList;\n/**\n * An API allowing you to add components as message accessories\n */\nexport const MessageDecorations = $MessageDecorations;\n/**\n * An API allowing you to add components to member list users, in both DM's and servers\n */\nexport const MemberListDecorators = $MemberListDecorators;\n/**\n * An API allowing you to persist data\n */\nexport const Settings = $Settings;\n/**\n * An API allowing you to dynamically load styles\n * a\n */\nexport const Styles = $Styles;\n/**\n * An API allowing you to display notifications\n */\nexport const Notifications = $Notifications;\n\n/**\n * An api allowing you to patch and add/remove items to/from context menus\n */\nexport const ContextMenu = $ContextMenu;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { LiteralUnion } from \"type-fest\";\n\n/**\n * Wait for a property to be defined on the target, then call the callback with\n * the value\n * @param target Object\n * @param property Property to be defined\n * @param callback Callback\n *\n * @example onceDefined(window, \"webpackChunkdiscord_app\", wpInstance => wpInstance.push(...));\n */\nexport function onceDefined>(\n target: T, property: P, callback: (v: P extends keyof T ? T[P] : any) => void\n): void {\n const propertyAsAny = property as any;\n\n if (property in target)\n return void callback(target[propertyAsAny]);\n\n Object.defineProperty(target, property, {\n set(v) {\n delete target[propertyAsAny];\n target[propertyAsAny] = v;\n callback(v);\n },\n configurable: true,\n enumerable: false\n });\n}\n", "/*!\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport * from \"./ChangeList\";\nexport * from \"./constants\";\nexport * from \"./debounce\";\nexport * from \"./discord\";\nexport * from \"./guards\";\nexport * from \"./lazy\";\nexport * from \"./localStorage\";\nexport * from \"./Logger\";\nexport * from \"./margins\";\nexport * from \"./misc\";\nexport * from \"./modal\";\nexport * from \"./onceDefined\";\nexport * from \"./onlyOnce\";\nexport * from \"./patches\";\nexport * from \"./Queue\";\nexport * from \"./react\";\nexport * from \"./text\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { addSettingsListener, Settings } from \"@api/Settings\";\n\n\nlet style: HTMLStyleElement;\nlet themesStyle: HTMLStyleElement;\n\nfunction createStyle(id: string) {\n const style = document.createElement(\"style\");\n style.id = id;\n document.documentElement.append(style);\n return style;\n}\n\nasync function initSystemValues() {\n const values = await VencordNative.themes.getSystemValues();\n const variables = Object.entries(values)\n .filter(([, v]) => v !== \"#\")\n .map(([k, v]) => `--${k}: ${v};`)\n .join(\"\");\n\n createStyle(\"vencord-os-theme-values\").textContent = `:root{${variables}}`;\n}\n\nexport async function toggle(isEnabled: boolean) {\n if (!style) {\n if (isEnabled) {\n style = createStyle(\"vencord-custom-css\");\n VencordNative.quickCss.addChangeListener(css => {\n style.textContent = css;\n // At the time of writing this, changing textContent resets the disabled state\n style.disabled = !Settings.useQuickCss;\n });\n style.textContent = await VencordNative.quickCss.get();\n }\n } else\n style.disabled = !isEnabled;\n}\n\nasync function initThemes() {\n themesStyle ??= createStyle(\"vencord-themes\");\n\n const { themeLinks, enabledThemes } = Settings;\n\n const links: string[] = [...themeLinks];\n\n if (IS_WEB) {\n for (const theme of enabledThemes) {\n const themeData = await VencordNative.themes.getThemeData(theme);\n if (!themeData) continue;\n const blob = new Blob([themeData], { type: \"text/css\" });\n links.push(URL.createObjectURL(blob));\n }\n } else {\n const localThemes = enabledThemes.map(theme => `vencord:///themes/${theme}?v=${Date.now()}`);\n links.push(...localThemes);\n }\n\n themesStyle.textContent = links.map(link => `@import url(\"${link.trim()}\");`).join(\"\\n\");\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n initSystemValues();\n initThemes();\n\n toggle(Settings.useQuickCss);\n addSettingsListener(\"useQuickCss\", toggle);\n\n addSettingsListener(\"themeLinks\", initThemes);\n addSettingsListener(\"enabledThemes\", initThemes);\n\n if (!IS_WEB)\n VencordNative.quickCss.addThemeChangeListener(initThemes);\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport * as Common from \"./common\";\nexport * from \"./webpack\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { WEBPACK_CHUNK } from \"@utils/constants\";\nimport { Logger } from \"@utils/Logger\";\nimport { canonicalizeReplacement } from \"@utils/patches\";\nimport { PatchReplacement } from \"@utils/types\";\n\nimport { traceFunction } from \"../debug/Tracer\";\nimport { _initWebpack } from \".\";\n\nlet webpackChunk: any[];\n\nconst logger = new Logger(\"WebpackInterceptor\", \"#8caaee\");\n\nif (window[WEBPACK_CHUNK]) {\n logger.info(`Patching ${WEBPACK_CHUNK}.push (was already existent, likely from cache!)`);\n _initWebpack(window[WEBPACK_CHUNK]);\n patchPush(window[WEBPACK_CHUNK]);\n} else {\n Object.defineProperty(window, WEBPACK_CHUNK, {\n get: () => webpackChunk,\n set: v => {\n if (v?.push) {\n if (!v.push.$$vencordOriginal) {\n logger.info(`Patching ${WEBPACK_CHUNK}.push`);\n patchPush(v);\n }\n\n if (_initWebpack(v)) {\n logger.info(\"Successfully initialised Vencord webpack\");\n // @ts-ignore\n delete window[WEBPACK_CHUNK];\n window[WEBPACK_CHUNK] = v;\n }\n }\n webpackChunk = v;\n },\n configurable: true\n });\n\n // wreq.m is the webpack module factory.\n // normally, this is populated via webpackGlobal.push, which we patch below.\n // However, Discord has their .m prepopulated.\n // Thus, we use this hack to immediately access their wreq.m and patch all already existing factories\n Object.defineProperty(Function.prototype, \"m\", {\n set(v: any) {\n // When using react devtools or other extensions, we may also catch their webpack here.\n // This ensures we actually got the right one\n if (new Error().stack?.includes(\"discord.com\")) {\n logger.info(\"Found webpack module factory\");\n patchFactories(v);\n\n delete (Function.prototype as any).m;\n }\n\n Object.defineProperty(this, \"m\", {\n value: v,\n configurable: true,\n });\n },\n configurable: true\n });\n}\n\nfunction patchPush(webpackGlobal: any) {\n function handlePush(chunk: any) {\n try {\n patchFactories(chunk[1]);\n } catch (err) {\n logger.error(\"Error in handlePush\", err);\n }\n\n return handlePush.$$vencordOriginal.call(webpackGlobal, chunk);\n }\n\n handlePush.$$vencordOriginal = webpackGlobal.push;\n // Webpack overwrites .push with its own push like so: `d.push = n.bind(null, d.push.bind(d));`\n // it wraps the old push (`d.push.bind(d)`). this old push is in this case our handlePush.\n // If we then repatched the new push, we would end up with recursive patching, which leads to our patches\n // being applied multiple times.\n // Thus, override bind to use the original push\n handlePush.bind = (...args: unknown[]) => handlePush.$$vencordOriginal.bind(...args);\n\n Object.defineProperty(webpackGlobal, \"push\", {\n get: () => handlePush,\n set(v) {\n handlePush.$$vencordOriginal = v;\n },\n configurable: true\n });\n}\n\nfunction patchFactories(factories: Record void>) {\n const { subscriptions, listeners } = Vencord.Webpack;\n const { patches } = Vencord.Plugins;\n\n for (const id in factories) {\n let mod = factories[id];\n // Discords Webpack chunks for some ungodly reason contain random\n // newlines. Cyn recommended this workaround and it seems to work fine,\n // however this could potentially break code, so if anything goes weird,\n // this is probably why.\n // Additionally, `[actual newline]` is one less char than \"\\n\", so if Discord\n // ever targets newer browsers, the minifier could potentially use this trick and\n // cause issues.\n let code: string = mod.toString().replaceAll(\"\\n\", \"\");\n // a very small minority of modules use function() instead of arrow functions,\n // but, unnamed toplevel functions aren't valid. However 0, function() makes it a statement\n if (code.startsWith(\"function(\")) {\n code = \"0,\" + code;\n }\n const originalMod = mod;\n const patchedBy = new Set();\n\n const factory = factories[id] = function (module, exports, require) {\n try {\n mod(module, exports, require);\n } catch (err) {\n // Just rethrow discord errors\n if (mod === originalMod) throw err;\n\n logger.error(\"Error in patched chunk\", err);\n return void originalMod(module, exports, require);\n }\n\n exports = module.exports;\n\n if (!exports) return;\n\n // There are (at the time of writing) 11 modules exporting the window\n // Make these non enumerable to improve webpack search performance\n if (exports === window) {\n Object.defineProperty(require.c, id, {\n value: require.c[id],\n enumerable: false,\n configurable: true,\n writable: true\n });\n return;\n }\n\n const numberId = Number(id);\n\n for (const callback of listeners) {\n try {\n callback(exports, numberId);\n } catch (err) {\n logger.error(\"Error in webpack listener\", err);\n }\n }\n\n for (const [filter, callback] of subscriptions) {\n try {\n if (filter(exports)) {\n subscriptions.delete(filter);\n callback(exports, numberId);\n } else if (typeof exports === \"object\") {\n if (exports.default && filter(exports.default)) {\n subscriptions.delete(filter);\n callback(exports.default, numberId);\n }\n\n for (const nested in exports) if (nested.length <= 3) {\n if (exports[nested] && filter(exports[nested])) {\n subscriptions.delete(filter);\n callback(exports[nested], numberId);\n }\n }\n }\n } catch (err) {\n logger.error(\"Error while firing callback for webpack chunk\", err);\n }\n }\n } as any as { toString: () => string, original: any, (...args: any[]): void; };\n\n // for some reason throws some error on which calling .toString() leads to infinite recursion\n // when you force load all chunks???\n try {\n factory.toString = () => mod.toString();\n factory.original = originalMod;\n } catch { }\n\n for (let i = 0; i < patches.length; i++) {\n const patch = patches[i];\n const executePatch = traceFunction(`patch by ${patch.plugin}`, (match: string | RegExp, replace: string) => code.replace(match, replace));\n if (patch.predicate && !patch.predicate()) continue;\n\n if (code.includes(patch.find)) {\n patchedBy.add(patch.plugin);\n\n // we change all patch.replacement to array in plugins/index\n for (const replacement of patch.replacement as PatchReplacement[]) {\n if (replacement.predicate && !replacement.predicate()) continue;\n const lastMod = mod;\n const lastCode = code;\n\n canonicalizeReplacement(replacement, patch.plugin);\n\n try {\n const newCode = executePatch(replacement.match, replacement.replace as string);\n if (newCode === code && !patch.noWarn) {\n (window.explosivePlugins ??= new Set()).add(patch.plugin);\n logger.warn(`Patch by ${patch.plugin} had no effect (Module id is ${id}): ${replacement.match}`);\n if (IS_DEV) {\n logger.debug(\"Function Source:\\n\", code);\n }\n } else {\n code = newCode;\n mod = (0, eval)(`// Webpack Module ${id} - Patched by ${[...patchedBy].join(\", \")}\\n${newCode}\\n//# sourceURL=WebpackModule${id}`);\n }\n } catch (err) {\n logger.error(`Patch by ${patch.plugin} errored (Module id is ${id}): ${replacement.match}\\n`, err);\n\n if (IS_DEV) {\n const changeSize = code.length - lastCode.length;\n const match = lastCode.match(replacement.match)!;\n\n // Use 200 surrounding characters of context\n const start = Math.max(0, match.index! - 200);\n const end = Math.min(lastCode.length, match.index! + match[0].length + 200);\n // (changeSize may be negative)\n const endPatched = end + changeSize;\n\n const context = lastCode.slice(start, end);\n const patchedContext = code.slice(start, endPatched);\n\n // inline require to avoid including it in !IS_DEV builds\n const diff = (require(\"diff\") as typeof import(\"diff\")).diffWordsWithSpace(context, patchedContext);\n let fmt = \"%c %s \";\n const elements = [] as string[];\n for (const d of diff) {\n const color = d.removed\n ? \"red\"\n : d.added\n ? \"lime\"\n : \"grey\";\n fmt += \"%c%s\";\n elements.push(\"color:\" + color, d.value);\n }\n\n logger.errorCustomFmt(...Logger.makeTitle(\"white\", \"Before\"), context);\n logger.errorCustomFmt(...Logger.makeTitle(\"white\", \"After\"), patchedContext);\n const [titleFmt, ...titleElements] = Logger.makeTitle(\"white\", \"Diff\");\n logger.errorCustomFmt(titleFmt + fmt, ...titleElements, ...elements);\n }\n code = lastCode;\n mod = lastMod;\n patchedBy.delete(patch.plugin);\n }\n }\n\n if (!patch.all) patches.splice(i--, 1);\n }\n }\n }\n}\n", "/*!\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport * as Api from \"./api\";\nexport * as Plugins from \"./plugins\";\nexport * as Util from \"./utils\";\nexport * as QuickCss from \"./utils/quickCss\";\nexport * as Updater from \"./utils/updater\";\nexport * as Webpack from \"./webpack\";\nexport { PlainSettings, Settings };\n\nimport \"./utils/quickCss\";\nimport \"./webpack/patchWebpack\";\n\nimport { get as dsGet } from \"./api/DataStore\";\nimport { showNotification } from \"./api/Notifications\";\nimport { PlainSettings, Settings } from \"./api/Settings\";\nimport { patches, PMLogger, startAllPlugins } from \"./plugins\";\nimport { localStorage } from \"./utils/localStorage\";\nimport { relaunch } from \"./utils/native\";\nimport { getCloudSettings, putCloudSettings } from \"./utils/settingsSync\";\nimport { checkForUpdates, update, UpdateLogger } from \"./utils/updater\";\nimport { onceReady } from \"./webpack\";\nimport { SettingsRouter } from \"./webpack/common\";\n\nasync function syncSettings() {\n // pre-check for local shared settings\n if (\n Settings.cloud.authenticated &&\n await dsGet(\"Vencord_cloudSecret\") === null // this has been enabled due to local settings share or some other bug\n ) {\n // show a notification letting them know and tell them how to fix it\n showNotification({\n title: \"Cloud Integrations\",\n body: \"We've noticed you have cloud integrations enabled in another client! Due to limitations, you will \" +\n \"need to re-authenticate to continue using them. Click here to go to the settings page to do so!\",\n color: \"var(--yellow-360)\",\n onClick: () => SettingsRouter.open(\"VencordCloud\")\n });\n return;\n }\n\n if (\n Settings.cloud.settingsSync && // if it's enabled\n Settings.cloud.authenticated // if cloud integrations are enabled\n ) {\n if (localStorage.Vencord_settingsDirty) {\n await putCloudSettings();\n delete localStorage.Vencord_settingsDirty;\n } else if (await getCloudSettings(false)) { // if we synchronized something (false means no sync)\n // we show a notification here instead of allowing getCloudSettings() to show one to declutter the amount of\n // potential notifications that might occur. getCloudSettings() will always send a notification regardless if\n // there was an error to notify the user, but besides that we only want to show one notification instead of all\n // of the possible ones it has (such as when your settings are newer).\n showNotification({\n title: \"Cloud Settings\",\n body: \"Your settings have been updated! Click here to restart to fully apply changes!\",\n color: \"var(--green-360)\",\n onClick: relaunch\n });\n }\n }\n}\n\nasync function init() {\n await onceReady;\n startAllPlugins();\n\n syncSettings();\n\n if (!IS_WEB) {\n try {\n const isOutdated = await checkForUpdates();\n if (!isOutdated) return;\n\n if (Settings.autoUpdate) {\n await update();\n if (Settings.autoUpdateNotification)\n setTimeout(() => showNotification({\n title: \"Vencord has been updated!\",\n body: \"Click here to restart\",\n permanent: true,\n noPersist: true,\n onClick: relaunch\n }), 10_000);\n return;\n }\n\n if (Settings.notifyAboutUpdates)\n setTimeout(() => showNotification({\n title: \"A Vencord update is available!\",\n body: \"Click here to view the update\",\n permanent: true,\n noPersist: true,\n onClick() {\n SettingsRouter.open(\"VencordUpdater\");\n }\n }), 10_000);\n } catch (err) {\n UpdateLogger.error(\"Failed to check for updates\", err);\n }\n }\n\n if (IS_DEV) {\n const pendingPatches = patches.filter(p => !p.all && p.predicate?.() !== false);\n if (pendingPatches.length)\n PMLogger.warn(\n \"Webpack has finished initialising, but some patches haven't been applied yet.\",\n \"This might be expected since some Modules are lazy loaded, but please verify\",\n \"that all plugins are working as intended.\",\n \"You are seeing this warning because this is a Development build of Vencord.\",\n \"\\nThe following patches have not been applied:\",\n \"\\n\\n\" + pendingPatches.map(p => `${p.plugin}: ${p.find}`).join(\"\\n\")\n );\n }\n}\n\ninit();\n\nif (IS_DISCORD_DESKTOP && Settings.winNativeTitleBar && navigator.platform.toLowerCase().startsWith(\"win\")) {\n document.addEventListener(\"DOMContentLoaded\", () => {\n document.head.append(Object.assign(document.createElement(\"style\"), {\n id: \"vencord-native-titlebar-style\",\n textContent: \"[class*=titleBar]{display: none!important}\"\n }));\n }, { once: true });\n}\n"], + "mappings": ";;;;67BAAA,IAkBaA,EACFC,EAnBXC,EAAAC,EAAA,kBAkBaH,EAAiC,OAAO,IAAI,gBAAgB,EAC9DC,EACP,IAAIG,KAAUH,EAAuB,QAAQ,QAAQ,OAAO,MAAM,eAAe,GAAGG,CAAI,ICpB5F,IAkBaC,GAlBbC,GAAAC,EAAA,kBAAAC,IAkBaH,GAAN,KAAa,CAahB,YAAmBI,EAAqBC,EAAgB,QAAS,CA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,mBACR,EACA,KAAM,CACF,KAAM,OACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,SACN,GAAI,mBACR,EACA,UAAW,CACP,KAAM,MACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,OACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,SACN,GAAI,mBACR,EACA,IAAK,CACD,KAAM,MACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,SACN,GAAI,mBACR,EACA,MAAO,CACH,KAAM,QACN,GAAI,mBACR,EACA,QAAS,CACL,KAAM,UACN,GAAI,mBACR,EACA,YAAa,CACT,KAAM,cACN,GAAI,mBACR,EACA,MAAO,CACH,KAAM,QACN,GAAI,mBACR,EACA,QAAS,CACL,KAAM,WACN,GAAI,mBACR,EACA,aAAc,CACV,KAAM,eACN,GAAI,mBACR,EACA,WAAY,CACR,KAAM,aACN,GAAI,mBACR,EACA,QAAS,CACL,KAAM,UACN,GAAI,oBACR,EACA,oBAAqB,CACjB,KAAM,wBACN,GAAI,oBACR,EACA,MAAO,CACH,KAAM,QACN,GAAI,EACR,EACA,MAAO,CACH,KAAM,QACN,GAAI,mBACR,EACA,IAAK,CACD,KAAM,MACN,GAAI,mBACR,EACA,SAAU,CACN,KAAM,WACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,OACN,GAAI,mBACR,EACA,MAAO,CACH,KAAM,QACN,GAAI,mBACR,EACA,MAAO,CACH,KAAM,QACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,SACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,OACN,GAAI,mBACR,EACA,IAAK,CACD,KAAM,WACN,GAAI,mBACR,EACA,SAAU,CACN,KAAM,YACN,GAAI,mBACR,EACA,cAAe,CACX,KAAM,gBACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,iBACN,GAAI,mBACR,EACA,MAAO,CACH,KAAM,MACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,SACN,GAAI,kBACR,EACA,WAAY,CACR,KAAM,cACN,GAAI,mBACR,EACA,GAAI,CACA,KAAM,KACN,GAAI,mBACR,EACA,QAAS,CACL,KAAM,UACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,OACN,GAAI,oBACJ,MAAO,EACX,EACA,QAAS,CACL,KAAM,UACN,GAAI,mBACR,EACA,WAAY,CACR,KAAM,aACN,GAAI,kBACR,EACA,OAAQ,CACJ,KAAM,SACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,SACN,GAAI,mBACR,EACA,WAAY,CACR,KAAM,aACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,SACN,GAAI,mBACR,EACA,YAAa,CACT,KAAM,cACN,GAAI,mBACR,EACA,UAAW,CACP,KAAM,YACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,UACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,gBACN,GAAI,mBACR,EACA,MAAO,CACH,KAAM,QACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,SACN,GAAI,oBACR,EACA,QAAS,CACL,KAAM,UACN,GAAI,oBACR,EACA,SAAU,CACN,KAAM,WACN,GAAI,mBACR,EACA,MAAO,CACH,KAAM,QACN,GAAI,mBACR,EACA,MAAO,CACH,KAAM,kBACN,GAAI,mBACR,EACA,WAAY,CACR,KAAM,aACN,GAAI,mBACR,EACA,UAAW,CACP,KAAM,YACN,GAAI,mBACR,EACA,YAAa,CACT,KAAM,QACN,GAAI,mBACR,EACA,SAAU,CACN,KAAM,QACN,GAAI,mBACR,EACA,QAAS,CACL,KAAM,UACN,GAAI,mBACR,EACA,YAAa,CACT,KAAM,cACN,GAAI,mBACR,EACA,QAAS,CACL,KAAM,UACN,GAAI,mBACR,EACA,UAAW,CACP,KAAM,YACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,MACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,OACN,GAAI,mBACR,EACA,KAAM,CACF,KAAM,OACN,GAAI,mBACR,EACA,OAAQ,CACJ,KAAM,U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,EACfA,CACX,CAEO,SAASP,GAAoBO,EAAyB,CACzD,OAAOW,GAAU,OAAOX,CAAQ,CACpC,CAxJA,IAwBMI,GAsDAH,GACAK,GAoDAK,GAnINC,GAAAC,EAAA,kBAAAC,IAkBAC,KACAC,IAKMZ,GAAsB,IAAIa,GAAO,gBAAiB,SAAS,EAsD3DhB,GAAgB,IAAI,IACpBK,GAAgB,IAAI,IAoDpBK,GAAY,IAAI,MCnItB,IAkBaO,GAlBbC,GAAAC,EAAA,kBAAAC,IAkBaH,GAAe,CACxB,oBACA,kBACA,iBACA,uBACA,uBACA,eACA,gBACA,4BACA,2BACA,QACA,aACA,mBACA,qBACA,eACA,eACA,gBACA,mBACA,cACA,gBACA,oBACA,mBACA,cACA,cACA,gBACA,eACA,wBACA,gBACA,gBACA,cACA,cACA,cACA,cACA,cACA,SACA,UACA,MACA,cACA,OACA,QACA,SACA,eACA,aACA,aACA,aACA,UACA,WACA,cACA,QACA,QACA,aACA,WACA,YACA,UACA,cACA,aACA,SACA,SACA,SACA,OACA,cACA,aACA,aACA,YACA,aACA,SACA,aACA,mBACA,YACA,UACA,QACA,YACA,OACA,QACA,MACA,OACA,cACA,WACA,cACA,gBACA,kBACA,SACA,YACA,SACA,sBACA,mBACA,OACA,kBACA,eACA,cACA,eACA,kBACA,kBACA,kBACA,iBACA,SACA,QACA,SACA,SACA,gBACA,yBACA,2BACA,kBACA,kBACA,sBACA,YACA,aACA,cACA,oBACA,sBACA,iBACA,iBACA,iBACA,cACA,SACA,aACA,cACA,aACA,eACA,WACA,sBACA,SACA,qBACJ,IC7IA,IA+BMI,GACAC,GAECC,GAlCPC,GAAAC,EAAA,kBAAAC,IAkBAC,KAOAC,IACAC,IAEAC,KAGMT,GAAe,sBACfC,GAAkB,OAAOD,GAAa,MAAM,EAE3CE,GAAQQ,EAAa,CACxB,KAAM,YACN,YAAa,qCACb,QAAS,CAACC,EAAK,KAAK,EACpB,aAAc,CAAC,kBAAkB,EAEjC,aAAaC,EAAa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SACN,GAAM,cACN,GAAM,UACN,GAAM,SACN,GAAM,aACN,GAAM,UACN,IAAO,WACP,GAAM,UACN,GAAM,YACN,GAAM,UACN,IAAO,UACP,GAAM,WACN,QAAS,uBACT,QAAS,wBACT,GAAM,WACN,GAAM,WACN,GAAM,QACN,GAAM,SACN,GAAM,UACN,IAAO,QACP,GAAM,QACN,GAAM,UACN,GAAM,YACN,GAAM,WACN,GAAM,MACN,GAAM,WACN,GAAM,UACN,GAAM,SACN,GAAM,UACN,GAAM,WACN,GAAM,WACN,GAAM,SACN,GAAM,QACN,GAAM,UACN,GAAM,WACN,GAAM,iBACN,GAAM,QACN,IAAO,WACP,GAAM,SACN,GAAM,QACN,IAAO,QACP,GAAM,YACN,GAAM,YACN,GAAM,OACN,IAAO,UACP,GAAM,aACN,GAAM,QACN,GAAM,UACN,GAAM,WACN,GAAM,WACN,GAAM,UACN,GAAM,SACN,GAAM,QACN,GAAM,cACN,IAAO,UACP,GAAM,SACN,IAAO,OACP,GAAM,qBACN,IAAO,mBACP,GAAM,SACN,GAAM,MACN,GAAM,QACN,GAAM,UACN,GAAM,UACN,GAAM,aACN,GAAM,UACN,GAAM,gBACN,GAAM,aACN,IAAO,WACP,GAAM,WACN,GAAM,QACN,GAAM,YACN,GAAM,UACN,GAAM,QACN,GAAM,UACN,WAAY,uBACZ,IAAO,OACP,GAAM,YACN,GAAM,oBACN,GAAM,SACN,GAAM,YACN,GAAM,eACN,GAAM,QACN,GAAM,SACN,GAAM,UACN,GAAM,SACN,GAAM,aACN,GAAM,UACN,GAAM,UACN,GAAM,WACN,GAAM,UACN,GAAM,SACN,GAAM,WACN,GAAM,eACN,IAAO,SACP,GAAM,UACN,GAAM,UACN,GAAM,QACN,GAAM,SACN,GAAM,UACN,GAAM,SACN,GAAM,YACN,GAAM,SACN,GAAM,UACN,GAAM,YACN,GAAM,UACN,GAAM,UACN,GAAM,QACN,GAAM,QACN,GAAM,QACN,GAAM,SACN,GAAM,OACN,GAAM,WACN,GAA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,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACAC,KACO/I,GAAQ,CACf,CAACgJ,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAG,MAAMA,GACV,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC,GAAI,MAAMA,GACX,CAACC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AGT,GAAI,CAEA,GAAI,CADe,MAAMW,GAAgB,EACxB,OAEjB,GAAIf,EAAS,WAAY,CACrB,MAAMgB,GAAO,EACThB,EAAS,wBACT,WAAW,IAAMM,GAAiB,CAC9B,MAAO,4BACP,KAAM,wBACN,UAAW,GACX,UAAW,GACX,QAASK,EACb,CAAC,EAAG,GAAM,EACd,MACJ,CAEIX,EAAS,oBACT,WAAW,IAAMM,GAAiB,CAC9B,MAAO,iCACP,KAAM,gCACN,UAAW,GACX,UAAW,GACX,SAAU,CACNC,GAAe,KAAK,gBAAgB,CACxC,CACJ,CAAC,EAAG,GAAM,CAClB,OAASU,EAAP,CACEC,GAAa,MAAM,8BAA+BD,CAAG,CACzD,CAeR,CAlIA,IAAAE,GAAAC,EAAA,KAAAC,IAkBAC,KACAC,KACAC,KACAC,KACAC,KACAC,KAGAF,KACAG,KAEAC,KACAC,KACAC,IACAR,KACAS,KACAC,KACAC,KACAR,KACAC,KACAQ,IA8FAvB,GAAK", + "names": ["VencordFragment", "VencordCreateElement", "init_react", "__esmMin", "args", "Logger", "init_Logger", "__esmMin", "init_react", "name", "color", "title", "level", "levelColor", "args", "customFmt", "fmt", "styleStr", "Margins", "init_margins", "__esmMin", "init_react", "dir", "size", "cl", "makeLazy", "factory", "attempts", "tries", "cache", "proxyLazy", "proxyDummy", "kCACHE", "kGET", "handler", "unconfigurable", "init_lazy", "__esmMin", "init_react", "method", "target", "args", "v", "keys", "key", "p", "descriptor", "noopTracer", "traceFunction", "init_Tracer", "__esmMin", "init_react", "init_Logger", "name", "f", "mapper", "_initWebpack", "instance", "cache", "r", "wreq", "id", "exports", "numberId", "callback", "listeners", "err", "logger", "filter", "subscriptions", "nested", "handleModuleNotFound", "method", "findLazy", "proxyLazy", "find", "findAll", "ret", "key", "mod", "nestedMod", "mapMangledModuleLazy", "code", "mappers", "mapMangledModule", "findByProps", "props", "res", "filters", "findByPropsLazy", "findByCode", "findByCodeLazy", "findStore", "name", "findStoreLazy", "waitFor", "existing", "addListener", "removeListener", "search", "results", "factories", "outer", "factory", "str", "extract", "_resolveReady", "onceReady", "findBulk", "findModuleId", "init_webpack", "__esmMin", "init_react", "init_lazy", "init_Logger", "init_Tracer", "Logger", "m", "p", "s", "c", "traceFunction", "isIndirect", "isWaitFor", "found", "filterFns", "length", "j", "member", "newName", "ModalImageClasses", "ButtonWrapperClasses", "init_classes", "__esmMin", "init_react", "init_webpack", "findLazy", "m", "findByPropsLazy", "waitForComponent", "name", "filter", "myValue", "lazyComponent", "LazyComponent", "waitFor", "v", "waitForStore", "cb", "filters", "init_internal", "__esmMin", "init_react", "init_webpack", "Forms", "Card", "Button", "Switch", "Tooltip", "TextInput", "TextArea", "Text", "Select", "SearchableSelect", "Slider", "ButtonLooks", "Popout", "Dialog", "TabBar", "Paginator", "ScrollerThin", "Clickable", "Avatar", "useToken", "MaskedLink", "Timestamp", "Flex", "init_components", "__esmMin", "init_react", "init_webpack", "init_internal", "waitForComponent", "m", "filters", "waitFor", "Menu", "ContextMenu", "init_menu", "__esmMin", "init_react", "init_webpack", "waitFor", "m", "mapMangledModuleLazy", "filters", "React", "useState", "useEffect", "useMemo", "useRef", "useReducer", "useCallback", "ReactDOM", "init_react", "__esmMin", "init_webpack", "findByPropsLazy", "waitFor", "m", "TextAndImagesSettingsStores", "StatusSettingsStores", "UserSettingsActionCreators", "init_settingsStores", "__esmMin", "init_react", "init_webpack", "findByPropsLazy", "Flux", "DraftType", "MessageStore", "PrivateChannelsStore", "PermissionStore", "GuildChannelStore", "ReadStateStore", "PresenceStore", "PoggerModeSettingsStore", "GuildStore", "UserStore", "UserProfileStore", "SelectedChannelStore", "SelectedGuildStore", "ChannelStore", "GuildMemberStore", "RelationshipStore", "EmojiStore", "WindowStore", "DraftStore", "MaskedLinkStore", "useStateFromStores", "init_stores", "__esmMin", "init_react", "init_lazy", "init_webpack", "init_internal", "findByPropsLazy", "mapMangledModuleLazy", "filters", "proxyLazy", "findByProps", "waitForStore", "s", "m", "components_d_exports", "init_components_d", "__esmMin", "init_react", "menu_d_exports", "init_menu_d", "__esmMin", "init_react", "utils_d_exports", "init_utils_d", "__esmMin", "init_react", "showToast", "message", "type", "ToastType", "Toasts", "FluxDispatcher", "ComponentDispatch", "RestAPI", "moment", "hljs", "lodash", "i18n", "SnowflakeUtils", "Parser", "Alerts", "ToastPosition", "UserUtils", "UploadHandler", "ApplicationAssetUtils", "Clipboard", "NavigationRouter", "SettingsRouter", "PermissionsBits", "init_utils", "__esmMin", "init_react", "init_lazy", "init_webpack", "waitFor", "m", "findByPropsLazy", "findLazy", "mapMangledModuleLazy", "filters", "x", "cb", "_resolveReady", "proxyLazy", "find", "common_exports", "__export", "Alerts", "ApplicationAssetUtils", "Avatar", "Button", "ButtonLooks", "ButtonWrapperClasses", "Card", "ChannelStore", "Clickable", "Clipboard", "ComponentDispatch", "components_d_exports", "ContextMenu", "Dialog", "DraftStore", "DraftType", "EmojiStore", "Flex", "Flux", "FluxDispatcher", "Forms", "GuildChannelStore", "GuildMemberStore", "GuildStore", "MaskedLink", "MaskedLinkStore", "Menu", "menu_d_exports", "MessageStore", "ModalImageClasses", "NavigationRouter", "Paginator", "Parser", "PermissionStore", "PermissionsBits", "PoggerModeSettingsStore", "Popout", "PresenceStore", "PrivateChannelsStore", "React", "ReactDOM", "ReadStateStore", "RelationshipStore", "RestAPI", "ScrollerThin", "SearchableSelect", "Select", "SelectedChannelStore", "SelectedGuildStore", "SettingsRouter", "Slider", "SnowflakeUtils", "StatusSettingsStores", "Switch", "TabBar", "Text", "TextAndImagesSettingsStores", "TextArea", "TextInput", "Timestamp", "Toasts", "Tooltip", "UploadHandler", "UserProfileStore", "UserSettingsActionCreators", "UserStore", "UserUtils", "utils_d_exports", "WindowStore", "hljs", "i18n", "lodash", "moment", "showToast", "useCallback", "useEffect", "useMemo", "useReducer", "useRef", "useState", "useStateFromStores", "useToken", "init_common", "__esmMin", "init_react", "init_classes", "init_components", "init_menu", "init_settingsStores", "init_stores", "init_components_d", "init_menu_d", "init_utils_d", "init_utils", "git_hash_default", "init_git_hash", "__esmMin", "init_react", "git_remote_default", "init_git_remote", "__esmMin", "init_react", "WEBPACK_CHUNK", "REACT_GLOBAL", "VENCORD_USER_AGENT", "SUPPORT_CHANNEL_ID", "Devs", "DevsById", "init_constants", "__esmMin", "init_react", "init_git_hash", "init_git_remote", "git_hash_default", "git_remote_default", "d", "_", "v", "mergeDefaults", "obj", "defaults", "key", "v", "classes", "sleep", "ms", "r", "copyWithToast", "text", "toastMessage", "Clipboard", "Toasts", "isObject", "isObjectEmpty", "k", "parseUrl", "urlString", "identity", "value", "checkIntersecting", "isMobile", "isPluginDev", "init_misc", "__esmMin", "init_react", "init_common", "init_constants", "el", "elementBox", "documentHeight", "id", "DevsById", "useAwaiter", "factory", "providedOpts", "opts", "state", "setState", "useState", "useEffect", "isAlive", "value", "error", "useForceUpdater", "withDep", "r", "useReducer", "x", "LazyComponent", "attempts", "get", "makeLazy", "props", "Component", "NoopComponent", "VencordCreateElement", "useTimer", "interval", "deps", "time", "setTime", "start", "useMemo", "intervalId", "useIntersection", "init_react", "__esmMin", "init_common", "init_lazy", "init_misc", "intersectOnly", "observerRef", "React", "isIntersecting", "setIntersecting", "element", "checkIntersecting", "entries", "entry", "ErrorCard", "props", "VencordCreateElement", "classes", "init_ErrorCard", "__esmMin", "init_react", "init_", "init_misc", "color", "logger", "NO_ERROR", "ErrorBoundary", "ErrorBoundary_default", "init_ErrorBoundary", "__esmMin", "init_react", "init_Logger", "init_margins", "init_common", "init_ErrorCard", "Logger", "LazyComponent", "React", "error", "stack", "message", "eolIdx", "errorInfo", "VencordCreateElement", "msg", "ErrorCard", "Margins", "Component", "errorBoundaryProps", "props", "Heart", "VencordCreateElement", "init_Heart", "__esmMin", "init_react", "DonateButton", "props", "VencordCreateElement", "Button", "Heart", "init_DonateButton", "__esmMin", "init_react", "init_common", "init_Heart", "Flex", "props", "VencordCreateElement", "init_Flex", "__esmMin", "init_react", "openModalLazy", "render", "options", "ModalAPI", "openModal", "contextKey", "closeModal", "modalKey", "closeAllModals", "ModalSize", "Modals", "ImageModal", "ModalRoot", "ModalHeader", "ModalContent", "ModalFooter", "ModalCloseButton", "init_modal", "__esmMin", "init_react", "init_webpack", "mapMangledModuleLazy", "filters", "LazyComponent", "findByProps", "findByPropsLazy", "definePlugin", "p", "init_types", "__esmMin", "init_react", "loadBadges", "noCache", "DonorBadges", "init", "lines", "r", "Logger", "line", "id", "description", "image", "CONTRIBUTOR_BADGE", "ContributorBadge", "badges_default", "init_badges", "__esmMin", "init_react", "init_Badges", "init_DonateButton", "init_ErrorBoundary", "init_Flex", "init_Heart", "init_constants", "init_Logger", "init_margins", "init_misc", "init_modal", "init_types", "init_common", "user", "isPluginDev", "definePlugin", "Devs", "Toasts", "ErrorBoundary_default", "badge", "Component", "VencordCreateElement", "userId", "modalKey", "openModal", "props", "closeModal", "Modals", "Flex", "Forms", "Heart", "Margins", "DonateButton", "commands_default", "init_commands", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "_", "cmd", "args", "ctx", "contextMenu_default", "init_contextMenu", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "memberListDecorators_default", "init_memberListDecorators", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "messageAccessories_default", "init_messageAccessories", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "messageDecorations_default", "init_messageDecorations", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "messageEvents_default", "init_messageEvents", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "_", "rest1", "rest2", "parsedMessage", "channel", "replyOptions", "extra", "m", "message", "event", "messagePopover_default", "init_messagePopover", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "m", "makeElement", "msg", "notices_default", "init_notices", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "serverList_default", "init_serverList", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "noTrack_default", "init_noTrack", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "ContextMenu_exports", "__export", "_patchContextMenu", "addContextMenuPatch", "addGlobalContextMenuPatch", "findGroupChildrenByChildId", "globalPatches", "navPatches", "removeContextMenuPatch", "removeGlobalContextMenuPatch", "navId", "patch", "id", "contextMenuPatches", "results", "children", "_itemsArray", "child", "nextChildren", "found", "props", "callback", "patchedMenus", "err", "ContextMenuLogger", "init_ContextMenu", "__esmMin", "init_react", "init_Logger", "Logger", "debounce", "func", "delay", "timeout", "args", "init_debounce", "__esmMin", "init_react", "localStorage", "init_localStorage", "__esmMin", "init_react", "Queue", "init_Queue", "__esmMin", "init_react", "maxSize", "func", "NotificationComponent_default", "init_NotificationComponent", "__esmMin", "init_react", "init_", "init_Settings", "init_ErrorBoundary", "init_misc", "init_common", "ErrorBoundary_default", "title", "body", "richBody", "color", "icon", "onClick", "onClose", "image", "permanent", "className", "dismissOnClick", "timeout", "position", "useSettings", "hasFocus", "useStateFromStores", "WindowStore", "isHover", "setIsHover", "useState", "elapsed", "setElapsed", "start", "useMemo", "useEffect", "intervalId", "timeoutProgress", "VencordCreateElement", "classes", "e", "props", "DataStore_exports", "__export", "clear", "createStore", "del", "delMany", "entries", "get", "getMany", "keys", "promisifyRequest", "set", "setMany", "update", "values", "request", "resolve", "reject", "dbName", "storeName", "dbp", "txMode", "callback", "db", "defaultGetStore", "defaultGetStoreFunc", "key", "customStore", "store", "value", "entry", "updater", "err", "eachCursor", "items", "cursor", "i", "init_DataStore", "__esmMin", "init_react", "Styles_exports", "__export", "classNameFactory", "classNameToSelector", "compileStyle", "disableStyle", "enableStyle", "isStyleEnabled", "requireStyle", "setStyleClassNames", "styleMap", "toggleStyle", "name", "style", "init_Styles", "__esmMin", "init_react", "classNames", "recompile", "match", "className", "prefix", "args", "arg", "value", "nanoid", "init_index_browser", "__esmMin", "init_react", "size", "id", "byte", "persistNotification", "notification", "limit", "Settings", "update", "KEY", "old", "log", "onClick", "onClose", "richBody", "permanent", "noPersist", "dismissOnClick", "pureNotification", "nanoid", "signals", "x", "deleteNotification", "timestamp", "getLog", "index", "set", "useLogs", "signal", "setSignal", "useReducer", "useEffect", "_", "pending", "useAwaiter", "NotificationEntry", "data", "removing", "setRemoving", "useState", "ref", "React", "div", "setHeight", "VencordCreateElement", "cl", "NotificationComponent_default", "Timestamp", "moment", "NotificationLog", "Forms", "LogModal", "modalProps", "close", "ModalRoot", "ModalHeader", "Text", "ModalCloseButton", "ModalContent", "ModalFooter", "Button", "Alerts", "openNotificationLogModal", "key", "openModal", "closeModal", "init_notificationLog", "__esmMin", "init_react", "init_DataStore", "init_Settings", "init_Styles", "init_modal", "init_common", "init_index_browser", "init_NotificationComponent", "get", "classNameFactory", "getRoot", "reactRoot", "container", "ReactDOM", "_showNotification", "notification", "id", "root", "resolve", "VencordCreateElement", "NotificationComponent_default", "shouldBeNative", "useNative", "Settings", "requestPermission", "showNotification", "data", "persistNotification", "title", "body", "icon", "image", "onClick", "onClose", "n", "NotificationQueue", "init_Notifications", "__esmMin", "init_react", "init_Settings", "init_Queue", "init_common", "init_NotificationComponent", "init_notificationLog", "Queue", "Notifications_exports", "__export", "requestPermission", "showNotification", "init_Notifications", "__esmMin", "init_react", "deflateSync", "data", "opts", "dopt", "inflateSync", "out", "inflt", "u8", "u16", "u32", "fleb", "fdeb", "clim", "freb", "_a", "fl", "revfl", "_b", "fd", "revfd", "rev", "x", "i", "hMap", "flt", "fdt", "flm", "flrm", "fdm", "fdrm", "max", "bits", "bits16", "shft", "slc", "ec", "err", "wbits", "wbits16", "hTree", "ln", "lc", "clen", "wfblk", "wblk", "deo", "et", "dflt", "td", "tds", "init_browser", "__esmMin", "init_react", "eb", "start", "b", "r", "j", "cd", "mb", "s", "l", "le", "co", "rvb", "sv", "r_1", "v", "m", "a", "d", "p", "o", "e", "n", "ind", "msg", "nt", "dat", "buf", "st", "sl", "noBuf", "noSt", "cbuf", "bl", "nbuf", "final", "pos", "bt", "lm", "dm", "lbt", "dbt", "tbts", "type", "hLit", "hcLen", "tl", "ldt", "clt", "clb", "clbmsk", "clm", "c", "lt", "dt", "t", "lms", "dms", "lpos", "sym", "add", "dsym", "end", "t2", "i0", "i1", "i2", "maxSym", "tr", "mbt", "lft", "cst", "i2_1", "i2_2", "i2_3", "cl", "cli", "cln", "cls", "w", "cf", "syms", "lf", "df", "li", "bs", "dlt", "mlb", "ddt", "mdb", "_c", "lclt", "nlc", "_d", "lcdt", "ndc", "lcfreq", "_e", "lct", "mlcb", "nlcc", "flen", "ftlen", "dtlen", "ll", "dl", "llm", "lcts", "it", "clct", "len", "dst", "lvl", "plvl", "pre", "post", "lst", "opt", "msk_1", "prev", "head", "bs1_1", "bs2_1", "hsh", "lc_1", "wi", "hv", "imod", "pimod", "rem", "ch_1", "dif", "maxn", "maxd", "ml", "nl", "mmd", "md", "ti", "pti", "lin", "din", "getAuthorization", "secrets", "get", "origin", "cloudUrlOrigin", "update", "getUserId", "setAuthorization", "secret", "deauthorizeCloud", "authorizeCloud", "Settings", "oauthConfiguration", "getCloudUrl", "clientId", "redirectUri", "showNotification", "OAuth2AuthorizeModal", "findByProps", "openModal", "props", "VencordCreateElement", "location", "res", "cloudLogger", "e", "getCloudAuth", "init_cloud", "__esmMin", "init_react", "init_DataStore", "init_Notifications", "init_Settings", "init_webpack", "init_common", "init_Logger", "init_modal", "Logger", "id", "UserStore", "relaunch", "showItemInFolder", "path", "init_native", "__esmMin", "init_react", "saveFile", "file", "a", "chooseFile", "mimeTypes", "resolve", "input", "init_web", "__esmMin", "init_react", "importSettings", "data", "parsed", "err", "PlainSettings", "exportSettings", "minify", "settings", "quickCss", "downloadSettingsBackup", "filename", "backup", "saveFile", "uploadSettingsBackup", "showToast", "file", "chooseFile", "reader", "toastSuccess", "Logger", "toastFailure", "putCloudSettings", "manual", "res", "getCloudUrl", "getCloudAuth", "deflateSync", "cloudSettingsLogger", "showNotification", "written", "e", "getCloudSettings", "shouldNotify", "force", "Settings", "localWritten", "inflateSync", "relaunch", "deleteCloudSettings", "toast", "init_settingsSync", "__esmMin", "init_react", "init_Notifications", "init_Settings", "init_common", "init_browser", "init_cloud", "init_Logger", "init_native", "init_web", "type", "message", "Toasts", "Settings_exports", "__export", "PlainSettings", "Settings", "addSettingsListener", "definePluginSettings", "migratePluginSettings", "useSettings", "makeProxy", "settings", "root", "path", "proxyCache", "target", "p", "v", "plugins_default", "plugin", "setting", "def", "o", "setPath", "subscription", "subscriptions", "localStorage", "saveSettingsOnFrequentAction", "paths", "forceUpdate", "React", "onUpdate", "value", "name", "oldNames", "plugins", "oldName", "logger", "checks", "definedSettings", "DefaultSettings", "init_Settings", "__esmMin", "init_react", "init_debounce", "init_localStorage", "init_Logger", "init_misc", "init_settingsSync", "init_types", "init_common", "init_plugins", "Logger", "mergeDefaults", "err", "debounce", "putCloudSettings", "updater_exports", "__export", "UpdateLogger", "changes", "checkForUpdates", "getRepo", "isNewer", "isOutdated", "maybePromptToUpdate", "update", "updateError", "Unwrap", "p", "res", "c", "git_hash_default", "confirmMessage", "checkForDev", "wantsUpdate", "relaunch", "err", "init_updater", "__esmMin", "init_react", "init_git_hash", "init_Logger", "init_native", "Logger", "handleComponentFailed", "maybePromptToUpdate", "init_handleComponentFailed", "__esmMin", "init_react", "init_updater", "onlyOnce", "f", "called", "result", "init_onlyOnce", "__esmMin", "init_react", "SettingsTab", "title", "children", "VencordCreateElement", "Forms", "Text", "Margins", "wrapTab", "component", "tab", "ErrorBoundary_default", "onError", "init_shared", "__esmMin", "init_react", "init_", "init_ErrorBoundary", "init_handleComponentFailed", "init_margins", "init_onlyOnce", "init_common", "onlyOnce", "handleComponentFailed", "VencordTab_exports", "__export", "VencordTab_default", "VencordSettings", "settingsDir", "settingsDirPending", "useAwaiter", "settings", "useSettings", "donateImage", "React", "DEFAULT_DONATE_IMAGE", "SHIGGY_DONATE_IMAGE", "isWindows", "isMac", "Switches", "VencordCreateElement", "SettingsTab", "DonateCard", "Forms", "Card", "cl", "Button", "relaunch", "showItemInFolder", "Margins", "s", "Switch", "v", "NotificationSection", "VencordFragment", "ErrorCard", "Select", "identity", "Slider", "openNotificationLogModal", "image", "DonateButton", "init_VencordTab", "__esmMin", "init_react", "init_notificationLog", "init_Settings", "init_Styles", "init_DonateButton", "init_ErrorCard", "init_margins", "init_misc", "init_native", "init_common", "init_shared", "classNameFactory", "wrapTab", "Notices_exports", "__export", "currentNotice", "nextNotice", "noticesQueue", "popNotice", "showNotice", "NoticesModule", "message", "buttonText", "onOkClick", "init_Notices", "__esmMin", "init_react", "init_webpack", "waitFor", "m", "Icon", "height", "width", "className", "children", "viewBox", "svgProps", "VencordCreateElement", "classes", "LinkIcon", "CopyIcon", "props", "OpenExternalIcon", "ImageIcon", "InfoIcon", "OwnerCrownIcon", "i18n", "ScreenshareIcon", "ImageVisible", "ImageInvisible", "Microphone", "CogWheel", "ReplyIcon", "DeleteIcon", "init_Icons", "__esmMin", "init_react", "init_", "init_misc", "init_common", "getUnitStr", "unit", "isOne", "short", "formatDuration", "time", "dur", "moment", "unitsAmounts", "units", "amountsToBeRemoved", "outer", "i", "v", "daysAmountIndex", "daysAmount", "daysMod", "res", "amount", "humanFriendlyJoin", "elements", "mapper", "s", "length", "makeCodeblock", "text", "language", "chars", "wordsFromCamel", "wordsFromSnake", "wordsFromKebab", "wordsFromPascal", "wordsFromTitle", "wordsToCamel", "wordsToSnake", "wordsToKebab", "wordsToPascal", "wordsToTitle", "init_text", "__esmMin", "init_react", "init_common", "w", "words", "generateId", "SnowflakeUtils", "sendBotMessage", "channelId", "message", "botMessage", "MessageCreator", "MessageSender", "mergeDefaults", "findOption", "args", "name", "fallbackValue", "a", "init_commandHelpers", "__esmMin", "init_react", "init_misc", "init_webpack", "init_common", "findByPropsLazy", "ApplicationCommandOptionType", "ApplicationCommandInputType", "ApplicationCommandType", "init_types", "__esmMin", "init_react", "Commands_exports", "__export", "ApplicationCommandInputType", "ApplicationCommandOptionType", "ApplicationCommandType", "BUILT_IN", "OptionalMessageOption", "RequiredMessageOption", "_handleCommand", "_init", "commands", "findOption", "generateId", "prepareOption", "registerCommand", "sendBotMessage", "unregisterCommand", "opt", "i", "opts", "OptPlaceholder", "ReqPlaceholder", "x", "registerSubCommands", "cmd", "plugin", "o", "subCmd", "command", "c", "name", "idx", "init_Commands", "__esmMin", "init_react", "init_text", "init_commandHelpers", "init_types", "cmds", "args", "ctx", "handleError", "err", "msg", "reason", "makeCodeblock", "res", "Badge", "text", "color", "VencordCreateElement", "init_Badge", "__esmMin", "init_react", "SettingBooleanComponent", "option", "pluginSettings", "definedSettings", "id", "onChange", "onError", "def", "state", "setState", "React", "error", "setError", "handleChange", "newValue", "isValid", "VencordCreateElement", "Forms", "Switch", "wordsToTitle", "wordsFromCamel", "init_SettingBooleanComponent", "__esmMin", "init_react", "init_text", "init_common", "SettingCustomComponent", "option", "onChange", "onError", "init_SettingCustomComponent", "__esmMin", "init_react", "SettingNumericComponent", "option", "pluginSettings", "definedSettings", "id", "onChange", "onError", "serialize", "value", "state", "setState", "React", "error", "setError", "handleChange", "newValue", "isValid", "MAX_SAFE_NUMBER", "VencordCreateElement", "Forms", "TextInput", "init_SettingNumericComponent", "__esmMin", "init_react", "init_types", "init_common", "SettingSelectComponent", "option", "pluginSettings", "definedSettings", "onChange", "onError", "id", "def", "o", "state", "setState", "React", "error", "setError", "handleChange", "newValue", "isValid", "VencordCreateElement", "Forms", "Select", "init_SettingSelectComponent", "__esmMin", "init_react", "init_common", "makeRange", "start", "end", "step", "ranges", "value", "SettingSliderComponent", "option", "pluginSettings", "definedSettings", "id", "onChange", "onError", "def", "error", "setError", "React", "handleChange", "newValue", "isValid", "VencordCreateElement", "Forms", "Slider", "v", "init_SettingSliderComponent", "__esmMin", "init_react", "init_common", "SettingTextComponent", "option", "pluginSettings", "definedSettings", "id", "onChange", "onError", "state", "setState", "React", "error", "setError", "handleChange", "newValue", "isValid", "VencordCreateElement", "Forms", "TextInput", "init_SettingTextComponent", "__esmMin", "init_react", "init_common", "init_components", "__esmMin", "init_react", "init_Badge", "init_SettingBooleanComponent", "init_SettingCustomComponent", "init_SettingNumericComponent", "init_SettingSelectComponent", "init_SettingSliderComponent", "init_SettingTextComponent", "getCurrentChannel", "ChannelStore", "SelectedChannelStore", "getCurrentGuild", "GuildStore", "openPrivateChannel", "userId", "PrivateChannelsStore", "getTheme", "UserSettingsActionCreators", "insertTextIntoChatInputBox", "text", "ComponentDispatch", "sendMessage", "channelId", "data", "waitForChannelReady", "extra", "messageData", "MessageActions", "openImageModal", "url", "props", "openModal", "modalProps", "VencordCreateElement", "ModalRoot", "ModalImageClasses", "ImageModal", "MaskedLink", "openUserProfile", "id", "UserUtils", "guildId", "SelectedGuildStore", "UserProfileActions", "fetchUserProfile", "options", "cached", "UserProfileStore", "FluxDispatcher", "body", "RestAPI", "getUniqueUsername", "user", "Theme", "init_discord", "__esmMin", "init_react", "init_webpack", "init_common", "init_modal", "findByPropsLazy", "openContributorModal", "user", "openModal", "modalProps", "VencordCreateElement", "ModalRoot", "ErrorBoundary_default", "ModalContent", "cl", "ContributorModal", "GithubIcon", "src", "getTheme", "GithubIconLight", "GithubIconDark", "WebsiteIcon", "WebsiteIconLight", "WebsiteIconDark", "useSettings", "profile", "useStateFromStores", "UserProfileStore", "useEffect", "fetchUserProfile", "githubName", "a", "website", "plugins", "useMemo", "allPlugins", "plugins_default", "DevsById", "p", "b", "VencordFragment", "Forms", "MaskedLink", "PluginCard", "showToast", "init_ContributorModal", "__esmMin", "init_react", "init_", "init_Settings", "init_Styles", "init_ErrorBoundary", "init_constants", "init_discord", "init_modal", "init_common", "init_plugins", "init_PluginSettings", "classNameFactory", "makeDummyUser", "user", "newUser", "UserRecord", "generateId", "FluxDispatcher", "PluginModal", "plugin", "onRestartNeeded", "onClose", "transitionState", "authors", "setAuthors", "React", "pluginSettings", "useSettings", "tempSettings", "setTempSettings", "errors", "setErrors", "saveError", "setSaveError", "canSubmit", "e", "hasSettings", "isObjectEmpty", "author", "UserUtils", "a", "saveAndClose", "result", "restartNeeded", "key", "value", "option", "renderSettings", "VencordCreateElement", "Forms", "options", "setting", "onChange", "newValue", "s", "onError", "hasError", "Component", "Components", "Flex", "renderMoreUsers", "_label", "count", "sliceCount", "sliceStart", "sliceEnd", "Tooltip", "u", "onMouseEnter", "onMouseLeave", "AvatarStyles", "ModalRoot", "ModalHeader", "Text", "ModalCloseButton", "ModalContent", "UserSummaryItem", "Clickable", "openContributorModal", "classes", "Margins", "ErrorBoundary_default", "ModalFooter", "Button", "init_PluginModal", "__esmMin", "init_react", "init_Commands", "init_Settings", "init_ErrorBoundary", "init_Flex", "init_lazy", "init_margins", "init_misc", "init_modal", "init_types", "init_webpack", "init_common", "init_components", "init_ContributorModal", "LazyComponent", "findByCode", "findByPropsLazy", "proxyLazy", "UserStore", "SettingTextComponent", "SettingNumericComponent", "SettingBooleanComponent", "SettingSelectComponent", "SettingSliderComponent", "SettingCustomComponent", "Switch", "checked", "onChange", "disabled", "VencordCreateElement", "classes", "SwitchClasses", "SWITCH_ON", "SWITCH_OFF", "VencordFragment", "e", "init_Switch", "__esmMin", "init_react", "init_", "init_misc", "init_webpack", "findByPropsLazy", "AddonCard", "disabled", "isNew", "name", "infoButton", "footer", "author", "enabled", "setEnabled", "description", "onMouseEnter", "onMouseLeave", "VencordCreateElement", "cl", "Text", "Badge", "Switch", "init_AddonCard", "__esmMin", "init_react", "init_", "init_Styles", "init_Badge", "init_Switch", "init_common", "classNameFactory", "ChangeList", "init_ChangeList", "__esmMin", "init_react", "item", "mapper", "plugins_exports", "__export", "PMLogger", "isPluginEnabled", "patches", "plugins", "startAllPlugins", "startDependenciesRecursive", "startPlugin", "stopPlugin", "p", "plugins_default", "settings", "restartNeeded", "failures", "dep", "Settings", "logger", "pluginsValues", "init_plugins", "__esmMin", "init_react", "init_Commands", "init_Settings", "init_Logger", "init_common", "init_Tracer", "Logger", "d", "error", "name", "def", "checks", "patch", "traceFunction", "commands", "flux", "e", "cmd", "registerCommand", "event", "FluxDispatcher", "unregisterCommand", "showErrorToast", "message", "Toasts", "ReloadRequiredCard", "required", "VencordCreateElement", "Card", "cl", "VencordFragment", "Forms", "Button", "PluginCard", "plugin", "disabled", "onRestartNeeded", "onMouseEnter", "onMouseLeave", "isNew", "settings", "Settings", "isEnabled", "openModal", "openModalLazy", "modalProps", "PluginModal", "toggleEnabled", "wasEnabled", "restartNeeded", "failures", "startDependenciesRecursive", "logger", "showNotice", "stopPlugin", "startPlugin", "msg", "AddonCard", "classes", "ButtonClasses", "isObjectEmpty", "CogWheel", "InfoIcon", "PluginSettings", "useSettings", "changes", "React", "ChangeList", "Alerts", "s", "i", "Parser", "depMap", "o", "plugins_default", "deps", "dep", "sortedPlugins", "a", "b", "searchValue", "setSearchValue", "onSearch", "query", "prev", "onStatusChange", "status", "pluginFilter", "enabled", "newPlugins", "v", "t", "useAwaiter", "get", "cachedPlugins", "now", "existingTimestamps", "sortedPluginNames", "p", "set", "lodash", "plugins", "requiredPlugins", "d", "tooltipText", "makeDependencyList", "Tooltip", "name", "Text", "SettingsTab", "Margins", "TextInput", "InputStyles", "Select", "init_PluginSettings", "__esmMin", "init_react", "init_", "init_DataStore", "init_Notices", "init_Settings", "init_Styles", "init_Icons", "init_PluginModal", "init_AddonCard", "init_shared", "init_ChangeList", "init_Logger", "init_margins", "init_misc", "init_modal", "init_webpack", "init_common", "init_plugins", "classNameFactory", "Logger", "findByPropsLazy", "PluginsTab_exports", "__export", "PluginsTab_default", "init_PluginsTab", "__esmMin", "init_react", "init_PluginSettings", "init_shared", "wrapTab", "PluginSettings", "Link", "props", "VencordCreateElement", "init_Link", "__esmMin", "init_react", "ThemesTab_exports", "__export", "ThemesTab_default", "Validator", "link", "res", "err", "pending", "useAwaiter", "contentType", "text", "VencordCreateElement", "Forms", "Validators", "themeLinks", "VencordFragment", "Margins", "Card", "ThemeCard", "theme", "enabled", "onChange", "onDelete", "AddonCard", "Flex", "Link", "e", "invite", "InviteActions", "showToast", "FluxDispatcher", "ThemesTab", "settings", "useSettings", "fileInputRef", "useRef", "currentTab", "setCurrentTab", "useState", "themeText", "setThemeText", "userThemes", "setUserThemes", "themeDir", "themeDirPending", "useEffect", "refreshLocalThemes", "themes", "onLocalThemeChange", "fileName", "value", "f", "onFileUpload", "files", "uploads", "file", "name", "resolve", "reject", "reader", "renderLocalThemes", "Button", "showItemInFolder", "cl", "onBlur", "s", "renderOnlineThemes", "TextArea", "classes", "TextAreaProps", "SettingsTab", "TabBar", "FileInput", "init_ThemesTab", "__esmMin", "init_react", "init_Settings", "init_Styles", "init_Flex", "init_Icons", "init_Link", "init_margins", "init_misc", "init_native", "init_webpack", "init_common", "init_AddonCard", "init_shared", "findByPropsLazy", "findLazy", "m", "classNameFactory", "wrapTab", "UpdaterTab_exports", "__export", "UpdaterTab_default", "withDispatcher", "dispatcher", "action", "e", "UpdateLogger", "code", "path", "cmd", "stderr", "err", "Alerts", "VencordCreateElement", "ErrorCard", "line", "Parser", "HashLink", "repo", "hash", "disabled", "Link", "Changes", "updates", "repoPending", "Card", "author", "message", "Updatable", "props", "setUpdates", "React", "changes", "isChecking", "setIsChecking", "isUpdating", "setIsUpdating", "isOutdated", "VencordFragment", "updateError", "Forms", "Margins", "Flex", "classes", "Button", "update", "r", "relaunch", "checkForUpdates", "Toasts", "Newer", "Updater", "settings", "useSettings", "useAwaiter", "getRepo", "commonProps", "SettingsTab", "Switch", "v", "git_hash_default", "isNewer", "init_UpdaterTab", "__esmMin", "init_react", "init_Settings", "init_ErrorCard", "init_Flex", "init_Link", "init_margins", "init_misc", "init_native", "init_updater", "init_common", "init_git_hash", "init_shared", "wrapTab", "CheckedTextInput", "initialValue", "onChange", "validate", "value", "setValue", "React", "error", "setError", "handleChange", "v", "res", "VencordCreateElement", "VencordFragment", "TextInput", "init_CheckedTextInput", "__esmMin", "init_react", "init_common", "CloudTab_exports", "__export", "CloudTab_default", "validateUrl", "url", "eraseAllData", "res", "getCloudUrl", "getCloudAuth", "cloudLogger", "showNotification", "Settings", "deauthorizeCloud", "SettingsSyncSection", "cloud", "useSettings", "sectionEnabled", "VencordCreateElement", "Forms", "Margins", "Switch", "v", "Button", "putCloudSettings", "Tooltip", "onMouseLeave", "onMouseEnter", "getCloudSettings", "deleteCloudSettings", "CloudTab", "settings", "SettingsTab", "Link", "authorizeCloud", "CheckedTextInput", "Alerts", "init_CloudTab", "__esmMin", "init_react", "init_Notifications", "init_Settings", "init_CheckedTextInput", "init_Link", "init_cloud", "init_margins", "init_settingsSync", "init_common", "init_shared", "wrapTab", "BackupAndRestoreTab_exports", "__export", "BackupAndRestoreTab_default", "BackupRestoreTab", "VencordCreateElement", "SettingsTab", "Card", "classes", "Flex", "Text", "Margins", "Button", "uploadSettingsBackup", "downloadSettingsBackup", "init_BackupAndRestoreTab", "__esmMin", "init_react", "init_Flex", "init_margins", "init_misc", "init_settingsSync", "init_common", "init_shared", "wrapTab", "settings_default", "init_settings", "__esmMin", "init_react", "init_ContextMenu", "init_Settings", "init_constants", "init_types", "init_common", "init_git_hash", "definePlugin", "Devs", "addContextMenuPatch", "children", "c", "it", "id", "SettingsRouter", "m", "component", "props", "Settings", "SectionTypes", "func", "b", "Component", "electronVersion", "chromiumVersion", "additionalInfo", "VencordCreateElement", "VencordFragment", "git_hash_default", "REMEMBER_DISMISS_KEY", "AllowedChannelIds", "supportHelper_default", "init_supportHelper", "__esmMin", "init_react", "init_api", "init_constants", "init_misc", "init_text", "init_types", "init_updater", "init_common", "init_git_hash", "init_plugins", "init_settings", "SUPPORT_CHANNEL_ID", "definePlugin", "Devs", "ctx", "RELEASE_CHANNEL", "client", "isApiPlugin", "plugin", "plugins_default", "enabledPlugins", "p", "enabledApiPlugins", "info", "git_hash_default", "settings_default", "isOutdated", "k", "v", "makeCodeblock", "channelId", "isPluginDev", "UserStore", "DataStore", "rememberDismiss", "Alerts", "VencordCreateElement", "Forms", "alwaysAnimate_default", "init_alwaysAnimate", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "m", "rest", "alwaysTrust_default", "init_alwaysTrust", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "tarExtMatcher", "anonymiseFileNames_default", "init_anonymiseFileNames", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "definePlugin", "Devs", "Settings", "file", "name", "extIdx", "ext", "chars", "lookupAsset", "applicationId", "key", "ApplicationAssetUtils", "lookupApp", "socket", "RpcUtils", "apps", "ws", "arRPC_default", "init_arRPC", "__esmMin", "init_react", "init_Notices", "init_Link", "init_constants", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePlugin", "Devs", "VencordCreateElement", "VencordFragment", "Forms", "Link", "data", "activity", "assets", "appId", "app", "FluxDispatcher", "res", "showNotice", "popNotice", "Toasts", "banger_default", "init_banger", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "ChannelRTCStore", "Animations", "GuildsBar", "FolderSideBar_default", "init_FolderSideBar", "__esmMin", "init_react", "init_ErrorBoundary", "init_webpack", "init_common", "init_betterFolders", "findStoreLazy", "findByPropsLazy", "LazyComponent", "find", "m", "ErrorBoundary_default", "guildsBarProps", "expandedFolders", "useStateFromStores", "ExpandedGuildFolderStore", "isFullscreen", "Sidebar", "VencordCreateElement", "visible", "guilds", "barStyle", "settings", "animationStyle", "show", "getGuildFolder", "id", "SortedGuildStore", "folder", "closeFolders", "ExpandedGuildFolderStore", "FolderUtils", "GuildsTree", "lastGuildId", "dispatchingFoldersClose", "settings", "betterFolders_default", "init_betterFolders", "__esmMin", "init_react", "init_Settings", "init_constants", "init_lazy", "init_types", "init_webpack", "init_common", "init_FolderSideBar", "proxyLazy", "findByProps", "findStoreLazy", "findByPropsLazy", "definePluginSettings", "definePlugin", "Devs", "_", "rest", "guildsTree", "isExpandedOrExpandedIds", "folderNote", "isExpanded", "m", "data", "guildFolder", "FluxDispatcher", "expandedFolders", "isBetterFolders", "oldTree", "expandedFolderIds", "newTree", "guildOrFolder", "child", "i18n", "guildsBarProps", "VencordCreateElement", "FolderSideBar_default", "betterGifAltText_default", "init_betterGifAltText", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "props", "url", "name", "UserPopoutSectionCssClasses", "betterNotes_default", "init_betterNotes", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_webpack", "findByPropsLazy", "definePlugin", "Devs", "m", "rest", "Settings", "VencordCreateElement", "betterRoleDot_default", "init_betterRoleDot", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_common", "definePlugin", "Devs", "Settings", "color", "Clipboard", "Toasts", "betterUploadButton_default", "init_betterUploadButton", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "ApplicationStreamPreviewStore", "ApplicationStreamingStore", "init_stores", "__esmMin", "init_react", "init_webpack", "findStoreLazy", "handleViewPreview", "addViewStreamContext", "streamContextPatch", "userContextPatch", "biggerStreamPreview_default", "init_biggerStreamPreview", "__esmMin", "init_react", "init_ContextMenu", "init_Icons", "init_constants", "init_discord", "init_types", "init_common", "init_stores", "guildId", "channelId", "ownerId", "previewUrl", "ApplicationStreamPreviewStore", "openImageModal", "children", "userId", "stream", "ApplicationStreamingStore", "streamPreviewItem", "VencordCreateElement", "Menu", "ScreenshareIcon", "user", "definePlugin", "Devs", "addContextMenuPatch", "removeContextMenuPatch", "setCss", "style", "Settings", "blurNsfw_default", "init_blurNsfw", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "definePlugin", "Devs", "formatDuration", "ms", "human", "Settings", "format", "n", "unit", "s", "delim", "d", "h", "m", "res", "callTimer_default", "init_callTimer", "__esmMin", "init_react", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "definePlugin", "Devs", "channelId", "VencordCreateElement", "ErrorBoundary_default", "time", "useTimer", "MessageEvents_exports", "__export", "_handleClick", "_handlePreEdit", "_handlePreSend", "addClickListener", "addPreEditListener", "addPreSendListener", "removeClickListener", "removePreEditListener", "removePreSendListener", "channelId", "messageObj", "extra", "replyOptions", "listener", "sendListeners", "result", "e", "MessageEventsLogger", "messageId", "editListeners", "message", "channel", "event", "MessageStore", "listeners", "init_MessageEvents", "__esmMin", "init_react", "init_Logger", "init_common", "Logger", "defaultRules", "init_defaultRules", "__esmMin", "init_react", "reRegExpChar", "reHasRegExpChar", "clearURLs_default", "init_clearURLs", "__esmMin", "init_react", "init_MessageEvents", "init_constants", "init_types", "init_defaultRules", "definePlugin", "Devs", "str", "rules", "defaultRules", "rule", "splitRule", "paramRule", "hostRule", "hostRuleIndex", "param", "parent", "match", "url", "_value", "regex", "hostRuleName", "msg", "addPreSendListener", "_", "addPreEditListener", "_cid", "_mid", "removePreSendListener", "removePreEditListener", "colorSighted_default", "init_colorSighted", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "canonicalizeMatch", "match", "canonSource", "canonicalizeReplace", "replace", "pluginName", "self", "args", "canonicalizeDescriptor", "descriptor", "canonicalize", "original", "canonicalizeReplacement", "replacement", "plugin", "descriptors", "init_patches", "__esmMin", "init_react", "consoleShortcuts_default", "init_consoleShortcuts", "__esmMin", "init_react", "init_constants", "init_native", "init_patches", "init_types", "init_webpack", "init_common", "definePlugin", "Devs", "newFindWrapper", "filterFactory", "cache", "filterProps", "cacheKey", "matches", "findAll", "result", "uniqueMatches", "fakeRenderWin", "wreq", "search", "extract", "code", "f", "filters", "props", "React", "relaunch", "canonicalizeMatch", "canonicalizeReplace", "canonicalizeReplacement", "component", "prevWin", "win", "ReactDOM", "shortcuts", "key", "val", "UserContextMenuPatch", "copyUserURLs_default", "init_copyUserURLs", "__esmMin", "init_react", "init_ContextMenu", "init_Icons", "init_constants", "init_types", "init_common", "children", "user", "VencordCreateElement", "Menu", "Clipboard", "LinkIcon", "definePlugin", "Devs", "addContextMenuPatch", "removeContextMenuPatch", "CrashHandlerLogger", "ModalStack", "settings", "crashCount", "lastCrashTimestamp", "shouldAttemptNextHandle", "crashHandler_default", "init_crashHandler", "__esmMin", "init_react", "init_Notifications", "init_Settings", "init_constants", "init_Logger", "init_modal", "init_types", "init_updater", "init_webpack", "init_common", "Logger", "findByPropsLazy", "definePluginSettings", "definePlugin", "Devs", "_this", "showNotification", "maybePromptToUpdate", "err", "FluxDispatcher", "closeAllModals", "NavigationRouter", "isTruthy", "item", "isNonNullish", "init_guards", "__esmMin", "init_react", "getApplicationAsset", "key", "ApplicationAssetUtils", "settings", "onChange", "setRpc", "Settings", "isStreamLinkDisabled", "isStreamLinkValid", "value", "isTimestampDisabled", "isImageKeyValid", "createActivity", "appID", "appName", "details", "state", "type", "streamLink", "startTime", "endTime", "imageBig", "imageBigTooltip", "imageSmall", "imageSmallTooltip", "buttonOneText", "buttonOneURL", "buttonTwoText", "buttonTwoURL", "activity", "isTruthy", "k", "v", "disable", "FluxDispatcher", "ActivityComponent", "ActivityClassName", "Colors", "customRPC_default", "init_customRPC", "__esmMin", "init_react", "init_Settings", "init_Link", "init_constants", "init_guards", "init_types", "init_webpack", "init_common", "findByCodeLazy", "findByPropsLazy", "definePluginSettings", "definePlugin", "Devs", "useAwaiter", "VencordCreateElement", "VencordFragment", "Forms", "Link", "SelectedChannelStore", "GuildStore", "SelectedGuildStore", "UserStore", "embedDidMount", "embed", "videoId", "embedUrlRe", "res", "titles", "thumbnails", "hasTitle", "hasThumb", "err", "Logger", "DearrowButton", "component", "VencordCreateElement", "Tooltip", "onMouseEnter", "onMouseLeave", "enabled", "oldThumb", "oldTitle", "dearrow_default", "init_dearrow", "__esmMin", "init_react", "init_", "init_ErrorBoundary", "init_constants", "init_Logger", "init_types", "init_common", "definePlugin", "Devs", "ErrorBoundary_default", "disableDMCallIdle_default", "init_disableDMCallIdle", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "getUrl", "data", "StickerExt", "fetchSticker", "id", "cached", "StickersStore", "body", "RestAPI", "FluxDispatcher", "cloneSticker", "guildId", "sticker", "fetchBlob", "UserStore", "cloneEmoji", "emoji", "dataUrl", "resolve", "reader", "EmojiManager", "getGuildCandidates", "meId", "GuildStore", "g", "PermissionStore", "PermissionsBits", "isAnimated", "emojiSlots", "emojis", "EmojiStore", "count", "a", "b", "url", "res", "doClone", "Toasts", "e", "message", "Logger", "CloneModal", "isCloning", "setIsCloning", "React", "name", "setName", "x", "invalidateMemo", "guilds", "VencordCreateElement", "VencordFragment", "Forms", "Margins", "CheckedTextInput", "v", "nameValidator", "Tooltip", "onMouseLeave", "onMouseEnter", "getFontSize", "buildMenuItem", "type", "fetchData", "Menu", "openModalLazy", "modalProps", "ModalRoot", "ModalHeader", "ModalContent", "isGifUrl", "messageContextMenuPatch", "expressionPickerPatch", "emoteCloner_default", "init_emoteCloner", "__esmMin", "init_react", "init_ContextMenu", "init_CheckedTextInput", "init_constants", "init_Logger", "init_margins", "init_modal", "init_types", "init_webpack", "init_common", "findStoreLazy", "findByPropsLazy", "s", "children", "props", "favoriteableId", "itemHref", "itemSrc", "favoriteableType", "menuItem", "match", "findGroupChildrenByChildId", "firstChild", "definePlugin", "Devs", "addContextMenuPatch", "removeContextMenuPatch", "KbdStyles", "settings", "experiments_default", "init_experiments", "__esmMin", "init_react", "init_Settings", "init_ErrorBoundary", "init_ErrorCard", "init_constants", "init_margins", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePluginSettings", "definePlugin", "Devs", "_", "user", "flags", "isMacOS", "modKey", "altKey", "VencordCreateElement", "React", "Forms", "ErrorBoundary_default", "ErrorCard", "Margins", "f8break_default", "init_f8break", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "init_web_metadata", "__esmMin", "init_react", "require_apng_canvas", "__commonJSMin", "exports", "module", "init_react", "self", "i", "o", "a", "s", "u", "n", "t", "e", "__require", "c", "r", "Y", "G", "q", "l", "d", "g", "f", "h", "p", "v", "A", "m", "w", "b", "_", "j", "L", "U", "y", "T", "E", "P", "x", "N", "O", "R", "C", "B", "I", "D", "k", "F", "S", "M", "importApngJs", "rnnoiseDist", "rnnoiseWorkletSrc", "shikiWorkerSrc", "shikiOnigasmSrc", "getStegCloak", "init_dependencies", "__esmMin", "init_react", "init_lazy", "init_web_metadata", "makeLazy", "__markAsModule", "exports", "__export", "GIFEncoder", "applyPalette", "src_default", "nearestColor", "nearestColorIndex", "nearestColorIndexWithDistance", "prequantize", "quantize", "snapColorsToPalette", "constants_default", "createStream", "initialCapacity", "cursor", "contents", "byte", "expand", "data", "offset", "byteLength", "i", "newCapacity", "prevCapacity", "CAPACITY_DOUBLING_MAX", "oldContents", "BITS", "DEFAULT_HSIZE", "MASKS", "lzwEncode", "width", "height", "pixels", "colorDepth", "outStream", "accum", "htab", "codetab", "hsize", "initCodeSize", "cur_accum", "cur_bits", "init_bits", "g_init_bits", "clear_flg", "n_bits", "maxcode", "ClearCode", "EOFCode", "free_ent", "a_count", "ent", "hshift", "fcode", "output", "length", "idx", "next_block", "c", "disp", "code", "lzwEncode_default", "rgb888_to_rgb565", "r", "g", "b", "rgba8888_to_rgba4444", "a", "rgb888_to_rgb444", "clamp", "value", "min", "max", "sqr", "find_nn", "bins", "hasAlpha", "nn", "err", "bin1", "n1", "wa", "wr", "wg", "wb", "bin", "n2", "nerr2", "nerr", "create_bin", "create_bin_list", "format", "bincount", "size", "color", "index", "rgba", "maxColors", "opts", "clearAlpha", "clearAlphaColor", "clearAlphaThreshold", "oneBitAlpha", "useSqrt", "bincountMinusOne", "heap", "maxbins", "d", "h", "l", "l2", "extbins", "tb", "b1", "nb", "palette", "k", "existsInPalette", "p", "matchesRGB", "matchesAlpha", "euclideanDistanceSquared", "sum", "n", "dx", "roundStep", "step", "roundRGB", "roundAlpha", "cache", "key", "nearestColorIndexRGBA", "rgb888_to_key", "nearestColorIndexRGB", "mindist", "px2", "a2", "curdist", "sqr2", "r2", "g2", "b2", "knownColors", "threshold", "paletteRGB", "thresholdSq", "dim", "distanceSq", "colors", "pixel", "distanceFn", "minDist", "minDistIndex", "j", "paletteColor", "dist", "opt", "auto", "stream", "HSIZE", "hasInit", "writeHeader", "transparent", "transparentIndex", "delay", "repeat", "dispose", "first", "encodeLogicalScreenDescriptor", "encodeColorTable", "encodeNetscapeExt", "delayTime", "encodeGraphicControlExt", "useLocalColorTable", "encodeImageDescriptor", "encodePixels", "writeUTFBytes", "transp", "userInput", "writeUInt16", "globalColorTableSize", "colorTableSize", "fields", "backgroundColorIndex", "pixelAspectRatio", "colorTableLength", "localPalette", "palSize", "short", "text", "searchProtoClassField", "localName", "protoClass", "field", "value", "import_gifenc", "DRAFT_TYPE", "StickerStore", "UserSettingsProtoStore", "ProtoUtils", "PreloadedUserSettingsActionCreators", "AppearanceSettingsActionCreators", "ClientThemeSettingsActionsCreators", "USE_EXTERNAL_EMOJIS", "USE_EXTERNAL_STICKERS", "fakeNitroEmojiRegex", "fakeNitroStickerRegex", "fakeNitroGifStickerRegex", "settings", "fakeNitro_default", "init_fakeNitro", "__esmMin", "init_react", "init_MessageEvents", "init_Settings", "init_constants", "init_dependencies", "init_discord", "init_lazy", "init_Logger", "init_types", "init_webpack", "init_common", "findStoreLazy", "findByPropsLazy", "proxyLazy", "UserSettingsActionCreators", "definePluginSettings", "definePlugin", "Devs", "_", "intention", "rest", "canUseExternal", "m", "premiumCheck", "func", "props", "backgroundGradientPresetId", "originalCall", "theme", "content", "rest1", "message", "rest2", "embed", "stickers", "attachments", "renderableSticker", "reactNode", "node", "getCurrentGuild", "UserStore", "proto", "user", "appearanceSettingsDummy", "clientThemeSettingsDummy", "original", "currentAppearanceSettings", "newAppearanceProto", "FluxDispatcher", "firstContent", "lastIndex", "lastContent", "array", "item", "child", "inline", "nextIndex", "transformLinkChild", "fakeNitroMatch", "url", "emojiName", "EmojiStore", "Parser", "gifMatch", "transformChild", "modifyChildren", "modifyChild", "newChild", "listHasAnItem", "index", "children", "lodash", "err", "Logger", "itemsToMaybePush", "contentItems", "attachment", "imgMatch", "stickerName", "match", "link", "type", "fake", "channelId", "channel", "ChannelStore", "PermissionStore", "stickerId", "Settings", "stickerLink", "parseURL", "importApngJs", "frames", "width", "height", "gif", "resolution", "canvas", "ctx", "scale", "previousFrameData", "frame", "left", "top", "img", "delay", "blendOp", "disposeOp", "data", "palette", "file", "UploadHandler", "s", "getWordBoundary", "origStr", "offset", "addPreSendListener", "messageObj", "extra", "guildId", "stickerBypass", "sticker", "canUseStickers", "canUseEmotes", "emoji", "emojiString", "addPreEditListener", "__", "emojiStr", "emojiId", "removePreSendListener", "removePreEditListener", "virtualMerge", "objects", "fallback", "findObjectByProp", "prop", "i", "handler", "acc", "obj", "method", "_", "args", "dist_default", "init_dist", "__esmMin", "init_react", "encode", "primary", "accent", "message", "padding", "encoded", "x", "decode", "bio", "colorString", "parsed", "settings", "fakeProfileThemes_default", "init_fakeProfileThemes", "__esmMin", "init_react", "init_Settings", "init_ErrorBoundary", "init_constants", "init_margins", "init_misc", "init_types", "init_common", "init_dist", "definePluginSettings", "definePlugin", "Devs", "VencordCreateElement", "Forms", "user", "colors", "dist_default", "ErrorBoundary_default", "Button", "copyWithToast", "Margins", "favEmojiFirst_default", "init_favEmojiFirst", "__esmMin", "init_react", "init_constants", "init_types", "init_common", "definePlugin", "Devs", "query", "emojiContext", "EmojiStore", "a", "b", "aIsFavorite", "bIsFavorite", "SearchBar", "instance", "SearchBarComponent", "query", "setQuery", "useState", "ref", "useRef", "onChange", "useCallback", "searchQuery", "props", "result", "gif", "fuzzySearch", "getTargetString", "m", "a", "b", "e", "useEffect", "VencordCreateElement", "containerClasses", "urlStr", "url", "settings", "searchString", "searchIndex", "score", "favGifSearch_default", "init_favGifSearch", "__esmMin", "init_react", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePluginSettings", "definePlugin", "Devs", "ErrorBoundary_default", "favorites", "filteredFavorites", "fixSpotifyEmbeds_default", "init_fixSpotifyEmbeds", "__esmMin", "init_react", "init_Settings", "init_components", "init_constants", "init_types", "definePlugin", "Devs", "definePluginSettings", "makeRange", "forceOwnerCrown_default", "init_forceOwnerCrown", "__esmMin", "init_react", "init_constants", "init_types", "init_common", "definePlugin", "Devs", "props", "guildId", "userId", "GuildStore", "FriendInvites", "uuid", "friendInvites_default", "init_friendInvites", "__esmMin", "init_react", "init_Commands", "init_constants", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePlugin", "Devs", "args", "ctx", "uses", "findOption", "UserStore", "sendBotMessage", "invite", "random", "invite_suggestions", "RestAPI", "_", "friendInviteList", "style_default", "init_style", "__esmMin", "init_react", "makeIcon", "showCurrentGame", "VencordCreateElement", "VencordFragment", "GameActivityToggleButton", "StatusSettingsStores", "Button", "old", "gameActivityToggle_default", "init_gameActivityToggle", "__esmMin", "init_react", "init_Styles", "init_ErrorBoundary", "init_constants", "init_types", "init_webpack", "init_common", "init_style", "findByCodeLazy", "definePlugin", "Devs", "ErrorBoundary_default", "enableStyle", "style_default", "disableStyle", "ExpressionPickerState", "gifPaste_default", "init_gifPaste", "__esmMin", "init_react", "init_constants", "init_discord", "init_types", "init_webpack", "mapMangledModuleLazy", "filters", "definePlugin", "Devs", "gif", "insertTextIntoChatInputBox", "greet", "channel", "message", "stickers", "options", "MessageActions", "settings", "msg", "GreetMenu", "s", "greetMode", "multiGreetChoices", "VencordCreateElement", "Menu", "FluxDispatcher", "GreetMode", "mode", "WELCOME_STICKERS", "sticker", "VencordFragment", "checked", "greetStickerPicker_default", "init_greetStickerPicker", "__esmMin", "init_react", "init_Settings", "init_constants", "init_lazy", "init_types", "init_webpack", "init_common", "definePluginSettings", "findByPropsLazy", "proxyLazy", "findByProps", "definePlugin", "Devs", "event", "props", "ContextMenu", "MessagePopover_exports", "__export", "_buildPopoverElements", "addButton", "buttons", "removeButton", "identifier", "item", "msg", "makeButton", "items", "getItem", "err", "logger", "init_MessagePopover", "__esmMin", "init_react", "init_Logger", "Logger", "style", "KEY", "hiddenMessages", "getHiddenMessages", "saveHiddenMessages", "hideAttachments_default", "init_hideAttachments", "__esmMin", "init_react", "init_DataStore", "init_MessagePopover", "init_Icons", "init_constants", "init_types", "init_common", "get", "set", "ids", "definePlugin", "Devs", "addButton", "msg", "isHidden", "ImageVisible", "ImageInvisible", "ChannelStore", "removeButton", "elements", "id", "iLoveSpam_default", "init_iLoveSpam", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "ToggleIcon", "activity", "tooltipText", "path", "fill", "forceUpdate", "useForceUpdater", "VencordCreateElement", "Tooltip", "tooltipProps", "e", "handleActivityToggle", "ToggleActivityComponent", "isPlaying", "getIgnoredActivities", "act", "ToggleIconOff", "ToggleIconOn", "forceUpdateButton", "ignoredActivityIndex", "settings", "_", "index", "StatusSettingsStores", "old", "RunningGameStore", "ignoreActivities_default", "init_ignoreActivities", "__esmMin", "init_react", "init_DataStore", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_webpack", "init_common", "findStoreLazy", "definePluginSettings", "definePlugin", "Devs", "m", "activities", "props", "nowPlaying", "oldIgnoredActivitiesData", "get", "del", "gamesSeen", "ignoredActivity", "game", "exePath", "ErrorBoundary_default", "ELEMENT_ID", "init_constants", "__esmMin", "init_react", "waitFor", "condition", "cb", "init_waitFor", "__esmMin", "init_react", "cl", "Magnifier", "init_Magnifier", "__esmMin", "init_react", "init_Styles", "init_common", "init_constants", "init_imageZoom", "init_waitFor", "classNameFactory", "instance", "initialSize", "initalZoom", "ready", "setReady", "useState", "lensPosition", "setLensPosition", "imagePosition", "setImagePosition", "opacity", "setOpacity", "isShiftDown", "useRef", "zoom", "size", "element", "currentVideoElementRef", "originalVideoElementRef", "imageRef", "React", "onKeyDown", "e", "onKeyUp", "syncVideos", "updateMousePosition", "offset", "pos", "x", "y", "onMouseDown", "settings", "FluxDispatcher", "onMouseUp", "onWheel", "val", "waitFor", "elem", "ELEMENT_ID", "box", "VencordCreateElement", "styles_default", "init_styles", "__esmMin", "init_react", "settings", "imageContextMenuPatch", "imageZoom_default", "init_imageZoom", "__esmMin", "init_react", "init_ContextMenu", "init_Settings", "init_Styles", "init_components", "init_constants", "init_debounce", "init_types", "init_common", "init_Magnifier", "init_styles", "definePluginSettings", "makeRange", "children", "VencordCreateElement", "Menu", "ContextMenu", "props", "ref", "debounce", "value", "definePlugin", "Devs", "ELEMENT_ID", "Magnifier", "instance", "e", "ReactDOM", "state", "enableStyle", "styles_default", "addContextMenuPatch", "disableStyle", "removeContextMenuPatch", "DecModal", "props", "encryptedMessage", "password", "setPassword", "React", "VencordCreateElement", "ModalRoot", "ModalHeader", "Forms", "ModalContent", "TextInput", "ModalFooter", "Button", "toSend", "decrypt", "buildDecModal", "msg", "openModal", "init_DecryptionModal", "__esmMin", "init_react", "init_modal", "init_common", "init_invisibleChat", "EncModal", "props", "secret", "setSecret", "React", "cover", "setCover", "password", "setPassword", "noCover", "setNoCover", "isValid", "VencordCreateElement", "ModalRoot", "ModalHeader", "Forms", "ModalContent", "TextInput", "e", "Switch", "ModalFooter", "Button", "encrypted", "encrypt", "toSend", "insertTextIntoChatInputBox", "buildEncModal", "openModal", "init_EncryptionModal", "__esmMin", "init_react", "init_discord", "init_modal", "init_common", "init_invisibleChat", "PopOverIcon", "VencordCreateElement", "Indicator", "Tooltip", "onMouseEnter", "onMouseLeave", "ChatBarIcon", "chatBoxProps", "Button", "ButtonLooks", "ButtonWrapperClasses", "buildEncModal", "encrypt", "secret", "password", "cover", "steggo", "decrypt", "encrypted", "removeIndicator", "decrypted", "isCorrectPassword", "result", "iteratePasswords", "message", "passwords", "settings", "s", "content", "i", "invisibleChat_default", "init_invisibleChat", "__esmMin", "init_react", "init_MessagePopover", "init_Settings", "init_ErrorBoundary", "init_constants", "init_dependencies", "init_types", "init_common", "init_DecryptionModal", "init_EncryptionModal", "definePluginSettings", "definePlugin", "Devs", "StegCloak", "getStegCloak", "addButton", "ChannelStore", "res", "buildDecModal", "removeButton", "url", "body", "RestAPI", "revealed", "urlCheck", "embed", "FluxDispatcher", "ErrorBoundary_default", "attemptToNavigateToChannel", "guildId", "channelId", "ChannelStore", "NavigationRouter", "isSwitchingAccount", "previousCache", "keepCurrentChannel_default", "init_keepCurrentChannel", "__esmMin", "init_react", "init_DataStore", "init_constants", "init_types", "init_common", "definePlugin", "Devs", "set", "get", "SelectedGuildStore", "SelectedChannelStore", "getApplicationAsset", "key", "ApplicationAssetUtils", "applicationId", "setActivity", "activity", "FluxDispatcher", "placeholderId", "logger", "presenceStore", "settings", "lastfm_default", "init_lastfm", "__esmMin", "init_react", "init_Settings", "init_Link", "init_constants", "init_Logger", "init_types", "init_webpack", "init_common", "Logger", "findByPropsLazy", "definePluginSettings", "definePlugin", "Devs", "VencordCreateElement", "VencordFragment", "Forms", "Link", "params", "res", "json", "trackData", "x", "track", "largeImage", "assets", "buttons", "statusName", "v", "quotes", "settings", "loadingQuotes_default", "init_loadingQuotes", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "definePluginSettings", "definePlugin", "Devs", "quote", "key", "codes", "s", "MemberCount", "channelId", "guildId", "useStateFromStores", "SelectedChannelStore", "getCurrentChannel", "groups", "ChannelMemberStore", "total", "GuildMemberCountStore", "online", "count", "curr", "VencordCreateElement", "Flex", "Tooltip", "numberFormat", "props", "sharedIntlNumberFormat", "memberCount_default", "init_memberCount", "__esmMin", "init_react", "init_ErrorBoundary", "init_Flex", "init_constants", "init_discord", "init_types", "init_webpack", "init_common", "findStoreLazy", "value", "definePlugin", "Devs", "ErrorBoundary_default", "isDeletePressed", "keydown", "keyup", "settings", "messageClickActions_default", "init_messageClickActions", "__esmMin", "init_react", "init_MessageEvents", "init_Settings", "init_constants", "init_types", "init_webpack", "init_common", "definePluginSettings", "definePlugin", "Devs", "MessageActions", "findByPropsLazy", "EditStore", "addClickListener", "msg", "channel", "event", "isMe", "UserStore", "PermissionStore", "PermissionsBits", "FluxDispatcher", "Settings", "removeClickListener", "MessageAccessories_exports", "__export", "_modifyAccessories", "accessories", "addAccessory", "removeAccessory", "identifier", "callback", "position", "elements", "props", "accessory", "e", "init_MessageAccessories", "__esmMin", "init_react", "fetchMessage", "channelID", "messageID", "cached", "messageCache", "msg", "RestAPI", "message", "MessageStore", "getImages", "attachments", "content_type", "height", "width", "url", "proxy_url", "type", "image", "thumbnail", "tenorRegex", "noContent", "embeds", "requiresRichEmbed", "a", "e", "computeWidthAndHeight", "adjustedWidth", "adjustedHeight", "withEmbeddedBy", "embeddedBy", "_", "prop", "MessageEmbedAccessory", "accessories", "match", "messageLinkRegex", "guildID", "linkedChannel", "ChannelStore", "PermissionStore", "listMode", "idList", "settings", "isListed", "id", "linkedMessage", "messageFetchQueue", "m", "FluxDispatcher", "messageProps", "VencordCreateElement", "AutomodEmbedAccessory", "ChannelMessageEmbedAccessory", "VencordFragment", "channel", "isDM", "guild", "GuildStore", "dmReceiver", "UserStore", "Embed", "Text", "Parser", "classes", "SearchResultClasses", "ChannelMessage", "props", "compact", "TextAndImagesSettingsStores", "images", "parse", "AutoModEmbed", "messageLinkEmbeds_default", "init_messageLinkEmbeds", "__esmMin", "init_react", "init_MessageAccessories", "init_Settings", "init_ErrorBoundary", "init_constants", "init_misc", "init_Queue", "init_types", "init_webpack", "init_common", "LazyComponent", "findByCode", "find", "findByPropsLazy", "Queue", "definePluginSettings", "Button", "definePlugin", "Devs", "addAccessory", "ErrorBoundary_default", "deleteStyleOverlay_default", "init_deleteStyleOverlay", "__esmMin", "init_react", "deleteStyleText_default", "init_deleteStyleText", "__esmMin", "init_react", "addDeleteStyle", "Settings", "enableStyle", "deleteStyleText_default", "disableStyle", "deleteStyleOverlay_default", "styles", "REMOVE_HISTORY_ID", "TOGGLE_DELETE_STYLE_ID", "patchMessageContextMenu", "messageLogger_default", "init_messageLogger", "__esmMin", "init_react", "init_", "init_ContextMenu", "init_Settings", "init_Styles", "init_ErrorBoundary", "init_constants", "init_Logger", "init_types", "init_webpack", "init_common", "init_deleteStyleOverlay", "init_deleteStyleText", "findByPropsLazy", "children", "props", "message", "deleted", "editHistory", "id", "channel_id", "toggle", "domElement", "VencordCreateElement", "Menu", "FluxDispatcher", "definePlugin", "Devs", "addContextMenuPatch", "removeContextMenuPatch", "edit", "ErrorBoundary_default", "Parser", "Timestamp", "i18n", "newMessage", "oldMessage", "moment", "cache", "data", "isBulk", "mutate", "msg", "EPHEMERAL", "m", "a", "e", "Logger", "ignoreBots", "ignoreSelf", "ignoreUsers", "ignoreChannels", "ignoreGuilds", "myId", "UserStore", "ChannelStore", "createTagCommand", "tag", "registerCommand", "_", "ctx", "getTag", "Settings", "sendBotMessage", "author", "EMOTE", "MessageTagsMarker", "DATA_KEY", "getTags", "addTag", "removeTag", "messageTags_default", "init_messageTags", "__esmMin", "init_react", "init_Commands", "init_DataStore", "init_Settings", "init_constants", "init_types", "get", "t", "name", "tt", "tags", "set", "definePlugin", "Devs", "args", "findOption", "message", "unregisterCommand", "mock", "input", "output", "i", "moreCommands_default", "init_moreCommands", "__esmMin", "init_react", "init_Commands", "init_constants", "init_types", "definePlugin", "Devs", "OptionalMessageOption", "opts", "ctx", "content", "findOption", "sendBotMessage", "RequiredMessageOption", "moreKaomoji_default", "init_moreKaomoji", "__esmMin", "init_react", "init_Commands", "init_constants", "init_types", "definePlugin", "Devs", "data", "OptionalMessageOption", "opts", "findOption", "SettingsComponent", "props", "settings", "defaultSettings", "tagSettings", "setTagSettings", "useState", "setValue", "v", "VencordCreateElement", "Flex", "tags", "t", "Card", "Forms", "Tooltip", "onMouseEnter", "onMouseLeave", "Tag", "TextInput", "Margins", "Switch", "PermissionUtil", "isWebhook", "moreUserTags_default", "init_moreUserTags", "__esmMin", "init_react", "init_Settings", "init_Flex", "init_constants", "init_margins", "init_types", "init_webpack", "init_common", "findByPropsLazy", "findLazy", "m", "message", "user", "_", "channel", "GuildStore", "name", "displayName", "definePluginSettings", "definePlugin", "Devs", "origSwitch", "variant", "displayedText", "strings", "newSettings", "value", "setting", "tag", "guild", "permissions", "PermissionsBits", "perm", "permInt", "obj", "i", "passedTagName", "tagName", "tagText", "channelId", "origType", "location", "type", "ChannelStore", "perms", "countOccurrences", "sourceString", "subString", "i", "lastIdx", "countMatches", "pattern", "getMoyaiCount", "message", "count", "MOYAI", "customMoyaiRe", "boom", "settings", "audioElement", "MOYAI_URL_HD", "MOYAI_URL", "moyai_default", "init_moyai", "__esmMin", "init_react", "init_Settings", "init_SettingSliderComponent", "init_constants", "init_misc", "init_types", "init_common", "definePluginSettings", "makeRange", "definePlugin", "Devs", "optimistic", "type", "channelId", "RelationshipStore", "SelectedChannelStore", "moyaiCount", "sleep", "userId", "messageAuthorId", "emoji", "UserStore", "name", "settings", "muteNewGuild_default", "init_muteNewGuild", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_webpack", "definePluginSettings", "definePlugin", "Devs", "m", "guildId", "lurker", "findByProps", "getGroupDMName", "channel", "UserStore", "isNonNullish", "c", "RelationshipStore", "UserUtils", "SelectedChannelActionCreators", "AvatarUtils", "ProfileListClasses", "GuildLabelClasses", "mutualGroupDMs_default", "init_mutualGroupDMs", "__esmMin", "init_react", "init_constants", "init_guards", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePlugin", "Devs", "user", "onClose", "entries", "ChannelStore", "VencordCreateElement", "Clickable", "Avatar", "ScrollerThin", "RelationshipStore", "noBlockedMessages_default", "init_noBlockedMessages", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_webpack", "findByPropsLazy", "definePlugin", "Devs", "find", "Settings", "_", "props", "message", "noDevtoolsWarning_default", "init_noDevtoolsWarning", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "noF1_default", "init_noF1", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "styles_default", "init_styles", "__esmMin", "init_react", "settings", "noMosaic_default", "init_noMosaic", "__esmMin", "init_react", "init_Settings", "init_Styles", "init_constants", "init_types", "init_styles", "definePluginSettings", "definePlugin", "Devs", "enableStyle", "styles_default", "disableStyle", "MessageRequestStore", "settings", "noPendingCount_default", "init_noPendingCount", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_webpack", "findByPropsLazy", "definePluginSettings", "definePlugin", "Devs", "noProfileThemes_default", "init_noProfileThemes", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "settings", "noReplyMention_default", "init_noReplyMention", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "definePluginSettings", "definePlugin", "Devs", "message", "isHoldingShift", "isListed", "isExempt", "noScreensharePreview_default", "init_noScreensharePreview", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "noTypingAnimation_default", "init_noTypingAnimation", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "noUnblockToJump_default", "init_noUnblockToJump", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "normalizeMessageLinks_default", "init_normalizeMessageLinks", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "host", "nsfwGateBypass_default", "init_nsfwGateBypass", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "settings", "onePingPerDM_default", "init_onePingPerDM", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_common", "definePluginSettings", "definePlugin", "Devs", "message", "channelType", "ChannelStore", "m", "UserStore", "ReadStateStore", "oneko_default", "init_oneko", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "x", "s", "ShortUrlMatcher", "SpotifyMatcher", "SteamMatcher", "EpicMatcher", "settings", "Native", "openInApp_default", "init_openInApp", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_common", "definePluginSettings", "definePlugin", "Devs", "data", "event", "url", "spotify", "match", "type", "id", "steam", "showToast", "Toasts", "epic", "platformType", "userId", "setPoggerState", "state", "FluxDispatcher", "setSettings", "intensity", "settings", "partyMode_default", "init_partyMode", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_common", "definePluginSettings", "definePlugin", "Devs", "settings", "permissionFreeWill_default", "init_permissionFreeWill", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "definePluginSettings", "definePlugin", "Devs", "formatPermissionWithoutMatchingString", "permission", "wordsToTitle", "getPermissionString", "PermissionKeyMap", "i18n", "getPermissionDescription", "msg", "Parser", "getSortedRoles", "roles", "id", "member", "a", "b", "sortUserRoles", "settings", "sortPermissionOverwrites", "overwrites", "guildId", "guild", "GuildStore", "roleA", "cl", "init_utils", "__esmMin", "init_react", "init_Styles", "init_text", "init_common", "init_permissionsViewer", "init_RolesAndUsersPermissions", "classNameFactory", "PermissionDeniedIcon", "VencordCreateElement", "PermissionAllowedIcon", "PermissionDefaultIcon", "init_icons", "__esmMin", "init_react", "openRolesAndUsersPermissionsModal", "permissions", "guild", "header", "openModal", "modalProps", "VencordCreateElement", "RolesAndUsersPermissions", "RolesAndUsersPermissionsComponent", "a", "b", "useStateFromStores", "GuildMemberStore", "old", "current", "useEffect", "usersToRequest", "p", "id", "FluxDispatcher", "selectedItemIndex", "selectItem", "useState", "selectedItem", "ModalRoot", "ModalHeader", "Text", "cl", "ModalCloseButton", "ModalContent", "permission", "index", "user", "UserStore", "role", "e", "settings", "ContextMenu", "RoleContextMenu", "getUniqueUsername", "Flex", "OwnerCrownIcon", "PermissionsBits", "permissionName", "bit", "overwriteAllow", "overwriteDeny", "PermissionAllowedIcon", "PermissionDeniedIcon", "PermissionDefaultIcon", "getPermissionString", "Tooltip", "getPermissionDescription", "props", "InfoIcon", "roleId", "onClose", "Menu", "RolesAndUsersPermissions_default", "init_RolesAndUsersPermissions", "__esmMin", "init_react", "init_ErrorBoundary", "init_Flex", "init_Icons", "init_discord", "init_modal", "init_common", "init_permissionsViewer", "init_utils", "init_icons", "ErrorBoundary_default", "ExpandableHeader", "children", "onMoreClick", "buttons", "moreTooltipText", "defaultState", "onDropDownClick", "headerText", "showContent", "setShowContent", "useState", "VencordCreateElement", "VencordFragment", "Text", "cl", "Tooltip", "tooltipProps", "v", "init_ExpandableHeader", "__esmMin", "init_react", "init_Styles", "init_common", "init_", "classNameFactory", "UserPermissionsComponent", "guild", "guildMember", "stns", "settings", "rolePermissions", "userPermissions", "useMemo", "userRoles", "getSortedRoles", "role", "PermissionsBits", "prev", "curr", "OWNER", "i18n", "sortUserRoles", "permission", "bit", "permissions", "colorString", "position", "name", "getPermissionString", "a", "b", "root", "roleRemoveButton", "roleNameOverflow", "roles", "rolePill", "rolePillBorder", "roleCircle", "roleName", "Classes", "VencordCreateElement", "ExpandableHeader", "RolesAndUsersPermissions_default", "UserStore", "Tooltip", "tooltipProps", "cl", "classes", "roleColor", "Text", "UserPermissions_default", "init_UserPermissions", "__esmMin", "init_react", "init_ErrorBoundary", "init_ExpandableHeader", "init_lazy", "init_misc", "init_webpack", "init_common", "init_permissionsViewer", "init_utils", "init_RolesAndUsersPermissions", "proxyLazy", "modules", "findBulk", "filters", "ErrorBoundary_default", "MenuItem", "guildId", "id", "type", "GuildMemberStore", "VencordCreateElement", "Menu", "guild", "GuildStore", "permissions", "header", "member", "getSortedRoles", "role", "PermissionsBits", "prev", "curr", "UserStore", "channel", "ChannelStore", "sortPermissionOverwrites", "allow", "deny", "RolesAndUsersPermissions_default", "makeContextMenuPatch", "childId", "children", "props", "group", "findGroupChildrenByChildId", "item", "settings", "permissionsViewer_default", "init_permissionsViewer", "__esmMin", "init_react", "init_", "init_ContextMenu", "init_Settings", "init_constants", "init_types", "init_common", "init_RolesAndUsersPermissions", "init_UserPermissions", "init_utils", "definePluginSettings", "definePlugin", "Devs", "m", "guildMember", "UserPermissions_default", "addContextMenuPatch", "removeContextMenuPatch", "loadImage", "source", "isFile", "url", "resolve", "reject", "img", "event", "_source", "_lineno", "_colno", "err", "resolveImage", "options", "ctx", "noServerPfp", "opt", "upload", "UploadStore", "DRAFT_TYPE", "UserUtils", "import_gifenc", "DEFAULT_DELAY", "DEFAULT_RESOLUTION", "FRAMES", "getFrames", "petpet_default", "init_petpet", "__esmMin", "init_react", "init_Commands", "init_constants", "init_lazy", "init_types", "init_webpack", "init_common", "makeLazy", "_", "i", "findByPropsLazy", "definePlugin", "Devs", "opts", "cmdCtx", "frames", "findOption", "sendBotMessage", "avatar", "delay", "resolution", "gif", "canvas", "j", "width", "height", "offsetX", "offsetY", "data", "palette", "index", "file", "UploadHandler", "settings", "pictureInPicture_default", "init_pictureInPicture", "__esmMin", "init_react", "init_", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_common", "definePluginSettings", "definePlugin", "Devs", "ErrorBoundary_default", "VencordCreateElement", "Tooltip", "tooltipProps", "e", "video", "videoClone", "launchPiP", "usePinnedDms", "useSettings", "requireSnapshot", "isPinned", "id", "togglePin", "snapshot", "save", "sortedSnapshot", "settings", "PrivateChannelSortStore", "snapshotArray", "getPinAt", "idx", "movePin", "direction", "pins", "getArray", "a", "b", "takeSnapshot", "init_settings", "__esmMin", "init_react", "init_Settings", "init_types", "init_webpack", "definePluginSettings", "findStoreLazy", "Settings", "PinMenuItem", "channelId", "pinned", "isPinned", "canMove", "settings", "VencordCreateElement", "VencordFragment", "Menu", "togglePin", "snapshotArray", "movePin", "addContextMenus", "addContextMenuPatch", "GroupDMContext", "UserContext", "removeContextMenus", "removeContextMenuPatch", "init_contextMenus", "__esmMin", "init_react", "init_ContextMenu", "init_common", "init_settings", "children", "props", "container", "findGroupChildrenByChildId", "idx", "c", "pinDms_default", "init_pinDms", "__esmMin", "init_react", "init_constants", "init_types", "init_contextMenus", "init_settings", "definePlugin", "Devs", "settings", "addContextMenus", "removeContextMenus", "channelIds", "pinnedDms", "usePinnedDms", "channels", "idx", "getPinAt", "isPinned", "sortedSnapshot", "channelId", "rowHeight", "padding", "preRenderedChildren", "originalOffset", "snapshotArray", "plainFolderIcon_default", "init_plainFolderIcon", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "MemberListDecorators_exports", "__export", "__getDecorators", "addDecorator", "decorators", "removeDecorator", "identifier", "decorator", "onlyIn", "props", "isInGuild", "decoratorObj", "init_MemberListDecorators", "__esmMin", "init_react", "MessageDecorations_exports", "__export", "__addDecorationsToMessage", "addDecoration", "decorations", "removeDecoration", "identifier", "decoration", "props", "init_MessageDecorations", "__esmMin", "init_react", "Icon", "path", "opts", "color", "tooltip", "small", "VencordCreateElement", "Tooltip", "tooltipProps", "SessionsStore", "Icons", "StatusUtils", "PlatformIcon", "getStatus", "PlatformIndicator", "badge", "indicatorLocations", "platformIndicators_default", "init_platformIndicators", "__esmMin", "init_react", "init_Badges", "init_MemberListDecorators", "init_MessageDecorations", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_webpack", "init_common", "findStoreLazy", "findByPropsLazy", "platform", "status", "id", "PresenceStore", "user", "wantMargin", "wantTopMargin", "UserStore", "sessions", "sortedSessions", "a", "b", "ownStatus", "acc", "curr", "clientStatuses", "icons", "p", "userInfo", "addDecorator", "props", "ErrorBoundary_default", "removeDecorator", "addBadge", "removeBadge", "addDecoration", "removeDecoration", "definePlugin", "Devs", "settings", "Settings", "displayMode", "key", "value", "_", "userStatus", "isMobile", "PreviewButton", "chatBoxProps", "isEmpty", "attachments", "channelId", "SelectedChannelStore", "draft", "useStateFromStores", "DraftStore", "getDraft", "hasAttachments", "UploadStore", "VencordCreateElement", "Tooltip", "tooltipProps", "Button", "sendBotMessage", "UserStore", "getAttachments", "ButtonLooks", "ButtonWrapperClasses", "getImageBox", "previewMessage_default", "init_previewMessage", "__esmMin", "init_react", "init_Commands", "init_ErrorBoundary", "init_constants", "init_types", "init_webpack", "init_common", "findByPropsLazy", "url", "res", "img", "upload", "isImage", "filename", "spoiler", "file", "attachment", "generateId", "box", "definePlugin", "Devs", "ErrorBoundary_default", "PronounsAboutComponent", "VencordCreateElement", "React", "Forms", "Link", "init_PronounsAboutComponent", "__esmMin", "init_react", "init_Link", "init_common", "settings", "init_settings", "__esmMin", "init_react", "init_Settings", "init_types", "init_pronoundbUtils", "definePluginSettings", "PronounMapping", "init_types", "__esmMin", "init_react", "getDiscordPronouns", "id", "useGlobalProfile", "globalPronouns", "UserProfileStore", "getCurrentChannel", "useFormattedPronouns", "discordPronouns", "NewLineRe", "result", "useAwaiter", "fetchPronouns", "getCachedPronouns", "e", "settings", "formatPronouns", "useProfilePronouns", "pronouns", "UserStore", "EmptyPronouns", "cached", "cache", "res", "requestQueue", "bulkFetch", "bulkFetchPronouns", "ids", "params", "VENCORD_USER_AGENT", "dummyPronouns", "pronounsFormat", "Settings", "PronounMapping", "init_pronoundbUtils", "__esmMin", "init_react", "init_Settings", "init_constants", "init_debounce", "init_discord", "init_common", "init_settings", "init_types", "debounce", "c", "shouldShow", "message", "settings", "AUTO_MODERATION_ACTION", "UserStore", "PronounsChatComponent", "result", "useFormattedPronouns", "VencordCreateElement", "classes", "styles", "PronounsChatComponentWrapper", "CompactPronounsChatComponentWrapper", "CompactPronounsChatComponent", "init_PronounsChatComponent", "__esmMin", "init_react", "init_ErrorBoundary", "init_misc", "init_webpack", "init_common", "init_pronoundbUtils", "init_settings", "findByPropsLazy", "ErrorBoundary_default", "PRONOUN_TOOLTIP_PATCH", "pronoundb_default", "init_pronoundb", "__esmMin", "init_react", "init_", "init_constants", "init_types", "init_PronounsAboutComponent", "init_PronounsChatComponent", "init_pronoundbUtils", "init_settings", "definePlugin", "Devs", "settings", "PronounsAboutComponent", "PronounsChatComponentWrapper", "CompactPronounsChatComponentWrapper", "useProfilePronouns", "quickMention_default", "init_quickMention", "__esmMin", "init_react", "init_MessagePopover", "init_constants", "init_discord", "init_types", "init_common", "definePlugin", "Devs", "addButton", "msg", "channel", "ChannelStore", "PermissionStore", "PermissionsBits", "insertTextIntoChatInputBox", "removeButton", "VencordCreateElement", "calculateIdx", "messages", "id", "idx", "m", "onStartEdit", "channelId", "messageId", "_isQuickEdit", "meId", "UserStore", "MessageStore", "editIdx", "onCreatePendingReply", "message", "_isQuickReply", "replyIdx", "onKeydown", "isUp", "isCtrl", "isAltOrMeta", "nextEdit", "nextReply", "jumpIfOffScreen", "element", "vh", "rect", "Kangaroo", "getNextMessage", "isReply", "SelectedChannelStore", "mutate", "i", "findNextNonDeleted", "shouldMention", "enabled", "userList", "shouldPingListed", "Settings", "shouldPing", "settings", "currChannel", "ChannelStore", "PermissionStore", "PermissionsBits", "FluxDispatcher", "channel", "isMac", "quickReply_default", "onDeletePendingReply", "onEndEdit", "init_quickReply", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePluginSettings", "definePlugin", "Devs", "ERROR_CODES", "CODES_URL", "reactErrorDecoder_default", "init_reactErrorDecoder", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "_", "func", "original", "res", "code", "args", "index", "arg", "ServerList_exports", "__export", "ServerListRenderPosition", "addServerListElement", "removeServerListElement", "renderAll", "getRenderFunctions", "position", "renderFunctionsAbove", "renderFunctionsIn", "renderFunction", "logger", "init_ServerList", "__esmMin", "init_react", "init_Logger", "Logger", "ret", "e", "onClick", "channels", "GuildStore", "guild", "GuildChannelStore", "c", "ReadStateStore", "FluxDispatcher", "ReadAllButton", "readAllNotificationsButton_default", "init_readAllNotificationsButton", "__esmMin", "init_react", "init_ServerList", "init_constants", "init_types", "init_common", "VencordCreateElement", "Button", "definePlugin", "Devs", "addServerListElement", "removeServerListElement", "settings_default", "init_settings", "__esmMin", "init_react", "init_Settings", "init_types", "definePluginSettings", "init_types", "__esmMin", "init_react", "runMigrations", "DataStore", "syncAndRunChecks", "oldGuilds", "oldGroups", "oldFriends", "guildsKey", "groupsKey", "friendsKey", "syncGuilds", "syncGroups", "syncFriends", "settings_default", "id", "group", "groups", "notify", "guild", "guilds", "friends", "user", "UserUtils", "getUniqueUsername", "openUserProfile", "RelationshipStore", "text", "icon", "onClick", "Notices", "showNotification", "getGuild", "deleteGuild", "me", "UserStore", "name", "GuildStore", "GuildMemberStore", "getGroup", "deleteGroup", "type", "rawRecipients", "ChannelStore", "r", "relationShips", "init_utils", "__esmMin", "init_react", "init_api", "init_Notifications", "init_discord", "init_common", "init_settings", "init_types", "onRelationshipRemove", "type", "id", "manuallyRemovedFriend", "user", "UserUtils", "settings_default", "notify", "getUniqueUsername", "openUserProfile", "onGuildDelete", "unavailable", "manuallyRemovedGuild", "deleteGuild", "guild", "getGuild", "onChannelDelete", "manuallyRemovedGroup", "deleteGroup", "group", "getGroup", "removeFriend", "removeGuild", "removeGroup", "init_functions", "__esmMin", "init_react", "init_discord", "init_common", "init_settings", "init_types", "init_utils", "relationshipNotifier_default", "init_relationshipNotifier", "__esmMin", "init_react", "init_constants", "init_types", "init_functions", "init_settings", "init_utils", "definePlugin", "Devs", "settings_default", "syncGuilds", "onGuildDelete", "syncGroups", "onChannelDelete", "syncFriends", "onRelationshipRemove", "syncAndRunChecks", "removeFriend", "removeGroup", "removeGuild", "SpoilerClasses", "MessagesClasses", "revealAllSpoilers_default", "init_revealAllSpoilers", "__esmMin", "init_react", "init_constants", "init_types", "init_webpack", "findByPropsLazy", "definePlugin", "Devs", "_", "event", "ctrlKey", "shiftKey", "target", "spoilerContent", "hidden", "messagesWrapper", "parent", "spoiler", "search", "src", "engine", "Engines", "imageContextMenuPatch", "reverseImageSearch_default", "init_reverseImageSearch", "__esmMin", "init_react", "init_ContextMenu", "init_Flex", "init_Icons", "init_constants", "init_types", "init_common", "children", "props", "reverseImageSearchType", "itemHref", "itemSrc", "group", "findGroupChildrenByChildId", "VencordCreateElement", "Menu", "i", "key", "Flex", "OpenExternalIcon", "e", "definePlugin", "Devs", "m", "target", "addContextMenuPatch", "removeContextMenuPatch", "settings", "roleColorEverywhere_default", "init_roleColorEverywhere", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_common", "definePluginSettings", "definePlugin", "Devs", "userId", "channelId", "guildId", "ChannelStore", "GuildMemberStore", "ids", "colorString", "id", "count", "title", "label", "role", "GuildStore", "VencordCreateElement", "messageUtils", "messageContextMenuPatch", "searchReply_default", "init_searchReply", "__esmMin", "init_react", "init_ContextMenu", "init_Icons", "init_constants", "init_types", "init_webpack", "init_common", "findByPropsLazy", "children", "message", "SelectedChannelStore", "channel", "ChannelStore", "PermissionStore", "PermissionsBits", "dmGroup", "findGroupChildrenByChildId", "child", "pinIndex", "c", "VencordCreateElement", "Menu", "i18n", "ReplyIcon", "e", "serverGroup", "definePlugin", "Devs", "addContextMenuPatch", "removeContextMenuPatch", "secretRingTone_default", "init_secretRingTone", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "parseTime", "time", "cleanTime", "ms", "PickerModal", "rootProps", "close", "value", "setValue", "useState", "format", "setFormat", "formatTimestamp", "formatted", "rendered", "useMemo", "Parser", "VencordCreateElement", "ModalRoot", "ModalHeader", "cl", "Forms", "ModalCloseButton", "ModalContent", "e", "getTheme", "Select", "Formats", "v", "o", "Margins", "ModalFooter", "Button", "insertTextIntoChatInputBox", "sendTimestamps_default", "init_sendTimestamps", "__esmMin", "init_react", "init_", "init_MessageEvents", "init_Styles", "init_constants", "init_discord", "init_margins", "init_modal", "init_types", "init_common", "classNameFactory", "definePlugin", "Devs", "addPreSendListener", "_", "msg", "removePreSendListener", "chatBoxProps", "Tooltip", "onMouseEnter", "onMouseLeave", "ButtonLooks", "ButtonWrapperClasses", "key", "openModal", "props", "closeModal", "samples", "s", "VencordFragment", "FriendsIndicator", "forceUpdateFriendCount", "useForceUpdater", "VencordCreateElement", "onlineFriends", "ServersIndicator", "forceUpdateGuildCount", "guildCount", "handlePresenceUpdate", "relations", "RelationshipStore", "id", "PresenceStore", "handleGuildUpdate", "GuildStore", "serverListIndicators_default", "init_serverListIndicators", "__esmMin", "init_react", "init_ServerList", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_common", "definePlugin", "Devs", "mode", "Settings", "ErrorBoundary_default", "addServerListElement", "removeServerListElement", "openGuildProfileModal", "guild", "openModal", "props", "VencordCreateElement", "ModalRoot", "GuildProfileModal", "renderTimestamp", "timestamp", "Timestamp", "moment", "friendCount", "setFriendCount", "useState", "blockedCount", "setBlockedCount", "useEffect", "fetched", "currentTab", "setCurrentTab", "bannerUrl", "IconUtils", "iconUrl", "cl", "openImageModal", "classes", "IconClasses", "Forms", "TabBar", "ServerInfoTab", "FriendsTab", "BlockedUsersTab", "Owner", "guildId", "owner", "guildAvatar", "GuildMemberStore", "ownerAvatarUrl", "Parser", "useAwaiter", "UserUtils", "Fields", "SnowflakeUtils", "GuildChannelStore", "name", "node", "setCount", "UserList", "RelationshipStore", "blockedIds", "id", "type", "ids", "missing", "members", "useStateFromStores", "old", "curr", "FluxDispatcher", "ScrollerThin", "FriendRow", "UserStore", "PresenceStore", "openUserProfile", "init_GuildProfileModal", "__esmMin", "init_react", "init_", "init_Styles", "init_discord", "init_misc", "init_modal", "init_webpack", "init_common", "findByPropsLazy", "LazyComponent", "findByProps", "classNameFactory", "Patch", "serverProfile_default", "init_serverProfile", "__esmMin", "init_react", "init_ContextMenu", "init_constants", "init_types", "init_common", "init_GuildProfileModal", "children", "guild", "findGroupChildrenByChildId", "VencordCreateElement", "Menu", "openGuildProfileModal", "definePlugin", "Devs", "addContextMenuPatch", "removeContextMenuPatch", "previewExample_default", "init_previewExample", "__esmMin", "init_react", "require_eventemitter3", "__commonJSMin", "exports", "module", "init_react", "has", "prefix", "Events", "EE", "fn", "context", "once", "addListener", "emitter", "event", "listener", "evt", "clearEvent", "EventEmitter", "names", "events", "name", "handlers", "l", "ee", "listeners", "a1", "a2", "a3", "a4", "a5", "len", "args", "i", "length", "j", "require_channel", "__commonJSMin", "exports", "init_react", "eventemitter3_1", "ipcPrefix", "kEdgeCreate", "ChannelPort", "sourceName", "event", "data", "pipeName", "listenerMap", "listener", "name", "existingPipe", "pipe", "fn", "Channel", "id", "edge", "message", "logger", "prevEdge", "newEdgeIds", "edgeId", "edgeIds", "callback", "caller", "error", "index", "arr", "destinaton", "destination", "resolve", "checkEdge", "messageData", "opts", "nonce", "promise", "reject", "timeout", "require_rpc", "__commonJSMin", "exports", "init_react", "RemoteHost", "channel", "spec", "name", "fn", "input", "RemoteClient", "hostName", "output", "require_worker", "__commonJSMin", "exports", "init_react", "channel_1", "rpc_1", "createWorkerHost", "name", "spec", "channel", "event", "data", "callback", "WorkerClient", "hostName", "source", "workerOpts", "blob", "worker", "listener", "ev", "evName", "require_ipc", "__commonJSMin", "exports", "init_react", "__createBinding", "o", "m", "k", "k2", "desc", "__exportStar", "p", "dispatchTheme", "state", "currentTheme", "themeSetters", "setTheme", "useTheme", "init_useTheme", "__esmMin", "init_react", "init_common", "React", "resolveLang", "idOrAlias", "languages", "lang", "aliasCache", "VPC_REPO", "VPC_REPO_COMMIT", "vpcRepoAssets", "vpcRepoGrammar", "vpcRepoLanguages", "loadLanguages", "getGrammar", "init_languages", "__esmMin", "init_react", "fileName", "langsJson", "res", "loadedLanguages", "SHIKI_REPO", "SHIKI_REPO_COMMIT", "shikiRepoTheme", "themes", "init_themes", "__esmMin", "init_react", "name", "import_ipc", "themeUrls", "resolveClient", "shiki", "init_shiki", "__esmMin", "init_react", "init_dependencies", "init_useTheme", "init_languages", "init_themes", "themes", "languages", "resolve", "initThemeUrl", "workerBlob", "shikiWorkerSrc", "res", "client", "themeUrl", "loadLanguages", "shikiOnigasmSrc", "themeData", "dispatchTheme", "langId", "lang", "resolveLang", "getGrammar", "code", "devicon_default", "init_devicon", "__esmMin", "init_react", "init_types", "__esmMin", "init_react", "themeNames", "settings", "init_settings", "__esmMin", "init_react", "init_Settings", "init_Styles", "init_misc", "init_text", "init_types", "init_shiki", "init_themes", "init_devicon", "themes", "definePluginSettings", "themeName", "wordsToTitle", "wordsFromPascal", "shiki", "value", "newValue", "disableStyle", "devicon_default", "enableStyle", "url", "parseUrl", "useShikiSettings", "settingKeys", "overrides", "settings", "isLoading", "setLoading", "React", "withOverrides", "themeUrl", "willChangeTheme", "shiki", "noOverrides", "init_useShikiSettings", "__esmMin", "init_react", "init_common", "init_shiki", "init_settings", "hex2Rgb", "hex", "c", "init_color", "__esmMin", "init_react", "cl", "shouldUseHljs", "init_misc", "__esmMin", "init_react", "init_Styles", "init_common", "init_languages", "init_types", "classNameFactory", "lang", "tryHljs", "hljsLang", "hljs", "langName", "resolveLang", "useCopyCooldown", "cooldown", "copyCooldown", "setCopyCooldown", "React", "copy", "text", "Clipboard", "init_useCopyCooldown", "__esmMin", "init_react", "init_common", "CopyButton", "content", "props", "copyCooldown", "copy", "useCopyCooldown", "VencordCreateElement", "init_CopyButton", "__esmMin", "init_react", "init_useCopyCooldown", "ButtonRow", "content", "theme", "buttons", "Clipboard", "VencordCreateElement", "CopyButton", "cl", "init_ButtonRow", "__esmMin", "init_react", "init_common", "init_misc", "init_CopyButton", "Code", "init_Code", "__esmMin", "init_react", "init_common", "init_misc", "theme", "useHljs", "lang", "content", "tokens", "lines", "hljsHtml", "hljs", "line", "i", "VencordCreateElement", "VencordFragment", "color", "fontStyle", "codeTableRows", "cl", "Header", "langName", "useDevIcon", "shikiLang", "VencordCreateElement", "cl", "VencordFragment", "init_Header", "__esmMin", "init_react", "init_types", "init_misc", "createHighlighter", "Highlighter", "init_Highlighter", "__esmMin", "init_react", "init_ErrorBoundary", "init_common", "init_languages", "init_shiki", "init_useShikiSettings", "init_useTheme", "init_color", "init_misc", "init_ButtonRow", "init_Code", "init_Header", "props", "VencordCreateElement", "cl", "ErrorBoundary_default", "lang", "content", "isPreview", "tempSettings", "tryHljs", "useDevIcon", "bgOpacity", "useShikiSettings", "currentThemeId", "currentTheme", "useTheme", "shikiLang", "resolveLang", "useHljs", "shouldUseHljs", "rootRef", "isIntersecting", "useIntersection", "tokens", "useAwaiter", "shiki", "themeBase", "langName", "hljs", "hex2Rgb", "Header", "Code", "ButtonRow", "styles", "clearStyles", "init_createStyle", "__esmMin", "init_react", "style", "shikiCodeblocks_default", "init_shikiCodeblocks", "__esmMin", "init_react", "init_", "init_Styles", "init_constants", "init_types", "init_previewExample", "init_shiki", "init_Highlighter", "init_devicon", "init_settings", "init_createStyle", "definePlugin", "Devs", "settings", "enableStyle", "devicon_default", "shiki", "clearStyles", "tempSettings", "createHighlighter", "previewExample_default", "lang", "content", "showAllMessageButtons_default", "init_showAllMessageButtons", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "VerifiedIcon", "color", "useToken", "ColorMap", "forcedIconColor", "VencordCreateElement", "VerifiedIconComponent", "i18n", "init_VerifiedIcon", "__esmMin", "init_react", "init_webpack", "init_common", "findLazy", "m", "LazyComponent", "findByCode", "ConnectionsComponent", "id", "theme", "profile", "UserProfileStore", "connections", "VencordCreateElement", "Section", "Text", "Flex", "getSpacingPx", "settings", "connection", "CompactConnectionComponent", "platform", "platforms", "url", "img", "TooltipIcon", "LinkIcon", "CopyIcon", "Tooltip", "VerifiedIcon", "tooltipProps", "e", "copyWithToast", "ThemeStore", "getTheme", "profilePopoutComponent", "profilePanelComponent", "showConnections_default", "init_showConnections", "__esmMin", "init_react", "init_", "init_Settings", "init_ErrorBoundary", "init_Flex", "init_Icons", "init_constants", "init_misc", "init_types", "init_webpack", "init_common", "init_VerifiedIcon", "LazyComponent", "findByCode", "findStoreLazy", "findByPropsLazy", "findByCodeLazy", "spacing", "definePluginSettings", "ErrorBoundary_default", "user", "displayProfile", "definePlugin", "Devs", "HiddenChannelLockScreen", "channel", "viewAllowedUsersAndRoles", "setViewAllowedUsersAndRoles", "useState", "settings", "permissions", "setPermissions", "type", "topic", "lastMessageId", "defaultForumLayout", "lastPinTimestamp", "defaultAutoArchiveDuration", "availableTags", "channelId", "rateLimitPerUser", "defaultThreadRateLimitPerUser", "defaultSortOrder", "defaultReactionEmoji", "bitrate", "rtcRegion", "videoQualityMode", "permissionOverwrites", "guild_id", "useEffect", "membersToFetch", "guildOwnerId", "GuildStore", "GuildMemberStore", "userId", "FluxDispatcher", "Settings", "sortPermissionOverwrites", "overwrite", "VencordCreateElement", "ChatScrollClasses", "ChatClasses", "HiddenChannelLogo", "Text", "PermissionStore", "PermissionsBits", "ChannelTypesToChannelNames", "Tooltip", "onMouseLeave", "onMouseEnter", "Parser", "Timestamp", "moment", "SnowflakeUtils", "formatDuration", "VideoQualityModesToNames", "ForumLayoutTypesToNames", "SortOrderTypesToNames", "EmojiParser", "EmojiStore", "EmojiUtils", "tag", "TagComponent", "RolesAndUsersPermissions_default", "v", "ChannelBeginHeader", "HiddenChannelLockScreen_default", "init_HiddenChannelLockScreen", "__esmMin", "init_react", "init_Settings", "init_ErrorBoundary", "init_text", "init_webpack", "init_common", "init_RolesAndUsersPermissions", "init_utils", "init_showHiddenChannels", "findByPropsLazy", "LazyComponent", "findByCode", "find", "m", "code", "ErrorBoundary_default", "ChannelListClasses", "settings", "showHiddenChannels_default", "init_showHiddenChannels", "__esmMin", "init_react", "init_", "init_Settings", "init_ErrorBoundary", "init_constants", "init_patches", "init_types", "init_webpack", "init_common", "init_HiddenChannelLockScreen", "findByPropsLazy", "definePluginSettings", "definePlugin", "Devs", "_", "renderLevelExpression", "RenderLevels", "channel", "m", "func", "muted", "otherClasses", "isMuted", "mutedClassExpression", "unread", "pushNotificationButtonExpression", "isLurking", "channelId", "permCheck", "PermissionsBits", "component", "canonicalizeMatch", "props", "amount", "inCall", "rest", "channels", "checkConnect", "ChannelStore", "PermissionStore", "shouldIncludeHidden", "res", "key", "maybeObjChannels", "objChannel", "guildId", "prev", "index", "originalArray", "everyoneRole", "role", "VencordCreateElement", "HiddenChannelLockScreen_default", "ErrorBoundary_default", "Tooltip", "onMouseLeave", "onMouseEnter", "settings", "showMeYourName_default", "init_showMeYourName", "__esmMin", "init_react", "init_", "init_Settings", "init_constants", "init_types", "definePluginSettings", "definePlugin", "Devs", "author", "message", "isRepliedMessage", "withMentionPrefix", "userOverride", "user", "username", "nick", "prefix", "VencordCreateElement", "VencordFragment", "showTimeouts_default", "init_showTimeouts", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "SilentMessageToggle", "chatBoxProps", "enabled", "setEnabled", "React", "lastState", "setEnabledValue", "value", "settings", "listener", "_", "message", "addPreSendListener", "removePreSendListener", "VencordCreateElement", "Tooltip", "tooltipProps", "Button", "ButtonLooks", "ButtonWrapperClasses", "silentMessageToggle_default", "init_silentMessageToggle", "__esmMin", "init_react", "init_MessageEvents", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_common", "definePluginSettings", "newValue", "definePlugin", "Devs", "ErrorBoundary_default", "SilentTypingToggle", "chatBoxProps", "isEnabled", "settings", "toggle", "VencordCreateElement", "Tooltip", "tooltipProps", "Button", "ButtonLooks", "ButtonWrapperClasses", "silentTyping_default", "init_silentTyping", "__esmMin", "init_react", "init_Commands", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_common", "definePluginSettings", "definePlugin", "Devs", "args", "ctx", "findOption", "sendBotMessage", "channelId", "FluxDispatcher", "ErrorBoundary_default", "sortFriendRequests_default", "init_sortFriendRequests", "__esmMin", "init_react", "init_Flex", "init_constants", "init_types", "init_common", "init_Vencord", "definePlugin", "Devs", "Settings", "_", "pre", "user", "subtext", "post", "row", "RelationshipStore", "text", "since", "VencordCreateElement", "Flex", "hoverOnly_default", "init_hoverOnly", "__esmMin", "init_react", "SpotifyStore", "init_SpotifyStore", "__esmMin", "init_react", "init_Settings", "init_lazy", "init_webpack", "init_common", "proxyLazy", "Store", "Flux", "SpotifySocket", "findByPropsLazy", "SpotifyUtils", "API_BASE", "path", "url", "Settings", "_", "idx", "pos", "p", "percent", "playing", "state", "ms", "e", "method", "route", "data", "socket", "store", "FluxDispatcher", "devices", "d", "msToHuman", "ms", "minutes", "m", "s", "Svg", "path", "label", "VencordCreateElement", "classes", "cl", "Button", "props", "CopyContextMenu", "name", "copyId", "openId", "Menu", "FluxDispatcher", "copyWithToast", "LinkIcon", "SpotifyStore", "OpenExternalIcon", "makeContextMenu", "e", "ContextMenu", "Controls", "isPlaying", "shuffle", "repeat", "useStateFromStores", "nextRepeat", "repeatClassName", "Flex", "Shuffle", "SkipPrev", "PauseButton", "PlayButton", "SkipNext", "Repeat", "SeekBar", "duration", "storePosition", "isSettingPosition", "position", "setPosition", "useState", "useEffect", "interval", "p", "Forms", "v", "seek", "AlbumContextMenu", "track", "volume", "openImageModal", "ImageIcon", "ref", "debounce", "makeLinkProps", "condition", "Info", "img", "coverExpanded", "setCoverExpanded", "VencordFragment", "a", "i", "React", "Player", "prev", "next", "device", "shouldHide", "setShouldHide", "timeout", "ErrorBoundary_default", "init_PlayerComponent", "__esmMin", "init_react", "init_", "init_ErrorBoundary", "init_Flex", "init_Icons", "init_debounce", "init_discord", "init_misc", "init_common", "init_SpotifyStore", "className", "toggleHoverControls", "value", "enableStyle", "disableStyle", "hoverOnly_default", "spotifyControls_default", "init_spotifyControls", "__esmMin", "init_react", "init_Settings", "init_Styles", "init_constants", "init_types", "init_hoverOnly", "init_PlayerComponent", "definePlugin", "Devs", "v", "Settings", "VencordCreateElement", "Player", "settings", "spotifyCrack_default", "init_spotifyCrack", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "definePluginSettings", "definePlugin", "Devs", "m", "req", "sendMessage", "channelId", "message", "reply", "PendingReplyStore", "MessageCreator", "FluxDispatcher", "Spotify", "spotifyShareCommands_default", "init_spotifyShareCommands", "__esmMin", "init_react", "init_Commands", "init_constants", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePlugin", "Devs", "_", "ctx", "track", "sendBotMessage", "StartupTimingPage_exports", "__export", "StartupTimingPage_default", "TimerItem", "emoji", "prefix", "log", "delta", "instance", "VencordCreateElement", "React", "TimingSection", "title", "logs", "traceEnd", "startTime", "lastTimestamp", "timings", "timestamp", "sinceStart", "sinceLast", "Forms", "AppStartPerformance", "i", "ServerTrace", "trace", "lines", "Flex", "line", "StartupTimingPage", "serverTrace", "g", "init_StartupTimingPage", "__esmMin", "init_react", "init_ErrorBoundary", "init_Flex", "init_webpack", "init_common", "findByPropsLazy", "ErrorBoundary_default", "startupTimings_default", "init_startupTimings", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "LazyComponent", "settings", "superReactionTweaks_default", "init_superReactionTweaks", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "definePluginSettings", "definePlugin", "Devs", "playingCount", "stringToRegex", "str", "match", "char", "pos", "flagArr", "renderFindError", "find", "e", "VencordCreateElement", "Input", "initialValue", "onChange", "placeholder", "value", "setValue", "useState", "TextInput", "TextReplace", "title", "rulesArray", "rulesKey", "update", "isRegexRules", "onClickRemove", "index", "DataStore", "key", "makeEmptyRule", "VencordFragment", "Forms", "Flex", "rule", "React", "Button", "DeleteIcon", "TextReplaceTesting", "applyRules", "content", "stringRules", "regexRules", "regex", "Logger", "STRING_RULES_KEY", "REGEX_RULES_KEY", "makeEmptyRuleArray", "settings", "TEXT_REPLACE_RULES_CHANNEL_ID", "textReplace_default", "init_textReplace", "__esmMin", "init_react", "init_api", "init_MessageEvents", "init_Settings", "init_Flex", "init_Icons", "init_constants", "init_Logger", "init_types", "init_common", "definePluginSettings", "useForceUpdater", "definePlugin", "Devs", "addPreSendListener", "channelId", "msg", "removePreSendListener", "themeAttributes_default", "init_themeAttributes", "__esmMin", "init_react", "init_constants", "init_types", "init_common", "definePlugin", "Devs", "props", "authorId", "UserStore", "timeBarAllActivities_default", "init_timeBarAllActivities", "__esmMin", "init_react", "init_constants", "init_types", "definePlugin", "Devs", "settings", "init_settings", "__esmMin", "init_react", "init_Settings", "init_types", "definePluginSettings", "Languages", "init_languages", "__esmMin", "init_react", "translate", "kind", "text", "sourceLang", "settings", "targetLang", "url", "res", "src", "sentences", "s", "cl", "init_utils", "__esmMin", "init_react", "init_Styles", "init_settings", "classNameFactory", "LanguageSelect", "settingsKey", "includeAuto", "currentValue", "settings", "options", "useMemo", "Languages", "value", "label", "VencordCreateElement", "Margins", "Forms", "SearchableSelect", "o", "v", "AutoTranslateToggle", "Switch", "TranslateModal", "rootProps", "ModalRoot", "ModalHeader", "cl", "ModalCloseButton", "ModalContent", "LanguageSettingKeys", "s", "init_TranslateModal", "__esmMin", "init_react", "init_margins", "init_modal", "init_common", "init_languages", "init_settings", "init_utils", "TranslateIcon", "height", "width", "className", "VencordCreateElement", "classes", "cl", "TranslateChatBarIcon", "slateProps", "autoTranslate", "settings", "toggle", "Tooltip", "onMouseEnter", "onMouseLeave", "Button", "ButtonLooks", "ButtonWrapperClasses", "e", "openModal", "props", "TranslateModal", "init_TranslateIcon", "__esmMin", "init_react", "init_misc", "init_modal", "init_common", "init_settings", "init_TranslateModal", "init_utils", "handleTranslate", "messageId", "data", "TranslationSetters", "Dismiss", "onDismiss", "VencordCreateElement", "cl", "TranslationAccessory", "message", "translation", "setTranslation", "useState", "useEffect", "TranslateIcon", "Parser", "Languages", "init_TranslationAccessory", "__esmMin", "init_react", "init_common", "init_languages", "init_TranslateIcon", "init_utils", "messageCtxPatch", "translate_default", "init_translate", "__esmMin", "init_react", "init_", "init_ContextMenu", "init_MessageAccessories", "init_MessageEvents", "init_MessagePopover", "init_ErrorBoundary", "init_constants", "init_types", "init_common", "init_settings", "init_TranslateIcon", "init_TranslationAccessory", "init_utils", "children", "message", "group", "findGroupChildrenByChildId", "c", "VencordCreateElement", "Menu", "TranslateIcon", "trans", "translate", "handleTranslate", "definePlugin", "Devs", "settings", "addAccessory", "props", "TranslationAccessory", "addContextMenuPatch", "addButton", "ChannelStore", "addPreSendListener", "_", "removePreSendListener", "removeContextMenuPatch", "removeButton", "removeAccessory", "slateProps", "ErrorBoundary_default", "TranslateChatBarIcon", "buildSeveralUsers", "a", "b", "count", "VencordCreateElement", "settings", "TypingUser", "typingTweaks_default", "init_typingTweaks", "__esmMin", "init_react", "init_Settings", "init_ErrorBoundary", "init_constants", "init_discord", "init_types", "init_common", "definePluginSettings", "ErrorBoundary_default", "user", "guildId", "openUserProfile", "GuildMemberStore", "Avatar", "RelationshipStore", "definePlugin", "Devs", "_", "users", "props", "children", "element", "c", "getDisplayName", "guildId", "userId", "GuildMemberStore", "UserStore", "TypingIndicator", "channelId", "typingUsers", "useStateFromStores", "TypingStore", "old", "current", "oldKeys", "currentKeys", "ChannelStore", "settings", "UserGuildSettingsStore", "myId", "typingUsersArray", "id", "RelationshipStore", "tooltipText", "Formatters", "Settings", "buildSeveralUsers", "VencordCreateElement", "Tooltip", "onMouseLeave", "onMouseEnter", "ThreeDots", "typingIndicator_default", "init_typingIndicator", "__esmMin", "init_react", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_webpack", "init_common", "init_typingTweaks", "LazyComponent", "find", "m", "findStoreLazy", "findLazy", "definePluginSettings", "definePlugin", "Devs", "ErrorBoundary_default", "unindent_default", "init_unindent", "__esmMin", "init_react", "init_MessageEvents", "init_constants", "init_types", "definePlugin", "Devs", "_", "content", "str", "minIndent", "prev", "curr", "msg", "m", "lines", "suffix", "addPreSendListener", "addPreEditListener", "_cid", "_mid", "removePreSendListener", "removePreEditListener", "EMBED_SUPPRESSED", "messageContextMenuPatch", "unsuppressEmbeds_default", "init_unsuppressEmbeds", "__esmMin", "init_react", "init_ContextMenu", "init_Icons", "init_constants", "init_types", "init_common", "children", "channel", "author", "embeds", "flags", "messageId", "isEmbedSuppressed", "hasEmbedPerms", "PermissionStore", "PermissionsBits", "UserStore", "menuGroup", "findGroupChildrenByChildId", "deleteIndex", "i", "VencordCreateElement", "Menu", "ImageVisible", "ImageInvisible", "RestAPI", "definePlugin", "Devs", "addContextMenuPatch", "removeContextMenuPatch", "urbanDictionary_default", "init_urbanDictionary", "__esmMin", "init_react", "init_Commands", "init_types", "init_constants", "definePlugin", "Devs", "args", "ctx", "query", "definition", "sendBotMessage", "linkify", "text", "_", "word", "error", "ChannelActions", "UserPopoutSection", "CONNECT", "VoiceChannelSection", "init_VoiceChannelSection", "__esmMin", "init_react", "init_", "init_webpack", "init_common", "findByPropsLazy", "findByCodeLazy", "channel", "label", "showHeader", "VencordCreateElement", "Forms", "Button", "PermissionStore", "Toasts", "VoiceStateStore", "settings", "VoiceChannelField", "userVoiceShow_default", "init_userVoiceShow", "__esmMin", "init_react", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_webpack", "init_common", "init_VoiceChannelSection", "findStoreLazy", "definePluginSettings", "ErrorBoundary_default", "user", "channelId", "channel", "ChannelStore", "guild", "GuildStore", "result", "VencordCreateElement", "VoiceChannelSection", "definePlugin", "Devs", "isSelfUser", "UserStore", "usrbg_default", "init_usrbg", "__esmMin", "init_react", "BASE_URL", "data", "settings", "usrbg_default", "init_usrbg", "__esmMin", "init_react", "init_Settings", "init_Styles", "init_Link", "init_constants", "init_types", "definePluginSettings", "definePlugin", "Devs", "VencordCreateElement", "Link", "className", "participantUserId", "displayProfile", "user", "userId", "enableStyle", "res", "MentionWrapper", "data", "UserMention", "RoleMention", "parse", "props", "userId", "setUserId", "useState", "VencordCreateElement", "children", "mention", "id", "fetching", "UserStore", "fetch", "queue", "UserUtils", "e", "sleep", "validUser_default", "init_validUser", "__esmMin", "init_react", "init_ErrorBoundary", "init_constants", "init_misc", "init_Queue", "init_types", "init_common", "Queue", "definePlugin", "Devs", "ErrorBoundary_default", "timers", "vcDoubleClick_default", "init_vcDoubleClick", "__esmMin", "init_react", "init_constants", "init_types", "init_common", "definePlugin", "Devs", "find", "_", "onClick", "props", "channelId", "channel", "ChannelStore", "cb", "e", "id", "SelectedChannelStore", "data", "speak", "text", "settings", "Settings", "speech", "voice", "v", "Logger", "clean", "str", "replacer", "formatText", "user", "channel", "displayName", "nickname", "getTypeAndChannelId", "channelId", "oldChannelId", "isMe", "myLastChannelId", "playSample", "tempSettings", "type", "currentUser", "UserStore", "myGuildId", "SelectedGuildStore", "GuildMemberStore", "VoiceStateStore", "vcNarrator_default", "init_vcNarrator", "__esmMin", "init_react", "init_Settings", "init_ErrorCard", "init_constants", "init_Logger", "init_margins", "init_text", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePlugin", "Devs", "voiceStates", "myChanId", "SelectedChannelStore", "myId", "ChannelStore", "state", "userId", "id", "template", "chanId", "s", "event", "hasVoices", "hasEnglishVoices", "useMemo", "voices", "types", "k", "errorComponent", "VencordCreateElement", "ErrorCard", "error", "Forms", "VencordFragment", "Margins", "t", "Button", "wordsToTitle", "VencordPopout", "onClose", "pluginEntries", "plugin", "VencordCreateElement", "Menu", "text", "action", "key", "openNotificationLogModal", "Settings", "VencordPopoutIcon", "isShown", "VencordPopoutButton", "show", "setShow", "useState", "Popout", "_", "HeaderBarIcon", "v", "ToolboxFragmentWrapper", "children", "ErrorBoundary_default", "VencordFragment", "vencordToolbox_default", "init_vencordToolbox", "__esmMin", "init_react", "init_", "init_notificationLog", "init_Settings", "init_ErrorBoundary", "init_constants", "init_types", "init_webpack", "init_common", "LazyComponent", "filter", "filters", "find", "m", "definePlugin", "Devs", "openImage", "url", "format", "settings", "u", "originalUrl", "openImageModal", "BannerStore", "UserContext", "GuildContext", "viewIcons_default", "init_viewIcons", "__esmMin", "init_react", "init_ContextMenu", "init_Settings", "init_Icons", "init_constants", "init_discord", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePluginSettings", "n", "children", "user", "guildId", "memberAvatar", "GuildMemberStore", "VencordCreateElement", "Menu", "ImageIcon", "guild", "id", "icon", "banner", "definePlugin", "Devs", "addContextMenuPatch", "removeContextMenuPatch", "CodeBlock", "props", "VencordCreateElement", "CodeContainerClasses", "Parser", "init_CodeBlock", "__esmMin", "init_react", "init_webpack", "init_common", "findByPropsLazy", "sortObject", "obj", "k1", "k2", "cleanMessage", "msg", "clone", "key", "cloneAny", "a", "openViewRawModal", "json", "type", "msgContent", "openModal", "props", "VencordCreateElement", "ErrorBoundary_default", "ModalRoot", "ModalHeader", "Text", "ModalCloseButton", "closeModal", "ModalContent", "VencordFragment", "Forms", "CodeBlock", "Margins", "ModalFooter", "Flex", "Button", "copyWithToast", "openViewRawModalMessage", "msgJson", "MakeContextCallback", "name", "children", "lastChild", "p", "Menu", "CopyIcon", "settings", "viewRaw_default", "init_viewRaw", "__esmMin", "init_react", "init_ContextMenu", "init_MessagePopover", "init_Settings", "init_CodeBlock", "init_ErrorBoundary", "init_Flex", "init_constants", "init_margins", "init_misc", "init_modal", "init_types", "init_common", "definePluginSettings", "definePlugin", "Devs", "addButton", "handleClick", "handleContextMenu", "e", "ChannelStore", "addContextMenuPatch", "removeButton", "removeContextMenuPatch", "settings", "init_settings", "__esmMin", "init_react", "init_Settings", "init_types", "definePluginSettings", "Native", "init_DesktopRecorder", "__esmMin", "init_react", "init_common", "init_settings", "cl", "init_utils", "__esmMin", "init_react", "init_Styles", "classNameFactory", "VoiceMessage", "VoicePreview", "init_VoicePreview", "__esmMin", "init_react", "init_webpack", "init_utils", "LazyComponent", "find", "m", "src", "waveform", "recording", "durationMs", "useTimer", "durationSeconds", "durationDisplay", "VencordCreateElement", "cl", "VoiceRecorderWeb", "init_WebRecorder", "__esmMin", "init_react", "init_common", "init_settings", "setAudioBlob", "onRecordingChange", "recording", "setRecording", "useState", "paused", "setPaused", "recorder", "setRecorder", "chunks", "setChunks", "changeRecording", "toggleRecording", "settings", "stream", "e", "VencordCreateElement", "VencordFragment", "Button", "sendAudio", "blob", "meta", "channelId", "SelectedChannelStore", "reply", "PendingReplyStore", "FluxDispatcher", "upload", "CloudUtils", "RestAPI", "SnowflakeUtils", "MessageCreator", "showToast", "Toasts", "useObjectUrl", "url", "setUrl", "useState", "Modal", "modalProps", "isRecording", "setRecording", "setBlob", "blobUrl", "setBlobUrl", "useEffect", "useAwaiter", "EMPTY_META", "audioBuffer", "channelData", "bins", "lodash", "samplesPerBin", "binIdx", "squares", "sampleOffset", "sampleIdx", "maxBin", "ratio", "i", "VencordCreateElement", "ModalRoot", "ModalHeader", "Forms", "ModalContent", "cl", "VoiceRecorder", "Button", "file", "chooseFile", "VoicePreview", "ModalFooter", "OptionClasses", "voiceMessages_default", "ctxMenuPatch", "init_voiceMessages", "__esmMin", "init_react", "init_", "init_ContextMenu", "init_Icons", "init_constants", "init_modal", "init_types", "init_web", "init_webpack", "init_common", "init_DesktopRecorder", "init_settings", "init_utils", "init_VoicePreview", "init_WebRecorder", "findByPropsLazy", "findStoreLazy", "VoiceRecorderWeb", "definePlugin", "Devs", "settings", "addContextMenuPatch", "removeContextMenuPatch", "children", "props", "PermissionStore", "PermissionsBits", "Menu", "Microphone", "openModal", "fetchImage", "url", "res", "MiniDispatcher", "settings", "webContextMenus_default", "init_webContextMenus", "__esmMin", "init_react", "init_Settings", "init_constants", "init_types", "init_web", "init_webpack", "init_common", "findLazy", "m", "definePluginSettings", "definePlugin", "Devs", "ctxMenuCallbacks", "findByProps", "img", "canvas", "data", "name", "file", "saveFile", "selection", "Clipboard", "clip", "type", "blob", "KeyBinds", "webKeybinds_default", "init_webKeybinds", "__esmMin", "init_react", "init_constants", "init_types", "init_webpack", "init_common", "findByPropsLazy", "definePlugin", "Devs", "SelectedGuildStore", "NavigationRouter", "ComponentDispatch", "FluxDispatcher", "SettingsRouter", "fetchReactions", "msg", "emoji", "type", "key", "RestAPI", "res", "FluxDispatcher", "sleep", "getReactionsWithQueue", "e", "cache", "reactions", "queue", "makeRenderMoreUsers", "users", "_label", "_count", "VencordCreateElement", "Tooltip", "u", "onMouseEnter", "onMouseLeave", "AvatarStyles", "handleClickAvatar", "event", "UserSummaryItem", "whoReacted_default", "init_whoReacted", "__esmMin", "init_react", "init_ErrorBoundary", "init_constants", "init_misc", "init_Queue", "init_types", "init_webpack", "init_common", "LazyComponent", "findByCode", "findByPropsLazy", "Queue", "definePlugin", "Devs", "props", "ErrorBoundary_default", "message", "forceUpdate", "useForceUpdater", "React", "cb", "user", "ChannelStore", "value", "wikisearch_default", "init_wikisearch", "__esmMin", "init_react", "init_Commands", "init_constants", "init_types", "definePlugin", "Devs", "_", "ctx", "word", "findOption", "sendBotMessage", "dataSearchParams", "data", "response", "err", "altData", "res", "thumbnailData", "thumbnail", "plugins_default", "init_plugins", "__esmMin", "init_react", "init_badges", "init_commands", "init_contextMenu", "init_memberListDecorators", "init_messageAccessories", "init_messageDecorations", "init_messageEvents", "init_messagePopover", "init_notices", "init_serverList", "init_noTrack", "init_settings", "init_supportHelper", "init_alwaysAnimate", "init_alwaysTrust", "init_anonymiseFileNames", "init_arRPC", "init_banger", "init_betterFolders", "init_betterGifAltText", "init_betterNotes", "init_betterRoleDot", "init_betterUploadButton", "init_biggerStreamPreview", "init_blurNsfw", "init_callTimer", "init_clearURLs", "init_colorSighted", "init_consoleShortcuts", "init_copyUserURLs", "init_crashHandler", "init_customRPC", "init_dearrow", "init_disableDMCallIdle", "init_emoteCloner", "init_experiments", "init_f8break", "init_fakeNitro", "init_fakeProfileThemes", "init_favEmojiFirst", "init_favGifSearch", "init_fixSpotifyEmbeds", "init_forceOwnerCrown", "init_friendInvites", "init_gameActivityToggle", "init_gifPaste", "init_greetStickerPicker", "init_hideAttachments", "init_iLoveSpam", "init_ignoreActivities", "init_imageZoom", "init_invisibleChat", "init_keepCurrentChannel", "init_lastfm", "init_loadingQuotes", "init_memberCount", "init_messageClickActions", "init_messageLinkEmbeds", "init_messageLogger", "init_messageTags", "init_moreCommands", "init_moreKaomoji", "init_moreUserTags", "init_moyai", "init_muteNewGuild", "init_mutualGroupDMs", "init_noBlockedMessages", "init_noDevtoolsWarning", "init_noF1", "init_noMosaic", "init_noPendingCount", "init_noProfileThemes", "init_noReplyMention", "init_noScreensharePreview", "init_noTypingAnimation", "init_noUnblockToJump", "init_normalizeMessageLinks", "init_nsfwGateBypass", "init_onePingPerDM", "init_oneko", "init_openInApp", "init_partyMode", "init_permissionFreeWill", "init_permissionsViewer", "init_petpet", "init_pictureInPicture", "init_pinDms", "init_plainFolderIcon", "init_platformIndicators", "init_previewMessage", "init_pronoundb", "init_quickMention", "init_quickReply", "init_reactErrorDecoder", "init_readAllNotificationsButton", "init_relationshipNotifier", "init_revealAllSpoilers", "init_reverseImageSearch", "init_roleColorEverywhere", "init_searchReply", "init_secretRingTone", "init_sendTimestamps", "init_serverListIndicators", "init_serverProfile", "init_shikiCodeblocks", "init_showAllMessageButtons", "init_showConnections", "init_showHiddenChannels", "init_showMeYourName", "init_showTimeouts", "init_silentMessageToggle", "init_silentTyping", "init_sortFriendRequests", "init_spotifyControls", "init_spotifyCrack", "init_spotifyShareCommands", "init_startupTimings", "init_superReactionTweaks", "init_textReplace", "init_themeAttributes", "init_timeBarAllActivities", "init_translate", "init_typingIndicator", "init_typingTweaks", "init_unindent", "init_unsuppressEmbeds", "init_urbanDictionary", "init_userVoiceShow", "init_usrbg", "init_validUser", "init_vcDoubleClick", "init_vcNarrator", "init_vencordToolbox", "init_viewIcons", "init_viewRaw", "init_voiceMessages", "init_webContextMenus", "init_webKeybinds", "init_whoReacted", "init_wikisearch", "badges_default", "commands_default", "contextMenu_default", "memberListDecorators_default", "messageAccessories_default", "messageDecorations_default", "messageEvents_default", "messagePopover_default", "notices_default", "serverList_default", "noTrack_default", "settings_default", "supportHelper_default", "alwaysAnimate_default", "alwaysTrust_default", "anonymiseFileNames_default", "arRPC_default", "banger_default", "betterFolders_default", "betterGifAltText_default", "betterNotes_default", "betterRoleDot_default", "betterUploadButton_default", "biggerStreamPreview_default", "blurNsfw_default", "callTimer_default", "clearURLs_default", "colorSighted_default", "consoleShortcuts_default", "copyUserURLs_default", "crashHandler_default", "customRPC_default", "dearrow_default", "disableDMCallIdle_default", "emoteCloner_default", "experiments_default", "f8break_default", "fakeNitro_default", "fakeProfileThemes_default", "favEmojiFirst_default", "favGifSearch_default", "fixSpotifyEmbeds_default", "forceOwnerCrown_default", "friendInvites_default", "gameActivityToggle_default", "gifPaste_default", "greetStickerPicker_default", "hideAttachments_default", "iLoveSpam_default", "ignoreActivities_default", "imageZoom_default", "invisibleChat_default", "keepCurrentChannel_default", "lastfm_default", "loadingQuotes_default", "memberCount_default", "messageClickActions_default", "messageLinkEmbeds_default", "messageLogger_default", "messageTags_default", "moreCommands_default", "moreKaomoji_default", "moreUserTags_default", "moyai_default", "muteNewGuild_default", "mutualGroupDMs_default", "noBlockedMessages_default", "noDevtoolsWarning_default", "noF1_default", "noMosaic_default", "noPendingCount_default", "noProfileThemes_default", "noReplyMention_default", "noScreensharePreview_default", "noTypingAnimation_default", "noUnblockToJump_default", "normalizeMessageLinks_default", "nsfwGateBypass_default", "onePingPerDM_default", "oneko_default", "openInApp_default", "partyMode_default", "permissionFreeWill_default", "permissionsViewer_default", "petpet_default", "pictureInPicture_default", "pinDms_default", "plainFolderIcon_default", "platformIndicators_default", "previewMessage_default", "pronoundb_default", "quickMention_default", "quickReply_default", "reactErrorDecoder_default", "readAllNotificationsButton_default", "relationshipNotifier_default", "revealAllSpoilers_default", "reverseImageSearch_default", "roleColorEverywhere_default", "searchReply_default", "secretRingTone_default", "sendTimestamps_default", "serverListIndicators_default", "serverProfile_default", "shikiCodeblocks_default", "showAllMessageButtons_default", "showConnections_default", "showHiddenChannels_default", "showMeYourName_default", "showTimeouts_default", "silentMessageToggle_default", "silentTyping_default", "sortFriendRequests_default", "spotifyControls_default", "spotifyCrack_default", "spotifyShareCommands_default", "startupTimings_default", "superReactionTweaks_default", "textReplace_default", "themeAttributes_default", "timeBarAllActivities_default", "translate_default", "typingIndicator_default", "typingTweaks_default", "unindent_default", "unsuppressEmbeds_default", "urbanDictionary_default", "userVoiceShow_default", "usrbg_default", "validUser_default", "vcDoubleClick_default", "vcNarrator_default", "vencordToolbox_default", "viewIcons_default", "viewRaw_default", "voiceMessages_default", "webContextMenus_default", "webKeybinds_default", "whoReacted_default", "wikisearch_default", "Badges_exports", "__export", "BadgePosition", "_getBadges", "addBadge", "removeBadge", "badge", "ErrorBoundary_default", "Badges", "args", "badges", "donorBadges", "plugins_default", "init_Badges", "__esmMin", "init_react", "init_ErrorBoundary", "init_plugins", "api_exports", "__export", "Badges", "Commands", "ContextMenu", "DataStore", "MemberListDecorators", "MessageAccessories", "MessageDecorations", "MessageEvents", "MessagePopover", "Notices", "Notifications", "ServerList", "Settings", "Styles", "init_api", "__esmMin", "init_react", "init_Badges", "init_Commands", "init_ContextMenu", "init_DataStore", "init_MemberListDecorators", "init_MessageAccessories", "init_MessageDecorations", "init_MessageEvents", "init_MessagePopover", "init_Notices", "init_Notifications", "init_ServerList", "init_Settings", "init_Styles", "MessageEvents_exports", "Notices_exports", "Commands_exports", "DataStore_exports", "MessageAccessories_exports", "MessagePopover_exports", "Badges_exports", "ServerList_exports", "MessageDecorations_exports", "MemberListDecorators_exports", "Settings_exports", "Styles_exports", "Notifications_exports", "ContextMenu_exports", "onceDefined", "target", "property", "callback", "propertyAsAny", "v", "init_onceDefined", "__esmMin", "init_react", "utils_exports", "__export", "ChangeList", "Devs", "DevsById", "ImageModal", "LazyComponent", "Logger", "Margins", "ModalCloseButton", "ModalContent", "ModalFooter", "ModalHeader", "ModalRoot", "ModalSize", "Modals", "NoopComponent", "Queue", "REACT_GLOBAL", "SUPPORT_CHANNEL_ID", "Theme", "VENCORD_USER_AGENT", "WEBPACK_CHUNK", "canonicalizeDescriptor", "canonicalizeMatch", "canonicalizeReplace", "canonicalizeReplacement", "checkIntersecting", "classes", "closeAllModals", "closeModal", "copyWithToast", "debounce", "fetchUserProfile", "formatDuration", "getCurrentChannel", "getCurrentGuild", "getTheme", "getUniqueUsername", "git_hash_default", "git_remote_default", "humanFriendlyJoin", "identity", "insertTextIntoChatInputBox", "isMobile", "isNonNullish", "isObject", "isObjectEmpty", "isPluginDev", "isTruthy", "localStorage", "makeCodeblock", "makeLazy", "mergeDefaults", "onceDefined", "onlyOnce", "openImageModal", "openModal", "openModalLazy", "openPrivateChannel", "openUserProfile", "parseUrl", "proxyLazy", "sendMessage", "sleep", "useAwaiter", "useForceUpdater", "useIntersection", "useTimer", "wordsFromCamel", "wordsFromKebab", "wordsFromPascal", "wordsFromSnake", "wordsFromTitle", "wordsToCamel", "wordsToKebab", "wordsToPascal", "wordsToSnake", "wordsToTitle", "init_utils", "__esmMin", "init_react", "init_ChangeList", "init_constants", "init_debounce", "init_discord", "init_guards", "init_lazy", "init_localStorage", "init_Logger", "init_margins", "init_misc", "init_modal", "init_onceDefined", "init_onlyOnce", "init_patches", "init_Queue", "init_text", "quickCss_exports", "__export", "toggle", "createStyle", "id", "style", "initSystemValues", "values", "variables", "v", "k", "isEnabled", "css", "Settings", "initThemes", "themesStyle", "themeLinks", "enabledThemes", "links", "localThemes", "theme", "link", "init_quickCss", "__esmMin", "init_react", "init_Settings", "addSettingsListener", "webpack_exports", "__export", "common_exports", "_initWebpack", "_resolveReady", "addListener", "cache", "extract", "filters", "find", "findAll", "findBulk", "findByCode", "findByCodeLazy", "findByProps", "findByPropsLazy", "findLazy", "findModuleId", "findStore", "findStoreLazy", "listeners", "mapMangledModule", "mapMangledModuleLazy", "onceReady", "removeListener", "search", "subscriptions", "waitFor", "wreq", "init_webpack", "__esmMin", "init_react", "init_common", "patchPush", "webpackGlobal", "handlePush", "chunk", "patchFactories", "err", "logger", "args", "v", "factories", "subscriptions", "listeners", "patches", "id", "mod", "code", "originalMod", "patchedBy", "factory", "module", "exports", "require", "numberId", "callback", "filter", "nested", "i", "patch", "executePatch", "traceFunction", "match", "replace", "replacement", "lastMod", "lastCode", "canonicalizeReplacement", "newCode", "webpackChunk", "init_patchWebpack", "__esmMin", "init_react", "init_constants", "init_Logger", "init_patches", "init_Tracer", "init_webpack", "Logger", "WEBPACK_CHUNK", "_initWebpack", "Vencord_exports", "__export", "api_exports", "PlainSettings", "plugins_exports", "quickCss_exports", "Settings", "updater_exports", "utils_exports", "webpack_exports", "syncSettings", "get", "showNotification", "SettingsRouter", "localStorage", "putCloudSettings", "getCloudSettings", "relaunch", "init", "onceReady", "startAllPlugins", "checkForUpdates", "update", "err", "UpdateLogger", "init_Vencord", "__esmMin", "init_react", "init_api", "init_plugins", "init_utils", "init_quickCss", "init_updater", "init_webpack", "init_patchWebpack", "init_DataStore", "init_Notifications", "init_Settings", "init_localStorage", "init_native", "init_settingsSync", "init_common"] } diff --git a/backup.sh b/backup.sh index 381b515..c836898 100755 --- a/backup.sh +++ b/backup.sh @@ -29,8 +29,9 @@ cp -r $HOME/.config/VencordDesktop/VencordDesktop/ $GIT_DIR rm -rf $GIT_DIR/vscode mkdir $GIT_DIR/vscode code --list-extensions >$GIT_DIR/vscode/extensions.txt -cp $HOME/.config/Code/User/keybindings.json ./vscode/keybindings.json -cp $HOME/.config/Code/User/settings.json ./vscode/settings.json +cp $HOME/.config/Code/User/keybindings.json $GIT_DIR/vscode/keybindings.json +cp $HOME/.config/Code/User/settings.json $GIT_DIR/vscode/settings.json +cp $HOME/.vscode/argv.json $GIT_DIR/vscode/argv.json # i3 rm -rf $GIT_DIR/i3 diff --git a/fish/fish_variables b/fish/fish_variables index 5713723..875a56c 100644 --- a/fish/fish_variables +++ b/fish/fish_variables @@ -6,12 +6,11 @@ SETUVAR _fisher_ilancosman_2F_tide_40_v6_files:\x7e/\x2econfig/fish/functions/_t SETUVAR _fisher_plugins:ilancosman/tide\x40v6 SETUVAR _fisher_upgraded_to_4_4:\x1d SETUVAR _tide_left_items:vi_mode\x1eos\x1epwd\x1egit -SETUVAR _tide_prompt_10568:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x3f1\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2000\x3a25\x3a52\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_1012:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x20\u21e31\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2017\x3a42\x3a38\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_10656:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b31m\x1b\x5b40m\x20\u2718\x201\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2018\x3a59\x3a39\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m SETUVAR _tide_prompt_1071:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b33m\x1b\x5b40m\x20\u2714\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2011\x3a56\x3a39\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m SETUVAR _tide_prompt_11632:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x2b57\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x212\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x3f1\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2017\x3a49\x3a16\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_1165:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x209s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2021\x3a24\x3a33\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m -SETUVAR _tide_prompt_12096:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20INT\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x201h\x2024m\x2051s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2015\x3a05\x3a38\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_1249:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2021\x3a23\x3a48\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_1315:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20INT\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x204m\x2017s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2018\x3a23\x3a11\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_1439:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2020\x3a49\x3a11\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m @@ -20,20 +19,21 @@ SETUVAR _tide_prompt_1693:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x SETUVAR _tide_prompt_174972:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2012s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2018\x3a13\x3a29\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_2174:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2008\x3a20\x3a32\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_2210:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2021\x3a23\x3a48\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m -SETUVAR _tide_prompt_2245:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x20\x2a1\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2012\x3a19\x3a15\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_2298:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2046s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2018\x3a23\x3a11\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_3025:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2022s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2009\x3a27\x3a15\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_3393:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2019s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2009\x3a45\x3a47\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_3985:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x20\x2a1\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x214\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x3f1\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2012\x3a07\x3a13\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_4222:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x20\x2a1\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x215\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x3f1\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2012\x3a08\x3a32\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_43033:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2020\x3a40\x3a38\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_48860:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x201\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2020\x3a16\x3a49\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_5064:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x204s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2017\x3a08\x3a48\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_5229:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x20\x2a2\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x2b2\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x2112\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x3f1\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x201\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2017\x3a50\x3a00\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_552:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b33m\x1b\x5b40m\x20\u2714\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2011\x3a53\x3a21\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m -SETUVAR _tide_prompt_5666:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x20\x2a1\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x203m\x2015s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a41\x3a05\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_571:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b33m\x1b\x5b40m\x20\u2714\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2011\x3a49\x3a52\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m -SETUVAR _tide_prompt_5715:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x20\x2a1\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x211\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2016\x3a21\x3a04\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m -SETUVAR _tide_prompt_5774:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x40\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m64f16a5\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x211\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2015\x3a58\x3a43\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_578:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b31m\x1b\x5b40m\x20\u2718\x201\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x20\uf252\x204m\x2040s\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2011\x3a39\x3a58\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m SETUVAR _tide_prompt_5971:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x205s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2021\x3a46\x3a35\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_6012:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x40\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m348a76c\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x212\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2017\x3a09\x3a30\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_60424:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2020\x3a17\x3a33\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_6415:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x201\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2010s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2021\x3a49\x3a45\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_65309:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2020m\x208s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2023\x3a26\x3a55\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_686:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b31m\x1b\x5b40m\x20\u2718\x20INT\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x20\uf252\x2024s\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2011\x3a52\x3a48\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m @@ -45,9 +45,10 @@ SETUVAR _tide_prompt_752:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5 SETUVAR _tide_prompt_768:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b33m\x1b\x5b40m\x20\u2714\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2009\x3a48\x3a19\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m SETUVAR _tide_prompt_774:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b33m\x1b\x5b40m\x20\u2714\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2008\x3a43\x3a41\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m SETUVAR _tide_prompt_79251:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x40\x1b\x5b38\x3b2\x3b95\x3b215\x3b0ma8b612c\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x213\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x3f2\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2023\x3a29\x3a19\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_826:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20255\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x206m\x2041s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2021\x3a06\x3a12\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_828:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmaster\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2012\x3a25\x3a03\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_851:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b31m\x1b\x5b40m\x20\u2718\x20127\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2018\x3a18\x3a20\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m SETUVAR _tide_prompt_9039:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2023\x3a40\x3a22\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m -SETUVAR _tide_prompt_91155:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2015\x3a53\x3a23\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_932:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b33m\x1b\x5b40m\x20\u2714\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2011\x3a31\x3a26\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m SETUVAR _tide_prompt_9469:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2017\x3a40\x3a18\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_964:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b31m\x1b\x5b40m\x20\u2718\x201\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2001\x3a34\x3a05\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m diff --git a/greetd/config.toml b/greetd/config.toml deleted file mode 100644 index 84173c4..0000000 --- a/greetd/config.toml +++ /dev/null @@ -1,16 +0,0 @@ -[terminal] -# The VT to run the greeter on. Can be "next", "current" or a number -# designating the VT. -vt = 1 - -# The default session, also known as the greeter. -[default_session] - -# `agreety` is the bundled agetty/login-lookalike. You can replace `/bin/sh` -# with whatever you want started, such as `sway`. -command = "agreety --cmd /usr/bin/sway" - -# The user to run the command as. The privileges this user must have depends -# on the greeter. A graphical greeter may for example require the user to be -# in the `video` group. -user = "greeter" diff --git a/restore.sh b/restore.sh index e9b013b..e6cbe04 100755 --- a/restore.sh +++ b/restore.sh @@ -29,7 +29,8 @@ cp -r $GIT_DIR/VencordDesktop/* $HOME/.config/VencordDesktop/VencordDesktop/ mkdir -p $HOME/.config/Code/User/ cp $GIT_DIR/vscode/keybindings.json $HOME/.config/Code/User/ cp $GIT_DIR/vscode/settings.json $HOME/.config/Code/User/ -#for ext in $(cat $GIT_DIR/vscode/extensions.txt); do code --install-extension $ext; done +for ext in $(cat $GIT_DIR/vscode/extensions.txt); do code --install-extension $ext; done +cp $GIT_DIR/vscode/argv.json $HOME/.vscode/argv.json # i3 rm -rf $HOME/.config/i3 diff --git a/sway/config.d/touchpad b/sway/config.d/touchpad deleted file mode 100644 index 821ef07..0000000 --- a/sway/config.d/touchpad +++ /dev/null @@ -1,4 +0,0 @@ -input * { - tap enabled - #natural_scroll enabled -} diff --git a/vscode/argv.json b/vscode/argv.json new file mode 100644 index 0000000..1306861 --- /dev/null +++ b/vscode/argv.json @@ -0,0 +1,21 @@ +// This configuration file allows you to pass permanent command line arguments to VS Code. +// Only a subset of arguments is currently supported to reduce the likelihood of breaking +// the installation. +// +// PLEASE DO NOT CHANGE WITHOUT UNDERSTANDING THE IMPACT +// +// NOTE: Changing this file requires a restart of VS Code. +{ + // Use software rendering instead of hardware accelerated rendering. + // This can help in cases where you see rendering issues in VS Code. + // "disable-hardware-acceleration": true, + + // Allows to disable crash reporting. + // Should restart the app if the value is changed. + "enable-crash-reporter": false, + + // Unique id used for correlating crash reports sent from this instance. + // Do not edit this value. + "crash-reporter-id": "9832aa9b-1f8c-4c44-809c-8823b139ad90", + "password-store":"gnome" +} \ No newline at end of file