dotfiles/VencordDesktop/vencordDist/vencordDesktopRenderer.js

209 lines
450 KiB
JavaScript
Raw Normal View History

2023-11-23 12:19:53 -06:00
// Vencord 81fb7c6
2023-11-14 11:41:09 -06:00
// Standalone: true
// Platform: Universal
// Updater disabled: false
2023-11-23 12:19:53 -06:00
"use strict";var Vencord=(()=>{var j2=Object.create;var zs=Object.defineProperty;var W2=Object.getOwnPropertyDescriptor;var q2=Object.getOwnPropertyNames;var K2=Object.getPrototypeOf,Y2=Object.prototype.hasOwnProperty;var Rr=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var g=(e,t)=>()=>(e&&(t=e(e=0)),t);var or=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Be=(e,t)=>{for(var n in t)zs(e,n,{get:t[n],enumerable:!0})},$g=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of q2(t))!Y2.call(e,i)&&i!==n&&zs(e,i,{get:()=>t[i],enumerable:!(r=W2(t,i))||r.enumerable});return e};var js=(e,t,n)=>(n=e!=null?j2(K2(e)):{},$g(t||!e||!e.__esModule?zs(n,"default",{value:e,enumerable:!0}):n,e)),To=e=>$g(zs({},"__esModule",{value:!0}),e);var f,o,a=g(()=>{"use strict";f=Symbol.for("react.fragment"),o=(...e)=>(o=Vencord.Webpack.Common.React.createElement)(...e)});var ie,Ze=g(()=>{"use strict";a();ie=class{constructor(t,n="white"){this.name=t;this.color=n}static makeTitle(t,n){return["%c %c %s ","",`background: ${t}; color: black; font-weight: bold; border-radius: 5px;`,n]}_log(t,n,r,i=""){console[t](`%c Vencord %c %c ${this.name} ${i}`,`background: ${n}; color: black; font-weight: bold; border-radius: 5px;`,"",`background: ${this.color}; color: black; font-weight: bold; border-radius: 5px;`,...r)}log(...t){this._log("log","#a6d189",t)}info(...t){this._log("info","#a6d189",t)}error(...t){this._log("error","#e78284",t)}errorCustomFmt(t,...n){this._log("error","#e78284",n,t)}warn(...t){this._log("warn","#e5c890",t)}debug(...t){this._log("debug","#eebebe",t)}}});var Gg,q,at=g(()=>{"use strict";a();Gg="",q={};for(let e of["top","bottom","left","right"])for(let t of[8,16,20]){let n=`vc-m-${e}-${t}`;q[`${e}${t}`]=n,Gg+=`.${n}{margin-${e}:${t}px;}`}document.addEventListener("DOMContentLoaded",()=>document.head.append(Object.assign(document.createElement("style"),{textContent:Gg,id:"vencord-margins"})),{once:!0})});function xo(e,t=5){let n=0,r;return()=>(!r&&t>n++&&(r=e(),!r&&t===n&&console.error("Lazy factory failed:",e)),r)}function yt(e,t=5,n=!1){let r=!0;n||setTimeout(()=>r=!1,0);let i=0,s=Object.assign(function(){},{[wi]:void 0,[Lr](){return!s[wi]&&t>i++&&(s[wi]=e(),!s[wi]&&t===i&&console.error("Lazy factory failed:",e)),s[wi]}});return new Proxy(s,{...Ws,get(l,c,u){return!n&&r?yt(()=>Reflect.get(l[Lr](),c,u),t,!0):Reflect.get(l[Lr](),c,u)}})}var Hg,Ws,Lr,wi,wn=g(()=>{"use strict";a();Hg=["arguments","caller","prototype"],Ws={},Lr=Symbol.for("vencord.lazy.get"),wi=Symbol.for("vencord.lazy.cached");for(let e of["apply","construct","defineProperty","deleteProperty","getOwnPropertyDescriptor","getPrototypeOf","has","isExtensible","ownKeys","preventExtensions","set","setPrototypeOf"])Ws[e]=(t,...n)=>Reflect[e](t[Lr](),...n);Ws.ownKeys=e=>{let t=e[Lr](),n=Reflect.ownKeys(t);for(let r of Hg)n.includes(r)||n.push(r);return n};Ws.getOwnPropertyDescriptor=(e,t)=>{if(typeof t=="string"&&Hg.includes(t))return Reflect.getOwnPropertyDescriptor(e,t);let n=Reflect.getOwnPropertyDescriptor(e[Lr](),t);return n&&Object.defineProperty(e,t,n),n}});function tt(e,t=5){let n=xo(e,t);return r=>{let i=n()??Z2;return o(i,{...r})}}var Z2,ec=g(()=>{"use strict";a();wn();Z2=()=>null});var X2,$n,qs=g(()=>{"use strict";a();Ze();X2=(e,t,n)=>t,$n=X2});function Ys(e){if(Jn!==void 0)throw"no.";return e.push([[Symbol("Vencord")],{},t=>Mn=t]),e.pop(),Mn?(Jn=Mn.c,!0):!1}function Mi(e,...t){let n=new Error(`webpack.${e} found no module`);tc.error(n,"Filter:",t)}function un(e){return yt(()=>Ot(e))}function rr(e){if(typeof e!="function")throw new Error("Invalid filter. Expected a function got "+typeof e);let t=[];for(let n in Jn){let r=Jn[n];!r?.exports||(e(r.exports)&&t.push(r.exports),r.exports.default&&e(r.exports.default)&&t.push(r.exports.default))}return t}function pn(...e){let t=Ot(Ke.byProps(...e),{isIndirect:!0});return t||Mi("findByProps",...e),t}func
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}
2023-11-23 12:19:53 -06:00
`;return(0,eval)(n)}var tc,Ks,nc,Mn,Jn,Ke,zg,oc,Ot,rc,ic,j=g(()=>{"use strict";a();wn();ec();Ze();qs();tc=new ie("Webpack"),nc=new Promise(e=>Ks=e),Ke={byProps:(...e)=>e.length===1?t=>t[e[0]]!==void 0:t=>e.every(n=>t[n]!==void 0),byCode:(...e)=>t=>{if(typeof t!="function")return!1;let n=Function.prototype.toString.call(t);for(let r of e)if(!n.includes(r))return!1;return!0},byStoreName:e=>t=>t.constructor?.displayName===e,componentByCode:(...e)=>{let t=Ke.byCode(...e);return n=>t(n)?!0:n.$$typeof?n.type?t(n.type):n.render?t(n.render):!1:!1}},zg=new Map,oc=new Set;Ot=$n("find",function(t,{isIndirect:n=!1,isWaitFor:r=!1}={}){if(typeof t!="function")throw new Error("Invalid filter. Expected a function got "+typeof t);for(let i in Jn){let s=Jn[i];if(!!s?.exports){if(t(s.exports))return r?[s.exports,Number(i)]:s.exports;if(s.exports.default&&t(s.exports.default)){let l=s.exports.default;return r?[l,Number(i)]:l}}}return n||Mi("find",t),r?[null,null]:null});rc=$n("findBulk",function(...t){if(!Array.isArray(t))throw new Error("Invalid filters. Expected function[] got "+typeof t);let{length:n}=t;if(n===0)throw new Error("Expected at least two filters.");if(n===1)return Ot(t[0]);let r=t,i=0,s=Array(n);e:for(let l in Jn){let c=Jn[l];if(!!c?.exports)for(let u=0;u<n;u++){let p=r[u];if(p!==void 0){if(p(c.exports)){if(s[u]=c.exports,r[u]=void 0,++i===n)break e;break}if(c.exports.default&&p(c.exports.default)){if(s[u]=c.exports.default,r[u]=void 0,++i===n)break e;break}}}}if(i!==n){let l=new Error(`Got ${n} filters, but only found ${i} modules!`);tc.warn(l)}return s}),ic=$n("findModuleId",function(t){for(let r in Mn.m)if(Mn.m[r].toString().includes(t))return Number(r);let n=new Error(`Didn't find module with code:
`+t);return tc.warn(n),null})});var Xs,vt,Kg=g(()=>{"use strict";a();j();Xs=un(e=>e.image&&e.modal&&!e.applicationIcon),vt=I("buttonWrapper","buttonContent")});function Js(e,t){let n=function(){throw new Error(`Vencord could not find the ${e} Component`)},r=tt(()=>n);return ut(t,i=>{n=i,Object.assign(r,i)}),r}function At(e,t){ut(Ke.byStoreName(e),t)}var cc=g(()=>{"use strict";a();Qe();j()});var S,wt,R,pt,V,Ve,Qs,re,Pn,Vs,ir,Kt,Ii,Yg,In,Zg,Er,Dr,Or,Ai,_r,Gn,ew,Xg=g(()=>{"use strict";a();j();cc();S={},_r=Js("MaskedLink",e=>e?.type?.toString().includes("MASKED_LINK)")),Gn=Js("Timestamp",Ke.byCode(".Messages.MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL.format")),ew=Js("Flex",["Justify","Align","Wrap"]);ut(["FormItem","Button"],e=>{({useToken:Ai,Card:wt,Button:R,FormSwitch:pt,Tooltip:V,TextInput:Ve,TextArea:Qs,Text:re,Select:Pn,SearchableSelect:Vs,Slider:ir,ButtonLooks:Kt,TabBar:In,Popout:Ii,Dialog:Yg,Paginator:Zg,ScrollerThin:Er,Clickable:Dr,Avatar:Or}=e),S=e})});var G,dn,Jg=g(()=>{"use strict";a();j();G={};ut(["MenuItem","MenuSliderControl"],e=>G=e);dn=I("closeContextMenu","openContextMenu")});var O,J,De,Nt,Yt,Br,ea,sr,Qg=g(()=>{"use strict";a();j();sr=I("createPortal","render");ut("useState",e=>{O=e,{useEffect:De,useState:J,useMemo:Nt,useRef:Yt,useReducer:Br,useCallback:ea}=O})});var uc,Fr,Ni,Vg=g(()=>{"use strict";a();j();uc=I("MessageDisplayCompact"),Fr=I("ShowCurrentGame"),Ni=I("PreloadedUserSettingsActionCreators")});var pc,dc,An,mc,Ce,Ur,ar,Hn,tw,Te,W,nn,Pe,on,Q,ke,nt,Nn,Ci,ki,He,eh=g(()=>{"use strict";a();j();cc();pc=I("connectStores"),dc=(i=>(i[i.ChannelMessage=0]="ChannelMessage",i[i.ThreadSettings=1]="ThreadSettings",i[i.FirstThreadMessage=2]="FirstThreadMessage",i[i.ApplicationLauncherCommand=3]="ApplicationLauncherCommand",i))(dc||{}),mc=I("openPrivateChannel"),{useStateFromStores:He}=I("useStateFromStores");At("DraftStore",e=>ki=e);At("UserStore",e=>W=e);At("UserProfileStore",e=>nn=e);At("ChannelStore",e=>Q=e);At("SelectedChannelStore",e=>Pe=e);At("SelectedGuildStore",e=>on=e);At("GuildStore",e=>Te=e);At("GuildMemberStore",e=>ke=e);At("RelationshipStore",e=>nt=e);At("PermissionStore",e=>Ce=e);At("PresenceStore",e=>Hn=e);At("ReadStateStore",e=>ar=e);At("GuildChannelStore",e=>Ur=e);At("MessageStore",e=>An=e);At("WindowStore",e=>Ci=e);At("EmojiStore",e=>Nn=e)});var th={};var nh=g(()=>{"use strict";a()});var oh={};var rh=g(()=>{"use strict";a()});var ih={};var sh=g(()=>{"use strict";a()});function fn(e,t=ah.MESSAGE){ee.show({id:ee.genId(),message:e,type:t})}var F,wo,Mt,mn,lr,cr,ot,zn,Fe,rn,ah,nw,ee,Rt,Ri,ur,Zt,pr,Qn,Se,lh=g(()=>{"use strict";a();wn();j();ut(["ComponentDispatch","ComponentDispatcher"],e=>wo=e.ComponentDispatch);Mt=I("getAPIBaseURL","get"),mn=I("parseTwoDigitYear"),lr=I("highlight","registerLanguage"),cr=I("debounce","cloneDeep"),ot=un(e=>e.Messages?.["en-US"]);ut(["fromTimestamp","extractTimestamp"],e=>zn=e);ah={MESSAGE:0,SUCCESS:1,FAILURE:2,CUSTOM:3},nw={TOP:0,BOTTOM:1},ee={Type:ah,Position:nw,genId:()=>(Math.random()||Math.random()).toString(36).slice(2)};Rt=I("getUser","fetchCurrentUser"),Ri=I("showUploadFileSizeExceededError","promptToUpload"),ur=I("fetchAssetIds","getAssetImage"),Zt=I("SUPPORTS_COPY","copy"),pr=I("transitionTo","replaceWith","transitionToGuild");ut(["dispatch","subscribe"],e=>{F=e;let t=()=>{e.unsubscribe("CONNECTION_OPEN",t),Ks()};e.subscribe("CONNECTION_OPEN",t)});ut("showToast",e=>{ee.show=e.showToast,ee.pop=e.popToast});ut(["show","close"],e=>rn=e);ut("parseTopic",e=>Fe=e);ut(["open","saveAccountChanges"],e=>Qn=e);Se=yt(()=>Ot(e=>typeof e.Permissions?.ADMINISTRATOR=="bigint").Permissions)});var fc={};Be(fc,{Alerts:()=>rn,ApplicationAssetUtils:()=>ur,Avatar:()=>Or,Button:()=>R,ButtonLooks:()=>Kt,ButtonWrapperClasses:()=>vt,Card:()=>wt,ChannelStore:()=>Q,Clickable:()=>Dr,Clipboard:()=>Zt,ComponentDispatch:()=>wo,ComponentTypes:()=>th,ContextMenuApi:()=>dn,Dialog:()=>Yg,DraftStore:()=>ki,DraftType:()=>dc,EmojiStore:()=>Nn,Flex:()=>ew,Flux:()=>pc,FluxDispatcher:()=>F,Forms:()=>S,GuildChannelStore:()=>Ur,GuildMemberStore:()=>ke,GuildStore:()=>Te,MaskedLink:()=>_r,Menu:()=>G,MenuTypes:()
`);i!==-1&&(r=n.slice(0,i),n=n.slice(i+1).replace(/https:\/\/\S+\/assets\//g,""))}return{error:t,stack:n,message:r}}componentDidCatch(t,n){this.props.onError?.({error:t,errorInfo:n,props:this.props.wrappedProps}),ph.error(`A component threw an Error
`,t),ph.error("Component Stack",n.componentStack)}render(){if(this.state.error===dh)return this.props.children;if(this.props.noop)return null;if(this.props.fallback)return o(this.props.fallback,{children:this.props.children,...this.state});let t=this.props.message||"An error occurred while rendering this Component. More info can be found below and in your console.";return o(hn,{style:{overflow:"hidden"}},o("h1",null,"Oh no!"),o("p",null,t),o("code",null,this.state.message,!!this.state.stack&&o("pre",{className:q.top8},this.state.stack)))}});Sc.wrap=(e,t)=>n=>o(Sc,{...t,wrappedProps:n},o(e,{...n}));_=Sc});function ra(){return o("svg",{"aria-hidden":"true",height:"16",viewBox:"0 0 16 16",width:"16",style:{marginRight:"0.5em",transform:"translateY(2px)"}},o("path",{fill:"#db61a2","fill-rule":"evenodd",d:"M4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.565 20.565 0 008 13.393a20.561 20.561 0 003.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.75.75 0 01-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5zM8 14.25l-.345.666-.002-.001-.006-.003-.018-.01a7.643 7.643 0 01-.31-.17 22.075 22.075 0 01-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.08 22.08 0 01-3.744 2.584l-.018.01-.006.003h-.002L8 14.25zm0 0l.345.666a.752.752 0 01-.69 0L8 14.25z"}))}var bc=g(()=>{"use strict";a()});function Oi(e){return o(R,{...e,look:R.Looks.LINK,color:R.Colors.TRANSPARENT,onClick:()=>VencordNative.native.openExternal("https://github.com/sponsors/Vendicated")},o(ra,null),"Donate")}var Tc=g(()=>{"use strict";a();A();bc()});function ge(e){return e.style??={},e.style.display="flex",e.style.gap??="1em",e.style.flexDirection||=e.flexDirection,delete e.flexDirection,o("div",{...e},e.children)}var Lt=g(()=>{"use strict";a()});function _i(e,t){return ia.openModalLazy(e,t)}function je(e,t,n){return ia.openModal(e,t,n)}function Vn(e,t){return ia.closeModal(e,t)}function wc(){return ia.closeAllModals()}var Io,Cn,xc,ze,lt,et,_t,an,ia,dt=g(()=>{"use strict";a();j();Qe();Io=(i=>(i.SMALL="small",i.MEDIUM="medium",i.LARGE="large",i.DYNAMIC="dynamic",i))(Io||{}),Cn=I("ModalRoot","ModalCloseButton"),xc=tt(()=>pn("ImageModal").ImageModal),ze=tt(()=>Cn.ModalRoot),lt=tt(()=>Cn.ModalHeader),et=tt(()=>Cn.ModalContent),_t=tt(()=>Cn.ModalFooter),an=tt(()=>Cn.ModalCloseButton),ia=I("openModalLazy")});function y(e){return e}var w=g(()=>{"use strict";a()});async function mh(e=!1){Mc={};let t={};e&&(t.cache="no-cache");let r=(await fetch("https://gist.githubusercontent.com/Vendicated/51a3dd775f6920429ec6e9b735ca7f01/raw/badges.csv",t).then(i=>i.text())).trim().split(`
`);if(r.shift()!=="id,tooltip,image"){new ie("BadgeAPI").error("Invalid badges.csv file!");return}for(let i of r){let[s,l,c]=i.split(",");(Mc[s]??=[]).push({image:c,description:l})}}var lw,cw,Mc,Pc,fh=g(()=>{"use strict";a();aa();Tc();le();Lt();bc();P();Ze();at();Re();dt();w();A();lw="https://cdn.discordapp.com/attachments/1033680203433660458/1092089947126780035/favicon.png",cw={description:"Vencord Contributor",image:lw,position:0,props:{style:{borderRadius:"50%",transform:"scale(0.9)"}},shouldShow:({user:e})=>Ei(e.id),link:"https://github.com/Vendicated/Vencord"},Mc={};Pc=y({name:"BadgeAPI",description:"API to add badges to users.",authors:[d.Megu,d.Ven,d.TheSun],required:!0,patches:[{find:"Messages.PROFILE_USER_BADGES,role:",replacement:[{match:/&&(\i)\.push\(\{id:"premium".+?\}\);/,replace:"$&$1.unshift(...Vencord.Api.Badges._getBadges(arguments[0]));"},{match:/alt:" ","aria-hidden":!0,src:(?=(\i)\.src)/,replace:"...$1.props,$& $1.image??"},{match:/(?<=text:(\i)\.description,spacing:12,)children:/,replace:"children:$1.component ? () => $self.renderBadgeComponent($1) :"},{match:/href:(\i)\.link/,replace:"...($1.onClick && { onClick: $1.onClick }),$&"}]}],toolboxActions:{async"Refetch Badges"(){await mh(!0),ee.show({id:ee.genId(),message:"Successfully refetched badges!",type:ee.Type.SUCCESS})}},async start(){Vencord.Api.Badges.addBadge(cw),await mh()},renderBadgeComponent:_.wrap(e=>{let t=e.component;return o(t,{...e})},{noop:!0}),getDonorBadges(e){return Mc[e]?.map(t=>({...t,position:0,props:{style:{borderRadius:"50%",transform:"scale(0.9)"}},onClick(){let n=je(r=>o(_,{noop:!0,onError:()=>{Vn(n),VencordNative.native.openExternal("https://github.com/sponsors/Vendicated")}},o(Cn.ModalRoot,{...r},o(Cn.ModalHeader,null,o(ge,{style:{width:"100%",justifyContent:"center"}},o(S.FormTitle,{tag:"h2",style:{width:"100%",textAlign:"center",margin:0}},o(ra,null),"Vencord Donor"))),o(Cn.ModalContent,null,o(ge,null,o("img",{role:"presentation",src:"https://cdn.discordapp.com/emojis/1026533070955872337.png",alt:"",style:{margin:"auto"}}),o("img",{role:"presentation",src:"https://cdn.discordapp.com/emojis/1026533090627174460.png",alt:"",style:{margin:"auto"}})),o("div",{style:{padding:"1em"}},o(S.FormText,null,"This Badge is a special perk for Vencord Donors"),o(S.FormText,{className:q.top20},"Please consider supporting the development of Vencord by becoming a donor. It would mean a lot!!"))),o(Cn.ModalFooter,null,o(ge,{style:{width:"100%",justifyContent:"center"}},o(Oi,null))))))}}))}})});var Ic,gh=g(()=>{"use strict";a();P();w();Ic=y({name:"CommandsAPI",authors:[d.Arjix],description:"Api required by anything that uses commands",patches:[{find:',"tenor"',replacement:[{match:/(?<=\w=)(\w)(\.filter\(.{0,60}tenor)/,replace:"Vencord.Api.Commands._init($1)$2"}]},{find:"Unexpected value for option",replacement:{match:/,(\i)\.execute\((\i),(\i)\)/,replace:(e,t,n,r)=>`,Vencord.Api.Commands._handleCommand(${t}, ${n}, ${r})`}},{find:".source,children",replacement:{match:/(?<=:(.{1,3})\.displayDescription\}.{0,200}\.source,children:)[^}]+/,replace:"$1.plugin||($&)"}}]})});var Ac,hh=g(()=>{"use strict";a();P();w();Ac=y({name:"ContextMenuAPI",description:"API for adding/removing items to/from context menus.",authors:[d.Nuckyz,d.Ven],required:!0,patches:[{find:"\u266B (\u3064\uFF61\u25D5\u203F\u203F\u25D5\uFF61)\u3064 \u266A",replacement:{match:/let{navId:/,replace:"Vencord.Api.ContextMenu._patchContextMenu(arguments[0]);$&"}},{find:".Menu,{",all:!0,replacement:{match:/Menu,{(?<=\.jsxs?\)\(\i\.Menu,{)/g,replace:"$&contextMenuApiArguments:typeof arguments!=='undefined'?arguments:[],"}}]})});var Nc,yh=g(()=>{"use strict";a();P();w();Nc=y({name:"MemberListDecoratorsAPI",description:"API to add decorators to member list (both in servers and DMs)",authors:[d.TheSun,d.Ven],patches:[{find:".lostPermission)",replacement:[{match:/let\{[^}]*lostPermissionTooltipText:\i[^}]*\}=(\i),/,replace:"$&vencordProps=$1,"},{match:/decorators:.{0,100}?children:\[/,replace:"$&...(typeof vencordProps=='undefined'?[]:Vencord.Api.MemberListDecorators.__getDecorators(venco
`,e)}Kw=yn(async()=>{E.cloud.settingsSync&&E.cloud.authenticated&&(await Kr(),delete mr.Vencord_settingsDirty)},6e4),wa=new Set,ny={};Kn=Lo,E=su(Lo)});var ry=g(()=>{});var iy=g(()=>{});var cu={};Be(cu,{UpdateLogger:()=>hr,changes:()=>Eo,checkForUpdates:()=>Zr,getRepo:()=>lu,isNewer:()=>qi,isOutdated:()=>Do,maybePromptToUpdate:()=>Ki,update:()=>Xr,updateError:()=>Yr});async function Ma(e){let t=await e;if(t.ok)return t.value;throw Yr=t.error,t.error}async function Zr(){return Eo=await Ma(VencordNative.updater.getUpdates()),Eo.some(e=>e.hash===sn)?(qi=!0,Do=!1):Do=Eo.length>0}async function Xr(){if(!Do)return!0;let e=await Ma(VencordNative.updater.update());if(e&&(Do=!1,!await Ma(VencordNative.updater.rebuild())))throw new Error("The Build failed. Please try manually building the new update");return e}async function Ki(e,t=!1){try{if(await Zr()){let r=confirm(e);if(r&&qi)return alert("Your local copy has more recent commits. Please stash or reset them.");r&&(await Xr(),ln())}}catch(n){hr.error(n),alert("That also failed :( Try updating or re-installing with the installer!")}}var hr,Do,qi,Yr,Eo,lu,yr=g(()=>{"use strict";a();$r();Ze();Ro();hr=new ie("Updater","white"),Do=!1,qi=!1;lu=()=>Ma(VencordNative.updater.getRepo())});function sy(){Ki("Uh Oh! Failed to render this Page. However, there is an update available that might fix it. Would you like to update and restart now?")}var ay=g(()=>{"use strict";a();yr()});function uu(e){let t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments))}}var pu=g(()=>{"use strict";a()});function vn({title:e,children:t}){return o(S.FormSection,null,o(re,{variant:"heading-lg/semibold",tag:"h2",className:q.bottom16},e),t)}function Sn(e,t){return _.wrap(e,{message:`Failed to render the ${t} tab. If this issue persists, try using the installer to reinstall!`,onError:Zw})}var Zw,Oo=g(()=>{"use strict";a();ry();iy();le();ay();at();pu();A();Zw=uu(sy)});var py={};Be(py,{default:()=>Vw});function Xw(){let[e,,t]=rt(VencordNative.settings.getSettingsDir,{fallbackValue:"Loading..."}),n=ct(),r=O.useMemo(()=>Math.random()>.5?cy:uy,[]),i=navigator.platform.toLowerCase().startsWith("win"),s=navigator.platform.toLowerCase().startsWith("mac"),l=[{key:"useQuickCss",title:"Enable Custom CSS",note:"Loads your Custom CSS"},{key:"enableReactDevtools",title:"Enable React Developer Tools",note:"Requires a full restart"},{key:"frameless",title:"Disable the window frame",note:"Requires a full restart"},!1,i&&{key:"winCtrlQ",title:"Register Ctrl+Q as shortcut to close Discord (Alternative to Alt+F4)",note:"Requires a full restart"},!1,!1];return o(vn,{title:"Vencord Settings"},o(Qw,{image:r}),o(S.FormSection,{title:"Quick Actions"},o(wt,{className:ly("quick-actions-card")},o(O.Fragment,null,o(R,{onClick:ln,size:R.Sizes.SMALL},"Restart Client"),o(R,{onClick:()=>VencordNative.quickCss.openEditor(),size:R.Sizes.SMALL,disabled:e==="Loading..."},"Open QuickCSS File"),o(R,{onClick:()=>va(e),size:R.Sizes.SMALL,disabled:t},"Open Settings Folder"),o(R,{onClick:()=>VencordNative.native.openExternal("https://github.com/Vendicated/Vencord"),size:R.Sizes.SMALL,disabled:t},"Open in GitHub")))),o(S.FormDivider,null),o(S.FormSection,{className:q.top16,title:"Settings",tag:"h5"},o(S.FormText,{className:q.bottom20},'Hint: You can change the position of this settings section in the settings of the "Settings" plugin!'),l.map(c=>c&&o(pt,{key:c.key,value:n[c.key],onChange:u=>n[c.key]=u,note:c.note},c.title))),typeof Notification<"u"&&o(Jw,{settings:n.notifications}))}function Jw({settings:e}){return o(f,null,o(S.FormTitle,{tag:"h5"},"Notification Style"),e.useNative!=="never"&&Notification?.permission==="denied"&&o(hn,{style:{padding:"1em"},className:q.bottom8},o(S.FormTitle,{tag:"h5"},"Desktop Notification Permission denied"),o(S.FormText,null,"You have denied Notification Permissions. Thus, Desktop notifications will not work!")),o(S.FormText,{className:q.bottom8},"Some plugins may show you notifications. These come in two styles:",o("ul",null,o("li",null,o("strong",null,"Vencord Notifications"),": These are in-app notificatio
2023-11-14 11:41:09 -06:00
${e.replaceAll("```","\\`\\`\\`")}
2023-11-23 12:19:53 -06:00
${n}`}var yu,eM,tM,vu,nM,oM,rM,iM,sM,oo,aM,ro=g(()=>{"use strict";a();A();yu=e=>e.split(/(?=[A-Z])/).map(t=>t.toLowerCase()),eM=e=>e.toLowerCase().split("_"),tM=e=>e.toLowerCase().split("-"),vu=e=>e.split(/(?=[A-Z])/).map(t=>t.toLowerCase()),nM=e=>e.toLowerCase().split(" "),oM=e=>e.map((t,n)=>n?t[0].toUpperCase()+t.slice(1):t).join(""),rM=e=>e.join("_").toUpperCase(),iM=e=>e.join("-").toLowerCase(),sM=e=>e.map(t=>t[0].toUpperCase()+t.slice(1)).join(""),oo=e=>e.map(t=>t[0].toUpperCase()+t.slice(1)).join(" "),aM=["years","months","weeks","days","hours","minutes","seconds"]});function Vi(){return`-${zn.fromTimestamp(Date.now())}`}function ue(e,t){let n=cM.createBotMessage({channelId:e,content:"",embeds:[]});return uM.receiveMessage(e,dr(t,n)),t}function it(e,t,n){return e.find(r=>r.name===t)?.value||n}var cM,uM,Su=g(()=>{"use strict";a();Re();j();A();cM=I("createBotMessage"),uM=I("receiveMessage")});var io,Dn,bu,Ca=g(()=>{"use strict";a();io=(h=>(h[h.SUB_COMMAND=1]="SUB_COMMAND",h[h.SUB_COMMAND_GROUP=2]="SUB_COMMAND_GROUP",h[h.STRING=3]="STRING",h[h.INTEGER=4]="INTEGER",h[h.BOOLEAN=5]="BOOLEAN",h[h.USER=6]="USER",h[h.CHANNEL=7]="CHANNEL",h[h.ROLE=8]="ROLE",h[h.MENTIONABLE=9]="MENTIONABLE",h[h.NUMBER=10]="NUMBER",h[h.ATTACHMENT=11]="ATTACHMENT",h))(io||{}),Dn=(s=>(s[s.BUILT_IN=0]="BUILT_IN",s[s.BUILT_IN_TEXT=1]="BUILT_IN_TEXT",s[s.BUILT_IN_INTEGRATION=2]="BUILT_IN_INTEGRATION",s[s.BOT=3]="BOT",s[s.PLACEHOLDER=4]="PLACEHOLDER",s))(Dn||{}),bu=(r=>(r[r.CHAT_INPUT=1]="CHAT_INPUT",r[r.USER=2]="USER",r[r.MESSAGE=3]="MESSAGE",r))(bu||{})});var wu={};Be(wu,{ApplicationCommandInputType:()=>Dn,ApplicationCommandOptionType:()=>io,ApplicationCommandType:()=>bu,BUILT_IN:()=>_o,OptionalMessageOption:()=>Bo,RequiredMessageOption:()=>es,_handleCommand:()=>dM,_init:()=>pM,commands:()=>Tu,findOption:()=>it,generateId:()=>Vi,prepareOption:()=>xu,registerCommand:()=>Qr,sendBotMessage:()=>ue,unregisterCommand:()=>ts});function xu(e){return e.displayName||=e.name,e.displayDescription||=e.description,e.options?.forEach((t,n,r)=>{t===wy?r[n]=Bo:t===My&&(r[n]=es),t.choices?.forEach(i=>i.displayName||=i.name),xu(r[n])}),e}function mM(e,t){e.options?.forEach(n=>{if(n.type!==1)throw new Error("When specifying sub-command options, all options must be sub-commands.");let r={...e,...n,type:1,name:`${e.name} ${n.name}`,id:`${n.name}-${e.id}`,displayName:`${e.name} ${n.name}`,subCommandPath:[{name:n.name,type:n.type,displayName:n.name}],rootCommand:e};Qr(r,t)})}function Qr(e,t){if(!_o){console.warn("[CommandsAPI]",`Not registering ${e.name} as the CommandsAPI hasn't been initialised.`,"Please restart to use commands");return}if(_o.some(n=>n.name===e.name))throw new Error(`Command '${e.name}' already exists.`);if(e.isVencordCommand=!0,e.id??=`-${_o.length+1}`,e.applicationId??="-1",e.type??=1,e.inputType??=1,e.plugin||=t,xu(e),e.options?.[0]?.type===1){mM(e,t);return}Tu[e.name]=e,_o.push(e)}function ts(e){let t=_o.findIndex(n=>n.name===e);return t===-1?!1:(_o.splice(t,1),delete Tu[e],!0)}var _o,Tu,wy,My,Bo,es,pM,dM,Qt=g(()=>{"use strict";a();ro();Su();Ca();Su();Ca();Tu={},wy=Symbol("OptionalMessageOption"),My=Symbol("RequiredMessageOption"),Bo=wy,es=My,pM=function(e){try{_o=e,Bo=e.find(t=>t.name==="shrug").options[0],es=e.find(t=>t.name==="me").options[0]}catch{console.error("Failed to load CommandsApi")}return e},dM=function(e,t,n){if(!e.isVencordCommand)return e.execute(t,n);let r=i=>{let s=`An Error occurred while executing command "${e.name}"`,l=i instanceof Error?i.stack||i.message:String(i);console.error(s,i),ue(n.channel.id,{content:`${s}:
${Qi(l)}`,author:{username:"Vencord"}})};try{let i=e.execute(t,n);return i instanceof Promise?i.catch(r):i}catch(i){return r(i)}}});function Py({text:e,color:t}){return o("div",{className:"vc-plugins-badge",style:{backgroundColor:t,justifySelf:"flex-end",marginLeft:"auto"}},e)}var Mu=g(()=>{"use strict";a()});function Iy({option:e,pluginSettings:t,definedSettings:n,id:r,onChange:i,onError:s}){let l=t[r]??e.default,[c,u]=O.useState(l??!1),[p,m]=O.useState(null);O.useEffect(()=>{s(p!==null)},[p]);function h(v){let T=e.isValid?.call(n,v)??!0;typeof T=="string"?m(T):T?(m(null),u(v),i(v)):m("Invalid input provided.")}return o(S.FormSection,null,o(pt,{value:c,onChange:h,note:e.description,disabled:e.disabled?.call(n)??!1,...e.componentProps,hideBorder:!0,style:{marginBottom:"0.5em"}},oo(yu(r))),p&&o(S.FormText,{style:{color:"var(--text-danger)"}},p))}var Ay=g(()=>{"use strict";a();ro();A()});function Ny({option:e,onChange:t,onError:n}){return e.component({setValue:t,setError:n,option:e})}var Cy=g(()=>{"use strict";a()});function Pu({option:e,pluginSettings:t,definedSettings:n,id:r,onChange:i,onError:s}){function l(v){return e.type===2?BigInt(v):Number(v)}let[c,u]=O.useState(`${t[r]??e.default??0}`),[p,m]=O.useState(null);O.useEffect(()=>{s(p!==null)},[p]);function h(v){let T=e.isValid?.call(n,v)??!0;m(null),typeof T=="string"?m(T):T||m("Invalid input provided."),e.type===1&&BigInt(v)>=fM?(u(`${Number.MAX_SAFE_INTEGER}`),i(l(v))):(u(v),i(l(v)))}return o(S.FormSection,null,o(S.FormTitle,null,e.description),o(Ve,{type:"number",pattern:"-?[0-9]+",value:c,onChange:h,placeholder:e.placeholder??"Enter a number",disabled:e.disabled?.call(n)??!1,...e.componentProps}),p&&o(S.FormText,{style:{color:"var(--text-danger)"}},p))}var fM,ky=g(()=>{"use strict";a();w();A();fM=BigInt(Number.MAX_SAFE_INTEGER)});function Ry({option:e,pluginSettings:t,definedSettings:n,onChange:r,onError:i,id:s}){let l=t[s]??e.options?.find(v=>v.default)?.value,[c,u]=O.useState(l??null),[p,m]=O.useState(null);O.useEffect(()=>{i(p!==null)},[p]);function h(v){let T=e.isValid?.call(n,v)??!0;typeof T=="string"?m(T):T?(m(null),u(v),r(v)):m("Invalid input provided.")}return o(S.FormSection,null,o(S.FormTitle,null,e.description),o(Pn,{isDisabled:e.disabled?.call(n)??!1,options:e.options,placeholder:e.placeholder??"Select an option",maxVisibleItems:5,closeOnSelect:!0,select:h,isSelected:v=>v===c,serialize:v=>String(v),...e.componentProps}),p&&o(S.FormText,{style:{color:"var(--text-danger)"}},p))}var Ly=g(()=>{"use strict";a();A()});function Fo(e,t,n=1){let r=[];for(let i=e;i<=t;i+=n)r.push(Math.round(i*100)/100);return r}function Ey({option:e,pluginSettings:t,definedSettings:n,id:r,onChange:i,onError:s}){let l=t[r]??e.default,[c,u]=O.useState(null);O.useEffect(()=>{s(c!==null)},[c]);function p(m){let h=e.isValid?.call(n,m)??!0;typeof h=="string"?u(h):h?(u(null),i(m)):u("Invalid input provided.")}return o(S.FormSection,null,o(S.FormTitle,null,e.description),o(ir,{disabled:e.disabled?.call(n)??!1,markers:e.markers,minValue:e.markers[0],maxValue:e.markers[e.markers.length-1],initialValue:l,onValueChange:p,onValueRender:m=>String(m.toFixed(2)),stickToMarkers:e.stickToMarkers??!0,...e.componentProps}))}var Iu=g(()=>{"use strict";a();A()});function Dy({option:e,pluginSettings:t,definedSettings:n,id:r,onChange:i,onError:s}){let[l,c]=O.useState(t[r]??e.default??null),[u,p]=O.useState(null);O.useEffect(()=>{s(u!==null)},[u]);function m(h){let v=e.isValid?.call(n,h)??!0;p(typeof v=="string"?v:v?null:"Invalid input provided."),c(h),i(h)}return o(S.FormSection,null,o(S.FormTitle,null,e.description),o(Ve,{type:"text",value:l,onChange:m,placeholder:e.placeholder??"Enter a value",disabled:e.disabled?.call(n)??!1,...e.componentProps}),u&&o(S.FormText,{style:{color:"var(--text-danger)"}},u))}var Oy=g(()=>{"use strict";a();A()});var ka=g(()=>{"use strict";a();Mu();Ay();Cy();ky();Ly();Iu();Oy()});var _y=g(()=>{});function Vr(){return Q.getChannel(Pe.getChannelId())}function Au(){return Te.getGuild(Vr()?.guild_id)}function yM(e){mc.openPrivateChannel(e)}function Uo(){return Ni.PreloadedUserS
`,s),!1}}if(r?.length){Vt.info("Registering commands of plugin",n);for(let s of r)try{Qr(s,n)}catch(l){return Vt.error(`Failed to register command ${s.name}
`,l),!1}}if(i)for(let s in i)F.subscribe(s,i[s]);return!0},e=>`startPlugin ${e.name}`),Fu=$n("stopPlugin",function(t){let{name:n,commands:r,flux:i}=t;if(t.stop){if(Vt.info("Stopping plugin",n),!t.started)return Vt.warn(`${n} already stopped`),!1;try{t.stop(),t.started=!1}catch(s){return Vt.error(`Failed to stop ${n}
`,s),!1}}if(r?.length){Vt.info("Unregistering commands of plugin",n);for(let s of r)try{ts(s.name)}catch(l){return Vt.error(`Failed to unregister command ${s.name}
`,l),!1}}if(i)for(let s in i)F.unsubscribe(s,i[s]);return!0},e=>`stopPlugin ${e.name}`)});function LM(e){ee.show({message:e,type:ee.Type.FAILURE,id:ee.genId(),options:{position:ee.Position.BOTTOM}})}function EM({required:e}){return o(wt,{className:Sr("info-card",{"restart-card":e})},e?o(f,null,o(S.FormTitle,{tag:"h5"},"Restart required!"),o(S.FormText,{className:Sr("dep-text")},"Restart now to apply new plugins and their settings"),o(R,{color:R.Colors.YELLOW,onClick:()=>location.reload()},"Restart")):o(f,null,o(S.FormTitle,{tag:"h5"},"Plugin Management"),o(S.FormText,null,"Press the cog wheel or info icon to get more info on a plugin"),o(S.FormText,null,"Plugins with a cog wheel have settings you can modify!")))}function Ra({plugin:e,disabled:t,onRestartNeeded:n,onMouseEnter:r,onMouseLeave:i,isNew:s}){let l=E.plugins[e.name],c=()=>l.enabled??!1;function u(){_i(async()=>m=>o(Ru,{...m,plugin:e,onRestartNeeded:()=>n(e.name)}))}function p(){let m=c();if(!m){let{restartNeeded:v,failures:T}=Da(e);if(T.length){Yy.error(`Failed to start dependencies for ${e.name}: ${T.join(", ")}`),Zi("Failed to start dependencies: "+T.join(", "),"Close",()=>null);return}else if(v){l.enabled=!0,n(e.name);return}}if(e.patches?.length){l.enabled=!m,n(e.name);return}if(m&&!e.started){l.enabled=!m;return}if(!(m?Fu(e):is(e))){l.enabled=!1;let v=`Error while ${m?"stopping":"starting"} plugin ${e.name}`;Yy.error(v),LM(v);return}l.enabled=!m}return o(Ea,{name:e.name,description:e.description,isNew:s,enabled:c(),setEnabled:p,disabled:t,onMouseEnter:r,onMouseLeave:i,infoButton:o("button",{role:"switch",onClick:()=>u(),className:oe(RM.button,Sr("info-button"))},e.options&&!Li(e.options)?o(by,null):o(Ia,null))})}function $u(){let e=ct(),t=O.useMemo(()=>new os,[]);O.useEffect(()=>()=>void(t.hasChanges&&rn.show({title:"Restart required",body:o(f,null,o("p",null,"The following plugins require a restart:"),o("div",null,t.map((v,T)=>o(f,null,T>0&&", ",Fe.parse("`"+v+"`"))))),confirmText:"Restart now",cancelText:"Later!",onConfirm:()=>location.reload()})),[]);let n=O.useMemo(()=>{let v={};for(let T in Oe){let M=Oe[T].dependencies;if(M)for(let b of M)v[b]??=[],v[b].push(T)}return v},[]),r=O.useMemo(()=>Object.values(Oe).sort((v,T)=>v.name.localeCompare(T.name)),[]),[i,s]=O.useState({value:"",status:0}),l=v=>s(T=>({...T,value:v})),c=v=>s(T=>({...T,status:v})),u=v=>{let T=e.plugins[v.name]?.enabled;if(T&&i.status===2||!T&&i.status===1||i.status===3&&!p?.includes(v.name))return!1;if(!i.value.length)return!0;let M=i.value.toLowerCase();return v.name.toLowerCase().includes(M)||v.description.toLowerCase().includes(M)||v.tags?.some(b=>b.toLowerCase().includes(M))},[p]=rt(()=>It("Vencord_existingPlugins").then(v=>{let T=Date.now()/1e3,M={},b=Object.values(r).map(N=>N.name),x=[];for(let{name:N}of r)(M[N]=v?.[N]??T)+60*60*24*2>T&&x.push(N);return Xt("Vencord_existingPlugins",M),cr.isEqual(x,b)?[]:x})),m,h;if(r?.length){m=[],h=[];for(let v of r){if(!v.options&&v.name.endsWith("API")&&i.value!=="API"||!u(v))continue;if(v.required||n[v.name]?.some(M=>e.plugins[M].enabled)){let M=v.required?"This plugin is required for Vencord to function.":DM(n[v.name]?.filter(b=>e.plugins[b].enabled));h.push(o(V,{text:M,key:v.name},({onMouseLeave:b,onMouseEnter:x})=>o(Ra,{onMouseLeave:b,onMouseEnter:x,onRestartNeeded:N=>t.handleChange(N),disabled:!0,plugin:v})))}else m.push(o(Ra,{onRestartNeeded:M=>t.handleChange(M),disabled:!1,plugin:v,isNew:p?.includes(v.name),key:v.name}))}}else m=h=o(re,{variant:"text-md/normal"},"No plugins meet search criteria.");return o(vn,{title:"Plugins"},o(EM,{required:t.hasChanges}),o(S.FormTitle,{tag:"h5",className:oe(q.top20,q.bottom8)},"Filters"),o("div",{className:Sr("filter-controls")},o(Ve,{autoFocus:!0,value:i.value,placeholder:"Search for a plugin...",onChange:l,className:q.bottom20}),o("div",{className:Zy.inputWrapper},o(Pn,{className:Zy.inputDefault,options:[{label:"Show All",value:0,default:!0},{label:"Show Enabled",value:1},{label:"Show Disabled",value:2},{label:"Show New",value:3}],serialize:String,select:c,isSelected:v=>v===i.status,closeOnSelect:!0
`)),[l,c]=J(null),[u,,p]=rt(VencordNative.themes.getThemesDir);De(()=>{m()},[]);async function m(){let x=await VencordNative.themes.getThemesList();c(x)}function h(x,N){if(N){if(e.enabledThemes.includes(x))return;e.enabledThemes=[...e.enabledThemes,x]}else e.enabledThemes=e.enabledThemes.filter(k=>k!==x)}async function v(x){if(x.stopPropagation(),x.preventDefault(),!x.currentTarget?.files?.length)return;let{files:N}=x.currentTarget,k=Array.from(N,B=>{let{name:U}=B;if(!!U.endsWith(".css"))return new Promise((Y,K)=>{let z=new FileReader;z.onload=()=>{VencordNative.themes.uploadTheme(U,z.result).then(Y).catch(K)},z.readAsText(B)})});await Promise.all(k),m()}function T(){return o(f,null,o(wt,{className:"vc-settings-card"},o(S.FormTitle,{tag:"h5"},"Find Themes:"),o("div",{style:{marginBottom:".5em",display:"flex",flexDirection:"column"}},o(st,{style:{marginRight:".5em"},href:"https://betterdiscord.app/themes"},"BetterDiscord Themes"),o(st,{href:"https://github.com/search?q=discord+theme"},"GitHub")),o(S.FormText,null,'If using the BD site, click on "Download" and place the downloaded .theme.css file into your themes folder.')),o(S.FormSection,{title:"Local Themes"},o(wt,{className:"vc-settings-quick-actions-card"},o(f,null,o(R,{onClick:()=>va(u),size:R.Sizes.SMALL,disabled:p},"Open Themes Folder"),o(R,{onClick:m,size:R.Sizes.SMALL},"Load missing Themes"),o(R,{onClick:()=>VencordNative.quickCss.openEditor(),size:R.Sizes.SMALL},"Edit QuickCSS"))),o("div",{className:FM("grid")},l?.map(x=>o(GM,{key:x.fileName,enabled:e.enabledThemes.includes(x.fileName),onChange:N=>h(x.fileName,N),onDelete:async()=>{h(x.fileName,!1),await VencordNative.themes.deleteTheme(x.fileName),m()},theme:x})))))}function M(){e.themeLinks=[...new Set(i.trim().split(/\n+/).map(x=>x.trim()).filter(Boolean))]}function b(){return o(f,null,o(wt,{className:"vc-settings-card vc-text-selectable"},o(S.FormTitle,{tag:"h5"},"Paste links to css files here"),o(S.FormText,null,"One link per line"),o(S.FormText,null,"Make sure to use direct links to files (raw or github.io)!")),o(S.FormSection,{title:"Online Themes",tag:"h5"},o(Qs,{value:i,onChange:s,className:oe(BM.textarea,"vc-settings-theme-links"),placeholder:"Theme Links",spellCheck:!1,onBlur:M,rows:10}),o($M,{themeLinks:e.themeLinks})))}return o(vn,{title:"Themes"},o(In,{type:"top",look:"brand",className:"vc-settings-tab-bar",selectedItem:n,onItemSelect:r},o(In.Item,{className:"vc-settings-tab-bar-item",id:0},"Local Themes"),o(In.Item,{className:"vc-settings-tab-bar-item",id:1},"Online Themes")),n===0&&T(),n===1&&b())}var _M,JO,BM,FM,zM,Vy=g(()=>{"use strict";a();$();Je();Lt();$t();lo();at();Re();Ro();Qe();j();A();Du();Oo();_M=I("resolveInvite"),JO=un(e=>e.prototype?.activateUploadDialogue&&e.prototype.setRef),BM=un(e=>typeof e.textarea=="string"),FM=Ue("vc-settings-theme-");zM=Sn(HM,"Themes")});var ov={};Be(ov,{default:()=>KM});function ev(e,t){return async()=>{e(!0);try{await t()}catch(r){if(hr.error("Failed to update",r),r)if(r.code&&r.cmd){let{code:i,path:s,cmd:l,stderr:c}=r;if(i==="ENOENT")var n=`Command \`${s}\` not found.
2023-11-14 11:41:09 -06:00
Please install it and try again`;else{var n=`An error occurred while running \`${l}\`:
`;n+=c||`Code \`${i}\`. See the console for more info`}}else var n="An unknown error occurred. See the console for more info.";else var n=`An unknown error occurred (error is undefined).
2023-11-23 12:19:53 -06:00
Please try again.`;rn.show({title:"Oops!",body:o(hn,null,n.split(`
`).map(i=>o("div",null,Fe.parse(i))))})}finally{e(!1)}}}function tv({repo:e,hash:t,disabled:n=!1}){return o(st,{href:`${e}/commit/${t}`,disabled:n},t)}function nv({updates:e,repo:t,repoPending:n}){return o(wt,{style:{padding:".5em"}},e.map(({hash:r,author:i,message:s})=>o("div",null,o("code",null,o(tv,{repo:t,hash:r,disabled:n})),o("span",{style:{marginLeft:"0.5em",color:"var(--text-normal)"}},s," - ",i))))}function jM(e){let[t,n]=O.useState(Eo),[r,i]=O.useState(!1),[s,l]=O.useState(!1),c=(t?.length??0)>0;return o(f,null,!t&&Yr?o(f,null,o(S.FormText,null,"Failed to check updates. Check the console for more info"),o(hn,{style:{padding:"1em"}},o("p",null,Yr.stderr||Yr.stdout||"An unknown error occurred"))):o(S.FormText,{className:q.bottom8},c?`There are ${t.length} Updates`:"Up to Date!"),c&&o(nv,{updates:t,...e}),o(ge,{className:oe(q.bottom8,q.top8)},c&&o(R,{size:R.Sizes.SMALL,disabled:s||r,onClick:ev(l,async()=>{await Xr()&&(n([]),await new Promise(u=>{rn.show({title:"Update Success!",body:"Successfully updated. Restart now to apply the changes?",confirmText:"Restart",cancelText:"Not now!",onConfirm(){ln(),u()},onCancel:u})}))})},"Update Now"),o(R,{size:R.Sizes.SMALL,disabled:s||r,onClick:ev(i,async()=>{await Zr()?n(Eo):(n([]),ee.show({message:"No updates found!",id:ee.genId(),type:ee.Type.MESSAGE,options:{position:ee.Position.BOTTOM}}))})},"Check for Updates")))}function WM(e){return o(f,null,o(S.FormText,{className:q.bottom8},"Your local copy has more recent commits. Please stash or reset them."),o(nv,{...e,updates:Eo}))}function qM(){let e=ct(["notifyAboutUpdates","autoUpdate","autoUpdateNotification"]),[t,n,r]=rt(lu,{fallbackValue:"Loading..."});O.useEffect(()=>{n&&hr.error("Failed to retrieve repo",n)},[n]);let i={repo:t,repoPending:r};return o(vn,{title:"Vencord Updater"},o(S.FormTitle,{tag:"h5"},"Updater Settings"),o(pt,{value:e.notifyAboutUpdates,onChange:s=>e.notifyAboutUpdates=s,note:"Shows a notification on startup",disabled:e.autoUpdate},"Get notified about new updates"),o(pt,{value:e.autoUpdate,onChange:s=>e.autoUpdate=s,note:"Automatically update Vencord without confirmation prompt"},"Automatically update"),o(pt,{value:e.autoUpdateNotification,onChange:s=>e.autoUpdateNotification=s,note:"Shows a notification when Vencord automatically updates",disabled:!e.autoUpdate},"Get notified when an automatic update completes"),o(S.FormTitle,{tag:"h5"},"Repo"),o(S.FormText,{className:"vc-text-selectable"},r?t:n?"Failed to retrieve - check console":o(st,{href:t},t.split("/").slice(-2).join("/"))," ","(",o(tv,{hash:sn,repo:t,disabled:r}),")"),o(S.FormDivider,{className:q.top8+" "+q.bottom8}),o(S.FormTitle,{tag:"h5"},"Updates"),qi?o(WM,{...i}):o(jM,{...i}))}var KM,rv=g(()=>{"use strict";a();$();Hr();Lt();lo();at();Re();Ro();Qe();yr();A();$r();Oo();KM=Sn(qM,"Updater")});function _a({value:e,onChange:t,validate:n}){let[r,i]=O.useState(e),[s,l]=O.useState();function c(u){i(u);let p=n(u);p===!0?(l(void 0),t(u)):l(p)}return o(f,null,o(Ve,{type:"text",value:r,onChange:c,error:s}))}var Gu=g(()=>{"use strict";a();A()});var iv={};Be(iv,{default:()=>QM});function YM(e){try{return new URL(e),!0}catch{return"Invalid URL"}}async function ZM(){let e=await fetch(new URL("/v1/",ko()),{method:"DELETE",headers:new Headers({Authorization:await qr()})});if(!e.ok){ya.error(`Failed to erase data, API returned ${e.status}`),Ie({title:"Cloud Integrations",body:`Could not erase all data (API returned ${e.status}), please contact support.`,color:"var(--red-360)"});return}E.cloud.authenticated=!1,await ru(),Ie({title:"Cloud Integrations",body:"Successfully erased all data.",color:"var(--green-360)"})}function XM(){let{cloud:e}=ct(["cloud.authenticated","cloud.settingsSync"]),t=e.authenticated&&e.settingsSync;return o(S.FormSection,{title:"Settings Sync",className:q.top16},o(S.FormText,{variant:"text-md/normal",className:q.bottom20},"Synchronize your settings to the cloud. This allows easy synchronization across multiple devices with minimal effort."),o(pt,{key:"cloud-sync",disabled:!e.authenticated,value:e.settingsSync,onChange:n=>{e.settingsSync
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}):
2023-11-23 12:19:53 -06:00
${Qi(r.join(", ")+`
2023-11-14 11:41:09 -06:00
`+i.join(", "))}
2023-11-23 12:19:53 -06:00
`.trim().replaceAll("```\n","```")}}}],flux:{async CHANNEL_SELECT({channelId:e}){if(e===na&&!Ei(W.getCurrentUser().id)&&Do&&sn!==await Gt.get(cv)){let t=()=>Gt.set(cv,sn);rn.show({title:"Hold on!",body:o("div",null,o(S.FormText,null,"You are using an outdated version of Vencord! Chances are, your issue is already fixed."),o(S.FormText,null,"Please first update using the Updater Page in Settings, or use the VencordInstaller (Update Vencord Button) to do so, in case you can't access the Updater page.")),onCancel:t,onConfirm:t})}}}})});var ju,pv=g(()=>{"use strict";a();P();w();ju=y({name:"AlwaysAnimate",description:"Animates anything that can be animated",authors:[d.FieryFlames],patches:[{find:"canAnimate:",all:!0,noWarn:!0,replacement:{match:/canAnimate:.+?(?=([,}].*?\)))/g,replace:(e,t)=>t.match(/}=.+/)==null?"canAnimate:!0":e}},{find:".Messages.GUILD_OWNER,",replacement:{match:/(?<=\.activityEmoji,.+?animate:)\i/,replace:"!0"}}]})});var Wu,dv=g(()=>{"use strict";a();P();w();Wu=y({name:"AlwaysTrust",description:"Removes the annoying untrusted domain and suspicious file popup",authors:[d.zt],patches:[{find:'.displayName="MaskedLinkStore"',replacement:{match:/(?<=isTrustedDomain\(\i\){)return \i\(\i\)/,replace:"return true"}},{find:"isSuspiciousDownload:",replacement:{match:/function \i\(\i\){(?=.{0,60}\.parse\(\i\))/,replace:"$&return null;"}}]})});var nP,qu,mv=g(()=>{"use strict";a();$();P();w();nP=/\.tar\.\w+$/,qu=y({name:"AnonymiseFileNames",authors:[d.obscurity],description:"Anonymise uploaded file names",patches:[{find:"instantBatchUpload:function",replacement:{match:/uploadFiles:(.{1,2}),/,replace:"uploadFiles:(...args)=>(args[0].uploads.forEach(f=>f.filename=$self.anonymise(f.filename)),$1(...args)),"}}],options:{method:{description:"Anonymising method",type:4,options:[{label:"Random Characters",value:0,default:!0},{label:"Consistent",value:1},{label:"Timestamp (4chan-like)",value:2}]},randomisedLength:{description:"Random characters length",type:1,default:7,disabled:()=>E.plugins.AnonymiseFileNames.method!==0},consistent:{description:"Consistent filename",type:0,default:"image",disabled:()=>E.plugins.AnonymiseFileNames.method!==1}},anonymise(e){let t="image",r=nP.exec(e)?.index??e.lastIndexOf("."),i=r!==-1?e.slice(r):"";switch(E.plugins.AnonymiseFileNames.method){case 0:let s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";t=Array.from({length:E.plugins.AnonymiseFileNames.randomisedLength},()=>s[Math.floor(Math.random()*s.length)]).join("");break;case 1:t=E.plugins.AnonymiseFileNames.consistent;break;case 2:t=`${Math.floor(Date.now()/1e3)}${Math.floor(window.performance.now())}`;break}return t+i}})});async function fv(e,t){return(await ur.fetchAssetIds(e,[t]))[0]}async function rP(e){let t={};return await oP.fetchApplicationsRPC(t,e),t.application}var oP,gv,ni,Ku,hv=g(()=>{"use strict";a();Pa();lo();P();w();j();A();oP=I("fetchApplicationsRPC","getRemoteIconURL");gv={};Ku=y({name:"WebRichPresence (arRPC)",description:"Client plugin for arRPC to enable RPC on Discord Web (experimental)",authors:[d.Ducko],settingsAboutComponent:()=>o(f,null,o(S.FormTitle,{tag:"h3"},"How to use arRPC"),o(S.FormText,null,o(st,{href:"https://github.com/OpenAsar/arrpc/tree/main#server"},"Follow the instructions in the GitHub repo")," to get the server running, and then enable the plugin.")),async handleEvent(e){let t=JSON.parse(e.data),{activity:n}=t,r=n?.assets;if(r?.large_image&&(r.large_image=await fv(n.application_id,r.large_image)),r?.small_image&&(r.small_image=await fv(n.application_id,r.small_image)),n){let i=n.application_id;gv[i]||=await rP(i);let s=gv[i];n.name||=s.name}F.dispatch({type:"LOCAL_ACTIVITY_UPDATE",...t})},async start(){if("armcord"in window)return;if(ni&&ni.close(),ni=new WebSocket("ws://127.0.0.1:1337"),ni.onmessage=this.handleEvent,!await new Promise(t=>setTimeout(()=>t(ni.readyState===WebSocket.OPEN),1e3))){Zi("Failed to connect to arRPC, is it running?","Retry",()=>{fu(),this.start()});return}ee.show({message:"Connected to arRPC",type:ee.Type.SUCCESS,id:ee.genId(),options:{duration:1e3,positio
2023-11-14 11:41:09 -06:00
.vc-nsfw-img [class^=imageWrapper] img,
.vc-nsfw-img [class^=wrapperPaused] video {
2023-11-23 12:19:53 -06:00
filter: blur(${E.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;
}
2023-11-23 12:19:53 -06:00
`}var ls,rp,_v=g(()=>{"use strict";a();$();P();w();rp=y({name:"BlurNSFW",description:"Blur attachments in NSFW channels until hovered",authors:[d.Ven],patches:[{find:".embedWrapper,embed",replacement:[{match:/\.embedWrapper/g,replace:"$&+(this.props.channel.nsfw?' vc-nsfw-img':'')"}]}],options:{blurAmount:{type:1,description:"Blur Amount",default:10,onChange:Ov}},start(){ls=document.createElement("style"),ls.id="VcBlurNsfw",document.head.appendChild(ls),Ov()},stop(){ls?.remove()}})});function pP(e){let t=E.plugins.CallTimer.format==="human",n=m=>t?m:m.toString().padStart(2,"0"),r=m=>t?m:"",i=t?" ":":",s=Math.floor(e/864e5),l=Math.floor(e%864e5/36e5),c=Math.floor(e%864e5%36e5/6e4),u=Math.floor(e%864e5%36e5%6e4/1e3),p="";return s&&(p+=`${s}d `),(l||p)&&(p+=`${n(l)}${r("h")}${i}`),(c||p||!t)&&(p+=`${n(c)}${r("m")}${i}`),p+=`${n(u)}${r("s")}`,p}var ip,Bv=g(()=>{"use strict";a();$();le();P();Qe();w();ip=y({name:"CallTimer",description:"Adds a timer to vcs",authors:[d.Ven],startTime:0,interval:void 0,options:{format:{type:4,description:"The timer format. This can be any valid moment.js format",options:[{label:"30d 23:00:42",value:"stopwatch",default:!0},{label:"30d 23h 00m 42s",value:"human"}]}},patches:[{find:"renderConnectionStatus(){",replacement:{match:/(?<=renderConnectionStatus\(\)\{.+\.channel,children:)\i/,replace:"[$&, $self.renderTimer(this.props.channel.id)]"}}],renderTimer(e){return o(_,{noop:!0},o(this.Timer,{channelId:e}))},Timer({channelId:e}){let t=Di({deps:[e]});return o("p",{style:{margin:0}},"Connected for ",o("span",{style:{fontFamily:"var(--font-code)"}},pP(t)))}})});var dp={};Be(dp,{_handleClick:()=>fP,_handlePreEdit:()=>mP,_handlePreSend:()=>dP,addClickListener:()=>up,addPreEditListener:()=>br,addPreSendListener:()=>Ht,removeClickListener:()=>pp,removePreEditListener:()=>Tr,removePreSendListener:()=>zt});async function dP(e,t,n,r){n.replyOptions=r;for(let i of ap)try{let s=await i(e,t,n);if(s&&s.cancel===!0)return!0}catch(s){sp.error(`MessageSendHandler: Listener encountered an unknown error
`,s)}return!1}async function mP(e,t,n){for(let r of lp)try{await r(e,t,n)}catch(i){sp.error(`MessageEditHandler: Listener encountered an unknown error
`,i)}}function Ht(e){return ap.add(e),e}function br(e){return lp.add(e),e}function zt(e){return ap.delete(e)}function Tr(e){return lp.delete(e)}function fP(e,t,n){e=An.getMessage(t.id,e.id)??e;for(let r of cp)try{r(e,t,n)}catch(i){sp.error(`MessageClickHandler: Listener encountered an unknown error
`,i)}}function up(e){return cp.add(e),e}function pp(e){return cp.delete(e)}var sp,ap,lp,cp,Yn=g(()=>{"use strict";a();Ze();A();sp=new ie("MessageEvents","#e5c890"),ap=new Set,lp=new Set;cp=new Set});var Fv,Uv=g(()=>{"use strict";a();Fv=["action_object_map","action_type_map","action_ref_map","spm@*.aliexpress.com","scm@*.aliexpress.com","aff_platform","aff_trace_key","algo_expid@*.aliexpress.*","algo_pvid@*.aliexpress.*","btsid","ws_ab_test","pd_rd_*@amazon.*","_encoding@amazon.*","psc@amazon.*","tag@amazon.*","ref_@amazon.*","pf_rd_*@amazon.*","pf@amazon.*","crid@amazon.*","keywords@amazon.*","sprefix@amazon.*","sr@amazon.*","ie@amazon.*","node@amazon.*","qid@amazon.*","callback@bilibili.com","cvid@bing.com","form@bing.com","sk@bing.com","sp@bing.com","sc@bing.com","qs@bing.com","pq@bing.com","sc_cid","mkt_tok","trk","trkCampaign","ga_*","gclid","gclsrc","hmb_campaign","hmb_medium","hmb_source","spReportId","spJobID","spUserID","spMailingID","itm_*","s_cid","elqTrackId","elqTrack","assetType","assetId","recipientId","campaignId","siteId","mc_cid","mc_eid","pk_*","sc_campaign","sc_channel","sc_content","sc_medium","sc_outcome","sc_geo","sc_country","nr_email_referer","vero_conv","vero_id","yclid","_openstat","mbid","cmpid","cid","c_id","campaign_id","Campaign","hash@ebay.*","fb_action_ids","fb_action_types","fb_ref","fb_source","fbclid","refsrc@facebook.com","hrc@facebook.com","gs_l","gs_lcp@google.*","ved@google.*","ei@google.*","sei@google.*","gws_rd@google.*","gs_gbg@google.*","gs_mss@google.*","gs_rn@google.*","_hsenc","_hsmi","__hssc","__hstc","hsCtaTracking","source@sourceforge.net","position@sourceforge.net","t@*.twitter.com","s@*.twitter.com","ref_*@*.twitter.com","tt_medium","tt_content","lr@yandex.*","redircnt@yandex.*","feature@youtube.com","kw@youtube.com","si@youtube.com","pp@youtube.com","si@youtu.be","wt_zmc","utm_source","utm_content","utm_medium","utm_campaign","utm_term","si@open.spotify.com","igshid","share_id@reddit.com"]});var $v,gP,mp,Gv=g(()=>{"use strict";a();Yn();P();w();Uv();$v=/[\\^$.*+?()[\]{}|]/g,gP=RegExp($v.source),mp=y({name:"ClearURLs",description:"Removes tracking garbage from URLs",authors:[d.adryd],dependencies:["MessageEventsAPI"],escapeRegExp(e){return e&&gP.test(e)?e.replace($v,"\\$&"):e||""},createRules(){let e=Fv;this.universalRules=new Set,this.rulesByHost=new Map,this.hostRules=new Map;for(let t of e){let n=t.split("@"),r=new RegExp("^"+this.escapeRegExp(n[0]).replace(/\\\*/,".+?")+"$");if(!n[1]){this.universalRules.add(r);continue}let i=new RegExp("^(www\\.)?"+this.escapeRegExp(n[1]).replace(/\\\./,"\\.").replace(/^\\\*\\\./,"(.+?\\.)?").replace(/\\\*/,".+?")+"$"),s=i.toString();this.hostRules.set(s,i),this.rulesByHost.get(s)==null&&this.rulesByHost.set(s,new Set),this.rulesByHost.get(s).add(r)}},removeParam(e,t,n){(t===e||e instanceof RegExp&&e.test(t))&&n.delete(t)},replacer(e){try{var t=new URL(e)}catch{return e}return t.searchParams.entries().next().done?e:(this.universalRules.forEach(n=>{t.searchParams.forEach((r,i,s)=>{this.removeParam(n,i,s)})}),this.hostRules.forEach((n,r)=>{!n.test(t.hostname)||this.rulesByHost.get(r).forEach(i=>{t.searchParams.forEach((s,l,c)=>{this.removeParam(i,l,c)})})}),t.toString())},onSend(e){e.content.match(/http(s)?:\/\//)&&(e.content=e.content.replace(/(https?:\/\/[^\s<]+[^<.,:;"'>)|\]\s])/g,t=>this.replacer(t)))},start(){this.createRules(),this.preSend=Ht((e,t)=>this.onSend(t)),this.preEdit=br((e,t,n)=>this.onSend(n))},stop(){zt(this.preSend),Tr(this.preEdit)}})});var Hv=g(()=>{});function jv(e){let t=e.toString(16).padStart(6,"0");cs.store.color=t,Wv(t)}function vP(){let e=TP(cs.store.color)>45,t=Uo()===2;return o("div",{className:"client-theme-settings"},o("div",{className:"client-theme-container"},o("div",{className:"client-theme-settings-labels"},o(S.FormTitle,{tag:"h3"},"Theme Color"),o(S.FormText,null,"Add a color to your Discord client theme")),o(hP,{color:parseInt(cs.store.color,16),onChange:jv,showEyeDropper:!1,suggestedColors:yP})),e||t?o("div",null,o(S.FormDivider,{className:oe(q.top8,q.bottom8)}),o(S.FormText,{className:"client-t
`),r=document.createElement("style");r.setAttribute("id","clientThemeOffsets"),r.textContent=`:root:root {
${n}
}`,document.head.appendChild(r)}function Wv(e){let{hue:t,saturation:n,lightness:r}=bP(e),i=document.getElementById("clientThemeVars");i||(i=document.createElement("style"),i.setAttribute("id","clientThemeVars"),document.head.appendChild(i)),i.textContent=`:root {
--theme-h: ${t};
--theme-s: ${n}%;
--theme-l: ${r}%;
}`}function bP(e){let t=parseInt(e.substring(0,2),16)/255,n=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,i=Math.max(t,n,r),s=Math.min(t,n,r),l=i-s,c,u,p;return p=(i+s)/2,l===0?(c=0,u=0):(u=l/(1-Math.abs(2*p-1)),i===t?c=(n-r)/l%6:i===n?c=(r-t)/l+2:c=(t-n)/l+4,c*=60,c<0&&(c+=360)),u*=100,p*=100,{hue:c,saturation:u,lightness:p}}function TP(e){let t=parseInt(e.substring(0,2),16)/255,n=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,i=Math.max(t,n,r),s=Math.min(t,n,r);return 100*((i+s)/2)}var hP,yP,cs,fp,zv,qv=g(()=>{"use strict";a();Hv();$();P();bt();at();Re();w();j();A();hP=Xe(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR"),yP=["#1E1514","#172019","#13171B","#1C1C28","#402D2D","#3A483D","#344242","#313D4B","#2D2F47","#322B42","#3C2E42","#422938"];cs=D({color:{description:"Color your Discord client theme will be based around. Light mode isn't supported",type:6,default:"313338",component:()=>o(vP,null)},resetColor:{description:"Reset Theme Color",type:6,default:"313338",component:()=>o(R,{onClick:()=>jv(3224376)},"Reset Theme Color")}}),fp=y({name:"ClientTheme",authors:[d.F53,d.Nuckyz],description:"Recreation of the old client theme experiment. Add a color to your Discord client theme",settings:cs,startAt:"DOMContentLoaded",start(){Wv(cs.store.color),SP()},stop(){document.getElementById("clientThemeVars")?.remove(),document.getElementById("clientThemeOffsets")?.remove()}}),zv=/(--primary-[5-9]\d{2}-hsl):.*?(\S*)%;/g});var gp,Kv=g(()=>{"use strict";a();P();w();gp=y({name:"ColorSighted",description:"Removes the colorblind-friendly icons from statuses, just like 2015-2017 Discord",authors:[d.lewisakura],patches:[{find:"Masks.STATUS_ONLINE",replacement:{match:/Masks\.STATUS_(?:IDLE|DND|STREAMING|OFFLINE)/g,replace:"Masks.STATUS_ONLINE"}},{find:".AVATAR_STATUS_MOBILE_16;",replacement:{match:/(?<=fromIsMobile:\i=!0,.+?)status:(\i)/,replace:'status_$:$1="online"'}}]})});function xr(e){if(typeof e=="string")return e;let t=e.source.replaceAll("\\i","[A-Za-z_$][\\w$]*");return new RegExp(t,e.flags)}function Ba(e,t){let n=`Vencord.Plugins.plugins[${JSON.stringify(t)}]`;return typeof e!="function"?e.replaceAll("$self",n):(...r)=>e(...r).replaceAll("$self",n)}function hp(e,t){if(e.get){let n=e.get;e.get=function(){return t(n.call(this))}}else e.value&&(e.value=t(e.value));return e}function us(e,t){let n=Object.getOwnPropertyDescriptors(e);n.match=hp(n.match,xr),n.replace=hp(n.replace,r=>Ba(r,t)),Object.defineProperties(e,n)}var ps=g(()=>{"use strict";a()});var yp,Yv=g(()=>{"use strict";a();P();Ro();ps();w();j();j();A();yp=y({name:"ConsoleShortcuts",description:"Adds shorter Aliases for many things on the window. Run `shortcutList` for a list.",authors:[d.Ven],getShortcuts(){function e(r){let i=new Map;return function(...s){let l=String(s);if(i.has(l))return i.get(l);let c=rr(r(...s)),u=(()=>{switch(c.length){case 0:return null;case 1:return c[0];default:let p=[...new Set(c)];return p.length>1&&console.warn(`Warning: This filter matches ${c.length} modules. Make it more specific!
`,p),c[0]}})();return u&&l&&i.set(l,u),u}}let t,n=e(r=>r);return{...Vencord.Webpack.Common,wp:Vencord.Webpack,wpc:Mn.c,wreq:Mn,wpsearch:lc,wpex:Zs,wpexs:r=>Zs(ic(r)),find:n,findAll:rr,findByProps:e(Ke.byProps),findAllByProps:(...r)=>rr(Ke.byProps(...r)),findByCode:e(Ke.byCode),findAllByCode:r=>rr(Ke.byCode(r)),findComponentByCode:e(Ke.componentByCode),findAllComponentsByCode:(...r)=>rr(Ke.componentByCode(...r)),findExportedComponent:(...r)=>n(...r)[r[0]],findStore:e(Ke.byStoreName),PluginsApi:Vencord.Plugins,plugins:Vencord.Plugins.plugins,Settings:Vencord.Settings,Api:Vencord.Api,reload:()=>location.reload(),restart:ln,canonicalizeMatch:xr,canonicalizeReplace:Ba,canonicalizeReplacement:us,fakeRender:(r,i)=>{let s=t?.deref(),l=s?.closed===!1?s:window.open("about:blank","Fake Render","popup,width=500,height=500");t=new WeakRef(l),l.focus();let c=l.document;c.body.style.margin="1em",l.prepared||(l.prepared=!0,[...document.querySelectorAll("style"),...document.querySelectorAll("link[rel=stylesheet]")].forEach(u=>{let p=u.cloneNode(!0);u.parentElement?.tagName==="HEAD"?c.head.append(p):p.id?.startsWith("vencord-")||p.id?.startsWith("vcd-")?c.documentElement.append(p):c.body.append(p)})),sr.render(O.createElement(r,i),c.body.appendChild(document.createElement("div")))}}},start(){let e=this.getShortcuts();window.shortcutList=e;for(let[t,n]of Object.entries(e))window[t]=n},stop(){delete window.shortcutList;for(let e in this.getShortcuts())delete window[e]}})});var Zv,vp,Xv=g(()=>{"use strict";a();Pt();$t();P();w();A();Zv=(e,{user:t})=>()=>{e.push(o(G.MenuItem,{id:"vc-copy-user-url",label:"Copy User URL",action:()=>Zt.copy(`<https://discord.com/users/${t.id}>`),icon:Jr}))},vp=y({name:"CopyUserURLs",authors:[d.castdrian],description:"Adds a 'Copy User URL' option to the user context menu.",start(){ce("user-context",Zv)},stop(){de("user-context",Zv)}})});var $o,xP,Sp,bp,Fa,Tp,xp,Jv=g(()=>{"use strict";a();Ao();$();P();Ze();dt();w();yr();j();A();$o=new ie("CrashHandler"),xP=I("pushLazy","popAll"),Sp=D({attemptToPreventCrashes:{type:3,description:"Whether to attempt to prevent Discord crashes.",default:!0},attemptToNavigateToHome:{type:3,description:"Whether to attempt to navigate to the home when preventing Discord crashes.",default:!1}}),bp=0,Fa=0,Tp=!1,xp=y({name:"CrashHandler",description:"Utility plugin for handling and possibly recovering from Crashes without a restart",authors:[d.Nuckyz],enabledByDefault:!0,settings:Sp,patches:[{find:".Messages.ERRORS_UNEXPECTED_CRASH",replacement:{match:/(?=this\.setState\()/,replace:"$self.handleCrash(this)||"}}],handleCrash(e){if(Date.now()-Fa<=1e3&&!Tp)return!0;if(Tp=!1,++bp>5){try{Ie({color:"#eed202",title:"Discord has crashed!",body:"Awn :( Discord has crashed more than five times, not attempting to recover.",noPersist:!0})}catch{}return Fa=Date.now(),!1}setTimeout(()=>bp--,6e4);try{return bp===1&&Ki("Uh oh, Discord has just crashed... but good news, there is a Vencord update available that might fix this issue! Would you like to update now?",!0),Sp.store.attemptToPreventCrashes?(this.handlePreventCrash(e),!0):!1}catch(t){return $o.error("Failed to handle crash",t),!1}finally{Fa=Date.now()}},handlePreventCrash(e){if(Date.now()-Fa>=1e3)try{Ie({color:"#eed202",title:"Discord has crashed!",body:"Attempting to recover...",noPersist:!0})}catch{}try{F.dispatch({type:"CONTEXT_MENU_CLOSE"})}catch(t){$o.debug("Failed to close open context menu.",t)}try{xP?.popAll()}catch(t){$o.debug("Failed to close old modals.",t)}try{wc()}catch(t){$o.debug("Failed to close all open modals.",t)}try{F.dispatch({type:"USER_PROFILE_MODAL_CLOSE"})}catch(t){$o.debug("Failed to close user popout.",t)}try{F.dispatch({type:"LAYER_POP_ALL"})}catch(t){$o.debug("Failed to pop all layers.",t)}if(Sp.store.attemptToNavigateToHome)try{pr.transitionTo("/channels/@me")}catch(t){$o.debug("Failed to navigate to home",t)}try{Tp=!0,e.forceUpdate()}catch(t){$o.debug("Failed to update crash handler component.",t)}}})});function Ua(e){return Boolean(e)}function wp(e){return e!=null}var $a=g(()=>{"use strict";a()});async function Qv(e
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}\`
2023-11-23 12:19:53 -06: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 Za.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}\`
2023-11-23 12:19:53 -06:00
`.trim().replace(/\s+/g," "));ue(t.channel.id,{content:r.join(`
`)||"You have no active friend invites!"})}},{name:"revoke friend invites",description:"Revokes all generated friend invites.",inputType:3,execute:async(e,t)=>{await Za.revokeFriendInvites(),ue(t.channel.id,{content:"All friend invites have been revoked."})}}]})});var qp,X1=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/gameActivityToggle/style.css",{name:"src/plugins/gameActivityToggle/style.css",source:`[class*="withTagAsButton"] {
2023-11-14 11:41:09 -06:00
min-width: 88px !important;
}
2023-11-23 12:19:53 -06:00
`,classNames:{},dom:null});qp="src/plugins/gameActivityToggle/style.css"});function vI(e){return function(){return o("svg",{width:"20",height:"20",viewBox:"0 0 24 24"},o("path",{fill:"currentColor",mask:"url(#gameActivityMask)",d:"M3.06 20.4q-1.53 0-2.37-1.065T.06 16.74l1.26-9q.27-1.8 1.605-2.97T6.06 3.6h11.88q1.8 0 3.135 1.17t1.605 2.97l1.26 9q.21 1.53-.63 2.595T20.94 20.4q-.63 0-1.17-.225T18.78 19.5l-2.7-2.7H7.92l-2.7 2.7q-.45.45-.99.675t-1.17.225Zm14.94-7.2q.51 0 .855-.345T19.2 12q0-.51-.345-.855T18 10.8q-.51 0-.855.345T16.8 12q0 .51.345 .855T18 13.2Zm-2.4-3.6q.51 0 .855-.345T16.8 8.4q0-.51-.345-.855T15.6 7.2q-.51 0-.855.345T14.4 8.4q0 .51.345 .855T15.6 9.6ZM6.9 13.2h1.8v-2.1h2.1v-1.8h-2.1v-2.1h-1.8v2.1h-2.1v1.8h2.1v2.1Z"}),!e&&o(f,null,o("mask",{id:"gameActivityMask"},o("rect",{fill:"white",x:"0",y:"0",width:"24",height:"24"}),o("path",{fill:"black",d:"M23.27 4.54 19.46.73 .73 19.46 4.54 23.27 23.27 4.54Z"})),o("path",{fill:"var(--status-danger)",d:"M23 2.27 21.73 1 1 21.73 2.27 23 23 2.27Z"})))}}function SI(){let e=Fr.ShowCurrentGame.useSetting();return o(yI,{tooltipText:e?"Disable Game Activity":"Enable Game Activity",icon:vI(e),role:"switch","aria-checked":!e,onClick:()=>Fr.ShowCurrentGame.updateSetting(t=>!t)})}var yI,Kp,J1=g(()=>{"use strict";a();Je();le();P();w();j();A();X1();yI=Xe("Button.Sizes.NONE,disabled:");Kp=y({name:"GameActivityToggle",description:"Adds a button next to the mic and deafen button to toggle game activity.",authors:[d.Nuckyz,d.RuukuLada],patches:[{find:".Messages.ACCOUNT_SPEAKING_WHILE_MUTED",replacement:{match:/this\.renderNameZone\(\).+?children:\[/,replace:"$&$self.GameActivityToggleButton(),"}}],GameActivityToggleButton:_.wrap(SI,{noop:!0}),start(){St(qp)},stop(){Ft(qp)}})});var bI,Yp,Q1=g(()=>{"use strict";a();P();bt();w();j();({closeExpressionPicker:bI}=I("closeExpressionPicker")),Yp=y({name:"GifPaste",description:"Makes picking a gif in the gif picker insert a link into the chatbox instead of instantly sending it",authors:[d.Ven],patches:[{find:".handleSelectGIF=",replacement:{match:/\.handleSelectGIF=(\i)=>\{/,replace:".handleSelectGIF=$1=>{if (!this.props.className) return $self.handleSelect($1);"}}],handleSelect(e){e&&(so(e.url+" "),bI())}})});function e0(e,t,n){let r=Zp.getSendMessageOptionsForReply({channel:e,message:t,shouldMention:!0,showMentionToggle:!0});if(Xa.store.greetMode==="Message"||n.length>1){r.stickerIds=n;let i={content:"",tts:!1,invalidEmojis:[],validNonShortcutEmojis:[]};Zp._sendMessage(e.id,i,r)}else Zp.sendGreetMessage(e.id,n[0],r)}function TI({channel:e,message:t}){let n=Xa.use(["greetMode","multiGreetChoices"]),{greetMode:r,multiGreetChoices:i=[]}=n;return o(G.Menu,{navId:"greet-sticker-picker",onClose:()=>F.dispatch({type:"CONTEXT_MENU_CLOSE"}),"aria-label":"Greet Sticker Picker"},o(G.MenuGroup,{label:"Greet Mode"},Object.values(t0).map(s=>o(G.MenuRadioItem,{key:s,group:"greet-mode",id:"greet-mode-"+s,label:s,checked:s===r,action:()=>n.greetMode=s}))),o(G.MenuSeparator,null),o(G.MenuGroup,{label:"Greet Stickers"},V1.map(s=>o(G.MenuItem,{key:s.id,id:"greet-"+s.id,label:s.description.split(" ")[0],action:()=>e0(e,t,[s.id])}))),Xa.store.unholyMultiGreetEnabled?o(f,null,o(G.MenuSeparator,null),o(G.MenuItem,{label:"Unholy Multi-Greet",id:"unholy-multi-greet"},V1.map(s=>{let l=i.some(c=>c===s.id);return o(G.MenuCheckboxItem,{key:s.id,id:"multi-greet-"+s.id,label:s.description.split(" ")[0],checked:l,disabled:!l&&i.length>=3,action:()=>{n.multiGreetChoices=l?i.filter(c=>c!==s.id):[...i,s.id]}})}),o(G.MenuSeparator,null),o(G.MenuItem,{id:"multi-greet-submit",label:"Send Greets",action:()=>e0(e,t,i),disabled:i.length===0}))):null)}var t0,Xa,Zp,V1,Xp,n0=g(()=>{"use strict";a();$();P();w();j();A();t0=(n=>(n.Greet="Greet",n.NormalMessage="Message",n))(t0||{}),Xa=D({greetMode:{type:4,options:[{label:"Greet (you can only greet 3 times)",value:"Greet",default:!0},{label:"Normal Message (you can greet spam)",value:"Message"}],description:"Choose the greet mode"}}).withPrivateSettings(),Zp=I("sendGreetMessage"),{WELCOME_STICKERS:V1}=I("WELCOME_STICKERS");Xp=y({name:"GreetS
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%;
}
2023-11-23 12:19:53 -06:00
`},async toggleHide(e){let t=await o0();t.delete(e)||t.add(e),await MI(t),await this.buildCss()}})});var Vp,s0=g(()=>{"use strict";a();P();w();Vp=y({name:"iLoveSpam",description:"Do not hide messages from 'likely spammers'",authors:[d.botato,d.Animal],patches:[{find:"hasFlag:{writable",replacement:{match:/if\((\i)<=(?:1<<30|1073741824)\)return/,replace:"if($1===(1<<20))return false;$&"}}]})});function c0(e,t,n,r){return o(V,{text:t},i=>o("button",{...i,onClick:s=>AI(s,e),style:{all:"unset",cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center"}},o("svg",{width:"24",height:"24",viewBox:"0 -960 960 960"},o("path",{fill:r,d:n}))))}function l0(e,t=!1){let n=ii.use(["ignoredActivities"]),{ignoredActivities:r=[]}=n;return r.some(i=>i.id===e.id)?II(e,"var(--status-danger)"):PI(e,t?"var(--green-300)":"var(--primary-400)")}function AI(e,t){e.stopPropagation();let n=zo().findIndex(r=>r.id===t.id);n===-1?ii.store.ignoredActivities=zo().concat(t):ii.store.ignoredActivities=zo().filter((r,i)=>i!==n),Fr.ShowCurrentGame.updateSetting(r=>r)}function zo(){return ii.store.ignoredActivities??=[]}var a0,PI,II,ii,ed,u0=g(()=>{"use strict";a();Wn();$();le();P();w();j();A();a0=Me("RunningGameStore");PI=(e,t)=>c0(e,"Disable Activity","M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z",t),II=(e,t)=>c0(e,"Enable Activity","m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z",t);ii=D({}).withPrivateSettings();ed=y({name:"IgnoreActivities",authors:[d.Nuckyz],description:"Ignore activities from showing up on your status ONLY. You can configure which ones are ignored from the Registered Games and Activities tabs.",settings:ii,patches:[{find:'.displayName="LocalActivityStore"',replacement:[{match:/HANG_STATUS.+?(?=!\i\(\i,\i\)&&)(?<=(\i)\.push.+?)/,replace:(e,t)=>`${e}${t}=${t}.filter($self.isActivityNotIgnored);`}]},{find:".Messages.SETTINGS_GAMES_TOGGLE_OVERLAY",replacement:{match:/\.Messages\.SETTINGS_GAMES_TOGGLE_OVERLAY.+?}\(\),(?<={overlay:\i,.+?=(\i),.+?)(?=!(\i))/,replace:(e,t,n)=>`${e}$self.renderToggleGameActivityButton(${t},${n}),`}},{find:".activityTitleText,variant",replacement:{match:/(?<=\i\.activityTitleText.+?children:(\i)\.name.*?}\),)/,replace:(e,t)=>`$self.renderToggleActivityButton(${t}),`}},{find:".activityCardDetails,children",replacement:{match:/(?<=\i\.activityCardDetails.+?children:(\i\.application)\.name.*?}\),)/,replace:(e,t)=>`$self.renderToggleActivityButton(${t}),`}}],async start(){let e=await It("IgnoreActivities_ignoredActivities");if(e!=null&&(ii.store.ignoredActivities=Array.from(e.values()).map(t=>({...t,name:"Unknown Name"})),$c("IgnoreActivities_ignoredActivities")),zo().length!==0){let t=a0.getGamesSeen();for(let[n,r]of zo().entries())r.type===0&&(t.some(i=>i.id===r.id||i.exePath===r.id)||zo().splice(n,1))}},isActivityNotIgnored(e){if(e.type===0||e.type===3){if(e.application_id!=null)return!zo().some(t=>t.id===e.application_id);{let t=a0.getRunningGames().find(n=>n.name===e.name)?.exePath;if(t)return!zo().some(n=>n.id===t)}}return!0},renderToggleGameActivityButton(e,t){return o(_,{noop:!0},o("div",{style:{marginLeft:12,zIndex:0}},l0({id:e.id??e.exePath,name:e.name,type:0},t)))},renderToggleActivityButton(e){return o(_,{no
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;
}
.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;
}
2023-11-23 12:19:53 -06:00
`,classNames:{},dom:null});id="src/plugins/imageZoom/styles.css"});var _e,f0,sd,rd=g(()=>{"use strict";a();Pt();$();Je();ka();P();zr();w();A();d0();td();m0();_e=D({saveZoomValues:{type:3,description:"Whether to save zoom and lens size values",default:!0},invertScroll:{type:3,description:"Invert scroll",default:!0},nearestNeighbour:{type:3,description:"Use Nearest Neighbour Interpolation when scaling images",default:!1},square:{type:3,description:"Make the lens square",default:!1},zoom:{description:"Zoom of the lens",type:5,markers:Fo(1,50,4),default:2,stickToMarkers:!1},size:{description:"Radius / Size of the lens",type:5,markers:Fo(50,1e3,50),default:100,stickToMarkers:!1},zoomSpeed:{description:"How fast the zoom / lens size changes",type:5,markers:Fo(.1,5,.2),default:.5,stickToMarkers:!1}}),f0=e=>()=>{e.push(o(G.MenuGroup,{id:"image-zoom"},o(G.MenuCheckboxItem,{id:"vc-square",label:"Square Lens",checked:_e.store.square,action:()=>{_e.store.square=!_e.store.square,dn.closeContextMenu()}}),o(G.MenuCheckboxItem,{id:"vc-nearest-neighbour",label:"Nearest Neighbour",checked:_e.store.nearestNeighbour,action:()=>{_e.store.nearestNeighbour=!_e.store.nearestNeighbour,dn.closeContextMenu()}}),o(G.MenuControlItem,{id:"vc-zoom",label:"Zoom",control:(t,n)=>o(G.MenuSliderControl,{ref:n,...t,minValue:1,maxValue:50,value:_e.store.zoom,onChange:yn(r=>_e.store.zoom=r,100)})}),o(G.MenuControlItem,{id:"vc-size",label:"Lens Size",control:(t,n)=>o(G.MenuSliderControl,{ref:n,...t,minValue:50,maxValue:1e3,value:_e.store.size,onChange:yn(r=>_e.store.size=r,100)})}),o(G.MenuControlItem,{id:"vc-zoom-speed",label:"Zoom Speed",control:(t,n)=>o(G.MenuSliderControl,{ref:n,...t,minValue:.1,maxValue:5,value:_e.store.zoomSpeed,onChange:yn(r=>_e.store.zoomSpeed=r,100),renderValue:r=>`${r.toFixed(3)}x`})})))},sd=y({name:"ImageZoom",description:"Lets you zoom in to images and gifs. Use scroll wheel to zoom in and shift + scroll wheel to increase lens radius / size",authors:[d.Aria],tags:["ImageUtilities"],patches:[{find:"Messages.OPEN_IN_BROWSER",replacement:{match:/return.{1,200}\.wrapper.{1,200}src:\i,/g,replace:`$&id: '${ys}',`}},{find:"handleImageLoad=",replacement:[{match:/showThumbhashPlaceholder:\i,/,replace:"...$self.makeProps(this),$&"},{match:/componentDidMount\(\){/,replace:"$&$self.renderMagnifier(this);"},{match:/componentWillUnmount\(\){/,replace:"$&$self.unMountMagnifier();"}]},{find:".carouselModal",replacement:{match:/(?<=\.carouselModal.{0,100}onClick:)\i,/,replace:"()=>{},"}}],settings:_e,currentMagnifierElement:null,element:null,Magnifier:od,root:null,makeProps(e){return{onMouseOver:()=>this.onMouseOver(e),onMouseOut:()=>this.onMouseOut(e),onMouseDown:t=>this.onMouseDown(t,e),onMouseUp:()=>this.onMouseUp(e),id:e.props.id}},renderMagnifier(e){e.props.id===ys&&(this.currentMagnifierElement||(this.currentMagnifierElement=o(od,{size:_e.store.size,zoom:_e.store.zoom,instance:e}),this.root=sr.createRoot(this.element),this.root.render(this.currentMagnifierElement)))},unMountMagnifier(){this.root?.unmount(),this.currentMagnifierElement=null,this.root=null},onMouseOver(e){e.setState(t=>({...t,mouseOver:!0}))},onMouseOut(e){e.setState(t=>({...t,mouseOver:!1}))},onMouseDown(e,t){e.button===0&&t.setState(n=>({...n,mouseDown:!0}))},onMouseUp(e){e.setState(t=>({...t,mouseDown:!1}))},start(){St(id),ce("image-context",f0),this.element=document.createElement("div"),this.element.classList.add("MagnifierContainer"),document.body.appendChild(this.element)},stop(){Ft(id),this.root&&this.root.unmount(),this.element?.remove(),de("image-context",f0)}})});function CI(e){let t=e?.message?.content,[n,r]=O.useState("password");return o(ze,{...e},o(lt,null,o(S.FormTitle,{tag:"h4"},"Decrypt Message")),o(et,null,o(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Message with Encryption"),o(Ve,{defaultValue:t,disabled:!0}),o(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Password"),o(Ve,{style:{marginBottom:"20px"},onChange:r})),o(_t,null,o(R,{color:R.Colors.GREEN,onClick:()=>{let i=ad(t,n,!0);!i||!e?.message||(Vencord.Plugins.plugins.InvisibleChat.buildEmbed(e?.m
2023-11-14 11:41:09 -06:00
background-color: rgba(240 71 71 / 15%) !important;
}
2023-11-23 12:19:53 -06:00
`,classNames:{},dom:null});xd="src/plugins/messageLogger/deleteStyleOverlay.css"});var wd,U0=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/messageLogger/deleteStyleText.css",{name:"src/plugins/messageLogger/deleteStyleText.css",source:`/* Message content highlighting */
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;
}
2023-11-23 12:19:53 -06:00
`,classNames:{},dom:null});wd="src/plugins/messageLogger/deleteStyleText.css"});function $0(){E.plugins.MessageLogger.deleteStyle==="text"?(St(wd),Ft(xd)):(Ft(wd),St(xd))}var tA,G0,H0,z0,Md,j0=g(()=>{"use strict";a();B0();Pt();$();Je();le();P();Ze();w();j();A();F0();U0();tA=I("edited","communicationDisabled","isSystemMessage");G0="ml-remove-history",H0="ml-toggle-style",z0=(e,t)=>()=>{let{message:n}=t,{deleted:r,editHistory:i,id:s,channel_id:l}=n;if(!r&&!i?.length)return;e:{if(!r)break e;let c=document.getElementById(`chat-messages-${l}-${s}`);if(!c)break e;e.push(o(G.MenuItem,{id:H0,key:H0,label:"Toggle Deleted Highlight",action:()=>c.classList.toggle("messagelogger-deleted")}))}e.push(o(G.MenuItem,{id:G0,key:G0,label:"Remove Message History",color:"danger",action:()=>{r?F.dispatch({type:"MESSAGE_DELETE",channelId:l,id:s,mlDeleted:!0}):n.editHistory=[]}}))},Md=y({name:"MessageLogger",description:"Temporarily logs deleted and edited messages.",authors:[d.rushii,d.Ven,d.AutumnVN],start(){$0(),ce("message",z0)},stop(){de("message",z0)},renderEdit(e){return o(_,{noop:!0},o("div",{className:"messagelogger-edited"},Fe.parse(e.content),o(Gn,{timestamp:e.timestamp,isEdited:!0,isInline:!1},o("span",{className:tA.edited}," ","(",ot.Messages.MESSAGE_EDITED,")"))))},makeEdit(e,t){return{timestamp:mn?.call(e.edited_timestamp),content:t.content}},options:{deleteStyle:{type:4,description:"The style of deleted messages",default:"text",options:[{label:"Red text",value:"text",default:!0},{label:"Red overlay",value:"overlay"}],onChange:()=>$0()},ignoreBots:{type:3,description:"Whether to ignore messages by bots",default:!1},ignoreSelf:{type:3,description:"Whether to ignore messages by yourself",default:!1},ignoreUsers:{type:0,description:"Comma-separated list of user IDs to ignore",default:""},ignoreChannels:{type:0,description:"Comma-separated list of channel IDs to ignore",default:""},ignoreGuilds:{type:0,description:"Comma-separated list of guild IDs to ignore",default:""}},handleDelete(e,t,n){try{if(e==null||!n&&!e.has(t.id))return e;let r=i=>{let s=e.get(i);if(!s)return;let l=64;t.mlDeleted||(s.flags&l)===l||this.shouldIgnore(s)?e=e.remove(i):e=e.update(i,u=>u.set("deleted",!0).set("attachments",u.attachments.map(p=>(p.deleted=!0,p))))};n?t.ids.forEach(r):r(t.id)}catch(r){new ie("MessageLogger").error("Error during handleDelete",r)}return e},shouldIgnore(e){let{ignoreBots:t,ignoreSelf:n,ignoreUsers:r,ignoreChannels:i,ignoreGuilds:s}=E.plugins.MessageLogger,l=W.getCurrentUser().id;return t&&e.author?.bot||n&&e.author?.id===l||r.includes(e.author?.id)||i.includes(e.channel_id)||i.includes(Q.getChannel(e.channel_id)?.parent_id)||s.includes(Q.getChannel(e.channel_id)?.guild_id)},patches:[{find:'displayName="MessageStore"',replacement:[{match:/MESSAGE_DELETE:function\((\i)\){let.+?((?:\i\.){2})getOrCreate.+?},/,replace:"MESSAGE_DELETE:function($1){ var cache = $2getOrCreate($1.channelId); cache = $self.handleDelete(cache, $1, false); $2commit(cache);},"},{match:/MESSAGE_DELETE_BULK:function\((\i)\){let.+?((?:\i\.){2})getOrCreate.+?},/,replace:"MESSAGE_DELETE_BULK:function($1){ var cache = $2getOrCreate($1.channelId); cache = $self.handleDelete(cache, $1, true); $2commit(cache);},"},{match:/(MESSAGE_UPDATE:function\((\i)\).+?)\.update\((\i)/,replace:"$1.update($3,m => (($2.message.flags & 64) === 64 || $self.shouldIgnore($2.message)) ? m : $2.message.content !== m.editHistory?.[0]?.content && $2.message.content !== m.content ? m.set('editHistory',[...(m.editHistory || []), $self.makeEdit($2.message, m)]) : m).update($3"},{match:/(?<=getLastEditableMessage\(\i\)\{.{0,200}\.find\((\i)=>)/,replace:"!$1.deleted &&"}]},{find:"}addReaction(",replacement:[{match:/this\.customRenderedContent=(\i)\.customRenderedContent,/,replace:"this.customRenderedContent = $1.customRenderedContent,this.deleted = $1.deleted || false,this.editHistory = $1.editHistory || [],"}]},{find:"THREAD_STARTER_MESSAGE?null===",replacement:[{match:/interactionData:(\i)\.interactionData/,replace:"interactionData:$1.interactionData,deleted:$1.delete
`)}):(ue(n.channel.id,{content:`${jo} The tag **${e.name}** does not exist anymore! Please reload ur Discord to fix :)`}),{content:`/${e.name}`}),[nA]:!0},"CustomTags")}var jo,sl,nA,il,rl,oA,rA,Pd,q0=g(()=>{"use strict";a();Qt();Wn();$();P();w();jo="<:luna:1035316192220553236>",sl="MessageTags_TAGS",nA=Symbol("MessageTags"),il=()=>It(sl).then(e=>e??[]),rl=e=>It(sl).then(t=>(t??[]).find(n=>n.name===e)??null),oA=async e=>{let t=await il();return t.push(e),Xt(sl,t),t},rA=async e=>{let t=await il();return t=await t.filter(n=>n.name!==e),Xt(sl,t),t};Pd=y({name:"MessageTags",description:"Allows you to save messages and to use them with a simple command.",authors:[d.Luna],options:{clyde:{name:"Clyde message on send",description:"If enabled, clyde will send you an ephemeral message when a tag was used.",type:3,default:!0}},dependencies:["CommandsAPI"],async start(){for(let e of await il())W0(e)},commands:[{name:"tags",description:"Manage all the tags for yourself",inputType:0,options:[{name:"create",description:"Create a new tag",type:1,options:[{name:"tag-name",description:"The name of the tag to trigger the response",type:3,required:!0},{name:"message",description:"The message that you will send when using this tag",type:3,required:!0}]},{name:"list",description:"List all tags from yourself",type:1,options:[]},{name:"delete",description:"Remove a tag from your yourself",type:1,options:[{name:"tag-name",description:"The name of the tag to trigger the response",type:3,required:!0}]},{name:"preview",description:"Preview a tag without sending it publicly",type:1,options:[{name:"tag-name",description:"The name of the tag to trigger the response",type:3,required:!0}]}],async execute(e,t){switch(e[0].name){case"create":{let n=it(e[0].options,"tag-name",""),r=it(e[0].options,"message","");if(await rl(n))return ue(t.channel.id,{content:`${jo} A Tag with the name **${n}** already exists!`});let i={name:n,enabled:!0,message:r};W0(i),await oA(i),ue(t.channel.id,{content:`${jo} Successfully created the tag **${n}**!`});break}case"delete":{let n=it(e[0].options,"tag-name","");if(!await rl(n))return ue(t.channel.id,{content:`${jo} A Tag with the name **${n}** does not exist!`});ts(n),await rA(n),ue(t.channel.id,{content:`${jo} Successfully deleted the tag **${n}**!`});break}case"list":{ue(t.channel.id,{embeds:[{title:"All Tags:",description:(await il()).map(n=>`\`${n.name}\`: ${n.message.slice(0,72).replaceAll("\\n"," ")}${n.message.length>72?"...":""}`).join(`
`)||`${jo} Woops! There are no tags yet, use \`/tags create\` to create one!`,color:14122879,type:"rich"}]});break}case"preview":{let n=it(e[0].options,"tag-name",""),r=await rl(n);if(!r)return ue(t.channel.id,{content:`${jo} A Tag with the name **${n}** does not exist!`});ue(t.channel.id,{content:r.message.replaceAll("\\n",`
`)});break}default:{ue(t.channel.id,{content:"Invalid sub-command"});break}}}}]})});function iA(e){let t="";for(let n=0;n<e.length;n++)t+=n%2?e[n].toUpperCase():e[n].toLowerCase();return t}var Id,K0=g(()=>{"use strict";a();Qt();P();w();Id=y({name:"MoreCommands",description:"echo, lenny, mock",authors:[d.Arjix,d.echo,d.Samu],dependencies:["CommandsAPI"],commands:[{name:"echo",description:"Sends a message as Clyde (locally)",options:[Bo],inputType:3,execute:(e,t)=>{let n=it(e,"message","");ue(t.channel.id,{content:n})}},{name:"lenny",description:"Sends a lenny face",options:[Bo],execute:e=>({content:it(e,"message","")+" ( \u0361\xB0 \u035C\u0296 \u0361\xB0)"})},{name:"mock",description:"mOcK PeOpLe",options:[es],execute:e=>({content:iA(it(e,"message",""))})}]})});var Ad,Y0=g(()=>{"use strict";a();Qt();P();w();Ad=y({name:"MoreKaomoji",description:"Adds more Kaomoji to discord. \u30FD(\xB4\u25BD`)/",authors:[d.JacobTm],dependencies:["CommandsAPI"],commands:[{name:"dissatisfaction",description:" \uFF1E\uFE4F\uFF1C"},{name:"smug",description:" \u0CA0_\u0CA0"},{name:"happy",description:" \u30FD(\xB4\u25BD`)/"},{name:"crying",description:" \u0CA5_\u0CA5"},{name:"angry",description:" \u30FD(\uFF40\u0414\xB4)\uFF89"},{name:"anger",description:" \u30FD(\uFF4F`\u76BF\u2032\uFF4F)\uFF89"},{name:"joy",description:" <(\uFFE3\uFE36\uFFE3)>"},{name:"blush",description:"\u0AEE \u02F6\u1D54 \u1D55 \u1D54\u02F6 \u10D0"},{name:"confused",description:"(\u2022\u0E34_\u2022\u0E34)?"},{name:"sleeping",description:"(\u1D17_\u1D17)"},{name:"laughing",description:"o(\u2267\u25BD\u2266)o"}].map(e=>({...e,options:[Bo],execute:t=>({content:it(t,"message","")+e.description})}))})});function aA(e){Wo.store.tagSettings??=Nd;let[t,n]=J(Wo.store.tagSettings),r=i=>{n(i),e.setValue(i)};return o(ge,{flexDirection:"column"},ai.map(i=>o(wt,{style:{padding:"1em 1em 0"}},o(S.FormTitle,{style:{width:"fit-content"}},o(V,{text:i.description},({onMouseEnter:s,onMouseLeave:l})=>o("div",{onMouseEnter:s,onMouseLeave:l},i.displayName," Tag ",o(uo,{type:uo.Types[i.name]})))),o(Ve,{type:"text",value:t[i.name]?.text??i.displayName,placeholder:`Text on tag (default: ${i.displayName})`,onChange:s=>{t[i.name].text=s,r(t)},className:q.bottom16}),o(pt,{value:t[i.name]?.showInChat??!0,onChange:s=>{t[i.name].showInChat=s,r(t)},hideBorder:!0},"Show in messages"),o(pt,{value:t[i.name]?.showInNotChat??!0,onChange:s=>{t[i.name].showInNotChat=s,r(t)},hideBorder:!0},"Show in member list and profiles"))))}var sA,uo,Z0,ai,Nd,Wo,Cd,X0=g(()=>{"use strict";a();$();Lt();P();at();w();j();A();sA=I("computePermissions","canEveryoneRole"),uo=un(e=>e.Types?.[0]==="BOT"),Z0=(e,t)=>!!e?.webhookId&&t.isNonUserBot(),ai=[{name:"WEBHOOK",displayName:"Webhook",description:"Messages sent by webhooks",condition:Z0},{name:"OWNER",displayName:"Owner",description:"Owns the server",condition:(e,t,n)=>Te.getGuild(n?.guild_id)?.ownerId===t.id},{name:"ADMINISTRATOR",displayName:"Admin",description:"Has the administrator permission",permissions:["ADMINISTRATOR"]},{name:"MODERATOR_STAFF",displayName:"Staff",description:"Can manage the server, channels or roles",permissions:["MANAGE_GUILD","MANAGE_CHANNELS","MANAGE_ROLES"]},{name:"MODERATOR",displayName:"Mod",description:"Can manage messages or kick/ban people",permissions:["MANAGE_MESSAGES","KICK_MEMBERS","BAN_MEMBERS"]},{name:"VOICE_MODERATOR",displayName:"VC Mod",description:"Can manage voice chats",permissions:["MOVE_MEMBERS","MUTE_MEMBERS","DEAFEN_MEMBERS"]}],Nd=Object.fromEntries(ai.map(({name:e,displayName:t})=>[e,{text:t,showInChat:!0,showInNotChat:!0}]));Wo=D({dontShowForBots:{description:"Don't show extra tags for bots (excluding webhooks)",type:3},dontShowBotTag:{description:"Only show extra tags for bots / Hide [BOT] text",type:3},tagSettings:{type:6,component:aA,description:"fill me"}}),Cd=y({name:"MoreUserTags",description:"Adds tags for webhooks and moderative roles (owner, admin, etc.)",authors:[d.Cyn,d.TheSun,d.RyanCaoDev,d.LordElias,d.AutumnVN],settings:Wo,patches:[{find:"BotTagTypes:",replacement:{match:/\((\i)=\{\}\)\)\[(\i)\.BOT/,replace:"($1=$
2023-11-14 11:41:09 -06:00
position: relative;
}
2023-11-23 12:19:53 -06:00
`,classNames:{},dom:null});Fd="src/plugins/noMosaic/styles.css"});var Ud,$d,rS=g(()=>{"use strict";a();$();Je();P();w();oS();Ud=D({inlineVideo:{description:"Play videos without carousel modal",type:3,default:!0,restartNeeded:!0},mediaLayoutType:{description:"Choose media layout type",type:4,restartNeeded:!0,options:[{label:"STATIC, render loading image but image isn't resposive, no problem unless discord window width is too small",value:"STATIC",default:!0},{label:"RESPONSIVE, image is responsive but not render loading image, cause messages shift when loaded",value:"RESPONSIVE"}]}}),$d=y({name:"NoMosaic",authors:[d.AutumnVN],description:"Removes Discord new image mosaic",tags:["image","mosaic","media"],settings:Ud,patches:[{find:".oneByTwoLayoutThreeGrid",replacement:[{match:/mediaLayoutType:\i\.\i\.MOSAIC/,replace:"mediaLayoutType:$self.mediaLayoutType()"},{match:/null!==\(\i=\i\.get\(\i\)\)&&void 0!==\i\?\i:"INVALID"/,replace:'"INVALID"'}]},{find:"renderAttachments(",predicate:()=>Ud.store.inlineVideo,replacement:{match:/url:(\i)\.url\}\);return /,replace:"$&$1.content_type?.startsWith('image/')&&"}},{find:"Messages.REMOVE_ATTACHMENT_TOOLTIP_TEXT",replacement:{match:/\i===\i\.\i\.MOSAIC/,replace:"true"}}],mediaLayoutType(){return Ud.store.mediaLayoutType},start(){St(Fd)},stop(){Ft(Fd)}})});var bA,bs,Gd,iS=g(()=>{"use strict";a();$();P();w();j();bA=I("getMessageRequestsCount"),bs=D({hideFriendRequestsCount:{type:3,description:"Hide incoming friend requests count",default:!0,restartNeeded:!0},hideMessageRequestsCount:{type:3,description:"Hide message requests count",default:!0,restartNeeded:!0},hidePremiumOffersCount:{type:3,description:"Hide nitro offers count",default:!0,restartNeeded:!0}}),Gd=y({name:"NoPendingCount",description:"Removes the ping count of incoming friend requests, message requests, and nitro offers.",authors:[d.amia],settings:bs,patches:[{find:"getPendingCount(){",predicate:()=>bs.store.hideFriendRequestsCount,replacement:{match:/(?<=getPendingCount\(\)\{)/,replace:"return 0;"}},{find:"getMessageRequestsCount(){",predicate:()=>bs.store.hideMessageRequestsCount,replacement:{match:/(?<=getMessageRequestsCount\(\)\{)/,replace:"return 0;"}},{find:".getSpamChannelsCount(),",predicate:()=>bs.store.hideMessageRequestsCount,replacement:{match:/(?<=getSpamChannelsCount\(\),\i=)\i\.getMessageRequestsCount\(\)/,replace:"$self.getRealMessageRequestCount()"}},{find:"showProgressBadge:",predicate:()=>bs.store.hidePremiumOffersCount,replacement:{match:/(?<=\{unviewedTrialCount:(\i),unviewedDiscountCount:(\i)\}.{0,200}\i=)\1\+\2/,replace:"0"}}],getRealMessageRequestCount(){return bA.getMessageRequestChannelIds().size}})});var Hd,sS=g(()=>{"use strict";a();P();w();Hd=y({name:"NoProfileThemes",description:"Completely removes Nitro profile themes",authors:[d.TheKodeToad],patches:[{find:".NITRO_BANNER,",replacement:{match:/=(?=\i\.\i\.isPremiumAtLeast\(null==(\i))/,replace:"=(arguments[0]?.bannerSrc||$1?.banner)&&"}},{find:".avatarPositionPremiumNoBanner,default:",replacement:{match:/\.avatarPositionPremiumNoBanner(?=,default:\i\.(\i))/,replace:".$1"}},{find:"hasThemeColors(){",replacement:{match:/get canUsePremiumProfileCustomization\(\){return /,replace:"$&false &&"}}]})});var ll,zd,aS=g(()=>{"use strict";a();$();P();w();ll=D({userList:{description:"List of users to allow or exempt pings for (separated by commas or spaces)",type:0,default:"1234567890123445,1234567890123445"},shouldPingListed:{description:"Behaviour",type:4,options:[{label:"Do not ping the listed users",value:!1},{label:"Only ping the listed users",value:!0,default:!0}]},inverseShiftReply:{description:"Invert Discord's shift replying behaviour (enable to make shift reply mention user)",type:3,default:!1}}),zd=y({name:"NoReplyMention",description:"Disables reply pings by default",authors:[d.DustyAngel47,d.axyie,d.pylix,d.outfoxxed],settings:ll,shouldMention(e,t){let n=ll.store.userList.includes(e.author.id),r=ll.store.shouldPingListed?n:!n;return ll.store.inverseShiftReply?t!==r:!t&&r},patches:[{find:',"Message")}function',replacement:{match:/:(\i),shou
`,s),"Failed to fetch user. Check the console for more info."}}return null}var ci,LS,DA,OA,dl,_A,BA,lm,DS=g(()=>{"use strict";a();Qt();P();wn();w();j();A();ci=js(_p()),LS=0,DA=20,OA=128,dl=10,_A=xo(()=>Promise.all(Array.from({length:dl},(e,t)=>ES(`https://raw.githubusercontent.com/VenPlugs/petpet/main/frames/pet${t}.gif`)))),BA=I("getUploads");lm=y({name:"petpet",description:"Adds a /petpet slash command to create headpet gifs from any image",authors:[d.Ven],dependencies:["CommandsAPI"],commands:[{inputType:0,name:"petpet",description:"Create a petpet gif. You can only specify one of the image options",options:[{name:"delay",description:"The delay between each frame. Defaults to 20.",type:4},{name:"resolution",description:"Resolution for the gif. Defaults to 120. If you enter an insane number and it freezes Discord that's your fault.",type:4},{name:"image",description:"Image attachment to use",type:11},{name:"url",description:"URL to fetch image from",type:3},{name:"user",description:"User whose avatar to use as image",type:6},{name:"no-server-pfp",description:"Use the normal avatar instead of the server specific one when using the 'user' option",type:5}],execute:async(e,t)=>{let n=await _A(),r=it(e,"no-server-pfp",!1);try{var i=await FA(e,t,r);if(!i)throw"No Image specified!"}catch(v){ue(t.channel.id,{content:String(v)});return}let s=await ES(i),l=it(e,"delay",DA),c=it(e,"resolution",OA),u=(0,ci.GIFEncoder)(),p=document.createElement("canvas");p.width=p.height=c;let m=p.getContext("2d");for(let v=0;v<dl;v++){m.clearRect(0,0,p.width,p.height);let T=v<dl/2?v:dl-v,M=.8+T*.02,b=.8-T*.05,x=(1-M)*.5+.1,N=1-b-.08;m.drawImage(s,x*c,N*c,M*c,b*c),m.drawImage(n[v],0,0,c,c);let{data:k}=m.getImageData(0,0,c,c),B=(0,ci.quantize)(k,256),U=(0,ci.applyPalette)(k,B);u.writeFrame(U,c,c,{transparent:!0,palette:B,delay:l})}u.finish();let h=new File([u.bytesView()],"petpet.gif",{type:"image/gif"});setTimeout(()=>Ri.promptToUpload([h],t.channel,LS),10)}}]})});var OS=g(()=>{});var _S,cm,BS=g(()=>{"use strict";a();OS();$();le();P();w();A();_S=D({loop:{description:"Whether to make the PiP video loop or not",type:3,default:!0,restartNeeded:!1}}),cm=y({name:"PictureInPicture",description:"Adds picture in picture to videos (next to the Download button)",authors:[d.Lumap],settings:_S,patches:[{find:".nonMediaAttachment]",replacement:{match:/\.nonMediaAttachment\]:!(\i).{0,10}children:\[(\S)/,replace:"$&,$1&&$2&&$self.renderPiPButton(),"}}],renderPiPButton:_.wrap(()=>o(V,{text:"Toggle Picture in Picture"},e=>o("div",{...e,className:"vc-pip-button",role:"button",style:{cursor:"pointer",paddingTop:"4px",paddingLeft:"4px",paddingRight:"4px"},onClick:t=>{let n=t.currentTarget.parentNode.parentNode.querySelector("video"),r=document.body.appendChild(n.cloneNode(!0));r.loop=_S.store.loop,r.style.display="none",r.onleavepictureinpicture=()=>r.remove();function i(){r.currentTime=n.currentTime,r.requestPictureInPicture(),n.pause(),r.play()}r.readyState===4?i():r.onloadedmetadata=i}},o("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24"},o("path",{fill:"currentColor",d:"M21 3a1 1 0 0 1 1 1v7h-2V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h18zm0 10a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1h8zm-1 2h-6v4h6v-4z"})))),{noop:!0})})});function $S(){return ct(["plugins.PinDMs.pinnedDMs"]),ml()}function ui(e){return ml().has(e)}function GS(e){let t=ml();t.delete(e)||t.add(e),US([...t])}function pm(){return ml(),Ps.store.pinOrder===0?UA.getPrivateChannelIds().filter(ui):Zn}function HS(e){return pm()[e]}function dm(e,t){let n=FS(),r=n.indexOf(e),i=r+t;[n[r],n[i]]=[n[i],n[r]],US(n)}var Ps,UA,Zn,um,FS,US,$A,ml,mm=g(()=>{"use strict";a();$();w();j();Ps=D({pinOrder:{type:4,description:"Which order should pinned DMs be displayed in?",options:[{label:"Most recent message",value:0,default:!0},{label:"Custom (right click channels to reorder)",value:1}]}}),UA=Me("PrivateChannelSortStore"),FS=()=>(E.plugins.PinDMs.pinnedDMs||void 0)?.split(","),US=e=>{um=void 0,E.plugins.PinDMs.pinnedDMs=e.join(",")},$A=()=>(Zn=FS()??[],um=new Set(Zn)),ml=()=>um??$A()});funct
`,e))},stop(){Om=void 0},decodeError(e,...t){let n=0;return Om?.[e]?.replace(/%s/g,()=>{let r=t[n];return n++,r})}})});var Fm={};Be(Fm,{ServerListRenderPosition:()=>Ml,addServerListElement:()=>Is,removeServerListElement:()=>As,renderAll:()=>gN});function Bm(e){return e===0?mN:fN}function Is(e,t){Bm(e).add(t)}function As(e,t){Bm(e).delete(t)}var dN,Ml,mN,fN,gN,Pl=g(()=>{"use strict";a();Ze();dN=new ie("ServerListAPI"),Ml=(n=>(n[n.Above=0]="Above",n[n.In=1]="In",n))(Ml||{}),mN=new Set,fN=new Set;gN=e=>{let t=[];for(let n of Bm(e))try{t.unshift(n())}catch(r){dN.error("Failed to render server list element:",r)}return t}});function hN(){let e=[];Object.values(Te.getGuilds()).forEach(t=>{Ur.getChannels(t.id).SELECTABLE.forEach(n=>{!ar.hasUnread(n.channel.id)||e.push({channelId:n.channel.id,messageId:ar.lastMessageId(n.channel.id),readStateType:0})})}),F.dispatch({type:"BULK_ACK",context:"APP",channels:e})}var yN,Um,Nb=g(()=>{"use strict";a();Pl();P();w();A();yN=()=>o(R,{onClick:hN,size:R.Sizes.MIN,color:R.Colors.BRAND,style:{marginTop:"2px",marginBottom:"8px",marginLeft:"9px"}},"Read all"),Um=y({name:"ReadAllNotificationsButton",description:"Read all server notifications with a single button click!",authors:[d.kemo],dependencies:["ServerListAPI"],renderReadAllButton:()=>o(yN,null),start(){Is(0,this.renderReadAllButton)},stop(){As(0,this.renderReadAllButton)}})});var en,Il=g(()=>{"use strict";a();$();w();en=D({notices:{type:3,description:"Also show a notice at the top of your screen when removed (use this if you don't want to miss any notifications).",default:!1},offlineRemovals:{type:3,description:"Notify you when starting discord if you were removed while offline.",default:!0},friends:{type:3,description:"Notify when a friend removes you",default:!0},friendRequestCancels:{type:3,description:"Notify when a friend request is cancelled",default:!0},servers:{type:3,description:"Notify when removed from a server",default:!0},groups:{type:3,description:"Notify when removed from a group chat",default:!0}})});var $m=g(()=>{"use strict";a()});async function bN(){Gt.delMany(["relationship-notifier-guilds","relationship-notifier-groups","relationship-notifier-friends"])}async function Gm(){await bN();let[e,t,n]=await Gt.getMany([Cb(),kb(),Rb()]);if(await Promise.all([Nl(),Cl(),Ns()]),en.store.offlineRemovals){if(en.store.groups&&t?.size)for(let[r,i]of t)mi.has(r)||mo(`You are no longer in the group ${i.name}.`,i.iconURL);if(en.store.servers&&e?.size)for(let[r,i]of e)di.has(r)||mo(`You are no longer in the server ${i.name}.`,i.iconURL);if(en.store.friends&&n?.friends.length)for(let r of n.friends){if(Nr.friends.includes(r))continue;let i=await Rt.getUser(r).catch(()=>{});i&&mo(`You are no longer friends with ${ao(i)}.`,i.getAvatarURL(void 0,void 0,!1),()=>_n(i.id))}if(en.store.friendRequestCancels&&n?.requests?.length)for(let r of n.requests){if(Nr.requests.includes(r)||[1,2,4].includes(nt.getRelationshipType(r)))continue;let i=await Rt.getUser(r).catch(()=>{});i&&mo(`Friend request from ${ao(i)} has been revoked.`,i.getAvatarURL(void 0,void 0,!1),()=>_n(i.id))}}}function mo(e,t,n){en.store.notices&&Al.showNotice(e,"OK",()=>Al.popNotice()),Ie({title:"Relationship Notifier",body:e,icon:t,onClick:n})}function Lb(e){return di.get(e)}function Hm(e){di.delete(e),Nl()}async function Nl(){di.clear();let e=W.getCurrentUser().id;for(let[t,{name:n,icon:r}]of Object.entries(Te.getGuilds()))ke.isMember(t,e)&&di.set(t,{id:t,name:n,iconURL:r&&`https://cdn.discordapp.com/icons/${t}/${r}.png`});await Gt.set(Cb(),di)}function Eb(e){return mi.get(e)}function zm(e){mi.delete(e),Cl()}async function Cl(){mi.clear();for(let{type:e,id:t,name:n,rawRecipients:r,icon:i}of Q.getSortedPrivateChannels())e===3&&mi.set(t,{id:t,name:n||r.map(s=>s.username).join(", "),iconURL:i&&`https://cdn.discordapp.com/channel-icons/${t}/${i}.png`});await Gt.set(kb(),mi)}async function Ns(){Nr.friends=[],Nr.requests=[];let e=nt.getRelationships();for(let t in e)switch(e[t]){case 1:Nr.friends.push(t);break;case 3:Nr.requests.push(t);break}await Gt.set(Rb(),Nr)}var di,mi,Nr,Cb,kb,Rb,
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>
</>;
2023-11-23 12:19:53 -06:00
`});var yT=or((nZ,sf)=>{"use strict";a();var EN=Object.prototype.hasOwnProperty,Wt="~";function Rs(){}Object.create&&(Rs.prototype=Object.create(null),new Rs().__proto__||(Wt=!1));function DN(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function hT(e,t,n,r,i){if(typeof n!="function")throw new TypeError("The listener must be a function");var s=new DN(n,r||e,i),l=Wt?Wt+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function El(e,t){--e._eventsCount===0?e._events=new Rs:delete e._events[t]}function Et(){this._events=new Rs,this._eventsCount=0}Et.prototype.eventNames=function(){var t=[],n,r;if(this._eventsCount===0)return t;for(r in n=this._events)EN.call(n,r)&&t.push(Wt?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(n)):t};Et.prototype.listeners=function(t){var n=Wt?Wt+t:t,r=this._events[n];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,l=new Array(s);i<s;i++)l[i]=r[i].fn;return l};Et.prototype.listenerCount=function(t){var n=Wt?Wt+t:t,r=this._events[n];return r?r.fn?1:r.length:0};Et.prototype.emit=function(t,n,r,i,s,l){var c=Wt?Wt+t:t;if(!this._events[c])return!1;var u=this._events[c],p=arguments.length,m,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,n),!0;case 3:return u.fn.call(u.context,n,r),!0;case 4:return u.fn.call(u.context,n,r,i),!0;case 5:return u.fn.call(u.context,n,r,i,s),!0;case 6:return u.fn.call(u.context,n,r,i,s,l),!0}for(h=1,m=new Array(p-1);h<p;h++)m[h-1]=arguments[h];u.fn.apply(u.context,m)}else{var v=u.length,T;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,n);break;case 3:u[h].fn.call(u[h].context,n,r);break;case 4:u[h].fn.call(u[h].context,n,r,i);break;default:if(!m)for(T=1,m=new Array(p-1);T<p;T++)m[T-1]=arguments[T];u[h].fn.apply(u[h].context,m)}}return!0};Et.prototype.on=function(t,n,r){return hT(this,t,n,r,!1)};Et.prototype.once=function(t,n,r){return hT(this,t,n,r,!0)};Et.prototype.removeListener=function(t,n,r,i){var s=Wt?Wt+t:t;if(!this._events[s])return this;if(!n)return El(this,s),this;var l=this._events[s];if(l.fn)l.fn===n&&(!i||l.once)&&(!r||l.context===r)&&El(this,s);else{for(var c=0,u=[],p=l.length;c<p;c++)(l[c].fn!==n||i&&!l[c].once||r&&l[c].context!==r)&&u.push(l[c]);u.length?this._events[s]=u.length===1?u[0]:u:El(this,s)}return this};Et.prototype.removeAllListeners=function(t){var n;return t?(n=Wt?Wt+t:t,this._events[n]&&El(this,n)):(this._events=new Rs,this._eventsCount=0),this};Et.prototype.off=Et.prototype.removeListener;Et.prototype.addListener=Et.prototype.on;Et.prefixed=Wt;Et.EventEmitter=Et;typeof sf<"u"&&(sf.exports=Et)});var uf=or(fi=>{"use strict";a();Object.defineProperty(fi,"__esModule",{value:!0});fi.Channel=fi.ChannelPort=void 0;var ON=yT(),Dl="vapIpc",af=Symbol.for("vapIpc.edgeCreate"),lf=class{_pipes=new Map;_listeners=new Map;_createListenerMap(){return new Map}_emit(t,n,...r){for(let[i,s]of this._listeners.entries()){if(i===t)continue;let l=s.get(n);l&&l(...r)}}createPipe(t){let n=this.getPipe(t);if(n)return n;let r=this._createListenerMap();this._listeners.set(t,r);let i={emit:this._emit.bind(this,t),listen:(s,l)=>void r.set(s,l)};return this._pipes.set(t,i),i}getPipe(t){return this._pipes.get(t)??null}};fi.ChannelPort=lf;var cf=class{id;_edges=new Map;_callbacks=new Map;_callers=new Map;_edgePipes=new Map;_pipes=[];_emitter=new ON.EventEmitter;_logger;_destroyed=!1;constructor(t){this.id=t}addPipe(t){t.listen(`${Dl}:handshake`,n=>{this._handleHandshake(t,n)}),t.listen(`${Dl}:message`,n=>{this._handleMessage(t,n)}),this._pipes.push(t),this._logger?.log(`Adding pipe to channel "${this.id}"`)}setLogger(t){this._logger=t}_handleHandshake(t,n){if(this.id===n.id)return;this._logger?.log(`\u{1F91D} "${n.id}" -> "${this.id}" (edges: [${n.channelIds.join(", ")}])`);let r=this._edges.get(n.id);if(r){let i=n.channelIds.filter(s=>!r?.channelIds.includ
`,classNames:{},dom:null});Es="src/plugins/shikiCodeblocks.desktop/devicon.css"});var Ds=g(()=>{"use strict";a()});var qN,Zo,xf=g(()=>{"use strict";a();$();Je();Re();ro();w();Ls();Sf();Tf();Ds();qN=Object.keys(go),Zo=D({theme:{type:4,description:"Default themes",options:qN.map(e=>({label:oo(vu(e)),value:go[e],default:go[e]===go.DarkPlus})),onChange:he.setTheme},customTheme:{type:0,description:"A link to a custom vscode theme",placeholder:go.MaterialCandy,onChange:e=>{he.setTheme(e||Zo.store.theme)}},tryHljs:{type:4,description:"Use the more lightweight default Discord highlighter and theme.",options:[{label:"Never",value:"NEVER"},{label:"Prefer Shiki instead of Highlight.js",value:"SECONDARY",default:!0},{label:"Prefer Highlight.js instead of Shiki",value:"PRIMARY"},{label:"Always",value:"ALWAYS"}]},useDevIcon:{type:4,description:"How to show language icons on codeblocks",options:[{label:"Disabled",value:"DISABLED"},{label:"Colorless",value:"GREYSCALE",default:!0},{label:"Colored",value:"COLOR"}],onChange:e=>{e==="DISABLED"?Ft(Es):St(Es)}},bgOpacity:{type:5,description:"Background opacity",markers:[0,20,40,60,80,100],default:100,componentProps:{stickToMarkers:!1,onValueRender:null}}},{theme:{disabled(){return!!this.store.customTheme}},customTheme:{isValid(e){if(!e)return!0;let t=hc(e);return t?t.pathname.endsWith(".json")?!0:"Must be a json file":"Must be a valid URL"}}})});function CT(e,t){let n=Zo.use(e),[r,i]=O.useState(!1),s={...n,...t},l=s.customTheme||s.theme;if(t){let c=he.currentThemeUrl&&l&&l!==he.currentThemeUrl,u=Object.keys(t).length===0;r&&(!c||u)&&i(!1),!r&&c&&(i(!0),he.setTheme(l))}return{...s,isThemeLoading:l!==he.currentThemeUrl}}var kT=g(()=>{"use strict";a();A();Ls();xf()});function RT(e){return e=e.slice(1),e.length<6&&(e=e.split("").map(t=>t+t).join("")),e.length===6&&(e+="ff"),e.length>6&&(e=e.slice(0,6)),e.split(/(..)/).filter(Boolean).map(t=>parseInt(t,16))}var LT=g(()=>{"use strict";a()});var Un,ET,Os=g(()=>{"use strict";a();Je();A();_l();Ds();Un=Ue("shiki-"),ET=({lang:e,tryHljs:t})=>{let n=e?lr?.getLanguage?.(e):null,i=(e?Cr(e):null)?.name;switch(t){case"ALWAYS":return!0;case"PRIMARY":return!!n||e==="";case"SECONDARY":return!i&&!!n;case"NEVER":return!1;default:return!1}}});function DT(e){let[t,n]=O.useState(!1);function r(i){Zt.copy(i),n(!0),setTimeout(()=>{n(!1)},e)}return[t,r]}var OT=g(()=>{"use strict";a();A()});function _T({content:e,...t}){let[n,r]=DT(1e3);return o("button",{...t,style:{...t.style,cursor:n?"default":void 0},onClick:()=>r(e)},n?"Copied!":"Copy")}var BT=g(()=>{"use strict";a();OT()});function FT({content:e,theme:t}){let n=[];return Zt.SUPPORTS_COPY&&n.push(o(_T,{content:e,className:Un("btn"),style:{backgroundColor:t.accentBgColor,color:t.accentFgColor}})),o("div",{className:Un("btns")},n)}var UT=g(()=>{"use strict";a();A();Os();BT()});var $T,GT=g(()=>{"use strict";a();A();Os();$T=({theme:e,useHljs:t,lang:n,content:r,tokens:i})=>{let s;if(t)try{let{value:c}=lr.highlight(n,r,!0);s=c.split(`
`).map((u,p)=>o("span",{key:p,dangerouslySetInnerHTML:{__html:u}}))}catch{s=r.split(`
2023-11-14 11:41:09 -06:00
`).map(c=>o("span",null,c))}else s=(i??r.split(`
`).map(u=>[{color:e.plainColor,content:u}])).map(u=>u.length===0?o("span",null,`
2023-11-23 12:19:53 -06:00
`):o(f,null,u.map(({content:p,color:m,fontStyle:h},v)=>o("span",{key:v,style:{color:m,fontStyle:(h??0)&1?"italic":void 0,fontWeight:(h??0)&2?"bold":void 0,textDecoration:(h??0)&4?"underline":void 0}},p))));let l=s.map((c,u)=>o("tr",{key:u},o("td",{style:{color:e.plainColor}},u+1),o("td",null,c)));return o("table",{className:Un("table")},...l)}});function HT({langName:e,useDevIcon:t,shikiLang:n}){return e?o("div",{className:Un("lang")},t!=="DISABLED"&&n?.devicon&&o("i",{className:`${Un("devicon")} devicon-${n.devicon}${t==="COLOR"?" colored":""}`}),e):o(f,null)}var zT=g(()=>{"use strict";a();Ds();Os()});var Bl,KN,jT=g(()=>{"use strict";a();le();Qe();A();_l();Ls();kT();vf();LT();Os();UT();GT();zT();Bl=e=>o("pre",{className:Un("container")},o(_,null,o(KN,{...e}))),KN=({lang:e,content:t,isPreview:n,tempSettings:r})=>{let{tryHljs:i,useDevIcon:s,bgOpacity:l}=CT(["tryHljs","useDevIcon","bgOpacity"],r),{id:c,theme:u}=xT(),p=e?Cr(e):null,m=ET({lang:e,tryHljs:i}),[h,v]=vc(!0),[T]=rt(async()=>!p||m||!v?null:await he.tokenizeCode(t,e),{fallbackValue:null,deps:[e,t,c,v]}),M={plainColor:u?.fg||"var(--text-normal)",accentBgColor:u?.colors?.["statusBar.background"]||(m?"#7289da":"#007BC8"),accentFgColor:u?.colors?.["statusBar.foreground"]||"#FFF",backgroundColor:u?.colors?.["editor.background"]||"var(--background-secondary)"},b;return e&&(b=m?lr?.getLanguage?.(e)?.name:p?.name),o("div",{ref:h,className:Un("root",{plain:!b,preview:n}),style:{backgroundColor:m?M.backgroundColor:`rgba(${RT(M.backgroundColor).concat(l/100).join(", ")})`,color:M.plainColor}},o("code",null,o(HT,{langName:b,useDevIcon:s,shikiLang:p}),o($T,{theme:M,useHljs:m,lang:e,content:t,tokens:T}),!n&&o(FT,{content:t,theme:M})))}});var WT,qT,KT=g(()=>{"use strict";a();WT=new Map,qT=()=>{WT.forEach(e=>e.remove()),WT.clear()}});var wf,YT=g(()=>{"use strict";a();mT();Je();P();w();gT();Ls();jT();Tf();xf();Ds();KT();wf=y({name:"ShikiCodeblocks",description:"Brings vscode-style codeblocks into Discord, powered by Shiki",authors:[d.Vap],patches:[{find:"codeBlock:{react(",replacement:{match:/codeBlock:\{react\((\i),(\i),(\i)\)\{/,replace:"$&return $self.renderHighlighter($1,$2,$3);"}}],start:async()=>{Zo.store.useDevIcon!=="DISABLED"&&St(Es),await he.init(Zo.store.customTheme||Zo.store.theme)},stop:()=>{he.destroy(),qT()},settingsAboutComponent:({tempSettings:e})=>Bl({lang:"tsx",content:fT,isPreview:!0,tempSettings:e}),settings:Zo,shiki:he,createHighlighter:Bl,renderHighlighter:({lang:e,content:t})=>Bl({lang:e?.toLowerCase(),content:t,isPreview:!1})})});var Mf,ZT=g(()=>{"use strict";a();P();w();Mf=y({name:"ShowAllMessageButtons",description:"Always show all message buttons no matter if you are holding the shift key or not.",authors:[d.Nuckyz],patches:[{find:".Messages.MESSAGE_UTILITIES_A11Y_LABEL",replacement:{match:/isExpanded:\i&&(.+?),/,replace:"isExpanded:$1,"}}]})});var XT=g(()=>{});function QT(){let e=Ai(JT.colors.INTERACTIVE_MUTED).hex(),t=Ai(JT.colors.INTERACTIVE_ACTIVE).hex();return o(YN,{color:e,forcedIconColor:t,size:16,tooltipText:ot.Messages.CONNECTION_VERIFIED})}var JT,YN,VT=g(()=>{"use strict";a();j();A();JT=un(e=>e.colors?.INTERACTIVE_MUTED?.css),YN=Xe(".CONNECTIONS_ROLE_OFFICIAL_ICON_TOOLTIP")});function ex({id:e,theme:t}){let n=nn.getUserProfile(e);if(!n)return null;let r=n.connectedAccounts;return r?.length?o(ZN,null,o(re,{tag:"h2",variant:"eyebrow",style:{color:"var(--header-primary)"}},"Connections"),o(ge,{style:{marginTop:"8px",gap:VN(Fl.store.iconSpacing),flexWrap:"wrap"}},r.map(i=>o(nC,{connection:i,theme:t})))):null}function nC({connection:e,theme:t}){let n=JN.get(e.type),r=n.getPlatformUserUrl?.(e),i=o("img",{"aria-label":e.name,src:t==="light"?n.icon.lightSVG:n.icon.darkSVG,style:{width:Fl.store.iconSize,height:Fl.store.iconSize}}),s=r?Jr:hy;return o(V,{text:o("span",{className:"vc-sc-tooltip"},e.name,e.verified&&o(QT,null),o(s,{height:16,width:16})),key:e.id},l=>r?o("a",{...l,className:"vc-user-connection",href:r,target:"_blank",onClick:c=>{Vencord.Plugins.isPluginEnabled("OpenInApp")&&Vencord.Plugins.plugins.OpenInApp.handleLink(c.currentTarget,c)}},i
2023-11-14 11:41:09 -06:00
subText: $self.makeSubtext(${r}, ${n}),
2023-11-23 12:19:53 -06:00
${i}`}}],sortList(e){return e.type===3||e.type===4?-this.getSince(e.user):e.comparator},getSince(e){return new Date(nt.getSince(e.id))},makeSubtext(e,t){let n=this.getSince(t);return o(ge,{flexDirection:"row",style:{gap:0,flexWrap:"wrap",lineHeight:"0.9rem"}},o("span",null,e),!isNaN(n.getTime())&&o("span",null,"Received \u2014 ",n.toDateString()))},options:{showDates:{type:3,description:"Show dates on friend requests",default:!1,restartNeeded:!0}}})});var fx,gx=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/spotifyControls/hoverOnly.css",{name:"src/plugins/spotifyControls/hoverOnly.css",source:`.vc-spotify-button-row {
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;
}
2023-11-23 12:19:53 -06:00
`,classNames:{},dom:null});fx="src/plugins/spotifyControls/hoverOnly.css"});var hx=g(()=>{});var $e,yx=g(()=>{"use strict";a();$();wn();j();A();$e=yt(()=>{let{Store:e}=pc,t=I("getActiveSocketAndDevice"),n=I("SpotifyAPI"),r="https://api.spotify.com/v1/me/player";class i extends e{mPosition=0;start=0;track=null;device=null;isPlaying=!1;repeat="off";shuffle=!1;volume=0;isSettingPosition=!1;openExternal(c){let u=E.plugins.SpotifyControls.useSpotifyUris||Vencord.Plugins.isPluginEnabled("OpenInApp")?"spotify:"+c.replaceAll("/",(p,m)=>m===0?"":":"):"https://open.spotify.com"+c;VencordNative.native.openExternal(u)}get position(){let c=this.mPosition;return this.isPlaying&&(c+=Date.now()-this.start),c}set position(c){this.mPosition=c,this.start=Date.now()}prev(){this.req("post","/previous")}next(){this.req("post","/next")}setVolume(c){this.req("put","/volume",{query:{volume_percent:Math.round(c)}}).then(()=>{this.volume=c,this.emitChange()})}setPlaying(c){this.req("put",c?"/play":"/pause")}setRepeat(c){this.req("put","/repeat",{query:{state:c}})}setShuffle(c){this.req("put","/shuffle",{query:{state:c}}).then(()=>{this.shuffle=c,this.emitChange()})}seek(c){return this.isSettingPosition?Promise.resolve():(this.isSettingPosition=!0,this.req("put","/seek",{query:{position_ms:Math.round(c)}}).catch(u=>{console.error("[VencordSpotifyControls] Failed to seek",u),this.isSettingPosition=!1}))}req(c,u,p={}){this.device?.is_active&&((p.query??={}).device_id=this.device.id);let{socket:m}=t.getActiveSocketAndDevice();return n.SpotifyAPI[c](m.accountId,m.accessToken,{url:r+u,...p})}}let s=new i(F,{SPOTIFY_PLAYER_STATE(l){s.track=l.track,s.device=l.device??null,s.isPlaying=l.isPlaying??!1,s.volume=l.volumePercent??0,s.repeat=l.actual_repeat||"off",s.position=l.position??0,s.isSettingPosition=!1,s.emitChange()},SPOTIFY_SET_DEVICES({devices:l}){s.device=l.find(c=>c.is_active)??l[0]??null,s.emitChange()}});return s})});function Of(e){let t=e/1e3/60,n=Math.floor(t),r=Math.floor((t-n)*60);return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}function vi(e,t){return()=>o("svg",{className:oe(qe("button-icon"),qe(t)),height:"24",width:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-label":t,focusable:!1},o("path",{d:e}))}function Bs(e){return o("button",{className:qe("button"),...e},e.children)}function xC({name:e,path:t}){let n=`spotify-copy-${e}`,r=`spotify-open-${e}`;return o(G.Menu,{navId:`spotify-${e}-menu`,onClose:()=>F.dispatch({type:"CONTEXT_MENU_CLOSE"}),"aria-label":`Spotify ${e} Menu`},o(G.MenuItem,{key:n,id:n,label:`Copy ${e} Link`,action:()=>gn("https://open.spotify.com"+t),icon:Jr}),o(G.MenuItem,{key:r,id:r,label:`Open ${e} in Spotify`,action:()=>$e.openExternal(t),icon:Xi}))}function wC(e,t){return n=>dn.openContextMenu(n,()=>o(xC,{name:e,path:t}))}function MC(){let[e,t,n]=He([$e],()=>[$e.isPlaying,$e.shuffle,$e.repeat]),[r,i]=(()=>{switch(n){case"off":return["context","repeat-off"];case"context":return["track","repeat-context"];case"track":return["off","repeat-track"];default:throw new Error(`Invalid repeat state ${n}`)}})();return o(ge,{className:qe("button-row"),style:{gap:0}},o(Bs,{className:oe(qe("button"),qe(t?"shuffle-on":"shuffle-off")),onClick:()=>$e.setShuffle(!t)},o(TC,null)),o(Bs,{onClick:()=>$e.prev()},o(vC,null)),o(Bs,{onClick:()=>$e.setPlaying(!e)},e?o(yC,null):o(hC,null)),o(Bs,{onClick:()=>$e.next()},o(SC,null)),o(Bs,{className:oe(qe("button"),qe(i)),onClick:()=>$e.setRepeat(r),style:{position:"relative"}},n==="track"&&o("span",{className:qe("repeat-1")},"1"),o(bC,null)))}function IC(){let{duration:e}=$e.track,[t,n,r]=He([$e],()=>[$e.mPosition,$e.isSettingPosition,$e.isPlaying]),[i,s]=J(t);return De(()=>{if(r&&!n){s($e.position);let l=setInterval(()=>{s(c=>c+1e3)},1e3);return()=>clearInterval(l)}},[t,n,r]),o("div",{id:qe("progress-bar")},o(S.FormText,{variant:"text-xs/medium",className:qe("progress-time")+" "+qe("time-left"),"aria-label":"Progress"},Of(i)),o(G.MenuSliderControl,{minValue:0,maxValue:e,value:i,onChange:l=>{n||(s(l),PC(l))},renderValue:Of}),o(S.FormText,{variant:"text-xs/medium",classNa
`);return o(S.FormSection,{title:"Server Trace",tag:"h2"},o("code",null,o(ge,{flexDirection:"column",style:{color:"var(--header-primary)",gap:5,userSelect:"text"}},t.map(n=>o("span",null,n)))))}function EC(){if(!Fs?.logs)return o("div",null,"Loading...");let e=Fs.logGroups.find(t=>t.serverTrace)?.serverTrace;return o(O.Fragment,null,o(RC,{title:"Startup Timings",logs:Fs.logs,traceEnd:Fs.endTime_}),o("div",{style:{marginTop:5}},"\xA0"),e&&o(LC,{trace:e}))}var Fs,DC,Ix=g(()=>{"use strict";a();le();Lt();j();A();Fs=I("markWithDelta","markAndLog","markAt");DC=_.wrap(EC)});var zf,Ax=g(()=>{"use strict";a();P();Qe();w();zf=y({name:"StartupTimings",description:"Adds Startup Timings to the Settings menu",authors:[d.Megu],patches:[{find:"UserSettingsSections.PAYMENT_FLOW_MODAL_TEST_PAGE,",replacement:{match:/{section:\i\.UserSettingsSections\.PAYMENT_FLOW_MODAL_TEST_PAGE/,replace:'{section:"StartupTimings",label:"Startup Timings",element:$self.StartupTimingPage},$&'}}],StartupTimingPage:tt(()=>(Ix(),To(Px)).default)})});var jf,Wf,Nx=g(()=>{"use strict";a();$();P();w();jf=D({superReactByDefault:{type:3,description:"Reaction picker will default to Super Reactions",default:!0},unlimitedSuperReactionPlaying:{type:3,description:"Remove the limit on Super Reactions playing at once",default:!1},superReactionPlayingLimit:{description:"Max Super Reactions to play at once",type:5,default:20,markers:[5,10,20,40,60,80,100],stickToMarkers:!0}},{superReactionPlayingLimit:{disabled(){return this.store.unlimitedSuperReactionPlaying}}}),Wf=y({name:"SuperReactionTweaks",description:"Customize the limit of Super Reactions playing at once, and super react by default",authors:[d.FieryFlames,d.ant0n],patches:[{find:",BURST_REACTION_EFFECT_PLAY",replacement:{match:/(?<=BURST_REACTION_EFFECT_PLAY:\i=>{.{50,100})(\i\(\i,\i\))>=\d+/,replace:"!$self.shouldPlayBurstReaction($1)"}},{find:".hasAvailableBurstCurrency)",replacement:{match:/(?<=\.useBurstReactionsExperiment.{0,20})useState\(!1\)(?=.+?(\i===\i\.EmojiIntention.REACTION))/,replace:"useState($self.settings.store.superReactByDefault && $1)"}}],settings:jf,shouldPlayBurstReaction(e){return!!(jf.store.unlimitedSuperReactionPlaying||e<=jf.store.superReactionPlayingLimit)}})});function Ex(e){let t=e.match(/^(\/)?(.+?)(?:\/([gimsuy]*))?$/);return t?new RegExp(t[2],t[3]?.split("").filter((n,r,i)=>i.indexOf(n)===r).join("")??"g"):new RegExp(e)}function _C(e){try{return Ex(e),null}catch(t){return o("span",{style:{color:"var(--text-danger)"}},String(t))}}function qf({initialValue:e,onChange:t,placeholder:n}){let[r,i]=J(e);return o(Ve,{placeholder:n,value:r,onChange:i,spellCheck:!1,onBlur:()=>r!==e&&t(r)})}function Cx({title:e,rulesArray:t,rulesKey:n,update:r}){let i=e==="Using Regex";async function s(c){c!==t.length-1&&(t.splice(c,1),await Gt.set(n,t),r())}async function l(c,u,p){u===t.length-1&&t.push(Lx()),t[u][p]=c,t[u].find===""&&t[u].replace===""&&t[u].onlyIfIncludes===""&&u!==t.length-1&&t.splice(u,1),await Gt.set(n,t),r()}return o(f,null,o(S.FormTitle,{tag:"h4"},e),o(ge,{flexDirection:"column",style:{gap:"0.5em"}},t.map((c,u)=>o(O.Fragment,{key:`${c.find}-${u}`},o(ge,{flexDirection:"row",style:{gap:0}},o(ge,{flexDirection:"row",style:{flexGrow:1,gap:"0.5em"}},o(qf,{placeholder:"Find",initialValue:c.find,onChange:p=>l(p,u,"find")}),o(qf,{placeholder:"Replace",initialValue:c.replace,onChange:p=>l(p,u,"replace")}),o(qf,{placeholder:"Only if includes",initialValue:c.onlyIfIncludes,onChange:p=>l(p,u,"onlyIfIncludes")})),o(R,{size:R.Sizes.MIN,onClick:()=>s(u),style:{background:"none",color:"var(--status-danger)",...u===t.length-1?{visibility:"hidden",pointerEvents:"none"}:{}}},o(Ty,null))),i&&_C(c.find)))))}function BC(){let[e,t]=J("");return o(f,null,o(S.FormTitle,{tag:"h4"},"Test Rules"),o(Ve,{placeholder:"Type a message",onChange:t}),o(Ve,{placeholder:"Message with rules applied",editable:!1,value:Dx(e)}))}function Dx(e){if(e.length===0)return e;if($l)for(let t of $l)!t.find||!t.replace||t.onlyIfIncludes&&!e.includes(t.onlyIfIncludes)||(e=` ${e} `.replaceAll(t.find,t.replace.replaceAll("\\n",`
`)).replace(/^\s|\s$/g,""));if(Gl){for(let t of Gl)if(!(!t.find||!t.replace)&&!(t.onlyIfIncludes&&!e.includes(t.onlyIfIncludes)))try{let n=Ex(t.find);e=e.replace(n,t.replace.replaceAll("\\n",`
`))}catch{new ie("TextReplace").error(`Invalid regex: ${t.find}`)}}return e=e.trim(),e}var kx,Rx,Lx,Ul,$l,Gl,OC,FC,Kf,Ox=g(()=>{"use strict";a();as();Yn();$();Lt();$t();P();Ze();Qe();w();A();kx="TextReplace_rulesString",Rx="TextReplace_rulesRegex",Lx=()=>({find:"",replace:"",onlyIfIncludes:""}),Ul=()=>[Lx()],$l=Ul(),Gl=Ul(),OC=D({replace:{type:6,description:"",component:()=>{let e=Po();return o(f,null,o(Cx,{title:"Using String",rulesArray:$l,rulesKey:kx,update:e}),o(Cx,{title:"Using Regex",rulesArray:Gl,rulesKey:Rx,update:e}),o(BC,null))}}});FC="1102784112584040479",Kf=y({name:"TextReplace",description:"Replace text in your messages. You can find pre-made rules in the #textreplace-rules channel in Vencord's Server",authors:[d.AutumnVN,d.TheKodeToad],dependencies:["MessageEventsAPI"],settings:OC,async start(){$l=await Gt.get(kx)??Ul(),Gl=await Gt.get(Rx)??Ul(),this.preSend=Ht((e,t)=>{e!==FC&&(t.content=Dx(t.content))})},stop(){zt(this.preSend)}})});var Yf,_x=g(()=>{"use strict";a();P();w();A();Yf=y({name:"ThemeAttributes",description:"Adds data attributes to various elements for theming purposes",authors:[d.Ven],patches:[{find:".tabBarRef",replacement:{match:/style:this\.getStyle\(\),role:"tab"/,replace:"$&,'data-tab-id':this.props.id"}},{find:".messageListItem",replacement:{match:/\.messageListItem(?=,"aria)/,replace:"$&,...$self.getMessageProps(arguments[0])"}}],getMessageProps(e){let t=e.message?.author?.id;return{"data-author-id":t,"data-is-self":t&&t===W.getCurrentUser()?.id}}})});var Zf,Bx=g(()=>{"use strict";a();P();w();Zf=y({name:"TimeBarAllActivities",description:"Adds the Spotify time bar to all activities if they have start and end timestamps",authors:[d.obscurity],patches:[{find:"}renderTimeBar(",replacement:{match:/renderTimeBar\((.{1,3})\){.{0,50}?let/,replace:"renderTimeBar($1){let"}}]})});var Fx=g(()=>{});var Dt,Us=g(()=>{"use strict";a();$();w();Dt=D({receivedInput:{type:0,description:"Input language for received messages",default:"auto",hidden:!0},receivedOutput:{type:0,description:"Output language for received messages",default:"en",hidden:!0},sentInput:{type:0,description:"Input language for sent messages",default:"auto",hidden:!0},sentOutput:{type:0,description:"Output language for sent messages",default:"en",hidden:!0},autoTranslate:{type:3,description:"Automatically translate your messages before sending. You can also shift/right click the translate button to toggle this",default:!1}})});var Hl,Xf=g(()=>{"use strict";a();Hl={auto:"Detect language",af:"Afrikaans",sq:"Albanian",am:"Amharic",ar:"Arabic",hy:"Armenian",as:"Assamese",ay:"Aymara",az:"Azerbaijani",bm:"Bambara",eu:"Basque",be:"Belarusian",bn:"Bengali",bho:"Bhojpuri",bs:"Bosnian",bg:"Bulgarian",ca:"Catalan",ceb:"Cebuano",ny:"Chichewa","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)",co:"Corsican",hr:"Croatian",cs:"Czech",da:"Danish",dv:"Dhivehi",doi:"Dogri",nl:"Dutch",en:"English",eo:"Esperanto",et:"Estonian",ee:"Ewe",tl:"Filipino",fi:"Finnish",fr:"French",fy:"Frisian",gl:"Galician",ka:"Georgian",de:"German",el:"Greek",gn:"Guarani",gu:"Gujarati",ht:"Haitian Creole",ha:"Hausa",haw:"Hawaiian",iw:"Hebrew",hi:"Hindi",hmn:"Hmong",hu:"Hungarian",is:"Icelandic",ig:"Igbo",ilo:"Ilocano",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",jw:"Javanese",kn:"Kannada",kk:"Kazakh",km:"Khmer",rw:"Kinyarwanda",gom:"Konkani",ko:"Korean",kri:"Krio",ku:"Kurdish (Kurmanji)",ckb:"Kurdish (Sorani)",ky:"Kyrgyz",lo:"Lao",la:"Latin",lv:"Latvian",ln:"Lingala",lt:"Lithuanian",lg:"Luganda",lb:"Luxembourgish",mk:"Macedonian",mai:"Maithili",mg:"Malagasy",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi","mni-Mtei":"Meiteilon (Manipuri)",lus:"Mizo",mn:"Mongolian",my:"Myanmar (Burmese)",ne:"Nepali",no:"Norwegian",or:"Odia (Oriya)",om:"Oromo",ps:"Pashto",fa:"Persian",pl:"Polish",pt:"Portuguese",pa:"Punjabi",qu:"Quechua",ro:"Romanian",ru:"Russian",sm:"Samoan",sa:"Sanskrit",gd:"Scots Gaelic",nso:"Sepedi",sr:"Serbian",st:"Sesotho",sn:"Shona",sd:"Sindhi",si:"Sinhala",sk:"Slovak",sl:"Slovenian",so:"Somali",es:"Spanish",su:"Sundanese",sw:"Swahili",sv:
${s.status} ${s.statusText}`);let{src:l,sentences:c}=await s.json();return{src:l,text:c.map(u=>u?.trans).filter(Boolean).join("")}}var yo,Gs=g(()=>{"use strict";a();Je();Us();yo=Ue("vc-trans-")});function $C({settingsKey:e,includeAuto:t}){let n=Dt.use([e])[e],r=Nt(()=>{let i=Object.entries(Hl).map(([s,l])=>({value:s,label:l}));return t||i.shift(),i},[]);return o("section",{className:q.bottom16},o(S.FormTitle,{tag:"h3"},Dt.def[e].description),o(Vs,{options:r,value:r.find(i=>i.value===n),placeholder:"Select a language",maxVisibleItems:5,closeOnSelect:!0,onChange:i=>Dt.store[e]=i}))}function GC(){let e=Dt.use(["autoTranslate"]).autoTranslate;return o(pt,{value:e,onChange:t=>Dt.store.autoTranslate=t,note:Dt.def.autoTranslate.description,hideBorder:!0},"Auto Translate")}function Ux({rootProps:e}){return o(ze,{...e},o(lt,{className:yo("modal-header")},o(S.FormTitle,{tag:"h2"},"Translate"),o(an,{onClick:e.onClose})),o(et,{className:yo("modal-content")},UC.map(t=>o($C,{key:t,settingsKey:t,includeAuto:t.endsWith("Input")})),o(S.FormDivider,{className:q.bottom16}),o(GC,null)))}var UC,$x=g(()=>{"use strict";a();at();dt();A();Xf();Us();Gs();UC=["receivedInput","receivedOutput","sentInput","sentOutput"]});function Si({height:e=24,width:t=24,className:n}){return o("svg",{viewBox:"0 96 960 960",height:e,width:t,className:oe(yo("icon"),n)},o("path",{fill:"currentColor",d:"m475 976 181-480h82l186 480h-87l-41-126H604l-47 126h-82Zm151-196h142l-70-194h-2l-70 194Zm-466 76-55-55 204-204q-38-44-67.5-88.5T190 416h87q17 33 37.5 62.5T361 539q45-47 75-97.5T487 336H40v-80h280v-80h80v80h280v80H567q-22 69-58.5 135.5T419 598l98 99-30 81-127-122-200 200Z"}))}function Gx({slateProps:e}){let{autoTranslate:t}=Dt.use(["autoTranslate"]);if(e.type.analyticsName!=="normal")return null;let n=()=>Dt.store.autoTranslate=!t;return o(V,{text:"Open Translate Modal"},({onMouseEnter:r,onMouseLeave:i})=>o("div",{style:{display:"flex"}},o(R,{"aria-haspopup":"dialog","aria-label":"Open Translate Modal",size:"",look:Kt.BLANK,onMouseEnter:r,onMouseLeave:i,innerClassName:vt.button,onClick:s=>{if(s.shiftKey)return n();je(l=>o(Ux,{rootProps:l}))},onContextMenu:()=>n(),style:{padding:"0 4px"}},o("div",{className:vt.buttonWrapper},o(Si,{className:yo({"auto-translate":t})})))))}var Jf=g(()=>{"use strict";a();Re();dt();A();Us();$x();Gs()});function Vf(e,t){Qf.get(e)(t)}function HC({onDismiss:e}){return o("button",{onClick:e,className:yo("dismiss")},"Dismiss")}function Hx({message:e}){let[t,n]=J();return De(()=>{if(!e.vencordEmbeddedBy)return Qf.set(e.id,n),()=>void Qf.delete(e.id)},[]),t?o("span",{className:yo("accessory")},o(Si,{width:16,height:16}),Fe.parse(t.text)," ","(translated from ",Hl[t.src]??t.src," - ",o(HC,{onDismiss:()=>n(void 0)}),")"):null}var Qf,zx=g(()=>{"use strict";a();A();Xf();Jf();Gs();Qf=new Map});var jx,eg,Wx=g(()=>{"use strict";a();Fx();Pt();nl();Yn();Ir();le();P();w();A();Us();Jf();zx();Gs();jx=(e,{message:t})=>()=>{if(!t.content)return;let n=mt("copy-text",e);!n||n.splice(n.findIndex(r=>r?.props?.id==="copy-text")+1,0,o(G.MenuItem,{id:"vc-trans",label:"Translate",icon:Si,action:async()=>{let r=await $s("received",t.content);Vf(t.id,r)}}))},eg=y({name:"Translate",description:"Translate messages with Google Translate",authors:[d.Ven],dependencies:["MessageAccessoriesAPI","MessagePopoverAPI","MessageEventsAPI"],settings:Dt,translate:$s,patches:[{find:"ChannelTextAreaButtons",replacement:{match:/(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/,replace:"$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()"}}],start(){Ss("vc-translation",e=>o(Hx,{message:e.message})),ce("message",jx),Bn("vc-translate",e=>e.content?{label:"Translate",icon:Si,message:e,channel:Q.getChannel(e.channel_id),onClick:async()=>{let t=await $s("received",e.content);Vf(e.id,t)}}:null),this.preSend=Ht(async(e,t)=>{!Dt.store.autoTranslate||!t.content||(t.content=(await $s("sent",t.content)).text)})},stop(){zt(this.preSend),de("message",jx),Fn("vc-translate"),vd("vc-translation")},chatBarIcon:e=>o(_,{noop:!0},o(Gx,{slateProps:e}))})});function tg({a:e,b:t,count:n}){re
2023-11-14 11:41:09 -06:00
`);if(n.length<2)return t;let r="";return n[n.length-1]==="```"&&(r=n.pop()),`${n[0]}
${this.unindent(n.slice(1).join(`
`))}
2023-11-23 12:19:53 -06:00
${r}`})},start(){this.preSend=Ht((e,t)=>this.unindentMsg(t)),this.preEdit=br((e,t,n)=>this.unindentMsg(n))},stop(){zt(this.preSend),Tr(this.preEdit)}})});var ag,Zx,lg,Xx=g(()=>{"use strict";a();Pt();$t();P();w();A();ag=1<<2,Zx=(e,{channel:t,message:{author:n,embeds:r,flags:i,id:s}})=>()=>{let l=(i&ag)!==0;if(!l&&!r.length)return;let c=t.isPrivate()||!!(Ce.getChannelPermissions({id:t.id})&Se.EMBED_LINKS);if(n.id===W.getCurrentUser().id&&!c)return;let u=mt("delete",e),p=u?.findIndex(m=>m?.props?.id==="delete");!p||!u||u.splice(p-1,0,o(G.MenuItem,{id:"unsuppress-embeds",key:"unsuppress-embeds",label:l?"Unsuppress Embeds":"Suppress Embeds",color:l?void 0:"danger",icon:l?Aa:Na,action:()=>Mt.patch({url:`/channels/${t.id}/messages/${s}`,body:{flags:l?i&~ag:i|ag}})}))},lg=y({name:"UnsuppressEmbeds",authors:[d.rad,d.HypedDomi],description:"Allows you to unsuppress embeds in messages",start(){ce("message",Zx)},stop(){de("message",Zx)}})});var cg,Jx=g(()=>{"use strict";a();Qt();Ca();P();w();cg=y({name:"UrbanDictionary",description:"Search for a word on Urban Dictionary via /urban slash command",authors:[d.jewdev],dependencies:["CommandsAPI"],commands:[{name:"urban",description:"Returns the definition of a word from Urban Dictionary",inputType:0,options:[{type:3,name:"word",description:"The word to search for on Urban Dictionary",required:!0}],execute:async(e,t)=>{try{let n=encodeURIComponent(e[0].value),{list:[r]}=await(await fetch(`https://api.urbandictionary.com/v0/define?term=${n}`)).json();if(!r)return void ue(t.channel.id,{content:"No results found."});let i=s=>s.replaceAll(`\r
2023-11-14 11:41:09 -06:00
`,`
2023-11-23 12:19:53 -06:00
`).replace(/([*>_`~\\])/gsi,"\\$1").replace(/\[(.+?)\]/g,(l,c)=>`[${c}](https://www.urbandictionary.com/define.php?term=${encodeURIComponent(c)} "Define '${c}' on Urban Dictionary")`).trim();return void ue(t.channel.id,{embeds:[{type:"rich",author:{name:`Uploaded by "${r.author}"`,url:`https://www.urbandictionary.com/author.php?author=${encodeURIComponent(r.author)}`},title:r.word,url:`https://www.urbandictionary.com/define.php?term=${encodeURIComponent(r.word)}`,description:i(r.definition),fields:[{name:"Example",value:i(r.example)},{name:"Want more definitions?",value:`Check out [more definitions](https://www.urbandictionary.com/define.php?term=${n} "Define "${e[0].value}" on Urban Dictionary") on Urban Dictionary.`}],color:16750848,footer:{text:`\u{1F44D} ${r.thumbs_up.toString()} | \u{1F44E} ${r.thumbs_down.toString()}`,icon_url:"https://www.urbandictionary.com/favicon.ico"},timestamp:new Date(r.written_on).toISOString()}]})}catch(n){ue(t.channel.id,{content:`Something went wrong: \`${n}\``})}}}]})});var Qx=g(()=>{});var KC,YC,ZC,Vx,e2=g(()=>{"use strict";a();Qx();j();A();KC=I("selectChannel","selectVoiceChannel"),YC=Pi(".lastSection","children:"),ZC=1n<<20n,Vx=({channel:e,label:t,showHeader:n})=>o(YC,null,n&&o(S.FormTitle,{className:"vc-uvs-header"},"In a voice channel"),o(R,{className:"vc-uvs-button",color:R.Colors.TRANSPARENT,size:R.Sizes.SMALL,onClick:()=>{Ce.can(ZC,e)?KC.selectVoiceChannel(e.id):ee.show({message:"Insufficient permissions to enter the channel.",id:"user-voice-show-insufficient-permissions",type:ee.Type.FAILURE,options:{position:ee.Position.BOTTOM}})}},t))});var XC,ug,t2,pg,n2=g(()=>{"use strict";a();$();le();P();w();j();A();e2();XC=Me("VoiceStateStore"),ug=D({showInUserProfileModal:{type:3,description:"Show a user's voice channel in their profile modal",default:!0},showVoiceChannelSectionHeader:{type:3,description:'Whether to show "IN A VOICE CHANNEL" above the join button',default:!0}}),t2=_.wrap(({user:e})=>{let{channelId:t}=XC.getVoiceStateForUser(e.id)??{};if(!t)return null;let n=Q.getChannel(t);if(!n)return null;let r=Te.getGuild(n.guild_id);if(!r)return null;let i=`${r.name} | ${n.name}`;return o(Vx,{channel:n,label:i,showHeader:ug.store.showVoiceChannelSectionHeader})}),pg=y({name:"UserVoiceShow",description:"Shows whether a User is currently in a voice channel somewhere in their profile",authors:[d.LordElias],settings:ug,patchModal({user:e}){return ug.store.showInUserProfileModal?o("div",{className:"vc-uvs-modal-margin"},o(t2,{user:e})):null},patchPopout:({user:e})=>{let t=e.id===W.getCurrentUser().id;return o("div",{className:t?"vc-uvs-popout-margin-self":""},o(t2,{user:e}))},patches:[{find:".lastEditedByContainer",replacement:{match:/\(0,\i\.jsx\)\(\i\.\i,{user:\i,setNote/,replace:"$self.patchPopout(arguments[0]),$&"}},{find:".USER_PROFILE_MODAL",replacement:{match:/\.body.+?displayProfile:\i}\),/,replace:"$&$self.patchModal(arguments[0]),"}}]})});var o2,r2=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/usrbg/index.css",{name:"src/plugins/usrbg/index.css",source:`:is([class*="userProfile"], [class*="userPopout"]) [class*="bannerPremium"] {
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;
}
2023-11-23 12:19:53 -06:00
`,classNames:{},dom:null});o2="src/plugins/usrbg/index.css"});var JC,vo,jl,dg,i2=g(()=>{"use strict";a();$();Je();lo();P();w();r2();JC="https://raw.githubusercontent.com/AutumnVN/usrbg/main/usrbg.json",vo={},jl=D({nitroFirst:{description:"Banner to use if both Nitro and USRBG banners are present",type:4,options:[{label:"Nitro banner",value:!0,default:!0},{label:"USRBG banner",value:!1}]},voiceBackground:{description:"Use USRBG banners as voice chat backgrounds",type:3,default:!0,restartNeeded:!0}}),dg=y({name:"USRBG",description:"Displays user banners from USRBG, allowing anyone to get a banner without Nitro",authors:[d.AutumnVN,d.pylix,d.TheKodeToad],settings:jl,patches:[{find:".NITRO_BANNER,",replacement:[{match:/(\i)\.premiumType/,replace:"$self.premiumHook($1)||$&"},{match:/(?<=function \i\((\i)\)\{)(?=var.{30,50},bannerSrc:)/,replace:"$1.bannerSrc=$self.useBannerHook($1);"},{match:/\?\(0,\i\.jsx\)\(\i,{type:\i,shown/,replace:"&&$self.shouldShowBadge(arguments[0])$&"}]},{find:'"data-selenium-video-tile":',predicate:()=>jl.store.voiceBackground,replacement:[{match:/(?<=function\((\i),\i\)\{)(?=let.{20,40},style:)/,replace:"$1.style=$self.voiceBackgroundHook($1);"}]}],data:vo,settingsAboutComponent:()=>o(st,{href:"https://github.com/AutumnVN/usrbg#how-to-request-your-own-usrbg-banner"},"CLICK HERE TO GET YOUR OWN BANNER"),voiceBackgroundHook({className:e,participantUserId:t}){if(e.includes("tile_")&&vo[t])return{backgroundImage:`url(${vo[t]})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}},useBannerHook({displayProfile:e,user:t}){if(!(e?.banner&&jl.store.nitroFirst)&&vo[t.id])return vo[t.id]},premiumHook({userId:e}){if(vo[e])return 2},shouldShowBadge({displayProfile:e,user:t}){return e?.banner&&(!vo[t.id]||jl.store.nitroFirst)},async start(){St(o2);let e=await fetch(JC);e.ok&&(vo=await e.json(),this.data=vo)}})});function QC({data:e,UserMention:t,RoleMention:n,parse:r,props:i}){let[s,l]=J(e.userId);if(s)return o(t,{className:"mention",userId:s,channelId:e.channelId,inlinePreview:i.noStyleAndInteraction,key:i.key});let c=r(e.content,i);return o(n,{...e,inlinePreview:i.formatInline},o("span",{onMouseEnter:()=>{let u=c?.[0]?.props?.children;if(typeof u!="string")return;let p=u.match(/<@!?(\d+)>/)?.[1];if(!p||Wl.has(p))return;if(W.getUser(p))return l(p);let m=()=>{Wl.add(p),s2.unshift(()=>Rt.getUser(p).then(()=>{l(p),Wl.delete(p)}).catch(h=>{h?.status===429&&(s2.unshift(()=>Mo(1e3).then(m)),Wl.delete(p))}).finally(()=>Mo(300)))};m()}},c))}var Wl,s2,mg,a2=g(()=>{"use strict";a();le();P();Re();jr();w();A();Wl=new Set,s2=new kn(5);mg=y({name:"ValidUser",description:"Fix mentions for unknown users showing up as '<@343383572805058560>' (hover over a mention to fix it)",authors:[d.Ven],tags:["MentionCacheFix"],patches:[{find:'className:"mention"',replacement:{match:/react(?=\(\i,\i,\i\).{0,50}return null==\i\?\(0,\i\.jsx\)\((\i\.\i),.+?jsx\)\((\i\.\i),\{className:"mention")/,replace:"react:(...args)=>$self.renderMention($1,$2,...args),originalReact"}}],renderMention(e,t,n,r,i){return o(_,{noop:!0},o(QC,{RoleMention:e,UserMention:t,data:n,parse:r,props:i}))}})});var fg,gg,l2=g(()=>{"use strict";a();P();w();A();fg={},gg=y({name:"VoiceChatDoubleClick",description:"Join voice chats via double click instead of single click",authors:[d.Ven,d.D3SOX],patches:[...[".handleVoiceStatusClick",".handleClickChat"].map(e=>({find:e,replacement:[{match:/onClick:\(\)=>\{this.handleClick\(\)/g,replace:"onClick:()=>{$self.schedule(()=>{this.handleClick()},this)"}]})),{find:".shouldCloseDefaultModals",replacement:{match:/onClick:(\i)(?=,.{0,30}className:"channelMention".+?(\i)\.inContent)/,replace:(e,t,n)=>`onClick:(vcDoubleClickEvt)=>$self.shouldRunOnClick(vcDoubleClickEvt,${n})&&${t}()`}}],shouldRunOnClick(e,{channelId:t}){let n=Q.getChannel(t);return!n||![2,13].includes(n.type)?!0:e.detail>=2},schedule(e,t){let n=t.props.channel.id;if(Pe.getVoiceChannelId()===n){e();return}let r=fg[n]??={timeout:void 0,i:0};clearTimeout(r.timeout),++r.i>=2?(e(),delete fg[n]):r.timeout=setTimeout(()=>{delete fg[n]},500)}})});fun
`)}var xi,B2,Fg=g(()=>{"use strict";a();$();document.addEventListener("DOMContentLoaded",()=>{Uk(),Ql(),Og(E.useQuickCss),Wi("useQuickCss",Og),Wi("themeLinks",Ql),Wi("enabledThemes",Ql),VencordNative.quickCss.addThemeChangeListener(Ql)})});var Ug={};Be(Ug,{Common:()=>fc,_initWebpack:()=>Ys,_resolveReady:()=>Ks,addListener:()=>J2,cache:()=>Jn,extract:()=>Zs,filters:()=>Ke,find:()=>Ot,findAll:()=>rr,findBulk:()=>rc,findByCode:()=>jg,findByCodeLazy:()=>Pi,findByProps:()=>pn,findByPropsLazy:()=>I,findComponentByCode:()=>qg,findComponentByCodeLazy:()=>Xe,findComponentLazy:()=>sc,findExportedComponentLazy:()=>ac,findLazy:()=>un,findModuleId:()=>ic,findStore:()=>Wg,findStoreLazy:()=>Me,listeners:()=>oc,onceReady:()=>nc,removeListener:()=>Q2,search:()=>lc,subscriptions:()=>zg,waitFor:()=>ut,wreq:()=>Mn});var Vl=g(()=>{"use strict";a();A();j()});function U2(e){function t(n){try{$2(n[1])}catch(r){xn.error("Error in handlePush",r)}return t.$$vencordOriginal.call(e,n)}t.$$vencordOriginal=e.push,t.bind=(...n)=>t.$$vencordOriginal.bind(...n),Object.defineProperty(e,"push",{get:()=>t,set(n){t.$$vencordOriginal=n},configurable:!0})}function $2(e){let{subscriptions:t,listeners:n}=Vencord.Webpack,{patches:r}=Vencord.Plugins;for(let i in e){let s=e[i],l="0,"+s.toString().replaceAll(`
`,""),c=s,u=new Set,p=e[i]=function(m,h,v){try{s(m,h,v)}catch(M){if(s===c)throw M;return xn.error("Error in patched chunk",M),void c(m,h,v)}if(h=m.exports,!h)return;if(h===window){Object.defineProperty(v.c,i,{value:v.c[i],enumerable:!1,configurable:!0,writable:!0});return}let T=Number(i);for(let M of n)try{M(h,T)}catch(b){xn.error("Error in webpack listener",b)}for(let[M,b]of t)try{M(h)?(t.delete(M),b(h,T)):h.default&&M(h.default)&&(t.delete(M),b(h.default,T))}catch(x){xn.error("Error while firing callback for webpack chunk",x)}};p.toString=()=>s.toString(),p.original=c;for(let m=0;m<r.length;m++){let h=r[m],v=$n(`patch by ${h.plugin}`,(T,M)=>l.replace(T,M));if(!(h.predicate&&!h.predicate())&&l.includes(h.find)){u.add(h.plugin);let T=s,M=l;for(let b of h.replacement){if(b.predicate&&!b.predicate())continue;let x=s,N=l;us(b,h.plugin);try{let k=v(b.match,b.replace);if(k===l){if(h.noWarn||xn.warn(`Patch by ${h.plugin} had no effect (Module id is ${i}): ${b.match}`),h.group){xn.warn(`Undoing patch ${h.find} by ${h.plugin} because replacement ${b.match} had no effect`),l=M,s=T,u.delete(h.plugin);break}}else l=k,s=(0,eval)(`// Webpack Module ${i} - Patched by ${[...u].join(", ")}
${k}
//# sourceURL=WebpackModule${i}`)}catch(k){if(xn.error(`Patch by ${h.plugin} errored (Module id is ${i}): ${b.match}
`,k),u.delete(h.plugin),h.group){xn.warn(`Undoing patch ${h.find} by ${h.plugin} because replacement ${b.match} errored`),l=M,s=T;break}l=N,s=x}}h.all||r.splice(m--,1)}}}}var F2,xn,G2=g(()=>{"use strict";a();P();Ze();ps();qs();Vl();xn=new ie("WebpackInterceptor","#8caaee");window[jn]?(xn.info(`Patching ${jn}.push (was already existent, likely from cache!)`),Ys(window[jn]),U2(window[jn])):(Object.defineProperty(window,jn,{get:()=>F2,set:e=>{e?.push&&(e.push.$$vencordOriginal||(xn.info(`Patching ${jn}.push`),U2(e)),Ys(e)&&(xn.info("Successfully initialised Vencord webpack"),delete window[jn],window[jn]=e)),F2=e},configurable:!0}),Object.defineProperty(Function.prototype,"m",{set(e){new Error().stack?.includes("discord.com")&&(xn.info("Found webpack module factory"),$2(e),delete Function.prototype.m),Object.defineProperty(this,"m",{value:e,configurable:!0})},configurable:!0}))});var Hk={};Be(Hk,{Api:()=>Eg,PlainSettings:()=>Kn,Plugins:()=>Uu,QuickCss:()=>Bg,Settings:()=>E,Updater:()=>cu,Util:()=>Dg,Webpack:()=>Ug});async function $k(){if(E.cloud.authenticated&&await It("Vencord_cloudSecret")===null){Ie({title:"Cloud Integrations",body:"We've noticed you have cloud integrations enabled in another client! Due to limitations, you will need to re-authenticate to continue using them. Click here to go to the settings page to do so!",color:"var(--yellow-360)",onClick:()=>Qn.open("VencordCloud")});return}E.cloud.settingsSync&&E.cloud.authenticated&&(mr.Vencord_settingsDirty?(await Kr(),delete mr.Vencord_settingsDirty):await xa(!1)&&Ie({title:"Cloud Settings",body:"Your settings have been updated! Click here to restart to fully apply changes!",color:"var(--green-360)",onClick:ln}))}async function Gk(){await nc,rs("WebpackReady"),$k();try{if(!await Zr())return;if(E.autoUpdate){await Xr(),E.autoUpdateNotification&&setTimeout(()=>Ie({title:"Vencord has been updated!",body:"Click here to restart",permanent:!0,noPersist:!0,onClick:ln}),1e4);return}E.notifyAboutUpdates&&setTimeout(()=>Ie({title:"A Vencord update is available!",body:"Click here to view the update",permanent:!0,noPersist:!0,onClick(){Qn.open("VencordUpdater")}}),1e4)}catch(e){hr.error("Failed to check for updates",e)}}var mx=g(()=>{a();as();Oa();_2();Fg();yr();Vl();Fg();G2();w();Wn();Ao();$();Oa();ca();Ro();ji();yr();Vl();A();rs("Init");Gk();document.addEventListener("DOMContentLoaded",()=>{rs("DOMContentLoaded")},{once:!0})});mx();return To(Hk);})();
2023-11-14 11:41:09 -06:00
//# sourceURL=VencordDesktopRenderer
//# sourceMappingURL=vencord://vencordDesktopRenderer.js.map
/*! For license information please see vencordDesktopRenderer.js.LEGAL.txt */