"use strict";(()=>{var Ia=Object.defineProperty;var s=(e,t)=>()=>(e&&(t=e(e=0)),t);var D=(e,t)=>{for(var n in t)Ia(e,n,{get:t[n],enumerable:!0})};var he,ye,B,Je,Le,Ae,Re=s(()=>{"use strict";he=window.nativeModuleProxy,ye=he.MMKVManager;B=he.DCDFileManager??he.RTNFileManager;Je=he.InfoDictionaryManager??he.RTNClientInfoManager;Le=he.DCDDeviceManager??he.RTNDeviceManager,Ae=he.BundleUpdaterManager});var Ht={};D(Ht,{find:()=>W,findAll:()=>Qe,findByDisplayName:()=>Vt,findByDisplayNameAll:()=>Ba,findByName:()=>O,findByNameAll:()=>Da,findByProps:()=>c,findByPropsAll:()=>Na,findByStoreName:()=>ee,findByTypeName:()=>Oa,findByTypeNameAll:()=>Ma,modules:()=>Gt});var Ca,pr,gr,Gt,W,Qe,hr,yr,Rr,Er,Pa,c,Na,O,Da,Vt,Ba,Oa,Ma,ee,w=s(()=>{"use strict";Ee();Ca=window.ErrorUtils.getGlobalHandler();window.ErrorUtils.setGlobalHandler(null);pr=function(e){return Object.defineProperty(window.modules,e,{value:window.modules[e],enumerable:!1,configurable:!0,writable:!0})};for(let e in window.modules){let t=Number(e),n=window.modules[t]?.publicModule?.exports;if(!n||n===window||n.proxygone===null){pr(t);continue}}gr=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return function(n){let r=[];for(let o in e){let a=Number(o),i=e[a]?.publicModule?.exports;if(!e[a].isInitialized)try{if(ie().discord.version>=224){let m=Function.prototype.toString;Object.defineProperty(Function.prototype,"toString",{value:m,configurable:!0,writable:!1}),__r(a),Object.defineProperty(Function.prototype,"toString",{value:m,configurable:!0,writable:!0})}window.ErrorUtils.setGlobalHandler(function(){}),__r(a),window.ErrorUtils.setGlobalHandler(Ca)}catch{}if(!i){pr(a);continue}if(i.default&&i.__esModule&&n(i.default)){if(t)return i.default;r.push(i.default)}if(n(i)){if(t)return i;r.push(i)}}if(!t)return r}},Gt=window.modules,W=gr(Gt,!0),Qe=gr(Gt),hr=function(e){return function(t){return e.every(function(n){return t[n]!==void 0})}},yr=function(e,t){return t?function(n){return n?.name===e}:function(n){return n?.default?.name===e}},Rr=function(e,t){return t?function(n){return n?.displayName===e}:function(n){return n?.default?.displayName===e}},Er=function(e,t){return t?function(n){return n?.type?.name===e}:function(n){return n?.default?.type?.name===e}},Pa=function(e){return function(t){return t.getName&&t.getName.length===0&&t.getName()===e}},c=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&arguments[1]!==void 0?arguments[1]:!0;return W(yr(e,t))},Da=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Qe(yr(e,t))},Vt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return W(Rr(e,t))},Ba=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Qe(Rr(e,t))},Oa=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return W(Er(e,t))},Ma=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Qe(Er(e,t))},ee=function(e){return W(Pa(e))}});function $(e,t){return dt(e,t,{walkable:["props","children","child","sibling"]})}var br=s(()=>{"use strict";se()});function $t(e,t,n,r){if(!(r>n.maxDepth)&&e){try{if(t(e))return e}catch{}if(Array.isArray(e)){for(let o of e)if(!(typeof o!="object"||o===null))try{let a=$t(o,t,n,r+1);if(a)return a}catch{}}else if(typeof e=="object"){for(let o of Object.keys(e))if(!(typeof e[o]!="object"||e[o]===null)&&!(n.walkable.length&&!n.walkable.includes(o))&&!n.ignore.includes(o))try{let a=$t(e[o],t,n,r+1);if(a)return a}catch{}}}}function dt(e,t){let{walkable:n=[],ignore:r=[],maxDepth:o=100}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return $t(e,t,{walkable:n,ignore:r,maxDepth:o},0)}var wr=s(()=>{"use strict"});async function be(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e4,r=await fetch(e,{signal:La(n),...t});if(!r.ok)throw new Error("Request returned non-ok");return r}function La(e){let t=new AbortController;return setTimeout(function(){return t.abort(`Timed out after ${e}ms`)},e),t.signal}var _r=s(()=>{"use strict"});function jt(e){return Object.isFrozen(e)?Object.assign({},e):e}var xr=s(()=>{"use strict"});function K(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{"use strict"});var zt={};D(zt,{findInReactTree:()=>$,findInTree:()=>dt,safeFetch:()=>be,unfreeze:()=>jt,without:()=>K});var se=s(()=>{"use strict";br();wr();_r();xr();Sr()});var Wt,te,pt=s(()=>{Wt=["a","b","i"],te=new Map});function vr(e,t,n,r,o){let a=te.get(t)?.[e];if(!a)return o?Reflect.construct(t[e],n,r):t[e].apply(r,n);for(let m of a.b.values()){let g=m.call(r,n);Array.isArray(g)&&(n=g)}let i=[...a.i.values()].reduce(function(m,g){return function(){for(var l=arguments.length,b=new Array(l),S=0;S{pt()});function Kt(e,t,n,r){let o=te.get(e),a=o?.[t];return a?.[r].has(n)?(a[r].delete(n),Wt.every(function(i){return a[i].size===0})&&(Reflect.defineProperty(e,t,{value:a.o,writable:!0,configurable:!0})||(e[t]=a.o),delete o[t]),Object.keys(o).length==0&&te.delete(e),!0):!1}function Ar(){for(let[e,t]of te.entries())for(let n in t)for(let r of Wt)for(let o of t[n]?.[r].keys()??[])Kt(e,n,o,r)}var Yt=s(()=>{pt()});function gt(e){return function(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(typeof n[t]!="function")throw new Error(`${t} is not a function in ${n.constructor.name}`);te.has(n)||te.set(n,Object.create(null));let a=te.get(n);if(!a[t]){let g=n[t];a[t]={o:g,b:new Map,i:new Map,a:new Map};let l=function(p,_,A){let Z=vr(t,n,_,p,A);return o&&m(),Z},b=new Proxy(g,{apply:function(p,_,A){return l(_,A,!1)},construct:function(p,_){return l(g,_,!0)},get:function(p,_,A){return _=="toString"?g.toString.bind(g):Reflect.get(p,_,A)}});Reflect.defineProperty(n,t,{value:b,configurable:!0,writable:!0})||(n[t]=b)}let i=Symbol(),m=function(){return Kt(n,t,i,e)};return a[t][e].set(i,r),m}}var Ir=s(()=>{Tr();pt();Yt()});var Jt={};D(Jt,{after:()=>y,before:()=>Xt,instead:()=>Y,unpatchAll:()=>Ar});var Xt,Y,y,Qt=s(()=>{Ir();Yt();Xt=gt("b"),Y=gt("i"),y=gt("a")});var Cr,C=s(()=>{"use strict";Qt();Qt();Cr={...Jt}});function qt(){return{listeners:Object.values(Zt).reduce(function(e,t){return e[t]=new Set,e},{}),on(e,t){this.listeners[e].has(t)||this.listeners[e].add(t)},off(e,t){this.listeners[e].delete(t)},once(e,t){var n=this;let r=function(o,a){n.off(o,r),t(o,a)};this.on(e,r)},emit(e,t){for(let n of this.listeners[e])n(e,t)}}}var Zt,Pr=s(()=>{"use strict";(function(e){e.GET="GET",e.SET="SET",e.DEL="DEL"})(Zt||(Zt={}))});var Nr,en,Dr,tn,we,ke,Br=s(()=>{"use strict";Re();h();Nr=/[<>:"\/\\|?*]/g,en=function(e){return u.Platform.select({default:e,ios:B.saveFileToGallery?e:`Documents/${e}`})},Dr=function(e){return Nr.test(e)&&(e=e.replace(Nr,"-").replace(/-+/g,"-")),`vd_mmkv/${e}`},tn=async function(e){await ye.getItem(e)&&ye.removeItem(e);let t=Dr(e);await B.fileExists(`${B.getConstants().DocumentsDirPath}/${t}`)&&await B.removeFile?.("documents",t)},we=function(e){let t=Dr(e);return ke(t,async function(){try{let n=`${B.getConstants().DocumentsDirPath}/${t}`;if(await B.fileExists(n))return;let r=await ye.getItem(e)??"{}";if(r==="!!LARGE_VALUE!!"){let o=`${B.getConstants().CacheDirPath}/mmkv/${e}`;await B.fileExists(o)?r=await B.readFile(o,"utf8"):(console.log(`${e}: Experienced data loss :(`),r="{}")}await B.writeFile("documents",en(t),r,"utf8"),await ye.getItem(e)!==null&&(ye.removeItem(e),console.log(`Successfully migrated ${e} store from MMKV storage to fs`))}catch(n){console.error("Failed to migrate to fs from MMKVManager ",n)}}())},ke=function(e,t){let n;return{get:async function(){await t;let r=`${B.getConstants().DocumentsDirPath}/${e}`;return!n&&!await B.fileExists(r)?(n=!0,B.writeFile("documents",en(e),"{}","utf8")):JSON.parse(await B.readFile(r,"utf8"))},set:async function(r){await t,await B.writeFile("documents",en(e),JSON.stringify(r),"utf8")}}}});var rn={};D(rn,{awaitSyncWrapper:()=>Fe,createFileBackend:()=>ke,createMMKVBackend:()=>we,createProxy:()=>Lr,createStorage:()=>ce,purgeStorage:()=>tn,useProxy:()=>k,wrapSync:()=>_e});function Lr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=qt();function n(r,o){return new Proxy(r,{get(a,i){if(i===Or)return t;let m=[...o,i],g=a[i];return g!=null?(t.emit("GET",{path:m,value:g}),typeof g=="object"?n(g,m):g):g},set(a,i,m){return a[i]=m,t.emit("SET",{path:[...o,i],value:m}),!0},deleteProperty(a,i){let m=delete a[i];return m&&t.emit("DEL",{path:[...o,i]}),m}})}return{proxy:n(e,[]),emitter:t}}function k(e){if(e[nn])throw e[nn];let t=e[Or];if(!t)throw new Error("InvalidArgumentExcpetion - storage[emitterSymbol] is "+typeof t);let[,n]=React.useReducer(function(r){return~r},0);return React.useEffect(function(){let r=function(){return n()};return t.on("SET",r),t.on("DEL",r),function(){t.off("SET",r),t.off("DEL",r)}},[]),e}async function ce(e){let t=await e.get(),{proxy:n,emitter:r}=Lr(t),o=function(){return e.set(n)};return r.on("SET",o),r.on("DEL",o),n}function _e(e){let t,n,r=[],o=function(a){return t?a():r.push(a)};return e.then(function(a){t=a,r.forEach(function(i){return i()})}).catch(function(a){n=a}),new Proxy({},{...Object.fromEntries(Object.getOwnPropertyNames(Reflect).map(function(a){return[a,function(i){for(var m=arguments.length,g=new Array(m>1?m-1:0),l=1;l{"use strict";Pr();Br();Or=Symbol.for("vendetta.storage.emitter"),Mr=Symbol.for("vendetta.storage.accessor"),nn=Symbol.for("vendetta.storage.error");Fe=function(e){return new Promise(function(t){return e[Mr](t)})}});var on,ka,P,Ie=s(()=>{"use strict";w();on=c("setLogFn").default,ka=new on("Opti"),P=ka});var un={};D(un,{color:()=>le,fetchTheme:()=>Ze,getCurrentTheme:()=>yt,getThemes:()=>Va,initThemes:()=>ln,installTheme:()=>Ce,patchChatBackground:()=>sn,removeTheme:()=>cn,selectTheme:()=>ht,themes:()=>F,updateThemes:()=>Fr});async function an(e){if(typeof e!="object")throw new Error("Theme must be an object");await ke("vendetta_theme.json").set(e)}function sn(){let e=yt()?.data?.background;if(!e)return;let t=O("MessagesWrapperConnected",!1);if(!t)return;let{MessagesWrapper:n}=c("MessagesWrapper");if(!n)return;let r=[y("default",t,function(o,a){return React.createElement(u.ImageBackground,{style:{flex:1,height:"100%"},source:{uri:e.url},blurRadius:typeof e.blur=="number"?e.blur:0,children:a})}),y("render",n.prototype,function(o,a){let i=$(a,function(m){return"HACK_fixModalInteraction"in m?.props&&m?.props?.style});i?i.props.style=Object.assign(u.StyleSheet.flatten(i.props.style??{}),{backgroundColor:"#0000"}):P.error("Didn't find Messages when patching MessagesWrapper!")})];return function(){return r.forEach(function(o){return o()})}}function kr(e){if(ue.valid(e))return ue(e).hex();let t=Number(u.processColor(e));return ue.rgb(t>>16&255,t>>8&255,t&255,t>>24&255).hex()}function Ua(e){if(e.semanticColors){let t=e.semanticColors;for(let n in t)for(let r in t[n])t[n][r]&&=kr(t[n][r])}if(e.rawColors){let t=e.rawColors;for(let n in t)e.rawColors[n]=kr(t[n]);u.Platform.OS==="android"&&Ga(t)}return e}function Ga(e){let t={BLACK_ALPHA_60:["BLACK",.6],BRAND_NEW_360_ALPHA_20:["BRAND_360",.2],BRAND_NEW_360_ALPHA_25:["BRAND_360",.25],BRAND_NEW_500_ALPHA_20:["BRAND_500",.2],PRIMARY_DARK_500_ALPHA_20:["PRIMARY_500",.2],PRIMARY_DARK_700_ALPHA_60:["PRIMARY_700",.6],STATUS_GREEN_500_ALPHA_20:["GREEN_500",.2],STATUS_RED_500_ALPHA_20:["RED_500",.2]};for(let n in t){let[r,o]=t[n];e[r]&&(e[n]=ue(e[r]).alpha(o).hex())}}async function Ze(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;try{n=await(await be(e,{cache:"no-store"})).json()}catch{throw new Error(`Failed to fetch theme at ${e}`)}F[e]={id:e,selected:t,data:Ua(n)},t&&an(F[e])}async function Ce(e){if(typeof e!="string"||e in F)throw new Error("Theme already installed");await Ze(e)}async function ht(e){if(e==="default")return await an({});let t=Object.values(F).find(function(n){return n.selected})?.id;t&&(F[t].selected=!1),F[e].selected=!0,await an(F[e])}async function cn(e){let t=F[e];return t.selected&&await ht("default"),delete F[e],t.selected}function yt(){let e=window.__vendetta_loader?.features?.themes?.prop;return e&&window[e]||null}async function Fr(){await Fe(F);let e=yt();await Promise.allSettled(Object.keys(F).map(function(t){return Ze(t,e?.id===t)}))}async function ln(){let e=yt();if(!e)return;let t=le.default.unsafe_rawColors;le.default.unsafe_rawColors=new Proxy(t,{get:function(n,r){return e?e.data?.rawColors?.[r]??Reflect.get(t,r):Reflect.get(t,r)}}),Y("resolveSemanticColor",le.default.meta??le.default.internal,function(n,r){if(!e)return r(...n);let[o,a]=n,[i,m]=Ur(o,a),g=o==="amoled"?2:o==="light"?1:0;let l=Fa[i]??i,b=(e.data?.semanticColors?.[i]??e.data?.semanticColors?.[l])?.[g];if(i==="CHAT_BACKGROUND"&&typeof e.data?.background?.alpha=="number")return ue(b||"black").alpha(1-e.data.background.alpha).hex();if(b)return b;let S=e.data?.rawColors?.[m.raw];return S?m.opacity===1?S:ue(S).alpha(m.opacity).hex():r(...n)}),await Fr()}function Ur(e,t){let n=t[Ur._sym??=Object.getOwnPropertySymbols(t)[0]],r=le.SemanticColor[n];return[n,r[e.toLowerCase()]]}function Va(){var e=0;return Object.keys(F).forEach(function(t){return e++}),e}var le,F,Fa,ne=s(()=>{"use strict";h();se();w();C();X();Ie();le=c("SemanticColor"),F=_e(ce(we("VENDETTA_THEMES"))),Fa={BG_BACKDROP:"BACKGROUND_FLOATING",BG_BASE_PRIMARY:"BACKGROUND_PRIMARY",BG_BASE_SECONDARY:"BACKGROUND_SECONDARY",BG_BASE_TERTIARY:"BACKGROUND_SECONDARY_ALT",BG_MOD_FAINT:"BACKGROUND_MODIFIER_ACCENT",BG_MOD_STRONG:"BACKGROUND_MODIFIER_ACCENT",BG_MOD_SUBTLE:"BACKGROUND_MODIFIER_ACCENT",BG_SURFACE_OVERLAY:"BACKGROUND_FLOATING",BG_SURFACE_OVERLAY_TMP:"BACKGROUND_FLOATING",BG_SURFACE_RAISED:"BACKGROUND_MOBILE_PRIMARY"}});var Rt,Gr,u,ue,Et=s(()=>{"use strict";ne();C();Rt=function(e){for(let t in window.modules){let n=window.modules[t]?.publicModule.exports;if(n&&e(n))return n}},Gr=Rt(function(e){return e?.default?.name==="requireNativeComponent"});Gr&&Y("default",Gr,function(e,t){try{return t(...e)}catch{return e[0]}});window.React=Rt(function(e){return e.createElement});u=Rt(function(e){return e.AppRegistry}),ue=Rt(function(e){return e.brewer});if(window.__vendetta_loader?.features.themes)try{ln()}catch(e){console.error("[Opti] Failed to initialize themes...",e)}});var pn={};D(pn,{AsyncUsers:()=>tt,Flux:()=>Ka,FluxDispatcher:()=>Ya,Messages:()=>rt,NavigationNative:()=>fe,Profiles:()=>Pe,React:()=>x,ReactNative:()=>u,User:()=>et,assets:()=>nt,channels:()=>mn,chroma:()=>ue,clipboard:()=>U,commands:()=>bt,constants:()=>xe,i18n:()=>re,invites:()=>ja,lodash:()=>wt,moment:()=>dn,navigation:()=>za,navigationStack:()=>Wa,stylesheet:()=>N,toasts:()=>qe,url:()=>Ue,util:()=>Xa});function $a(e){if(fn){for(let t in e)e[t]=new Proxy(u.StyleSheet.flatten(e[t]),{get(n,r,o){let a=Reflect.get(n,r,o);return Vr.isSemanticColor(a)?Vr.resolveSemanticColor(Ha.theme,a):a}});return e}}var Ha,fn,Vr,xe,mn,re,Ue,qe,et,tt,Pe,N,U,nt,ja,bt,za,Wa,fe,rt,Ka,Ya,x,dn,wt,Xa,h=s(()=>{"use strict";w();Et();Et();Et();Ha=ee("ThemeStore"),fn=c("colors","unsafe_rawColors"),Vr=fn?.internal??fn?.meta;xe=c("Fonts","Permissions"),mn=c("getVoiceChannelId"),re=c("Messages"),Ue=c("openURL","openDeeplink"),qe=W(function(e){return e.open&&e.close&&!e.startDrag&&!e.init&&!e.openReplay&&!e.setAlwaysOnTop&&!e.setAccountFlag}),et=c("getCurrentUser"),tt=c("getUser","fetchProfile"),Pe=c("showUserProfile"),N={...W(function(e){return e.createStyles&&!e.ActionSheet}),createThemedStyleSheet:$a,...c("createThemedStyleSheet")},U=c("setString","getString","hasString"),nt=c("registerAsset"),ja=c("acceptInviteAndTransitionToInviteChannel"),bt=c("getBuiltInCommands"),za=c("pushLazy"),Wa=c("createStackNavigator"),fe=c("NavigationContainer"),rt=c("sendBotMessage"),Ka=c("connectStores"),Ya=c("_currentDispatchActionType"),x=window.React,dn=c("isMoment"),wt=c("forEachRight"),Xa=c("inspect","isNullOrUndefined")});var hn={};D(hn,{all:()=>me,find:()=>Ja,getAssetByID:()=>Za,getAssetByName:()=>Qa,getAssetIDByName:()=>f,patchAssets:()=>gn});function gn(){let e=y("registerAsset",nt,function(t,n){let r=t[0];me[r.name]={...r,id:n}});for(let t=1;;t++){let n=nt.getAssetByID(t);if(!n)break;me[n.name]||(me[n.name]={...n,id:t})}return e}var me,Ja,Qa,Za,f,v=s(()=>{"use strict";h();C();me={};Ja=function(e){return Object.values(me).find(e)},Qa=function(e){return me[e]},Za=function(e){return nt.getAssetByID(e)},f=function(e){return me[e]?.id}});var yn={};D(yn,{showToast:()=>R});var qa,R,oe=s(()=>{"use strict";w();h();({uuid4:qa}=c("uuid4")),R=function(e,t){return qe.open({key:`vd-toast-${qa()}`,content:e,source:t,icon:t})}});var bn={};D(bn,{connectToDebugger:()=>Rn,getDebugInfo:()=>ie,patchLogHook:()=>En,socket:()=>j,versionHash:()=>_t});function Rn(e){if(j!==void 0&&j.readyState!==WebSocket.CLOSED&&j.close(),!e){R("Invalid debugger URL!",f("Small"));return}j=new WebSocket(`ws://${e}`),j.addEventListener("open",function(){return R("Connected to debugger.",f("Check"))}),j.addEventListener("message",function(t){try{(0,eval)(t.data)}catch(n){console.error(n)}}),j.addEventListener("error",function(t){console.log(`Debugger error: ${t.message}`),R("An error occurred with the debugger connection!",f("Small"))})}function En(){let e=y("nativeLoggingHook",globalThis,function(t){j?.readyState===WebSocket.OPEN&&j.send(JSON.stringify({message:t[0],level:t[1]})),P.log(t[0])});return function(){j&&j.close(),e()}}function ie(){let e=window.HermesInternal.getRuntimeProperties(),t=e["OSS Release Version"],n="for RN ",r=u.Platform.constants,o=r.reactNativeVersion;return{vendetta:{version:_t,loader:window.__vendetta_loader?.name??"Unknown"},discord:{version:Je.Version,build:Je.Build},react:{version:React.version,nativeVersion:t.startsWith(n)?t.substring(n.length):`${o.major}.${o.minor}.${o.patch}`},hermes:{version:t,buildType:e.Build,bytecodeVersion:e["Bytecode Version"]},...u.Platform.select({android:{os:{name:"Android",version:r.Release,sdk:r.Version}},ios:{os:{name:r.systemName,version:r.osVersion}}}),...u.Platform.select({android:{device:{manufacturer:r.Manufacturer,brand:r.Brand,model:r.Model,codename:Le.device}},ios:{device:{manufacturer:Le.deviceManufacturer,brand:Le.deviceBrand,model:Le.deviceModel,codename:Le.device}}})}}var j,_t,Ee=s(()=>{"use strict";h();C();Re();v();oe();Ie();_t="5708f73"});var Se,Ge,Hr,Ve,ot=s(()=>{(function(e){e.BRAND="brand",e.RED="red",e.GREEN="green",e.PRIMARY="primary",e.TRANSPARENT="transparent",e.GREY="grey",e.LIGHTGREY="lightgrey",e.WHITE="white",e.LINK="link"})(Se||(Se={}));(function(e){e[e.BUILT_IN=0]="BUILT_IN",e[e.BUILT_IN_TEXT=1]="BUILT_IN_TEXT",e[e.BUILT_IN_INTEGRATION=2]="BUILT_IN_INTEGRATION",e[e.BOT=3]="BOT",e[e.PLACEHOLDER=4]="PLACEHOLDER"})(Ge||(Ge={}));(function(e){e[e.SUB_COMMAND=1]="SUB_COMMAND",e[e.SUB_COMMAND_GROUP=2]="SUB_COMMAND_GROUP",e[e.STRING=3]="STRING",e[e.INTEGER=4]="INTEGER",e[e.BOOLEAN=5]="BOOLEAN",e[e.USER=6]="USER",e[e.CHANNEL=7]="CHANNEL",e[e.ROLE=8]="ROLE",e[e.MENTIONABLE=9]="MENTIONABLE",e[e.NUMBER=10]="NUMBER",e[e.ATTACHMENT=11]="ATTACHMENT"})(Hr||(Hr={}));(function(e){e[e.CHAT=1]="CHAT",e[e.USER=2]="USER",e[e.MESSAGE=3]="MESSAGE"})(Ve||(Ve={}))});var Sn={};D(Sn,{patchCommands:()=>_n,registerCommand:()=>xn});function _n(){let e=y("getBuiltInCommands",bt,function(t,n){let[r]=t;if(r===Ve.CHAT)return[...n,...wn]});return function(){wn=[],e()}}function xn(e){for(let t in e){let n=bt.getBuiltInCommands(Ve.CHAT,!0,!1);n.sort(function(a,i){return parseInt(i.id)-parseInt(a.id)});let r=n[n.length-1],o=e[t];e[t]={id:(parseInt(r.id,10)-1).toString(),displayName:o.name,displayDescription:o.description,type:Ve.CHAT,inputType:Ge.BUILT_IN,...o,__isOpti:!0}}wn.push(...e)}var wn,xt=s(()=>{"use strict";ot();h();C();wn=[]});var ei,ti,ni,$r,jr=s(()=>{"use strict";ei=function(e){return{status:"fulfilled",value:e}},ti=function(e){return{status:"rejected",reason:e}},ni=function(e){return Promise.resolve(e).then(ei,ti)},$r=function(e){return Promise.all(Array.from(e).map(ni))}});var d,J,z=s(()=>{"use strict";X();d=_e(ce(we("VENDETTA_SETTINGS"))),J=_e(ce(ke("vendetta_loader.json")))});var Bn={};D(Bn,{evalPlugin:()=>zr,fetchPlugin:()=>He,getDisabledPlugins:()=>Nn,getPluginList:()=>Pn,getPlugins:()=>Cn,getSettings:()=>Dn,initPlugins:()=>In,installPlugin:()=>Te,plugins:()=>M,pluginsList:()=>vn,removePlugin:()=>An,startPlugin:()=>$e,stopPlugin:()=>je,stoppedPlugins:()=>Tn});async function He(e){e.endsWith("/")||(e+="/");let t=M[e],n;try{n=await(await be(e+"manifest.json",{cache:"no-store"})).json()}catch{throw new Error(`Failed to fetch manifest for ${e}`)}let r;if(t?.manifest.hash!==n.hash)try{r=await(await be(e+(n.main||"index.js"),{cache:"no-store"})).text()}catch{}if(!r&&!t)throw new Error(`Failed to fetch JS for ${e}`);M[e]={id:e,manifest:n,enabled:t?.enabled??!1,update:t?.update??!0,js:r??t.js}}async function Te(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.endsWith("/")||(e+="/"),typeof e!="string"||e in M)throw new Error("Plugin already installed");await He(e),t&&await $e(e)}async function zr(e){let t={...window.vendetta,plugin:{id:e.id,manifest:e.manifest,storage:await ce(we(e.id))},logger:new on(`Opti \xBB ${e.manifest.name}`)},n=`vendetta=>{return ${e.js}} //# sourceURL=${e.id}`,r=(0,eval)(n)(t),o=typeof r=="function"?r():r;return o?.default??o??{}}async function $e(e){e.endsWith("/")||(e+="/");let t=M[e];if(!t)throw new Error("Attempted to start non-existent plugin");try{let n=await zr(t);ve[e]=n,n.onLoad?.(),vn.push(" "+t.manifest.name),t.enabled=!0}catch(n){Tn.push(" "+t.id),P.error(`Plugin ${t.id} errored whilst loading, and will be unloaded`,n);try{ve[t.id]?.onUnload?.()}catch(r){P.error(`Plugin ${t.id} errored whilst unloading`,r)}delete ve[e],t.enabled=!1}}function je(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e.endsWith("/")||(e+="/");let n=M[e],r=ve[e];if(!n)throw new Error("Attempted to stop non-existent plugin");try{r?.onUnload?.()}catch(o){P.error(`Plugin ${n.id} errored whilst unloading`,o)}delete ve[e],t&&(n.enabled=!1)}async function An(e){e.endsWith("/")||(e+="/"),M[e].enabled&&je(e),delete M[e],await tn(e)}async function In(){await Fe(d),await Fe(M);let e=Object.keys(M);return await $r(e.filter(function(t){return M[t].enabled}).map(async function(t){return M[t].update&&await He(t).catch(function(n){return P.error(n.message)}),await $e(t)})),e.filter(function(t){return!M[t].enabled&&M[t].update}).forEach(function(t){return He(t)}),ri}function Cn(){var e=0;return Object.keys(ve).forEach(function(t){return e++}),e}function Pn(){return vn.sort()}function Nn(){return Tn.sort()}var M,ve,vn,Tn,ri,Dn,de=s(()=>{"use strict";se();X();jr();Ie();z();M=_e(ce(we("VENDETTA_PLUGINS"))),ve={},vn=new Array,Tn=new Array;ri=function(){return Object.keys(ve).forEach(function(e){return je(e,!1)})};Dn=function(e){return ve[e]?.settings}});var Ne,Wr,Kr=s(()=>{"use strict";ot();h();Ee();Ne=ie(),Wr=[{name:"debug",description:"Prints Optis debug information to chat.",inputType:Ge.BUILT_IN,__isOpti:!0,execute(e,t){let n=`**Opti Debug Info** > **Opti Version**: ${Ne.vendetta.version} > **Discord Version**: ${Ne.discord.version} (Build ${Ne.discord.build}) > **Device**: ${Ne.device.brand} (${Ne.os.name} ${Ne.os.version}) > **Codename/Machine ID**: ${Ne.device.codename}`;rt.sendMessage(t.channel.id,{content:n})}}]});var Yr,Xr=s(()=>{"use strict";h();de();Yr=[{name:"plugins list",description:"Lists all Opti plugins.",execute(e,t){let n=`**Enabled Plugins (${Cn()}):** > ${Pn()} **Disabled Plugins:** > ${Nn()}`;rt.sendMessage(t.channel.id,{content:n})}}]});var Jr,Qr=s(()=>{"use strict";Re();Jr=[{name:"reload",description:"Reload Discord.",execute(){Ae.reload()}}]});function Zr(){let e=[...Wr,...Jr,...Yr];xn(e)}var qr=s(()=>{"use strict";xt();Kr();Xr();Qr()});var Fn={};D(Fn,{BADGES:()=>oi,DISCORD_SERVER:()=>On,DISCORD_SERVER_ID:()=>Mn,GITHUB:()=>kn,HTTP_REGEX:()=>ai,HTTP_REGEX_MULTI:()=>st,PLUGINS_CHANNEL_ID:()=>Ln,PROXY_PREFIX:()=>De,THEMES_CHANNEL_ID:()=>at,VENDETTA_PROXY:()=>it});var On,Mn,Ln,at,kn,oi,De,it,ai,st,Be=s(()=>{"use strict";On="https://discord.gg/zm5MWBPeRp",Mn="1228081962883747880",Ln="1228464451846672465",at="1228464459295756358",kn="https://github.com/opti-mod",oi="https://raw.githubusercontent.com/opti-mod/badges/main/",De="https://opti-mod.github.io/proxy/",it="https://vd-plugins.github.io/proxy/",ai=/^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/,st=/https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g});function ze(e){let{label:t,icon:n,noPadding:r=!1,noAnimation:o=!1,children:a}=e,{FormRow:i,FormDivider:m}=E,[g,l]=React.useState(!0);return React.createElement(React.Fragment,null,React.createElement(i,{label:t,leading:n&&React.createElement(i.Icon,{source:f(n)}),trailing:React.createElement(i.Arrow,{style:{transform:[{rotate:`${g?180:90}deg`}]}}),onPress:function(){l(!g),o||u.LayoutAnimation.configureNext(u.LayoutAnimation.Presets.easeInEaseOut)}}),!g&&React.createElement(React.Fragment,null,React.createElement(m,null),React.createElement(u.View,{style:!r&&{paddingHorizontal:15}},a)))}var eo=s(()=>{"use strict";h();v();G()});function to(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var no=s(()=>{});function ro(e,t){for(var n=0;n{});function io(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var so=s(()=>{});function St(e,t){return St=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},St(e,t)}var co=s(()=>{});function lo(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&St(e,t)}var uo=s(()=>{co()});function ct(e){return ct=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ct(e)}var fo=s(()=>{});function mo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var po=s(()=>{});function go(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var ho=s(()=>{});function yo(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}var Ro=s(()=>{});function Eo(e,t){return t&&(yo(t)==="object"||typeof t=="function")?t:go(e)}var bo=s(()=>{ho();Ro()});function wo(e){var t=mo();return function(){var r=ct(e),o;if(t){var a=ct(this).constructor;o=Reflect.construct(r,arguments,a)}else o=r.apply(this,arguments);return Eo(this,o)}}var _o=s(()=>{fo();po();bo()});var vt,ii,V,Un=s(()=>{"use strict";no();ao();so();uo();_o();h();G();vt=N.createThemedStyleSheet({view:{flex:1,flexDirection:"column",margin:10},title:{fontSize:20,textAlign:"center",marginBottom:5},br:{fontSize:0,padding:1}}),V=function(e){"use strict";lo(n,e);var t=wo(n);function n(r){to(this,n);var o;return o=t.call(this,r),o.state={hasErr:!1},o}return oo(n,[{key:"render",value:function(){var o=this;return this.state.hasErr?x.createElement(u.ScrollView,{style:vt.view},x.createElement(E.FormText,{style:vt.title},"Opti has encountered an error."),x.createElement(lt,{selectable:!0,style:{marginBottom:5,maxHeight:400}},this.state.errStack),x.createElement(E.FormText,{style:vt.br}," "),x.createElement(ae,{color:ae.Colors.RED,size:ae.Sizes.MEDIUM,look:ae.Looks.FILLED,onPress:function(){return o.setState({hasErr:!1})},text:"Retry"}),x.createElement(E.FormText,{style:vt.br}," "),x.createElement(ae,{color:ae.Colors.BRAND,size:ae.Sizes.MEDIUM,look:ae.Looks.FILLED,onPress:function(){return U.setString(""+o.state.errStack)},text:"Copy"})):this.props.children}}]),n}(ii=x.Component);io(V,"getDerivedStateFromError",function(e){return{hasErr:!0,errText:e.message,errName:e.name,errCause:e.cause,errStack:e.stack}})});var Gn={};D(Gn,{rawColors:()=>si,semanticColors:()=>I});var I,si,We=s(()=>{"use strict";h();ne();I=le?.default?.colors??xe?.ThemeColorMap,si=le?.default?.unsafe_rawColors??xe?.Colors});function lt(e){let{selectable:t,style:n,children:r}=e;return t?u.Platform.select({ios:React.createElement(ci,{style:n,children:r}),default:React.createElement(xo,{style:n,children:r,selectable:!0})}):React.createElement(xo,{style:n,children:r})}var So,ci,xo,vo=s(()=>{"use strict";h();We();So=N.createThemedStyleSheet({codeBlock:{fontFamily:xe.Fonts.CODE_SEMIBOLD,fontSize:12,textAlignVertical:"center",backgroundColor:I.BACKGROUND_SECONDARY,color:I.TEXT_NORMAL,borderWidth:1,borderRadius:4,borderColor:I.BACKGROUND_TERTIARY,padding:10}}),ci=function(e){let{style:t,children:n}=e;return React.createElement(u.TextInput,{editable:!1,multiline:!0,style:[So.codeBlock,t&&t],value:n})},xo=function(e){let{selectable:t,style:n,children:r}=e;return React.createElement(u.Text,{selectable:t,style:[So.codeBlock,n&&n]},r)}});function Ke(e){let{onChangeText:t,placeholder:n,style:r}=e;return React.createElement(li,{style:[ui.search,r],placeholder:n,onChangeText:t})}var li,ui,To=s(()=>{"use strict";h();w();li=O("StaticSearchBarContainer"),ui=N.createThemedStyleSheet({search:{margin:0,padding:0,borderBottomWidth:0,backgroundColor:"none"}})});var Hn={};D(Hn,{Alert:()=>Vn,Button:()=>ae,Codeblock:()=>lt,ErrorBoundary:()=>V,Forms:()=>E,General:()=>fi,HelpMessage:()=>mi,SafeAreaView:()=>di,Search:()=>Ke,Summary:()=>ze});var E,fi,Vn,ae,mi,di,G=s(()=>{"use strict";w();eo();Un();vo();To();E=c("Form","FormSection"),fi=c("Button","Text","View"),Vn=Vt("FluxContainer(Alert)"),ae=c("Looks","Colors","Sizes"),mi=O("HelpMessage"),di=c("useSafeAreaInsets").SafeAreaView});function Ao(){return y("default",pi,function(e,t){let[{thread:n}]=e;if(n.guild_id!==Mn)return;let r;if(n.parent_id===Ln)r="Plugin";else if(n.parent_id===at&&window.__vendetta_loader?.features.themes)r="Theme";else return;let{firstMessage:o}=yi(n),a=o?.content?.match(st);if(!a)return;r==="Plugin"?a=a.filter(function(l){return l.startsWith(De)}):a=a.filter(function(l){return l.endsWith(".json")});let i=a[0];if(!i)return;let m=$(t,function(l){return l?.[0]?.key}),g=m[0].type;m.unshift(React.createElement(g,{key:"install"},React.createElement(gi,{leading:React.createElement(hi,{style:{opacity:1},source:f("ic_download_24px")}),label:`Install ${r}`,onPress:function(){return(r==="Plugin"?Te:Ce)(i).then(function(){R(`Successfully installed ${n.name}`,f("Check"))}).catch(function(l){R(l.message,f("Small"))}).finally(function(){return Ri()})}})))})}var pi,gi,hi,yi,Ri,Io=s(()=>{"use strict";w();Be();C();de();ne();se();v();oe();G();pi=O("ForumPostLongPressActionSheet",!1),{FormRow:gi,FormIcon:hi}=E,{useFirstForumPostMessage:yi}=c("useFirstForumPostMessage"),{hideActionSheet:Ri}=c("openLazy","hideActionSheet")});function $n(e){let{title:t,confirmText:n,confirmColor:r,onConfirm:o,cancelText:a,placeholder:i,initialValue:m="",secureTextEntry:g}=e,[l,b]=React.useState(m),[S,p]=React.useState("");function _(){Promise.resolve(o(l)).then(function(){Co.close()}).catch(function(Z){p(Z.message)})}return React.createElement(Vn,{title:t,confirmText:n,confirmColor:r,isConfirmButtonDisabled:S.length!==0,onConfirm:_,cancelText:a,onCancel:function(){return Co.close()}},React.createElement(Ei,{placeholder:i,value:l,onChange:function(A){b(typeof A=="string"?A:A.text),S&&p("")},returnKeyType:"done",onSubmitEditing:_,error:S||void 0,secureTextEntry:g,autoFocus:!0,showBorder:!0,style:{paddingVertical:5,alignSelf:"stretch",paddingHorizontal:0}}))}var Ei,Co,Po=s(()=>{"use strict";w();G();({FormInput:Ei}=E),Co=c("openLazy","close")});var zn={};D(zn,{showConfirmationAlert:()=>Q,showCustomAlert:()=>Do,showInputAlert:()=>jn});function Q(e){let t=e;return t.body=e.content,delete t.content,t.isDismissable??=!0,No.show(t)}var No,Do,jn,Oe=s(()=>{"use strict";w();Po();No=c("openLazy","close");Do=function(e,t){return No.openLazy({importer:async function(){return function(){return React.createElement(e,t)}}})},jn=function(e){return Do($n,e)}});function Bo(e){return e.startsWith(De)||e.startsWith(it)?"Plugin":e.endsWith(".json")&&window.__vendetta_loader?.features.themes?"Theme":void 0}function Oo(e,t){(e==="Plugin"?Te:Ce)(t).then(function(){R("Successfully installed",f("Check"))}).catch(function(n){R(n.message,f("Small"))})}function Mo(){let e=new Array;return e.push(y("showSimpleActionSheet",bi,function(t){if(t[0].key!=="LongPressUrl")return;let{header:{title:n},options:r}=t[0],o=Bo(n);o&&r.push({label:`Install ${o}`,onPress:function(){return Oo(o,n)}})})),e.push(Y("handleClick",wi,async function(t,n){let{href:r}=t[0],o=Bo(r);if(!o)return n.apply(this,t);if(o==="Theme"&&Si(xi())?.parent_id!==at)return n.apply(this,t);Q({title:"Hold Up",content:["This link is a ",React.createElement(u.Text,{style:vi["text-md/semibold"]},o),", would you like to install it?"],onConfirm:function(){return Oo(o,r)},confirmText:"Install",cancelText:"Cancel",secondaryConfirmText:"Open in Browser",onConfirmSecondary:function(){return _i(r)}})})),function(){return e.forEach(function(t){return t()})}}var bi,wi,_i,xi,Si,vi,Lo=s(()=>{"use strict";w();h();Be();C();de();ne();Oe();v();oe();bi=W(function(e){return e?.showSimpleActionSheet&&!Object.getOwnPropertyDescriptor(e,"showSimpleActionSheet")?.get}),wi=c("handleClick"),{openURL:_i}=Ue,{getChannelId:xi}=mn,{getChannel:Si}=c("getChannel"),{TextStyleSheet:vi}=c("TextStyleSheet")});function Wn(){let e=new Array;return e.push(Ao()),e.push(Mo()),function(){return e.forEach(function(t){return t()})}}var ko=s(()=>{"use strict";Io();Lo()});function Kn(e){let{alertTitle:t,installFunction:n}=e;return React.createElement(u.TouchableOpacity,{onPress:function(){return U.getString().then(function(r){return jn({title:t,initialValue:r.match(st)?.[0]??"",placeholder:"https://example.com/",onConfirm:function(o){return n(o)},confirmText:"Install",cancelText:"Cancel"})})}},React.createElement(u.Image,{style:Ti.icon,source:f("ic_add_24px")}))}var Ti,Fo=s(()=>{"use strict";h();Be();Oe();v();We();Ti=N.createThemedStyleSheet({icon:{marginRight:10,tintColor:I.HEADER_PRIMARY}})});function Yn(e){let{asset:t}=e;return React.createElement(Ai,{label:`${t.name} - ${t.id}`,trailing:React.createElement(u.Image,{source:t.id,style:{width:32,height:32}}),onPress:function(){U.setString(t.name),R("Copied asset name to clipboard.",f("toast_copy_link"))}})}var Ai,Uo=s(()=>{"use strict";h();oe();v();G();({FormRow:Ai}=E)});function Xn(){let[e,t]=React.useState("");return React.createElement(V,null,React.createElement(u.View,{style:{flex:1}},React.createElement(Ke,{style:{margin:10},onChangeText:function(n){return t(n)},placeholder:"Search Assets"}),React.createElement(u.FlatList,{data:Object.values(me).filter(function(n){return n.name.includes(e)||n.id.toString()===e}),renderItem:function(n){let{item:r}=n;return React.createElement(Yn,{asset:r})},ItemSeparatorComponent:Ii,keyExtractor:function(n){return n.name}})))}var Ii,Go=s(()=>{"use strict";h();v();G();Uo();({FormDivider:Ii}=E)});function Tt(e){let{label:t,version:n,icon:r}=e;return React.createElement(Vo,{label:t,leading:React.createElement(Vo.Icon,{source:f(r)}),trailing:React.createElement(Ci,{style:{fontSize:13}},n),onPress:function(){U.setString(`${t} - ${n}`),R("Copied version to clipboard.",f("toast_copy_link"))}})}var Vo,Ci,Ho=s(()=>{"use strict";h();v();oe();G();({FormRow:Vo,FormText:Ci}=E)});function Jn(){let e=fe.useNavigation();k(d),k(J);let t=[{label:"Discord Version",version:`${L.discord.version} (${L.discord.build})`,icon:"Discord"},{label:"React",version:L.react.version,icon:"ic_category_16px"},{label:"React Native",version:L.react.nativeVersion,icon:"mobile"},{label:"Bytecode",version:L.hermes.bytecodeVersion,icon:"ic_server_security_24px"}],n=[{label:"Loader",version:L.vendetta.loader,icon:"ic_download_24px"},{label:"OS",version:`${L.os.name} ${L.os.version}`,icon:"ic_cog_24px"},...L.os.sdk?[{label:"SDK",version:L.os.sdk,icon:"ic_profile_badge_verified_developer_color"}]:[],{label:"Manufacturer",version:L.device.manufacturer,icon:"ic_badge_staff"},{label:"Brand",version:L.device.brand,icon:"ic_settings_boost_24px"},{label:"Model",version:L.device.model,icon:"ic_phonelink_24px"},{label:u.Platform.select({android:"Codename",ios:"Machine ID"}),version:L.device.codename,icon:"ic_compose_24px"}];return React.createElement(V,null,React.createElement(u.ScrollView,{style:{flex:1},contentContainerStyle:{paddingBottom:38}},React.createElement(At,{title:"Important",titleStyleType:"no_border"},React.createElement(T,{label:"Opti Version",leading:React.createElement(T.Icon,{source:{uri:"https://raw.githubusercontent.com/Opti-mod/assets/main/LogoOpti.png"}}),trailing:React.createElement(Pi,{style:{fontSize:13,color:"white"}},L.vendetta.version),onPress:function(){return U.setString(L.vendetta.version)}}),React.createElement(H,null),React.createElement(T,{label:"Discord Server",leading:React.createElement(T.Icon,{source:f("Discord")}),trailing:T.Arrow,onPress:function(){return Ue.openDeeplink(On)}}),React.createElement(H,null),React.createElement(T,{label:"GitHub Repository",leading:React.createElement(T.Icon,{source:f("img_account_sync_github_white")}),trailing:T.Arrow,onPress:function(){return Ue.openURL(kn)}})),React.createElement(At,{title:"Actions"},React.createElement(T,{label:"Reload Discord",leading:React.createElement(T.Icon,{source:f("ic_message_retry")}),onPress:function(){return Ae.reload()}}),React.createElement(H,null),React.createElement(T,{label:"Asset Browser",leading:React.createElement(T.Icon,{source:f("ic_image")}),trailing:T.Arrow,onPress:function(){return e.push("VendettaCustomPage",{title:"Asset Browser",render:Xn})}}),React.createElement(H,null)),React.createElement(At,{title:"Info"},React.createElement(ze,{label:"Versions",icon:"ic_information_filled_24px"},t.map(function(r,o){return React.createElement(React.Fragment,null,React.createElement(Tt,{label:r.label,version:r.version,icon:r.icon}),o!==t.length-1&&React.createElement(H,null))})),React.createElement(H,null),React.createElement(ze,{label:"Platform",icon:"ic_mobile_device"},n.map(function(r,o){return React.createElement(React.Fragment,null,React.createElement(Tt,{label:r.label,version:r.version,icon:r.icon}),o!==n.length-1&&React.createElement(H,null))})),React.createElement(H,null)),React.createElement(At,{title:"Developer"},React.createElement(jo,{value:d.debuggerUrl,onChange:function(r){return d.debuggerUrl=r},placeholder:"127.0.0.1:9090",title:"Debugger URL"}),React.createElement(H,null),React.createElement(T,{label:"Connect to debug websocket",leading:React.createElement(T.Icon,{source:f("copy")}),onPress:function(){return Rn(d.debuggerUrl)}}),window.__vendetta_rdc&&React.createElement(React.Fragment,null,React.createElement(H,null),React.createElement(T,{label:"Connect to React DevTools",leading:React.createElement(T.Icon,{source:f("ic_badge_staff")}),onPress:function(){return window.__vendetta_rdc?.connectToDevTools({host:d.debuggerUrl.split(":")?.[0],resolveRNStyle:u.StyleSheet.flatten})}})),window.__vendetta_loader?.features.loaderConfig&&React.createElement(React.Fragment,null,React.createElement($o,{label:"Load from custom url",subLabel:"Load Opti from a custom endpoint.",leading:React.createElement(T.Icon,{source:f("copy")}),value:J.customLoadUrl.enabled,onValueChange:function(r){J.customLoadUrl.enabled=r}}),React.createElement(H,null),J.customLoadUrl.enabled&&React.createElement(React.Fragment,null,React.createElement(jo,{value:J.customLoadUrl.url,onChange:function(r){return J.customLoadUrl.url=r},placeholder:"http://localhost:4040/vendetta.js",title:"OPTI URL"}),React.createElement(H,null)),window.__vendetta_loader.features.devtools&&React.createElement($o,{label:"Load React DevTools",subLabel:`Version: ${window.__vendetta_loader.features.devtools.version}`,leading:React.createElement(T.Icon,{source:f("ic_badge_staff")}),value:J.loadReactDevTools,onValueChange:function(r){J.loadReactDevTools=r}}),React.createElement(H,null)))))}var T,$o,At,H,jo,Pi,L,zo=s(()=>{"use strict";h();Be();Ee();X();Re();v();G();z();z();Go();Ho();Ee();({FormRow:T,FormSwitchRow:$o,FormSection:At,FormDivider:H,FormInput:jo,FormText:Pi}=E),L=ie()});function It(e){let{items:t,card:n}=e;k(d),k(t);let[r,o]=React.useState("");return React.createElement(V,null,React.createElement(u.FlatList,{ListHeaderComponent:React.createElement(React.Fragment,null,React.createElement(u.View,{style:{marginBottom:10}}),React.createElement(Ke,{style:{marginBottom:10},onChangeText:function(a){return o(a.toLowerCase())},placeholder:"Search"})),style:{paddingHorizontal:10,paddingTop:20},contentContainerStyle:{paddingBottom:20},data:Object.values(t).filter(function(a){return a.id?.toLowerCase().includes(r)}),renderItem:function(a){let{item:i,index:m}=a;return React.createElement(n,{item:i,index:m})}}))}var Wo=s(()=>{"use strict";h();X();G();z()});function ft(e){let t=e.toggleValue??!1;return React.createElement(u.View,{style:[Me.card,{marginTop:e.index!==0?10:0}]},React.createElement(ut,{style:Me.header,label:function(){return React.createElement(u.View,null,React.createElement(u.Text,{style:Me.headertitle},e.headerLabel))},leading:e.headerIcon&&React.createElement(ut.Icon,{source:f(e.headerIcon)}),trailing:e.toggleType&&(e.toggleType==="switch"?React.createElement(Ni,{style:u.Platform.OS==="android"&&{marginVertical:-15},value:e.toggleValue,onValueChange:e.onToggleChange}):React.createElement(u.Pressable,{onPress:function(){t=!t,e.onToggleChange?.(t)}},React.createElement(Di,{selected:e.toggleValue}))),optiLogo:e.optiLogo&&React.createElement(u.View,null,React.createElement(ut.Icon,{source:{uri:"https://raw.githubusercontent.com/Opti-mod/assets/main/LogoOpti.png"}}))}),React.createElement(Bi,null),React.createElement(ut,{label:function(){return React.createElement(u.View,null,React.createElement(u.Text,{style:Me.description},e.descriptionLabel))},trailing:React.createElement(u.View,{style:Me.actions},e.overflowActions&&React.createElement(u.TouchableOpacity,{onPress:function(){return Mi({key:"CardOverflow",header:{title:e.overflowTitle,icon:e.headerIcon&&React.createElement(ut.Icon,{style:{marginRight:8},source:f(e.headerIcon)}),onClose:function(){return Oi()}},options:e.overflowActions?.map(function(n){return{...n,icon:f(n.icon)}})})}},React.createElement(u.Image,{style:Me.icon,source:f("ic_more_24px")})),e.actions?.map(function(n){let{icon:r,onPress:o}=n;return React.createElement(u.TouchableOpacity,{onPress:o},React.createElement(u.Image,{style:Me.icon,source:f(r)}))}))}))}var ut,Ni,Di,Bi,Oi,Mi,Me,Qn=s(()=>{"use strict";h();w();v();We();G();({FormRow:ut,FormSwitch:Ni,FormRadio:Di,FormDivider:Bi}=E),{hideActionSheet:Oi}=c("openLazy","hideActionSheet"),{showSimpleActionSheet:Mi}=c("showSimpleActionSheet"),Me=N.createThemedStyleSheet({card:{backgroundColor:I.BACKGROUND_SECONDARY,borderRadius:7,borderColor:I.BACKGROUND_TERTIARY,borderWidth:1},header:{padding:0,backgroundColor:I.PRIMARY_DARK,color:I.HEADER_PRIMARY,borderTopLeftRadius:5,borderTopRightRadius:5},headertitle:{fontFamily:xe.Fonts.PRIMARY_BOLD,fontSize:17,color:I.HEADER_PRIMARY},description:{color:I.TEXT_MUTED,fontSize:13},authors:{color:I.HEADER_SECONDARY,fontSize:14},actions:{flexDirection:"row-reverse",alignItems:"center"},icon:{width:22,height:22,marginLeft:5,tintColor:I?.INTERACTIVE_NORMAL}})});async function Ko(e,t){e.enabled&&je(e.id,!1),t(),e.enabled&&await $e(e.id)}function Zn(e){let{item:t,index:n}=e,r=Dn(t.id),o=fe.useNavigation(),[a,i]=React.useState(!1),m=t.manifest.authors,g=t.manifest.vendetta?.version??"";return a?null:React.createElement(ft,{index:n,headerLabel:`${t.manifest.name} ${g}`,headerIcon:t.manifest.vendetta?.icon||"ic_application_command_24px",toggleType:"switch",toggleValue:t.enabled,onToggleChange:function(l){try{l?$e(t.id):je(t.id)}catch(b){R(b.message,f("Small"))}},descriptionLabel:`${t.manifest.description} Authors: ${m.map(function(l){return l.name}).join(", ")}`,overflowTitle:t.manifest.name,overflowActions:[{label:"View Creator Profile",icon:"ic_profile_24px",onPress:function(){et.getUser(t.manifest.authors[0]?.id)?Pe.showUserProfile({userId:t.manifest.authors[0]?.id}):tt.fetchProfile(t.manifest.authors[0]?.id).then(function(){Pe.showUserProfile({userId:t.manifest.authors[0]?.id})})}},{icon:"RetryIcon",label:"Refetch",onPress:async function(){Ko(t,function(){He(t.id).then(async function(){R("Successfully refetched plugin.",f("toast_image_saved"))}).catch(function(){R("Failed to refetch plugin!",f("Small"))})})}},{icon:"copy",label:"Copy URL",onPress:function(){U.setString(t.id),R("Copied plugin URL to clipboard.",f("toast_copy_link"))}},{icon:"ic_download_24px",label:t.update?"Disable updates":"Enable updates",onPress:function(){t.update=!t.update,R(`${t.update?"Enabled":"Disabled"} updates for ${t.manifest.name}.`,f("toast_image_saved"))}},{icon:"ic_duplicate",label:"Clear Data",isDestructive:!0,onPress:function(){return Q({title:"Wait!",content:`Are you sure you wish to clear the data of ${t.manifest.name}?`,confirmText:"Clear",cancelText:"Cancel",confirmColor:Se.RED,onConfirm:function(){Ko(t,function(){try{ye.removeItem(t.id),R(`Cleared data for ${t.manifest.name}.`,f("trash"))}catch{R(`Failed to clear data for ${t.manifest.name}!`,f("Small"))}})}})}},{icon:"ic_message_delete",label:"Delete",isDestructive:!0,onPress:function(){return Q({title:"Wait!",content:`Are you sure you wish to delete ${t.manifest.name}? This will clear all of the plugin's data.`,confirmText:"Delete",cancelText:"Cancel",confirmColor:Se.RED,onConfirm:function(){try{An(t.id),i(!0)}catch(l){R(l.message,f("Small"))}}})}}],actions:[...r?[{icon:"settings",onPress:function(){return o.push("VendettaCustomPage",{title:t.manifest.name,render:r})}}]:[]]})}var Yo=s(()=>{"use strict";ot();h();de();Re();v();oe();Oe();Qn()});async function Xo(e,t){await ht(e?t:"default"),Ae.reload()}function qn(e){let{item:t,index:n}=e;k(d);let[r,o]=React.useState(!1),a=t.data.authors;return r?null:React.createElement(ft,{index:n,headerLabel:`${t.data.name}`,headerIcon:"ic_theme_24px",descriptionLabel:t.data.description??"No description.",toggleType:"switch",toggleValue:t.selected,onToggleChange:function(i){Xo(i,t.id)},overflowTitle:t.data.name,overflowActions:[{label:"View Creator Profile",icon:"ic_profile_24px",onPress:function(){et.getUser(t.data.authors[0]?.id)?Pe.showUserProfile({userId:t.data.authors[0]?.id}):tt.fetchProfile(t.data.authors[0]?.id).then(function(){Pe.showUserProfile({userId:t.data.authors[0]?.id})})}},{icon:"ic_sync_24px",label:"Refetch",onPress:function(){Ze(t.id,t.selected).then(function(){t.selected?Q({title:"Theme refetched",content:"A reload is required to see the changes. Do you want to reload now?",confirmText:"Reload",cancelText:"Cancel",confirmColor:Se.RED,onConfirm:function(){return Ae.reload()}}):R("Successfully refetched theme.",f("toast_image_saved"))}).catch(function(){R("Failed to refetch theme!",f("Small"))})}},{icon:"copy",label:"Copy URL",onPress:function(){U.setString(t.id),R("Copied shader URL to clipboard.",f("toast_copy_link"))}},{icon:"ic_message_delete",label:"Delete",isDestructive:!0,onPress:function(){return Q({title:"Wait!",content:`Are you sure you wish to delete ${t.data.name}?`,confirmText:"Delete",cancelText:"Cancel",confirmColor:Se.RED,onConfirm:function(){cn(t.id).then(function(i){o(!0),i&&Xo(!1,t.id)}).catch(function(i){R(i.message,f("Small"))})}})}}]})}var Jo=s(()=>{"use strict";ot();h();ne();X();Re();v();Oe();oe();z();Qn()});function Ct(){console.log("TweakManager has loaded SilentTyping."),Qo=["startTyping","stopTyping"].map(function(e){return Y(e,Li,function(){})})}function Pt(){Qo.forEach(function(e){return e()})}var Li,Qo,er=s(()=>{"use strict";C();w();Li=c("startTyping"),Qo=[]});function Nt(){console.log("TweakManager has loaded RemoveChatButtons.");let e=["ic_thread_normal_24px","ic_gift","AppsIcon"].map(function(t){return f(t)});Zo=y("render",ki.prototype,function(t,n){let r=$(n,function(a){return a.props?.canSendVoiceMessage});r&&(r.props.canSendVoiceMessage=!1);let o=$(n,function(a){return"forceAnimateButtons"in a.props&&a.props.actions});o.props.actions=o.props.actions.filter(function(a){return!e.includes(a.source)})})}function Dt(){}var ki,Zo,tr=s(()=>{"use strict";C();w();v();se();ki=O("ChatInput")});function Bt(){console.log("TweakManager has loaded RemovePrompts.");let e=c("show","openLazy");qo=Y("show",e,function(t,n){t?.[0]?.title===re.Messages.DELETE_MESSAGE||t?.[0]?.title===re.Messages.PIN_MESSAGE?t[0].onConfirm?.():n(...t)}),ea.push(y("isTrustedDomain",Fi,function(){return!0}))}function Ot(){for(let e of ea)e()}var Fi,qo,ea,nr=s(()=>{"use strict";C();w();h();C();w();Fi=ee("MaskedLinkStore"),ea=[]});function rr(){return k(d),d.tweaks??={},React.createElement(V,null,React.createElement(u.View,{style:{flex:1}},React.createElement(pe,{label:"Tweaks are small QoL adjustments that you can enable."}),React.createElement(Mt,null),React.createElement(pe,{label:d.tweaks.silentTyping?.valueOf()?"Silent Typing (Enabled)":"Silent Typing (Disabled)",subLabel:"Hides that you are typing to other people.",leading:React.createElement(pe.Icon,{source:f("bell")}),onPress:function(){d.tweaks.silentTyping??=!1,d.tweaks.silentTyping=!d.tweaks.silentTyping,(d.tweaks.silentTyping?Ct:Pt)()}}),React.createElement(Mt,null),React.createElement(pe,{label:d.tweaks.hideButtons?.valueOf()?"Remove Chat Buttons (Enabled)":"Remove Chat Buttons (Disabled)",subLabel:"Removes the Gift, Voice Message, and Activities buton.",leading:React.createElement(pe.Icon,{source:f("ic_trash_24px")}),onPress:function(){d.tweaks.hideButtons??=!1,d.tweaks.hideButtons=!d.tweaks.hideButtons,(d.tweaks.hideButtons?Nt:Dt)()}}),React.createElement(Mt,null),React.createElement(pe,{label:d.tweaks.removePrompts?.valueOf()?"Remove Prompts (Enabled)":"Remove Prompts (Disabled)",subLabel:"Removes the pin, delete, and trusted URL prompts for messages.",leading:React.createElement(pe.Icon,{source:f("ic_message_delete")}),onPress:function(){d.tweaks.removePrompts??=!0,d.tweaks.removePrompts=!d.tweaks.removePrompts,(d.tweaks.removePrompts?Bt:Ot)()}}),React.createElement(Mt,null),React.createElement(pe,{label:d.tweaks.externalbadges?.valueOf()?"Custom Badges (Enabled)":"Custom Badges (Disabled)",subLabel:"Loads Opti badges.",leading:React.createElement(pe.Icon,{source:f("ic_person_shield")}),onPress:function(){d.tweaks.externalbadges??=!0,d.tweaks.externalbadges=!d.tweaks.externalbadges}})))}var Mt,pe,ta=s(()=>{"use strict";h();G();v();er();tr();z();X();nr();({FormDivider:Mt,FormRow:pe}=E)});function or(){k(d);let[e,t]=React.useState("plugins"),n=[{id:"plugins",title:"Plugins",page:function(){return React.createElement(It,{items:M,card:Zn})}},{id:"shaders",title:"Shaders",page:function(){return React.createElement(It,{items:F,card:qn})}},{id:"tweaks",title:"Tweaks",page:function(){return React.createElement(rr,null)}}];return React.createElement(React.Fragment,null,React.createElement(u.View,{style:Gi.bar},React.createElement(Ui,{tabs:n,activeTab:e,onTabSelected:function(r){return t(r)}})),React.createElement(n.find(function(r){return r.id===e}).page))}var Ui,Gi,na=s(()=>{"use strict";X();de();ne();z();Wo();Yo();h();Jo();w();ta();({BadgableTabBar:Ui}=c("BadgableTabBar")),Gi=N.createThemedStyleSheet({bar:{padding:8}})});var Vi,om,am,im,sm,Hi,ar,Lt,Ye,mt,ra,ir,kt=s(()=>{"use strict";h();de();ne();Oe();We();oe();se();v();Un();Fo();zo();Be();G();na();({FormRow:Vi,FormSwitchRow:om,FormSection:am,FormDivider:im,FormInput:sm}=E),Hi=N.createThemedStyleSheet({container:{flex:1,backgroundColor:I.BACKGROUND_MOBILE_PRIMARY}}),ar=function(e,t){return t?wt.snakeCase(e).toUpperCase():e},Lt=function(e,t){return Object.fromEntries(e.map(function(n){return[n.key,typeof t=="function"?t(n):typeof t=="string"?n[t]:t]}))},Ye=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return[{key:ar("VendettaSettings",e),title:"Opti",icon:"ic_settings_boost_24px",render:Jn},{key:ar("VendettaAddons",e),title:"Addons",icon:"CirclePlusIcon-primary",render:or,options:{headerRight:function(){return React.createElement(Kn,{alertTitle:"Install Addon",installFunction:async function(t){if(t.endsWith(".json"))return await Ce(t);if(!t.startsWith(De)||!t.startsWith(it))setImmediate(function(){return Q({title:"Unproxied Plugin",content:"The plugin you are trying to install has not been proxied. Want to download it anyways?",confirmText:"Install",onConfirm:function(){return Te(t).then(function(){return R("Installed plugin",f("Check"))}).catch(function(n){return R(n?.message??`${n}`,f("Small"))})},cancelText:"Cancel"})});else return await Te(t)}})}}},{key:ar("VendettaCustomPage",e),title:"Opti Page",shouldRender:function(){return!1},render:function(t){let{render:n,noErrorBoundary:r,...o}=t,a=fe.useNavigation();return a.addListener("focus",function(){return a.setOptions(K(o,"render","noErrorBoundary"))}),r?React.createElement(n,null):React.createElement(V,null,React.createElement(n,null))}}]},mt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return Ye(e).filter(function(t){return t.shouldRender?.()??!0})},ra=function(){return Lt(Ye(),function(e){return{title:e.title,render:e.render,...e.options}})},ir=function(){let e=Ye(!0);return{getLayout:function(){return{title:"Opti",label:"Opti",settings:mt(!0).map(function(t){return t.key})}},titleConfig:Lt(e,"title"),relationships:Lt(e,null),rendererConfigs:Lt(e,function(t){let n=React.memo(function(r){let{navigation:o,route:a}=r;return o.addListener("focus",function(){return o.setOptions(t.options)}),React.createElement(u.View,{style:Hi.container},React.createElement(t.render,a.params))});return{type:"route",title:function(){return t.title},icon:React.createElement(Vi.Icon,null,"s.icon")?f(""+t.icon):t.icon,screen:{route:wt.chain(t.key).camelCase().upperFirst().value(),getComponent:function(){return n}}}})}}});function cr(){let e=fe.useNavigation();k(d);let t=mt();return React.createElement(V,null,React.createElement($i,{key:"Opti",title:"Opti"},t.map(function(n,r){return React.createElement(React.Fragment,null,React.createElement(sr,{label:n.title,leading:React.createElement(sr.Icon,{source:f(n.icon)}),trailing:sr.Arrow,onPress:function(){return e.push(n.key)}}),r!==t.length-1&&React.createElement(ji,null))})))}var sr,$i,ji,gm,oa=s(()=>{"use strict";h();X();v();kt();G();z();({FormRow:sr,FormSection:$i,FormDivider:ji,FormText:gm}=E)});function lr(){let e=new Array;return e.push(y("default",zi,function(t,n){return{...n,...ra()}})),y("default",Wi,function(t,n){let r=$(n.props.children,function(o){return o.type&&o.type.name==="UserSettingsOverview"});e.push(y("renderSupportAndAcknowledgements",r.type.prototype,function(o,a){let{props:{children:i}}=a,m=i.findIndex(function(g){return g?.type?.name==="UploadLogsButton"});m!==-1&&i.splice(m,1)})),e.push(y("render",r.type.prototype,function(o,a){let{props:{children:i}}=a,m=[re.Messages.BILLING_SETTINGS,re.Messages.PREMIUM_SETTINGS];i=$(i,function(l){return l.children?.[1].type?.name==="FormSection"}).children;let g=i.findIndex(function(l){return m.includes(l?.props.label)});i.splice(g===-1?4:g,0,React.createElement(cr,null))}))},!0),function(){return e.forEach(function(t){return t()})}}var zi,Wi,aa=s(()=>{"use strict";h();w();C();se();kt();oa();zi=O("getScreens",!1),Wi=O("UserSettingsOverviewWrapper",!1)});function fr(){let e=new Array;return Yi(e)||Ki(e),function(){return e.forEach(function(t){return t?.()})}}function Ki(e){let t=c("useOverviewSettings"),n=c("getSettingTitleConfig"),r=c("SETTING_RELATIONSHIPS","SETTING_RENDERER_CONFIGS"),o="getSettingSearchListItems",a="getSettingListItems",i=c(o),m=!i,g=m?a:o,l=i??c(a);if(!l||!t)return;let b=Ye(!0),S=mt(!0),p=ir();e.push(y("useOverviewSettings",t,function(Z,ge){return ia(ge,p.getLayout())})),e.push(y("getSettingTitleConfig",n,function(Z,ge){return{...ge,...p.titleConfig}})),e.push(y(g,l,function(Z,ge){let[Ta]=Z;return[...S.filter(function(q){return Ta.includes(q.key)}).map(function(q){return{type:"setting_search_result",ancestorRendererData:p.rendererConfigs[q.key],setting:q.key,title:p.titleConfig[q.key],breadcrumbs:["Opti"],icon:p.rendererConfigs[q.key].icon}}),...ge.filter(function(q){return m||!b.map(function(Ut){return Ut.key}).includes(q.setting)})].map(function(q,Ut,Aa){return{...q,index:Ut,total:Aa.length}})}));let _=r.SETTING_RELATIONSHIPS,A=r.SETTING_RENDERER_CONFIGS;return r.SETTING_RELATIONSHIPS={..._,...p.relationships},r.SETTING_RENDERER_CONFIGS={...A,...p.rendererConfigs},e.push(function(){r.SETTING_RELATIONSHIPS=_,r.SETTING_RENDERER_CONFIGS=A}),!0}function Yi(e){let t=c("SearchableSettingsList"),n=c("SETTING_RENDERER_CONFIG"),r=c("getSettingListItems");if(!r||!t||!n)return!1;let o=Ye(!0),a=ir();e.push(Xt("type",t.SearchableSettingsList,function(m){let[{sections:g}]=m;return ia(g,a.getLayout())})),e.push(y("getSettingListSearchResultItems",r,function(m,g){g.forEach(function(l){return o.some(function(b){return b.key===l.setting})&&(l.breadcrumbs=["Opti"])})}));let i=n.SETTING_RENDERER_CONFIG;return n.SETTING_RENDERER_CONFIG={...i,...a.rendererConfigs},e.push(function(){n.SETTING_RENDERER_CONFIG=i}),!0}function ia(e,t){if(!Array.isArray(e)||e.find(function(o){return ur(o,"Opti")}))return;let n=e.findIndex(function(o){return ur(o,re.Messages.ACCOUNT_SETTINGS)});e.splice(n+1,0,t);let r=e.find(function(o){return ur(o,re.Messages.SUPPORT)});r&&(r.settings=r.settings.filter(function(o){return o!=="UPLOAD_DEBUG_LOGS"}))}var ur,sa=s(()=>{"use strict";w();C();kt();h();ur=function(e,t){return e?.label===t||e?.title===t}});function mr(){let e=[lr(),fr()];return function(){return e.forEach(function(t){return t?.()})}}var ca=s(()=>{"use strict";aa();sa()});function ma(e){let{locale:t}=e;try{la&&(la.overrideTheme(Xi?.theme??"dark"),ua&&Ji.useAMOLEDTheme===2&&ua.setAMOLEDThemeEnabled(!0))}catch(n){P.error("Failed to fix theme...",n)}try{dn.locale(t.toLowerCase())}catch(n){P.error("Failed to fix timestamps...",n)}fa.unsubscribe("I18N_LOAD_SUCCESS",ma)}function da(){return fa.subscribe("I18N_LOAD_SUCCESS",ma)}var la,ua,Xi,Ji,fa,pa=s(()=>{"use strict";h();w();Ie();la=c("updateTheme","overrideTheme"),ua=c("setAMOLEDThemeEnabled"),Xi=ee("ThemeStore"),Ji=ee("UnsyncedUserSettingsStore"),fa=c("_currentDispatchActionType","_subscriptions","_actionHandlers","_waitQueue")});async function ga(e){return{patcher:K(Cr,"unpatchAll"),metro:{...Ht,common:{...pn}},constants:Fn,utils:zt,debug:K(bn,"versionHash","patchLogHook"),ui:{components:Hn,toasts:yn,alerts:zn,assets:hn,...Gn},plugins:K(Bn,"initPlugins","evalPlugin"),themes:K(un,"initThemes"),commands:K(Sn,"patchCommands"),storage:rn,settings:d,loader:{identity:window.__vendetta_loader,config:J},logger:P,version:_t,unload:function(){e.filter(function(t){return typeof t=="function"}).forEach(function(t){return t()}),delete window.vendetta}}}var ha=s(()=>{"use strict";C();Ie();z();Be();Ee();de();ne();xt();X();w();h();G();oe();Oe();v();We();se()});var Qi,Zi,qi,ya,Ra=s(()=>{"use strict";h();({View:Qi,Image:Zi,TouchableOpacity:qi}=u),ya=function(e){let{name:t,image:n,size:r,margin:o,custom:a}=e,i=N.createThemedStyleSheet({container:{flexDirection:"row",alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end"},img:{width:r,height:r,resizeMode:"contain",marginHorizontal:o}}),m=function(){return a||x.createElement(qi,{onPress:function(){return qe.open({content:t,source:{uri:n}})}},x.createElement(Zi,{style:i.img,source:{uri:n}}))};return x.createElement(Qi,{style:i.container},m())}});function Ea(){let e=O("ProfileBadges",!1);ns=y("default",e,function(t,n){let r=n,[,o]=x.useReducer(function(b){return b=!b},!1),a=t[0]?.user;if(a===void 0)return;if(Ft=Xe.get(a.id),Ft===void 0){rs(a.id,o);return}let i=r?.props?.style,{replugged:m}=Ft?.badges,g=`#${m?.custom?.color||"7289da"}`;r||(r=x.createElement(es,{style:[i,{flexDirection:"row",flexWrap:"wrap",alignItems:"flex-end",justifyContent:"flex-end",paddingVertical:2}],accessibilityRole:"list",accessibilityLabel:"User Badges"}),r.props.children=[]);let l=function(b){let{name:S,image:p,custom:_=!1}=b,A=function(){return x.createElement(ya,{custom:_,name:S,image:p,size:Array.isArray(i)?i?.find(function(ge){return ge.paddingVertical&&ge.paddingHorizontal})?16:22:16,margin:Array.isArray(i)?4:6})},Z="PUSH";r?.props?.badges?Z?r.props.badges=[x.createElement(A,null),...r.props.badges]:r.props.badges=[...r.props.badges,x.createElement(A,null)]:Z?r.props.children=[x.createElement(A,null),...r.props.children]:r.props.children=[...r.props.children,x.createElement(A,null)]};Object.entries(Ft?.badges).forEach(function(b){let[S,p]=b;if(!(d.tweaks.externalbadges?.valueOf()==!1&&S!=="opti"))switch(S){case"customBadgesArray":p&&p.badges.map(function(_){l({name:_.name,image:_.badge})});break;case"opti":p?.developer&&l({name:"Opti Developer",image:"https://raw.githubusercontent.com/Opti-mod/assets/main/BadgeDeveloper.png"}),p?.contributor&&l({name:"Opti Contributor",image:"https://raw.githubusercontent.com/Opti-mod/assets/main/BadgeContributor.png"}),p?.supporter&&l({name:"Opti Supporter",image:"https://raw.githubusercontent.com/Opti-mod/assets/main/BadgeSupporter.png"});break;case"aliu":p?.dev&&l({name:"Aliucord Dev",image:"https://cdn.discordapp.com/emojis/860165259117199401.webp"}),p?.donor&&l({name:"Aliucord Donor",image:"https://cdn.discordapp.com/emojis/859801776232202280.webp"}),p?.contributor&&l({name:"Aliucord Contributor",image:"https://cdn.discordapp.com/emojis/886587553187246120.webp"});break;case"bd":p?.dev&&l({name:"BetterDiscord Dev",image:""});break;case"enmity":p?.supporter?.data&&l({name:"Enmity Supporter",image:p?.supporter?.data.url.dark}),p?.staff?.data&&l({name:"Enmity Staff",image:p?.staff?.data.url.dark}),p?.dev?.data&&l({name:"Enmity Dev",image:p?.dev?.data.url.dark}),p?.contributor?.data&&l({name:"Enmity Contributor",image:p?.contributor?.data.url.dark}),p[a.id]?.data&&l({name:"Enmity User",image:p[a.id]?.data.url.dark});break;case"replugged":p?.developer&&l({name:"Replugged Developer",image:""}),p?.staff&&l({name:"Replugged Staff",image:""}),p?.support&&l({name:"Replugged Support",image:""}),p?.contributor&&l({name:"Replugged Contributor",image:""}),p?.translator&&l({name:"Replugged Translator",image:""}),p?.hunter&&l({name:"Replugged Hunter",image:""}),p?.early&&l({name:"Replugged Early Access",image:""}),p?.booster&&l({name:"Replugged Booster",image:""}),p?.custom?.name&&l({name:p.custom.name,image:p.custom.icon});break;case"vencord":p?.contributor&&l({name:"Vencord Contributor",image:"https://vencord.dev/assets/favicon.png"}),p?.cutie&&p.cutie.map(function(_){l({name:_.tooltip,image:_.badge})});break;default:break}})})}async function rs(e,t){if(!Xe.has(e)||Xe.get(e).lastFetch+ts{"use strict";w();C();h();Ra();z();({View:es}=u),Xe=new Map,ts=1e3*60*30});function wa(){let e=c("startSession"),t=ee("AuthenticationStore"),n=c("_currentDispatchActionType","_subscriptions","_actionHandlers","_waitQueue");try{os=y("startSession",e,function(r,o){setTimeout(function(){t.getSessionId()||(n?.dispatch({type:"APP_STATE_UPDATE",state:"active"}),console.log("Successfully patched infinite loading."))},200)})}catch{console.log("Failed to patch infinite connection, please reload the app.")}}var os,_a=s(()=>{"use strict";w();C()});function dr(){d.tweaks??={},console.log("TweakManager has successfully initialized."),d.tweaks.hideButtons==null&&(d.tweaks.hideButtons=!1),d.tweaks.silentTyping==null&&(d.tweaks.silentTyping=!1),d.tweaks.removePrompts==null&&(d.tweaks.removePrompts=!1),d.tweaks.externalbadges==null&&(d.tweaks.externalbadges=!0),(d.tweaks.hideButtons?Nt:Dt)(),(d.tweaks.silentTyping?Ct:Pt)(),(d.tweaks.removePrompts?Bt:Ot)(),wa(),Ea()}var xa=s(()=>{"use strict";z();er();tr();nr();ba();_a()});var Sa={};D(Sa,{default:()=>as});async function as(){let e=await Promise.all([En(),gn(),_n(),sn(),da(),mr(),Wn()]);try{window.vendetta=await ga(e)}catch{P.log("Opti has failed to load.")}e.push(await In()),e.push(await dr()),e.push(await Zr()),P.log("Opti has loaded!")}var va=s(()=>{"use strict";Ee();xt();de();ne();v();qr();ko();ca();pa();Ie();ha();xa()});Re();Ee();console.log("Opti has loaded!");Object.freeze=Object;Object.seal=Object;Promise.resolve().then(()=>(va(),Sa)).then(function(e){return e.default()}).catch(function(e){console.log(e?.stack??e.toString()),alert([`Opti failed to initialize. Some parts may not function properly. `,`Build Number: ${Je.Build}`,"Opti Version: 5708f73",e?.stack||e.toString()].join(` `))});ie().discord.version==223&&alert("You are running on Discord v223. This version is known to have many crashes and issues with modded clients. Continue at your own risk.");})(); //# sourceURL=Vendetta