dotfiles/vesktop/vencordDist/vencordDesktopRenderer.js

226 lines
523 KiB
JavaScript
Raw Normal View History

2024-03-22 12:55:56 -05:00
// Vencord ca18b6e
2023-11-14 11:41:09 -06:00
// Standalone: true
// Platform: Universal
// Updater disabled: false
2024-03-22 12:55:56 -05:00
"use strict";var Vencord=(()=>{var kP=Object.create;var qa=Object.defineProperty;var NP=Object.getOwnPropertyDescriptor;var DP=Object.getOwnPropertyNames;var LP=Object.getPrototypeOf,EP=Object.prototype.hasOwnProperty;var fi=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):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 kr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),qe=(e,t)=>{for(var o in t)qa(e,o,{get:t[o],enumerable:!0})},a1=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of DP(t))!EP.call(e,i)&&i!==o&&qa(e,i,{get:()=>t[i],enumerable:!(r=NP(t,i))||r.enumerable});return e};var Ka=(e,t,o)=>(o=e!=null?kP(LP(e)):{},a1(t||!e||!e.__esModule?qa(o,"default",{value:e,enumerable:!0}):o,e)),Xn=e=>a1(qa({},"__esModule",{value:!0}),e);var f,n,a=g(()=>{"use strict";f=Symbol.for("react.fragment"),n=(...e)=>(n=Vencord.Webpack.Common.React.createElement)(...e)});var oe,Ke=g(()=>{"use strict";a();oe=class{constructor(t,o="white"){this.name=t;this.color=o}static makeTitle(t,o){return["%c %c %s ","",`background: ${t}; color: black; font-weight: bold; border-radius: 5px;`,o]}_log(t,o,r,i=""){console[t](`%c Vencord %c %c ${this.name} ${i}`,`background: ${o}; 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,...o){this._log("error","#e78284",o,t)}warn(...t){this._log("warn","#e5c890",t)}debug(...t){this._log("debug","#eebebe",t)}}});var l1,j,ot=g(()=>{"use strict";a();l1="",j={};for(let e of["top","bottom","left","right"])for(let t of[8,16,20]){let o=`vc-m-${e}-${t}`;j[`${e}${t}`]=o,l1+=`.${o}{margin-${e}:${t}px;}`}document.addEventListener("DOMContentLoaded",()=>document.head.append(Object.assign(document.createElement("style"),{textContent:l1,id:"vencord-margins"})),{once:!0})});function Jn(e,t=5){let o=0,r;return()=>(!r&&t>o++&&(r=e(),!r&&t===o&&console.error("Lazy factory failed:",e)),r)}function Ot(e,t=5,o=!1){let r=!0;o||setTimeout(()=>r=!1,0);let i=0,s=Object.assign(function(){},{[hs]:void 0,[gi](){return!s[hs]&&t>i++&&(s[hs]=e(),!s[hs]&&t===i&&console.error("Lazy factory failed:",e)),s[hs]}});return new Proxy(s,{...Ya,get(l,c,u){return!o&&r?Ot(()=>Reflect.get(l[gi](),c,u),t,!0):Reflect.get(l[gi](),c,u)}})}var c1,Ya,gi,hs,Uo=g(()=>{"use strict";a();c1=["arguments","caller","prototype"],Ya={},gi=Symbol.for("vencord.lazy.get"),hs=Symbol.for("vencord.lazy.cached");for(let e of["apply","construct","defineProperty","deleteProperty","getOwnPropertyDescriptor","getPrototypeOf","has","isExtensible","ownKeys","preventExtensions","set","setPrototypeOf"])Ya[e]=(t,...o)=>Reflect[e](t[gi](),...o);Ya.ownKeys=e=>{let t=e[gi](),o=Reflect.ownKeys(t);for(let r of c1)o.includes(r)||o.push(r);return o};Ya.getOwnPropertyDescriptor=(e,t)=>{if(typeof t=="string"&&c1.includes(t))return Reflect.getOwnPropertyDescriptor(e,t);let o=Reflect.getOwnPropertyDescriptor(e[gi](),t);return o&&Object.defineProperty(e,t,o),o}});function bt(e,t=5){let o=Jn(e,t),r=i=>{let s=o()??OP;return n(s,{...i})};return r.$$vencordInternal=o,r}var OP,Cu=g(()=>{"use strict";a();Uo();OP=()=>null});function bn(e){if(typeof e=="string")return e;let t=e.source.replaceAll("\\i","[A-Za-z_$][\\w$]*");return new RegExp(t,e.flags)}function Za(e,t){let o=`Vencord.Plugins.plugins[${JSON.stringify(t)}]`;return typeof e!="function"?e.replaceAll("$self",o):(...r)=>e(...r).replaceAll("$self",o)}function Ru(e,t){if(e.get){let o=e.get;e.get=function(){return t(o.call(this))}}else e.value&&(e.value=t(e.value));return e}function ys(e,t){let o=Object.getOwnPropertyDescriptors(e);o.match=Ru(o.match,bn),o.replace=Ru(o.replace,r=>Za(r,t)),Object.defineProperties(e,o)}var hi=g(()=>{"use strict";a()});var _P,an,Xa=g(()=>{"use strict";a();Ke();_P=(e,t,o)=>t,an=
2023-11-14 11:41:09 -06:00
// [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}
2024-03-22 12:55:56 -05:00
`;return(0,eval)(o)}var yi,Ja,ku,io,ln,Ce,u1,Nu,$o,Dr,Va,BP,H=g(()=>{"use strict";a();Uo();Cu();Ke();hi();Xa();yi=new oe("Webpack"),ku=new Promise(e=>Ja=e),Ce={byProps:(...e)=>e.length===1?t=>t[e[0]]!==void 0:t=>e.every(o=>t[o]!==void 0),byCode:(...e)=>t=>{if(typeof t!="function")return!1;let o=Function.prototype.toString.call(t);for(let r of e)if(!o.includes(r))return!1;return!0},byStoreName:e=>t=>t.constructor?.displayName===e,componentByCode:(...e)=>{let t=Ce.byCode(...e);return o=>t(o)?!0:o.$$typeof?o.type&&o.type.render?t(o.type.render):o.type?t(o.type):o.render?t(o.render):!1:!1}},u1=new Map,Nu=new Set;$o=an("find",function(t,{isIndirect:o=!1,isWaitFor:r=!1}={}){if(typeof t!="function")throw new Error("Invalid filter. Expected a function got "+typeof t);for(let i in ln){let s=ln[i];if(!!s?.exports){if(t(s.exports))return r?[s.exports,i]:s.exports;if(s.exports.default&&t(s.exports.default)){let l=s.exports.default;return r?[l,i]:l}}}return o||Qn("find",t),r?[null,null]:null});Dr=an("findBulk",function(...t){if(!Array.isArray(t))throw new Error("Invalid filters. Expected function[] got "+typeof t);let{length:o}=t;if(o===0)throw new Error("Expected at least two filters.");if(o===1)return $o(t[0]);let r=t,i=0,s=Array(o);e:for(let l in ln){let c=ln[l];if(!!c?.exports)for(let u=0;u<o;u++){let p=r[u];if(p!==void 0){if(p(c.exports)){if(s[u]=c.exports,r[u]=void 0,++i===o)break e;break}if(c.exports.default&&p(c.exports.default)){if(s[u]=c.exports.default,r[u]=void 0,++i===o)break e;break}}}}if(i!==o){let l=new Error(`Got ${o} filters, but only found ${i} modules!`);yi.warn(l)}return s}),Va=an("findModuleId",function(...t){e:for(let r in io.m){let i=io.m[r].toString();for(let s of t)if(!i.includes(s))continue e;return r}let o=new Error(`Didn't find module with code(s):
2024-01-10 23:19:19 -06:00
`+t.join(`
2024-03-22 12:55:56 -05:00
`));return yi.warn(o),null});BP=[]});var tl,ol,g1=g(()=>{"use strict";a();H();tl=so(e=>e.image&&e.modal&&!e.applicationIcon),ol=x("buttonWrapper","buttonContent")});function nl(e,t){let o=function(){throw new Error(`Vencord could not find the ${e} Component`)},r=bt(()=>o);return gt(t,i=>{o=i,Object.assign(r,i)},{isIndirect:!0}),r}function $t(e,t){gt(Ce.byStoreName(e),t,{isIndirect:!0})}var _u=g(()=>{"use strict";a();lt();H()});var S,Tt,k,wt,ne,Je,rl,V,Io,il,Er,sl,vs,h1,Ho,al,Si,bi,Ti,ll,Ss,Vn,Po,GP,bs,y1=g(()=>{"use strict";a();H();_u();S={},Vn=nl("MaskedLink",Ce.componentByCode("MASKED_LINK)")),Po=nl("Timestamp",Ce.byCode(".Messages.MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL.format")),GP=nl("Flex",["Justify","Align","Wrap"]),{OAuth2AuthorizeModal:bs}=x("OAuth2AuthorizeModal");gt(["FormItem","Button"],e=>{({useToken:Ss,Card:Tt,Button:k,FormSwitch:wt,Tooltip:ne,TextInput:Je,TextArea:rl,Text:V,Select:Io,SearchableSelect:il,Slider:Er,ButtonLooks:sl,TabBar:Ho,Popout:vs,Dialog:h1,Paginator:al,ScrollerThin:Si,Clickable:bi,Avatar:Ti,FocusLock:ll}=e),S=e})});var L,Yt,v1=g(()=>{"use strict";a();H();L={};gt(["MenuItem","MenuSliderControl"],e=>L=e);Yt=x("closeContextMenu","openContextMenu")});var U,W,se,Rt,xt,wi,cl,Or,S1=g(()=>{"use strict";a();H();Or=x("createPortal","render");gt("useState",e=>{U=e,{useEffect:se,useState:W,useMemo:Rt,useRef:xt,useReducer:wi,useCallback:cl}=U})});var Ts,xi,ws,b1=g(()=>{"use strict";a();H();Ts=x("MessageDisplayCompact"),xi=x("ShowCurrentGame"),ws=x("PreloadedUserSettingsActionCreators")});var xs,Bu,zo,Ms,_e,wn,_r,cn,HP,ae,E,ho,Ie,yo,ee,Ge,it,jo,Is,Ps,Be,T1=g(()=>{"use strict";a();H();_u();xs=x("connectStores"),Bu=(i=>(i[i.ChannelMessage=0]="ChannelMessage",i[i.ThreadSettings=1]="ThreadSettings",i[i.FirstThreadMessage=2]="FirstThreadMessage",i[i.ApplicationLauncherCommand=3]="ApplicationLauncherCommand",i))(Bu||{}),Ms=x("openPrivateChannel"),{useStateFromStores:Be}=x("useStateFromStores");$t("DraftStore",e=>Ps=e);$t("UserStore",e=>E=e);$t("UserProfileStore",e=>ho=e);$t("ChannelStore",e=>ee=e);$t("SelectedChannelStore",e=>Ie=e);$t("SelectedGuildStore",e=>yo=e);$t("GuildStore",e=>ae=e);$t("GuildMemberStore",e=>Ge=e);$t("RelationshipStore",e=>it=e);$t("PermissionStore",e=>_e=e);$t("PresenceStore",e=>cn=e);$t("ReadStateStore",e=>_r=e);$t("GuildChannelStore",e=>wn=e);$t("MessageStore",e=>zo=e);$t("WindowStore",e=>Is=e);$t("EmojiStore",e=>jo=e)});var w1={};var x1=g(()=>{"use strict";a()});var M1={};var I1=g(()=>{"use strict";a()});var P1={};var A1=g(()=>{"use strict";a()});function Mt(e,t=C1.MESSAGE){X.show({id:X.genId(),message:e,type:t})}var B,Wo,_t,Fu,Br,Fr,Ye,un,Pe,et,C1,zP,X,Bt,As,Ur,Ft,qo,$r,me,Gr,jP,Uu,ao,$u,Gu,Gt,R1=g(()=>{"use strict";a();H();gt(["dispatch","subscribe"],e=>{B=e;let t=()=>{e.unsubscribe("CONNECTION_OPEN",t),Ja()};e.subscribe("CONNECTION_OPEN",t)});gt(["ComponentDispatch","ComponentDispatcher"],e=>Wo=e.ComponentDispatch);_t=go(()=>{let e=Lr("getAPIBaseURL");return e.HTTP??e}),Fu=x("parseTwoDigitYear"),Br=x("highlight","registerLanguage"),Fr=x("debounce","cloneDeep"),Ye=so(e=>e.Messages?.["en-US"]);gt(["fromTimestamp","extractTimestamp"],e=>un=e);gt("parseTopic",e=>Pe=e);gt(["show","close"],e=>et=e);C1={MESSAGE:0,SUCCESS:1,FAILURE:2,CUSTOM:3},zP={TOP:0,BOTTOM:1},X={Type:C1,Position:zP,genId:()=>(Math.random()||Math.random()).toString(36).slice(2)};gt("showToast",e=>{X.show=e.showToast,X.pop=e.popToast});Bt=x("getUser","fetchCurrentUser"),As=x("showUploadFileSizeExceededError","promptToUpload"),Ur=x("fetchAssetIds","getAssetImage"),Ft=x("SUPPORTS_COPY","copy"),qo=x("transitionTo","replaceWith","transitionToGuild");gt(["open","saveAccountChanges"],e=>$r=e);({Permissions:me}=so(e=>typeof e.Permissions?.ADMINISTRATOR=="bigint")),Gr=Go("will be removed in v4"),jP=Ce.byCode("[zustand persist middleware]"),{persist:Uu}=so(e=>e.persist&&jP(e.persist)),ao=x("editMessage","sendMessage"),$u=x("openUserProfileModal","closeUserProfileModal"),Gu=x("resolveInvite"),Gt=x("getGuildBannerURL","getUserAvatarURL")});var Hu={};qe(Hu,{Alerts:()=>et,ApplicationAssetUtils:()=>Ur,Avatar:()=>Ti,Button:()=>k,ButtonL
`);i!==-1&&(r=o.slice(0,i),o=o.slice(i+1).replace(/https:\/\/\S+\/assets\//g,""))}return{error:t,stack:o,message:r}}componentDidCatch(t,o){this.props.onError?.({error:t,errorInfo:o,props:this.props.wrappedProps}),N1.error(`A component threw an Error
`,t),N1.error("Component Stack",o.componentStack)}render(){if(this.state.error===D1)return this.props.children;if(this.props.noop)return null;if(this.props.fallback)return n(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 n(Ro,{style:{overflow:"hidden"}},n("h1",null,"Oh no!"),n("p",null,t),n("code",null,this.state.message,!!this.state.stack&&n("pre",{className:j.top8},this.state.stack)))}});qu.wrap=(e,t)=>o=>n(qu,{...t,wrappedProps:o},n(e,{...o}));_=qu});function pl(){return n("svg",{"aria-hidden":"true",height:"16",viewBox:"0 0 16 16",width:"16",style:{marginRight:"0.5em",transform:"translateY(2px)"}},n("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 Ku=g(()=>{"use strict";a()});function Ds(e){return n(k,{...e,look:k.Looks.LINK,color:k.Colors.TRANSPARENT,onClick:()=>VencordNative.native.openExternal("https://github.com/sponsors/Vendicated")},n(pl,null),"Donate")}var Yu=g(()=>{"use strict";a();T();Ku()});function fe(e){return e.style??={},e.style.display="flex",e.style.gap??="1em",e.style.flexDirection||=e.flexDirection,delete e.flexDirection,n("div",{...e},e.children)}var Ut=g(()=>{"use strict";a()});function Hr(e,t){return dl.openModalLazy(e,t)}function de(e,t,o){return dl.openModal(e,t,o)}function xn(e,t){return dl.closeModal(e,t)}function dn(){return dl.closeAllModals()}var ko,Yo,Zu,ye,Le,ke,ct,pt,dl,Ze=g(()=>{"use strict";a();H();lt();ko=(i=>(i.SMALL="small",i.MEDIUM="medium",i.LARGE="large",i.DYNAMIC="dynamic",i))(ko||{}),Yo=x("ModalRoot","ModalCloseButton"),Zu=Tn("ImageModal"),ye=bt(()=>Yo.ModalRoot),Le=bt(()=>Yo.ModalHeader),ke=bt(()=>Yo.ModalContent),ct=bt(()=>Yo.ModalFooter),pt=bt(()=>Yo.ModalCloseButton),dl=x("openModalLazy")});function y(e){return e}var I=g(()=>{"use strict";a()});async function L1(e=!1){Xu={};let t={};e&&(t.cache="no-cache"),Xu=await fetch("https://badges.vencord.dev/badges.json",t).then(o=>o.json())}var XP,JP,Xu,Ju,E1=g(()=>{"use strict";a();fl();Yu();le();Ut();Ku();P();ot();we();Ze();I();T();XP="https://vencord.dev/assets/favicon.png",JP={description:"Vencord Contributor",image:XP,position:0,props:{style:{borderRadius:"50%",transform:"scale(0.9)"}},shouldShow:({user:e})=>ks(e.id),link:"https://github.com/Vendicated/Vencord"},Xu={};Ju=y({name:"BadgeAPI",description:"API to add badges to users.",authors:[m.Megu,m.Ven,m.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 L1(!0),X.show({id:X.genId(),message:"Successfully refetched badges!",type:X.Type.SUCCESS})}},async start(){Vencord.Api.Badges.addBadge(JP),await L1()},renderBadgeComponent:_.wrap(e=>{let t=e.component;return n(t,{...e})},{noop:!0}),getDonorBadges(e){return Xu[e]?.map(t=>({image:t.badge,description:t.tooltip,position:0,props:{style:{borderRadius:"50%",transform:"scale(0.9)"}},onClick(){let o=de(r=>n(_,{noop:!0,onError:()=>{xn(o),VencordNative.native.openExte
2023-11-14 11:41:09 -06:00
${e.replaceAll("```","\\`\\`\\`")}
2024-03-22 12:55:56 -05:00
${o}`}var Hp,$A,GA,zp,HA,zA,jA,WA,qA,An,KA,Cn=g(()=>{"use strict";a();T();Hp=e=>e.split(/(?=[A-Z])/).map(t=>t.toLowerCase()),$A=e=>e.toLowerCase().split("_"),GA=e=>e.toLowerCase().split("-"),zp=e=>e.split(/(?=[A-Z])/).map(t=>t.toLowerCase()),HA=e=>e.toLowerCase().split(" "),zA=e=>e.map((t,o)=>o?t[0].toUpperCase()+t.slice(1):t).join(""),jA=e=>e.join("_").toUpperCase(),WA=e=>e.join("-").toLowerCase(),qA=e=>e.map(t=>t[0].toUpperCase()+t.slice(1)).join(""),An=e=>e.map(t=>t[0].toUpperCase()+t.slice(1)).join(" "),KA=["years","months","weeks","days","hours","minutes","seconds"]});function Ks(){return`-${un.fromTimestamp(Date.now())}`}function ge(e,t){let o=ZA.createBotMessage({channelId:e,content:"",embeds:[]});return ao.receiveMessage(e,Ii(t,o)),t}function ht(e,t,o){return e.find(r=>r.name===t)?.value||o}var ZA,jp=g(()=>{"use strict";a();we();H();T();ZA=x("createBotMessage")});var Rn,Vo,Wp,_l=g(()=>{"use strict";a();Rn=(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))(Rn||{}),Vo=(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))(Vo||{}),Wp=(r=>(r[r.CHAT_INPUT=1]="CHAT_INPUT",r[r.USER=2]="USER",r[r.MESSAGE=3]="MESSAGE",r))(Wp||{})});var Yp={};qe(Yp,{ApplicationCommandInputType:()=>Vo,ApplicationCommandOptionType:()=>Rn,ApplicationCommandType:()=>Wp,BUILT_IN:()=>lr,OptionalMessageOption:()=>cr,RequiredMessageOption:()=>Ys,_handleCommand:()=>JA,_init:()=>XA,commands:()=>qp,findOption:()=>ht,generateId:()=>Ks,prepareOption:()=>Kp,registerCommand:()=>_i,sendBotMessage:()=>ge,unregisterCommand:()=>Zs});function Kp(e){return e.displayName||=e.name,e.displayDescription||=e.description,e.options?.forEach((t,o,r)=>{t===Gv?r[o]=cr:t===Hv&&(r[o]=Ys),t.choices?.forEach(i=>i.displayName||=i.name),Kp(r[o])}),e}function QA(e,t){e.options?.forEach(o=>{if(o.type!==1)throw new Error("When specifying sub-command options, all options must be sub-commands.");let r={...e,...o,type:1,name:`${e.name} ${o.name}`,id:`${o.name}-${e.id}`,displayName:`${e.name} ${o.name}`,subCommandPath:[{name:o.name,type:o.type,displayName:o.name}],rootCommand:e};_i(r,t)})}function _i(e,t){if(!lr){console.warn("[CommandsAPI]",`Not registering ${e.name} as the CommandsAPI hasn't been initialised.`,"Please restart to use commands");return}if(lr.some(o=>o.name===e.name))throw new Error(`Command '${e.name}' already exists.`);if(e.isVencordCommand=!0,e.id??=`-${lr.length+1}`,e.applicationId??="-1",e.type??=1,e.inputType??=1,e.plugin||=t,Kp(e),e.options?.[0]?.type===1){QA(e,t);return}qp[e.name]=e,lr.push(e)}function Zs(e){let t=lr.findIndex(o=>o.name===e);return t===-1?!1:(lr.splice(t,1),delete qp[e],!0)}var lr,qp,Gv,Hv,cr,Ys,XA,JA,uo=g(()=>{"use strict";a();Cn();jp();_l();jp();_l();qp={},Gv=Symbol("OptionalMessageOption"),Hv=Symbol("RequiredMessageOption"),cr=Gv,Ys=Hv,XA=function(e){try{lr=e,cr=e.find(t=>t.name==="shrug").options[0],Ys=e.find(t=>t.name==="me").options[0]}catch{console.error("Failed to load CommandsApi")}return e},JA=function(e,t,o){if(!e.isVencordCommand)return e.execute(t,o);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),ge(o.channel.id,{content:`${s}:
${qs(l)}`,author:{username:"Vencord"}})};try{let i=e.execute(t,o);return i instanceof Promise?i.catch(r):i}catch(i){return r(i)}}});function zv({text:e,color:t}){return n("div",{className:"vc-plugins-badge",style:{backgroundColor:t,justifySelf:"flex-end",marginLeft:"auto"}},e)}var Zp=g(()=>{"use strict";a()});function jv({option:e,pluginSettings:t,definedSettings:o,id:r,onChange:i,onError:s}){let l=t[r]??e.default,[c,u]=U.useState(l??!1),[p,d]=U.useState(null);U.useEffect(()=>{s(p!==null)},[p]);function h(v){let b=e.isValid?.call(o,v)??!0;typeof b=="string"?d(b):b?(d(null),u(v),i(v)):d("Invalid input provided.")}return n(S.FormSection,null,n(wt,{value:c,onChange:h,note:e.description,disabled:e.disabled?.call(o)??!1,...e.componentProps,hideBorder:!0,style:{marginBottom:"0.5em"}},An(Hp(r))),p&&n(S.FormText,{style:{color:"var(--text-danger)"}},p))}var Wv=g(()=>{"use strict";a();Cn();T()});function qv({option:e,onChange:t,onError:o}){return e.component({setValue:t,setError:o,option:e})}var Kv=g(()=>{"use strict";a()});function Xp({option:e,pluginSettings:t,definedSettings:o,id:r,onChange:i,onError:s}){function l(v){return e.type===2?BigInt(v):Number(v)}let[c,u]=U.useState(`${t[r]??e.default??0}`),[p,d]=U.useState(null);U.useEffect(()=>{s(p!==null)},[p]);function h(v){let b=e.isValid?.call(o,v)??!0;d(null),typeof b=="string"?d(b):b||d("Invalid input provided."),e.type===1&&BigInt(v)>=VA?(u(`${Number.MAX_SAFE_INTEGER}`),i(l(v))):(u(v),i(l(v)))}return n(S.FormSection,null,n(S.FormTitle,null,e.description),n(Je,{type:"number",pattern:"-?[0-9]+",value:c,onChange:h,placeholder:e.placeholder??"Enter a number",disabled:e.disabled?.call(o)??!1,...e.componentProps}),p&&n(S.FormText,{style:{color:"var(--text-danger)"}},p))}var VA,Yv=g(()=>{"use strict";a();I();T();VA=BigInt(Number.MAX_SAFE_INTEGER)});function Zv({option:e,pluginSettings:t,definedSettings:o,onChange:r,onError:i,id:s}){let l=t[s]??e.options?.find(v=>v.default)?.value,[c,u]=U.useState(l??null),[p,d]=U.useState(null);U.useEffect(()=>{i(p!==null)},[p]);function h(v){let b=e.isValid?.call(o,v)??!0;typeof b=="string"?d(b):b?(d(null),u(v),r(v)):d("Invalid input provided.")}return n(S.FormSection,null,n(S.FormTitle,null,e.description),n(Io,{isDisabled:e.disabled?.call(o)??!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&&n(S.FormText,{style:{color:"var(--text-danger)"}},p))}var Xv=g(()=>{"use strict";a();T()});function en(e,t,o=1){let r=[];for(let i=e;i<=t;i+=o)r.push(Math.round(i*100)/100);return r}function Jv({option:e,pluginSettings:t,definedSettings:o,id:r,onChange:i,onError:s}){let l=t[r]??e.default,[c,u]=U.useState(null);U.useEffect(()=>{s(c!==null)},[c]);function p(d){let h=e.isValid?.call(o,d)??!0;typeof h=="string"?u(h):h?(u(null),i(d)):u("Invalid input provided.")}return n(S.FormSection,null,n(S.FormTitle,null,e.description),n(Er,{disabled:e.disabled?.call(o)??!1,markers:e.markers,minValue:e.markers[0],maxValue:e.markers[e.markers.length-1],initialValue:l,onValueChange:p,onValueRender:d=>String(d.toFixed(2)),stickToMarkers:e.stickToMarkers??!0,...e.componentProps}))}var Jp=g(()=>{"use strict";a();T()});function Qv({option:e,pluginSettings:t,definedSettings:o,id:r,onChange:i,onError:s}){let[l,c]=U.useState(t[r]??e.default??null),[u,p]=U.useState(null);U.useEffect(()=>{s(u!==null)},[u]);function d(h){let v=e.isValid?.call(o,h)??!0;p(typeof v=="string"?v:v?null:"Invalid input provided."),c(h),i(h)}return n(S.FormSection,null,n(S.FormTitle,null,e.description),n(Je,{type:"text",value:l,onChange:d,placeholder:e.placeholder??"Enter a value",disabled:e.disabled?.call(o)??!1,...e.componentProps}),u&&n(S.FormText,{style:{color:"var(--text-danger)"}},u))}var Vv=g(()=>{"use strict";a();T()});var Xs=g(()=>{"use strict";a();Zp();Wv();Kv();Yv();Xv();Jp();Vv()});var e0=g(()=>{});async function Qr(e){let{invite:t}=await Gu.resolveInvite(e,"Desktop Modal");if(!t)throw new Error("Invalid invite: "+e);return B.dispatch({type:"INVITE_MODAL_OPEN",invite:t,code:e
`,l),!1}}if(r?.length){po.info("Registering commands of plugin",o);for(let l of r)try{_i(l,o)}catch(c){return po.error(`Failed to register command ${l.name}
`,c),!1}}if(i)for(let l in i)B.subscribe(l,i[l]);if(s)for(let l in s)ad(l,s[l]);return!0},e=>`startPlugin ${e.name}`),dd=an("stopPlugin",function(t){let{name:o,commands:r,flux:i,contextMenus:s}=t;if(t.stop){if(po.info("Stopping plugin",o),!t.started)return po.warn(`${o} already stopped`),!1;try{t.stop(),t.started=!1}catch(l){return po.error(`Failed to stop ${o}
`,l),!1}}if(r?.length){po.info("Unregistering commands of plugin",o);for(let l of r)try{Zs(l.name)}catch(c){return po.error(`Failed to unregister command ${l.name}
`,c),!1}}if(i)for(let l in i)B.unsubscribe(l,i[l]);if(s)for(let l in s)ld(l,s[l]);return!0},e=>`stopPlugin ${e.name}`)});function vC(e){X.show({message:e,type:X.Type.FAILURE,id:X.genId(),options:{position:X.Position.BOTTOM}})}function SC({required:e}){return n(Tt,{className:Vr("info-card",{"restart-card":e})},e?n(f,null,n(S.FormTitle,{tag:"h5"},"Restart required!"),n(S.FormText,{className:Vr("dep-text")},"Restart now to apply new plugins and their settings"),n(k,{color:k.Colors.YELLOW,onClick:()=>location.reload()},"Restart")):n(f,null,n(S.FormTitle,{tag:"h5"},"Plugin Management"),n(S.FormText,null,"Press the cog wheel or info icon to get more info on a plugin"),n(S.FormText,null,"Plugins with a cog wheel have settings you can modify!")))}function Fl({plugin:e,disabled:t,onRestartNeeded:o,onMouseEnter:r,onMouseLeave:i,isNew:s}){let l=G.plugins[e.name],c=()=>l.enabled??!1;function u(){Hr(async()=>d=>n(Qs,{...d,plugin:e,onRestartNeeded:()=>o(e.name)}))}function p(){let d=c();if(!d){let{restartNeeded:v,failures:b}=zl(e);if(b.length){p0.error(`Failed to start dependencies for ${e.name}: ${b.join(", ")}`),js("Failed to start dependencies: "+b.join(", "),"Close",()=>null);return}else if(v){l.enabled=!0,o(e.name);return}}if(e.patches?.length){l.enabled=!d,o(e.name);return}if(d&&!e.started){l.enabled=!d;return}if(!(d?dd(e):oa(e))){l.enabled=!1;let v=`Error while ${d?"stopping":"starting"} plugin ${e.name}`;p0.error(v),vC(v);return}l.enabled=!d}return n($l,{name:e.name,description:e.description,isNew:s,enabled:c(),setEnabled:p,disabled:t,onMouseEnter:r,onMouseLeave:i,infoButton:n("button",{role:"switch",onClick:()=>u(),className:Q(yC.button,Vr("info-button"))},e.options&&!Cs(e.options)?n(Bv,null):n(Ll,null))})}function fd(){let e=St(),t=U.useMemo(()=>new Vs,[]);U.useEffect(()=>()=>void(t.hasChanges&&et.show({title:"Restart required",body:n(f,null,n("p",null,"The following plugins require a restart:"),n("div",null,t.map((v,b)=>n(f,null,b>0&&", ",Pe.parse("`"+v+"`"))))),confirmText:"Restart now",cancelText:"Later!",onConfirm:()=>location.reload()})),[]);let o=U.useMemo(()=>{let v={};for(let b in ze){let M=ze[b].dependencies;if(M)for(let w of M)v[w]??=[],v[w].push(b)}return v},[]),r=U.useMemo(()=>Object.values(ze).sort((v,b)=>v.name.localeCompare(b.name)),[]),[i,s]=U.useState({value:"",status:0}),l=v=>s(b=>({...b,value:v})),c=v=>s(b=>({...b,status:v})),u=v=>{let b=e.plugins[v.name]?.enabled;if(b&&i.status===2||!b&&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(w=>w.toLowerCase().includes(M))},[p]=st(()=>dt("Vencord_existingPlugins").then(v=>{let b=Date.now()/1e3,M={},w=Object.values(r).map(R=>R.name),C=[];for(let{name:R}of r)(M[R]=v?.[R]??b)+60*60*24*2>b&&C.push(R);return kt("Vencord_existingPlugins",M),Fr.isEqual(C,w)?[]:C})),d,h;if(r?.length){d=[],h=[];for(let v of r){if(!v.options&&v.name.endsWith("API")&&i.value!=="API"||!u(v))continue;if(v.required||o[v.name]?.some(M=>e.plugins[M].enabled)){let M=v.required?"This plugin is required for Vencord to function.":bC(o[v.name]?.filter(w=>e.plugins[w].enabled));h.push(n(ne,{text:M,key:v.name},({onMouseLeave:w,onMouseEnter:C})=>n(Fl,{onMouseLeave:w,onMouseEnter:C,onRestartNeeded:R=>t.handleChange(R),disabled:!0,plugin:v})))}else d.push(n(Fl,{onRestartNeeded:M=>t.handleChange(M),disabled:!1,plugin:v,isNew:p?.includes(v.name),key:v.name}))}}else d=h=n(V,{variant:"text-md/normal"},"No plugins meet search criteria.");return n(Do,{title:"Plugins"},n(SC,{required:t.hasChanges}),n(S.FormTitle,{tag:"h5",className:Q(j.top20,j.bottom8)},"Filters"),n("div",{className:Vr("filter-controls")},n(Je,{autoFocus:!0,value:i.value,placeholder:"Search for a plugin...",onChange:l,className:j.bottom20}),n("div",{className:d0.inputWrapper},n(Io,{className:d0.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===
`)),[l,c]=W(null),[u,,p]=st(VencordNative.themes.getThemesDir);se(()=>{d()},[]);async function d(){let C=await VencordNative.themes.getThemesList();c(C)}function h(C,R){if(R){if(e.enabledThemes.includes(C))return;e.enabledThemes=[...e.enabledThemes,C]}else e.enabledThemes=e.enabledThemes.filter(A=>A!==C)}async function v(C){if(C.stopPropagation(),C.preventDefault(),!C.currentTarget?.files?.length)return;let{files:R}=C.currentTarget,A=Array.from(R,F=>{let{name:z}=F;if(!!z.endsWith(".css"))return new Promise((Y,J)=>{let Z=new FileReader;Z.onload=()=>{VencordNative.themes.uploadTheme(z,Z.result).then(Y).catch(J)},Z.readAsText(F)})});await Promise.all(A),d()}function b(){return n(f,null,n(Tt,{className:"vc-settings-card"},n(S.FormTitle,{tag:"h5"},"Find Themes:"),n("div",{style:{marginBottom:".5em",display:"flex",flexDirection:"column"}},n(je,{style:{marginRight:".5em"},href:"https://betterdiscord.app/themes"},"BetterDiscord Themes"),n(je,{href:"https://github.com/search?q=discord+theme"},"GitHub")),n(S.FormText,null,'If using the BD site, click on "Download" and place the downloaded .theme.css file into your themes folder.')),n(S.FormSection,{title:"Local Themes"},n(Tt,{className:"vc-settings-quick-actions-card"},n(f,null,n(k,{onClick:()=>Il(u),size:k.Sizes.SMALL,disabled:p},"Open Themes Folder"),n(k,{onClick:d,size:k.Sizes.SMALL},"Load missing Themes"),n(k,{onClick:()=>VencordNative.quickCss.openEditor(),size:k.Sizes.SMALL},"Edit QuickCSS"),Vencord.Settings.plugins.ClientTheme.enabled&&n(k,{onClick:()=>de(C=>n(Qs,{...C,plugin:Vencord.Plugins.plugins.ClientTheme,onRestartNeeded:()=>{}})),size:k.Sizes.SMALL},"Edit ClientTheme"))),n("div",{className:xC("grid")},l?.map(C=>n(PC,{key:C.fileName,enabled:e.enabledThemes.includes(C.fileName),onChange:R=>h(C.fileName,R),onDelete:async()=>{h(C.fileName,!1),await VencordNative.themes.deleteTheme(C.fileName),d()},theme:C})))))}function M(){e.themeLinks=[...new Set(i.trim().split(/\n+/).map(C=>C.trim()).filter(Boolean))]}function w(){return n(f,null,n(Tt,{className:"vc-settings-card vc-text-selectable"},n(S.FormTitle,{tag:"h5"},"Paste links to css files here"),n(S.FormText,null,"One link per line"),n(S.FormText,null,"Make sure to use direct links to files (raw or github.io)!")),n(S.FormSection,{title:"Online Themes",tag:"h5"},n(rl,{value:i,onChange:s,className:Q(wC.textarea,"vc-settings-theme-links"),placeholder:"Theme Links",spellCheck:!1,onBlur:M,rows:10}),n(IC,{themeLinks:e.themeLinks})))}return n(Do,{title:"Themes"},n(Ho,{type:"top",look:"brand",className:"vc-settings-tab-bar",selectedItem:o,onItemSelect:r},n(Ho.Item,{className:"vc-settings-tab-bar-item",id:0},"Local Themes"),n(Ho.Item,{className:"vc-settings-tab-bar-item",id:1},"Online Themes")),o===0&&b(),o===1&&w())}var xU,MU,wC,xC,CC,h0=g(()=>{"use strict";a();$();Qe();Ut();It();To();td();mt();ot();we();Ze();rr();lt();H();T();rd();ar();xU=x("resolveInvite"),MU=so(e=>e.prototype?.activateUploadDialogue&&e.prototype.setRef),wC=so(e=>typeof e.textarea=="string"),xC=ve("vc-settings-theme-");CC=Lo(AC,"Themes")});var b0={};qe(b0,{default:()=>DC});function y0(e,t){return async()=>{e(!0);try{await t()}catch(r){if(Yr.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 o=`Command \`${s}\` not found.
2024-01-10 23:19:19 -06:00
Please install it and try again`;else{var o=`An error occurred while running \`${l}\`:
`;o+=c||`Code \`${i}\`. See the console for more info`}}else var o="An unknown error occurred. See the console for more info.";else var o=`An unknown error occurred (error is undefined).
2024-03-22 12:55:56 -05:00
Please try again.`;et.show({title:"Oops!",body:n(Ro,null,o.split(`
`).map(i=>n("div",null,Pe.parse(i))))})}finally{e(!1)}}}function v0({repo:e,hash:t,disabled:o=!1}){return n(je,{href:`${e}/commit/${t}`,disabled:o},t)}function S0({updates:e,repo:t,repoPending:o}){return n(Tt,{style:{padding:"0 0.5em"}},e.map(({hash:r,author:i,message:s})=>n("div",{style:{marginTop:"0.5em",marginBottom:"0.5em"}},n("code",null,n(v0,{repo:t,hash:r,disabled:o})),n("span",{style:{marginLeft:"0.5em",color:"var(--text-normal)"}},s," - ",i))))}function RC(e){let[t,o]=U.useState(ir),[r,i]=U.useState(!1),[s,l]=U.useState(!1),c=(t?.length??0)>0;return n(f,null,!t&&Ni?n(f,null,n(S.FormText,null,"Failed to check updates. Check the console for more info"),n(Ro,{style:{padding:"1em"}},n("p",null,Ni.stderr||Ni.stdout||"An unknown error occurred"))):n(S.FormText,{className:j.bottom8},c?t.length===1?"There is 1 Update":`There are ${t.length} Updates`:"Up to Date!"),c&&n(S0,{updates:t,...e}),n(fe,{className:Q(j.bottom8,j.top8)},c&&n(k,{size:k.Sizes.SMALL,disabled:s||r,onClick:y0(l,async()=>{await Li()&&(o([]),await new Promise(u=>{et.show({title:"Update Success!",body:"Successfully updated. Restart now to apply the changes?",confirmText:"Restart",cancelText:"Not now!",onConfirm(){So(),u()},onCancel:u})}))})},"Update Now"),n(k,{size:k.Sizes.SMALL,disabled:s||r,onClick:y0(i,async()=>{await Di()?o(ir):(o([]),X.show({message:"No updates found!",id:X.genId(),type:X.Type.MESSAGE,options:{position:X.Position.BOTTOM}}))})},"Check for Updates")))}function kC(e){return n(f,null,n(S.FormText,{className:j.bottom8},"Your local copy has more recent commits. Please stash or reset them."),n(S0,{...e,updates:ir}))}function NC(){let e=St(["notifyAboutUpdates","autoUpdate","autoUpdateNotification"]),[t,o,r]=st(Lp,{fallbackValue:"Loading..."});U.useEffect(()=>{o&&Yr.error("Failed to retrieve repo",o)},[o]);let i={repo:t,repoPending:r};return n(Do,{title:"Vencord Updater"},n(S.FormTitle,{tag:"h5"},"Updater Settings"),n(wt,{value:e.notifyAboutUpdates,onChange:s=>e.notifyAboutUpdates=s,note:"Shows a notification on startup",disabled:e.autoUpdate},"Get notified about new updates"),n(wt,{value:e.autoUpdate,onChange:s=>e.autoUpdate=s,note:"Automatically update Vencord without confirmation prompt"},"Automatically update"),n(wt,{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"),n(S.FormTitle,{tag:"h5"},"Repo"),n(S.FormText,{className:"vc-text-selectable"},r?t:o?"Failed to retrieve - check console":n(je,{href:t},t.split("/").slice(-2).join("/"))," ","(",n(v0,{hash:No,repo:t,disabled:r}),")"),n(S.FormDivider,{className:j.top8+" "+j.bottom8}),n(S.FormTitle,{tag:"h5"},"Updates"),Gs?n(kC,{...i}):n(RC,{...i}))}var DC,T0=g(()=>{"use strict";a();$();Pi();Ut();To();ot();we();rr();lt();Zr();T();ki();ar();DC=Lo(NC,"Updater")});function Wl({value:e,onChange:t,validate:o}){let[r,i]=U.useState(e),[s,l]=U.useState();function c(u){i(u);let p=o(u);p===!0?(l(void 0),t(u)):l(p)}return n(f,null,n(Je,{type:"text",value:r,onChange:c,error:s}))}var gd=g(()=>{"use strict";a();T()});var w0={};qe(w0,{default:()=>BC});function LC(e){try{return new URL(e),!0}catch{return"Invalid URL"}}async function EC(){let e=await fetch(new URL("/v1/",nr()),{method:"DELETE",headers:{Authorization:await Ci()}});if(!e.ok){Ml.error(`Failed to erase data, API returned ${e.status}`),Fe({title:"Cloud Integrations",body:`Could not erase all data (API returned ${e.status}), please contact support.`,color:"var(--red-360)"});return}G.cloud.authenticated=!1,await Rp(),Fe({title:"Cloud Integrations",body:"Successfully erased all data.",color:"var(--green-360)"})}function OC(){let{cloud:e}=St(["cloud.authenticated","cloud.settingsSync"]),t=e.authenticated&&e.settingsSync;return n(S.FormSection,{title:"Settings Sync",className:j.top16},n(S.FormText,{variant:"text-md/normal",className:j.bottom20},"Synchronize your settings to the cloud. This allows easy synchronization across multiple devices with minimal effort."),n(wt,{key:"cloud-sync",disabled:!e.
2023-11-14 11:41:09 -06:00
**Vencord Debug Info**
>>> ${Object.entries(s).map(([c,u])=>`${c}: ${u}`).join(`
`)}
Enabled Plugins (${r.length+i.length}):
2024-03-22 12:55:56 -05:00
${qs(r.join(", ")+`
2023-11-14 11:41:09 -06:00
`+i.join(", "))}
2024-03-22 12:55:56 -05:00
`.trim().replaceAll("```\n","```")}}}],flux:{async CHANNEL_SELECT({channelId:e}){if(e===ul&&!ks(E.getCurrentUser().id)&&sr&&No!==await yt.get(P0)){let t=()=>yt.set(P0,No);et.show({title:"Hold on!",body:n("div",null,n(S.FormText,null,"You are using an outdated version of Vencord! Chances are, your issue is already fixed."),n(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 vd,C0=g(()=>{"use strict";a();P();I();vd=y({name:"AlwaysAnimate",description:"Animates anything that can be animated",authors:[m.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"}},{find:".animatedBannerHoverLayer,onMouseEnter:",replacement:{match:/(?<=guildBanner:\i,animate:)\i(?=}\))/,replace:"!0"}}]})});var Sd,bd,R0=g(()=>{"use strict";a();$();P();I();Sd=N({domain:{type:3,default:!0,description:"Remove the untrusted domain popup when opening links",restartNeeded:!0},file:{type:3,default:!0,description:"Remove the 'Potentially Dangerous Download' popup when opening links",restartNeeded:!0}}),bd=y({name:"AlwaysTrust",description:"Removes the annoying untrusted domain and suspicious file popup",authors:[m.zt,m.Trwy],patches:[{find:'.displayName="MaskedLinkStore"',replacement:{match:/(?<=isTrustedDomain\(\i\){)return \i\(\i\)/,replace:"return true"},predicate:()=>Sd.store.domain},{find:"isSuspiciousDownload:",replacement:{match:/function \i\(\i\){(?=.{0,60}\.parse\(\i\))/,replace:"$&return null;"},predicate:()=>Sd.store.file}],settings:Sd})});var GC,HC,zC,ur,Td,k0=g(()=>{"use strict";a();$();le();P();I();H();GC=Go(".actionBarIcon)"),HC=x("popFirstFile","update"),zC=/\.tar\.\w+$/,ur=N({anonymiseByDefault:{description:"Whether to anonymise file names by default",type:3,default:!0},method:{description:"Anonymising method",type:4,options:[{label:"Random Characters",value:0,default:!0},{label:"Consistent",value:1},{label:"Timestamp",value:2}]},randomisedLength:{description:"Random characters length",type:1,default:7,disabled:()=>ur.store.method!==0},consistent:{description:"Consistent filename",type:0,default:"image",disabled:()=>ur.store.method!==1}}),Td=y({name:"AnonymiseFileNames",authors:[m.fawn],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)),$1(...args)),"}},{find:"message.attachments",replacement:{match:/(\i.uploadFiles\((\i),)/,replace:"$2.forEach(f=>f.filename=$self.anonymise(f)),$1"}},{find:".Messages.ATTACHMENT_UTILITIES_SPOILER",replacement:{match:/(?<=children:\[)(?=.{10,80}tooltip:.{0,100}\i\.\i\.Messages\.ATTACHMENT_UTILITIES_SPOILER)/,replace:"arguments[0].canEdit!==false?$self.renderIcon(arguments[0]):null,"}}],settings:ur,renderIcon:_.wrap(({upload:e,channelId:t,draftType:o})=>{let r=e.anonymise??ur.store.anonymiseByDefault;return n(GC,{tooltip:r?"Using anonymous file name":"Using normal file name",onClick:()=>{e.anonymise=!r,HC.update(t,e.id,o,{})}},r?n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},n("path",{fill:"currentColor",d:"M17.06 13C15.2 13 13.64 14.33 13.24 16.1C12.29 15.69 11.42 15.8 10.76 16.09C10.35 14.31 8.79 13 6.94 13C4.77 13 3 14.79 3 17C3 19.21 4.77 21 6.94 21C9 21 10.68 19.38 10.84 17.32C11.18 17.08 12.07 16.63 13.16 17.34C13.34 19.39 15 21 17.06 21C19.23 21 21 19.21 21 17C21 14.79 19.23 13 17.06 13M6.94 19.86C5.38 19.86 4.13 18.58 4.13 17S5.39 14.14 6.94 14.14C8.5 14.14 9.75 15.42 9.75 17S8.5 19.86 6.94 19.86M17.06 19.86C15.5 19.86 14.25 18.58 14.25 17S15.5 14.14 17.06 14.14C18.62 14.14 19.88 15.42 19.88 17S18.61 19.86 17.06 19.86M22 10.5H2V12H22V10.5M15.53 2.63C15.31 2.14 14.75 1.88 14.22 2.05L12 2.79L9.77 2.05L9.72 2.04C9.19 1.89 8.63 2.17 8.43 2.68L6
2023-11-14 11:41:09 -06:00
.vc-nsfw-img [class^=imageWrapper] img,
.vc-nsfw-img [class^=wrapperPaused] video {
2024-03-22 12:55:56 -05:00
filter: blur(${G.plugins.BlurNSFW.blurAmount}px);
2023-11-14 11:41:09 -06:00
transition: filter 0.2s;
}
.vc-nsfw-img [class^=imageWrapper]:hover img,
.vc-nsfw-img [class^=wrapperPaused]:hover video {
filter: unset;
}
2024-03-22 12:55:56 -05:00
`}var ra,_d,oS=g(()=>{"use strict";a();$();P();I();_d=y({name:"BlurNSFW",description:"Blur attachments in NSFW channels until hovered",authors:[m.Ven],patches:[{find:".embedWrapper,embed",replacement:[{match:/\.embedWrapper(?=.+?channel_id:(\i)\.id)/g,replace:"$&+($1.nsfw?' vc-nsfw-img':'')"}]}],options:{blurAmount:{type:1,description:"Blur Amount",default:10,onChange:tS}},start(){ra=document.createElement("style"),ra.id="VcBlurNsfw",document.head.appendChild(ra),tS()},stop(){ra?.remove()}})});function rR(e){let t=G.plugins.CallTimer.format==="human",o=d=>t?d:d.toString().padStart(2,"0"),r=d=>t?d:"",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+=`${o(l)}${r("h")}${i}`),(c||p||!t)&&(p+=`${o(c)}${r("m")}${i}`),p+=`${o(u)}${r("s")}`,p}var Bd,nS=g(()=>{"use strict";a();$();le();P();lt();I();Bd=y({name:"CallTimer",description:"Adds a timer to vcs",authors:[m.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 n(_,{noop:!0},n(this.Timer,{channelId:e}))},Timer({channelId:e}){let t=Ns({deps:[e]});return n("p",{style:{margin:0}},"Connected for ",n("span",{style:{fontFamily:"var(--font-code)"}},rR(t)))}})});var jd={};qe(jd,{_handleClick:()=>aR,_handlePreEdit:()=>sR,_handlePreSend:()=>iR,addClickListener:()=>Hd,addPreEditListener:()=>ti,addPreSendListener:()=>Vt,removeClickListener:()=>zd,removePreEditListener:()=>oi,removePreSendListener:()=>eo});async function iR(e,t,o,r){o.replyOptions=r;for(let i of Ud)try{if((await i(e,t,o))?.cancel)return!0}catch(s){Fd.error(`MessageSendHandler: Listener encountered an unknown error
`,s)}return!1}async function sR(e,t,o){for(let r of $d)try{if((await r(e,t,o))?.cancel)return!0}catch(i){Fd.error(`MessageEditHandler: Listener encountered an unknown error
`,i)}return!1}function Vt(e){return Ud.add(e),e}function ti(e){return $d.add(e),e}function eo(e){return Ud.delete(e)}function oi(e){return $d.delete(e)}function aR(e,t,o){e=zo.getMessage(t.id,e.id)??e;for(let r of Gd)try{r(e,t,o)}catch(i){Fd.error(`MessageClickHandler: Listener encountered an unknown error
`,i)}}function Hd(e){return Gd.add(e),e}function zd(e){return Gd.delete(e)}var Fd,Ud,$d,Gd,gn=g(()=>{"use strict";a();Ke();T();Fd=new oe("MessageEvents","#e5c890"),Ud=new Set,$d=new Set;Gd=new Set});var rS,iS=g(()=>{"use strict";a();rS=["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","t@*.x.com","s@*.x.com","ref_*@*.x.com","t@*.fixupx.com","s@*.fixupx.com","ref_*@*.fixupx.com","t@*.fxtwitter.com","s@*.fxtwitter.com","ref_*@*.fxtwitter.com","t@*.twittpr.com","s@*.twittpr.com","ref_*@*.twittpr.com","t@*.fixvx.com","s@*.fixvx.com","ref_*@*.fixvx.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","igsh","share_id@reddit.com"]});var sS,lR,Wd,aS=g(()=>{"use strict";a();gn();P();I();iS();sS=/[\\^$.*+?()[\]{}|]/g,lR=RegExp(sS.source),Wd=y({name:"ClearURLs",description:"Removes tracking garbage from URLs",authors:[m.adryd],dependencies:["MessageEventsAPI"],escapeRegExp(e){return e&&lR.test(e)?e.replace(sS,"\\$&"):e||""},createRules(){let e=rS;this.universalRules=new Set,this.rulesByHost=new Map,this.hostRules=new Map;for(let t of e){let o=t.split("@"),r=new RegExp("^"+this.escapeRegExp(o[0]).replace(/\\\*/,".+?")+"$");if(!o[1]){this.universalRules.add(r);continue}let i=new RegExp("^(www\\.)?"+this.escapeRegExp(o[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,o){(t===e||e instanceof RegExp&&e.test(t))&&o.delete(t)},replacer(e){try{var t=new URL(e)}catch{return e}return t.searchParams.entries().next().done?e:(this.universalRules.forEach(o=>{t.searchParams.forEach((r,i,s)=>{this.removeParam(o,i,s)})}),this.hostRules.forEach((o,r)=>{!o.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=Vt((e,t)=>this.onSend(t)),this.preEdit=ti((e,t,o)=>this.onSend(o))},stop(){eo(this.preSend),oi(this.preEdit)}})});var lS=g(()=>{});function fS(e){let t=e.toString(16).padStart(6,"0");ia.store.color=t,gS(t)}function cS(e){pR({theme:e})}function dR(){let e=Be([uS],()=>uS.theme),t=e==="light",o=t?"dark":"light",i=Be([pS],()=>pS.gradientPreset)!==void 0,s=SR(ia.store.color),l=!1,c=!0;return(t&&s<.26||!t&&s>.12)&&(l=!
`)}function gR(e){let t={},o=dS.exec(e);for(;o!==null;){let[,r,i]=o;t[r]=parseFloat(i),o=dS.exec(e)}Kd("clientThemeOffsets",[`.theme-light {
${mS(t,mR,"--primary-345-hsl")}
}`,`.theme-dark {
${mS(t,fR,"--primary-600-hsl")}
}`].join(`
`))}function hR(e){let t=/\.theme-light[^{]*\{[^}]*var\(--white-500\)[^}]*}/gm,o=[...e.matchAll(t)].flat(),r=/^([^{]*)\{background:var\(--white-500\)/m,i=/^([^{]*)\{background-color:var\(--white-500\)/m,s=Kl(o,M=>ql(M,r)).join(`,
`),l=Kl(o,M=>ql(M,i)).join(`,
`),c=`${s} {
background: var(--primary-100)
}`,u=`${l} {
background-color: var(--primary-100)
}`,p=/\.theme-light\{([^}]*--[^:}]*(?:background|bg)[^:}]*:var\(--white-500\)[^}]*)\}/m,d=/^(--[^:]*(?:background|bg)[^:]*):var\(--white-500\)/m,h=Kl(o,M=>ql(M,p)).map(M=>M.split(";")).flat(),b=`.theme-light {
${Kl(h,M=>ql(M,d)).map(M=>`${M}: var(--primary-100);`).join(`
`)}
}`;Kd("clientThemeLightModeFixes",[c,u,b].join(`
`))}function ql(e,t){let o=e.match(t);return o===null?null:o[1]}function Kl(e,t){return e.map(t).filter(Boolean)}function gS(e){let{hue:t,saturation:o,lightness:r}=vR(e),i=document.getElementById("clientThemeVars");i||(i=Kd("clientThemeVars")),i.textContent=`:root {
--theme-h: ${t};
2024-01-10 23:19:19 -06:00
--theme-s: ${o}%;
--theme-l: ${r}%;
2024-03-22 12:55:56 -05:00
}`}function Kd(e,t=""){let o=document.createElement("style");return o.setAttribute("id",e),o.textContent=t.split(`
`).map(r=>r.trim()).join(`
`),document.body.appendChild(o),o}async function yR(){let e="",t=document.querySelectorAll('link[rel="stylesheet"]');for(let o of t){let r=o.getAttribute("href");if(!r)continue;let i=await fetch(r);e+=await i.text()}return e}function vR(e){let t=parseInt(e.substring(0,2),16)/255,o=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,i=Math.max(t,o,r),s=Math.min(t,o,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=(o-r)/l%6:i===o?c=(r-t)/l+2:c=(t-o)/l+4,c*=60,c<0&&(c+=360)),u*=100,p*=100,{hue:c,saturation:u,lightness:p}}function SR(e){let t=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4,o=t(parseInt(e.substring(0,2),16)/255),r=t(parseInt(e.substring(2,4),16)/255),i=t(parseInt(e.substring(4,6),16)/255);return o*.2126+r*.7152+i*.0722}var cR,uR,pR,uS,pS,ia,qd,dS,mR,fR,hS=g(()=>{"use strict";a();lS();$();P();ot();we();I();H();T();cR=Ne(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR",".BACKGROUND_PRIMARY)"),uR=["#1E1514","#172019","#13171B","#1C1C28","#402D2D","#3A483D","#344242","#313D4B","#2D2F47","#322B42","#3C2E42","#422938","#b6908f","#bfa088","#d3c77d","#86ac86","#88aab3","#8693b5","#8a89ba","#ad94bb"];({saveClientTheme:pR}=x("saveClientTheme"));uS=Re("ThemeStore"),pS=Re("ClientThemesBackgroundStore");ia=N({color:{description:"Color your Discord client theme will be based around. Light mode isn't supported",type:6,default:"313338",component:()=>n(dR,null)},resetColor:{description:"Reset Theme Color",type:6,default:"313338",component:()=>n(k,{onClick:()=>fS(3224376)},"Reset Theme Color")}}),qd=y({name:"ClientTheme",authors:[m.F53,m.Nuckyz],description:"Recreation of the old client theme experiment. Add a color to your Discord client theme",settings:ia,startAt:"DOMContentLoaded",async start(){gS(ia.store.color);let e=await yR();gR(e),hR(e)},stop(){document.getElementById("clientThemeVars")?.remove(),document.getElementById("clientThemeOffsets")?.remove()}}),dS=/(--primary-\d{3}-hsl):.*?(\S*)%;/g,mR=/^--primary-[1-5]\d{2}-hsl/g,fR=/^--primary-[5-9]\d{2}-hsl/g});var Yd,yS=g(()=>{"use strict";a();P();I();Yd=y({name:"ColorSighted",description:"Removes the colorblind-friendly icons from statuses, just like 2015-2017 Discord",authors:[m.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"'}}]})});var Zd,vS=g(()=>{"use strict";a();P();rr();hi();I();H();H();T();Zd=y({name:"ConsoleShortcuts",description:"Adds shorter Aliases for many things on the window. Run `shortcutList` for a list.",authors:[m.Ven],getShortcuts(){function e(i){let s=new Map;return function(...l){let c=String(l);if(s.has(c))return s.get(c);let u=Nr(i(...l)),p=(()=>{switch(u.length){case 0:return null;case 1:return u[0];default:let d=[...new Set(u)];return d.length>1&&console.warn(`Warning: This filter matches ${u.length} modules. Make it more specific!
`,d),u[0]}})();return p&&c&&s.set(c,p),p}}let t,o=e(i=>i),r=e(Ce.byProps);return{...Vencord.Webpack.Common,wp:Vencord.Webpack,wpc:io.c,wreq:io,wpsearch:Ou,wpex:el,wpexs:i=>el(Va(i)),find:o,findAll:Nr,findByProps:r,findAllByProps:(...i)=>Nr(Ce.byProps(...i)),findByCode:e(Ce.byCode),findAllByCode:i=>Nr(Ce.byCode(i)),findComponentByCode:e(Ce.componentByCode),findAllComponentsByCode:(...i)=>Nr(Ce.componentByCode(...i)),findExportedComponent:(...i)=>r(...i)[i[0]],findStore:e(Ce.byStoreName),PluginsApi:Vencord.Plugins,plugins:Vencord.Plugins.plugins,Settings:Vencord.Settings,Api:Vencord.Api,reload:()=>location.reload(),restart:So,canonicalizeMatch:bn,canonicalizeReplace:Za,canonicalizeReplacement:ys,fakeRender:(i,s)=>{let l=t?.deref(),c=l?.closed===!1?l:window.open("about:blank","Fake Render","popup,width=500,height=500");t=new WeakRef(c),c.focus();let u=c.document;u.body.style.margin="1em",c.prepared||(c.prepared=!0,[...document.querySelectorAll("style"),...document.querySelectorAll("link[rel=stylesheet]")].forEach(p=>{let d=p.cloneNode(!0);p.parentElement?.tagName==="HEAD"?u.head.append(d):d.id?.startsWith("vencord-")||d.id?.startsWith("vcd-")?u.documentElement.append(d):u.body.append(d)})),Or.render(U.createElement(i,s),u.body.appendChild(document.createElement("div")))}}},start(){let e=this.getShortcuts();window.shortcutList=e;for(let[t,o]of Object.entries(e))window[t]=o},stop(){delete window.shortcutList;for(let e in this.getShortcuts())delete window[e]}})});var bR,Xd,SS=g(()=>{"use strict";a();It();P();I();T();bR=(e,{user:t})=>{!t||e.push(n(L.MenuItem,{id:"vc-copy-user-url",label:"Copy User URL",action:()=>Ft.copy(`<https://discord.com/users/${t.id}>`),icon:Ei}))},Xd=y({name:"CopyUserURLs",authors:[m.castdrian],description:"Adds a 'Copy User URL' option to the user context menu.",contextMenus:{"user-context":bR}})});var hn,TR,bS,TS,wR,Jd,wS,Qd,Vd,em,xS=g(()=>{"use strict";a();er();$();P();Ke();Ze();I();Zr();H();T();hn=new oe("CrashHandler"),{ModalStack:TR,DraftManager:bS,DraftType:TS,closeExpressionPicker:wR}=go(()=>{let e=Dr(Ce.byProps("pushLazy","popAll"),Ce.byProps("clearDraft","saveDraft"),Ce.byProps("DraftType"),Ce.byProps("closeExpressionPicker","openExpressionPicker"));return{ModalStack:e[0],DraftManager:e[1],DraftType:e[2]?.DraftType,closeExpressionPicker:e[3]?.closeExpressionPicker}}),Jd=N({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}}),wS=!1,Qd=!1,Vd=!0,em=y({name:"CrashHandler",description:"Utility plugin for handling and possibly recovering from crashes without a restart",authors:[m.Nuckyz],enabledByDefault:!0,settings:Jd,patches:[{find:".Messages.ERRORS_UNEXPECTED_CRASH",replacement:{match:/this\.setState\((.+?)\)/,replace:"$self.handleCrash(this,$1);"}}],handleCrash(e,t){e.setState(t),!Qd&&(Qd=!0,setTimeout(()=>{try{if(!Vd){try{Fe({color:"#eed202",title:"Discord has crashed!",body:"Awn :( Discord has crashed two times rapidly, not attempting to recover.",noPersist:!0})}catch{}return}Vd=!1,setTimeout(()=>Vd=!0,500)}catch{}try{wS||(wS=!0,Hs("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))}catch{}try{Jd.store.attemptToPreventCrashes&&this.handlePreventCrash(e)}catch(o){hn.error("Failed to handle crash",o)}},1))},handlePreventCrash(e){try{Fe({color:"#eed202",title:"Discord has crashed!",body:"Attempting to recover...",noPersist:!0})}catch{}try{let t=Ie.getChannelId();bS.clearDraft(t,TS.ChannelMessage),bS.clearDraft(t,TS.FirstThreadMessage)}catch(t){hn.debug("Failed to clear drafts.",t)}try{wR()}catch(t){hn.debug("Failed to close expression picker.",t)}try{B.dispatch({type:"CONTEXT_MENU_CLOSE"})}catch(t){hn.debug("Failed to close open context menu.",t)}try{TR.popAll()}catch(t){hn.debug("Failed to close old modals.",t)}try{dn()}catch(t){hn.debug("Failed to close all open modals.",t)}try{B.dispatch({type:"USER_PROFILE_MODAL
2023-11-14 11:41:09 -06:00
discord.gg/${r.code} \xB7
Expires: <t:${new Date(r.expires_at).getTime()/1e3}:R> \xB7
Max uses: \`${r.max_uses}\`
2024-03-22 12:55:56 -05:00
`.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 mc.getAllFriendInvites()).map(i=>`
2023-11-14 11:41:09 -06:00
_discord.gg/${i.code}_ \xB7
Expires: <t:${new Date(i.expires_at).getTime()/1e3}:R> \xB7
Times used: \`${i.uses}/${i.max_uses}\`
2024-03-22 12:55:56 -05:00
`.trim().replace(/\s+/g," "));ge(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 mc.revokeFriendInvites(),ge(t.channel.id,{content:"All friend invites have been revoked."})}}]})});var Ek,Ok,_k,Bk,Yb,Fk,Uk,Gm,Zb=g(()=>{"use strict";a();le();P();I();H();T();({Heading:Ek,Text:Ok}=x("Heading","Text")),_k=x("memberSinceContainer"),{getCreatedAtDate:Bk}=x("getCreatedAtDate"),Yb=x("clydeMoreInfo"),Fk=x("getLocale"),Uk=x("lastSection"),Gm=y({name:"FriendsSince",description:"Shows when you became friends with someone in the user popout",authors:[m.Elvyra],patches:[{find:".AnalyticsSections.USER_PROFILE}",replacement:{match:/\i.default,\{userId:(\i.id).{0,30}}\)/,replace:"$&,$self.friendsSince({ userId: $1 })"}},{find:".UserPopoutUpsellSource.PROFILE_PANEL,",replacement:{match:/\i.default,\{userId:(\i)}\)/,replace:"$&,$self.friendsSince({ userId: $1 })"}}],friendsSince:_.wrap(({userId:e})=>{let t=it.getSince(e);return t?n("div",{className:Uk.section},n(Ek,{variant:"eyebrow",className:Yb.title},"Friends Since"),n("div",{className:_k.memberSinceContainer},n(Ok,{variant:"text-sm/normal",className:Yb.body},Bk(t,Fk.getLocale())))):null},{noop:!0})})});var Hm,Xb=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/gameActivityToggle/style.css",{name:"src/plugins/gameActivityToggle/style.css",source:`[class*="withTagAsButton"] {
2023-11-14 11:41:09 -06:00
min-width: 88px !important;
}
2024-03-22 12:55:56 -05:00
`,classNames:{},dom:null});Hm="src/plugins/gameActivityToggle/style.css"});function Gk(e){let{oldIcon:t}=Jb.use(["oldIcon"]),o=t?"M23 2.27 21.73 1 1 21.73 2.27 23 23 2.27Z":"M22.7 2.7a1 1 0 0 0-1.4-1.4l-20 20a1 1 0 1 0 1.4 1.4Z",r=t?"M23.27 4.54 19.46.73 .73 19.46 4.54 23.27 23.27 4.54Z":"M23.27 4.73 19.27 .73 -.27 20.27 3.73 24.27Z";return function(){return n("svg",{width:"20",height:"20",viewBox:"0 0 24 24"},n("path",{fill:!e&&!t?"var(--status-danger)":"currentColor",mask:e?void 0:"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&&n(f,null,n("path",{fill:"var(--status-danger)",d:o}),n("mask",{id:"gameActivityMask"},n("rect",{fill:"white",x:"0",y:"0",width:"24",height:"24"}),n("path",{fill:"black",d:r}))))}}function Hk(){let e=xi.ShowCurrentGame.useSetting();return n($k,{tooltipText:e?"Disable Game Activity":"Enable Game Activity",icon:Gk(e),role:"switch","aria-checked":!e,onClick:()=>xi.ShowCurrentGame.updateSetting(t=>!t)})}var $k,Jb,zm,Qb=g(()=>{"use strict";a();$();Qe();le();P();I();H();T();Xb();$k=Ne("Button.Sizes.NONE,disabled:");Jb=N({oldIcon:{type:3,description:"Use the old icon style before Discord icon redesign",default:!1}}),zm=y({name:"GameActivityToggle",description:"Adds a button next to the mic and deafen button to toggle game activity.",authors:[m.Nuckyz,m.RuukuLada],settings:Jb,patches:[{find:".Messages.ACCOUNT_SPEAKING_WHILE_MUTED",replacement:{match:/this\.renderNameZone\(\).+?children:\[/,replace:"$&$self.GameActivityToggleButton(),"}}],GameActivityToggleButton:_.wrap(Hk,{noop:!0}),start(){Nt(Hm)},stop(){Xt(Hm)}})});var zk,jm,Vb=g(()=>{"use strict";a();P();mt();I();H();({closeExpressionPicker:zk}=x("closeExpressionPicker")),jm=y({name:"GifPaste",description:"Makes picking a gif in the gif picker insert a link into the chatbox instead of instantly sending it",authors:[m.Ven],patches:[{find:".handleSelectGIF=",replacement:{match:/\.handleSelectGIF=(\i)=>\{/,replace:".handleSelectGIF=$1=>{if (!this.props.className) return $self.handleSelect($1);"}}],handleSelect(e){e&&(kn(e.url+" "),zk())}})});function tT(e,t,o){let r=ao.getSendMessageOptionsForReply({channel:e,message:t,shouldMention:!0,showMentionToggle:!0});if(fc.store.greetMode==="Message"||o.length>1){r.stickerIds=o;let i={content:"",tts:!1,invalidEmojis:[],validNonShortcutEmojis:[]};ao._sendMessage(e.id,i,r)}else ao.sendGreetMessage(e.id,o[0],r)}function jk({channel:e,message:t}){let o=fc.use(["greetMode","multiGreetChoices"]),{greetMode:r,multiGreetChoices:i=[]}=o;return n(L.Menu,{navId:"greet-sticker-picker",onClose:()=>B.dispatch({type:"CONTEXT_MENU_CLOSE"}),"aria-label":"Greet Sticker Picker"},n(L.MenuGroup,{label:"Greet Mode"},Object.values(oT).map(s=>n(L.MenuRadioItem,{key:s,group:"greet-mode",id:"greet-mode-"+s,label:s,checked:s===r,action:()=>o.greetMode=s}))),n(L.MenuSeparator,null),n(L.MenuGroup,{label:"Greet Stickers"},eT.map(s=>n(L.MenuItem,{key:s.id,id:"greet-"+s.id,label:s.description.split(" ")[0],action:()=>tT(e,t,[s.id])}))),fc.store.unholyMultiGreetEnabled?n(f,null,n(L.MenuSeparator,null),n(L.MenuItem,{label:"Unholy Multi-Greet",id:"unholy-multi-greet"},eT.map(s=>{let l=i.some(c=>c===s.id);return n(L.MenuCheckboxItem,{key:s.id,id:"multi-greet-"+s.id,label:s.description.split(" ")[0],checked:l,disabled:!l&&i.length>=3,action:()=>{o.multiGreetChoices=l?i.filter(c=>c!==s.id):[...i,s.id]}})}),n(L.MenuSeparator,null),n(L.MenuItem,{id:"multi-greet-submit",label:"Send Greets",action:()=>tT(e,t,i),disabled:i.length===0}))):null)}var oT,fc,eT,Wm,nT=g(()=>{"use strict";a();$();P();I();H();T();oT=(o=>(o.Greet="Greet",o.NormalMessage="Message",o))(oT||{}),fc=N({g
2023-11-14 11:41:09 -06:00
: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;
}
:is(${e})::after {
content: "Attachments hidden";
color: var(--text-muted);
font-size: 80%;
}
2024-03-22 12:55:56 -05:00
`},async toggleHide(e){let t=await rT();t.delete(e)||t.add(e),await Kk(t),await this.buildCss()}})});var Ym,aT=g(()=>{"use strict";a();P();I();Ym=y({name:"iLoveSpam",description:"Do not hide messages from 'likely spammers'",authors:[m.botato,m.Nyako],patches:[{find:"hasFlag:{writable",replacement:{match:/if\((\i)<=(?:1<<30|1073741824)\)return/,replace:"if($1===(1<<20))return false;$&"}}]})});function uT(e,t,o,r){return n(ne,{text:t},i=>n("button",{...i,onClick:s=>Xk(s,e),style:{all:"unset",cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center"}},n("svg",{width:"24",height:"24",viewBox:"0 -960 960 960"},n("path",{fill:r,d:o}))))}function cT(e,t=!1){let o=to.use(["ignoredActivities"]),{ignoredActivities:r=[]}=o;return r.some(i=>i.id===e.id)?Zk(e,"var(--status-danger)"):Yk(e,t?"var(--green-300)":"var(--primary-400)")}function Xk(e,t){e.stopPropagation();let o=yr().findIndex(r=>r.id===t.id);o===-1?to.store.ignoredActivities=yr().concat(t):to.store.ignoredActivities=yr().filter((r,i)=>i!==o),xi.ShowCurrentGame.updateSetting(r=>r)}function Jk(){return n(fe,{flexDirection:"column"},n(S.FormText,{type:S.FormText.Types.DESCRIPTION},"Import the application id of the CustomRPC plugin to the allowed list"),n("div",null,n(k,{onClick:()=>{let e=G.plugins.CustomRPC?.appID;if(!e)return Mt("CustomRPC application ID is not set.",X.Type.FAILURE);Zm?.(e)&&Mt("CustomRPC application ID is already added.",X.Type.FAILURE)}},"Import CustomRPC ID")))}function Qk(e){let[t,o]=W(to.store.allowedIds??"");Zm=i=>{let s=new Set(t.split(",").map(u=>u.trim()).filter(Boolean)),l=s.has(i)||(s.add(i),!1),c=Array.from(s).join(", ");return o(c),e.setValue(c),l},se(()=>()=>{Zm=null},[]);function r(i){o(i),e.setValue(i)}return n(S.FormSection,null,n(S.FormTitle,{tag:"h3"},"Allowed List"),n(S.FormText,{className:j.bottom8,type:S.FormText.Types.DESCRIPTION},"Comma separated list of activity IDs to allow (Useful for allowing RPC activities and CustomRPC)"),n(Je,{type:"text",value:t,onChange:r,placeholder:"235834946571337729, 343383572805058560"}))}function yr(){return to.store.ignoredActivities??=[]}function Vk(e,t){if(t&&to.store.allowedIds.includes(t))return!1;switch(e){case 0:return to.store.ignorePlaying;case 1:return to.store.ignoreStreaming;case 2:return to.store.ignoreListening;case 3:return to.store.ignoreWatching;case 5:return to.store.ignoreCompeting}return!1}var lT,Yk,Zk,Zm,to,Xm,pT=g(()=>{"use strict";a();Xo();$();le();Ut();P();ot();I();H();T();lT=Re("RunningGameStore");Yk=(e,t)=>uT(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),Zk=(e,t)=>uT(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);Zm=null;to=N({importCustomRPC:{type:6,description:"",component:()=>n(Jk,null)},allowedIds:{type:6,description:"",default:"",onChange(e){let t=new Set(e.split(",").map(o=>o.trim()).filter(Boolean));to.store.allowedIds=Array.from(t).join(", ")},component:e=>n(Qk,{setValue:e.setValue})},ignorePlaying:{type:3,description:"Ignore all playing activities (These are usually game and RPC activities)",default:!1},ignoreStreaming:{type:3,description:"Ignore all streaming activities",default:!1},ignoreListening:{type:3,description:"
2023-11-14 11:41:09 -06:00
position: absolute;
inset: 0;
z-index: 9999;
border: 2px solid grey;
border-radius: 50%;
overflow: hidden;
cursor: none;
box-shadow: inset 0 0 10px 2px grey;
filter: drop-shadow(0 0 2px grey);
pointer-events: none;
2024-03-22 12:55:56 -05:00
/* negate the border offsetting the lens */
margin: -2px;
2023-11-14 11:41:09 -06:00
}
.vc-imgzoom-square {
border-radius: 0;
}
.vc-imgzoom-nearest-neighbor>img {
image-rendering: pixelated;
/* https://googlechrome.github.io/samples/image-rendering-pixelated/index.html */
}
/* make the carousel take up less space so we can click the backdrop and exit out of it */
[class*="modalCarouselWrapper_"] {
top: 0 !important;
}
[class*="carouselModal_"] {
height: 0 !important;
}
2024-03-22 12:55:56 -05:00
`,classNames:{},dom:null});tf="src/plugins/imageZoom/styles.css"});var nt,tN,of,ef=g(()=>{"use strict";a();$();Qe();Xs();zr();P();I();T();mT();Jm();fT();nt=N({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:en(1,50,4),default:2,stickToMarkers:!1},size:{description:"Radius / Size of the lens",type:5,markers:en(50,1e3,50),default:100,stickToMarkers:!1},zoomSpeed:{description:"How fast the zoom / lens size changes",type:5,markers:en(.1,5,.2),default:.5,stickToMarkers:!1}}),tN=e=>{let{square:t,nearestNeighbour:o}=nt.use(["square","nearestNeighbour"]);e.push(n(L.MenuGroup,{id:"image-zoom"},n(L.MenuCheckboxItem,{id:"vc-square",label:"Square Lens",checked:t,action:()=>{nt.store.square=!t}}),n(L.MenuCheckboxItem,{id:"vc-nearest-neighbour",label:"Nearest Neighbour",checked:o,action:()=>{nt.store.nearestNeighbour=!o}}),n(L.MenuControlItem,{id:"vc-zoom",label:"Zoom",control:(r,i)=>n(L.MenuSliderControl,{ref:i,...r,minValue:1,maxValue:50,value:nt.store.zoom,onChange:lo(s=>nt.store.zoom=s,100)})}),n(L.MenuControlItem,{id:"vc-size",label:"Lens Size",control:(r,i)=>n(L.MenuSliderControl,{ref:i,...r,minValue:50,maxValue:1e3,value:nt.store.size,onChange:lo(s=>nt.store.size=s,100)})}),n(L.MenuControlItem,{id:"vc-zoom-speed",label:"Zoom Speed",control:(r,i)=>n(L.MenuSliderControl,{ref:i,...r,minValue:.1,maxValue:5,value:nt.store.zoomSpeed,onChange:lo(s=>nt.store.zoomSpeed=s,100),renderValue:s=>`${s.toFixed(3)}x`})})))},of=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:[m.Aria],tags:["ImageUtilities"],patches:[{find:"Messages.OPEN_IN_BROWSER",replacement:{match:/return.{1,200}\.wrapper.{1,200}src:\i,/g,replace:`$&id: '${ga}',`}},{find:"handleImageLoad=",replacement:[{match:/placeholderVersion:\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:nt,contextMenus:{"image-context":tN},currentMagnifierElement:null,element:null,Magnifier:Vm,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===ga&&(this.currentMagnifierElement||(this.currentMagnifierElement=n(Vm,{size:nt.store.size,zoom:nt.store.zoom,instance:e}),this.root=Or.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(o=>({...o,mouseDown:!0}))},onMouseUp(e){e.setState(t=>({...t,mouseDown:!1}))},start(){Nt(tf),this.element=document.createElement("div"),this.element.classList.add("MagnifierContainer"),document.body.appendChild(this.element)},stop(){Xt(tf),this.root&&this.root.unmount(),this.element?.remove()}})});var gT=g(()=>{});var sf={};qe(sf,{ChatBarButton:()=>xo,_injectButtons:()=>nN,addChatBarButton:()=>wo,removeChatBarButton:()=>nn});function nN(e,t){if(!t.disabled)for(let[o,r]of rf)e.push(n(_,{noop:!0,key:o,onError:i=>oN.error(`Failed to render ${o}`,i.error)},n(r,{...t,isMainChat:t.type.analyticsName==="normal"})))}var nf,rf,oN,wo,nn,xo,En=g(()=>{"use strict";a();gT();le();Ke();H();T();gt(["buttonContainer","channelTextArea"],e=>nf=e);rf=new Map,oN=new oe("ChatButtons");wo=(e,t)=>rf.set(e,t),nn=e=>rf.delete(e),xo=_.wrap(e=>n(ne,{text:e.tooltip},({onMouseEnter:t,onMouseLeave:o})=>n("
2023-11-14 11:41:09 -06:00
background-color: rgba(240 71 71 / 15%) !important;
}
2024-03-22 12:55:56 -05:00
`,classNames:{},dom:null});Cf="src/plugins/messageLogger/deleteStyleOverlay.css"});var Rf,GT=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/messageLogger/deleteStyleText.css",{name:"src/plugins/messageLogger/deleteStyleText.css",source:`/* Message content highlighting */
2023-11-14 11:41:09 -06:00
.messagelogger-deleted [class*="contents"] > :is(div, h1, h2, h3, p) {
color: #f04747 !important;
}
/* Bot "thinking" text highlighting */
.messagelogger-deleted [class*="colorStandard"] {
color: #f04747 !important;
}
/* Embed highlighting */
.messagelogger-deleted article :is(div, span, h1, h2, h3, p) {
color: #f04747 !important;
}
.messagelogger-deleted a {
color: #be3535 !important;
text-decoration: underline;
}
2024-03-22 12:55:56 -05:00
`,classNames:{},dom:null});Rf="src/plugins/messageLogger/deleteStyleText.css"});function HT(){G.plugins.MessageLogger.deleteStyle==="text"?(Nt(Rf),Xt(Cf)):(Xt(Rf),Nt(Cf))}var RN,zT,jT,kN,kf,WT=g(()=>{"use strict";a();UT();$();Qe();le();P();Ke();I();H();T();$T();GT();RN=x("edited","communicationDisabled","isSystemMessage");zT="ml-remove-history",jT="ml-toggle-style",kN=(e,t)=>{let{message:o}=t,{deleted:r,editHistory:i,id:s,channel_id:l}=o;if(!r&&!i?.length)return;e:{if(!r)break e;let c=document.getElementById(`chat-messages-${l}-${s}`);if(!c)break e;e.push(n(L.MenuItem,{id:jT,key:jT,label:"Toggle Deleted Highlight",action:()=>c.classList.toggle("messagelogger-deleted")}))}e.push(n(L.MenuItem,{id:zT,key:zT,label:"Remove Message History",color:"danger",action:()=>{r?B.dispatch({type:"MESSAGE_DELETE",channelId:l,id:s,mlDeleted:!0}):o.editHistory=[]}}))},kf=y({name:"MessageLogger",description:"Temporarily logs deleted and edited messages.",authors:[m.rushii,m.Ven,m.AutumnVN],contextMenus:{message:kN},start(){HT()},renderEdit(e){return n(_,{noop:!0},n("div",{className:"messagelogger-edited"},Pe.parse(e.content),n(Po,{timestamp:e.timestamp,isEdited:!0,isInline:!1},n("span",{className:RN.edited}," ","(",Ye.Messages.MESSAGE_EDITED,")"))))},makeEdit(e,t){return{timestamp:new Date(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:()=>HT()},logDeletes:{type:3,description:"Whether to log deleted messages",default:!0},logEdits:{type:3,description:"Whether to log edited messages",default:!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,o){try{if(e==null||!o&&!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))))};o?t.ids.forEach(r):r(t.id)}catch(r){new oe("MessageLogger").error("Error during handleDelete",r)}return e},shouldIgnore(e,t=!1){let{ignoreBots:o,ignoreSelf:r,ignoreUsers:i,ignoreChannels:s,ignoreGuilds:l,logEdits:c,logDeletes:u}=G.plugins.MessageLogger,p=E.getCurrentUser().id;return o&&e.author?.bot||r&&e.author?.id===p||i.includes(e.author?.id)||s.includes(e.channel_id)||s.includes(ee.getChannel(e.channel_id)?.parent_id)||(t?!c:!u)||l.includes(ee.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, true)) ? 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.editHisto
`)}):(ge(o.channel.id,{content:`${vr} The tag **${e.name}** does not exist anymore! Please reload ur Discord to fix :)`}),{content:`/${e.name}`}),[NN]:!0},"CustomTags")}var vr,Ic,NN,Mc,xc,DN,LN,Nf,KT=g(()=>{"use strict";a();uo();Xo();$();P();I();vr="<:luna:1035316192220553236>",Ic="MessageTags_TAGS",NN=Symbol("MessageTags"),Mc=()=>dt(Ic).then(e=>e??[]),xc=e=>dt(Ic).then(t=>(t??[]).find(o=>o.name===e)??null),DN=async e=>{let t=await Mc();return t.push(e),kt(Ic,t),t},LN=async e=>{let t=await Mc();return t=await t.filter(o=>o.name!==e),kt(Ic,t),t};Nf=y({name:"MessageTags",description:"Allows you to save messages and to use them with a simple command.",authors:[m.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 Mc())qT(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 o=ht(e[0].options,"tag-name",""),r=ht(e[0].options,"message","");if(await xc(o))return ge(t.channel.id,{content:`${vr} A Tag with the name **${o}** already exists!`});let i={name:o,enabled:!0,message:r};qT(i),await DN(i),ge(t.channel.id,{content:`${vr} Successfully created the tag **${o}**!`});break}case"delete":{let o=ht(e[0].options,"tag-name","");if(!await xc(o))return ge(t.channel.id,{content:`${vr} A Tag with the name **${o}** does not exist!`});Zs(o),await LN(o),ge(t.channel.id,{content:`${vr} Successfully deleted the tag **${o}**!`});break}case"list":{ge(t.channel.id,{embeds:[{title:"All Tags:",description:(await Mc()).map(o=>`\`${o.name}\`: ${o.message.slice(0,72).replaceAll("\\n"," ")}${o.message.length>72?"...":""}`).join(`
`)||`${vr} Woops! There are no tags yet, use \`/tags create\` to create one!`,color:14122879,type:"rich"}]});break}case"preview":{let o=ht(e[0].options,"tag-name",""),r=await xc(o);if(!r)return ge(t.channel.id,{content:`${vr} A Tag with the name **${o}** does not exist!`});ge(t.channel.id,{content:r.message.replaceAll("\\n",`
`)});break}default:{ge(t.channel.id,{content:"Invalid sub-command"});break}}}}]})});function EN(e){let t="";for(let o=0;o<e.length;o++)t+=o%2?e[o].toUpperCase():e[o].toLowerCase();return t}var Df,YT=g(()=>{"use strict";a();uo();P();I();Df=y({name:"MoreCommands",description:"echo, lenny, mock",authors:[m.Arjix,m.echo,m.Samu],dependencies:["CommandsAPI"],commands:[{name:"echo",description:"Sends a message as Clyde (locally)",options:[cr],inputType:3,execute:(e,t)=>{let o=ht(e,"message","");ge(t.channel.id,{content:o})}},{name:"lenny",description:"Sends a lenny face",options:[cr],execute:e=>({content:ht(e,"message","")+" ( \u0361\xB0 \u035C\u0296 \u0361\xB0)"})},{name:"mock",description:"mOcK PeOpLe",options:[Ys],execute:e=>({content:EN(ht(e,"message",""))})}]})});var Lf,ZT=g(()=>{"use strict";a();uo();P();I();Lf=y({name:"MoreKaomoji",description:"Adds more Kaomoji to discord. \u30FD(\xB4\u25BD`)/",authors:[m.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:[cr],execute:t=>({content:ht(t,"message","")+e.description})}))})});function _N(e){Sr.store.tagSettings??=Ef;let[t,o]=W(Sr.store.tagSettings),r=i=>{o(i),e.setValue(i)};return n(fe,{flexDirection:"column"},Qi.map(i=>n(Tt,{style:{padding:"1em 1em 0"}},n(S.FormTitle,{style:{width:"fit-content"}},n(ne,{text:i.description},({onMouseEnter:s,onMouseLeave:l})=>n("div",{onMouseEnter:s,onMouseLeave:l},i.displayName," Tag ",n(On,{type:On.Types[i.name]})))),n(Je,{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:j.bottom16}),n(wt,{value:t[i.name]?.showInChat??!0,onChange:s=>{t[i.name].showInChat=s,r(t)},hideBorder:!0},"Show in messages"),n(wt,{value:t[i.name]?.showInNotChat??!0,onChange:s=>{t[i.name].showInNotChat=s,r(t)},hideBorder:!0},"Show in member list and profiles"))))}var ON,On,XT,Qi,Ef,Sr,Of,JT=g(()=>{"use strict";a();$();Ut();P();ot();I();H();T();ON=x("computePermissions","canEveryoneRole"),On=so(e=>e.Types?.[0]==="BOT"),XT=(e,t)=>!!e?.webhookId&&t.isNonUserBot(),Qi=[{name:"WEBHOOK",displayName:"Webhook",description:"Messages sent by webhooks",condition:XT},{name:"OWNER",displayName:"Owner",description:"Owns the server",condition:(e,t,o)=>ae.getGuild(o?.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"]}],Ef=Object.fromEntries(Qi.map(({name:e,displayName:t})=>[e,{text:t,showInChat:!0,showInNotChat:!0}]));Sr=N({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:_N,description:"fill me"}}),Of=y({name:"MoreUserTags",description:"Adds tags for webhooks and moderative roles (owner, admin, etc.)",authors:[m.Cyn,m.TheSun,m.RyanCaoDev,m.LordElias,m.AutumnVN],settings:Sr,patches:[{find:"BotTagTypes:",replacement:{match:/\((\i)=\{\}\)\)\[(\i)\.BOT/,replace:"($1=
2023-11-14 11:41:09 -06:00
position: relative;
}
2024-03-22 12:55:56 -05:00
`,classNames:{},dom:null});jf="src/plugins/noMosaic/styles.css"});var Wf,qf,iw=g(()=>{"use strict";a();$();Qe();P();I();rw();Wf=N({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"}]}}),qf=y({name:"NoMosaic",authors:[m.AutumnVN],description:"Removes Discord new image mosaic",tags:["image","mosaic","media"],settings:Wf,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:()=>Wf.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 Wf.store.mediaLayoutType},start(){Nt(jf)},stop(){Xt(jf)}})});var JN,Sa,Kf,sw=g(()=>{"use strict";a();$();P();I();H();JN=x("getMessageRequestsCount"),Sa=N({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}}),Kf=y({name:"NoPendingCount",description:"Removes the ping count of incoming friend requests, message requests, and nitro offers.",authors:[m.amia],settings:Sa,patches:[{find:"getPendingCount(){",predicate:()=>Sa.store.hideFriendRequestsCount,replacement:{match:/(?<=getPendingCount\(\)\{)/,replace:"return 0;"}},{find:"getMessageRequestsCount(){",predicate:()=>Sa.store.hideMessageRequestsCount,replacement:{match:/(?<=getMessageRequestsCount\(\)\{)/,replace:"return 0;"}},{find:".getSpamChannelsCount(),",predicate:()=>Sa.store.hideMessageRequestsCount,replacement:{match:/(?<=getSpamChannelsCount\(\),\i=)\i\.getMessageRequestsCount\(\)/,replace:"$self.getRealMessageRequestCount()"}},{find:"showProgressBadge:",predicate:()=>Sa.store.hidePremiumOffersCount,replacement:{match:/(?<=\{unviewedTrialCount:(\i),unviewedDiscountCount:(\i)\}.{0,200}\i=)\1\+\2/,replace:"0"}}],getRealMessageRequestCount(){return JN.getMessageRequestChannelIds().size}})});var Yf,aw=g(()=>{"use strict";a();P();I();Yf=y({name:"NoProfileThemes",description:"Completely removes Nitro profile themes",authors:[m.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 Pc,Zf,lw=g(()=>{"use strict";a();$();P();I();Pc=N({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}}),Zf=y({name:"NoReplyMention",description:"Disables reply pings by default",authors:[m.DustyAngel47,m.axyie,m.pylix,m.outfoxxed],settings:Pc,shouldMention(e,t){let o=Pc.store.userList.includes(e.author.id),r=Pc.store.shouldPingListed?o:!o;return Pc.store.inverseShiftReply?t!==r:!t&&r},patches:[{find:',"Message")}function',replacement:{match:/:(\i),shou
`,s),"Failed to fetch user. Check the console for more info."}}return null}var es,Ew,dD,mD,Nc,fD,gD,hg,_w=g(()=>{"use strict";a();uo();P();Uo();I();H();T();es=Ka(Rm()),Ew=0,dD=20,mD=128,Nc=10,fD=Jn(()=>Promise.all(Array.from({length:Nc},(e,t)=>Ow(`https://raw.githubusercontent.com/VenPlugs/petpet/main/frames/pet${t}.gif`)))),gD=x("getUploads");hg=y({name:"petpet",description:"Adds a /petpet slash command to create headpet gifs from any image",authors:[m.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 o=await fD(),r=ht(e,"no-server-pfp",!1);try{var i=await hD(e,t,r);if(!i)throw"No Image specified!"}catch(v){ge(t.channel.id,{content:String(v)});return}let s=await Ow(i),l=ht(e,"delay",dD),c=ht(e,"resolution",mD),u=(0,es.GIFEncoder)(),p=document.createElement("canvas");p.width=p.height=c;let d=p.getContext("2d");for(let v=0;v<Nc;v++){d.clearRect(0,0,p.width,p.height);let b=v<Nc/2?v:Nc-v,M=.8+b*.02,w=.8-b*.05,C=(1-M)*.5+.1,R=1-w-.08;d.drawImage(s,C*c,R*c,M*c,w*c),d.drawImage(o[v],0,0,c,c);let{data:A}=d.getImageData(0,0,c,c),F=(0,es.quantize)(A,256),z=(0,es.applyPalette)(A,F);u.writeFrame(z,c,c,{transparent:!0,palette:F,delay:l})}u.finish();let h=new File([u.bytesView()],"petpet.gif",{type:"image/gif"});setTimeout(()=>As.promptToUpload([h],t.channel,Ew),10)}}]})});var Bw=g(()=>{});var Fw,yg,Uw=g(()=>{"use strict";a();Bw();$();le();P();I();T();Fw=N({loop:{description:"Whether to make the PiP video loop or not",type:3,default:!0,restartNeeded:!1}}),yg=y({name:"PictureInPicture",description:"Adds picture in picture to videos (next to the Download button)",authors:[m.Nobody],settings:Fw,patches:[{find:".nonMediaAttachment]",replacement:{match:/\.nonMediaAttachment\]:!(\i).{0,10}children:\[(\S)/,replace:"$&,$1&&$2&&$self.renderPiPButton(),"}}],renderPiPButton:_.wrap(()=>n(ne,{text:"Toggle Picture in Picture"},e=>n("div",{...e,className:"vc-pip-button",role:"button",style:{cursor:"pointer",paddingTop:"4px",paddingLeft:"4px",paddingRight:"4px"},onClick:t=>{let o=t.currentTarget.parentNode.parentNode.querySelector("video"),r=document.body.appendChild(o.cloneNode(!0));r.loop=Fw.store.loop,r.style.display="none",r.onleavepictureinpicture=()=>r.remove();function i(){r.currentTime=o.currentTime,r.requestPictureInPicture(),o.pause(),r.play()}r.readyState===4?i():r.onloadedmetadata=i}},n("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24"},n("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})})});var $w=g(()=>{});var Gw,Dc=g(()=>{"use strict";a();Gw=[1752220,3066993,3447003,10181046,15277667,15844367,15105570,15158332,9807270,6323595,1146986,2067276,2123412,7419530,11342935,12745742,11027200,10038562,9936031,5533306]});async function Bn(e){let{id:t}=E.getCurrentUser();await kt(Hw+t,e)}async function bg(){let e=E.getCurrentUser()?.id;await vD(e),await wD(e),Wt()}async function vD(e){pe=await dt(Hw+e)??[]}function jw(e){return pe.find(t=>t.id===e)}async function Ww(e){pe.push(e),await Bn(pe)}async function qw(e){let t=pe.findIndex(o=>o.id===e.id);t!==-1&&(pe[t]=e,await Bn(pe))}async function Kw(e,t){let o=pe.find(r=>r.id===t);!o||o.channels.includes(e)||(o.channels.push(e),await Bn(pe))}async function Yw(e){let t=pe.find(o=>o.channels.includes(e));!t||(t.channels=t.channels.filter(o=>o!==e),await Bn(pe))}as
`,t))},stop(){Yg=void 0},decodeError(e,...t){let o=0;return Yg?.[e]?.replace(/%s/g,()=>{let r=t[o];return o++,r})}})});var Jg={};qe(Jg,{ServerListRenderPosition:()=>Wc,addServerListElement:()=>Ca,removeServerListElement:()=>Ra,renderAll:()=>iL});function Xg(e){return e===0?nL:rL}function Ca(e,t){Xg(e).add(t)}function Ra(e,t){Xg(e).delete(t)}var oL,Wc,nL,rL,iL,qc=g(()=>{"use strict";a();Ke();oL=new oe("ServerListAPI"),Wc=(o=>(o[o.Above=0]="Above",o[o.In=1]="In",o))(Wc||{}),nL=new Set,rL=new Set;iL=e=>{let t=[];for(let o of Xg(e))try{t.unshift(o())}catch(r){oL.error("Failed to render server list element:",r)}return t}});function sL(){let e=[];Object.values(ae.getGuilds()).forEach(t=>{wn.getChannels(t.id).SELECTABLE.concat(wn.getChannels(t.id).VOCAL).forEach(o=>{!_r.hasUnread(o.channel.id)||e.push({channelId:o.channel.id,messageId:_r.lastMessageId(o.channel.id),readStateType:0})})}),B.dispatch({type:"BULK_ACK",context:"APP",channels:e})}var aL,Qg,z2=g(()=>{"use strict";a();qc();P();I();T();aL=()=>n(k,{onClick:sL,size:k.Sizes.MIN,color:k.Colors.BRAND,style:{marginTop:"2px",marginBottom:"8px",marginLeft:"9px"}},"Read all"),Qg=y({name:"ReadAllNotificationsButton",description:"Read all server notifications with a single button click!",authors:[m.kemo],dependencies:["ServerListAPI"],renderReadAllButton:()=>n(aL,null),start(){Ca(0,this.renderReadAllButton)},stop(){Ra(0,this.renderReadAllButton)}})});var mo,Kc=g(()=>{"use strict";a();$();I();mo=N({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 Vg=g(()=>{"use strict";a()});async function uL(){yt.delMany(["relationship-notifier-guilds","relationship-notifier-groups","relationship-notifier-friends"])}async function eh(){await uL();let[e,t,o]=await yt.getMany([j2(),W2(),q2()]);if(await Promise.all([Zc(),Xc(),ka()]),mo.store.offlineRemovals){if(mo.store.groups&&t?.size)for(let[r,i]of t)ns.has(r)||Un(`You are no longer in the group ${i.name}.`,i.iconURL);if(mo.store.servers&&e?.size)for(let[r,i]of e)os.has(r)||Un(`You are no longer in the server ${i.name}.`,i.iconURL);if(mo.store.friends&&o?.friends.length)for(let r of o.friends){if(ui.friends.includes(r))continue;let i=await Bt.getUser(r).catch(()=>{});i&&Un(`You are no longer friends with ${Nn(i)}.`,i.getAvatarURL(void 0,void 0,!1),()=>bo(i.id))}if(mo.store.friendRequestCancels&&o?.requests?.length)for(let r of o.requests){if(ui.requests.includes(r)||[1,2,4].includes(it.getRelationshipType(r)))continue;let i=await Bt.getUser(r).catch(()=>{});i&&Un(`Friend request from ${Nn(i)} has been revoked.`,i.getAvatarURL(void 0,void 0,!1),()=>bo(i.id))}}}function Un(e,t,o){mo.store.notices&&Yc.showNotice(e,"OK",()=>Yc.popNotice()),Fe({title:"Relationship Notifier",body:e,icon:t,onClick:o})}function K2(e){return os.get(e)}function th(e){os.delete(e),Zc()}async function Zc(){os.clear();let e=E.getCurrentUser().id;for(let[t,{name:o,icon:r}]of Object.entries(ae.getGuilds()))Ge.isMember(t,e)&&os.set(t,{id:t,name:o,iconURL:r&&`https://cdn.discordapp.com/icons/${t}/${r}.png`});await yt.set(j2(),os)}function Y2(e){return ns.get(e)}function oh(e){ns.delete(e),Xc()}async function Xc(){ns.clear();for(let{type:e,id:t,name:o,rawRecipients:r,icon:i}of ee.getSortedPrivateChannels())e===3&&ns.set(t,{id:t,name:o||r.map(s=>s.username).join(", "),iconURL:i&&`https://cdn.discordapp.com/channel-icons/${t}/${i}.png`});await yt.set(W2(),ns)}async function ka(){ui.friends=[],ui.requests=[];let e=it.getRelationships();for(let t in e)switch(e[t]){case 1:ui.friends.push(t);break;case 3:ui.requests.push(t);break}await yt
2023-11-14 11:41:09 -06:00
import React from "react";
const handleClick = async () =>
console.log((await import("@webpack/common")).Clipboard.copy("\\u200b"));
export const Example: React.FC<{
real: boolean,
shigged?: number,
}> = ({ real, shigged }) => <>
<p>{\`Shigg\${real ? \`ies\${shigged === 0x1B ? "t" : ""}\` : "y"}\`}</p>
<button onClick={handleClick}>Click Me</button>
</>;
2024-03-22 12:55:56 -05:00
`});var rM=kr((Nae,Ah)=>{"use strict";a();var $L=Object.prototype.hasOwnProperty,no="~";function Ea(){}Object.create&&(Ea.prototype=Object.create(null),new Ea().__proto__||(no=!1));function GL(e,t,o){this.fn=e,this.context=t,this.once=o||!1}function nM(e,t,o,r,i){if(typeof o!="function")throw new TypeError("The listener must be a function");var s=new GL(o,r||e,i),l=no?no+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 su(e,t){--e._eventsCount===0?e._events=new Ea:delete e._events[t]}function Kt(){this._events=new Ea,this._eventsCount=0}Kt.prototype.eventNames=function(){var t=[],o,r;if(this._eventsCount===0)return t;for(r in o=this._events)$L.call(o,r)&&t.push(no?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(o)):t};Kt.prototype.listeners=function(t){var o=no?no+t:t,r=this._events[o];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,l=new Array(s);i<s;i++)l[i]=r[i].fn;return l};Kt.prototype.listenerCount=function(t){var o=no?no+t:t,r=this._events[o];return r?r.fn?1:r.length:0};Kt.prototype.emit=function(t,o,r,i,s,l){var c=no?no+t:t;if(!this._events[c])return!1;var u=this._events[c],p=arguments.length,d,h;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,o),!0;case 3:return u.fn.call(u.context,o,r),!0;case 4:return u.fn.call(u.context,o,r,i),!0;case 5:return u.fn.call(u.context,o,r,i,s),!0;case 6:return u.fn.call(u.context,o,r,i,s,l),!0}for(h=1,d=new Array(p-1);h<p;h++)d[h-1]=arguments[h];u.fn.apply(u.context,d)}else{var v=u.length,b;for(h=0;h<v;h++)switch(u[h].once&&this.removeListener(t,u[h].fn,void 0,!0),p){case 1:u[h].fn.call(u[h].context);break;case 2:u[h].fn.call(u[h].context,o);break;case 3:u[h].fn.call(u[h].context,o,r);break;case 4:u[h].fn.call(u[h].context,o,r,i);break;default:if(!d)for(b=1,d=new Array(p-1);b<p;b++)d[b-1]=arguments[b];u[h].fn.apply(u[h].context,d)}}return!0};Kt.prototype.on=function(t,o,r){return nM(this,t,o,r,!1)};Kt.prototype.once=function(t,o,r){return nM(this,t,o,r,!0)};Kt.prototype.removeListener=function(t,o,r,i){var s=no?no+t:t;if(!this._events[s])return this;if(!o)return su(this,s),this;var l=this._events[s];if(l.fn)l.fn===o&&(!i||l.once)&&(!r||l.context===r)&&su(this,s);else{for(var c=0,u=[],p=l.length;c<p;c++)(l[c].fn!==o||i&&!l[c].once||r&&l[c].context!==r)&&u.push(l[c]);u.length?this._events[s]=u.length===1?u[0]:u:su(this,s)}return this};Kt.prototype.removeAllListeners=function(t){var o;return t?(o=no?no+t:t,this._events[o]&&su(this,o)):(this._events=new Ea,this._eventsCount=0),this};Kt.prototype.off=Kt.prototype.removeListener;Kt.prototype.addListener=Kt.prototype.on;Kt.prefixed=no;Kt.EventEmitter=Kt;typeof Ah<"u"&&(Ah.exports=Kt)});var Nh=kr(ls=>{"use strict";a();Object.defineProperty(ls,"__esModule",{value:!0});ls.Channel=ls.ChannelPort=void 0;var HL=rM(),au="vapIpc",Ch=Symbol.for("vapIpc.edgeCreate"),Rh=class{_pipes=new Map;_listeners=new Map;_createListenerMap(){return new Map}_emit(t,o,...r){for(let[i,s]of this._listeners.entries()){if(i===t)continue;let l=s.get(o);l&&l(...r)}}createPipe(t){let o=this.getPipe(t);if(o)return o;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}};ls.ChannelPort=Rh;var kh=class{id;_edges=new Map;_callbacks=new Map;_callers=new Map;_edgePipes=new Map;_pipes=[];_emitter=new HL.EventEmitter;_logger;_destroyed=!1;constructor(t){this.id=t}addPipe(t){t.listen(`${au}:handshake`,o=>{this._handleHandshake(t,o)}),t.listen(`${au}:message`,o=>{this._handleMessage(t,o)}),this._pipes.push(t),this._logger?.log(`Adding pipe to channel "${this.id}"`)}setLogger(t){this._logger=t}_handleHandshake(t,o){if(this.id===o.id)return;this._logger?.log(`\u{1F91D} "${o.id}" -> "${this.id}" (edges: [${o.channelIds.join(", ")}])`);let r=this._edges.get(o.id);if(r){let i=o.channelIds.filter(s=>!r?.channelIds.inclu
`,classNames:{},dom:null});_a="src/plugins/shikiCodeblocks.desktop/devicon.css"});var Ba=g(()=>{"use strict";a()});var VL,wr,zh=g(()=>{"use strict";a();$();Qe();we();Cn();I();Oa();$h();Hh();Ba();VL=Object.keys(jn),wr=N({theme:{type:4,description:"Default themes",options:VL.map(e=>({label:An(zp(e)),value:jn[e],default:jn[e]===jn.DarkPlus})),onChange:xe.setTheme},customTheme:{type:0,description:"A link to a custom vscode theme",placeholder:jn.MaterialCandy,onChange:e=>{xe.setTheme(e||wr.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"?Xt(_a):Nt(_a)}},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=zu(e);return t?t.pathname.endsWith(".json")?!0:"Must be a json file":"Must be a valid URL"}}})});function hM(e,t){let o=wr.use(e),[r,i]=U.useState(!1),s={...o,...t},l=s.customTheme||s.theme;if(t){let c=xe.currentThemeUrl&&l&&l!==xe.currentThemeUrl,u=Object.keys(t).length===0;r&&(!c||u)&&i(!1),!r&&c&&(i(!0),xe.setTheme(l))}return{...s,isThemeLoading:l!==xe.currentThemeUrl}}var yM=g(()=>{"use strict";a();T();Oa();zh()});function vM(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 SM=g(()=>{"use strict";a()});var sn,bM,Fa=g(()=>{"use strict";a();Qe();T();cu();Ba();sn=ve("shiki-"),bM=({lang:e,tryHljs:t})=>{let o=e?Br?.getLanguage?.(e):null,i=(e?di(e):null)?.name;switch(t){case"ALWAYS":return!0;case"PRIMARY":return!!o||e==="";case"SECONDARY":return!i&&!!o;case"NEVER":return!1;default:return!1}}});function TM(e){let[t,o]=U.useState(!1);function r(i){Ft.copy(i),o(!0),setTimeout(()=>{o(!1)},e)}return[t,r]}var wM=g(()=>{"use strict";a();T()});function xM({content:e,...t}){let[o,r]=TM(1e3);return n("button",{...t,style:{...t.style,cursor:o?"default":void 0},onClick:()=>r(e)},o?"Copied!":"Copy")}var MM=g(()=>{"use strict";a();wM()});function IM({content:e,theme:t}){let o=[];return Ft.SUPPORTS_COPY&&o.push(n(xM,{content:e,className:sn("btn"),style:{backgroundColor:t.accentBgColor,color:t.accentFgColor}})),n("div",{className:sn("btns")},o)}var PM=g(()=>{"use strict";a();T();Fa();MM()});var AM,CM=g(()=>{"use strict";a();T();Fa();AM=({theme:e,useHljs:t,lang:o,content:r,tokens:i})=>{let s;if(t)try{let{value:c}=Br.highlight(o,r,!0);s=c.split(`
2024-01-10 23:19:19 -06:00
`).map((u,p)=>n("span",{key:p,dangerouslySetInnerHTML:{__html:u}}))}catch{s=r.split(`
`).map(c=>n("span",null,c))}else s=(i??r.split(`
`).map(u=>[{color:e.plainColor,content:u}])).map(u=>u.length===0?n("span",null,`
2024-03-22 12:55:56 -05:00
`):n(f,null,u.map(({content:p,color:d,fontStyle:h},v)=>n("span",{key:v,style:{color:d,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)=>n("tr",{key:u},n("td",{style:{color:e.plainColor}},u+1),n("td",null,c)));return n("table",{className:sn("table")},...l)}});function RM({langName:e,useDevIcon:t,shikiLang:o}){return e?n("div",{className:sn("lang")},t!=="DISABLED"&&o?.devicon&&n("i",{className:`${sn("devicon")} devicon-${o.devicon}${t==="COLOR"?" colored":""}`}),e):n(f,null)}var kM=g(()=>{"use strict";a();Ba();Fa()});var uu,e5,NM=g(()=>{"use strict";a();le();lt();T();cu();Oa();yM();Uh();SM();Fa();PM();CM();kM();uu=e=>n("pre",{className:sn("container")},n(_,null,n(e5,{...e}))),e5=({lang:e,content:t,isPreview:o,tempSettings:r})=>{let{tryHljs:i,useDevIcon:s,bgOpacity:l}=hM(["tryHljs","useDevIcon","bgOpacity"],r),{id:c,theme:u}=cM(),p=e?di(e):null,d=bM({lang:e,tryHljs:i}),[h,v]=Wu(!0),[b]=st(async()=>!p||d||!v?null:await xe.tokenizeCode(t,e),{fallbackValue:null,deps:[e,t,c,v]}),M={plainColor:u?.fg||"var(--text-normal)",accentBgColor:u?.colors?.["statusBar.background"]||(d?"#7289da":"#007BC8"),accentFgColor:u?.colors?.["statusBar.foreground"]||"#FFF",backgroundColor:u?.colors?.["editor.background"]||"var(--background-secondary)"},w;return e&&(w=d?Br?.getLanguage?.(e)?.name:p?.name),n("div",{ref:h,className:sn("root",{plain:!w,preview:o}),style:{backgroundColor:d?M.backgroundColor:`rgba(${vM(M.backgroundColor).concat(l/100).join(", ")})`,color:M.plainColor}},n("code",null,n(RM,{langName:w,useDevIcon:s,shikiLang:p}),n(AM,{theme:M,useHljs:d,lang:e,content:t,tokens:b}),!o&&n(IM,{content:t,theme:M})))}});var DM,LM,EM=g(()=>{"use strict";a();DM=new Map,LM=()=>{DM.forEach(e=>e.remove()),DM.clear()}});var jh,OM=g(()=>{"use strict";a();eM();Qe();P();I();oM();Oa();NM();Hh();zh();Ba();EM();jh=y({name:"ShikiCodeblocks",description:"Brings vscode-style codeblocks into Discord, powered by Shiki",authors:[m.Vap],patches:[{find:"codeBlock:{react(",replacement:{match:/codeBlock:\{react\((\i),(\i),(\i)\)\{/,replace:"$&return $self.renderHighlighter($1,$2,$3);"}},{find:".PREVIEW_NUM_LINES",replacement:{match:/(?<=function \i\((\i)\)\{)(?=let\{text:\i,language:)/,replace:"return $self.renderHighlighter({lang:$1.language,content:$1.text});"}}],start:async()=>{wr.store.useDevIcon!=="DISABLED"&&Nt(_a),await xe.init(wr.store.customTheme||wr.store.theme)},stop:()=>{xe.destroy(),LM()},settingsAboutComponent:({tempSettings:e})=>uu({lang:"tsx",content:tM,isPreview:!0,tempSettings:e}),settings:wr,shiki:xe,createHighlighter:uu,renderHighlighter:({lang:e,content:t})=>uu({lang:e?.toLowerCase(),content:t,isPreview:!1})})});var Wh,_M=g(()=>{"use strict";a();P();I();Wh=y({name:"ShowAllMessageButtons",description:"Always show all message buttons no matter if you are holding the shift key or not.",authors:[m.Nuckyz],patches:[{find:".Messages.MESSAGE_UTILITIES_A11Y_LABEL",replacement:{match:/isExpanded:\i&&(.+?),/,replace:"isExpanded:$1,"}}]})});var BM=g(()=>{});function UM(){let e=Ss(FM.colors.INTERACTIVE_MUTED).hex(),t=Ss(FM.colors.INTERACTIVE_ACTIVE).hex();return n(t5,{color:e,forcedIconColor:t,size:16,tooltipText:Ye.Messages.CONNECTION_VERIFIED})}var FM,t5,$M=g(()=>{"use strict";a();H();T();FM=so(e=>e.colors?.INTERACTIVE_MUTED?.css),t5=Ne(".CONNECTIONS_ROLE_OFFICIAL_ICON_TOOLTIP")});function GM({id:e,theme:t}){let o=ho.getUserProfile(e);if(!o)return null;let r=o.connectedAccounts;return r?.length?n(o5,null,n(V,{tag:"h2",variant:"eyebrow",style:{color:"var(--header-primary)"}},"Connections"),n(fe,{style:{marginTop:"8px",gap:a5(pu.store.iconSpacing),flexWrap:"wrap"}},r.map(i=>n(u5,{connection:i,theme:t})))):null}function u5({connection:e,theme:t}){let o=i5.get(r5.useLegacyPlatformType(e.type)),r=o.getPlatformUserUrl?.(e),i=n("img",{"aria-label":e.name,src:t==="light"?o.icon.lightSVG:o.icon.darkSVG,style:{width:pu.store.iconSize,height:pu.store.iconSize}}),s=r?Ei:Dl;return n(ne,{text:n("span",{className:"vc-sc-tooltip"},e.name,e.verified&&n(UM,null),n(s,{height:16,width:16}))
2023-11-14 11:41:09 -06:00
height: 0;
opacity: 0;
pointer-events: none;
transition: 0.2s;
transition-property: height;
}
#vc-spotify-player:hover .vc-spotify-button-row {
opacity: 1;
height: 32px;
pointer-events: auto;
/* only transition opacity on show to prevent clipping */
transition-property: height, opacity;
}
2024-03-22 12:55:56 -05:00
`,classNames:{},dom:null});tI="src/plugins/spotifyControls/hoverOnly.css"});var nI=g(()=>{});var Ve,rI=g(()=>{"use strict";a();$();H();T();Ve=go(()=>{let{Store:e}=xs,t=Lr("getActiveSocketAndDevice"),o=Lr("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=G.plugins.SpotifyControls.useSpotifyUris||Vencord.Plugins.isPluginEnabled("OpenInApp")?"spotify:"+c.replaceAll("/",(p,d)=>d===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:d}=t.getActiveSocketAndDevice();return o.SpotifyAPI[c](d.accountId,d.accessToken,{url:r+u,...p})}}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 oy(e){let t=e/1e3/60,o=Math.floor(t),r=Math.floor((t-o)*60);return`${o.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}function ds(e,t){return()=>n("svg",{className:Q(rt("button-icon"),rt(t)),height:"24",width:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-label":t,focusable:!1},n("path",{d:e}))}function $a(e){return n("button",{className:rt("button"),...e},e.children)}function k5({name:e,path:t}){let o=`spotify-copy-${e}`,r=`spotify-open-${e}`;return n(L.Menu,{navId:`spotify-${e}-menu`,onClose:()=>B.dispatch({type:"CONTEXT_MENU_CLOSE"}),"aria-label":`Spotify ${e} Menu`},n(L.MenuItem,{key:o,id:o,label:`Copy ${e} Link`,action:()=>Ao("https://open.spotify.com"+t),icon:Ei}),n(L.MenuItem,{key:r,id:r,label:`Open ${e} in Spotify`,action:()=>Ve.openExternal(t),icon:Xr}))}function N5(e,t){return o=>Yt.openContextMenu(o,()=>n(k5,{name:e,path:t}))}function D5(){let[e,t,o]=Be([Ve],()=>[Ve.isPlaying,Ve.shuffle,Ve.repeat]),[r,i]=(()=>{switch(o){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 ${o}`)}})();return n(fe,{className:rt("button-row"),style:{gap:0}},n($a,{className:Q(rt("button"),rt(t?"shuffle-on":"shuffle-off")),onClick:()=>Ve.setShuffle(!t)},n(R5,null)),n($a,{onClick:()=>Ve.prev()},n(P5,null)),n($a,{onClick:()=>Ve.setPlaying(!e)},e?n(I5,null):n(M5,null)),n($a,{onClick:()=>Ve.next()},n(A5,null)),n($a,{className:Q(rt("button"),rt(i)),onClick:()=>Ve.setRepeat(r),style:{position:"relative"}},o==="track"&&n("span",{className:rt("repeat-1")},"1"),n(C5,null)))}function E5(){let{duration:e}=Ve.track,[t,o,r]=Be([Ve],()=>[Ve.mPosition,Ve.isSettingPosition,Ve.isPlaying]),[i,s]=W(t);return se(()=>{if(r&&!o){s(Ve.position);let l=setInterval(()=>{s(c=>c+1e3)},1e3);return()=>clearInterval(l)}},[t,o,r]),n("div",{id:rt("progress-bar")},n(S.FormText,{variant:"text-xs/medium",className:rt("progress-time")+" "+rt("time-left"),"aria-label":"Progress"},oy(i)),n(L.MenuSliderControl,{minValue:0,maxValue:e,value:i,onChange:l=>{o||(s(l),L5(l))},renderValue:oy}),n(S.FormText,{variant:"text-xs/medium",className:rt(
`);return n(S.FormSection,{title:"Server Trace",tag:"h2"},n("code",null,n(fe,{flexDirection:"column",style:{color:"var(--header-primary)",gap:5,userSelect:"text"}},t.map(o=>n("span",null,o)))))}function G5(){if(!Ga?.logs)return n("div",null,"Loading...");let e=Ga.logGroups.find(t=>t.serverTrace)?.serverTrace;return n(U.Fragment,null,n(U5,{title:"Startup Timings",logs:Ga.logs,traceEnd:Ga.endTime_}),n("div",{style:{marginTop:5}},"\xA0"),e&&n($5,{trace:e}))}var Ga,H5,dI=g(()=>{"use strict";a();le();Ut();H();T();Ga=x("markWithDelta","markAndLog","markAt");H5=_.wrap(G5)});var uy,mI=g(()=>{"use strict";a();P();lt();I();uy=y({name:"StartupTimings",description:"Adds Startup Timings to the Settings menu",authors:[m.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:bt(()=>(dI(),Xn(pI)).default)})});var du,py,fI=g(()=>{"use strict";a();$();P();I();T();du=N({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}}}),py=y({name:"SuperReactionTweaks",description:"Customize the limit of Super Reactions playing at once, and super react by default",authors:[m.FieryFlames,m.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:".trackEmojiSearchEmpty,200",replacement:{match:/(\.trackEmojiSearchEmpty,200(?=.+?isBurstReaction:(\i).+?(\i===\i\.EmojiIntention.REACTION)).+?\[\2,\i\]=\i\.useState\().+?\)/,replace:(e,t,o,r)=>`${t}$self.shouldSuperReactByDefault&&${r})`}}],settings:du,shouldPlayBurstReaction(e){return!!(du.store.unlimitedSuperReactionPlaying||e<=du.store.superReactionPlayingLimit)},get shouldSuperReactByDefault(){return du.store.superReactByDefault&&E.getCurrentUser().premiumType!=null}})});function SI(e){let t=e.match(/^(\/)?(.+?)(?:\/([gimsuy]*))?$/);return t?new RegExp(t[2],t[3]?.split("").filter((o,r,i)=>i.indexOf(o)===r).join("")??"g"):new RegExp(e)}function j5(e){try{return SI(e),null}catch(t){return n("span",{style:{color:"var(--text-danger)"}},String(t))}}function dy({initialValue:e,onChange:t,placeholder:o}){let[r,i]=W(e);return n(Je,{placeholder:o,value:r,onChange:i,spellCheck:!1,onBlur:()=>r!==e&&t(r)})}function gI({title:e,rulesArray:t,rulesKey:o,update:r}){let i=e==="Using Regex";async function s(c){c!==t.length-1&&(t.splice(c,1),await yt.set(o,t),r())}async function l(c,u,p){u===t.length-1&&t.push(vI()),t[u][p]=c,t[u].find===""&&t[u].replace===""&&t[u].onlyIfIncludes===""&&u!==t.length-1&&t.splice(u,1),await yt.set(o,t),r()}return n(f,null,n(S.FormTitle,{tag:"h4"},e),n(fe,{flexDirection:"column",style:{gap:"0.5em"}},t.map((c,u)=>n(U.Fragment,{key:`${c.find}-${u}`},n(fe,{flexDirection:"row",style:{gap:0}},n(fe,{flexDirection:"row",style:{flexGrow:1,gap:"0.5em"}},n(dy,{placeholder:"Find",initialValue:c.find,onChange:p=>l(p,u,"find")}),n(dy,{placeholder:"Replace",initialValue:c.replace,onChange:p=>l(p,u,"replace")}),n(dy,{placeholder:"Only if includes",initialValue:c.onlyIfIncludes,onChange:p=>l(p,u,"onlyIfIncludes")})),n(k,{size:k.Sizes.MIN,onClick:()=>s(u),style:{background:"none",color:"var(--status-danger)",...u===t.length-1?{visibility:"hidden",pointerEvents:"none"}:{}}},n(Oi,null))),i&&j5(c.find)))))}function W5(){let[e,t]=W("");return n(f,null,n(S.FormTitle,{tag:"h4"},"Test Rules"),n(Je,{placeholder:"Type a message",onChange:t}),n(Je,{placeholder:"Message with rules applied",editable:!1,value:bI(e)}))}function bI(e){if(e.length===0)return e;if(fu)for(let t of fu)!t.f
`)).replace(/^\s|\s$/g,""));if(gu){for(let t of gu)if(!!t.find&&!(t.onlyIfIncludes&&!e.includes(t.onlyIfIncludes)))try{let o=SI(t.find);e=e.replace(o,t.replace.replaceAll("\\n",`
`))}catch{new oe("TextReplace").error(`Invalid regex: ${t.find}`)}}return e=e.trim(),e}var hI,yI,vI,mu,fu,gu,z5,q5,my,TI=g(()=>{"use strict";a();ei();gn();$();Ut();It();P();Ke();lt();I();T();hI="TextReplace_rulesString",yI="TextReplace_rulesRegex",vI=()=>({find:"",replace:"",onlyIfIncludes:""}),mu=()=>[vI()],fu=mu(),gu=mu(),z5=N({replace:{type:6,description:"",component:()=>{let e=Co();return n(f,null,n(gI,{title:"Using String",rulesArray:fu,rulesKey:hI,update:e}),n(gI,{title:"Using Regex",rulesArray:gu,rulesKey:yI,update:e}),n(W5,null))}}});q5="1102784112584040479",my=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:[m.AutumnVN,m.TheKodeToad],dependencies:["MessageEventsAPI"],settings:z5,async start(){fu=await yt.get(hI)??mu(),gu=await yt.get(yI)??mu(),this.preSend=Vt((e,t)=>{e!==q5&&(t.content=bI(t.content))})},stop(){eo(this.preSend)}})});var fy,wI=g(()=>{"use strict";a();P();I();T();fy=y({name:"ThemeAttributes",description:"Adds data attributes to various elements for theming purposes",authors:[m.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===E.getCurrentUser()?.id}}})});var gy,xI=g(()=>{"use strict";a();P();I();gy=y({name:"TimeBarAllActivities",description:"Adds the Spotify time bar to all activities if they have start and end timestamps",authors:[m.fawn],patches:[{find:"}renderTimeBar(",replacement:{match:/renderTimeBar\((.{1,3})\){.{0,50}?let/,replace:"renderTimeBar($1){let"}}]})});var MI=g(()=>{});var Dt,Ha=g(()=>{"use strict";a();$();I();Dt=N({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}}).withPrivateSettings()});var hu,hy=g(()=>{"use strict";a();hu={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"
${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 qn,ja=g(()=>{"use strict";a();Qe();Ha();qn=ve("vc-trans-")});function Y5({settingsKey:e,includeAuto:t}){let o=Dt.use([e])[e],r=Rt(()=>{let i=Object.entries(hu).map(([s,l])=>({value:s,label:l}));return t||i.shift(),i},[]);return n("section",{className:j.bottom16},n(S.FormTitle,{tag:"h3"},Dt.def[e].description),n(il,{options:r,value:r.find(i=>i.value===o),placeholder:"Select a language",maxVisibleItems:5,closeOnSelect:!0,onChange:i=>Dt.store[e]=i}))}function Z5(){let e=Dt.use(["autoTranslate"]).autoTranslate;return n(wt,{value:e,onChange:t=>Dt.store.autoTranslate=t,note:Dt.def.autoTranslate.description,hideBorder:!0},"Auto Translate")}function II({rootProps:e}){return n(ye,{...e},n(Le,{className:qn("modal-header")},n(S.FormTitle,{tag:"h2"},"Translate"),n(pt,{onClick:e.onClose})),n(ke,{className:qn("modal-content")},K5.map(t=>n(Y5,{key:t,settingsKey:t,includeAuto:t.endsWith("Input")})),n(S.FormDivider,{className:j.bottom16}),n(Z5,null)))}var K5,PI=g(()=>{"use strict";a();ot();Ze();T();hy();Ha();ja();K5=["receivedInput","receivedOutput","sentInput","sentOutput"]});function ms({height:e=24,width:t=24,className:o}){return n("svg",{viewBox:"0 96 960 960",height:e,width:t,className:Q(qn("icon"),o)},n("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"}))}var AI,yy=g(()=>{"use strict";a();En();ot();we();Ze();T();Ha();PI();ja();AI=({isMainChat:e})=>{let{autoTranslate:t}=Dt.use(["autoTranslate"]);if(!e)return null;let o=()=>{let r=!t;Dt.store.autoTranslate=r,r&&Dt.store.showAutoTranslateAlert!==!1&&et.show({title:"Vencord Auto-Translate Enabled",body:n(f,null,n(S.FormText,null,"You just enabled auto translate (by right clicking the Translate icon). Any message you send will automatically be translated before being sent."),n(S.FormText,{className:j.top16},"If this was an accident, disable it again, or it will change your message content before sending.")),cancelText:"Disable Auto-Translate",confirmText:"Got it",secondaryConfirmText:"Don't show again",onConfirmSecondary:()=>Dt.store.showAutoTranslateAlert=!1,onCancel:()=>Dt.store.autoTranslate=!1})};return n(xo,{tooltip:"Open Translate Modal",onClick:r=>{if(r.shiftKey)return o();de(i=>n(II,{rootProps:i}))},onContextMenu:()=>o(),buttonProps:{"aria-haspopup":"dialog"}},n(ms,{className:qn({"auto-translate":t,"chat-button":!0})}))}});function Sy(e,t){vy.get(e)(t)}function X5({onDismiss:e}){return n("button",{onClick:e,className:qn("dismiss")},"Dismiss")}function CI({message:e}){let[t,o]=W();return se(()=>{if(!e.vencordEmbeddedBy)return vy.set(e.id,o),()=>void vy.delete(e.id)},[]),t?n("span",{className:qn("accessory")},n(ms,{width:16,height:16}),Pe.parse(t.text)," ","(translated from ",hu[t.src]??t.src," - ",n(X5,{onDismiss:()=>o(void 0)}),")"):null}var vy,RI=g(()=>{"use strict";a();T();hy();yy();ja();vy=new Map});var J5,by,kI=g(()=>{"use strict";a();MI();En();Eo();Tc();gn();li();P();I();T();Ha();yy();RI();ja();J5=(e,{message:t})=>{if(!t.content)return;let o=ut("copy-text",e);!o||o.splice(o.findIndex(r=>r?.props?.id==="copy-text")+1,0,n(L.MenuItem,{id:"vc-trans",label:"Translate",icon:ms,action:async()=>{let r=await za("received",t.content);Sy(t.id,r)}}))},by=y({name:"Translate",description:"Translate messages with Google Translate",authors:[m.Ven],dependencies:["MessageAccessoriesAPI","MessagePopoverAPI","MessageEventsAPI","ChatInputButtonAPI"],settings:Dt,contextMenus:{message:J5},translate:za,start(){ya("vc-translation",e=>n(CI,{message:e.message})),wo("vc-translate",AI),on("vc-translate",e=>e.content?{label:"Translate",icon:ms,message:e,channel:ee.getChannel(e.channel_id),onClick:async()=>{let t=await za("received",e.content);Sy(e.id,t)}}:null),this.preSend=Vt(async(e,t)=>{!Dt.store.autoTranslate||!t.con
2024-01-10 23:19:19 -06:00
`);if(o.length<2)return t;let r="";return o[o.length-1]==="```"&&(r=o.pop()),`${o[0]}
${this.unindent(o.slice(1).join(`
2023-11-14 11:41:09 -06:00
`))}
2024-03-22 12:55:56 -05:00
${r}`})},start(){this.preSend=Vt((e,t)=>this.unindentMsg(t)),this.preEdit=ti((e,t,o)=>this.unindentMsg(o))},stop(){eo(this.preSend),oi(this.preEdit)}})});var Py,o3,Ay,EI=g(()=>{"use strict";a();Eo();It();P();I();T();Py=1<<2,o3=(e,{channel:t,message:{author:o,embeds:r,flags:i,id:s}})=>{let l=(i&Py)!==0;if(!l&&!r.length)return;let c=t.isPrivate()||!!(_e.getChannelPermissions({id:t.id})&me.EMBED_LINKS);if(o.id===E.getCurrentUser().id&&!c)return;let u=ut("delete",e),p=u?.findIndex(d=>d?.props?.id==="delete");!p||!u||u.splice(p-1,0,n(L.MenuItem,{id:"unsuppress-embeds",key:"unsuppress-embeds",label:l?"Unsuppress Embeds":"Suppress Embeds",color:l?void 0:"danger",icon:l?El:Ol,action:()=>_t.patch({url:`/channels/${t.id}/messages/${s}`,body:{flags:l?i&~Py:i|Py}})}))},Ay=y({name:"UnsuppressEmbeds",authors:[m.rad,m.HypedDomi],description:"Allows you to unsuppress embeds in messages",contextMenus:{message:o3}})});var OI,Cy,_I=g(()=>{"use strict";a();uo();_l();$();P();I();OI=N({resultsAmount:{type:1,description:"The amount of results you want to get (more gives better results, but is slower)",default:10}}),Cy=y({name:"UrbanDictionary",description:"Search for a word on Urban Dictionary via /urban slash command",authors:[m.jewdev],dependencies:["CommandsAPI"],settings:OI,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 o=encodeURIComponent(e[0].value),{list:r}=await fetch(`https://api.urbandictionary.com/v0/define?term=${o}&per_page=${OI.store.resultsAmount}`).then(l=>l.json());if(!r.length)return void ge(t.channel.id,{content:"No results found."});let i=r.reduce((l,c)=>l.thumbs_up>c.thumbs_up?l:c),s=l=>l.replaceAll(`\r
2023-11-14 11:41:09 -06:00
`,`
2024-03-22 12:55:56 -05:00
`).replace(/([*>_`~\\])/gsi,"\\$1").replace(/\[(.+?)\]/g,(c,u)=>`[${u}](https://www.urbandictionary.com/define.php?term=${encodeURIComponent(u)} "Define '${u}' on Urban Dictionary")`).trim();return void ge(t.channel.id,{embeds:[{type:"rich",author:{name:`Uploaded by "${i.author}"`,url:`https://www.urbandictionary.com/author.php?author=${encodeURIComponent(i.author)}`},title:i.word,url:`https://www.urbandictionary.com/define.php?term=${encodeURIComponent(i.word)}`,description:s(i.definition),fields:[{name:"Example",value:s(i.example)},{name:"Want more definitions?",value:`Check out [more definitions](https://www.urbandictionary.com/define.php?term=${o} "Define "${e[0].value}" on Urban Dictionary") on Urban Dictionary.`}],color:16750848,footer:{text:`\u{1F44D} ${i.thumbs_up.toString()} | \u{1F44E} ${i.thumbs_down.toString()}`,icon_url:"https://www.urbandictionary.com/favicon.ico"},timestamp:new Date(i.written_on).toISOString()}]})}catch(o){ge(t.channel.id,{content:`Something went wrong: \`${o}\``})}}}]})});var BI=g(()=>{});var n3,r3,i3,FI,UI=g(()=>{"use strict";a();BI();H();T();n3=x("selectChannel","selectVoiceChannel"),r3=Go(".lastSection","children:"),i3=1n<<20n,FI=({channel:e,label:t,showHeader:o})=>n(r3,null,o&&n(S.FormTitle,{className:"vc-uvs-header"},"In a voice channel"),n(k,{className:"vc-uvs-button",color:k.Colors.TRANSPARENT,size:k.Sizes.SMALL,onClick:()=>{_e.can(i3,e)?n3.selectVoiceChannel(e.id):X.show({message:"Insufficient permissions to enter the channel.",id:"user-voice-show-insufficient-permissions",type:X.Type.FAILURE,options:{position:X.Position.BOTTOM}})}},t))});var s3,Ry,$I,ky,GI=g(()=>{"use strict";a();$();le();P();I();H();T();UI();s3=Re("VoiceStateStore"),Ry=N({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}}),$I=_.wrap(({user:e})=>{let{channelId:t}=s3.getVoiceStateForUser(e.id)??{};if(!t)return null;let o=ee.getChannel(t);if(!o)return null;let r=ae.getGuild(o.guild_id);if(!r)return null;let i=`${r.name} | ${o.name}`;return n(FI,{channel:o,label:i,showHeader:Ry.store.showVoiceChannelSectionHeader})}),ky=y({name:"UserVoiceShow",description:"Shows whether a User is currently in a voice channel somewhere in their profile",authors:[m.LordElias],settings:Ry,patchModal({user:e}){return Ry.store.showInUserProfileModal?n("div",{className:"vc-uvs-modal-margin"},n($I,{user:e})):null},patchPopout:({user:e})=>{let t=e.id===E.getCurrentUser().id;return n("div",{className:t?"vc-uvs-popout-margin-self":""},n($I,{user:e}))},patches:[{find:".popularApplicationCommandIds,",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 HI,zI=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"] {
2023-11-14 11:41:09 -06:00
background: center / cover no-repeat;
}
[class*="NonPremium"]:has([class*="bannerPremium"]) [class*="avatarPositionNormal"],
[class*="PremiumWithoutBanner"]:has([class*="bannerPremium"]) [class*="avatarPositionPremiumNoBanner"] {
top: 76px;
}
[style*="background-image"] [class*="background_"] {
background-color: transparent !important;
}
2024-03-22 12:55:56 -05:00
`,classNames:{},dom:null});HI="src/plugins/usrbg/index.css"});var a3,Kn,Su,Ny,jI=g(()=>{"use strict";a();$();Qe();To();P();I();zI();a3="https://raw.githubusercontent.com/AutumnVN/usrbg/main/usrbg.json",Kn={},Su=N({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}}),Ny=y({name:"USRBG",description:"Displays user banners from USRBG, allowing anyone to get a banner without Nitro",authors:[m.AutumnVN,m.pylix,m.TheKodeToad],settings:Su,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:()=>Su.store.voiceBackground,replacement:[{match:/(?<=function\((\i),\i\)\{)(?=let.{20,40},style:)/,replace:"$1.style=$self.voiceBackgroundHook($1);"}]}],data:Kn,settingsAboutComponent:()=>n(je,{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_")&&Kn[t])return{backgroundImage:`url(${Kn[t]})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}},useBannerHook({displayProfile:e,user:t}){if(!(e?.banner&&Su.store.nitroFirst)&&Kn[t.id])return Kn[t.id]},premiumHook({userId:e}){if(Kn[e])return 2},shouldShowBadge({displayProfile:e,user:t}){return e?.banner&&(!Kn[t.id]||Su.store.nitroFirst)},async start(){Nt(HI);let e=await fetch(a3);e.ok&&(Kn=await e.json(),this.data=Kn)}})});function l3({data:e,UserMention:t,RoleMention:o,parse:r,props:i}){let[s,l]=W(e.userId);if(s)return n(t,{className:"mention",userId:s,channelId:e.channelId,inlinePreview:i.noStyleAndInteraction,key:i.key});let c=r(e.content,i);return n(o,{...e,inlinePreview:i.formatInline},n("span",{onMouseEnter:()=>{let u=c?.[0]?.props?.children;if(typeof u!="string")return;let p=u.match(/<@!?(\d+)>/)?.[1];if(!p||bu.has(p))return;if(E.getUser(p))return l(p);let d=()=>{bu.add(p),WI.unshift(()=>Bt.getUser(p).then(()=>{l(p),bu.delete(p)}).catch(h=>{h?.status===429&&(WI.unshift(()=>Ko(1e3).then(d)),bu.delete(p))}).finally(()=>Ko(300)))};d()}},c))}var bu,WI,Dy,qI=g(()=>{"use strict";a();le();P();we();Wr();I();T();bu=new Set,WI=new vo(5);Dy=y({name:"ValidUser",description:"Fix mentions for unknown users showing up as '<@343383572805058560>' (hover over a mention to fix it)",authors:[m.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,o,r,i){return n(_,{noop:!0},n(l3,{RoleMention:e,UserMention:t,data:o,parse:r,props:i}))}})});var Ly,Ey,KI=g(()=>{"use strict";a();P();I();T();Ly={},Ey=y({name:"VoiceChatDoubleClick",description:"Join voice chats via double click instead of single click",authors:[m.Ven,m.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,o)=>`onClick:(vcDoubleClickEvt)=>$self.shouldRunOnClick(vcDoubleClickEvt,${o})&&${t}()`}}],shouldRunOnClick(e,{channelId:t}){let o=ee.getChannel(t);return!o||![2,13].includes(o.type)?!0:e.detail>=2},schedule(e,t){let o=t.props.channel.id;if(Ie.getVoiceChannelId()===o){e();return}let r=Ly[o]??={timeout:void 0,i:0};clearTimeout(r.timeout),++r.i>=2?(e(),delete Ly[o]):r.timeout=setTimeout(()=>{delete Ly[o]},500)}})});fu
`)}document.addEventListener("DOMContentLoaded",()=>{n4(),Au(),n1(G.useQuickCss),jt.addChangeListener("useQuickCss",n1),jt.addChangeListener("themeLinks",Au),jt.addChangeListener("enabledThemes",Au),VencordNative.quickCss.addThemeChangeListener(Au)});Zr();var s1={};qe(s1,{Common:()=>Hu,LazyComponentWebpack:()=>Du,_initWebpack:()=>Qa,_resolveReady:()=>Ja,addListener:()=>FP,cache:()=>ln,extract:()=>el,extractAndLoadChunks:()=>f1,extractAndLoadChunksLazy:()=>vi,filters:()=>Ce,find:()=>$o,findAll:()=>Nr,findBulk:()=>Dr,findByCode:()=>d1,findByCodeLazy:()=>Go,findByProps:()=>Lr,findByPropsLazy:()=>x,findComponentByCode:()=>Lu,findComponentByCodeLazy:()=>Ne,findComponentLazy:()=>Eu,findExportedComponentLazy:()=>Tn,findLazy:()=>so,findModuleFactory:()=>p1,findModuleId:()=>Va,findStore:()=>m1,findStoreLazy:()=>Re,lazyWebpackSearchHistory:()=>BP,listeners:()=>Nu,onceReady:()=>ku,proxyLazyWebpack:()=>go,removeListener:()=>UP,search:()=>Ou,subscriptions:()=>u1,waitFor:()=>gt,wreq:()=>io});a();T();H();a();P();Ke();hi();Xa();var IP,Fo=new oe("WebpackInterceptor","#8caaee");window[pn]?(Fo.info(`Patching ${pn}.push (was already existent, likely from cache!)`),Qa(window[pn]),PP(window[pn])):(Object.defineProperty(window,pn,{get:()=>IP,set:e=>{e?.push&&(e.push.$$vencordOriginal||(Fo.info(`Patching ${pn}.push`),PP(e)),Qa(e)&&(Fo.info("Successfully initialised Vencord webpack"),delete window[pn],window[pn]=e)),IP=e},configurable:!0}),Object.defineProperty(Function.prototype,"m",{set(e){new Error().stack?.includes("discord.com")&&(Fo.info("Found webpack module factory"),AP(e)),Object.defineProperty(this,"m",{value:e,configurable:!0})},configurable:!0}));function PP(e){function t(o){try{AP(o[1])}catch(r){Fo.error("Error in handlePush",r)}return t.$$vencordOriginal.call(e,o)}t.$$vencordOriginal=e.push,t.bind=(...o)=>t.$$vencordOriginal.bind(...o),Object.defineProperty(e,"push",{get:()=>t,set(o){t.$$vencordOriginal=o},configurable:!0})}function AP(e){let{subscriptions:t,listeners:o}=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(d,h,v){try{s(d,h,v)}catch(b){if(s===c)throw b;return Fo.error("Error in patched chunk",b),void c(d,h,v)}if(h=d.exports,!!h){if(h===window&&v.c){Object.defineProperty(v.c,i,{value:v.c[i],enumerable:!1,configurable:!0,writable:!0});return}for(let b of o)try{b(h,i)}catch(M){Fo.error("Error in webpack listener",M)}for(let[b,M]of t)try{b(h)?(t.delete(b),M(h,i)):h.default&&b(h.default)&&(t.delete(b),M(h.default,i))}catch(w){Fo.error("Error while firing callback for webpack chunk",w)}}};p.toString=()=>s.toString(),p.original=c;for(let d=0;d<r.length;d++){let h=r[d],v=an(`patch by ${h.plugin}`,(b,M)=>l.replace(b,M));if(!(h.predicate&&!h.predicate())&&l.includes(h.find)){u.add(h.plugin);let b=s,M=l;for(let w of h.replacement){if(w.predicate&&!w.predicate())continue;let C=s,R=l;ys(w,h.plugin);try{let A=v(w.match,w.replace);if(A===l){if(h.noWarn||Fo.warn(`Patch by ${h.plugin} had no effect (Module id is ${i}): ${w.match}`),h.group){Fo.warn(`Undoing patch group ${h.find} by ${h.plugin} because replacement ${w.match} had no effect`),l=M,s=b,u.delete(h.plugin);break}}else l=A,s=(0,eval)(`// Webpack Module ${i} - Patched by ${[...u].join(", ")}
${A}
//# sourceURL=WebpackModule${i}`)}catch(A){if(Fo.error(`Patch by ${h.plugin} errored (Module id is ${i}): ${w.match}
`,A),u.delete(h.plugin),h.group){Fo.warn(`Undoing patch group ${h.find} by ${h.plugin} because replacement ${w.match} errored`),l=M,s=b;break}l=R,s=C}}h.all||r.splice(d--,1)}}}}I();Xo();er();$();jl();hl();rr();Us();Zr();T();async function r4(){if(G.cloud.authenticated&&!await dt("Vencord_cloudSecret")){Fe({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:()=>$r.open("VencordCloud")});return}G.cloud.settingsSync&&G.cloud.authenticated&&(jr.Vencord_settingsDirty?(await Ri(),delete jr.Vencord_settingsDirty):await Rl(!1)&&Fe({title:"Cloud Settings",body:"Your settings have been updated! Click here to restart to fully apply changes!",color:"var(--green-360)",onClick:So}))}async function i4(){await ku,ta("WebpackReady"),r4();try{if(!await Di())return;if(G.autoUpdate){await Li(),G.autoUpdateNotification&&setTimeout(()=>Fe({title:"Vencord has been updated!",body:"Click here to restart",permanent:!0,noPersist:!0,onClick:So}),1e4);return}G.notifyAboutUpdates&&setTimeout(()=>Fe({title:"A Vencord update is available!",body:"Click here to view the update",permanent:!0,noPersist:!0,onClick(){$r.open("VencordUpdater")}}),1e4)}catch(e){Yr.error("Failed to check for updates",e)}}ta("Init");i4();document.addEventListener("DOMContentLoaded",()=>{ta("DOMContentLoaded")},{once:!0});return Xn(s4);})();
2023-11-14 11:41:09 -06:00
//# sourceURL=VencordDesktopRenderer
//# sourceMappingURL=vencord://vencordDesktopRenderer.js.map
/*! For license information please see vencordDesktopRenderer.js.LEGAL.txt */