discord-awesomeaudio/assets/vencord/vencord.js

37 lines
60 KiB
JavaScript
Raw Normal View History

2022-10-14 17:16:34 -04:00
"use strict";var Vencord=(()=>{var Do=Object.create;var Fe=Object.defineProperty;var No=Object.getOwnPropertyDescriptor;var Fo=Object.getOwnPropertyNames;var Lo=Object.getPrototypeOf,Uo=Object.prototype.hasOwnProperty;var Oo=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var l=(e,t)=>()=>(e&&(t=e(e=0)),t);var I=(e,t)=>{for(var n in t)Fe(e,n,{get:t[n],enumerable:!0})},Kn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Fo(t))!Uo.call(e,o)&&o!==n&&Fe(e,o,{get:()=>t[o],enumerable:!(r=No(t,o))||r.enumerable});return e};var $o=(e,t,n)=>(n=e!=null?Do(Lo(e)):{},Kn(t||!e||!e.__esModule?Fe(n,"default",{value:e,enumerable:!0}):n,e)),Vo=e=>Kn(Fe({},"__esModule",{value:!0}),e);function s(e){return e}var m=l(()=>{"use strict"});var Ze={};I(Ze,{Devs:()=>a,REACT_GLOBAL:()=>Go,WEBPACK_CHUNK:()=>z});var z,Go,a,u=l(()=>{"use strict";z="webpackChunkdiscord_app",Go="Vencord.Webpack.Common.React",a=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}})});var et,Qn=l(()=>{"use strict";m();u();et=s({name:"STFU",description:"Disables the 'HOLD UP' banner in the console",authors:[a.Ven],patches:[{find:"setDevtoolsCallbacks",replacement:{match:/if\(.{0,10}\|\|"0.0.0"!==.{0,2}\.remoteApp\.getVersion\(\)\)/,replace:"if(false)"}}]})});var tt,Yn=l(()=>{"use strict";m();u();tt=s({name:"CommandsAPI",authors:[a.Arjix],description:"Api required by anything that uses commands",patches:[{find:'"giphy","tenor"',replacement:[{match:/(?<=\w=)(\w)(\.filter\(.{0,30}giphy)/,replace:"Vencord.Api.Commands._init($1)$2"}]},{find:"Unexpected value for option",replacement:{match:/,(.{1,2})\.execute\((.{1,2}),(.{1,2})\)]/,replace:(e,t,n,r)=>`,Vencord.Api.Commands._handleCommand(${t}, ${n}, ${r})]`}}]})});var nt,Jn=l(()=>{"use strict";u();m();nt=s({name:"MessageEventsAPI",description:"Api required by anything using message events.",authors:[a.Arjix],patches:[{find:"sendMessage:function",replacement:[{match:/(?<=_sendMessage:function\([^)]+\)){/,replace:"{Vencord.Api.MessageEvents._handlePreSend(...arguments);"},{match:/(?<=\beditMessage:function\([^)]+\)){/,replace:"{Vencord.Api.MessageEvents._handlePreEdit(...arguments);"}]},{find:"if(e.altKey){",replacement:{match:/var \w=(\w)\.id,\w=(\w)\.id;return .{1,2}\.useCallback\(\(?function\((.{1,2})\){/,replace:(e,t,n,r)=>`var _msg=${t},_chan=${n};${e}Vencord.Api.MessageEvents._handleClick(_msg, _chan, ${r});`}}]})});var rt,Xn=l(()=>{"use strict";u();m();rt=s({name:"ApiNotices",description:"Fixes notices being automatically dismissed",authors:[a.Ven],required:!0,patches:[{find:"updateNotice:",replacement:[{match:/;(.{1,2}=null;)(?=.{0,50}updateNotice)/g,replace:";if(Vencord.Api.Notices.currentNotice)return !1;$1"},{match:/(?<=NOTICE_DISMISS:function.+?){(?=if\(null==(.+?)\))/,replace:'{if($1?.id=="VencordNotice")return ($1=null,Vencord.Api.Notices.nextNotice(),true);'}]}]})});var ot,Zn=l(()=>{"use strict";m();u();ot=s({name:"BANger",description:"Replaces the GIF in the ban dialogue with a custom one.",authors:[{name:"Xinto",id:423915768191647755n},a.Glitch],patches:[{find:"BAN_CONFIRM_TITLE.",replacement:{match:/src:\w\(\d+\)/g,replace:'src: "https://i.imgur.com/wp5q52C.mp4"'}}]})});var it,er=l(()=>{"use strict";u();m();it=s({name:"BetterGifAltText",authors:[a.Ven],description:"Change GIF alt text from simply being 'GIF' to containing the gif tags / filename",patches:[{find:"onCloseImage=",replacement:
`,r)}}:function(){try{t.apply(n??this,arguments)}catch(r){console.error(`Caught an Error in ${e||"anonymous"}
`,r)}}}function Ct(e,t){let n="```";return`${n}${t||""}
${e}
${n}`}var Zo,N=l(()=>{"use strict";F();v();$e();Zo=H});function Se(e){let t=H(e);return new Proxy(ni,{get:(n,r)=>t()[r],set:(n,r,o)=>t()[r]=o,has:(n,r)=>r in t(),apply:(n,r,o)=>t().apply(r,o),ownKeys:()=>Reflect.ownKeys(t()),construct:(n,r)=>Reflect.construct(t(),r),deleteProperty:(n,r)=>delete t()[r],defineProperty:(n,r,o)=>!!Object.defineProperty(t(),r,o),getPrototypeOf:()=>Object.getPrototypeOf(t())})}var ni,$e=l(()=>{"use strict";N();ni=function(){}});function Et(e){if(ne!==void 0)throw"no.";J=e.push([[Symbol()],{},t=>t]),ne=J.c,e.pop()}function B(e,t=!0){if(typeof e!="function")throw new Error("Invalid filter. Expected a function got "+typeof e);for(let n in ne){let r=ne[n];if(!!r?.exports){if(e(r.exports))return r.exports;if(typeof r.exports=="object"){if(r.exports.default&&e(r.exports.default))return t?r.exports.default:r.exports;for(let o in r.exports)if(o.length<=3){let i=r.exports[o];if(i&&e(i))return i}}}}return null}function ar(e,t=!0){if(typeof e!="function")throw new Error("Invalid filter. Expected a function got "+typeof e);let n=[];for(let r in ne){let o=ne[r];if(!!o?.exports){if(e(o.exports))n.push(o.exports);else if(typeof o.exports!="object")continue;if(o.exports.default&&e(o.exports.default))n.push(t?o.exports.default:o.exports);else for(let i in o.exports)if(i.length<=3){let d=o.exports[i];d&&e(d)&&n.push(d)}}}return n}function cr(e,t){let n={};for(let r in J.m)if(J.m[r].toString().includes(e)){let i=J(r);e:for(let d in i){let c=i[d];for(let f in t)if(t[f](c)){n[f]=c;continue e}}break}return n}function bt(e,t){return Se(()=>cr(e,t))}function re(...e){return B(y.byProps(e))}function Ko(...e){return ar(y.byProps(e))}function qo(e){return B(y.byDisplayName(e))}function b(e,t){if(typeof e=="string")e=y.byProps([e]);else if(Array.isArray(e))e=y.byProps(e);else if(typeof e!="function")throw new Error("filter must be a string, string[] or function, got "+typeof e);let n=B(e);if(n)return void t(n);sr.set(e,t)}function Qo(e){yt.add(e)}function Yo(e){yt.delete(e)}function Jo(...e){let t={},n=J.m;e:for(let r in n){let o=n[r].original??n[r],i=o.toString();for(let d of e)if(typeof d=="string"&&!i.includes(d)||d instanceof RegExp&&!d.test(i))continue e;t[r]=o}return t}function Xo(e){let t=J.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!!
${t.toString()}
//# sourceURL=ExtractedWebpackModule${e}
`;return(0,eval)(n)}var Ue,ht,J,ne,y,sr,yt,Oe=l(()=>{"use strict";$e();ht=new Promise(e=>Ue=e),y={byProps:e=>e.length===1?t=>t[e[0]]!==void 0:t=>e.every(n=>t[n]!==void 0),byDisplayName:e=>t=>t.default?.displayName===e,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}},sr=new Map,yt=new Set});var xt={};I(xt,{Alerts:()=>se,Button:()=>D,Card:()=>me,ChannelStore:()=>pe,FluxDispatcher:()=>C,Forms:()=>_,GuildStore:()=>Ve,Margins:()=>U,Parser:()=>ue,React:()=>x,Router:()=>Be,SelectedChannelStore:()=>V,Switch:()=>ie,Toasts:()=>w,Tooltip:()=>lr,UserStore:()=>K});var U,C,x,Ve,K,V,pe,_,me,D,ie,lr,Be,ue,se,ri,oi,w,v=l(()=>{"use strict";Oe();N();U=R(y.byProps(["marginTop20"])),_={},ri={MESSAGE:0,SUCCESS:1,FAILURE:2,CUSTOM:3},oi={TOP:0,BOTTOM:1},w={Type:ri,Position:oi,genId:()=>(Math.random()||Math.random()).toString(36).slice(2)};b("useState",e=>x=e);b(["dispatch","subscribe"],e=>{C=e;let t=()=>{e.unsubscribe("CONNECTION_OPEN",t),Ue()};e.subscribe("CONNECTION_OPEN",t)});b(["getCurrentUser","initialize"],e=>K=e);b("getSortedPrivateChannels",e=>pe=e);b("getCurrentlySelectedChannelId",e=>V=e);b("getGuildCount",e=>Ve=e);b(["Hovers","Looks","Sizes"],e=>D=e);b(y.byCode("helpdeskArticleId"),e=>ie=e);b(["Positions","Colors"],e=>lr=e);b(e=>e.Types?.PRIMARY==="cardPrimary",e=>me=e);b(e=>e.Tags&&y.byCode("errorSeparator")(e),e=>_.FormTitle=e);b(e=>e.Tags&&y.byCode("titleClassName","sectionTitle")(e),e=>_.FormSection=e);b(e=>e.Types?.INPUT_PLACEHOLDER,e=>_.FormText=e);b(e=>{if(typeof e!="function")return!1;let t=e.toString();return t.length<200&&t.includes("divider")},e=>_.FormDivider=e);b(y.byCode("currentToast?"),e=>w.show=e);b(y.byCode("currentToast:null"),e=>w.pop=e);b(["show","close"],e=>se=e);b("parseTopic",e=>ue=e);b(["open","saveAccountChanges"],e=>Be=e)});var wt,dr=l(()=>{"use strict";u();m();v();wt=s({name:"ClickableRoleDot",authors:[a.Ven],description:"Makes RoleDots (Accessibility Feature) copy colour to clipboard on click",patches:[{find:"M0 4C0 1.79086 1.79086 0 4 0H16C18.2091 0 20 1.79086 20 4V16C20 18.2091 18.2091 20 16 20H4C1.79086 20 0 18.2091 0 16V4Z",replacement:{match:/(viewBox:"0 0 20 20")/,replace:"$1,onClick:()=>Vencord.Plugins.plugins.ClickableRoleDot.copyToClipBoard(e.color)"}}],copyToClipBoard(e){window.DiscordNative.clipboard.copy(e),w.show({message:"Copied to Clipboard!",type:w.Type.SUCCESS,id:w.genId(),options:{duration:1e3,position:w.Position.BOTTOM}})}})});var Pt,Tt,pr=l(()=>{"use strict";u();m();Pt=e=>()=>{throw new Error(`'${e}' is Discord Desktop only.`)},Tt=s({name:"ConsoleShortcuts",description:"Adds shorter Aliases for many things on the window. Run `shortcutList` for a list.",authors:[a.Ven],getShortcuts(){return{toClip:IS_WEB?Pt("toClip"):window.DiscordNative.clipboard.copy,fromClip:IS_WEB?Pt("fromClip"):window.DiscordNative.clipboard.read,wp:Vencord.Webpack,wpc:Vencord.Webpack.wreq.c,wreq:Vencord.Webpack.wreq,wpsearch:Vencord.Webpack.search,wpex:Vencord.Webpack.extract,findByProps:Vencord.Webpack.findByProps,find:Vencord.Webpack.find,Plugins:Vencord.Plugins,React:Vencord.Webpack.Common.React,Settings:Vencord.Settings,Api:Vencord.Api,reload:()=>location.reload(),restart:IS_WEB?Pt("restart"):window.DiscordNative.app.relaunch}},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 vt,mr=l(()=>{"use strict";m();vt=s({name:"discord-screenaudio",authors:[{name:"maltejur",id:205966226709676032n}],required:!0,description:"UI patches for discord-screenaudio.",patches:[]})});var Rt,ur=l(()=>{"use strict";u();m();Rt=s({name:"Experiments",authors:[a.Ven,a.Megu],description:"Enable Experiments",patches:[{find:"Object.defineProperties(this,{isDeveloper",replacement:{match:/(?<={isDeveloper:\{[^}]+,get:function\(\)\{return )\w/,replace:"true"}},{find:'type:"user",revision',replacement:{match:/(\w)\|\|"CONNECTION_OPEN".+?;/g,replace:"$1=!0;"}}]})});function Mt(){return`-${fr.fromTimestam
${Ct(d)}`,author:{username:"Vencord"}})};try{let o=e.execute(t,n);return o instanceof Promise?o.catch(r):o}catch(o){return r(o)}}});var Er,Ut,br=l(()=>{"use strict";ae();u();m();Er={fart:new Audio("https://raw.githubusercontent.com/ItzOnlyAnimal/AliuPlugins/main/fart.mp3")},Ut=s({name:"Fart2",authors:[a.Animal],description:"Enable farting v2, a slash command that allows you to perform or request that someone perform a little toot.",dependencies:["CommandsAPI"],commands:[{name:"fart",description:"A simple command in which you may either request that a user do a little toot for you, or conduct one yourself.",options:[{type:6,name:"user",description:"A Discord\u2122 user of which you would humbly request a toot from.",required:!1}],execute(e){return Er.fart.volume=.3,Er.fart.play(),{content:e[0]?`<@${e[0].value}> fart`:"fart"}}}]})});var li,Ot,xr=l(()=>{"use strict";m();Y();u();li=/https?:\/\/twitter\.com(?=\/\w+?\/status\/)/g,Ot=s({name:"FxTwitter",description:"Uses FxTwitter to improve embeds from twitter on send",authors:[a.Samu],dependencies:["MessageEventsAPI"],addPrefix(e){e.content=e.content.replace(li,"https://fxtwitter.com")},start(){this.preSend=O((e,t)=>this.addPrefix(t))},stop(){$(this.preSend)}})});var $t,_r=l(()=>{"use strict";u();m();$t=s({name:"iLoveSpam",description:"Do not hide messages from 'likely spammers'",authors:[a.botato,a.Animal],patches:[{find:"),{hasFlag:",replacement:{match:/(if\((.{1,2})<=1<<30\)return)/,replace:"if($2===(1<<20)){return false};$1"}}]})});var Vt,Sr=l(()=>{"use strict";u();m();Vt=s({name:"Ify",description:"Disables Spotify auto-pausing and Premium checks, allowing you to listen along with others.",authors:[a.Cyn],patches:[{find:'.displayName="SpotifyStore"',replacement:[{match:/\.isPremium=.;/,replace:".isPremium=true;"},{match:/function (.{1,2})\(\).{0,200}SPOTIFY_AUTO_PAUSED\);.{0,}}}}/,replace:"function $1(){}"}]}]})});function Mr(e,t){let n=e.findIndex(r=>r.id===t);return n===-1?n:e.length-n-1}function Pr({channelId:e,messageId:t,_isQuickEdit:n}){if(n)return;let r=K.getCurrentUser().id,o=Bt.getMessages(e)._array.filter(i=>i.author.id===r);We=Mr(o,t)}function Tr({message:e,_isQuickReply:t}){t||(je=Mr(Bt.getMessages(e.channel_id)._array,e.id))}function vr(e){let t=e.key==="ArrowUp";!t&&e.key!=="ArrowDown"||!di(e)||pi(e)||(e.shiftKey?ui(t):mi(t))}function kr(e,t){let n=Bt.getMessages(V.getChannelId())._array;if(!t){let i=K.getCurrentUser().id;n=n.filter(d=>d.author.id===i)}let r=i=>e?Math.min(n.length-1,i+1):Math.max(-1,i-1),o;return t?je=o=r(je):We=o=r(We),o===-1?void 0:n[n.length-o-1]}function mi(e){let t=kr(e,!0);if(!t)return void C.dispatch({type:"DELETE_PENDING_REPLY",channelId:V.getChannelId()});let n=pe.getChannel(t.channel_id);C.dispatch({type:"CREATE_PENDING_REPLY",channel:n,message:t,shouldMention:!0,showMentionToggle:n.guild_id!==null,_isQuickReply:!0})}function ui(e){let t=kr(e,!1);t?C.dispatch({type:"MESSAGE_START_EDIT",channelId:t.channel_id,messageId:t.id,content:t.content,_isQuickEdit:!0}):C.dispatch({type:"MESSAGE_END_EDIT",channelId:V.getChannelId()})}var Bt,Rr,je,We,Gt,Cr,wr,di,pi,Ir=l(()=>{"use strict";m();u();v();F();N();Bt=R(y.byProps(["getRawMessages"])),Rr=navigator.platform.includes("Mac"),je=-1,We=-1,Gt=s({name:"InteractionKeybinds",authors:[a.obscurity,a.Ven],description:"Reply to (ctrl + up/down) and edit (ctrl + shift + up/down) messages via keybinds",start(){C.subscribe("DELETE_PENDING_REPLY",Cr),C.subscribe("MESSAGE_END_EDIT",wr),C.subscribe("MESSAGE_START_EDIT",Pr),C.subscribe("CREATE_PENDING_REPLY",Tr),document.addEventListener("keydown",vr)},stop(){C.unsubscribe("DELETE_PENDING_REPLY",Cr),C.unsubscribe("MESSAGE_END_EDIT",wr),C.unsubscribe("MESSAGE_START_EDIT",Pr),C.unsubscribe("CREATE_PENDING_REPLY",Tr),document.removeEventListener("keydown",vr)}}),Cr=()=>je=-1,wr=()=>We=-1;di=e=>Rr?e.metaKey:e.ctrlKey,pi=e=>e.altKey||!Rr&&e.metaKey});var jt,Ar=l(()=>{"use strict";u();m();jt=s({name:"isStaff",description:"Gives access to client devtools & other things locked behind isStaff",authors:[a.Megu,{name:"Nickyux",id:427146305651998721n},{name:"BanTheNo
`,i),"Failed to fetch user. Check the console for more info."}}return null}var Qr,xi,_i,ze,Si,Ci,wi,Pi,Ti,on,Jr=l(()=>{"use strict";ae();u();m();N();F();Qr=0,xi=20,_i=128,ze=10,Si=H(()=>import("https://unpkg.com/gifenc@1.0.3/dist/gifenc.esm.js")),Ci=H(()=>Promise.all(Array.from({length:ze},(e,t)=>Yr(`https://raw.githubusercontent.com/VenPlugs/petpet/main/frames/pet${t}.gif`)))),wi=R(y.byCode(".USER(")),Pi=R(y.byCode("UPLOAD_FILE_LIMIT_ERROR")),Ti=R(y.byProps(["getUploads"]));on=s({name:"petpet",description:"headpet a cutie",authors:[a.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{GIFEncoder:n,quantize:r,applyPalette:o}=await Si(),i=await Ci(),d=G(e,"no-server-pfp",!1);try{var c=await vi(e,t,d);if(!c)throw"No Image specified!"}catch(T){console.log(T);return}let f=await Yr(c),E=G(e,"delay",xi),h=G(e,"resolution",_i),p=new n,g=document.createElement("canvas");g.width=g.height=h;let S=g.getContext("2d");for(let T=0;T<ze;T++){S.clearRect(0,0,g.width,g.height);let k=T<ze/2?T:ze-T,jn=.8+k*.02,Wn=.8-k*.05,ko=(1-jn)*.5+.1,Io=1-Wn-.08;S.drawImage(f,ko*h,Io*h,jn*h,Wn*h),S.drawImage(i[T],0,0,h,h);let{data:zn}=S.getImageData(0,0,h,h),Hn=r(zn,256),Ao=o(zn,Hn);p.writeFrame(Ao,h,h,{transparent:!0,palette:Hn,delay:E})}p.finish();let M=new File([p.bytesView()],"petpet.gif",{type:"image/gif"});setImmediate(()=>Pi([M],t.channel,Qr))}}]})});var sn,Xr=l(()=>{"use strict";u();m();sn=s({name:"PlainFolderIcon",description:"Doesn't show the small guild icons in folders",authors:[a.botato],patches:[{find:"().expandedFolderIconWrapper",replacement:[{match:/\(\w\|\|\w\)(&&\(\w=\w\.createElement\(\w+\.animated)/,replace:"true$1"}]}]})});var an,Zr=l(()=>{"use strict";m();u();an=s({name:"RandomiseFileNames",authors:[a.obscurity],description:"Randomise uploaded file names",patches:[{find:"instantBatchUpload:function",replacement:{match:/uploadFiles:(.{1,2}),/,replace:"uploadFiles:(...args)=>(args[0].uploads.forEach(f=>f.filename=Vencord.Plugins.plugins.RandomiseFileNames.rand(f.filename)),$1(...args)),"}}],rand(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";return Array.from({length:7},()=>t[Math.floor(Math.random()*t.length)]).join("")+(e.lastIndexOf(".")>-1?e.slice(e.lastIndexOf(".")):"")}})});var he,He=l(()=>{he="0d99663"});var cn,eo=l(()=>{"use strict";m();He();u();cn=s({name:"Settings",description:"Adds Settings UI and debug info",authors:[a.Ven],required:!0,patches:[{find:"().versionHash",replacement:[{match:/\w\.createElement\(.{1,2}.Fragment,.{0,30}\{[^}]+\},"Host ".+?\):null/,replace:e=>{let t=e.indexOf("Host")-1,n=e.slice(0,t),r=`${e}, ${n}"Vencord ", "${he}${IS_WEB?" (Web)":""}"), " ")`;return IS_WEB||(r+=`,${n} "Electron ",VencordNative.getVersions().electron)," "),`,r+=`${n} "Chrome ",VencordNative.getVersions().chrome)," ")`),r}}]},{find:"Messages.ACTIVITY_SETTINGS",replacement:{match:/\{section:(.{1,2})\.ID\.HEADER,\s*label:(.{1,2})\..{1,2}\.Messages\.ACTIVITY_SETTINGS\}/,replace:(e,t)=>`{section:${t}.ID.HEADER,label:"Vencord"},{section:"VencordSetting",label:"Vencord",element:Vencord.Components.Settings},{section:"VencordUpdater",label:"Updater",element:Vencord.Components.Updater,predicate:()=>!IS_WEB},{section:${t}.ID.DIVIDER},${e}`}}]})});var ln,to=l(()=>{"use strict";m();u();ln=s({name:"SilentTyping",authors:[a.Ven],description:"Hide that you are typing",patches:[{find:"startTyping:",replacement:{match:/startTyping:.+?,stop/,
`);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=O((e,t)=>this.unindentMsg(t)),this.preEdit=ee((e,t,n)=>this.unindentMsg(n))},stop(){$(this.preSend),te(this.preEdit)}})});var pn,Ri,mn,ro=l(()=>{"use strict";m();u();Ri="https://raw.githubusercontent.com/facebook/react/17.0.2/scripts/error-codes/codes.json",mn=s({name:"ReactErrorDecoder",description:'Replaces "Minifed React Error" with the actual error.',authors:[a.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;.<arguments\.length;.\+\+\).\+="&args\[\]="\+encodeURIComponent\(arguments\[.\]\);return"Minified React error #"\+.\+"; visit "\+.\+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.")}/,replace:(e,t,n)=>`${t}{var decoded=Vencord.Plugins.plugins.ReactErrorDecoder.decodeError.apply(null, arguments);if(decoded)return decoded;${n}}`}}],async start(){pn=await fetch(Ri).then(e=>e.json()).catch(e=>console.error(`[ReactErrorDecoder] Failed to fetch React error codes
`,e))},stop(){pn=void 0},decodeError(e,...t){let n=0;return pn?.[e]?.replace(/%s/g,()=>{let r=t[n];return n++,r})}})});function ki(e){return e.split(" ").map(t=>{let n=!1,r=t.toLowerCase();if(t.length<4)return t;for(let[o,i]of Mi)t.includes(o)&&(t=t.replace(o,i),n=!0);return r.includes("u")&&!r.includes("uwu")&&(t=t.replace("u","UwU"),n=!0),r.includes("o")&&!r.includes("owo")&&(t=t.replace("o","OwO"),n=!0),r.endsWith("y")&&t.length<7&&(t=t+" w"+t.slice(1),n=!0),n||(r.endsWith("n")||(t=t.replace("n","ny")),Math.floor(Math.random()*2)===1&&t.replace("s","sh"),Math.floor(Math.random()*5)===3&&!n&&(t=t[0]+"-"+t[0]+"-"+t),Math.floor(Math.random()*5)===3&&(t=t+" "+oo[Math.floor(Math.random()*oo.length)]),t=t.replaceAll("r","w").replaceAll("l","w")),t}).join(" ")}var oo,Mi,un,io=l(()=>{"use strict";m();ae();oo=["owo","UwU",">w<","^w^","\u25CFw\u25CF","\u2606w\u2606","\u{1D5E8}\u{1D604}\u{1D5E8}","(\u15D2\u15E8\u15D5)","(\u25B0\u02D8v\u02D8\u25B0)","( \xB4 \u25BD ` ).\uFF61\uFF4F\u2661","*unbuttons shirt*",">3<",">:3",":3","murr~","\u2665(\u3002U \u03C9 U\u3002)","(\u02D8\u03B5\u02D8)","*screams*","*twerks*","*sweats*"],Mi=[["love","wuv"],["mr","mistuh"],["dog","doggo"],["cat","kitteh"],["hello","henwo"],["hell","heck"],["fuck","fwick"],["fuk","fwick"],["shit","shoot"],["friend","fwend"],["stop","stawp"],["god","gosh"],["dick","peepee"],["penis","bulge"],["damn","darn"]];un=s({name:"UwUifier",description:"Simply uwuify commands",authors:[{name:"ECHO",id:712639419785412668n}],dependencies:["CommandsAPI"],commands:[{name:"uwuify",description:"uwuifies your messages",options:[Pe],execute:e=>({content:ki(G(e,"message",""))})}]})});var hn={};I(hn,{ModalSize:()=>fn,closeModal:()=>Di,openModal:()=>gn});function gn(e,t){let n=`Vencord${Ai++}`;return so.openModal(r=>Vencord.Webpack.Common.React.createElement(Ii,{...r,...t},Vencord.Webpack.Common.React.createElement(e,null)),{modalKey:n}),n}function Di(e){so.closeModal(e)}var Ii,so,Ai,fn,yn=l(()=>{"use strict";F();N();Oe();Ii=R(y.byCode("headerIdIsManaged:")),so=bt("onCloseRequest:null!=",{openModal:y.byCode("onCloseRequest:null!="),closeModal:y.byCode("onCloseCallback&&")}),Ai=1337,fn=(o=>(o.SMALL="small",o.MEDIUM="medium",o.LARGE="large",o.DYNAMIC="dynamic",o))(fn||{})});var Ni,Fi,Ke,En,ao=l(()=>{"use strict";u();m();N();yn();F();v();Ni=R(e=>e.prototype?.render?.toString().includes("OPEN_ORIGINAL_IMAGE")),Fi=H(()=>B(e=>e.type?.toString().includes("MASKED_LINK)"))),Ke="Vencord.Plugins.plugins.ViewIcons.openImage(",En=s({name:"ViewIcons",authors:[a.Ven],description:"Makes Avatars/Banners in user profiles clickable, and adds Guild Context Menu Entries to View Banner/Icon.",openImage(e){gn(()=>Vencord.Webpack.Common.React.createElement(Ni,{shouldAnimate:!0,original:e,src:e,renderLinkComponent:t=>x.createElement(Fi(),t)}),{size:"dynamic"})},patches:[{find:"onAddFriend:",replacement:{match:/\{src:(.{1,2}),avatarDecoration/,replace:(e,t)=>`{src:${t},onClick:()=>${Ke}${t}.replace(/\\?.+$/, "")+"?size=2048"),avatarDecoration`}},{find:"().popoutNoBannerPremium",replacement:{match:/style:.{0,10}\{\},(.{1,2})\)/,replace:(e,t)=>`onClick:${t}.backgroundImage&&(()=>${Ke}${t}.backgroundImage.replace("url(", "").replace(/(\\?size=.+)?\\)/, "?size=2048"))),${e}`}},{find:'"GuildContextMenu:',replacement:[{match:/\w=(\w)\.id/,replace:(e,t)=>`_guild=${t},${e}`},{match:/(?<=createElement\((.{1,5}),\{id:"leave-guild".{0,100}\,)(.{1,2}\.createElement)\((.{1,5}),null,(.{1,2})\)(?=\)\}function)/,replace:(e,t,n,r,o)=>`${n}(${r},null,[_guild.icon&&${n}(${t},{id:"viewicons-copy-icon",label:"View Icon",action:()=>${Ke}_guild.getIconURL(void 0,true)+"size=2048")}),_guild.banner&&${n}(${t},{id:"viewicons-copy-banner",label:"View Banner",action:()=>${Ke}Vencord.Webpack.findByProps("getGuildBannerURL").getGuildBannerURL(_guild).replace(/\\?size=.+/, "?size=2048"))}),${o}])`}]}]})});var bn,co=l(()=>{"use strict";m();u();bn=s({name:"Webhook Tags",description:"Changes the bot tag to say webhook for webhooks",authors:[a.Cyn],patches:[{find:'.BOT=0]="BOT"',replacement:[{match:/(.)\[.\.BOT=0\]="BOT";/,replace:(e,t)=>`${t}[${
`,t),!1}}if(e.commands?.length){j.info("Registering commands of plugin",e.name);for(let t of e.commands)try{Nt(t,e.name)}catch(n){return j.error(`Failed to register command ${t.name}
`,n),!1}}return!0}function _n(e){if(e.stop){if(j.info("Stopping plugin",e.name),!e.started)return j.warn(`${e.name} already stopped`),!1;try{e.stop(),e.started=!1}catch(t){return j.error(`Failed to stop ${e.name}
`,t),!1}}if(e.commands?.length){j.info("Unregistering commands of plugin",e.name);for(let t of e.commands)try{Ft(t.name)}catch(n){return j.error(`Failed to unregister command ${t.name}
`,n),!1}}return!0}var j,Ui,fo,Me=l(()=>{"use strict";qe();ae();ve();Z();j=new A("PluginManager","#a6d189"),Ui=L,fo=[];for(let e of Object.values(L))if(e.patches&&q.plugins[e.name].enabled)for(let t of e.patches)t.plugin=e.name,Array.isArray(t.replacement)||(t.replacement=[t.replacement]),fo.push(t)});var An={};I(An,{UpdateLogger:()=>be,changes:()=>X,checkForUpdates:()=>Ae,getRepo:()=>kn,isNewer:()=>Ye,isOutdated:()=>Ie,rebuild:()=>In,update:()=>Mn,updateError:()=>xe});async function Ee(e){let t=await e;if(t.ok)return t.value;throw xe=t.error,t.error}async function Ae(){return X=await Ee(VencordNative.ipc.invoke(P.GET_UPDATES)),X.some(e=>e.hash===he)?(Ye=!0,Ie=!1):Ie=X.length>0}async function Mn(){if(!Ie)return!0;let e=await Ee(VencordNative.ipc.invoke(P.UPDATE));return e&&(Ie=!1),e}function kn(){return Ee(VencordNative.ipc.invoke(P.GET_REPO))}async function In(){let e=await Ee(VencordNative.ipc.invoke(P.GET_HASHES));if(!await Ee(VencordNative.ipc.invoke(P.BUILD)))throw new Error("The Build failed. Please try manually building the new update");let t=await Ee(VencordNative.ipc.invoke(P.GET_HASHES));return e["patcher.js"]!==t["patcher.js"]||e["preload.js"]!==t["preload.js"]}var be,Ie,Ye,xe,X,Je=l(()=>{"use strict";ye();Z();He();be=new A("Updater","white"),Ie=!1,Ye=!1});var De,Fn=l(()=>{"use strict";De=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)}getChanges(){return this.set.values()}map(t){return[...this.getChanges()].map(t)}}});function Ne(e){return Vencord.Webpack.Common.React.createElement(me,{className:e.className,style:{padding:"2em",backgroundColor:"#e7828430",borderColor:"#e78284",color:"var(--text-normal)",...e.style}},e.children)}var On=l(()=>{"use strict";v()});var Bi,Eo,bo,Q,$n=l(()=>{"use strict";Z();v();On();Bi="#e78284",Eo=new A("React ErrorBoundary",Bi),bo={},Q=class extends x.Component{static wrap(t){return n=>Vencord.Webpack.Common.React.createElement(Q,null,Vencord.Webpack.Common.React.createElement(t,{...n}))}state={error:bo,stack:"",message:""};static getDerivedStateFromError(t){let n=t?.stack??"",r=t?.message||String(t);if(t instanceof Error&&n){let o=n.indexOf(`
`);o!==-1&&(r=n.slice(0,o),n=n.slice(o+1).replace(/https:\/\/\S+\/assets\//g,""))}return{error:t,stack:n,message:r}}componentDidCatch(t,n){this.props.onError?.(t,n),Eo.error(`A component threw an Error
`,t),Eo.error("Component Stack",n.componentStack)}render(){return this.state.error===bo?this.props.children:this.props.fallback?Vencord.Webpack.Common.React.createElement(this.props.fallback,{children:this.props.children,...this.state}):Vencord.Webpack.Common.React.createElement(Ne,{style:{overflow:"hidden"}},Vencord.Webpack.Common.React.createElement("h1",null,"Oh no!"),Vencord.Webpack.Common.React.createElement("p",null,"An error occurred while rendering this Component. More info can be found below and in your console."),Vencord.Webpack.Common.React.createElement("code",null,this.state.message,!!this.state.stack&&Vencord.Webpack.Common.React.createElement("pre",{className:U.marginTop8},this.state.stack)))}}});function Xe(e){return e.style??={},e.style.flexDirection||=e.flexDirection,e.style.gap??="1em",e.style.display="flex",Vencord.Webpack.Common.React.createElement("div",{...e},e.children)}var Vn=l(()=>{"use strict"});function Bn(e){w.show({message:e,type:w.Type.FAILURE,id:w.genId(),options:{position:w.Position.BOTTOM}})}var xo,_o=l(()=>{"use strict";N();qe();ve();ye();v();$n();Me();Me();Vn();Fn();xo=Q.wrap(function(){let[t,,n]=_e(()=>VencordNative.ipc.invoke(P.GET_SETTINGS_DIR),"Loading..."),r=mo(),o=x.useMemo(()=>new De,[]);x.useEffect(()=>()=>void(o.hasChanges&&se.show({title:"Restart required",body:Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,Vencord.Webpack.Common.React.createElement("p",null,"The following plugins require a restart:"),Vencord.Webpack.Common.React.createElement("div",null,o.map((c,f)=>Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,f>0&&", ",ue.parse("`"+c+"`"))))),confirmText:"Restart now",cancelText:"Later!",onConfirm:()=>location.reload()})),[]);let i=x.useMemo(()=>{let c={};for(let f in L){let E=L[f].dependencies;if(E)for(let h of E)c[h]??=[],c[h].push(f)}return c},[]),d=x.useMemo(()=>Object.values(L).sort((c,f)=>c.name.localeCompare(f.name)),[]);return Vencord.Webpack.Common.React.createElement(_.FormSection,{tag:"h1",title:"Vencord"},Vencord.Webpack.Common.React.createElement(_.FormTitle,{tag:"h5"},"Settings"),Vencord.Webpack.Common.React.createElement(_.FormText,null,"SettingsDir: ",Vencord.Webpack.Common.React.createElement("code",{style:{userSelect:"text",cursor:"text"}},t)),!IS_WEB&&Vencord.Webpack.Common.React.createElement(Xe,{className:de(U.marginBottom20)},Vencord.Webpack.Common.React.createElement(D,{onClick:()=>window.DiscordNative.app.relaunch(),size:D.Sizes.SMALL,color:D.Colors.GREEN},"Reload"),Vencord.Webpack.Common.React.createElement(D,{onClick:()=>window.DiscordNative.fileManager.showItemInFolder(t),size:D.Sizes.SMALL,disabled:n},"Launch Directory"),Vencord.Webpack.Common.React.createElement(D,{onClick:()=>VencordNative.ipc.invoke(P.OPEN_QUICKCSS),size:D.Sizes.SMALL,disabled:t==="Loading..."},"Open QuickCSS File")),Vencord.Webpack.Common.React.createElement(_.FormDivider,null),Vencord.Webpack.Common.React.createElement(_.FormTitle,{tag:"h5"},"Settings"),Vencord.Webpack.Common.React.createElement(ie,{value:r.useQuickCss,onChange:c=>r.useQuickCss=c,note:"Loads styles from your QuickCss file"},"Use QuickCss"),!IS_WEB&&Vencord.Webpack.Common.React.createElement(ie,{value:r.enableReactDevtools,onChange:c=>r.enableReactDevtools=c,note:"Requires a full restart"},"Enable React Developer Tools"),!IS_WEB&&Vencord.Webpack.Common.React.createElement(ie,{value:r.notifyAboutUpdates,onChange:c=>r.notifyAboutUpdates=c,note:"Shows a Toast on StartUp"},"Get notified about new Updates"),Vencord.Webpack.Common.React.createElement(_.FormDivider,null),Vencord.Webpack.Common.React.createElement(_.FormTitle,{tag:"h5",className:de(U.marginTop20,U.marginBottom8)},"Plugins"),d.map(c=>{let f=i[c.name]?.filter(h=>r.plugins[h].enabled),E=f?.length;return Vencord.Webpack.Common.React.createElement(ie,{disabled:c.required||E,key:c.name,value:r.plugins[c.name].enabled||c.required||E,onChange:h=>{r.plugins[c.name].enabled=h;let p=Boolean(c.patches?.length);h?(c.dependencies?.forEach(g=>{let S=L[g];p||=Boolean(S.patches?.length&&
Please install it and try again`;else{var n=`An error occured while running \`${d}\`:
`;n+=c||`Code \`${o}\`. 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.`;se.show({title:"Oops!",body:Vencord.Webpack.Common.React.createElement(Ne,null,n.split(`
`).map(o=>Vencord.Webpack.Common.React.createElement("div",null,ue.parse(o))))})}finally{e(!1)}}}function wo({updates:e,repo:t,repoPending:n}){return Vencord.Webpack.Common.React.createElement(me,{style:{padding:".5em"}},e.map(({hash:r,author:o,message:i})=>Vencord.Webpack.Common.React.createElement("div",null,Vencord.Webpack.Common.React.createElement(Gn,{href:`${t}/commit/${r}`,disabled:n},Vencord.Webpack.Common.React.createElement("code",null,r)),Vencord.Webpack.Common.React.createElement("span",{style:{marginLeft:"0.5em",color:"var(--text-normal)"}},i," - ",o))))}function Gi(e){let[t,n]=x.useState(X),[r,o]=x.useState(!1),[i,d]=x.useState(!1),c=t.length>0;return Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,!t&&xe?Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,Vencord.Webpack.Common.React.createElement(_.FormText,null,"Failed to check updates. Check the console for more info"),Vencord.Webpack.Common.React.createElement(Ne,{style:{padding:"1em"}},Vencord.Webpack.Common.React.createElement("p",null,xe.stderr||xe.stdout||"An unknown error occurred"))):Vencord.Webpack.Common.React.createElement(_.FormText,{className:U.marginBottom8},c?`There are ${t.length} Updates`:"Up to Date!"),c&&Vencord.Webpack.Common.React.createElement(wo,{updates:t,...e}),Vencord.Webpack.Common.React.createElement(Xe,{className:de(U.marginBottom8,U.marginTop8)},c&&Vencord.Webpack.Common.React.createElement(D,{size:D.Sizes.SMALL,disabled:i||r,onClick:Co(d,async()=>{if(await Mn()){n([]);let f=await In();await new Promise(E=>{se.show({title:"Update Success!",body:"Successfully updated. Restart now to apply the changes?",confirmText:"Restart",cancelText:"Not now!",onConfirm(){f?window.DiscordNative.app.relaunch():location.reload(),E()},onCancel:E})})}})},"Update Now"),Vencord.Webpack.Common.React.createElement(D,{size:D.Sizes.SMALL,disabled:i||r,onClick:Co(o,async()=>{await Ae()?n(X):(n([]),w.show({message:"No updates found!",id:w.genId(),type:w.Type.MESSAGE,options:{position:w.Position.BOTTOM}}))})},"Check for Updates")))}function ji(e){return Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,Vencord.Webpack.Common.React.createElement(_.FormText,{className:U.marginBottom8},"Your local copy has more recent commits. Please stash or reset them."),Vencord.Webpack.Common.React.createElement(wo,{...e,updates:X}))}var Po,To=l(()=>{"use strict";He();Je();v();Vn();N();So();$n();On();Po=Q.wrap(function(){let[t,n,r]=_e(kn,"Loading...");x.useEffect(()=>{n&&be.error("Failed to retrieve repo",n)},[n]);let o={repo:t,repoPending:r};return Vencord.Webpack.Common.React.createElement(_.FormSection,{tag:"h1",title:"Vencord Updater"},Vencord.Webpack.Common.React.createElement(_.FormTitle,{tag:"h5"},"Repo"),Vencord.Webpack.Common.React.createElement(_.FormText,null,r?t:n?"Failed to retrieve - check console":Vencord.Webpack.Common.React.createElement(Gn,{href:t},t.split("/").slice(-2).join("/"))," (",he,")"),Vencord.Webpack.Common.React.createElement(_.FormDivider,null),Vencord.Webpack.Common.React.createElement(_.FormTitle,{tag:"h5"},"Updates"),Ye?Vencord.Webpack.Common.React.createElement(ji,{...o}):Vencord.Webpack.Common.React.createElement(Gi,{...o}))})});var vo={};I(vo,{Settings:()=>xo,Updater:()=>Po});var Ro=l(()=>{"use strict";_o();To()});var zi={};I(zi,{Api:()=>Rn,Components:()=>Mo,PlainSettings:()=>po,Plugins:()=>Sn,QuickCss:()=>Nn,Settings:()=>q,Updater:()=>An,Util:()=>Un,Webpack:()=>gt});var Le,Bo=new Promise(e=>{new QWebChannel(qt.webChannelTransport,function(t){Le=t.objects.webclass,e()})});async function qn(){Le||await Bo}window.VencordNative={getVersions:()=>({}),ipc:{send:async(e,...t)=>{await qn(),Le.vencordSend(e,t)},sendSync:(e,...t)=>{if(e==="VencordGetSettings")return"{}";throw new Error("Synchroneous IPC not implemented")},on(e,t){},off(e,t){},invoke:(e,...t)=>async()=>(await qn(),Le.vencordSend(e,t))}};Me();F();var Rn={};I(Rn,{Commands:()=>Lt,MessageEvents:()=>ut,Notices:()=>vn});Y();var vn={};I(vn,{currentNotice:()=>ke,nextNotice:()=>g
`,""),E=c,h=new Set;n[d]=function(p,g,S){try{c(p,g,S)}catch(M){if(c===E)throw M;return W.error("Error in patched chunk",M),void E(p,g,S)}if(p.exports===window){Object.defineProperty(S.c,d,{value:S.c[d],enumerable:!1,configurable:!0,writable:!0});return}for(let M of o)try{M(g)}catch(T){W.error("Error in webpack listener",T)}for(let[M,T]of r)try{if(M(g))r.delete(M),T(g);else if(typeof g=="object"){g.default&&M(g.default)&&(r.delete(M),T(g.default));for(let k in g)k.length<3&&g[k]&&M(g[k])&&(r.delete(M),T(g[k]))}}catch(k){W.error("Error while firing callback for webpack chunk",k)}},n[d].toString=()=>c.toString(),n[d].original=E;for(let p=0;p<i.length;p++){let g=i[p];if(f.includes(g.find)){h.add(g.plugin);for(let S of g.replacement){let M=c,T=f;try{let k=f.replace(S.match,S.replace);k===f?(W.warn(`Patch by ${g.plugin} had no effect: ${S.match}`),W.debug(`Function Source:
`,f)):(f=k,c=(0,eval)(`// Webpack Module ${d} - Patched by ${[...h].join(", ")}
${k}
//# sourceURL=WebpackModule${d}`))}catch(k){W.error("Failed to apply patch of",g.plugin,k),W.debug(`Original Source
`,T),W.debug(`Patched Source
`,f),f=T,c=M,h.delete(g.plugin)}}g.all||i.splice(p--,1)}}}}catch(n){W.error("oopsie",n)}return e.original.call(window[z],t)}e.original=window[z].push,Object.defineProperty(window[z],"push",{get:()=>e,set:t=>e.original=t,configurable:!0})}Je();F();v();Object.defineProperty(window,"IS_WEB",{get:()=>!window.DiscordNative,configurable:!0,enumerable:!0});var Mo;async function Wi(){await ht,xn(),Mo=await Promise.resolve().then(()=>(Ro(),vo));try{await Ae()&&q.notifyAboutUpdates&&setTimeout(()=>{Tn("A Vencord update is available!","View Update",()=>{Pn(),Be.open("VencordUpdater")})},1e4)}catch(e){be.error("Failed to check for updates",e)}}Wi();return Vo(zi);})();
//# sourceURL=VencordWeb