dotfiles/vesktop/vencordDist/vencordDesktopRenderer.js

207 lines
477 KiB
JavaScript
Raw Normal View History

2024-01-10 23:19:19 -06:00
// Vencord d73790e
2023-11-14 11:41:09 -06:00
// Standalone: true
// Platform: Universal
// Updater disabled: false
2024-01-10 23:19:19 -06:00
"use strict";var Vencord=(()=>{var MM=Object.create;var Sa=Object.defineProperty;var PM=Object.getOwnPropertyDescriptor;var IM=Object.getOwnPropertyNames;var AM=Object.getPrototypeOf,NM=Object.prototype.hasOwnProperty;var Zr=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var g=(e,t)=>()=>(e&&(t=e(e=0)),t);var vr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ze=(e,t)=>{for(var o in t)Sa(e,o,{get:t[o],enumerable:!0})},Gh=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of IM(t))!NM.call(e,i)&&i!==o&&Sa(e,i,{get:()=>t[i],enumerable:!(r=PM(t,i))||r.enumerable});return e};var ba=(e,t,o)=>(o=e!=null?MM(AM(e)):{},Gh(t||!e||!e.__esModule?Sa(o,"default",{value:e,enumerable:!0}):o,e)),En=e=>Gh(Sa({},"__esModule",{value:!0}),e);var f,n,a=g(()=>{"use strict";f=Symbol.for("react.fragment"),n=(...e)=>(n=Vencord.Webpack.Common.React.createElement)(...e)});var ie,Ve=g(()=>{"use strict";a();ie=class{constructor(t,o="white"){this.name=t;this.color=o}static makeTitle(t,o){return["%c %c %s ","",`background: ${t}; color: black; font-weight: bold; border-radius: 5px;`,o]}_log(t,o,r,i=""){console[t](`%c Vencord %c %c ${this.name} ${i}`,`background: ${o}; color: black; font-weight: bold; border-radius: 5px;`,"",`background: ${this.color}; color: black; font-weight: bold; border-radius: 5px;`,...r)}log(...t){this._log("log","#a6d189",t)}info(...t){this._log("info","#a6d189",t)}error(...t){this._log("error","#e78284",t)}errorCustomFmt(t,...o){this._log("error","#e78284",o,t)}warn(...t){this._log("warn","#e5c890",t)}debug(...t){this._log("debug","#eebebe",t)}}});var Hh,z,it=g(()=>{"use strict";a();Hh="",z={};for(let e of["top","bottom","left","right"])for(let t of[8,16,20]){let o=`vc-m-${e}-${t}`;z[`${e}${t}`]=o,Hh+=`.${o}{margin-${e}:${t}px;}`}document.addEventListener("DOMContentLoaded",()=>document.head.append(Object.assign(document.createElement("style"),{textContent:Hh,id:"vencord-margins"})),{once:!0})});function _n(e,t=5){let o=0,r;return()=>(!r&&t>o++&&(r=e(),!r&&t===o&&console.error("Lazy factory failed:",e)),r)}function Ft(e,t=5,o=!1){let r=!0;o||setTimeout(()=>r=!1,0);let i=0,s=Object.assign(function(){},{[Yi]:void 0,[Xr](){return!s[Yi]&&t>i++&&(s[Yi]=e(),!s[Yi]&&t===i&&console.error("Lazy factory failed:",e)),s[Yi]}});return new Proxy(s,{...Ta,get(l,c,u){return!o&&r?Ft(()=>Reflect.get(l[Xr](),c,u),t,!0):Reflect.get(l[Xr](),c,u)}})}var zh,Ta,Xr,Yi,qo=g(()=>{"use strict";a();zh=["arguments","caller","prototype"],Ta={},Xr=Symbol.for("vencord.lazy.get"),Yi=Symbol.for("vencord.lazy.cached");for(let e of["apply","construct","defineProperty","deleteProperty","getOwnPropertyDescriptor","getPrototypeOf","has","isExtensible","ownKeys","preventExtensions","set","setPrototypeOf"])Ta[e]=(t,...o)=>Reflect[e](t[Xr](),...o);Ta.ownKeys=e=>{let t=e[Xr](),o=Reflect.ownKeys(t);for(let r of zh)o.includes(r)||o.push(r);return o};Ta.getOwnPropertyDescriptor=(e,t)=>{if(typeof t=="string"&&zh.includes(t))return Reflect.getOwnPropertyDescriptor(e,t);let o=Reflect.getOwnPropertyDescriptor(e[Xr](),t);return o&&Object.defineProperty(e,t,o),o}});function It(e,t=5){let o=_n(e,t),r=i=>{let s=o()??CM;return n(s,{...i})};return r.$$vencordInternal=o,r}var CM,Gc=g(()=>{"use strict";a();qo();CM=()=>null});function ln(e){if(typeof e=="string")return e;let t=e.source.replaceAll("\\i","[A-Za-z_$][\\w$]*");return new RegExp(t,e.flags)}function xa(e,t){let o=`Vencord.Plugins.plugins[${JSON.stringify(t)}]`;return typeof e!="function"?e.replaceAll("$self",o):(...r)=>e(...r).replaceAll("$self",o)}function Hc(e,t){if(e.get){let o=e.get;e.get=function(){return t(o.call(this))}}else e.value&&(e.value=t(e.value));return e}function Zi(e,t){let o=Object.getOwnPropertyDescriptors(e);o.match=Hc(o.match,ln),o.replace=Hc(o.replace,r=>xa(r,t)),Object.defineProperties(e,o)}var Jr=g(()=>{"use strict";a()});var kM,Ko,wa=g(()=>{"use strict";a();Ve();kM=(e,t,o)=>t,Ko=
2023-11-14 11:41:09 -06:00
// [EXTRACTED] WebpackModule${e}
// WARNING: This module was extracted to be more easily readable.
// This module is NOT ACTUALLY USED! This means putting breakpoints will have NO EFFECT!!
0,${t.toString()}
//# sourceURL=ExtractedWebpackModule${e}
2024-01-10 23:19:19 -06:00
`;return(0,eval)(o)}var Qr,Ma,zc,Qt,cn,Ae,jh,jc,Ao,Xi,Ia,RM,j=g(()=>{"use strict";a();qo();Gc();Ve();Jr();wa();Qr=new ie("Webpack"),zc=new Promise(e=>Ma=e),Ae={byProps:(...e)=>e.length===1?t=>t[e[0]]!==void 0:t=>e.every(o=>t[o]!==void 0),byCode:(...e)=>t=>{if(typeof t!="function")return!1;let o=Function.prototype.toString.call(t);for(let r of e)if(!o.includes(r))return!1;return!0},byStoreName:e=>t=>t.constructor?.displayName===e,componentByCode:(...e)=>{let t=Ae.byCode(...e);return o=>t(o)?!0:o.$$typeof?o.type?t(o.type):o.render?t(o.render):!1:!1}},jh=new Map,jc=new Set;Ao=Ko("find",function(t,{isIndirect:o=!1,isWaitFor:r=!1}={}){if(typeof t!="function")throw new Error("Invalid filter. Expected a function got "+typeof t);for(let i in cn){let s=cn[i];if(!!s?.exports){if(t(s.exports))return r?[s.exports,i]:s.exports;if(s.exports.default&&t(s.exports.default)){let l=s.exports.default;return r?[l,i]:l}}}return o||On("find",t),r?[null,null]:null});Xi=Ko("findBulk",function(...t){if(!Array.isArray(t))throw new Error("Invalid filters. Expected function[] got "+typeof t);let{length:o}=t;if(o===0)throw new Error("Expected at least two filters.");if(o===1)return Ao(t[0]);let r=t,i=0,s=Array(o);e:for(let l in cn){let c=cn[l];if(!!c?.exports)for(let u=0;u<o;u++){let p=r[u];if(p!==void 0){if(p(c.exports)){if(s[u]=c.exports,r[u]=void 0,++i===o)break e;break}if(c.exports.default&&p(c.exports.default)){if(s[u]=c.exports.default,r[u]=void 0,++i===o)break e;break}}}}if(i!==o){let l=new Error(`Got ${o} filters, but only found ${i} modules!`);Qr.warn(l)}return s}),Ia=Ko("findModuleId",function(...t){e:for(let r in Qt.m){let i=Qt.m[r].toString();for(let s of t)if(!i.includes(s))continue e;return r}let o=new Error(`Didn't find module with code(s):
`+t.join(`
`));return Qr.warn(o),null});RM=[]});var Ca,St,Zh=g(()=>{"use strict";a();j();Ca=Vt(e=>e.image&&e.modal&&!e.applicationIcon),St=P("buttonWrapper","buttonContent")});function ka(e,t){let o=function(){throw new Error(`Vencord could not find the ${e} Component`)},r=It(()=>o);return ft(t,i=>{o=i,Object.assign(r,i)},{isIndirect:!0}),r}function Et(e,t){ft(Ae.byStoreName(e),t,{isIndirect:!0})}var Zc=g(()=>{"use strict";a();ut();j()});var S,At,C,gt,ee,ot,Ra,J,ho,Da,br,eo,Qi,Xh,Co,Jh,Vr,ei,ti,Vi,oi,Yo,_M,es,Qh=g(()=>{"use strict";a();j();Zc();S={},oi=ka("MaskedLink",e=>e?.type?.toString().includes("MASKED_LINK)")),Yo=ka("Timestamp",Ae.byCode(".Messages.MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL.format")),_M=ka("Flex",["Justify","Align","Wrap"]),{OAuth2AuthorizeModal:es}=P("OAuth2AuthorizeModal");ft(["FormItem","Button"],e=>{({useToken:Vi,Card:At,Button:C,FormSwitch:gt,Tooltip:ee,TextInput:ot,TextArea:Ra,Text:J,Select:ho,SearchableSelect:Da,Slider:br,ButtonLooks:eo,TabBar:Co,Popout:Qi,Dialog:Xh,Paginator:Jh,ScrollerThin:Vr,Clickable:ei,Avatar:ti}=e),S=e})});var G,Ut,Vh=g(()=>{"use strict";a();j();G={};ft(["MenuItem","MenuSliderControl"],e=>G=e);Ut=P("closeContextMenu","openContextMenu")});var _,Y,pe,bt,to,ni,La,Tr,ey=g(()=>{"use strict";a();j();Tr=P("createPortal","render");ft("useState",e=>{_=e,{useEffect:pe,useState:Y,useMemo:bt,useRef:to,useReducer:ni,useCallback:La}=_})});var Xc,ri,ts,ty=g(()=>{"use strict";a();j();Xc=P("MessageDisplayCompact"),ri=P("ShowCurrentGame"),ts=P("PreloadedUserSettingsActionCreators")});var Jc,Qc,ko,Vc,_e,ii,xr,Zo,OM,de,U,po,be,mo,Q,Oe,st,Ro,os,ns,Ye,oy=g(()=>{"use strict";a();j();Zc();Jc=P("connectStores"),Qc=(i=>(i[i.ChannelMessage=0]="ChannelMessage",i[i.ThreadSettings=1]="ThreadSettings",i[i.FirstThreadMessage=2]="FirstThreadMessage",i[i.ApplicationLauncherCommand=3]="ApplicationLauncherCommand",i))(Qc||{}),Vc=P("openPrivateChannel"),{useStateFromStores:Ye}=P("useStateFromStores");Et("DraftStore",e=>ns=e);Et("UserStore",e=>U=e);Et("UserProfileStore",e=>po=e);Et("ChannelStore",e=>Q=e);Et("SelectedChannelStore",e=>be=e);Et("SelectedGuildStore",e=>mo=e);Et("GuildStore",e=>de=e);Et("GuildMemberStore",e=>Oe=e);Et("RelationshipStore",e=>st=e);Et("PermissionStore",e=>_e=e);Et("PresenceStore",e=>Zo=e);Et("ReadStateStore",e=>xr=e);Et("GuildChannelStore",e=>ii=e);Et("MessageStore",e=>ko=e);Et("WindowStore",e=>os=e);Et("EmojiStore",e=>Ro=e)});var ny={};var ry=g(()=>{"use strict";a()});var iy={};var sy=g(()=>{"use strict";a()});var ay={};var ly=g(()=>{"use strict";a()});function oo(e,t=cy.MESSAGE){oe.show({id:oe.genId(),message:e,type:t})}var O,Bn,Nt,yo,wr,Mr,et,Xo,Be,_t,cy,BM,oe,Ct,rs,Pr,$t,Do,dn,xe,Ir,FM,eu,no,tu,ou,uy=g(()=>{"use strict";a();j();ft(["dispatch","subscribe"],e=>{O=e;let t=()=>{e.unsubscribe("CONNECTION_OPEN",t),Ma()};e.subscribe("CONNECTION_OPEN",t)});ft(["ComponentDispatch","ComponentDispatcher"],e=>Bn=e.ComponentDispatch);Nt=P("getAPIBaseURL","get"),yo=P("parseTwoDigitYear"),wr=P("highlight","registerLanguage"),Mr=P("debounce","cloneDeep"),et=Vt(e=>e.Messages?.["en-US"]);ft(["fromTimestamp","extractTimestamp"],e=>Xo=e);ft("parseTopic",e=>Be=e);ft(["show","close"],e=>_t=e);cy={MESSAGE:0,SUCCESS:1,FAILURE:2,CUSTOM:3},BM={TOP:0,BOTTOM:1},oe={Type:cy,Position:BM,genId:()=>(Math.random()||Math.random()).toString(36).slice(2)};ft("showToast",e=>{oe.show=e.showToast,oe.pop=e.popToast});Ct=P("getUser","fetchCurrentUser"),rs=P("showUploadFileSizeExceededError","promptToUpload"),Pr=P("fetchAssetIds","getAssetImage"),$t=P("SUPPORTS_COPY","copy"),Do=P("transitionTo","replaceWith","transitionToGuild");ft(["open","saveAccountChanges"],e=>dn=e);({Permissions:xe}=Vt(e=>typeof e.Permissions?.ADMINISTRATOR=="bigint")),Ir=un("will be removed in v4"),FM=Ae.byCode("[zustand persist middleware]"),{persist:eu}=Vt(e=>e.persist&&FM(e.persist)),no=P("editMessage","sendMessage"),tu=P("openUserProfileModal","closeUserProfileModal"),ou=P("resolveInvite")});var nu={};ze(nu,{Alerts:()=>_t,ApplicationAssetUtils:()=>Pr,Avatar:()=>ti,Button:()=>C,ButtonLooks:()=>eo,ButtonWrapperClasses:()=>St,Card:()=>At,ChannelStore:()=>Q,Clic
`);i!==-1&&(r=o.slice(0,i),o=o.slice(i+1).replace(/https:\/\/\S+\/assets\//g,""))}return{error:t,stack:o,message:r}}componentDidCatch(t,o){this.props.onError?.({error:t,errorInfo:o,props:this.props.wrappedProps}),my.error(`A component threw an Error
`,t),my.error("Component Stack",o.componentStack)}render(){if(this.state.error===fy)return this.props.children;if(this.props.noop)return null;if(this.props.fallback)return n(this.props.fallback,{children:this.props.children,...this.state});let t=this.props.message||"An error occurred while rendering this Component. More info can be found below and in your console.";return n(So,{style:{overflow:"hidden"}},n("h1",null,"Oh no!"),n("p",null,t),n("code",null,this.state.message,!!this.state.stack&&n("pre",{className:z.top8},this.state.stack)))}});lu.wrap=(e,t)=>o=>n(lu,{...t,wrappedProps:o},n(e,{...o}));B=lu});function Oa(){return n("svg",{"aria-hidden":"true",height:"16",viewBox:"0 0 16 16",width:"16",style:{marginRight:"0.5em",transform:"translateY(2px)"}},n("path",{fill:"#db61a2","fill-rule":"evenodd",d:"M4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.565 20.565 0 008 13.393a20.561 20.561 0 003.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.75.75 0 01-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5zM8 14.25l-.345.666-.002-.001-.006-.003-.018-.01a7.643 7.643 0 01-.31-.17 22.075 22.075 0 01-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.08 22.08 0 01-3.744 2.584l-.018.01-.006.003h-.002L8 14.25zm0 0l.345.666a.752.752 0 01-.69 0L8 14.25z"}))}var cu=g(()=>{"use strict";a()});function cs(e){return n(C,{...e,look:C.Looks.LINK,color:C.Colors.TRANSPARENT,onClick:()=>VencordNative.native.openExternal("https://github.com/sponsors/Vendicated")},n(Oa,null),"Donate")}var uu=g(()=>{"use strict";a();x();cu()});function ce(e){return e.style??={},e.style.display="flex",e.style.gap??="1em",e.style.flexDirection||=e.flexDirection,delete e.flexDirection,n("div",{...e},e.children)}var kt=g(()=>{"use strict";a()});function us(e,t){return Ba.openModalLazy(e,t)}function we(e,t,o){return Ba.openModal(e,t,o)}function mn(e,t){return Ba.closeModal(e,t)}function Qo(){return Ba.closeAllModals()}var Lo,Eo,pu,Ne,Xe,We,pt,Tt,Ba,nt=g(()=>{"use strict";a();j();ut();Lo=(i=>(i.SMALL="small",i.MEDIUM="medium",i.LARGE="large",i.DYNAMIC="dynamic",i))(Lo||{}),Eo=P("ModalRoot","ModalCloseButton"),pu=pn("ImageModal"),Ne=It(()=>Eo.ModalRoot),Xe=It(()=>Eo.ModalHeader),We=It(()=>Eo.ModalContent),pt=It(()=>Eo.ModalFooter),Tt=It(()=>Eo.ModalCloseButton),Ba=P("openModalLazy")});function y(e){return e}var w=g(()=>{"use strict";a()});async function gy(e=!1){du={};let t={};e&&(t.cache="no-cache"),du=await fetch("https://badges.vencord.dev/badges.json",t).then(o=>o.json())}var jM,WM,du,mu,hy=g(()=>{"use strict";a();Ua();uu();ae();kt();cu();A();it();Pe();nt();w();x();jM="https://vencord.dev/assets/favicon.png",WM={description:"Vencord Contributor",image:jM,position:0,props:{style:{borderRadius:"50%",transform:"scale(0.9)"}},shouldShow:({user:e})=>as(e.id),link:"https://github.com/Vendicated/Vencord"},du={};mu=y({name:"BadgeAPI",description:"API to add badges to users.",authors:[m.Megu,m.Ven,m.TheSun],required:!0,patches:[{find:"Messages.PROFILE_USER_BADGES,role:",replacement:[{match:/&&(\i)\.push\(\{id:"premium".+?\}\);/,replace:"$&$1.unshift(...Vencord.Api.Badges._getBadges(arguments[0]));"},{match:/alt:" ","aria-hidden":!0,src:(?=(\i)\.src)/,replace:"...$1.props,$& $1.image??"},{match:/(?<=text:(\i)\.description,spacing:12,)children:/,replace:"children:$1.component ? () => $self.renderBadgeComponent($1) :"},{match:/href:(\i)\.link/,replace:"...($1.onClick && { onClick: $1.onClick }),$&"}]}],toolboxActions:{async"Refetch Badges"(){await gy(!0),oe.show({id:oe.genId(),message:"Successfully refetched badges!",type:oe.Type.SUCCESS})}},async start(){Vencord.Api.Badges.addBadge(WM),await gy()},renderBadgeComponent:B.wrap(e=>{let t=e.component;return n(t,{...e})},{noop:!0}),getDonorBadges(e){return du[e]?.map(t=>({image:t.badge,description:t.tooltip,position:0,props:{style:{borderRadius:"50%",transform:"scale(0.9)"}},onClick(){let o=we(r=>n(B,{noop:!0,onError:()=>{mn(o),VencordNative.native.openE
`,e)}CP=ro(async()=>{E.cloud.settingsSync&&E.cloud.authenticated&&(await di(),delete Cr.Vencord_settingsDirty)},6e4),tl=new Set,rv={};tn=Wn,E=Yu(Wn)});var sv=g(()=>{});var av=g(()=>{});var Ju={};ze(Ju,{UpdateLogger:()=>Dr,changes:()=>qn,checkForUpdates:()=>fi,getRepo:()=>Xu,isNewer:()=>bs,isOutdated:()=>Kn,maybePromptToUpdate:()=>Ts,update:()=>gi,updateError:()=>mi});async function ol(e){let t=await e;if(t.ok)return t.value;throw mi=t.error,t.error}async function fi(){return qn=await ol(VencordNative.updater.getUpdates()),qn.some(e=>e.hash===fo)?(bs=!0,Kn=!1):Kn=qn.length>0}async function gi(){if(!Kn)return!0;let e=await ol(VencordNative.updater.update());if(e&&(Kn=!1,!await ol(VencordNative.updater.rebuild())))throw new Error("The Build failed. Please try manually building the new update");return e}async function Ts(e,t=!1){try{if(await fi()){let r=confirm(e);if(r&&bs)return alert("Your local copy has more recent commits. Please stash or reset them.");r&&(await gi(),go())}}catch(o){Dr.error(o),alert("That also failed :( Try updating or re-installing with the installer!")}}var Dr,Kn,bs,mi,qn,Xu,Lr=g(()=>{"use strict";a();si();Ve();jn();Dr=new ie("Updater","white"),Kn=!1,bs=!1;Xu=()=>ol(VencordNative.updater.getRepo())});function lv(){Ts("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 cv=g(()=>{"use strict";a();Lr()});function Qu(e){let t=!1,o;return function(){return t?o:(t=!0,o=e.apply(this,arguments))}}var Vu=g(()=>{"use strict";a()});function bo({title:e,children:t}){return n(S.FormSection,null,n(J,{variant:"heading-lg/semibold",tag:"h2",className:z.bottom16},e),t)}function To(e,t){return B.wrap(e,{message:`Failed to render the ${t} tab. If this issue persists, try using the installer to reinstall!`,onError:RP})}var RP,Yn=g(()=>{"use strict";a();sv();av();ae();cv();it();Vu();x();RP=Qu(lv)});var mv={};ze(mv,{default:()=>_P});function DP(){let[e,,t]=at(VencordNative.settings.getSettingsDir,{fallbackValue:"Loading..."}),o=mt(),r=_.useMemo(()=>Math.random()>.5?pv:dv,[]),i=navigator.platform.toLowerCase().startsWith("win"),s=navigator.platform.toLowerCase().startsWith("mac"),l=!1;_.useEffect(()=>{o.macosTranslucency===!0&&!o.macosVibrancyStyle&&(o.macosVibrancyStyle="sidebar",o.macosTranslucency=void 0)},[]);let c=[{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];return n(bo,{title:"Vencord Settings"},n(EP,{image:r}),n(S.FormSection,{title:"Quick Actions"},n(At,{className:uv("quick-actions-card")},n(_.Fragment,null,n(C,{onClick:go,size:C.Sizes.SMALL},"Restart Client"),n(C,{onClick:()=>VencordNative.quickCss.openEditor(),size:C.Sizes.SMALL,disabled:e==="Loading..."},"Open QuickCSS File"),n(C,{onClick:()=>Xa(e),size:C.Sizes.SMALL,disabled:t},"Open Settings Folder"),n(C,{onClick:()=>VencordNative.native.openExternal("https://github.com/Vendicated/Vencord"),size:C.Sizes.SMALL,disabled:t},"Open in GitHub")))),n(S.FormDivider,null),n(S.FormSection,{className:z.top16,title:"Settings",tag:"h5"},n(S.FormText,{className:z.bottom20},'Hint: You can change the position of this settings section in the settings of the "Settings" plugin!'),c.map(u=>u&&n(gt,{key:u.key,value:o[u.key],onChange:p=>o[u.key]=p,note:u.note},u.title))),l&&n(f,null,n(S.FormTitle,{tag:"h5"},"Window vibrancy style (requires restart)"),n(ho,{className:z.bottom20,placeholder:"Window vibrancy style",options:[{label:"No vibrancy",default:!o.macosTranslucency,value:void 0},{label:"Under Page (window tinting)",value:"under-page"},{label:"Content",value:"content"},{label:"Window",value:"window"},{label:"Selection",value:"selection"},{label:"Titlebar",value:"titlebar"},{label:"Header",value:"header"},{label:"Sidebar (old value for transparent window
2023-11-14 11:41:09 -06:00
${e.replaceAll("```","\\`\\`\\`")}
2024-01-10 23:19:19 -06:00
${o}`}var ip,OP,BP,sp,FP,UP,$P,GP,HP,yn,zP,vn=g(()=>{"use strict";a();x();ip=e=>e.split(/(?=[A-Z])/).map(t=>t.toLowerCase()),OP=e=>e.toLowerCase().split("_"),BP=e=>e.toLowerCase().split("-"),sp=e=>e.split(/(?=[A-Z])/).map(t=>t.toLowerCase()),FP=e=>e.toLowerCase().split(" "),UP=e=>e.map((t,o)=>o?t[0].toUpperCase()+t.slice(1):t).join(""),$P=e=>e.join("_").toUpperCase(),GP=e=>e.join("-").toLowerCase(),HP=e=>e.map(t=>t[0].toUpperCase()+t.slice(1)).join(""),yn=e=>e.map(t=>t[0].toUpperCase()+t.slice(1)).join(" "),zP=["years","months","weeks","days","hours","minutes","seconds"]});function As(){return`-${Xo.fromTimestamp(Date.now())}`}function me(e,t){let o=WP.createBotMessage({channelId:e,content:"",embeds:[]});return no.receiveMessage(e,Ar(t,o)),t}function lt(e,t,o){return e.find(r=>r.name===t)?.value||o}var WP,ap=g(()=>{"use strict";a();Pe();j();x();WP=P("createBotMessage")});var Sn,Uo,lp,cl=g(()=>{"use strict";a();Sn=(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))(Sn||{}),Uo=(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))(Uo||{}),lp=(r=>(r[r.CHAT_INPUT=1]="CHAT_INPUT",r[r.USER=2]="USER",r[r.MESSAGE=3]="MESSAGE",r))(lp||{})});var pp={};ze(pp,{ApplicationCommandInputType:()=>Uo,ApplicationCommandOptionType:()=>Sn,ApplicationCommandType:()=>lp,BUILT_IN:()=>Zn,OptionalMessageOption:()=>Xn,RequiredMessageOption:()=>Ns,_handleCommand:()=>KP,_init:()=>qP,commands:()=>cp,findOption:()=>lt,generateId:()=>As,prepareOption:()=>up,registerCommand:()=>yi,sendBotMessage:()=>me,unregisterCommand:()=>Cs});function up(e){return e.displayName||=e.name,e.displayDescription||=e.description,e.options?.forEach((t,o,r)=>{t===Pv?r[o]=Xn:t===Iv&&(r[o]=Ns),t.choices?.forEach(i=>i.displayName||=i.name),up(r[o])}),e}function YP(e,t){e.options?.forEach(o=>{if(o.type!==1)throw new Error("When specifying sub-command options, all options must be sub-commands.");let r={...e,...o,type:1,name:`${e.name} ${o.name}`,id:`${o.name}-${e.id}`,displayName:`${e.name} ${o.name}`,subCommandPath:[{name:o.name,type:o.type,displayName:o.name}],rootCommand:e};yi(r,t)})}function yi(e,t){if(!Zn){console.warn("[CommandsAPI]",`Not registering ${e.name} as the CommandsAPI hasn't been initialised.`,"Please restart to use commands");return}if(Zn.some(o=>o.name===e.name))throw new Error(`Command '${e.name}' already exists.`);if(e.isVencordCommand=!0,e.id??=`-${Zn.length+1}`,e.applicationId??="-1",e.type??=1,e.inputType??=1,e.plugin||=t,up(e),e.options?.[0]?.type===1){YP(e,t);return}cp[e.name]=e,Zn.push(e)}function Cs(e){let t=Zn.findIndex(o=>o.name===e);return t===-1?!1:(Zn.splice(t,1),delete cp[e],!0)}var Zn,cp,Pv,Iv,Xn,Ns,qP,KP,ao=g(()=>{"use strict";a();vn();ap();cl();ap();cl();cp={},Pv=Symbol("OptionalMessageOption"),Iv=Symbol("RequiredMessageOption"),Xn=Pv,Ns=Iv,qP=function(e){try{Zn=e,Xn=e.find(t=>t.name==="shrug").options[0],Ns=e.find(t=>t.name==="me").options[0]}catch{console.error("Failed to load CommandsApi")}return e},KP=function(e,t,o){if(!e.isVencordCommand)return e.execute(t,o);let r=i=>{let s=`An Error occurred while executing command "${e.name}"`,l=i instanceof Error?i.stack||i.message:String(i);console.error(s,i),me(o.channel.id,{content:`${s}:
${Is(l)}`,author:{username:"Vencord"}})};try{let i=e.execute(t,o);return i instanceof Promise?i.catch(r):i}catch(i){return r(i)}}});function Av({text:e,color:t}){return n("div",{className:"vc-plugins-badge",style:{backgroundColor:t,justifySelf:"flex-end",marginLeft:"auto"}},e)}var dp=g(()=>{"use strict";a()});function Nv({option:e,pluginSettings:t,definedSettings:o,id:r,onChange:i,onError:s}){let l=t[r]??e.default,[c,u]=_.useState(l??!1),[p,d]=_.useState(null);_.useEffect(()=>{s(p!==null)},[p]);function h(v){let T=e.isValid?.call(o,v)??!0;typeof T=="string"?d(T):T?(d(null),u(v),i(v)):d("Invalid input provided.")}return n(S.FormSection,null,n(gt,{value:c,onChange:h,note:e.description,disabled:e.disabled?.call(o)??!1,...e.componentProps,hideBorder:!0,style:{marginBottom:"0.5em"}},yn(ip(r))),p&&n(S.FormText,{style:{color:"var(--text-danger)"}},p))}var Cv=g(()=>{"use strict";a();vn();x()});function kv({option:e,onChange:t,onError:o}){return e.component({setValue:t,setError:o,option:e})}var Rv=g(()=>{"use strict";a()});function mp({option:e,pluginSettings:t,definedSettings:o,id:r,onChange:i,onError:s}){function l(v){return e.type===2?BigInt(v):Number(v)}let[c,u]=_.useState(`${t[r]??e.default??0}`),[p,d]=_.useState(null);_.useEffect(()=>{s(p!==null)},[p]);function h(v){let T=e.isValid?.call(o,v)??!0;d(null),typeof T=="string"?d(T):T||d("Invalid input provided."),e.type===1&&BigInt(v)>=ZP?(u(`${Number.MAX_SAFE_INTEGER}`),i(l(v))):(u(v),i(l(v)))}return n(S.FormSection,null,n(S.FormTitle,null,e.description),n(ot,{type:"number",pattern:"-?[0-9]+",value:c,onChange:h,placeholder:e.placeholder??"Enter a number",disabled:e.disabled?.call(o)??!1,...e.componentProps}),p&&n(S.FormText,{style:{color:"var(--text-danger)"}},p))}var ZP,Dv=g(()=>{"use strict";a();w();x();ZP=BigInt(Number.MAX_SAFE_INTEGER)});function Lv({option:e,pluginSettings:t,definedSettings:o,onChange:r,onError:i,id:s}){let l=t[s]??e.options?.find(v=>v.default)?.value,[c,u]=_.useState(l??null),[p,d]=_.useState(null);_.useEffect(()=>{i(p!==null)},[p]);function h(v){let T=e.isValid?.call(o,v)??!0;typeof T=="string"?d(T):T?(d(null),u(v),r(v)):d("Invalid input provided.")}return n(S.FormSection,null,n(S.FormTitle,null,e.description),n(ho,{isDisabled:e.disabled?.call(o)??!1,options:e.options,placeholder:e.placeholder??"Select an option",maxVisibleItems:5,closeOnSelect:!0,select:h,isSelected:v=>v===c,serialize:v=>String(v),...e.componentProps}),p&&n(S.FormText,{style:{color:"var(--text-danger)"}},p))}var Ev=g(()=>{"use strict";a();x()});function $o(e,t,o=1){let r=[];for(let i=e;i<=t;i+=o)r.push(Math.round(i*100)/100);return r}function _v({option:e,pluginSettings:t,definedSettings:o,id:r,onChange:i,onError:s}){let l=t[r]??e.default,[c,u]=_.useState(null);_.useEffect(()=>{s(c!==null)},[c]);function p(d){let h=e.isValid?.call(o,d)??!0;typeof h=="string"?u(h):h?(u(null),i(d)):u("Invalid input provided.")}return n(S.FormSection,null,n(S.FormTitle,null,e.description),n(br,{disabled:e.disabled?.call(o)??!1,markers:e.markers,minValue:e.markers[0],maxValue:e.markers[e.markers.length-1],initialValue:l,onValueChange:p,onValueRender:d=>String(d.toFixed(2)),stickToMarkers:e.stickToMarkers??!0,...e.componentProps}))}var fp=g(()=>{"use strict";a();x()});function Ov({option:e,pluginSettings:t,definedSettings:o,id:r,onChange:i,onError:s}){let[l,c]=_.useState(t[r]??e.default??null),[u,p]=_.useState(null);_.useEffect(()=>{s(u!==null)},[u]);function d(h){let v=e.isValid?.call(o,h)??!0;p(typeof v=="string"?v:v?null:"Invalid input provided."),c(h),i(h)}return n(S.FormSection,null,n(S.FormTitle,null,e.description),n(ot,{type:"text",value:l,onChange:d,placeholder:e.placeholder??"Enter a value",disabled:e.disabled?.call(o)??!1,...e.componentProps}),u&&n(S.FormText,{style:{color:"var(--text-danger)"}},u))}var Bv=g(()=>{"use strict";a();x()});var ks=g(()=>{"use strict";a();dp();Cv();Rv();Dv();Ev();fp();Bv()});var Fv=g(()=>{});async function _r(e){let{invite:t}=await ou.resolveInvite(e,"Desktop Modal");if(!t)throw new Error("Invalid invite: "+e);return O.dispatch({type:"INVITE_MODAL_OPEN",invite:t,code:e
`,s),!1}}if(r?.length){lo.info("Registering commands of plugin",o);for(let s of r)try{yi(s,o)}catch(l){return lo.error(`Failed to register command ${s.name}
`,l),!1}}if(i)for(let s in i)O.subscribe(s,i[s]);return!0},e=>`startPlugin ${e.name}`),Ip=Ko("stopPlugin",function(t){let{name:o,commands:r,flux:i}=t;if(t.stop){if(lo.info("Stopping plugin",o),!t.started)return lo.warn(`${o} already stopped`),!1;try{t.stop(),t.started=!1}catch(s){return lo.error(`Failed to stop ${o}
`,s),!1}}if(r?.length){lo.info("Unregistering commands of plugin",o);for(let s of r)try{Cs(s.name)}catch(l){return lo.error(`Failed to unregister command ${s.name}
`,l),!1}}if(i)for(let s in i)O.unsubscribe(s,i[s]);return!0},e=>`stopPlugin ${e.name}`)});function pI(e){oe.show({message:e,type:oe.Type.FAILURE,id:oe.genId(),options:{position:oe.Position.BOTTOM}})}function dI({required:e}){return n(At,{className:Or("info-card",{"restart-card":e})},e?n(f,null,n(S.FormTitle,{tag:"h5"},"Restart required!"),n(S.FormText,{className:Or("dep-text")},"Restart now to apply new plugins and their settings"),n(C,{color:C.Colors.YELLOW,onClick:()=>location.reload()},"Restart")):n(f,null,n(S.FormTitle,{tag:"h5"},"Plugin Management"),n(S.FormText,null,"Press the cog wheel or info icon to get more info on a plugin"),n(S.FormText,null,"Plugins with a cog wheel have settings you can modify!")))}function ul({plugin:e,disabled:t,onRestartNeeded:o,onMouseEnter:r,onMouseLeave:i,isNew:s}){let l=E.plugins[e.name],c=()=>l.enabled??!1;function u(){us(async()=>d=>n(Sp,{...d,plugin:e,onRestartNeeded:()=>o(e.name)}))}function p(){let d=c();if(!d){let{restartNeeded:v,failures:T}=ml(e);if(T.length){Xv.error(`Failed to start dependencies for ${e.name}: ${T.join(", ")}`),ws("Failed to start dependencies: "+T.join(", "),"Close",()=>null);return}else if(v){l.enabled=!0,o(e.name);return}}if(e.patches?.length){l.enabled=!d,o(e.name);return}if(d&&!e.started){l.enabled=!d;return}if(!(d?Ip(e):Es(e))){l.enabled=!1;let v=`Error while ${d?"stopping":"starting"} plugin ${e.name}`;Xv.error(v),pI(v);return}l.enabled=!d}return n(dl,{name:e.name,description:e.description,isNew:s,enabled:c(),setEnabled:p,disabled:t,onMouseEnter:r,onMouseLeave:i,infoButton:n("button",{role:"switch",onClick:()=>u(),className:te(uI.button,Or("info-button"))},e.options&&!is(e.options)?n(Tv,null):n(il,null))})}function Np(){let e=mt(),t=_.useMemo(()=>new Ds,[]);_.useEffect(()=>()=>void(t.hasChanges&&_t.show({title:"Restart required",body:n(f,null,n("p",null,"The following plugins require a restart:"),n("div",null,t.map((v,T)=>n(f,null,T>0&&", ",Be.parse("`"+v+"`"))))),confirmText:"Restart now",cancelText:"Later!",onConfirm:()=>location.reload()})),[]);let o=_.useMemo(()=>{let v={};for(let T in Ge){let N=Ge[T].dependencies;if(N)for(let b of N)v[b]??=[],v[b].push(T)}return v},[]),r=_.useMemo(()=>Object.values(Ge).sort((v,T)=>v.name.localeCompare(T.name)),[]),[i,s]=_.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 N=i.value.toLowerCase();return v.name.toLowerCase().includes(N)||v.description.toLowerCase().includes(N)||v.tags?.some(b=>b.toLowerCase().includes(N))},[p]=at(()=>Dt("Vencord_existingPlugins").then(v=>{let T=Date.now()/1e3,N={},b=Object.values(r).map(k=>k.name),I=[];for(let{name:k}of r)(N[k]=v?.[k]??T)+60*60*24*2>T&&I.push(k);return io("Vencord_existingPlugins",N),Mr.isEqual(I,b)?[]:I})),d,h;if(r?.length){d=[],h=[];for(let v of r){if(!v.options&&v.name.endsWith("API")&&i.value!=="API"||!u(v))continue;if(v.required||o[v.name]?.some(N=>e.plugins[N].enabled)){let N=v.required?"This plugin is required for Vencord to function.":mI(o[v.name]?.filter(b=>e.plugins[b].enabled));h.push(n(ee,{text:N,key:v.name},({onMouseLeave:b,onMouseEnter:I})=>n(ul,{onMouseLeave:b,onMouseEnter:I,onRestartNeeded:k=>t.handleChange(k),disabled:!0,plugin:v})))}else d.push(n(ul,{onRestartNeeded:N=>t.handleChange(N),disabled:!1,plugin:v,isNew:p?.includes(v.name),key:v.name}))}}else d=h=n(J,{variant:"text-md/normal"},"No plugins meet search criteria.");return n(bo,{title:"Plugins"},n(dI,{required:t.hasChanges}),n(S.FormTitle,{tag:"h5",className:te(z.top20,z.bottom8)},"Filters"),n("div",{className:Or("filter-controls")},n(ot,{autoFocus:!0,value:i.value,placeholder:"Search for a plugin...",onChange:l,className:z.bottom20}),n("div",{className:Jv.inputWrapper},n(ho,{className:Jv.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]=Y(null),[u,,p]=at(VencordNative.themes.getThemesDir);pe(()=>{d()},[]);async function d(){let I=await VencordNative.themes.getThemesList();c(I)}function h(I,k){if(k){if(e.enabledThemes.includes(I))return;e.enabledThemes=[...e.enabledThemes,I]}else e.enabledThemes=e.enabledThemes.filter(M=>M!==I)}async function v(I){if(I.stopPropagation(),I.preventDefault(),!I.currentTarget?.files?.length)return;let{files:k}=I.currentTarget,M=Array.from(k,F=>{let{name:H}=F;if(!!H.endsWith(".css"))return new Promise((X,Z)=>{let q=new FileReader;q.onload=()=>{VencordNative.themes.uploadTheme(H,q.result).then(X).catch(Z)},q.readAsText(F)})});await Promise.all(M),d()}function T(){return n(f,null,n(At,{className:"vc-settings-card"},n(S.FormTitle,{tag:"h5"},"Find Themes:"),n("div",{style:{marginBottom:".5em",display:"flex",flexDirection:"column"}},n(qe,{style:{marginRight:".5em"},href:"https://betterdiscord.app/themes"},"BetterDiscord Themes"),n(qe,{href:"https://github.com/search?q=discord+theme"},"GitHub")),n(S.FormText,null,'If using the BD site, click on "Download" and place the downloaded .theme.css file into your themes folder.')),n(S.FormSection,{title:"Local Themes"},n(At,{className:"vc-settings-quick-actions-card"},n(f,null,n(C,{onClick:()=>Xa(u),size:C.Sizes.SMALL,disabled:p},"Open Themes Folder"),n(C,{onClick:d,size:C.Sizes.SMALL},"Load missing Themes"),n(C,{onClick:()=>VencordNative.quickCss.openEditor(),size:C.Sizes.SMALL},"Edit QuickCSS"))),n("div",{className:hI("grid")},l?.map(I=>n(SI,{key:I.fileName,enabled:e.enabledThemes.includes(I.fileName),onChange:k=>h(I.fileName,k),onDelete:async()=>{h(I.fileName,!1),await VencordNative.themes.deleteTheme(I.fileName),d()},theme:I})))))}function N(){e.themeLinks=[...new Set(i.trim().split(/\n+/).map(I=>I.trim()).filter(Boolean))]}function b(){return n(f,null,n(At,{className:"vc-settings-card vc-text-selectable"},n(S.FormTitle,{tag:"h5"},"Paste links to css files here"),n(S.FormText,null,"One link per line"),n(S.FormText,null,"Make sure to use direct links to files (raw or github.io)!")),n(S.FormSection,{title:"Online Themes",tag:"h5"},n(Ra,{value:i,onChange:s,className:te(gI.textarea,"vc-settings-theme-links"),placeholder:"Theme Links",spellCheck:!1,onBlur:N,rows:10}),n(vI,{themeLinks:e.themeLinks})))}return n(bo,{title:"Themes"},n(Co,{type:"top",look:"brand",className:"vc-settings-tab-bar",selectedItem:o,onItemSelect:r},n(Co.Item,{className:"vc-settings-tab-bar-item",id:0},"Local Themes"),n(Co.Item,{className:"vc-settings-tab-bar-item",id:1},"Online Themes")),o===0&&T(),o===1&&b())}var J6,Q6,gI,hI,TI,t1=g(()=>{"use strict";a();$();rt();kt();Lt();xo();ct();it();Pe();jn();ut();j();x();xp();Yn();J6=P("resolveInvite"),Q6=Vt(e=>e.prototype?.activateUploadDialogue&&e.prototype.setRef),gI=Vt(e=>typeof e.textarea=="string"),hI=Fe("vc-settings-theme-");TI=To(bI,"Themes")});var i1={};ze(i1,{default:()=>PI});function o1(e,t){return async()=>{e(!0);try{await t()}catch(r){if(Dr.error("Failed to update",r),r)if(r.code&&r.cmd){let{code:i,path:s,cmd:l,stderr:c}=r;if(i==="ENOENT")var o=`Command \`${s}\` not found.
Please install it and try again`;else{var o=`An error occurred while running \`${l}\`:
`;o+=c||`Code \`${i}\`. See the console for more info`}}else var o="An unknown error occurred. See the console for more info.";else var o=`An unknown error occurred (error is undefined).
Please try again.`;_t.show({title:"Oops!",body:n(So,null,o.split(`
`).map(i=>n("div",null,Be.parse(i))))})}finally{e(!1)}}}function n1({repo:e,hash:t,disabled:o=!1}){return n(qe,{href:`${e}/commit/${t}`,disabled:o},t)}function r1({updates:e,repo:t,repoPending:o}){return n(At,{style:{padding:"0 0.5em"}},e.map(({hash:r,author:i,message:s})=>n("div",{style:{marginTop:"0.5em",marginBottom:"0.5em"}},n("code",null,n(n1,{repo:t,hash:r,disabled:o})),n("span",{style:{marginLeft:"0.5em",color:"var(--text-normal)"}},s," - ",i))))}function xI(e){let[t,o]=_.useState(qn),[r,i]=_.useState(!1),[s,l]=_.useState(!1),c=(t?.length??0)>0;return n(f,null,!t&&mi?n(f,null,n(S.FormText,null,"Failed to check updates. Check the console for more info"),n(So,{style:{padding:"1em"}},n("p",null,mi.stderr||mi.stdout||"An unknown error occurred"))):n(S.FormText,{className:z.bottom8},c?t.length===1?"There is 1 Update":`There are ${t.length} Updates`:"Up to Date!"),c&&n(r1,{updates:t,...e}),n(ce,{className:te(z.bottom8,z.top8)},c&&n(C,{size:C.Sizes.SMALL,disabled:s||r,onClick:o1(l,async()=>{await gi()&&(o([]),await new Promise(u=>{_t.show({title:"Update Success!",body:"Successfully updated. Restart now to apply the changes?",confirmText:"Restart",cancelText:"Not now!",onConfirm(){go(),u()},onCancel:u})}))})},"Update Now"),n(C,{size:C.Sizes.SMALL,disabled:s||r,onClick:o1(i,async()=>{await fi()?o(qn):(o([]),oe.show({message:"No updates found!",id:oe.genId(),type:oe.Type.MESSAGE,options:{position:oe.Position.BOTTOM}}))})},"Check for Updates")))}function wI(e){return n(f,null,n(S.FormText,{className:z.bottom8},"Your local copy has more recent commits. Please stash or reset them."),n(r1,{...e,updates:qn}))}function MI(){let e=mt(["notifyAboutUpdates","autoUpdate","autoUpdateNotification"]),[t,o,r]=at(Xu,{fallbackValue:"Loading..."});_.useEffect(()=>{o&&Dr.error("Failed to retrieve repo",o)},[o]);let i={repo:t,repoPending:r};return n(bo,{title:"Vencord Updater"},n(S.FormTitle,{tag:"h5"},"Updater Settings"),n(gt,{value:e.notifyAboutUpdates,onChange:s=>e.notifyAboutUpdates=s,note:"Shows a notification on startup",disabled:e.autoUpdate},"Get notified about new updates"),n(gt,{value:e.autoUpdate,onChange:s=>e.autoUpdate=s,note:"Automatically update Vencord without confirmation prompt"},"Automatically update"),n(gt,{value:e.autoUpdateNotification,onChange:s=>e.autoUpdateNotification=s,note:"Shows a notification when Vencord automatically updates",disabled:!e.autoUpdate},"Get notified when an automatic update completes"),n(S.FormTitle,{tag:"h5"},"Repo"),n(S.FormText,{className:"vc-text-selectable"},r?t:o?"Failed to retrieve - check console":n(qe,{href:t},t.split("/").slice(-2).join("/"))," ","(",n(n1,{hash:fo,repo:t,disabled:r}),")"),n(S.FormDivider,{className:z.top8+" "+z.bottom8}),n(S.FormTitle,{tag:"h5"},"Updates"),bs?n(wI,{...i}):n(xI,{...i}))}var PI,s1=g(()=>{"use strict";a();$();li();kt();xo();it();Pe();jn();ut();Lr();x();si();Yn();PI=To(MI,"Updater")});function gl({value:e,onChange:t,validate:o}){let[r,i]=_.useState(e),[s,l]=_.useState();function c(u){i(u);let p=o(u);p===!0?(l(void 0),t(u)):l(p)}return n(f,null,n(ot,{type:"text",value:r,onChange:c,error:s}))}var Cp=g(()=>{"use strict";a();x()});var a1={};ze(a1,{default:()=>kI});function II(e){try{return new URL(e),!0}catch{return"Invalid URL"}}async function AI(){let e=await fetch(new URL("/v1/",zn()),{method:"DELETE",headers:new Headers({Authorization:await pi()})});if(!e.ok){Za.error(`Failed to erase data, API returned ${e.status}`),De({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 qu(),De({title:"Cloud Integrations",body:"Successfully erased all data.",color:"var(--green-360)"})}function NI(){let{cloud:e}=mt(["cloud.authenticated","cloud.settingsSync"]),t=e.authenticated&&e.settingsSync;return n(S.FormSection,{title:"Settings Sync",className:z.top16},n(S.FormText,{variant:"text-md/normal",className:z.bottom20},"Synchronize your settings to the cloud. This allows easy synchronization across multiple devices with minimal effort."),n(gt,{key:"cloud-
2023-11-14 11:41:09 -06:00
**Vencord Debug Info**
>>> ${Object.entries(s).map(([c,u])=>`${c}: ${u}`).join(`
`)}
Enabled Plugins (${r.length+i.length}):
2024-01-10 23:19:19 -06:00
${Is(r.join(", ")+`
2023-11-14 11:41:09 -06:00
`+i.join(", "))}
2024-01-10 23:19:19 -06:00
`.trim().replaceAll("```\n","```")}}}],flux:{async CHANNEL_SELECT({channelId:e}){if(e===_a&&!as(U.getCurrentUser().id)&&Kn&&fo!==await wt.get(p1)){let t=()=>wt.set(p1,fo);_t.show({title:"Hold on!",body:n("div",null,n(S.FormText,null,"You are using an outdated version of Vencord! Chances are, your issue is already fixed."),n(S.FormText,null,"Please first update using the Updater Page in Settings, or use the VencordInstaller (Update Vencord Button) to do so, in case you can't access the Updater page.")),onCancel:t,onConfirm:t})}}}})});var Dp,m1=g(()=>{"use strict";a();A();w();Dp=y({name:"AlwaysAnimate",description:"Animates anything that can be animated",authors:[m.FieryFlames],patches:[{find:"canAnimate:",all:!0,noWarn:!0,replacement:{match:/canAnimate:.+?(?=([,}].*?\)))/g,replace:(e,t)=>t.match(/}=.+/)==null?"canAnimate:!0":e}},{find:".Messages.GUILD_OWNER,",replacement:{match:/(?<=\.activityEmoji,.+?animate:)\i/,replace:"!0"}},{find:".animatedBannerHoverLayer,onMouseEnter:",replacement:{match:/(?<=guildBanner:\i,animate:)\i(?=}\))/,replace:"!0"}}]})});var Lp,f1=g(()=>{"use strict";a();A();w();Lp=y({name:"AlwaysTrust",description:"Removes the annoying untrusted domain and suspicious file popup",authors:[m.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 EI,Ep,g1=g(()=>{"use strict";a();$();A();w();EI=/\.tar\.\w+$/,Ep=y({name:"AnonymiseFileNames",authors:[m.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=EI.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 h1(e,t){return(await Pr.fetchAssetIds(e,[t]))[0]}async function OI(e){let t={};return await _I.fetchApplicationsRPC(t,e),t.application}var _I,y1,xi,_p,v1=g(()=>{"use strict";a();nl();xo();A();w();j();x();_I=P("fetchApplicationsRPC","getRemoteIconURL");y1={};_p=y({name:"WebRichPresence (arRPC)",description:"Client plugin for arRPC to enable RPC on Discord Web (experimental)",authors:[m.Ducko],settingsAboutComponent:()=>n(f,null,n(S.FormTitle,{tag:"h3"},"How to use arRPC"),n(S.FormText,null,n(qe,{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:o}=t,r=o?.assets;if(r?.large_image&&(r.large_image=await h1(o.application_id,r.large_image)),r?.small_image&&(r.small_image=await h1(o.application_id,r.small_image)),o){let i=o.application_id;y1[i]||=await OI(i);let s=y1[i];o.name||=s.name}O.dispatch({type:"LOCAL_ACTIVITY_UPDATE",...t})},async start(){if("armcord"in window)return;if(xi&&xi.close(),xi=new WebSocket("ws://127.0.0.1:1337"),xi.onmessage=this.handleEvent,!await new Promise(t=>setTimeout(()=>t(xi.readyState===WebSocket.OPEN),1e3))){ws("Failed to connect to arRPC, is it running?","Retry",()=>{op(),th
2023-11-14 11:41:09 -06:00
.vc-nsfw-img [class^=imageWrapper] img,
.vc-nsfw-img [class^=wrapperPaused] video {
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;
}
2024-01-10 23:19:19 -06:00
`}var Os,qp,F1=g(()=>{"use strict";a();$();A();w();qp=y({name:"BlurNSFW",description:"Blur attachments in NSFW channels until hovered",authors:[m.Ven],patches:[{find:".embedWrapper,embed",replacement:[{match:/\.embedWrapper(?=.+?channel_id:(\i)\.id)/g,replace:"$&+($1.nsfw?' vc-nsfw-img':'')"}]}],options:{blurAmount:{type:1,description:"Blur Amount",default:10,onChange:B1}},start(){Os=document.createElement("style"),Os.id="VcBlurNsfw",document.head.appendChild(Os),B1()},stop(){Os?.remove()}})});function zI(e){let t=E.plugins.CallTimer.format==="human",o=d=>t?d:d.toString().padStart(2,"0"),r=d=>t?d:"",i=t?" ":":",s=Math.floor(e/864e5),l=Math.floor(e%864e5/36e5),c=Math.floor(e%864e5%36e5/6e4),u=Math.floor(e%864e5%36e5%6e4/1e3),p="";return s&&(p+=`${s}d `),(l||p)&&(p+=`${o(l)}${r("h")}${i}`),(c||p||!t)&&(p+=`${o(c)}${r("m")}${i}`),p+=`${o(u)}${r("s")}`,p}var Kp,U1=g(()=>{"use strict";a();$();ae();A();ut();w();Kp=y({name:"CallTimer",description:"Adds a timer to vcs",authors:[m.Ven],startTime:0,interval:void 0,options:{format:{type:4,description:"The timer format. This can be any valid moment.js format",options:[{label:"30d 23:00:42",value:"stopwatch",default:!0},{label:"30d 23h 00m 42s",value:"human"}]}},patches:[{find:"renderConnectionStatus(){",replacement:{match:/(?<=renderConnectionStatus\(\)\{.+\.channel,children:)\i/,replace:"[$&, $self.renderTimer(this.props.channel.id)]"}}],renderTimer(e){return n(B,{noop:!0},n(this.Timer,{channelId:e}))},Timer({channelId:e}){let t=ls({deps:[e]});return n("p",{style:{margin:0}},"Connected for ",n("span",{style:{fontFamily:"var(--font-code)"}},zI(t)))}})});var ed={};ze(ed,{_handleClick:()=>qI,_handlePreEdit:()=>WI,_handlePreSend:()=>jI,addClickListener:()=>Qp,addPreEditListener:()=>Br,addPreSendListener:()=>Kt,removeClickListener:()=>Vp,removePreEditListener:()=>Fr,removePreSendListener:()=>Yt});async function jI(e,t,o,r){o.replyOptions=r;for(let i of Zp)try{let s=await i(e,t,o);if(s&&s.cancel===!0)return!0}catch(s){Yp.error(`MessageSendHandler: Listener encountered an unknown error
`,s)}return!1}async function WI(e,t,o){for(let r of Xp)try{await r(e,t,o)}catch(i){Yp.error(`MessageEditHandler: Listener encountered an unknown error
`,i)}}function Kt(e){return Zp.add(e),e}function Br(e){return Xp.add(e),e}function Yt(e){return Zp.delete(e)}function Fr(e){return Xp.delete(e)}function qI(e,t,o){e=ko.getMessage(t.id,e.id)??e;for(let r of Jp)try{r(e,t,o)}catch(i){Yp.error(`MessageClickHandler: Listener encountered an unknown error
`,i)}}function Qp(e){return Jp.add(e),e}function Vp(e){return Jp.delete(e)}var Yp,Zp,Xp,Jp,on=g(()=>{"use strict";a();Ve();x();Yp=new ie("MessageEvents","#e5c890"),Zp=new Set,Xp=new Set;Jp=new Set});var $1,G1=g(()=>{"use strict";a();$1=["action_object_map","action_type_map","action_ref_map","spm@*.aliexpress.com","scm@*.aliexpress.com","aff_platform","aff_trace_key","algo_expid@*.aliexpress.*","algo_pvid@*.aliexpress.*","btsid","ws_ab_test","pd_rd_*@amazon.*","_encoding@amazon.*","psc@amazon.*","tag@amazon.*","ref_@amazon.*","pf_rd_*@amazon.*","pf@amazon.*","crid@amazon.*","keywords@amazon.*","sprefix@amazon.*","sr@amazon.*","ie@amazon.*","node@amazon.*","qid@amazon.*","callback@bilibili.com","cvid@bing.com","form@bing.com","sk@bing.com","sp@bing.com","sc@bing.com","qs@bing.com","pq@bing.com","sc_cid","mkt_tok","trk","trkCampaign","ga_*","gclid","gclsrc","hmb_campaign","hmb_medium","hmb_source","spReportId","spJobID","spUserID","spMailingID","itm_*","s_cid","elqTrackId","elqTrack","assetType","assetId","recipientId","campaignId","siteId","mc_cid","mc_eid","pk_*","sc_campaign","sc_channel","sc_content","sc_medium","sc_outcome","sc_geo","sc_country","nr_email_referer","vero_conv","vero_id","yclid","_openstat","mbid","cmpid","cid","c_id","campaign_id","Campaign","hash@ebay.*","fb_action_ids","fb_action_types","fb_ref","fb_source","fbclid","refsrc@facebook.com","hrc@facebook.com","gs_l","gs_lcp@google.*","ved@google.*","ei@google.*","sei@google.*","gws_rd@google.*","gs_gbg@google.*","gs_mss@google.*","gs_rn@google.*","_hsenc","_hsmi","__hssc","__hstc","hsCtaTracking","source@sourceforge.net","position@sourceforge.net","t@*.twitter.com","s@*.twitter.com","ref_*@*.twitter.com","t@*.x.com","s@*.x.com","ref_*@*.x.com","t@*.fixupx.com","s@*.fixupx.com","ref_*@*.fixupx.com","t@*.fxtwitter.com","s@*.fxtwitter.com","ref_*@*.fxtwitter.com","t@*.twittpr.com","s@*.twittpr.com","ref_*@*.twittpr.com","t@*.fixvx.com","s@*.fixvx.com","ref_*@*.fixvx.com","tt_medium","tt_content","lr@yandex.*","redircnt@yandex.*","feature@youtube.com","kw@youtube.com","si@youtube.com","pp@youtube.com","si@youtu.be","wt_zmc","utm_source","utm_content","utm_medium","utm_campaign","utm_term","si@open.spotify.com","igshid","share_id@reddit.com"]});var H1,KI,td,z1=g(()=>{"use strict";a();on();A();w();G1();H1=/[\\^$.*+?()[\]{}|]/g,KI=RegExp(H1.source),td=y({name:"ClearURLs",description:"Removes tracking garbage from URLs",authors:[m.adryd],dependencies:["MessageEventsAPI"],escapeRegExp(e){return e&&KI.test(e)?e.replace(H1,"\\$&"):e||""},createRules(){let e=$1;this.universalRules=new Set,this.rulesByHost=new Map,this.hostRules=new Map;for(let t of e){let o=t.split("@"),r=new RegExp("^"+this.escapeRegExp(o[0]).replace(/\\\*/,".+?")+"$");if(!o[1]){this.universalRules.add(r);continue}let i=new RegExp("^(www\\.)?"+this.escapeRegExp(o[1]).replace(/\\\./,"\\.").replace(/^\\\*\\\./,"(.+?\\.)?").replace(/\\\*/,".+?")+"$"),s=i.toString();this.hostRules.set(s,i),this.rulesByHost.get(s)==null&&this.rulesByHost.set(s,new Set),this.rulesByHost.get(s).add(r)}},removeParam(e,t,o){(t===e||e instanceof RegExp&&e.test(t))&&o.delete(t)},replacer(e){try{var t=new URL(e)}catch{return e}return t.searchParams.entries().next().done?e:(this.universalRules.forEach(o=>{t.searchParams.forEach((r,i,s)=>{this.removeParam(o,i,s)})}),this.hostRules.forEach((o,r)=>{!o.test(t.hostname)||this.rulesByHost.get(r).forEach(i=>{t.searchParams.forEach((s,l,c)=>{this.removeParam(i,l,c)})})}),t.toString())},onSend(e){e.content.match(/http(s)?:\/\//)&&(e.content=e.content.replace(/(https?:\/\/[^\s<]+[^<.,:;"'>)|\]\s])/g,t=>this.replacer(t)))},start(){this.createRules(),this.preSend=Kt((e,t)=>this.onSend(t)),this.preEdit=Br((e,t,o)=>this.onSend(o))},stop(){Yt(this.preSend),Fr(this.preEdit)}})});var j1=g(()=>{});function q1(e){let t=e.toString(16).padStart(6,"0");Bs.store.color=t,K1(t)}function XI(){let e=VI(Bs.store.color)>45,t=Jn()===2;return n("div",{className:"client-theme-settings"},n("div",{className:"client-theme-container"},n("div",{className:"client-theme-settings-labels"},n(S.FormTitle,{tag:"h3"},"T
`),r=document.createElement("style");r.setAttribute("id","clientThemeOffsets"),r.textContent=`:root:root {
2024-01-10 23:19:19 -06:00
${o}
}`,document.head.appendChild(r)}function K1(e){let{hue:t,saturation:o,lightness:r}=QI(e),i=document.getElementById("clientThemeVars");i||(i=document.createElement("style"),i.setAttribute("id","clientThemeVars"),document.head.appendChild(i)),i.textContent=`:root {
--theme-h: ${t};
2024-01-10 23:19:19 -06:00
--theme-s: ${o}%;
--theme-l: ${r}%;
2024-01-10 23:19:19 -06:00
}`}function QI(e){let t=parseInt(e.substring(0,2),16)/255,o=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,i=Math.max(t,o,r),s=Math.min(t,o,r),l=i-s,c,u,p;return p=(i+s)/2,l===0?(c=0,u=0):(u=l/(1-Math.abs(2*p-1)),i===t?c=(o-r)/l%6:i===o?c=(r-t)/l+2:c=(t-o)/l+4,c*=60,c<0&&(c+=360)),u*=100,p*=100,{hue:c,saturation:u,lightness:p}}function VI(e){let t=parseInt(e.substring(0,2),16)/255,o=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,i=Math.max(t,o,r),s=Math.min(t,o,r);return 100*((i+s)/2)}var YI,ZI,Bs,od,W1,Y1=g(()=>{"use strict";a();j1();$();A();ct();it();Pe();w();j();x();YI=je(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR",".BACKGROUND_PRIMARY)"),ZI=["#1E1514","#172019","#13171B","#1C1C28","#402D2D","#3A483D","#344242","#313D4B","#2D2F47","#322B42","#3C2E42","#422938"];Bs=D({color:{description:"Color your Discord client theme will be based around. Light mode isn't supported",type:6,default:"313338",component:()=>n(XI,null)},resetColor:{description:"Reset Theme Color",type:6,default:"313338",component:()=>n(C,{onClick:()=>q1(3224376)},"Reset Theme Color")}}),od=y({name:"ClientTheme",authors:[m.F53,m.Nuckyz],description:"Recreation of the old client theme experiment. Add a color to your Discord client theme",settings:Bs,startAt:"DOMContentLoaded",start(){K1(Bs.store.color),JI()},stop(){document.getElementById("clientThemeVars")?.remove(),document.getElementById("clientThemeOffsets")?.remove()}}),W1=/(--primary-[5-9]\d{2}-hsl):.*?(\S*)%;/g});var nd,Z1=g(()=>{"use strict";a();A();w();nd=y({name:"ColorSighted",description:"Removes the colorblind-friendly icons from statuses, just like 2015-2017 Discord",authors:[m.lewisakura],patches:[{find:"Masks.STATUS_ONLINE",replacement:{match:/Masks\.STATUS_(?:IDLE|DND|STREAMING|OFFLINE)/g,replace:"Masks.STATUS_ONLINE"}},{find:".AVATAR_STATUS_MOBILE_16;",replacement:{match:/(?<=fromIsMobile:\i=!0,.+?)status:(\i)/,replace:'status_$:$1="online"'}}]})});var rd,X1=g(()=>{"use strict";a();A();jn();Jr();w();j();j();x();rd=y({name:"ConsoleShortcuts",description:"Adds shorter Aliases for many things on the window. Run `shortcutList` for a list.",authors:[m.Ven],getShortcuts(){function e(i){let s=new Map;return function(...l){let c=String(l);if(s.has(c))return s.get(c);let u=Sr(i(...l)),p=(()=>{switch(u.length){case 0:return null;case 1:return u[0];default:let d=[...new Set(u)];return d.length>1&&console.warn(`Warning: This filter matches ${u.length} modules. Make it more specific!
`,d),u[0]}})();return p&&c&&s.set(c,p),p}}let t,o=e(i=>i),r=e(Ae.byProps);return{...Vencord.Webpack.Common,wp:Vencord.Webpack,wpc:Qt.c,wreq:Qt,wpsearch:Yc,wpex:Na,wpexs:i=>Na(Ia(i)),find:o,findAll:Sr,findByProps:r,findAllByProps:(...i)=>Sr(Ae.byProps(...i)),findByCode:e(Ae.byCode),findAllByCode:i=>Sr(Ae.byCode(i)),findComponentByCode:e(Ae.componentByCode),findAllComponentsByCode:(...i)=>Sr(Ae.componentByCode(...i)),findExportedComponent:(...i)=>r(...i)[i[0]],findStore:e(Ae.byStoreName),PluginsApi:Vencord.Plugins,plugins:Vencord.Plugins.plugins,Settings:Vencord.Settings,Api:Vencord.Api,reload:()=>location.reload(),restart:go,canonicalizeMatch:ln,canonicalizeReplace:xa,canonicalizeReplacement:Zi,fakeRender:(i,s)=>{let l=t?.deref(),c=l?.closed===!1?l:window.open("about:blank","Fake Render","popup,width=500,height=500");t=new WeakRef(c),c.focus();let u=c.document;u.body.style.margin="1em",c.prepared||(c.prepared=!0,[...document.querySelectorAll("style"),...document.querySelectorAll("link[rel=stylesheet]")].forEach(p=>{let d=p.cloneNode(!0);p.parentElement?.tagName==="HEAD"?u.head.append(d):d.id?.startsWith("vencord-")||d.id?.startsWith("vcd-")?u.documentElement.append(d):u.body.append(d)})),Tr.render(_.createElement(i,s),u.body.appendChild(document.createElement("div")))}}},start(){let e=this.getShortcuts();window.shortcutList=e;for(let[t,o]of Object.entries(e))window[t]=o},stop(){delete window.shortcutList;for(let e in this.getShortcuts())delete window[e]}})});var J1,id,Q1=g(()=>{"use strict";a();Rt();Lt();A();w();x();J1=(e,{user:t})=>()=>{!t||e.push(n(G.MenuItem,{id:"vc-copy-user-url",label:"Copy User URL",action:()=>$t.copy(`<https://discord.com/users/${t.id}>`),icon:hi}))},id=y({name:"CopyUserURLs",authors:[m.castdrian],description:"Adds a 'Copy User URL' option to the user context menu.",start(){ue("user-context",J1)},stop(){fe("user-context",J1)}})});var nn,eA,V1,eS,tA,sd,ad,hl,ld,cd,tS=g(()=>{"use strict";a();$n();$();A();Ve();nt();w();Lr();j();x();nn=new ie("CrashHandler"),{ModalStack:eA,DraftManager:V1,DraftType:eS,closeExpressionPicker:tA}=No(()=>{let e=Xi(Ae.byProps("pushLazy","popAll"),Ae.byProps("clearDraft","saveDraft"),Ae.byProps("DraftType"),Ae.byProps("closeExpressionPicker","openExpressionPicker"));return{ModalStack:e[0],DraftManager:e[1],DraftType:e[2]?.DraftType,closeExpressionPicker:e[3]?.closeExpressionPicker}}),sd=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}}),ad=0,hl=0,ld=!1,cd=y({name:"CrashHandler",description:"Utility plugin for handling and possibly recovering from Crashes without a restart",authors:[m.Nuckyz],enabledByDefault:!0,settings:sd,patches:[{find:".Messages.ERRORS_UNEXPECTED_CRASH",replacement:{match:/(?=this\.setState\()/,replace:"$self.handleCrash(this)||"}}],handleCrash(e){if(Date.now()-hl<=1e3&&!ld)return!0;if(ld=!1,++ad>5){try{De({color:"#eed202",title:"Discord has crashed!",body:"Awn :( Discord has crashed more than five times, not attempting to recover.",noPersist:!0})}catch{}return hl=Date.now(),!1}setTimeout(()=>ad--,6e4);try{return ad===1&&Ts("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),sd.store.attemptToPreventCrashes?(this.handlePreventCrash(e),!0):!1}catch(t){return nn.error("Failed to handle crash",t),!1}finally{hl=Date.now()}},handlePreventCrash(e){if(Date.now()-hl>=1e3)try{De({color:"#eed202",title:"Discord has crashed!",body:"Attempting to recover...",noPersist:!0})}catch{}try{let t=be.getChannelId();V1.clearDraft(t,eS.ChannelMessage),V1.clearDraft(t,eS.FirstThreadMessage)}catch(t){nn.debug("Failed to clear drafts.",t)}try{tA()}catch(t){nn.debug("Failed to close expression picker.",t)}try{O.dispatch({type:"CONTEXT_MENU_CLOSE"})}catch(t){nn.debug("Failed to close open context menu.",t)}try{eA.popAll()}catch(t){nn.debug("Failed to close old modals.",t)}try{Qo()}catch(t){nn.deb
2023-11-14 11:41:09 -06:00
discord.gg/${r.code} \xB7
Expires: <t:${new Date(r.expires_at).getTime()/1e3}:R> \xB7
Max uses: \`${r.max_uses}\`
2024-01-10 23:19:19 -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 _l.getAllFriendInvites()).map(i=>`
2023-11-14 11:41:09 -06:00
_discord.gg/${i.code}_ \xB7
Expires: <t:${new Date(i.expires_at).getTime()/1e3}:R> \xB7
Times used: \`${i.uses}/${i.max_uses}\`
2024-01-10 23:19:19 -06:00
`.trim().replace(/\s+/g," "));me(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 _l.revokeFriendInvites(),me(t.channel.id,{content:"All friend invites have been revoked."})}}]})});var Yd,w0=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/gameActivityToggle/style.css",{name:"src/plugins/gameActivityToggle/style.css",source:`[class*="withTagAsButton"] {
2023-11-14 11:41:09 -06:00
min-width: 88px !important;
}
2024-01-10 23:19:19 -06:00
`,classNames:{},dom:null});Yd="src/plugins/gameActivityToggle/style.css"});function dN(e){let{oldIcon:t}=M0.use(["oldIcon"]),o=t?"M23 2.27 21.73 1 1 21.73 2.27 23 23 2.27Z":"M22.7 2.7a1 1 0 0 0-1.4-1.4l-20 20a1 1 0 1 0 1.4 1.4Z",r=t?"M23.27 4.54 19.46.73 .73 19.46 4.54 23.27 23.27 4.54Z":"M23.27 4.73 19.27 .73 -.27 20.27 3.73 24.27Z";return function(){return n("svg",{width:"20",height:"20",viewBox:"0 0 24 24"},n("path",{fill:!e&&!t?"var(--status-danger)":"currentColor",mask:e?void 0:"url(#gameActivityMask)",d:"M3.06 20.4q-1.53 0-2.37-1.065T.06 16.74l1.26-9q.27-1.8 1.605-2.97T6.06 3.6h11.88q1.8 0 3.135 1.17t1.605 2.97l1.26 9q.21 1.53-.63 2.595T20.94 20.4q-.63 0-1.17-.225T18.78 19.5l-2.7-2.7H7.92l-2.7 2.7q-.45.45-.99.675t-1.17.225Zm14.94-7.2q.51 0 .855-.345T19.2 12q0-.51-.345-.855T18 10.8q-.51 0-.855.345T16.8 12q0 .51.345 .855T18 13.2Zm-2.4-3.6q.51 0 .855-.345T16.8 8.4q0-.51-.345-.855T15.6 7.2q-.51 0-.855.345T14.4 8.4q0 .51.345 .855T15.6 9.6ZM6.9 13.2h1.8v-2.1h2.1v-1.8h-2.1v-2.1h-1.8v2.1h-2.1v1.8h2.1v2.1Z"}),!e&&n(f,null,n("path",{fill:"var(--status-danger)",d:o}),n("mask",{id:"gameActivityMask"},n("rect",{fill:"white",x:"0",y:"0",width:"24",height:"24"}),n("path",{fill:"black",d:r}))))}}function mN(){let e=ri.ShowCurrentGame.useSetting();return n(pN,{tooltipText:e?"Disable Game Activity":"Enable Game Activity",icon:dN(e),role:"switch","aria-checked":!e,onClick:()=>ri.ShowCurrentGame.updateSetting(t=>!t)})}var pN,M0,Zd,P0=g(()=>{"use strict";a();$();rt();ae();A();w();j();x();w0();pN=je("Button.Sizes.NONE,disabled:");M0=D({oldIcon:{type:3,description:"Use the old icon style before Discord icon redesign",default:!1}}),Zd=y({name:"GameActivityToggle",description:"Adds a button next to the mic and deafen button to toggle game activity.",authors:[m.Nuckyz,m.RuukuLada],settings:M0,patches:[{find:".Messages.ACCOUNT_SPEAKING_WHILE_MUTED",replacement:{match:/this\.renderNameZone\(\).+?children:\[/,replace:"$&$self.GameActivityToggleButton(),"}}],GameActivityToggleButton:B.wrap(mN,{noop:!0}),start(){xt(Yd)},stop(){jt(Yd)}})});var fN,Xd,I0=g(()=>{"use strict";a();A();ct();w();j();({closeExpressionPicker:fN}=P("closeExpressionPicker")),Xd=y({name:"GifPaste",description:"Makes picking a gif in the gif picker insert a link into the chatbox instead of instantly sending it",authors:[m.Ven],patches:[{find:".handleSelectGIF=",replacement:{match:/\.handleSelectGIF=(\i)=>\{/,replace:".handleSelectGIF=$1=>{if (!this.props.className) return $self.handleSelect($1);"}}],handleSelect(e){e&&(bn(e.url+" "),fN())}})});function N0(e,t,o){let r=no.getSendMessageOptionsForReply({channel:e,message:t,shouldMention:!0,showMentionToggle:!0});if(Ol.store.greetMode==="Message"||o.length>1){r.stickerIds=o;let i={content:"",tts:!1,invalidEmojis:[],validNonShortcutEmojis:[]};no._sendMessage(e.id,i,r)}else no.sendGreetMessage(e.id,o[0],r)}function gN({channel:e,message:t}){let o=Ol.use(["greetMode","multiGreetChoices"]),{greetMode:r,multiGreetChoices:i=[]}=o;return n(G.Menu,{navId:"greet-sticker-picker",onClose:()=>O.dispatch({type:"CONTEXT_MENU_CLOSE"}),"aria-label":"Greet Sticker Picker"},n(G.MenuGroup,{label:"Greet Mode"},Object.values(C0).map(s=>n(G.MenuRadioItem,{key:s,group:"greet-mode",id:"greet-mode-"+s,label:s,checked:s===r,action:()=>o.greetMode=s}))),n(G.MenuSeparator,null),n(G.MenuGroup,{label:"Greet Stickers"},A0.map(s=>n(G.MenuItem,{key:s.id,id:"greet-"+s.id,label:s.description.split(" ")[0],action:()=>N0(e,t,[s.id])}))),Ol.store.unholyMultiGreetEnabled?n(f,null,n(G.MenuSeparator,null),n(G.MenuItem,{label:"Unholy Multi-Greet",id:"unholy-multi-greet"},A0.map(s=>{let l=i.some(c=>c===s.id);return n(G.MenuCheckboxItem,{key:s.id,id:"multi-greet-"+s.id,label:s.description.split(" ")[0],checked:l,disabled:!l&&i.length>=3,action:()=>{o.multiGreetChoices=l?i.filter(c=>c!==s.id):[...i,s.id]}})}),n(G.MenuSeparator,null),n(G.MenuItem,{id:"multi-greet-submit",label:"Send Greets",action:()=>N0(e,t,i),disabled:i.length===0}))):null)}var C0,Ol,A0,Jd,k0=g(()=>{"use strict";a();$();A();w();j();x();C0=(o=>(o.Greet="Greet",o.NormalMessage="Message",o))(C0||{}),Ol=D({g
2023-11-14 11:41:09 -06:00
:is(${e}) :is([class*="embedWrapper"], [class*="clickableSticker"]) {
/* important is not necessary, but add it to make sure bad themes won't break it */
display: none !important;
}
:is(${e})::after {
content: "Attachments hidden";
color: var(--text-muted);
font-size: 80%;
}
2024-01-10 23:19:19 -06:00
`},async toggleHide(e){let t=await R0();t.delete(e)||t.add(e),await vN(t),await this.buildCss()}})});var em,E0=g(()=>{"use strict";a();A();w();em=y({name:"iLoveSpam",description:"Do not hide messages from 'likely spammers'",authors:[m.botato,m.Nyako],patches:[{find:"hasFlag:{writable",replacement:{match:/if\((\i)<=(?:1<<30|1073741824)\)return/,replace:"if($1===(1<<20))return false;$&"}}]})});function B0(e,t,o,r){return n(ee,{text:t},i=>n("button",{...i,onClick:s=>TN(s,e),style:{all:"unset",cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center"}},n("svg",{width:"24",height:"24",viewBox:"0 -960 960 960"},n("path",{fill:r,d:o}))))}function O0(e,t=!1){let o=ki.use(["ignoredActivities"]),{ignoredActivities:r=[]}=o;return r.some(i=>i.id===e.id)?bN(e,"var(--status-danger)"):SN(e,t?"var(--green-300)":"var(--primary-400)")}function TN(e,t){e.stopPropagation();let o=rr().findIndex(r=>r.id===t.id);o===-1?ki.store.ignoredActivities=rr().concat(t):ki.store.ignoredActivities=rr().filter((r,i)=>i!==o),ri.ShowCurrentGame.updateSetting(r=>r)}function rr(){return ki.store.ignoredActivities??=[]}var _0,SN,bN,ki,tm,F0=g(()=>{"use strict";a();Vo();$();ae();A();w();j();x();_0=Re("RunningGameStore");SN=(e,t)=>B0(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),bN=(e,t)=>B0(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);ki=D({}).withPrivateSettings();tm=y({name:"IgnoreActivities",authors:[m.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:ki,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,o)=>`${e}$self.renderToggleGameActivityButton(${t},${o}),`}},{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 Dt("IgnoreActivities_ignoredActivities");if(e!=null&&(ki.store.ignoredActivities=Array.from(e.values()).map(t=>({...t,name:"Unknown Name"})),Nu("IgnoreActivities_ignoredActivities")),rr().length!==0){let t=_0.getGamesSeen();for(let[o,r]of rr().entries())r.type===0&&(t.some(i=>i.id===r.id||i.exePath===r.id)||rr().splice(o,1))}},isActivityNotIgnored(e){if(e.type===0||e.type===3){if(e.application_id!=null)return!rr().some(t=>t.id===e.application_id);{let t=_0.getRunningGames().find(o=>o.name===e.name)?.exePath;if(t)return!rr().some(o=>o.id===t)}}return!0},renderToggleGameActivityButton(e,t){return n(B,{noop:!0},n("div",{style:{marginLeft:12,zIndex:0}},O0({id:e.id??e.exePath,name:e.name,type:0},t)))},renderToggleActivityButton(e){return n(B,{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;
}
2024-01-10 23:19:19 -06:00
`,classNames:{},dom:null});sm="src/plugins/imageZoom/styles.css"});var He,H0,am,im=g(()=>{"use strict";a();Rt();$();rt();ks();A();Nr();w();x();$0();om();G0();He=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:$o(1,50,4),default:2,stickToMarkers:!1},size:{description:"Radius / Size of the lens",type:5,markers:$o(50,1e3,50),default:100,stickToMarkers:!1},zoomSpeed:{description:"How fast the zoom / lens size changes",type:5,markers:$o(.1,5,.2),default:.5,stickToMarkers:!1}}),H0=e=>()=>{e.push(n(G.MenuGroup,{id:"image-zoom"},n(G.MenuCheckboxItem,{id:"vc-square",label:"Square Lens",checked:He.store.square,action:()=>{He.store.square=!He.store.square,Ut.closeContextMenu()}}),n(G.MenuCheckboxItem,{id:"vc-nearest-neighbour",label:"Nearest Neighbour",checked:He.store.nearestNeighbour,action:()=>{He.store.nearestNeighbour=!He.store.nearestNeighbour,Ut.closeContextMenu()}}),n(G.MenuControlItem,{id:"vc-zoom",label:"Zoom",control:(t,o)=>n(G.MenuSliderControl,{ref:o,...t,minValue:1,maxValue:50,value:He.store.zoom,onChange:ro(r=>He.store.zoom=r,100)})}),n(G.MenuControlItem,{id:"vc-size",label:"Lens Size",control:(t,o)=>n(G.MenuSliderControl,{ref:o,...t,minValue:50,maxValue:1e3,value:He.store.size,onChange:ro(r=>He.store.size=r,100)})}),n(G.MenuControlItem,{id:"vc-zoom-speed",label:"Zoom Speed",control:(t,o)=>n(G.MenuSliderControl,{ref:o,...t,minValue:.1,maxValue:5,value:He.store.zoomSpeed,onChange:ro(r=>He.store.zoomSpeed=r,100),renderValue:r=>`${r.toFixed(3)}x`})})))},am=y({name:"ImageZoom",description:"Lets you zoom in to images and gifs. Use scroll wheel to zoom in and shift + scroll wheel to increase lens radius / size",authors:[m.Aria],tags:["ImageUtilities"],patches:[{find:"Messages.OPEN_IN_BROWSER",replacement:{match:/return.{1,200}\.wrapper.{1,200}src:\i,/g,replace:`$&id: '${Ks}',`}},{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:He,currentMagnifierElement:null,element:null,Magnifier:rm,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===Ks&&(this.currentMagnifierElement||(this.currentMagnifierElement=n(rm,{size:He.store.size,zoom:He.store.zoom,instance:e}),this.root=Tr.createRoot(this.element),this.root.render(this.currentMagnifierElement)))},unMountMagnifier(){this.root?.unmount(),this.currentMagnifierElement=null,this.root=null},onMouseOver(e){e.setState(t=>({...t,mouseOver:!0}))},onMouseOut(e){e.setState(t=>({...t,mouseOver:!1}))},onMouseDown(e,t){e.button===0&&t.setState(o=>({...o,mouseDown:!0}))},onMouseUp(e){e.setState(t=>({...t,mouseDown:!1}))},start(){xt(sm),ue("image-context",H0),this.element=document.createElement("div"),this.element.classList.add("MagnifierContainer"),document.body.appendChild(this.element)},stop(){jt(sm),this.root&&this.root.unmount(),this.element?.remove(),fe("image-context",H0)}})});function wN(e){let t=e?.message?.content,[o,r]=_.useState("password");return n(Ne,{...e},n(Xe,null,n(S.FormTitle,{tag:"h4"},"Decrypt Message")),n(We,null,n(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Message with Encryption"),n(ot,{defaultValue:t,disabled:!0}),n(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Password"),n(ot,{style:{marginBottom:"20px"},onChange:r})),n(pt,null,n(C,{color:C.Colors.GREEN,onClick:()=>{let i=lm(t,o,!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;
}
2024-01-10 23:19:19 -06:00
`,classNames:{},dom:null});wm="src/plugins/messageLogger/deleteStyleOverlay.css"});var Mm,mb=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/messageLogger/deleteStyleText.css",{name:"src/plugins/messageLogger/deleteStyleText.css",source:`/* Message content highlighting */
2023-11-14 11:41:09 -06:00
.messagelogger-deleted [class*="contents"] > :is(div, h1, h2, h3, p) {
color: #f04747 !important;
}
/* Bot "thinking" text highlighting */
.messagelogger-deleted [class*="colorStandard"] {
color: #f04747 !important;
}
/* Embed highlighting */
.messagelogger-deleted article :is(div, span, h1, h2, h3, p) {
color: #f04747 !important;
}
.messagelogger-deleted a {
color: #be3535 !important;
text-decoration: underline;
}
2024-01-10 23:19:19 -06:00
`,classNames:{},dom:null});Mm="src/plugins/messageLogger/deleteStyleText.css"});function fb(){E.plugins.MessageLogger.deleteStyle==="text"?(xt(Mm),jt(wm)):(jt(Mm),xt(wm))}var ZN,gb,hb,yb,Pm,vb=g(()=>{"use strict";a();pb();Rt();$();rt();ae();A();Ve();w();j();x();db();mb();ZN=P("edited","communicationDisabled","isSystemMessage");gb="ml-remove-history",hb="ml-toggle-style",yb=(e,t)=>()=>{let{message:o}=t,{deleted:r,editHistory:i,id:s,channel_id:l}=o;if(!r&&!i?.length)return;e:{if(!r)break e;let c=document.getElementById(`chat-messages-${l}-${s}`);if(!c)break e;e.push(n(G.MenuItem,{id:hb,key:hb,label:"Toggle Deleted Highlight",action:()=>c.classList.toggle("messagelogger-deleted")}))}e.push(n(G.MenuItem,{id:gb,key:gb,label:"Remove Message History",color:"danger",action:()=>{r?O.dispatch({type:"MESSAGE_DELETE",channelId:l,id:s,mlDeleted:!0}):o.editHistory=[]}}))},Pm=y({name:"MessageLogger",description:"Temporarily logs deleted and edited messages.",authors:[m.rushii,m.Ven,m.AutumnVN],start(){fb(),ue("message",yb)},stop(){fe("message",yb)},renderEdit(e){return n(B,{noop:!0},n("div",{className:"messagelogger-edited"},Be.parse(e.content),n(Yo,{timestamp:e.timestamp,isEdited:!0,isInline:!1},n("span",{className:ZN.edited}," ","(",et.Messages.MESSAGE_EDITED,")"))))},makeEdit(e,t){return{timestamp:yo?.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:()=>fb()},ignoreBots:{type:3,description:"Whether to ignore messages by bots",default:!1},ignoreSelf:{type:3,description:"Whether to ignore messages by yourself",default:!1},ignoreUsers:{type:0,description:"Comma-separated list of user IDs to ignore",default:""},ignoreChannels:{type:0,description:"Comma-separated list of channel IDs to ignore",default:""},ignoreGuilds:{type:0,description:"Comma-separated list of guild IDs to ignore",default:""}},handleDelete(e,t,o){try{if(e==null||!o&&!e.has(t.id))return e;let r=i=>{let s=e.get(i);if(!s)return;let l=64;t.mlDeleted||(s.flags&l)===l||this.shouldIgnore(s)?e=e.remove(i):e=e.update(i,u=>u.set("deleted",!0).set("attachments",u.attachments.map(p=>(p.deleted=!0,p))))};o?t.ids.forEach(r):r(t.id)}catch(r){new ie("MessageLogger").error("Error during handleDelete",r)}return e},shouldIgnore(e){let{ignoreBots:t,ignoreSelf:o,ignoreUsers:r,ignoreChannels:i,ignoreGuilds:s}=E.plugins.MessageLogger,l=U.getCurrentUser().id;return t&&e.author?.bot||o&&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
`)}):(me(o.channel.id,{content:`${ir} The tag **${e.name}** does not exist anymore! Please reload ur Discord to fix :)`}),{content:`/${e.name}`}),[XN]:!0},"CustomTags")}var ir,ql,XN,Wl,jl,JN,QN,Im,bb=g(()=>{"use strict";a();ao();Vo();$();A();w();ir="<:luna:1035316192220553236>",ql="MessageTags_TAGS",XN=Symbol("MessageTags"),Wl=()=>Dt(ql).then(e=>e??[]),jl=e=>Dt(ql).then(t=>(t??[]).find(o=>o.name===e)??null),JN=async e=>{let t=await Wl();return t.push(e),io(ql,t),t},QN=async e=>{let t=await Wl();return t=await t.filter(o=>o.name!==e),io(ql,t),t};Im=y({name:"MessageTags",description:"Allows you to save messages and to use them with a simple command.",authors:[m.Luna],options:{clyde:{name:"Clyde message on send",description:"If enabled, clyde will send you an ephemeral message when a tag was used.",type:3,default:!0}},dependencies:["CommandsAPI"],async start(){for(let e of await Wl())Sb(e)},commands:[{name:"tags",description:"Manage all the tags for yourself",inputType:0,options:[{name:"create",description:"Create a new tag",type:1,options:[{name:"tag-name",description:"The name of the tag to trigger the response",type:3,required:!0},{name:"message",description:"The message that you will send when using this tag",type:3,required:!0}]},{name:"list",description:"List all tags from yourself",type:1,options:[]},{name:"delete",description:"Remove a tag from your yourself",type:1,options:[{name:"tag-name",description:"The name of the tag to trigger the response",type:3,required:!0}]},{name:"preview",description:"Preview a tag without sending it publicly",type:1,options:[{name:"tag-name",description:"The name of the tag to trigger the response",type:3,required:!0}]}],async execute(e,t){switch(e[0].name){case"create":{let o=lt(e[0].options,"tag-name",""),r=lt(e[0].options,"message","");if(await jl(o))return me(t.channel.id,{content:`${ir} A Tag with the name **${o}** already exists!`});let i={name:o,enabled:!0,message:r};Sb(i),await JN(i),me(t.channel.id,{content:`${ir} Successfully created the tag **${o}**!`});break}case"delete":{let o=lt(e[0].options,"tag-name","");if(!await jl(o))return me(t.channel.id,{content:`${ir} A Tag with the name **${o}** does not exist!`});Cs(o),await QN(o),me(t.channel.id,{content:`${ir} Successfully deleted the tag **${o}**!`});break}case"list":{me(t.channel.id,{embeds:[{title:"All Tags:",description:(await Wl()).map(o=>`\`${o.name}\`: ${o.message.slice(0,72).replaceAll("\\n"," ")}${o.message.length>72?"...":""}`).join(`
`)||`${ir} Woops! There are no tags yet, use \`/tags create\` to create one!`,color:14122879,type:"rich"}]});break}case"preview":{let o=lt(e[0].options,"tag-name",""),r=await jl(o);if(!r)return me(t.channel.id,{content:`${ir} A Tag with the name **${o}** does not exist!`});me(t.channel.id,{content:r.message.replaceAll("\\n",`
`)});break}default:{me(t.channel.id,{content:"Invalid sub-command"});break}}}}]})});function VN(e){let t="";for(let o=0;o<e.length;o++)t+=o%2?e[o].toUpperCase():e[o].toLowerCase();return t}var Am,Tb=g(()=>{"use strict";a();ao();A();w();Am=y({name:"MoreCommands",description:"echo, lenny, mock",authors:[m.Arjix,m.echo,m.Samu],dependencies:["CommandsAPI"],commands:[{name:"echo",description:"Sends a message as Clyde (locally)",options:[Xn],inputType:3,execute:(e,t)=>{let o=lt(e,"message","");me(t.channel.id,{content:o})}},{name:"lenny",description:"Sends a lenny face",options:[Xn],execute:e=>({content:lt(e,"message","")+" ( \u0361\xB0 \u035C\u0296 \u0361\xB0)"})},{name:"mock",description:"mOcK PeOpLe",options:[Ns],execute:e=>({content:VN(lt(e,"message",""))})}]})});var Nm,xb=g(()=>{"use strict";a();ao();A();w();Nm=y({name:"MoreKaomoji",description:"Adds more Kaomoji to discord. \u30FD(\xB4\u25BD`)/",authors:[m.JacobTm],dependencies:["CommandsAPI"],commands:[{name:"dissatisfaction",description:" \uFF1E\uFE4F\uFF1C"},{name:"smug",description:" \u0CA0_\u0CA0"},{name:"happy",description:" \u30FD(\xB4\u25BD`)/"},{name:"crying",description:" \u0CA5_\u0CA5"},{name:"angry",description:" \u30FD(\uFF40\u0414\xB4)\uFF89"},{name:"anger",description:" \u30FD(\uFF4F`\u76BF\u2032\uFF4F)\uFF89"},{name:"joy",description:" <(\uFFE3\uFE36\uFFE3)>"},{name:"blush",description:"\u0AEE \u02F6\u1D54 \u1D55 \u1D54\u02F6 \u10D0"},{name:"confused",description:"(\u2022\u0E34_\u2022\u0E34)?"},{name:"sleeping",description:"(\u1D17_\u1D17)"},{name:"laughing",description:"o(\u2267\u25BD\u2266)o"}].map(e=>({...e,options:[Xn],execute:t=>({content:lt(t,"message","")+e.description})}))})});function tC(e){sr.store.tagSettings??=Cm;let[t,o]=Y(sr.store.tagSettings),r=i=>{o(i),e.setValue(i)};return n(ce,{flexDirection:"column"},Di.map(i=>n(At,{style:{padding:"1em 1em 0"}},n(S.FormTitle,{style:{width:"fit-content"}},n(ee,{text:i.description},({onMouseEnter:s,onMouseLeave:l})=>n("div",{onMouseEnter:s,onMouseLeave:l},i.displayName," Tag ",n(Mn,{type:Mn.Types[i.name]})))),n(ot,{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:z.bottom16}),n(gt,{value:t[i.name]?.showInChat??!0,onChange:s=>{t[i.name].showInChat=s,r(t)},hideBorder:!0},"Show in messages"),n(gt,{value:t[i.name]?.showInNotChat??!0,onChange:s=>{t[i.name].showInNotChat=s,r(t)},hideBorder:!0},"Show in member list and profiles"))))}var eC,Mn,wb,Di,Cm,sr,km,Mb=g(()=>{"use strict";a();$();kt();A();it();w();j();x();eC=P("computePermissions","canEveryoneRole"),Mn=Vt(e=>e.Types?.[0]==="BOT"),wb=(e,t)=>!!e?.webhookId&&t.isNonUserBot(),Di=[{name:"WEBHOOK",displayName:"Webhook",description:"Messages sent by webhooks",condition:wb},{name:"OWNER",displayName:"Owner",description:"Owns the server",condition:(e,t,o)=>de.getGuild(o?.guild_id)?.ownerId===t.id},{name:"ADMINISTRATOR",displayName:"Admin",description:"Has the administrator permission",permissions:["ADMINISTRATOR"]},{name:"MODERATOR_STAFF",displayName:"Staff",description:"Can manage the server, channels or roles",permissions:["MANAGE_GUILD","MANAGE_CHANNELS","MANAGE_ROLES"]},{name:"MODERATOR",displayName:"Mod",description:"Can manage messages or kick/ban people",permissions:["MANAGE_MESSAGES","KICK_MEMBERS","BAN_MEMBERS"]},{name:"VOICE_MODERATOR",displayName:"VC Mod",description:"Can manage voice chats",permissions:["MOVE_MEMBERS","MUTE_MEMBERS","DEAFEN_MEMBERS"]}],Cm=Object.fromEntries(Di.map(({name:e,displayName:t})=>[e,{text:t,showInChat:!0,showInNotChat:!0}]));sr=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:tC,description:"fill me"}}),km=y({name:"MoreUserTags",description:"Adds tags for webhooks and moderative roles (owner, admin, etc.)",authors:[m.Cyn,m.TheSun,m.RyanCaoDev,m.LordElias,m.AutumnVN],settings:sr,patches:[{find:"BotTagTypes:",replacement:{match:/\((\i)=\{\}\)\)\[(\i)\.BOT/,replace:"($1=
2023-11-14 11:41:09 -06:00
position: relative;
}
2024-01-10 23:19:19 -06:00
`,classNames:{},dom:null});Um="src/plugins/noMosaic/styles.css"});var $m,Gm,Db=g(()=>{"use strict";a();$();rt();A();w();Rb();$m=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"}]}}),Gm=y({name:"NoMosaic",authors:[m.AutumnVN],description:"Removes Discord new image mosaic",tags:["image","mosaic","media"],settings:$m,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:()=>$m.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 $m.store.mediaLayoutType},start(){xt(Um)},stop(){jt(Um)}})});var gC,Xs,Hm,Lb=g(()=>{"use strict";a();$();A();w();j();gC=P("getMessageRequestsCount"),Xs=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}}),Hm=y({name:"NoPendingCount",description:"Removes the ping count of incoming friend requests, message requests, and nitro offers.",authors:[m.amia],settings:Xs,patches:[{find:"getPendingCount(){",predicate:()=>Xs.store.hideFriendRequestsCount,replacement:{match:/(?<=getPendingCount\(\)\{)/,replace:"return 0;"}},{find:"getMessageRequestsCount(){",predicate:()=>Xs.store.hideMessageRequestsCount,replacement:{match:/(?<=getMessageRequestsCount\(\)\{)/,replace:"return 0;"}},{find:".getSpamChannelsCount(),",predicate:()=>Xs.store.hideMessageRequestsCount,replacement:{match:/(?<=getSpamChannelsCount\(\),\i=)\i\.getMessageRequestsCount\(\)/,replace:"$self.getRealMessageRequestCount()"}},{find:"showProgressBadge:",predicate:()=>Xs.store.hidePremiumOffersCount,replacement:{match:/(?<=\{unviewedTrialCount:(\i),unviewedDiscountCount:(\i)\}.{0,200}\i=)\1\+\2/,replace:"0"}}],getRealMessageRequestCount(){return gC.getMessageRequestChannelIds().size}})});var zm,Eb=g(()=>{"use strict";a();A();w();zm=y({name:"NoProfileThemes",description:"Completely removes Nitro profile themes",authors:[m.TheKodeToad],patches:[{find:".NITRO_BANNER,",replacement:{match:/=(?=\i\.\i\.isPremiumAtLeast\(null==(\i))/,replace:"=(arguments[0]?.bannerSrc||$1?.banner)&&"}},{find:".avatarPositionPremiumNoBanner,default:",replacement:{match:/\.avatarPositionPremiumNoBanner(?=,default:\i\.(\i))/,replace:".$1"}},{find:"hasThemeColors(){",replacement:{match:/get canUsePremiumProfileCustomization\(\){return /,replace:"$&false &&"}}]})});var Yl,jm,_b=g(()=>{"use strict";a();$();A();w();Yl=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}}),jm=y({name:"NoReplyMention",description:"Disables reply pings by default",authors:[m.DustyAngel47,m.axyie,m.pylix,m.outfoxxed],settings:Yl,shouldMention(e,t){let o=Yl.store.userList.includes(e.author.id),r=Yl.store.shouldPingListed?o:!o;return Yl.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 Ei,aT,kC,RC,Ql,DC,LC,pf,cT=g(()=>{"use strict";a();ao();A();qo();w();j();x();Ei=ba(Fd()),aT=0,kC=20,RC=128,Ql=10,DC=_n(()=>Promise.all(Array.from({length:Ql},(e,t)=>lT(`https://raw.githubusercontent.com/VenPlugs/petpet/main/frames/pet${t}.gif`)))),LC=P("getUploads");pf=y({name:"petpet",description:"Adds a /petpet slash command to create headpet gifs from any image",authors:[m.Ven],dependencies:["CommandsAPI"],commands:[{inputType:0,name:"petpet",description:"Create a petpet gif. You can only specify one of the image options",options:[{name:"delay",description:"The delay between each frame. Defaults to 20.",type:4},{name:"resolution",description:"Resolution for the gif. Defaults to 120. If you enter an insane number and it freezes Discord that's your fault.",type:4},{name:"image",description:"Image attachment to use",type:11},{name:"url",description:"URL to fetch image from",type:3},{name:"user",description:"User whose avatar to use as image",type:6},{name:"no-server-pfp",description:"Use the normal avatar instead of the server specific one when using the 'user' option",type:5}],execute:async(e,t)=>{let o=await DC(),r=lt(e,"no-server-pfp",!1);try{var i=await EC(e,t,r);if(!i)throw"No Image specified!"}catch(v){me(t.channel.id,{content:String(v)});return}let s=await lT(i),l=lt(e,"delay",kC),c=lt(e,"resolution",RC),u=(0,Ei.GIFEncoder)(),p=document.createElement("canvas");p.width=p.height=c;let d=p.getContext("2d");for(let v=0;v<Ql;v++){d.clearRect(0,0,p.width,p.height);let T=v<Ql/2?v:Ql-v,N=.8+T*.02,b=.8-T*.05,I=(1-N)*.5+.1,k=1-b-.08;d.drawImage(s,I*c,k*c,N*c,b*c),d.drawImage(o[v],0,0,c,c);let{data:M}=d.getImageData(0,0,c,c),F=(0,Ei.quantize)(M,256),H=(0,Ei.applyPalette)(M,F);u.writeFrame(H,c,c,{transparent:!0,palette:F,delay:l})}u.finish();let h=new File([u.bytesView()],"petpet.gif",{type:"image/gif"});setTimeout(()=>rs.promptToUpload([h],t.channel,aT),10)}}]})});var uT=g(()=>{});var pT,df,dT=g(()=>{"use strict";a();uT();$();ae();A();w();x();pT=D({loop:{description:"Whether to make the PiP video loop or not",type:3,default:!0,restartNeeded:!1}}),df=y({name:"PictureInPicture",description:"Adds picture in picture to videos (next to the Download button)",authors:[m.Lumap],settings:pT,patches:[{find:".nonMediaAttachment]",replacement:{match:/\.nonMediaAttachment\]:!(\i).{0,10}children:\[(\S)/,replace:"$&,$1&&$2&&$self.renderPiPButton(),"}}],renderPiPButton:B.wrap(()=>n(ee,{text:"Toggle Picture in Picture"},e=>n("div",{...e,className:"vc-pip-button",role:"button",style:{cursor:"pointer",paddingTop:"4px",paddingLeft:"4px",paddingRight:"4px"},onClick:t=>{let o=t.currentTarget.parentNode.parentNode.querySelector("video"),r=document.body.appendChild(o.cloneNode(!0));r.loop=pT.store.loop,r.style.display="none",r.onleavepictureinpicture=()=>r.remove();function i(){r.currentTime=o.currentTime,r.requestPictureInPicture(),o.pause(),r.play()}r.readyState===4?i():r.onloadedmetadata=i}},n("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24"},n("path",{fill:"currentColor",d:"M21 3a1 1 0 0 1 1 1v7h-2V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h18zm0 10a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1h8zm-1 2h-6v4h6v-4z"})))),{noop:!0})})});function gT(){return mt(["plugins.PinDMs.pinnedDMs"]),Vl()}function _i(e){return Vl().has(e)}function hT(e){let t=Vl();t.delete(e)||t.add(e),fT([...t])}function ff(){return Vl(),ta.store.pinOrder===0?_C.getPrivateChannelIds().filter(_i):sn}function yT(e){return ff()[e]}function gf(e,t){let o=mT(),r=o.indexOf(e),i=r+t;[o[r],o[i]]=[o[i],o[r]],fT(o)}var ta,_C,sn,mf,mT,fT,OC,Vl,hf=g(()=>{"use strict";a();$();w();j();ta=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}]}}),_C=Re("PrivateChannelSortStore"),mT=()=>(E.plugins.PinDMs.pinnedDMs||void 0)?.split(","),fT=e=>{mf=void 0,E.plugins.PinDMs.pinnedDMs=e.join(",")},OC=()=>(sn=mT()??[],mf=new Set(sn)),Vl=()=>mf??OC()});func
`,t))},stop(){Ff=void 0},decodeError(e,...t){let o=0;return Ff?.[e]?.replace(/%s/g,()=>{let r=t[o];return o++,r})}})});var Gf={};ze(Gf,{ServerListRenderPosition:()=>uc,addServerListElement:()=>oa,removeServerListElement:()=>na,renderAll:()=>uk});function $f(e){return e===0?lk:ck}function oa(e,t){$f(e).add(t)}function na(e,t){$f(e).delete(t)}var ak,uc,lk,ck,uk,pc=g(()=>{"use strict";a();Ve();ak=new ie("ServerListAPI"),uc=(o=>(o[o.Above=0]="Above",o[o.In=1]="In",o))(uc||{}),lk=new Set,ck=new Set;uk=e=>{let t=[];for(let o of $f(e))try{t.unshift(o())}catch(r){ak.error("Failed to render server list element:",r)}return t}});function pk(){let e=[];Object.values(de.getGuilds()).forEach(t=>{ii.getChannels(t.id).SELECTABLE.forEach(o=>{!xr.hasUnread(o.channel.id)||e.push({channelId:o.channel.id,messageId:xr.lastMessageId(o.channel.id),readStateType:0})})}),O.dispatch({type:"BULK_ACK",context:"APP",channels:e})}var dk,Hf,nx=g(()=>{"use strict";a();pc();A();w();x();dk=()=>n(C,{onClick:pk,size:C.Sizes.MIN,color:C.Colors.BRAND,style:{marginTop:"2px",marginBottom:"8px",marginLeft:"9px"}},"Read all"),Hf=y({name:"ReadAllNotificationsButton",description:"Read all server notifications with a single button click!",authors:[m.kemo],dependencies:["ServerListAPI"],renderReadAllButton:()=>n(dk,null),start(){oa(0,this.renderReadAllButton)},stop(){na(0,this.renderReadAllButton)}})});var co,dc=g(()=>{"use strict";a();$();w();co=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 zf=g(()=>{"use strict";a()});async function gk(){wt.delMany(["relationship-notifier-guilds","relationship-notifier-groups","relationship-notifier-friends"])}async function jf(){await gk();let[e,t,o]=await wt.getMany([rx(),ix(),sx()]);if(await Promise.all([fc(),gc(),ra()]),co.store.offlineRemovals){if(co.store.groups&&t?.size)for(let[r,i]of t)Fi.has(r)||In(`You are no longer in the group ${i.name}.`,i.iconURL);if(co.store.servers&&e?.size)for(let[r,i]of e)Bi.has(r)||In(`You are no longer in the server ${i.name}.`,i.iconURL);if(co.store.friends&&o?.friends.length)for(let r of o.friends){if(qr.friends.includes(r))continue;let i=await Ct.getUser(r).catch(()=>{});i&&In(`You are no longer friends with ${Tn(i)}.`,i.getAvatarURL(void 0,void 0,!1),()=>Ho(i.id))}if(co.store.friendRequestCancels&&o?.requests?.length)for(let r of o.requests){if(qr.requests.includes(r)||[1,2,4].includes(st.getRelationshipType(r)))continue;let i=await Ct.getUser(r).catch(()=>{});i&&In(`Friend request from ${Tn(i)} has been revoked.`,i.getAvatarURL(void 0,void 0,!1),()=>Ho(i.id))}}}function In(e,t,o){co.store.notices&&mc.showNotice(e,"OK",()=>mc.popNotice()),De({title:"Relationship Notifier",body:e,icon:t,onClick:o})}function ax(e){return Bi.get(e)}function Wf(e){Bi.delete(e),fc()}async function fc(){Bi.clear();let e=U.getCurrentUser().id;for(let[t,{name:o,icon:r}]of Object.entries(de.getGuilds()))Oe.isMember(t,e)&&Bi.set(t,{id:t,name:o,iconURL:r&&`https://cdn.discordapp.com/icons/${t}/${r}.png`});await wt.set(rx(),Bi)}function lx(e){return Fi.get(e)}function qf(e){Fi.delete(e),gc()}async function gc(){Fi.clear();for(let{type:e,id:t,name:o,rawRecipients:r,icon:i}of Q.getSortedPrivateChannels())e===3&&Fi.set(t,{id:t,name:o||r.map(s=>s.username).join(", "),iconURL:i&&`https://cdn.discordapp.com/channel-icons/${t}/${i}.png`});await wt.set(ix(),Fi)}async function ra(){qr.friends=[],qr.requests=[];let e=st.getRelationships();for(let t in e)switch(e[t]){case 1:qr.friends.push(t);break;case 3:qr.requests.push(t);break}await wt.set(sx(),qr)}var Bi,Fi,qr,rx,ix,sx,
2023-11-14 11:41:09 -06:00
import React from "react";
const handleClick = async () =>
console.log((await import("@webpack/common")).Clipboard.copy("\\u200b"));
export const Example: React.FC<{
real: boolean,
shigged?: number,
}> = ({ real, shigged }) => <>
<p>{\`Shigg\${real ? \`ies\${shigged === 0x1B ? "t" : ""}\` : "y"}\`}</p>
<button onClick={handleClick}>Click Me</button>
</>;
2024-01-10 23:19:19 -06:00
`});var Zx=vr((iee,lg)=>{"use strict";a();var Nk=Object.prototype.hasOwnProperty,Xt="~";function aa(){}Object.create&&(aa.prototype=Object.create(null),new aa().__proto__||(Xt=!1));function Ck(e,t,o){this.fn=e,this.context=t,this.once=o||!1}function Yx(e,t,o,r,i){if(typeof o!="function")throw new TypeError("The listener must be a function");var s=new Ck(o,r||e,i),l=Xt?Xt+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 Sc(e,t){--e._eventsCount===0?e._events=new aa:delete e._events[t]}function Gt(){this._events=new aa,this._eventsCount=0}Gt.prototype.eventNames=function(){var t=[],o,r;if(this._eventsCount===0)return t;for(r in o=this._events)Nk.call(o,r)&&t.push(Xt?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(o)):t};Gt.prototype.listeners=function(t){var o=Xt?Xt+t:t,r=this._events[o];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,l=new Array(s);i<s;i++)l[i]=r[i].fn;return l};Gt.prototype.listenerCount=function(t){var o=Xt?Xt+t:t,r=this._events[o];return r?r.fn?1:r.length:0};Gt.prototype.emit=function(t,o,r,i,s,l){var c=Xt?Xt+t:t;if(!this._events[c])return!1;var u=this._events[c],p=arguments.length,d,h;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,o),!0;case 3:return u.fn.call(u.context,o,r),!0;case 4:return u.fn.call(u.context,o,r,i),!0;case 5:return u.fn.call(u.context,o,r,i,s),!0;case 6:return u.fn.call(u.context,o,r,i,s,l),!0}for(h=1,d=new Array(p-1);h<p;h++)d[h-1]=arguments[h];u.fn.apply(u.context,d)}else{var v=u.length,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,o);break;case 3:u[h].fn.call(u[h].context,o,r);break;case 4:u[h].fn.call(u[h].context,o,r,i);break;default:if(!d)for(T=1,d=new Array(p-1);T<p;T++)d[T-1]=arguments[T];u[h].fn.apply(u[h].context,d)}}return!0};Gt.prototype.on=function(t,o,r){return Yx(this,t,o,r,!1)};Gt.prototype.once=function(t,o,r){return Yx(this,t,o,r,!0)};Gt.prototype.removeListener=function(t,o,r,i){var s=Xt?Xt+t:t;if(!this._events[s])return this;if(!o)return Sc(this,s),this;var l=this._events[s];if(l.fn)l.fn===o&&(!i||l.once)&&(!r||l.context===r)&&Sc(this,s);else{for(var c=0,u=[],p=l.length;c<p;c++)(l[c].fn!==o||i&&!l[c].once||r&&l[c].context!==r)&&u.push(l[c]);u.length?this._events[s]=u.length===1?u[0]:u:Sc(this,s)}return this};Gt.prototype.removeAllListeners=function(t){var o;return t?(o=Xt?Xt+t:t,this._events[o]&&Sc(this,o)):(this._events=new aa,this._eventsCount=0),this};Gt.prototype.off=Gt.prototype.removeListener;Gt.prototype.addListener=Gt.prototype.on;Gt.prefixed=Xt;Gt.EventEmitter=Gt;typeof lg<"u"&&(lg.exports=Gt)});var dg=vr(Ui=>{"use strict";a();Object.defineProperty(Ui,"__esModule",{value:!0});Ui.Channel=Ui.ChannelPort=void 0;var kk=Zx(),bc="vapIpc",cg=Symbol.for("vapIpc.edgeCreate"),ug=class{_pipes=new Map;_listeners=new Map;_createListenerMap(){return new Map}_emit(t,o,...r){for(let[i,s]of this._listeners.entries()){if(i===t)continue;let l=s.get(o);l&&l(...r)}}createPipe(t){let o=this.getPipe(t);if(o)return o;let r=this._createListenerMap();this._listeners.set(t,r);let i={emit:this._emit.bind(this,t),listen:(s,l)=>void r.set(s,l)};return this._pipes.set(t,i),i}getPipe(t){return this._pipes.get(t)??null}};Ui.ChannelPort=ug;var pg=class{id;_edges=new Map;_callbacks=new Map;_callers=new Map;_edgePipes=new Map;_pipes=[];_emitter=new kk.EventEmitter;_logger;_destroyed=!1;constructor(t){this.id=t}addPipe(t){t.listen(`${bc}:handshake`,o=>{this._handleHandshake(t,o)}),t.listen(`${bc}:message`,o=>{this._handleMessage(t,o)}),this._pipes.push(t),this._logger?.log(`Adding pipe to channel "${this.id}"`)}setLogger(t){this._logger=t}_handleHandshake(t,o){if(this.id===o.id)return;this._logger?.log(`\u{1F91D} "${o.id}" -> "${this.id}" (edges: [${o.channelIds.join(", ")}])`);let r=this._edges.get(o.id);if(r){let i=o.channelIds.filter(s=>!r?.channelIds.inclu
`,classNames:{},dom:null});ca="src/plugins/shikiCodeblocks.desktop/devicon.css"});var ua=g(()=>{"use strict";a()});var Gk,ur,Mg=g(()=>{"use strict";a();$();rt();Pe();vn();w();la();Tg();wg();ua();Gk=Object.keys(Nn),ur=D({theme:{type:4,description:"Default themes",options:Gk.map(e=>({label:yn(sp(e)),value:Nn[e],default:Nn[e]===Nn.DarkPlus})),onChange:ve.setTheme},customTheme:{type:0,description:"A link to a custom vscode theme",placeholder:Nn.MaterialCandy,onChange:e=>{ve.setTheme(e||ur.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"?jt(ca):xt(ca)}},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=iu(e);return t?t.pathname.endsWith(".json")?!0:"Must be a json file":"Must be a valid URL"}}})});function aw(e,t){let o=ur.use(e),[r,i]=_.useState(!1),s={...o,...t},l=s.customTheme||s.theme;if(t){let c=ve.currentThemeUrl&&l&&l!==ve.currentThemeUrl,u=Object.keys(t).length===0;r&&(!c||u)&&i(!1),!r&&c&&(i(!0),ve.setTheme(l))}return{...s,isThemeLoading:l!==ve.currentThemeUrl}}var lw=g(()=>{"use strict";a();x();la();Mg()});function cw(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 uw=g(()=>{"use strict";a()});var Wo,pw,pa=g(()=>{"use strict";a();rt();x();xc();ua();Wo=Fe("shiki-"),pw=({lang:e,tryHljs:t})=>{let o=e?wr?.getLanguage?.(e):null,i=(e?Kr(e):null)?.name;switch(t){case"ALWAYS":return!0;case"PRIMARY":return!!o||e==="";case"SECONDARY":return!i&&!!o;case"NEVER":return!1;default:return!1}}});function dw(e){let[t,o]=_.useState(!1);function r(i){$t.copy(i),o(!0),setTimeout(()=>{o(!1)},e)}return[t,r]}var mw=g(()=>{"use strict";a();x()});function fw({content:e,...t}){let[o,r]=dw(1e3);return n("button",{...t,style:{...t.style,cursor:o?"default":void 0},onClick:()=>r(e)},o?"Copied!":"Copy")}var gw=g(()=>{"use strict";a();mw()});function hw({content:e,theme:t}){let o=[];return $t.SUPPORTS_COPY&&o.push(n(fw,{content:e,className:Wo("btn"),style:{backgroundColor:t.accentBgColor,color:t.accentFgColor}})),n("div",{className:Wo("btns")},o)}var yw=g(()=>{"use strict";a();x();pa();gw()});var vw,Sw=g(()=>{"use strict";a();x();pa();vw=({theme:e,useHljs:t,lang:o,content:r,tokens:i})=>{let s;if(t)try{let{value:c}=wr.highlight(o,r,!0);s=c.split(`
`).map((u,p)=>n("span",{key:p,dangerouslySetInnerHTML:{__html:u}}))}catch{s=r.split(`
`).map(c=>n("span",null,c))}else s=(i??r.split(`
`).map(u=>[{color:e.plainColor,content:u}])).map(u=>u.length===0?n("span",null,`
`):n(f,null,u.map(({content:p,color:d,fontStyle:h},v)=>n("span",{key:v,style:{color:d,fontStyle:(h??0)&1?"italic":void 0,fontWeight:(h??0)&2?"bold":void 0,textDecoration:(h??0)&4?"underline":void 0}},p))));let l=s.map((c,u)=>n("tr",{key:u},n("td",{style:{color:e.plainColor}},u+1),n("td",null,c)));return n("table",{className:Wo("table")},...l)}});function bw({langName:e,useDevIcon:t,shikiLang:o}){return e?n("div",{className:Wo("lang")},t!=="DISABLED"&&o?.devicon&&n("i",{className:`${Wo("devicon")} devicon-${o.devicon}${t==="COLOR"?" colored":""}`}),e):n(f,null)}var Tw=g(()=>{"use strict";a();ua();pa()});var wc,Hk,xw=g(()=>{"use strict";a();ae();ut();x();xc();la();lw();bg();uw();pa();yw();Sw();Tw();wc=e=>n("pre",{className:Wo("container")},n(B,null,n(Hk,{...e}))),Hk=({lang:e,content:t,isPreview:o,tempSettings:r})=>{let{tryHljs:i,useDevIcon:s,bgOpacity:l}=aw(["tryHljs","useDevIcon","bgOpacity"],r),{id:c,theme:u}=ew(),p=e?Kr(e):null,d=pw({lang:e,tryHljs:i}),[h,v]=au(!0),[T]=at(async()=>!p||d||!v?null:await ve.tokenizeCode(t,e),{fallbackValue:null,deps:[e,t,c,v]}),N={plainColor:u?.fg||"var(--text-normal)",accentBgColor:u?.colors?.["statusBar.background"]||(d?"#7289da":"#007BC8"),accentFgColor:u?.colors?.["statusBar.foreground"]||"#FFF",backgroundColor:u?.colors?.["editor.background"]||"var(--background-secondary)"},b;return e&&(b=d?wr?.getLanguage?.(e)?.name:p?.name),n("div",{ref:h,className:Wo("root",{plain:!b,preview:o}),style:{backgroundColor:d?N.backgroundColor:`rgba(${cw(N.backgroundColor).concat(l/100).join(", ")})`,color:N.plainColor}},n("code",null,n(bw,{langName:b,useDevIcon:s,shikiLang:p}),n(vw,{theme:N,useHljs:d,lang:e,content:t,tokens:T}),!o&&n(hw,{content:t,theme:N})))}});var ww,Mw,Pw=g(()=>{"use strict";a();ww=new Map,Mw=()=>{ww.forEach(e=>e.remove()),ww.clear()}});var Pg,Iw=g(()=>{"use strict";a();Wx();rt();A();w();Kx();la();xw();wg();Mg();ua();Pw();Pg=y({name:"ShikiCodeblocks",description:"Brings vscode-style codeblocks into Discord, powered by Shiki",authors:[m.Vap],patches:[{find:"codeBlock:{react(",replacement:{match:/codeBlock:\{react\((\i),(\i),(\i)\)\{/,replace:"$&return $self.renderHighlighter($1,$2,$3);"}},{find:".PREVIEW_NUM_LINES",replacement:{match:/(?<=function \i\((\i)\)\{)(?=let\{text:\i,language:)/,replace:"return $self.renderHighlighter({lang:$1.language,content:$1.text});"}}],start:async()=>{ur.store.useDevIcon!=="DISABLED"&&xt(ca),await ve.init(ur.store.customTheme||ur.store.theme)},stop:()=>{ve.destroy(),Mw()},settingsAboutComponent:({tempSettings:e})=>wc({lang:"tsx",content:qx,isPreview:!0,tempSettings:e}),settings:ur,shiki:ve,createHighlighter:wc,renderHighlighter:({lang:e,content:t})=>wc({lang:e?.toLowerCase(),content:t,isPreview:!1})})});var Ig,Aw=g(()=>{"use strict";a();A();w();Ig=y({name:"ShowAllMessageButtons",description:"Always show all message buttons no matter if you are holding the shift key or not.",authors:[m.Nuckyz],patches:[{find:".Messages.MESSAGE_UTILITIES_A11Y_LABEL",replacement:{match:/isExpanded:\i&&(.+?),/,replace:"isExpanded:$1,"}}]})});var Nw=g(()=>{});function kw(){let e=Vi(Cw.colors.INTERACTIVE_MUTED).hex(),t=Vi(Cw.colors.INTERACTIVE_ACTIVE).hex();return n(zk,{color:e,forcedIconColor:t,size:16,tooltipText:et.Messages.CONNECTION_VERIFIED})}var Cw,zk,Rw=g(()=>{"use strict";a();j();x();Cw=Vt(e=>e.colors?.INTERACTIVE_MUTED?.css),zk=je(".CONNECTIONS_ROLE_OFFICIAL_ICON_TOOLTIP")});function Dw({id:e,theme:t}){let o=po.getUserProfile(e);if(!o)return null;let r=o.connectedAccounts;return r?.length?n(jk,null,n(J,{tag:"h2",variant:"eyebrow",style:{color:"var(--header-primary)"}},"Connections"),n(ce,{style:{marginTop:"8px",gap:Zk(Mc.store.iconSpacing),flexWrap:"wrap"}},r.map(i=>n(Qk,{connection:i,theme:t})))):null}function Qk({connection:e,theme:t}){let o=Kk.get(qk.useLegacyPlatformType(e.type)),r=o.getPlatformUserUrl?.(e),i=n("img",{"aria-label":e.name,src:t==="light"?o.icon.lightSVG:o.icon.darkSVG,style:{width:Mc.store.iconSize,height:Mc.store.iconSize}}),s=r?hi:rl;return n(ee,{text:n("span",{className:"vc-sc-tooltip"},e.name,e.verified&&n(kw,null),n(s,{height:16,width:16}))
2023-11-14 11:41:09 -06:00
height: 0;
opacity: 0;
pointer-events: none;
transition: 0.2s;
transition-property: height;
}
#vc-spotify-player:hover .vc-spotify-button-row {
opacity: 1;
height: 32px;
pointer-events: auto;
/* only transition opacity on show to prevent clipping */
transition-property: height, opacity;
}
2024-01-10 23:19:19 -06:00
`,classNames:{},dom:null});qw="src/plugins/spotifyControls/hoverOnly.css"});var Yw=g(()=>{});var Ke,Zw=g(()=>{"use strict";a();$();j();x();Ke=No(()=>{let{Store:e}=Jc,t=Ji("getActiveSocketAndDevice"),o=Ji("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,d)=>d===0?"":":"):"https://open.spotify.com"+c;VencordNative.native.openExternal(u)}get position(){let c=this.mPosition;return this.isPlaying&&(c+=Date.now()-this.start),c}set position(c){this.mPosition=c,this.start=Date.now()}prev(){this.req("post","/previous")}next(){this.req("post","/next")}setVolume(c){this.req("put","/volume",{query:{volume_percent:Math.round(c)}}).then(()=>{this.volume=c,this.emitChange()})}setPlaying(c){this.req("put",c?"/play":"/pause")}setRepeat(c){this.req("put","/repeat",{query:{state:c}})}setShuffle(c){this.req("put","/shuffle",{query:{state:c}}).then(()=>{this.shuffle=c,this.emitChange()})}seek(c){return this.isSettingPosition?Promise.resolve():(this.isSettingPosition=!0,this.req("put","/seek",{query:{position_ms:Math.round(c)}}).catch(u=>{console.error("[VencordSpotifyControls] Failed to seek",u),this.isSettingPosition=!1}))}req(c,u,p={}){this.device?.is_active&&((p.query??={}).device_id=this.device.id);let{socket:d}=t.getActiveSocketAndDevice();return o.SpotifyAPI[c](d.accountId,d.accessToken,{url:r+u,...p})}}let s=new i(O,{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 Bg(e){let t=e/1e3/60,o=Math.floor(t),r=Math.floor((t-o)*60);return`${o.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}function zi(e,t){return()=>n("svg",{className:te(Qe("button-icon"),Qe(t)),height:"24",width:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-label":t,focusable:!1},n("path",{d:e}))}function ma(e){return n("button",{className:Qe("button"),...e},e.children)}function vR({name:e,path:t}){let o=`spotify-copy-${e}`,r=`spotify-open-${e}`;return n(G.Menu,{navId:`spotify-${e}-menu`,onClose:()=>O.dispatch({type:"CONTEXT_MENU_CLOSE"}),"aria-label":`Spotify ${e} Menu`},n(G.MenuItem,{key:o,id:o,label:`Copy ${e} Link`,action:()=>vo("https://open.spotify.com"+t),icon:hi}),n(G.MenuItem,{key:r,id:r,label:`Open ${e} in Spotify`,action:()=>Ke.openExternal(t),icon:Ms}))}function SR(e,t){return o=>Ut.openContextMenu(o,()=>n(vR,{name:e,path:t}))}function bR(){let[e,t,o]=Ye([Ke],()=>[Ke.isPlaying,Ke.shuffle,Ke.repeat]),[r,i]=(()=>{switch(o){case"off":return["context","repeat-off"];case"context":return["track","repeat-context"];case"track":return["off","repeat-track"];default:throw new Error(`Invalid repeat state ${o}`)}})();return n(ce,{className:Qe("button-row"),style:{gap:0}},n(ma,{className:te(Qe("button"),Qe(t?"shuffle-on":"shuffle-off")),onClick:()=>Ke.setShuffle(!t)},n(yR,null)),n(ma,{onClick:()=>Ke.prev()},n(fR,null)),n(ma,{onClick:()=>Ke.setPlaying(!e)},e?n(mR,null):n(dR,null)),n(ma,{onClick:()=>Ke.next()},n(gR,null)),n(ma,{className:te(Qe("button"),Qe(i)),onClick:()=>Ke.setRepeat(r),style:{position:"relative"}},o==="track"&&n("span",{className:Qe("repeat-1")},"1"),n(hR,null)))}function xR(){let{duration:e}=Ke.track,[t,o,r]=Ye([Ke],()=>[Ke.mPosition,Ke.isSettingPosition,Ke.isPlaying]),[i,s]=Y(t);return pe(()=>{if(r&&!o){s(Ke.position);let l=setInterval(()=>{s(c=>c+1e3)},1e3);return()=>clearInterval(l)}},[t,o,r]),n("div",{id:Qe("progress-bar")},n(S.FormText,{variant:"text-xs/medium",className:Qe("progress-time")+" "+Qe("time-left"),"aria-label":"Progress"},Bg(i)),n(G.MenuSliderControl,{minValue:0,maxValue:e,value:i,onChange:l=>{o||(s(l),TR(l))},renderValue:Bg}),n(S.FormText,{variant:"text-xs/medium",className:
`);return n(S.FormSection,{title:"Server Trace",tag:"h2"},n("code",null,n(ce,{flexDirection:"column",style:{color:"var(--header-primary)",gap:5,userSelect:"text"}},t.map(o=>n("span",null,o)))))}function CR(){if(!fa?.logs)return n("div",null,"Loading...");let e=fa.logGroups.find(t=>t.serverTrace)?.serverTrace;return n(_.Fragment,null,n(AR,{title:"Startup Timings",logs:fa.logs,traceEnd:fa.endTime_}),n("div",{style:{marginTop:5}},"\xA0"),e&&n(NR,{trace:e}))}var fa,kR,n2=g(()=>{"use strict";a();ae();kt();j();x();fa=P("markWithDelta","markAndLog","markAt");kR=B.wrap(CR)});var Wg,r2=g(()=>{"use strict";a();A();ut();w();Wg=y({name:"StartupTimings",description:"Adds Startup Timings to the Settings menu",authors:[m.Megu],patches:[{find:"UserSettingsSections.PAYMENT_FLOW_MODAL_TEST_PAGE,",replacement:{match:/{section:\i\.UserSettingsSections\.PAYMENT_FLOW_MODAL_TEST_PAGE/,replace:'{section:"StartupTimings",label:"Startup Timings",element:$self.StartupTimingPage},$&'}}],StartupTimingPage:It(()=>(n2(),En(o2)).default)})});var qg,Kg,i2=g(()=>{"use strict";a();$();A();w();qg=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}}}),Kg=y({name:"SuperReactionTweaks",description:"Customize the limit of Super Reactions playing at once, and super react by default",authors:[m.FieryFlames,m.ant0n],patches:[{find:",BURST_REACTION_EFFECT_PLAY",replacement:{match:/(?<=BURST_REACTION_EFFECT_PLAY:\i=>{.{50,100})(\i\(\i,\i\))>=\d+/,replace:"!$self.shouldPlayBurstReaction($1)"}},{find:".trackEmojiSearchEmpty,200",replacement:{match:/(\.trackEmojiSearchEmpty,200(?=.+?isBurstReaction:(\i).+?(\i===\i\.EmojiIntention.REACTION)).+?\[\2,\i\]=\i\.useState\().+?\)/,replace:(e,t,o,r)=>`${t}$self.settings.store.superReactByDefault&&${r})`}}],settings:qg,shouldPlayBurstReaction(e){return!!(qg.store.unlimitedSuperReactionPlaying||e<=qg.store.superReactionPlayingLimit)}})});function u2(e){let t=e.match(/^(\/)?(.+?)(?:\/([gimsuy]*))?$/);return t?new RegExp(t[2],t[3]?.split("").filter((o,r,i)=>i.indexOf(o)===r).join("")??"g"):new RegExp(e)}function DR(e){try{return u2(e),null}catch(t){return n("span",{style:{color:"var(--text-danger)"}},String(t))}}function Yg({initialValue:e,onChange:t,placeholder:o}){let[r,i]=Y(e);return n(ot,{placeholder:o,value:r,onChange:i,spellCheck:!1,onBlur:()=>r!==e&&t(r)})}function s2({title:e,rulesArray:t,rulesKey:o,update:r}){let i=e==="Using Regex";async function s(c){c!==t.length-1&&(t.splice(c,1),await wt.set(o,t),r())}async function l(c,u,p){u===t.length-1&&t.push(c2()),t[u][p]=c,t[u].find===""&&t[u].replace===""&&t[u].onlyIfIncludes===""&&u!==t.length-1&&t.splice(u,1),await wt.set(o,t),r()}return n(f,null,n(S.FormTitle,{tag:"h4"},e),n(ce,{flexDirection:"column",style:{gap:"0.5em"}},t.map((c,u)=>n(_.Fragment,{key:`${c.find}-${u}`},n(ce,{flexDirection:"row",style:{gap:0}},n(ce,{flexDirection:"row",style:{flexGrow:1,gap:"0.5em"}},n(Yg,{placeholder:"Find",initialValue:c.find,onChange:p=>l(p,u,"find")}),n(Yg,{placeholder:"Replace",initialValue:c.replace,onChange:p=>l(p,u,"replace")}),n(Yg,{placeholder:"Only if includes",initialValue:c.onlyIfIncludes,onChange:p=>l(p,u,"onlyIfIncludes")})),n(C,{size:C.Sizes.MIN,onClick:()=>s(u),style:{background:"none",color:"var(--status-danger)",...u===t.length-1?{visibility:"hidden",pointerEvents:"none"}:{}}},n(ll,null))),i&&DR(c.find)))))}function LR(){let[e,t]=Y("");return n(f,null,n(S.FormTitle,{tag:"h4"},"Test Rules"),n(ot,{placeholder:"Type a message",onChange:t}),n(ot,{placeholder:"Message with rules applied",editable:!1,value:p2(e)}))}function p2(e){if(e.length===0)return e;if(Ic)for(let t of Ic)!t.find||t.onlyIfIncludes&&!e.includes(t.onlyIfIncludes)||(e=` ${e} `.replaceAll(t.find,t.replace.replaceA
`)).replace(/^\s|\s$/g,""));if(Ac){for(let t of Ac)if(!!t.find&&!(t.onlyIfIncludes&&!e.includes(t.onlyIfIncludes)))try{let o=u2(t.find);e=e.replace(o,t.replace.replaceAll("\\n",`
`))}catch{new ie("TextReplace").error(`Invalid regex: ${t.find}`)}}return e=e.trim(),e}var a2,l2,c2,Pc,Ic,Ac,RR,ER,Zg,d2=g(()=>{"use strict";a();Ti();on();$();kt();Lt();A();Ve();ut();w();x();a2="TextReplace_rulesString",l2="TextReplace_rulesRegex",c2=()=>({find:"",replace:"",onlyIfIncludes:""}),Pc=()=>[c2()],Ic=Pc(),Ac=Pc(),RR=D({replace:{type:6,description:"",component:()=>{let e=Un();return n(f,null,n(s2,{title:"Using String",rulesArray:Ic,rulesKey:a2,update:e}),n(s2,{title:"Using Regex",rulesArray:Ac,rulesKey:l2,update:e}),n(LR,null))}}});ER="1102784112584040479",Zg=y({name:"TextReplace",description:"Replace text in your messages. You can find pre-made rules in the #textreplace-rules channel in Vencord's Server",authors:[m.AutumnVN,m.TheKodeToad],dependencies:["MessageEventsAPI"],settings:RR,async start(){Ic=await wt.get(a2)??Pc(),Ac=await wt.get(l2)??Pc(),this.preSend=Kt((e,t)=>{e!==ER&&(t.content=p2(t.content))})},stop(){Yt(this.preSend)}})});var Xg,m2=g(()=>{"use strict";a();A();w();x();Xg=y({name:"ThemeAttributes",description:"Adds data attributes to various elements for theming purposes",authors:[m.Ven],patches:[{find:".tabBarRef",replacement:{match:/style:this\.getStyle\(\),role:"tab"/,replace:"$&,'data-tab-id':this.props.id"}},{find:".messageListItem",replacement:{match:/\.messageListItem(?=,"aria)/,replace:"$&,...$self.getMessageProps(arguments[0])"}}],getMessageProps(e){let t=e.message?.author?.id;return{"data-author-id":t,"data-is-self":t&&t===U.getCurrentUser()?.id}}})});var Jg,f2=g(()=>{"use strict";a();A();w();Jg=y({name:"TimeBarAllActivities",description:"Adds the Spotify time bar to all activities if they have start and end timestamps",authors:[m.obscurity],patches:[{find:"}renderTimeBar(",replacement:{match:/renderTimeBar\((.{1,3})\){.{0,50}?let/,replace:"renderTimeBar($1){let"}}]})});var g2=g(()=>{});var Ht,ga=g(()=>{"use strict";a();$();w();Ht=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 Nc,Qg=g(()=>{"use strict";a();Nc={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 kn,ya=g(()=>{"use strict";a();rt();ga();kn=Fe("vc-trans-")});function OR({settingsKey:e,includeAuto:t}){let o=Ht.use([e])[e],r=bt(()=>{let i=Object.entries(Nc).map(([s,l])=>({value:s,label:l}));return t||i.shift(),i},[]);return n("section",{className:z.bottom16},n(S.FormTitle,{tag:"h3"},Ht.def[e].description),n(Da,{options:r,value:r.find(i=>i.value===o),placeholder:"Select a language",maxVisibleItems:5,closeOnSelect:!0,onChange:i=>Ht.store[e]=i}))}function BR(){let e=Ht.use(["autoTranslate"]).autoTranslate;return n(gt,{value:e,onChange:t=>Ht.store.autoTranslate=t,note:Ht.def.autoTranslate.description,hideBorder:!0},"Auto Translate")}function h2({rootProps:e}){return n(Ne,{...e},n(Xe,{className:kn("modal-header")},n(S.FormTitle,{tag:"h2"},"Translate"),n(Tt,{onClick:e.onClose})),n(We,{className:kn("modal-content")},_R.map(t=>n(OR,{key:t,settingsKey:t,includeAuto:t.endsWith("Input")})),n(S.FormDivider,{className:z.bottom16}),n(BR,null)))}var _R,y2=g(()=>{"use strict";a();it();nt();x();Qg();ga();ya();_R=["receivedInput","receivedOutput","sentInput","sentOutput"]});function ji({height:e=24,width:t=24,className:o}){return n("svg",{viewBox:"0 96 960 960",height:e,width:t,className:te(kn("icon"),o)},n("path",{fill:"currentColor",d:"m475 976 181-480h82l186 480h-87l-41-126H604l-47 126h-82Zm151-196h142l-70-194h-2l-70 194Zm-466 76-55-55 204-204q-38-44-67.5-88.5T190 416h87q17 33 37.5 62.5T361 539q45-47 75-97.5T487 336H40v-80h280v-80h80v80h280v80H567q-22 69-58.5 135.5T419 598l98 99-30 81-127-122-200 200Z"}))}function v2({slateProps:e}){let{autoTranslate:t}=Ht.use(["autoTranslate"]);if(e.type.analyticsName!=="normal")return null;let o=()=>Ht.store.autoTranslate=!t;return n(ee,{text:"Open Translate Modal"},({onMouseEnter:r,onMouseLeave:i})=>n("div",{style:{display:"flex"}},n(C,{"aria-haspopup":"dialog","aria-label":"Open Translate Modal",size:"",look:eo.BLANK,onMouseEnter:r,onMouseLeave:i,innerClassName:St.button,onClick:s=>{if(s.shiftKey)return o();we(l=>n(h2,{rootProps:l}))},onContextMenu:()=>o(),style:{padding:"0 4px"}},n("div",{className:St.buttonWrapper},n(ji,{className:kn({"auto-translate":t})})))))}var Vg=g(()=>{"use strict";a();Pe();nt();x();ga();y2();ya()});function th(e,t){eh.get(e)(t)}function FR({onDismiss:e}){return n("button",{onClick:e,className:kn("dismiss")},"Dismiss")}function S2({message:e}){let[t,o]=Y();return pe(()=>{if(!e.vencordEmbeddedBy)return eh.set(e.id,o),()=>void eh.delete(e.id)},[]),t?n("span",{className:kn("accessory")},n(ji,{width:16,height:16}),Be.parse(t.text)," ","(translated from ",Nc[t.src]??t.src," - ",n(FR,{onDismiss:()=>o(void 0)}),")"):null}var eh,b2=g(()=>{"use strict";a();x();Qg();Vg();ya();eh=new Map});var T2,oh,x2=g(()=>{"use strict";a();g2();Rt();Hl();on();jr();ae();A();w();x();ga();Vg();b2();ya();T2=(e,{message:t})=>()=>{if(!t.content)return;let o=dt("copy-text",e);!o||o.splice(o.findIndex(r=>r?.props?.id==="copy-text")+1,0,n(G.MenuItem,{id:"vc-trans",label:"Translate",icon:ji,action:async()=>{let r=await ha("received",t.content);th(t.id,r)}}))},oh=y({name:"Translate",description:"Translate messages with Google Translate",authors:[m.Ven],dependencies:["MessageAccessoriesAPI","MessagePopoverAPI","MessageEventsAPI"],settings:Ht,translate:ha,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(){Zs("vc-translation",e=>n(S2,{message:e.message})),ue("message",T2),zo("vc-translate",e=>e.content?{label:"Translate",icon:ji,message:e,channel:Q.getChannel(e.channel_id),onClick:async()=>{let t=await ha("received",e.content);th(e.id,t)}}:null),this.preSend=Kt(async(e,t)=>{!Ht.store.autoTranslate||!t.content||(t.content=(await ha("sent",t.content)).text)})},stop(){Yt(this.preSend),fe("message",T2),jo("vc-translate"),Sm("vc-translation")},chatBarIcon:e=>n(B,{noop:!0},n(v2,{slateProps:e}))})});function nh({a:e,b:t,count:o}){r
`);if(o.length<2)return t;let r="";return o[o.length-1]==="```"&&(r=o.pop()),`${o[0]}
${this.unindent(o.slice(1).join(`
2023-11-14 11:41:09 -06:00
`))}
2024-01-10 23:19:19 -06:00
${r}`})},start(){this.preSend=Kt((e,t)=>this.unindentMsg(t)),this.preEdit=Br((e,t,o)=>this.unindentMsg(o))},stop(){Yt(this.preSend),Fr(this.preEdit)}})});var lh,I2,ch,A2=g(()=>{"use strict";a();Rt();Lt();A();w();x();lh=1<<2,I2=(e,{channel:t,message:{author:o,embeds:r,flags:i,id:s}})=>()=>{let l=(i&lh)!==0;if(!l&&!r.length)return;let c=t.isPrivate()||!!(_e.getChannelPermissions({id:t.id})&xe.EMBED_LINKS);if(o.id===U.getCurrentUser().id&&!c)return;let u=dt("delete",e),p=u?.findIndex(d=>d?.props?.id==="delete");!p||!u||u.splice(p-1,0,n(G.MenuItem,{id:"unsuppress-embeds",key:"unsuppress-embeds",label:l?"Unsuppress Embeds":"Suppress Embeds",color:l?void 0:"danger",icon:l?sl:al,action:()=>Nt.patch({url:`/channels/${t.id}/messages/${s}`,body:{flags:l?i&~lh:i|lh}})}))},ch=y({name:"UnsuppressEmbeds",authors:[m.rad,m.HypedDomi],description:"Allows you to unsuppress embeds in messages",start(){ue("message",I2)},stop(){fe("message",I2)}})});var N2,uh,C2=g(()=>{"use strict";a();ao();cl();$();A();w();N2=D({resultsAmount:{type:1,description:"The amount of results you want to get (more gives better results, but is slower)",default:10}}),uh=y({name:"UrbanDictionary",description:"Search for a word on Urban Dictionary via /urban slash command",authors:[m.jewdev],dependencies:["CommandsAPI"],settings:N2,commands:[{name:"urban",description:"Returns the definition of a word from Urban Dictionary",inputType:0,options:[{type:3,name:"word",description:"The word to search for on Urban Dictionary",required:!0}],execute:async(e,t)=>{try{let o=encodeURIComponent(e[0].value),{list:r}=await fetch(`https://api.urbandictionary.com/v0/define?term=${o}&per_page=${N2.store.resultsAmount}`).then(l=>l.json());if(!r.length)return void me(t.channel.id,{content:"No results found."});let i=r.reduce((l,c)=>l.thumbs_up>c.thumbs_up?l:c),s=l=>l.replaceAll(`\r
2023-11-14 11:41:09 -06:00
`,`
2024-01-10 23:19:19 -06:00
`).replace(/([*>_`~\\])/gsi,"\\$1").replace(/\[(.+?)\]/g,(c,u)=>`[${u}](https://www.urbandictionary.com/define.php?term=${encodeURIComponent(u)} "Define '${u}' on Urban Dictionary")`).trim();return void me(t.channel.id,{embeds:[{type:"rich",author:{name:`Uploaded by "${i.author}"`,url:`https://www.urbandictionary.com/author.php?author=${encodeURIComponent(i.author)}`},title:i.word,url:`https://www.urbandictionary.com/define.php?term=${encodeURIComponent(i.word)}`,description:s(i.definition),fields:[{name:"Example",value:s(i.example)},{name:"Want more definitions?",value:`Check out [more definitions](https://www.urbandictionary.com/define.php?term=${o} "Define "${e[0].value}" on Urban Dictionary") on Urban Dictionary.`}],color:16750848,footer:{text:`\u{1F44D} ${i.thumbs_up.toString()} | \u{1F44E} ${i.thumbs_down.toString()}`,icon_url:"https://www.urbandictionary.com/favicon.ico"},timestamp:new Date(i.written_on).toISOString()}]})}catch(o){me(t.channel.id,{content:`Something went wrong: \`${o}\``})}}}]})});var k2=g(()=>{});var zR,jR,WR,R2,D2=g(()=>{"use strict";a();k2();j();x();zR=P("selectChannel","selectVoiceChannel"),jR=un(".lastSection","children:"),WR=1n<<20n,R2=({channel:e,label:t,showHeader:o})=>n(jR,null,o&&n(S.FormTitle,{className:"vc-uvs-header"},"In a voice channel"),n(C,{className:"vc-uvs-button",color:C.Colors.TRANSPARENT,size:C.Sizes.SMALL,onClick:()=>{_e.can(WR,e)?zR.selectVoiceChannel(e.id):oe.show({message:"Insufficient permissions to enter the channel.",id:"user-voice-show-insufficient-permissions",type:oe.Type.FAILURE,options:{position:oe.Position.BOTTOM}})}},t))});var qR,ph,L2,dh,E2=g(()=>{"use strict";a();$();ae();A();w();j();x();D2();qR=Re("VoiceStateStore"),ph=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}}),L2=B.wrap(({user:e})=>{let{channelId:t}=qR.getVoiceStateForUser(e.id)??{};if(!t)return null;let o=Q.getChannel(t);if(!o)return null;let r=de.getGuild(o.guild_id);if(!r)return null;let i=`${r.name} | ${o.name}`;return n(R2,{channel:o,label:i,showHeader:ph.store.showVoiceChannelSectionHeader})}),dh=y({name:"UserVoiceShow",description:"Shows whether a User is currently in a voice channel somewhere in their profile",authors:[m.LordElias],settings:ph,patchModal({user:e}){return ph.store.showInUserProfileModal?n("div",{className:"vc-uvs-modal-margin"},n(L2,{user:e})):null},patchPopout:({user:e})=>{let t=e.id===U.getCurrentUser().id;return n("div",{className:t?"vc-uvs-popout-margin-self":""},n(L2,{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 _2,O2=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/usrbg/index.css",{name:"src/plugins/usrbg/index.css",source:`:is([class*="userProfile"], [class*="userPopout"]) [class*="bannerPremium"] {
2023-11-14 11:41:09 -06:00
background: center / cover no-repeat;
}
[class*="NonPremium"]:has([class*="bannerPremium"]) [class*="avatarPositionNormal"],
[class*="PremiumWithoutBanner"]:has([class*="bannerPremium"]) [class*="avatarPositionPremiumNoBanner"] {
top: 76px;
}
[style*="background-image"] [class*="background_"] {
background-color: transparent !important;
}
2024-01-10 23:19:19 -06:00
`,classNames:{},dom:null});_2="src/plugins/usrbg/index.css"});var KR,Rn,Rc,mh,B2=g(()=>{"use strict";a();$();rt();xo();A();w();O2();KR="https://raw.githubusercontent.com/AutumnVN/usrbg/main/usrbg.json",Rn={},Rc=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}}),mh=y({name:"USRBG",description:"Displays user banners from USRBG, allowing anyone to get a banner without Nitro",authors:[m.AutumnVN,m.pylix,m.TheKodeToad],settings:Rc,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:()=>Rc.store.voiceBackground,replacement:[{match:/(?<=function\((\i),\i\)\{)(?=let.{20,40},style:)/,replace:"$1.style=$self.voiceBackgroundHook($1);"}]}],data:Rn,settingsAboutComponent:()=>n(qe,{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_")&&Rn[t])return{backgroundImage:`url(${Rn[t]})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}},useBannerHook({displayProfile:e,user:t}){if(!(e?.banner&&Rc.store.nitroFirst)&&Rn[t.id])return Rn[t.id]},premiumHook({userId:e}){if(Rn[e])return 2},shouldShowBadge({displayProfile:e,user:t}){return e?.banner&&(!Rn[t.id]||Rc.store.nitroFirst)},async start(){xt(_2);let e=await fetch(KR);e.ok&&(Rn=await e.json(),this.data=Rn)}})});function YR({data:e,UserMention:t,RoleMention:o,parse:r,props:i}){let[s,l]=Y(e.userId);if(s)return n(t,{className:"mention",userId:s,channelId:e.channelId,inlinePreview:i.noStyleAndInteraction,key:i.key});let c=r(e.content,i);return n(o,{...e,inlinePreview:i.formatInline},n("span",{onMouseEnter:()=>{let u=c?.[0]?.props?.children;if(typeof u!="string")return;let p=u.match(/<@!?(\d+)>/)?.[1];if(!p||Dc.has(p))return;if(U.getUser(p))return l(p);let d=()=>{Dc.add(p),F2.unshift(()=>Ct.getUser(p).then(()=>{l(p),Dc.delete(p)}).catch(h=>{h?.status===429&&(F2.unshift(()=>Fn(1e3).then(d)),Dc.delete(p))}).finally(()=>Fn(300)))};d()}},c))}var Dc,F2,fh,U2=g(()=>{"use strict";a();ae();A();Pe();ci();w();x();Dc=new Set,F2=new _o(5);fh=y({name:"ValidUser",description:"Fix mentions for unknown users showing up as '<@343383572805058560>' (hover over a mention to fix it)",authors:[m.Ven],tags:["MentionCacheFix"],patches:[{find:'className:"mention"',replacement:{match:/react(?=\(\i,\i,\i\).{0,50}return null==\i\?\(0,\i\.jsx\)\((\i\.\i),.+?jsx\)\((\i\.\i),\{className:"mention")/,replace:"react:(...args)=>$self.renderMention($1,$2,...args),originalReact"}}],renderMention(e,t,o,r,i){return n(B,{noop:!0},n(YR,{RoleMention:e,UserMention:t,data:o,parse:r,props:i}))}})});var gh,hh,$2=g(()=>{"use strict";a();A();w();x();gh={},hh=y({name:"VoiceChatDoubleClick",description:"Join voice chats via double click instead of single click",authors:[m.Ven,m.D3SOX],patches:[...[".handleVoiceStatusClick",".handleClickChat"].map(e=>({find:e,replacement:[{match:/onClick:\(\)=>\{this.handleClick\(\)/g,replace:"onClick:()=>{$self.schedule(()=>{this.handleClick()},this)"}]})),{find:".shouldCloseDefaultModals",replacement:{match:/onClick:(\i)(?=,.{0,30}className:"channelMention".+?(\i)\.inContent)/,replace:(e,t,o)=>`onClick:(vcDoubleClickEvt)=>$self.shouldRunOnClick(vcDoubleClickEvt,${o})&&${t}()`}}],shouldRunOnClick(e,{channelId:t}){let o=Q.getChannel(t);return!o||![2,13].includes(o.type)?!0:e.detail>=2},schedule(e,t){let o=t.props.channel.id;if(be.getVoiceChannelId()===o){e();return}let r=gh[o]??={timeout:void 0,i:0};clearTimeout(r.timeout),++r.i>=2?(e(),delete gh[o]):r.timeout=setTimeout(()=>{delete gh[o]},500)}})});fun
`)}document.addEventListener("DOMContentLoaded",()=>{FD(),$c(),Bh(E.useQuickCss),Ss("useQuickCss",Bh),Ss("themeLinks",$c),Ss("enabledThemes",$c),VencordNative.quickCss.addThemeChangeListener($c)});Lr();var $h={};ze($h,{Common:()=>nu,LazyComponentWebpack:()=>Wc,_initWebpack:()=>Pa,_resolveReady:()=>Ma,addListener:()=>DM,cache:()=>cn,extract:()=>Na,extractAndLoadChunks:()=>Yh,extractAndLoadChunksLazy:()=>Aa,filters:()=>Ae,find:()=>Ao,findAll:()=>Sr,findBulk:()=>Xi,findByCode:()=>qh,findByCodeLazy:()=>un,findByProps:()=>Ji,findByPropsLazy:()=>P,findComponentByCode:()=>qc,findComponentByCodeLazy:()=>je,findComponentLazy:()=>Kc,findExportedComponentLazy:()=>pn,findLazy:()=>Vt,findModuleFactory:()=>Wh,findModuleId:()=>Ia,findStore:()=>Kh,findStoreLazy:()=>Re,lazyWebpackSearchHistory:()=>RM,listeners:()=>jc,onceReady:()=>zc,proxyLazyWebpack:()=>No,removeListener:()=>LM,search:()=>Yc,subscriptions:()=>jh,waitFor:()=>ft,wreq:()=>Qt});a();x();j();a();A();Ve();Jr();wa();var SM,Io=new ie("WebpackInterceptor","#8caaee");window[Jo]?(Io.info(`Patching ${Jo}.push (was already existent, likely from cache!)`),Pa(window[Jo]),bM(window[Jo])):(Object.defineProperty(window,Jo,{get:()=>SM,set:e=>{e?.push&&(e.push.$$vencordOriginal||(Io.info(`Patching ${Jo}.push`),bM(e)),Pa(e)&&(Io.info("Successfully initialised Vencord webpack"),delete window[Jo],window[Jo]=e)),SM=e},configurable:!0}),Object.defineProperty(Function.prototype,"m",{set(e){new Error().stack?.includes("discord.com")&&(Io.info("Found webpack module factory"),TM(e)),Object.defineProperty(this,"m",{value:e,configurable:!0})},configurable:!0}));function bM(e){function t(o){try{TM(o[1])}catch(r){Io.error("Error in handlePush",r)}return t.$$vencordOriginal.call(e,o)}t.$$vencordOriginal=e.push,t.bind=(...o)=>t.$$vencordOriginal.bind(...o),Object.defineProperty(e,"push",{get:()=>t,set(o){t.$$vencordOriginal=o},configurable:!0})}function TM(e){let{subscriptions:t,listeners:o}=Vencord.Webpack,{patches:r}=Vencord.Plugins;for(let i in e){let s=e[i],l="0,"+s.toString().replaceAll(`
`,""),c=s,u=new Set,p=e[i]=function(d,h,v){try{s(d,h,v)}catch(T){if(s===c)throw T;return Io.error("Error in patched chunk",T),void c(d,h,v)}if(h=d.exports,!!h){if(h===window&&v.c){Object.defineProperty(v.c,i,{value:v.c[i],enumerable:!1,configurable:!0,writable:!0});return}for(let T of o)try{T(h,i)}catch(N){Io.error("Error in webpack listener",N)}for(let[T,N]of t)try{T(h)?(t.delete(T),N(h,i)):h.default&&T(h.default)&&(t.delete(T),N(h.default,i))}catch(b){Io.error("Error while firing callback for webpack chunk",b)}}};p.toString=()=>s.toString(),p.original=c;for(let d=0;d<r.length;d++){let h=r[d],v=Ko(`patch by ${h.plugin}`,(T,N)=>l.replace(T,N));if(!(h.predicate&&!h.predicate())&&l.includes(h.find)){u.add(h.plugin);let T=s,N=l;for(let b of h.replacement){if(b.predicate&&!b.predicate())continue;let I=s,k=l;Zi(b,h.plugin);try{let M=v(b.match,b.replace);if(M===l){if(h.noWarn||Io.warn(`Patch by ${h.plugin} had no effect (Module id is ${i}): ${b.match}`),h.group){Io.warn(`Undoing patch group ${h.find} by ${h.plugin} because replacement ${b.match} had no effect`),l=N,s=T,u.delete(h.plugin);break}}else l=M,s=(0,eval)(`// Webpack Module ${i} - Patched by ${[...u].join(", ")}
${M}
//# sourceURL=WebpackModule${i}`)}catch(M){if(Io.error(`Patch by ${h.plugin} errored (Module id is ${i}): ${b.match}
`,M),u.delete(h.plugin),h.group){Io.warn(`Undoing patch group ${h.find} by ${h.plugin} because replacement ${b.match} errored`),l=N,s=T;break}l=k,s=I}}h.all||r.splice(d--,1)}}}}w();Vo();$n();$();fl();Ga();jn();vs();Lr();x();async function UD(){if(E.cloud.authenticated&&!await Dt("Vencord_cloudSecret")){De({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:()=>dn.open("VencordCloud")});return}E.cloud.settingsSync&&E.cloud.authenticated&&(Cr.Vencord_settingsDirty?(await di(),delete Cr.Vencord_settingsDirty):await el(!1)&&De({title:"Cloud Settings",body:"Your settings have been updated! Click here to restart to fully apply changes!",color:"var(--green-360)",onClick:go}))}async function $D(){await zc,Ls("WebpackReady"),UD();try{if(!await fi())return;if(E.autoUpdate){await gi(),E.autoUpdateNotification&&setTimeout(()=>De({title:"Vencord has been updated!",body:"Click here to restart",permanent:!0,noPersist:!0,onClick:go}),1e4);return}E.notifyAboutUpdates&&setTimeout(()=>De({title:"A Vencord update is available!",body:"Click here to view the update",permanent:!0,noPersist:!0,onClick(){dn.open("VencordUpdater")}}),1e4)}catch(e){Dr.error("Failed to check for updates",e)}}Ls("Init");$D();document.addEventListener("DOMContentLoaded",()=>{Ls("DOMContentLoaded")},{once:!0});return En(GD);})();
2023-11-14 11:41:09 -06:00
//# sourceURL=VencordDesktopRenderer
//# sourceMappingURL=vencord://vencordDesktopRenderer.js.map
/*! For license information please see vencordDesktopRenderer.js.LEGAL.txt */