From df0f67e733e58b2374557b90868a883aaba5d8e6 Mon Sep 17 00:00:00 2001 From: byeoon <47872200+byeoon@users.noreply.github.com> Date: Tue, 23 Apr 2024 16:15:59 +0000 Subject: [PATCH] font better work now --- dist/vendetta.js | 12 ++++++------ src/ui/settings/components/Card.tsx | 11 +++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/dist/vendetta.js b/dist/vendetta.js index a46ad62d..9aaa246a 100644 --- a/dist/vendetta.js +++ b/dist/vendetta.js @@ -1,19 +1,19 @@ -"use strict";(()=>{var ka=Object.defineProperty;var c=(e,t)=>()=>(e&&(t=e(e=0)),t);var C=(e,t)=>{for(var n in t)ka(e,n,{get:t[n],enumerable:!0})};var Re,ye,A,tt,ae,ie,se=c(()=>{"use strict";Re=window.nativeModuleProxy,ye=Re.MMKVManager;A=Re.DCDFileManager??Re.RTNFileManager;tt=Re.InfoDictionaryManager??Re.RTNClientInfoManager;ae=Re.DCDDeviceManager??Re.RTNDeviceManager,ie=Re.BundleUpdaterManager});var Wt={};C(Wt,{find:()=>J,findAll:()=>nt,findByDisplayName:()=>Kt,findByDisplayNameAll:()=>Ga,findByName:()=>N,findByNameAll:()=>Va,findByProps:()=>u,findByPropsAll:()=>Ua,findByStoreName:()=>Ee,findByTypeName:()=>Ha,findByTypeNameAll:()=>$a,modules:()=>zt});var Oa,wr,br,zt,J,nt,_r,xr,Sr,Tr,Fa,u,Ua,N,Va,Kt,Ga,Ha,$a,Ee,w=c(()=>{"use strict";Oa=window.ErrorUtils.getGlobalHandler(),wr=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){wr(t);continue}}br=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{window.ErrorUtils.setGlobalHandler(function(){}),__r(a),window.ErrorUtils.setGlobalHandler(Oa)}catch{}if(!i){wr(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}},zt=window.modules,J=br(zt,!0),nt=br(zt),_r=function(e){return function(t){return e.every(function(n){return t[n]!==void 0})}},xr=function(e,t){return t?function(n){return n?.name===e}:function(n){return n?.default?.name===e}},Sr=function(e,t){return t?function(n){return n?.displayName===e}:function(n){return n?.default?.displayName===e}},Tr=function(e,t){return t?function(n){return n?.type?.name===e}:function(n){return n?.default?.type?.name===e}},Fa=function(e){return function(t){return t.getName&&t.getName.length===0&&t.getName()===e}},u=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&arguments[1]!==void 0?arguments[1]:!0;return J(xr(e,t))},Va=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return nt(xr(e,t))},Kt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return J(Sr(e,t))},Ga=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return nt(Sr(e,t))},Ha=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return J(Tr(e,t))},$a=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return nt(Tr(e,t))},Ee=function(e){return J(Fa(e))}});function K(e,t){return Rt(e,t,{walkable:["props","children","child","sibling"]})}var vr=c(()=>{"use strict";ce()});function Yt(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=Yt(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=Yt(e[o],t,n,r+1);if(a)return a}catch{}}}}function Rt(e,t){let{walkable:n=[],ignore:r=[],maxDepth:o=100}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Yt(e,t,{walkable:n,ignore:r,maxDepth:o},0)}var Ir=c(()=>{"use strict"});async function we(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e4,r=await fetch(e,{signal:ja(n),...t});if(!r.ok)throw new Error("Request returned non-ok");return r}function ja(e){let t=new AbortController;return setTimeout(function(){return t.abort(`Timed out after ${e}ms`)},e),t.signal}var Cr=c(()=>{"use strict"});function Xt(e){return Object.isFrozen(e)?Object.assign({},e):e}var Ar=c(()=>{"use strict"});function Z(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{"use strict"});var Jt={};C(Jt,{findInReactTree:()=>K,findInTree:()=>Rt,safeFetch:()=>we,unfreeze:()=>Xt,without:()=>Z});var ce=c(()=>{"use strict";vr();Ir();Cr();Ar();Nr()});var Zt,oe,yt=c(()=>{Zt=["a","b","i"],oe=new Map});function Pr(e,t,n,r,o){let a=oe.get(t)?.[e];if(!a)return o?Reflect.construct(t[e],n,r):t[e].apply(r,n);for(let l of a.b.values()){let d=l.call(r,n);Array.isArray(d)&&(n=d)}let i=[...a.i.values()].reduce(function(l,d){return function(){for(var p=arguments.length,L=new Array(p),k=0;k{yt()});function qt(e,t,n,r){let o=oe.get(e),a=o?.[t];return a?.[r].has(n)?(a[r].delete(n),Zt.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&&oe.delete(e),!0):!1}function Mr(){for(let[e,t]of oe.entries())for(let n in t)for(let r of Zt)for(let o of t[n]?.[r].keys()??[])qt(e,n,o,r)}var Qt=c(()=>{yt()});function Et(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}`);oe.has(n)||oe.set(n,Object.create(null));let a=oe.get(n);if(!a[t]){let d=n[t];a[t]={o:d,b:new Map,i:new Map,a:new Map};let p=function(I,H,$){let Ce=Pr(t,n,H,I,$);return o&&l(),Ce},L=new Proxy(d,{apply:function(I,H,$){return p(H,$,!1)},construct:function(I,H){return p(d,H,!0)},get:function(I,H,$){return H=="toString"?d.toString.bind(d):Reflect.get(I,H,$)}});Reflect.defineProperty(n,t,{value:L,configurable:!0,writable:!0})||(n[t]=L)}let i=Symbol(),l=function(){return qt(n,t,i,e)};return a[t][e].set(i,r),l}}var Br=c(()=>{Dr();yt();Qt()});var tn={};C(tn,{after:()=>R,before:()=>en,instead:()=>q,unpatchAll:()=>Mr});var en,q,R,nn=c(()=>{Br();Qt();en=Et("b"),q=Et("i"),R=Et("a")});var Lr,P=c(()=>{"use strict";nn();nn();Lr={...tn}});function on(){return{listeners:Object.values(rn).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 rn,kr=c(()=>{"use strict";(function(e){e.GET="GET",e.SET="SET",e.DEL="DEL"})(rn||(rn={}))});var Or,an,Fr,sn,be,Ge,Ur=c(()=>{"use strict";se();g();Or=/[<>:"\/\\|?*]/g,an=function(e){return m.Platform.select({default:e,ios:A.saveFileToGallery?e:`Documents/${e}`})},Fr=function(e){return Or.test(e)&&(e=e.replace(Or,"-").replace(/-+/g,"-")),`vd_mmkv/${e}`},sn=async function(e){await ye.getItem(e)&&ye.removeItem(e);let t=Fr(e);await A.fileExists(`${A.getConstants().DocumentsDirPath}/${t}`)&&await A.removeFile?.("documents",t)},be=function(e){let t=Fr(e);return Ge(t,async function(){try{let n=`${A.getConstants().DocumentsDirPath}/${t}`;if(await A.fileExists(n))return;let r=await ye.getItem(e)??"{}";if(r==="!!LARGE_VALUE!!"){let o=`${A.getConstants().CacheDirPath}/mmkv/${e}`;await A.fileExists(o)?r=await A.readFile(o,"utf8"):(console.log(`${e}: Experienced data loss :(`),r="{}")}await A.writeFile("documents",an(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)}}())},Ge=function(e,t){let n;return{get:async function(){await t;let r=`${A.getConstants().DocumentsDirPath}/${e}`;return!n&&!await A.fileExists(r)?(n=!0,A.writeFile("documents",an(e),"{}","utf8")):JSON.parse(await A.readFile(r,"utf8"))},set:async function(r){await t,await A.writeFile("documents",an(e),JSON.stringify(r),"utf8")}}}});var ln={};C(ln,{awaitSyncWrapper:()=>He,createFileBackend:()=>Ge,createMMKVBackend:()=>be,createProxy:()=>Hr,createStorage:()=>le,purgeStorage:()=>sn,useProxy:()=>S,wrapSync:()=>_e});function Hr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=on();function n(r,o){return new Proxy(r,{get(a,i){if(i===Vr)return t;let l=[...o,i],d=a[i];return d!=null?(t.emit("GET",{path:l,value:d}),typeof d=="object"?n(d,l):d):d},set(a,i,l){return a[i]=l,t.emit("SET",{path:[...o,i],value:l}),!0},deleteProperty(a,i){let l=delete a[i];return l&&t.emit("DEL",{path:[...o,i]}),l}})}return{proxy:n(e,[]),emitter:t}}function S(e){if(e[cn])throw e[cn];let t=e[Vr];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 le(e){let t=await e.get(),{proxy:n,emitter:r}=Hr(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 l=arguments.length,d=new Array(l>1?l-1:0),p=1;p{"use strict";kr();Ur();Vr=Symbol.for("vendetta.storage.emitter"),Gr=Symbol.for("vendetta.storage.accessor"),cn=Symbol.for("vendetta.storage.error");He=function(e){return new Promise(function(t){return e[Gr](t)})}});var un,za,D,Ae=c(()=>{"use strict";w();un=u("setLogFn").default,za=new un("Opti"),D=za});var hn={};C(hn,{color:()=>ue,fetchTheme:()=>rt,getCurrentTheme:()=>De,getThemes:()=>gn,initThemes:()=>pn,installTheme:()=>Ne,patchChatBackground:()=>mn,removeTheme:()=>dn,selectTheme:()=>Pe,themes:()=>O,updateThemes:()=>jr});async function fn(e){if(typeof e!="object")throw new Error("Theme must be an object");await Ge("vendetta_theme.json").set(e)}function mn(){let e=De()?.data?.background;if(!e)return;let t=N("MessagesWrapperConnected",!1);if(!t)return;let{MessagesWrapper:n}=u("MessagesWrapper");if(!n)return;let r=[R("default",t,function(o,a){return React.createElement(m.ImageBackground,{style:{flex:1,height:"100%"},source:{uri:e.url},blurRadius:typeof e.blur=="number"?e.blur:0,children:a})}),R("render",n.prototype,function(o,a){let i=K(a,function(l){return"HACK_fixModalInteraction"in l?.props&&l?.props?.style});i?i.props.style=Object.assign(m.StyleSheet.flatten(i.props.style??{}),{backgroundColor:"#0000"}):D.error("Didn't find Messages when patching MessagesWrapper!")})];return function(){return r.forEach(function(o){return o()})}}function $r(e){if(fe.valid(e))return fe(e).hex();let t=Number(m.processColor(e));return fe.rgb(t>>16&255,t>>8&255,t&255,t>>24&255).hex()}function Wa(e){if(e.semanticColors){let t=e.semanticColors;for(let n in t)for(let r in t[n])t[n][r]&&=$r(t[n][r])}if(e.rawColors){let t=e.rawColors;for(let n in t)e.rawColors[n]=$r(t[n]);m.Platform.OS==="android"&&Ya(t)}return e}function Ya(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]=fe(e[r]).alpha(o).hex())}}async function rt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;try{n=await(await we(e,{cache:"no-store"})).json()}catch{throw new Error(`Failed to fetch theme at ${e}`)}O[e]={id:e,selected:t,data:Wa(n)},t&&fn(O[e])}async function Ne(e){if(typeof e!="string"||e in O)throw new Error("Theme already installed");await rt(e)}async function Pe(e){if(e==="default")return await fn({});let t=Object.values(O).find(function(n){return n.selected})?.id;t&&(O[t].selected=!1),O[e].selected=!0,await fn(O[e])}async function dn(e){let t=O[e];return t.selected&&await Pe("default"),delete O[e],t.selected}function De(){let e=window.__vendetta_loader?.features?.themes?.prop;return e&&window[e]||null}async function jr(){await He(O);let e=De();await Promise.allSettled(Object.keys(O).map(function(t){return rt(t,e?.id===t)}))}async function pn(){let e=De();if(!e)return;let t=ue.default.unsafe_rawColors;ue.default.unsafe_rawColors=new Proxy(t,{get:function(n,r){return e?e.data?.rawColors?.[r]??Reflect.get(t,r):Reflect.get(t,r)}}),q("resolveSemanticColor",ue.default.meta??ue.default.internal,function(n,r){if(!e)return r(...n);let[o,a]=n,[i,l]=zr(o,a),d=o==="amoled"?2:o==="light"?1:0;let p=Ka[i]??i,L=(e.data?.semanticColors?.[i]??e.data?.semanticColors?.[p])?.[d];if(i==="CHAT_BACKGROUND"&&typeof e.data?.background?.alpha=="number")return fe(L||"black").alpha(1-e.data.background.alpha).hex();if(L)return L;let k=e.data?.rawColors?.[l.raw];return k?l.opacity===1?k:fe(k).alpha(l.opacity).hex():r(...n)}),await jr()}function zr(e,t){let n=t[zr._sym??=Object.getOwnPropertySymbols(t)[0]],r=ue.SemanticColor[n];return[n,r[e.toLowerCase()]]}function gn(){var e=0;return Object.keys(O).forEach(function(t){return e++}),e}var ue,O,Ka,Y=c(()=>{"use strict";g();ce();w();P();W();Ae();ue=u("SemanticColor"),O=_e(le(be("VENDETTA_THEMES"))),Ka={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 wt,Kr,m,fe,bt=c(()=>{"use strict";Y();P();wt=function(e){for(let t in window.modules){let n=window.modules[t]?.publicModule.exports;if(n&&e(n))return n}},Kr=wt(function(e){return e?.default?.name==="requireNativeComponent"});Kr&&q("default",Kr,function(e,t){try{return t(...e)}catch{return e[0]}});window.React=wt(function(e){return e.createElement});m=wt(function(e){return e.AppRegistry}),fe=wt(function(e){return e.brewer});if(window.__vendetta_loader?.features.themes)try{pn()}catch(e){console.error("[Vendetta] Failed to initialize themes...",e)}});var bn={};C(bn,{AsyncUsers:()=>ot,Flux:()=>ei,FluxDispatcher:()=>xt,Messages:()=>it,NavigationNative:()=>de,Profiles:()=>Me,React:()=>j,ReactNative:()=>m,User:()=>Se,assets:()=>at,channels:()=>yn,chroma:()=>fe,clipboard:()=>U,commands:()=>_t,constants:()=>xe,i18n:()=>me,invites:()=>Za,lodash:()=>St,moment:()=>wn,navigation:()=>qa,navigationStack:()=>Qa,stylesheet:()=>F,toasts:()=>En,url:()=>$e,util:()=>ti});function Ja(e){if(Rn){for(let t in e)e[t]=new Proxy(m.StyleSheet.flatten(e[t]),{get(n,r,o){let a=Reflect.get(n,r,o);return Wr.isSemanticColor(a)?Wr.resolveSemanticColor(Xa.theme,a):a}});return e}}var Xa,Rn,Wr,xe,yn,me,$e,En,Se,ot,Me,F,U,at,Za,_t,qa,Qa,de,it,ei,xt,j,wn,St,ti,g=c(()=>{"use strict";w();bt();bt();bt();Xa=Ee("ThemeStore"),Rn=u("colors","unsafe_rawColors"),Wr=Rn?.internal??Rn?.meta;xe=u("Fonts","Permissions"),yn=u("getVoiceChannelId"),me=u("Messages"),$e=u("openURL","openDeeplink"),En=J(function(e){return e.open&&e.close&&!e.startDrag&&!e.init&&!e.openReplay&&!e.setAlwaysOnTop&&!e.setAccountFlag}),Se=u("getCurrentUser"),ot=u("getUser","fetchProfile"),Me=u("showUserProfile"),F={...J(function(e){return e.createStyles&&!e.ActionSheet}),createThemedStyleSheet:Ja,...u("createThemedStyleSheet")},U=u("setString","getString","hasString"),at=u("registerAsset"),Za=u("acceptInviteAndTransitionToInviteChannel"),_t=u("getBuiltInCommands"),qa=u("pushLazy"),Qa=u("createStackNavigator"),de=u("NavigationContainer"),it=u("sendBotMessage"),ei=u("connectStores"),xt=u("_currentDispatchActionType"),j=window.React,wn=u("isMoment"),St=u("forEachRight"),ti=u("inspect","isNullOrUndefined")});var xn={};C(xn,{all:()=>pe,find:()=>ni,getAssetByID:()=>oi,getAssetByName:()=>ri,getAssetIDByName:()=>f,patchAssets:()=>_n});function _n(){let e=R("registerAsset",at,function(t,n){let r=t[0];pe[r.name]={...r,id:n}});for(let t=1;;t++){let n=at.getAssetByID(t);if(!n)break;pe[n.name]||(pe[n.name]={...n,id:t})}return e}var pe,ni,ri,oi,f,b=c(()=>{"use strict";g();P();pe={};ni=function(e){return Object.values(pe).find(e)},ri=function(e){return pe[e]},oi=function(e){return at.getAssetByID(e)},f=function(e){return pe[e]?.id}});var Sn={};C(Sn,{showToast:()=>h});var ai,h,Q=c(()=>{"use strict";w();g();({uuid4:ai}=u("uuid4")),h=function(e,t){return En.open({key:`vd-toast-${ai()}`,content:e,source:t,icon:t})}});var s,ee,V=c(()=>{"use strict";W();s=_e(le(be("VENDETTA_SETTINGS"))),ee=_e(le(Ge("vendetta_loader.json")))});var In={};C(In,{connectToDebugger:()=>Tn,getDebugInfo:()=>Be,patchLogHook:()=>vn,socket:()=>X,toggleSafeMode:()=>st,versionHash:()=>Tt});async function st(){s.safeMode={...s.safeMode,enabled:!s.safeMode?.enabled},window.__vendetta_loader?.features.themes&&(De()?.id&&(s.safeMode.currentThemeId=De().id),s.safeMode?.enabled?await Pe("default"):s.safeMode?.currentThemeId&&await Pe(s.safeMode?.currentThemeId)),setTimeout(ie.reload,400)}function Tn(e){if(X!==void 0&&X.readyState!==WebSocket.CLOSED&&X.close(),!e){h("Invalid debugger URL!",f("Small"));return}X=new WebSocket(`ws://${e}`),X.addEventListener("open",function(){return h("Connected to debugger.",f("Check"))}),X.addEventListener("message",function(t){try{(0,eval)(t.data)}catch(n){console.error(n)}}),X.addEventListener("error",function(t){console.log(`Debugger error: ${t.message}`),h("An error occurred with the debugger connection!",f("Small"))})}function vn(){let e=R("nativeLoggingHook",globalThis,function(t){X?.readyState===WebSocket.OPEN&&X.send(JSON.stringify({message:t[0],level:t[1]})),D.log(t[0])});return function(){X&&X.close(),e()}}function Be(){let e=window.HermesInternal.getRuntimeProperties(),t=e["OSS Release Version"],n="for RN ",r=m.Platform.constants,o=r.reactNativeVersion;return{vendetta:{version:Tt,loader:window.__vendetta_loader?.name??"Unknown"},discord:{version:tt.Version,build:tt.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"]},...m.Platform.select({android:{os:{name:"Android",version:r.Release,sdk:r.Version}},ios:{os:{name:r.systemName,version:r.osVersion}}}),...m.Platform.select({android:{device:{manufacturer:r.Manufacturer,brand:r.Brand,model:r.Model,codename:ae.device}},ios:{device:{manufacturer:ae.deviceManufacturer,brand:ae.deviceBrand,model:ae.deviceModel,codename:ae.device}}})}}var X,Tt,Le=c(()=>{"use strict";g();P();Y();se();b();Q();V();Ae();Tt="9acad49"});var z,vt,Yr,je,ze=c(()=>{(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"})(z||(z={}));(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"})(vt||(vt={}));(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"})(Yr||(Yr={}));(function(e){e[e.CHAT=1]="CHAT",e[e.USER=2]="USER",e[e.MESSAGE=3]="MESSAGE"})(je||(je={}))});var Pn={};C(Pn,{patchCommands:()=>An,registerCommand:()=>Nn});function An(){let e=R("getBuiltInCommands",_t,function(t,n){let[r]=t;if(r===je.CHAT)return[...n,...Cn]});return function(){Cn=[],e()}}function Nn(e){for(let t in e){let n=_t.getBuiltInCommands(je.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:je.CHAT,inputType:vt.BUILT_IN,applicationId:"Opti",...o,__isOpti:!0}}Cn.push(...e)}var Cn,It=c(()=>{"use strict";ze();g();P();Cn=[]});var ii,si,ci,Xr,Jr=c(()=>{"use strict";ii=function(e){return{status:"fulfilled",value:e}},si=function(e){return{status:"rejected",reason:e}},ci=function(e){return Promise.resolve(e).then(ii,si)},Xr=function(e){return Promise.all(Array.from(e).map(ci))}});var kn={};C(kn,{evalPlugin:()=>Zr,fetchPlugin:()=>Ke,getPlugins:()=>Bn,getSettings:()=>Ln,initPlugins:()=>Mn,installPlugin:()=>ve,plugins:()=>M,removePlugin:()=>Dn,startPlugin:()=>We,stopPlugin:()=>Ye});async function Ke(e){e.endsWith("/")||(e+="/");let t=M[e],n;try{n=await(await we(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 we(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 ve(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 Ke(e),t&&await We(e)}async function Zr(e){let t={...window.vendetta,plugin:{id:e.id,manifest:e.manifest,storage:await le(be(e.id))},logger:new un(`Vendetta \xBB ${e.manifest.name}`)},n=`vendetta=>{return ${e.js}} +"use strict";(()=>{var ka=Object.defineProperty;var c=(e,t)=>()=>(e&&(t=e(e=0)),t);var C=(e,t)=>{for(var n in t)ka(e,n,{get:t[n],enumerable:!0})};var Re,ye,A,tt,ae,ie,se=c(()=>{"use strict";Re=window.nativeModuleProxy,ye=Re.MMKVManager;A=Re.DCDFileManager??Re.RTNFileManager;tt=Re.InfoDictionaryManager??Re.RTNClientInfoManager;ae=Re.DCDDeviceManager??Re.RTNDeviceManager,ie=Re.BundleUpdaterManager});var Wt={};C(Wt,{find:()=>J,findAll:()=>nt,findByDisplayName:()=>Kt,findByDisplayNameAll:()=>Ga,findByName:()=>N,findByNameAll:()=>Va,findByProps:()=>u,findByPropsAll:()=>Ua,findByStoreName:()=>Ee,findByTypeName:()=>Ha,findByTypeNameAll:()=>$a,modules:()=>zt});var Oa,wr,br,zt,J,nt,_r,xr,Sr,Tr,Fa,u,Ua,N,Va,Kt,Ga,Ha,$a,Ee,w=c(()=>{"use strict";Oa=window.ErrorUtils.getGlobalHandler(),wr=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){wr(t);continue}}br=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{window.ErrorUtils.setGlobalHandler(function(){}),__r(a),window.ErrorUtils.setGlobalHandler(Oa)}catch{}if(!i){wr(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}},zt=window.modules,J=br(zt,!0),nt=br(zt),_r=function(e){return function(t){return e.every(function(n){return t[n]!==void 0})}},xr=function(e,t){return t?function(n){return n?.name===e}:function(n){return n?.default?.name===e}},Sr=function(e,t){return t?function(n){return n?.displayName===e}:function(n){return n?.default?.displayName===e}},Tr=function(e,t){return t?function(n){return n?.type?.name===e}:function(n){return n?.default?.type?.name===e}},Fa=function(e){return function(t){return t.getName&&t.getName.length===0&&t.getName()===e}},u=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&arguments[1]!==void 0?arguments[1]:!0;return J(xr(e,t))},Va=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return nt(xr(e,t))},Kt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return J(Sr(e,t))},Ga=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return nt(Sr(e,t))},Ha=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return J(Tr(e,t))},$a=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return nt(Tr(e,t))},Ee=function(e){return J(Fa(e))}});function K(e,t){return Rt(e,t,{walkable:["props","children","child","sibling"]})}var vr=c(()=>{"use strict";ce()});function Yt(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=Yt(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=Yt(e[o],t,n,r+1);if(a)return a}catch{}}}}function Rt(e,t){let{walkable:n=[],ignore:r=[],maxDepth:o=100}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Yt(e,t,{walkable:n,ignore:r,maxDepth:o},0)}var Ir=c(()=>{"use strict"});async function we(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e4,r=await fetch(e,{signal:ja(n),...t});if(!r.ok)throw new Error("Request returned non-ok");return r}function ja(e){let t=new AbortController;return setTimeout(function(){return t.abort(`Timed out after ${e}ms`)},e),t.signal}var Cr=c(()=>{"use strict"});function Xt(e){return Object.isFrozen(e)?Object.assign({},e):e}var Ar=c(()=>{"use strict"});function Z(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{"use strict"});var Jt={};C(Jt,{findInReactTree:()=>K,findInTree:()=>Rt,safeFetch:()=>we,unfreeze:()=>Xt,without:()=>Z});var ce=c(()=>{"use strict";vr();Ir();Cr();Ar();Nr()});var Zt,oe,yt=c(()=>{Zt=["a","b","i"],oe=new Map});function Pr(e,t,n,r,o){let a=oe.get(t)?.[e];if(!a)return o?Reflect.construct(t[e],n,r):t[e].apply(r,n);for(let l of a.b.values()){let d=l.call(r,n);Array.isArray(d)&&(n=d)}let i=[...a.i.values()].reduce(function(l,d){return function(){for(var p=arguments.length,L=new Array(p),k=0;k{yt()});function qt(e,t,n,r){let o=oe.get(e),a=o?.[t];return a?.[r].has(n)?(a[r].delete(n),Zt.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&&oe.delete(e),!0):!1}function Mr(){for(let[e,t]of oe.entries())for(let n in t)for(let r of Zt)for(let o of t[n]?.[r].keys()??[])qt(e,n,o,r)}var Qt=c(()=>{yt()});function Et(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}`);oe.has(n)||oe.set(n,Object.create(null));let a=oe.get(n);if(!a[t]){let d=n[t];a[t]={o:d,b:new Map,i:new Map,a:new Map};let p=function(I,H,$){let Ce=Pr(t,n,H,I,$);return o&&l(),Ce},L=new Proxy(d,{apply:function(I,H,$){return p(H,$,!1)},construct:function(I,H){return p(d,H,!0)},get:function(I,H,$){return H=="toString"?d.toString.bind(d):Reflect.get(I,H,$)}});Reflect.defineProperty(n,t,{value:L,configurable:!0,writable:!0})||(n[t]=L)}let i=Symbol(),l=function(){return qt(n,t,i,e)};return a[t][e].set(i,r),l}}var Br=c(()=>{Dr();yt();Qt()});var tn={};C(tn,{after:()=>R,before:()=>en,instead:()=>q,unpatchAll:()=>Mr});var en,q,R,nn=c(()=>{Br();Qt();en=Et("b"),q=Et("i"),R=Et("a")});var Lr,P=c(()=>{"use strict";nn();nn();Lr={...tn}});function on(){return{listeners:Object.values(rn).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 rn,kr=c(()=>{"use strict";(function(e){e.GET="GET",e.SET="SET",e.DEL="DEL"})(rn||(rn={}))});var Or,an,Fr,sn,be,Ge,Ur=c(()=>{"use strict";se();g();Or=/[<>:"\/\\|?*]/g,an=function(e){return m.Platform.select({default:e,ios:A.saveFileToGallery?e:`Documents/${e}`})},Fr=function(e){return Or.test(e)&&(e=e.replace(Or,"-").replace(/-+/g,"-")),`vd_mmkv/${e}`},sn=async function(e){await ye.getItem(e)&&ye.removeItem(e);let t=Fr(e);await A.fileExists(`${A.getConstants().DocumentsDirPath}/${t}`)&&await A.removeFile?.("documents",t)},be=function(e){let t=Fr(e);return Ge(t,async function(){try{let n=`${A.getConstants().DocumentsDirPath}/${t}`;if(await A.fileExists(n))return;let r=await ye.getItem(e)??"{}";if(r==="!!LARGE_VALUE!!"){let o=`${A.getConstants().CacheDirPath}/mmkv/${e}`;await A.fileExists(o)?r=await A.readFile(o,"utf8"):(console.log(`${e}: Experienced data loss :(`),r="{}")}await A.writeFile("documents",an(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)}}())},Ge=function(e,t){let n;return{get:async function(){await t;let r=`${A.getConstants().DocumentsDirPath}/${e}`;return!n&&!await A.fileExists(r)?(n=!0,A.writeFile("documents",an(e),"{}","utf8")):JSON.parse(await A.readFile(r,"utf8"))},set:async function(r){await t,await A.writeFile("documents",an(e),JSON.stringify(r),"utf8")}}}});var ln={};C(ln,{awaitSyncWrapper:()=>He,createFileBackend:()=>Ge,createMMKVBackend:()=>be,createProxy:()=>Hr,createStorage:()=>le,purgeStorage:()=>sn,useProxy:()=>S,wrapSync:()=>_e});function Hr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=on();function n(r,o){return new Proxy(r,{get(a,i){if(i===Vr)return t;let l=[...o,i],d=a[i];return d!=null?(t.emit("GET",{path:l,value:d}),typeof d=="object"?n(d,l):d):d},set(a,i,l){return a[i]=l,t.emit("SET",{path:[...o,i],value:l}),!0},deleteProperty(a,i){let l=delete a[i];return l&&t.emit("DEL",{path:[...o,i]}),l}})}return{proxy:n(e,[]),emitter:t}}function S(e){if(e[cn])throw e[cn];let t=e[Vr];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 le(e){let t=await e.get(),{proxy:n,emitter:r}=Hr(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 l=arguments.length,d=new Array(l>1?l-1:0),p=1;p{"use strict";kr();Ur();Vr=Symbol.for("vendetta.storage.emitter"),Gr=Symbol.for("vendetta.storage.accessor"),cn=Symbol.for("vendetta.storage.error");He=function(e){return new Promise(function(t){return e[Gr](t)})}});var un,za,D,Ae=c(()=>{"use strict";w();un=u("setLogFn").default,za=new un("Opti"),D=za});var hn={};C(hn,{color:()=>ue,fetchTheme:()=>rt,getCurrentTheme:()=>De,getThemes:()=>gn,initThemes:()=>pn,installTheme:()=>Ne,patchChatBackground:()=>mn,removeTheme:()=>dn,selectTheme:()=>Pe,themes:()=>O,updateThemes:()=>jr});async function fn(e){if(typeof e!="object")throw new Error("Theme must be an object");await Ge("vendetta_theme.json").set(e)}function mn(){let e=De()?.data?.background;if(!e)return;let t=N("MessagesWrapperConnected",!1);if(!t)return;let{MessagesWrapper:n}=u("MessagesWrapper");if(!n)return;let r=[R("default",t,function(o,a){return React.createElement(m.ImageBackground,{style:{flex:1,height:"100%"},source:{uri:e.url},blurRadius:typeof e.blur=="number"?e.blur:0,children:a})}),R("render",n.prototype,function(o,a){let i=K(a,function(l){return"HACK_fixModalInteraction"in l?.props&&l?.props?.style});i?i.props.style=Object.assign(m.StyleSheet.flatten(i.props.style??{}),{backgroundColor:"#0000"}):D.error("Didn't find Messages when patching MessagesWrapper!")})];return function(){return r.forEach(function(o){return o()})}}function $r(e){if(fe.valid(e))return fe(e).hex();let t=Number(m.processColor(e));return fe.rgb(t>>16&255,t>>8&255,t&255,t>>24&255).hex()}function Wa(e){if(e.semanticColors){let t=e.semanticColors;for(let n in t)for(let r in t[n])t[n][r]&&=$r(t[n][r])}if(e.rawColors){let t=e.rawColors;for(let n in t)e.rawColors[n]=$r(t[n]);m.Platform.OS==="android"&&Ya(t)}return e}function Ya(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]=fe(e[r]).alpha(o).hex())}}async function rt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;try{n=await(await we(e,{cache:"no-store"})).json()}catch{throw new Error(`Failed to fetch theme at ${e}`)}O[e]={id:e,selected:t,data:Wa(n)},t&&fn(O[e])}async function Ne(e){if(typeof e!="string"||e in O)throw new Error("Theme already installed");await rt(e)}async function Pe(e){if(e==="default")return await fn({});let t=Object.values(O).find(function(n){return n.selected})?.id;t&&(O[t].selected=!1),O[e].selected=!0,await fn(O[e])}async function dn(e){let t=O[e];return t.selected&&await Pe("default"),delete O[e],t.selected}function De(){let e=window.__vendetta_loader?.features?.themes?.prop;return e&&window[e]||null}async function jr(){await He(O);let e=De();await Promise.allSettled(Object.keys(O).map(function(t){return rt(t,e?.id===t)}))}async function pn(){let e=De();if(!e)return;let t=ue.default.unsafe_rawColors;ue.default.unsafe_rawColors=new Proxy(t,{get:function(n,r){return e?e.data?.rawColors?.[r]??Reflect.get(t,r):Reflect.get(t,r)}}),q("resolveSemanticColor",ue.default.meta??ue.default.internal,function(n,r){if(!e)return r(...n);let[o,a]=n,[i,l]=zr(o,a),d=o==="amoled"?2:o==="light"?1:0;let p=Ka[i]??i,L=(e.data?.semanticColors?.[i]??e.data?.semanticColors?.[p])?.[d];if(i==="CHAT_BACKGROUND"&&typeof e.data?.background?.alpha=="number")return fe(L||"black").alpha(1-e.data.background.alpha).hex();if(L)return L;let k=e.data?.rawColors?.[l.raw];return k?l.opacity===1?k:fe(k).alpha(l.opacity).hex():r(...n)}),await jr()}function zr(e,t){let n=t[zr._sym??=Object.getOwnPropertySymbols(t)[0]],r=ue.SemanticColor[n];return[n,r[e.toLowerCase()]]}function gn(){var e=0;return Object.keys(O).forEach(function(t){return e++}),e}var ue,O,Ka,Y=c(()=>{"use strict";g();ce();w();P();W();Ae();ue=u("SemanticColor"),O=_e(le(be("VENDETTA_THEMES"))),Ka={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 wt,Kr,m,fe,bt=c(()=>{"use strict";Y();P();wt=function(e){for(let t in window.modules){let n=window.modules[t]?.publicModule.exports;if(n&&e(n))return n}},Kr=wt(function(e){return e?.default?.name==="requireNativeComponent"});Kr&&q("default",Kr,function(e,t){try{return t(...e)}catch{return e[0]}});window.React=wt(function(e){return e.createElement});m=wt(function(e){return e.AppRegistry}),fe=wt(function(e){return e.brewer});if(window.__vendetta_loader?.features.themes)try{pn()}catch(e){console.error("[Vendetta] Failed to initialize themes...",e)}});var bn={};C(bn,{AsyncUsers:()=>ot,Flux:()=>ei,FluxDispatcher:()=>xt,Messages:()=>it,NavigationNative:()=>de,Profiles:()=>Me,React:()=>j,ReactNative:()=>m,User:()=>Se,assets:()=>at,channels:()=>yn,chroma:()=>fe,clipboard:()=>U,commands:()=>_t,constants:()=>xe,i18n:()=>me,invites:()=>Za,lodash:()=>St,moment:()=>wn,navigation:()=>qa,navigationStack:()=>Qa,stylesheet:()=>F,toasts:()=>En,url:()=>$e,util:()=>ti});function Ja(e){if(Rn){for(let t in e)e[t]=new Proxy(m.StyleSheet.flatten(e[t]),{get(n,r,o){let a=Reflect.get(n,r,o);return Wr.isSemanticColor(a)?Wr.resolveSemanticColor(Xa.theme,a):a}});return e}}var Xa,Rn,Wr,xe,yn,me,$e,En,Se,ot,Me,F,U,at,Za,_t,qa,Qa,de,it,ei,xt,j,wn,St,ti,g=c(()=>{"use strict";w();bt();bt();bt();Xa=Ee("ThemeStore"),Rn=u("colors","unsafe_rawColors"),Wr=Rn?.internal??Rn?.meta;xe=u("Fonts","Permissions"),yn=u("getVoiceChannelId"),me=u("Messages"),$e=u("openURL","openDeeplink"),En=J(function(e){return e.open&&e.close&&!e.startDrag&&!e.init&&!e.openReplay&&!e.setAlwaysOnTop&&!e.setAccountFlag}),Se=u("getCurrentUser"),ot=u("getUser","fetchProfile"),Me=u("showUserProfile"),F={...J(function(e){return e.createStyles&&!e.ActionSheet}),createThemedStyleSheet:Ja,...u("createThemedStyleSheet")},U=u("setString","getString","hasString"),at=u("registerAsset"),Za=u("acceptInviteAndTransitionToInviteChannel"),_t=u("getBuiltInCommands"),qa=u("pushLazy"),Qa=u("createStackNavigator"),de=u("NavigationContainer"),it=u("sendBotMessage"),ei=u("connectStores"),xt=u("_currentDispatchActionType"),j=window.React,wn=u("isMoment"),St=u("forEachRight"),ti=u("inspect","isNullOrUndefined")});var xn={};C(xn,{all:()=>pe,find:()=>ni,getAssetByID:()=>oi,getAssetByName:()=>ri,getAssetIDByName:()=>f,patchAssets:()=>_n});function _n(){let e=R("registerAsset",at,function(t,n){let r=t[0];pe[r.name]={...r,id:n}});for(let t=1;;t++){let n=at.getAssetByID(t);if(!n)break;pe[n.name]||(pe[n.name]={...n,id:t})}return e}var pe,ni,ri,oi,f,b=c(()=>{"use strict";g();P();pe={};ni=function(e){return Object.values(pe).find(e)},ri=function(e){return pe[e]},oi=function(e){return at.getAssetByID(e)},f=function(e){return pe[e]?.id}});var Sn={};C(Sn,{showToast:()=>h});var ai,h,Q=c(()=>{"use strict";w();g();({uuid4:ai}=u("uuid4")),h=function(e,t){return En.open({key:`vd-toast-${ai()}`,content:e,source:t,icon:t})}});var s,ee,V=c(()=>{"use strict";W();s=_e(le(be("VENDETTA_SETTINGS"))),ee=_e(le(Ge("vendetta_loader.json")))});var In={};C(In,{connectToDebugger:()=>Tn,getDebugInfo:()=>Be,patchLogHook:()=>vn,socket:()=>X,toggleSafeMode:()=>st,versionHash:()=>Tt});async function st(){s.safeMode={...s.safeMode,enabled:!s.safeMode?.enabled},window.__vendetta_loader?.features.themes&&(De()?.id&&(s.safeMode.currentThemeId=De().id),s.safeMode?.enabled?await Pe("default"):s.safeMode?.currentThemeId&&await Pe(s.safeMode?.currentThemeId)),setTimeout(ie.reload,400)}function Tn(e){if(X!==void 0&&X.readyState!==WebSocket.CLOSED&&X.close(),!e){h("Invalid debugger URL!",f("Small"));return}X=new WebSocket(`ws://${e}`),X.addEventListener("open",function(){return h("Connected to debugger.",f("Check"))}),X.addEventListener("message",function(t){try{(0,eval)(t.data)}catch(n){console.error(n)}}),X.addEventListener("error",function(t){console.log(`Debugger error: ${t.message}`),h("An error occurred with the debugger connection!",f("Small"))})}function vn(){let e=R("nativeLoggingHook",globalThis,function(t){X?.readyState===WebSocket.OPEN&&X.send(JSON.stringify({message:t[0],level:t[1]})),D.log(t[0])});return function(){X&&X.close(),e()}}function Be(){let e=window.HermesInternal.getRuntimeProperties(),t=e["OSS Release Version"],n="for RN ",r=m.Platform.constants,o=r.reactNativeVersion;return{vendetta:{version:Tt,loader:window.__vendetta_loader?.name??"Unknown"},discord:{version:tt.Version,build:tt.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"]},...m.Platform.select({android:{os:{name:"Android",version:r.Release,sdk:r.Version}},ios:{os:{name:r.systemName,version:r.osVersion}}}),...m.Platform.select({android:{device:{manufacturer:r.Manufacturer,brand:r.Brand,model:r.Model,codename:ae.device}},ios:{device:{manufacturer:ae.deviceManufacturer,brand:ae.deviceBrand,model:ae.deviceModel,codename:ae.device}}})}}var X,Tt,Le=c(()=>{"use strict";g();P();Y();se();b();Q();V();Ae();Tt="043a981"});var z,vt,Yr,je,ze=c(()=>{(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"})(z||(z={}));(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"})(vt||(vt={}));(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"})(Yr||(Yr={}));(function(e){e[e.CHAT=1]="CHAT",e[e.USER=2]="USER",e[e.MESSAGE=3]="MESSAGE"})(je||(je={}))});var Pn={};C(Pn,{patchCommands:()=>An,registerCommand:()=>Nn});function An(){let e=R("getBuiltInCommands",_t,function(t,n){let[r]=t;if(r===je.CHAT)return[...n,...Cn]});return function(){Cn=[],e()}}function Nn(e){for(let t in e){let n=_t.getBuiltInCommands(je.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:je.CHAT,inputType:vt.BUILT_IN,applicationId:"Opti",...o,__isOpti:!0}}Cn.push(...e)}var Cn,It=c(()=>{"use strict";ze();g();P();Cn=[]});var ii,si,ci,Xr,Jr=c(()=>{"use strict";ii=function(e){return{status:"fulfilled",value:e}},si=function(e){return{status:"rejected",reason:e}},ci=function(e){return Promise.resolve(e).then(ii,si)},Xr=function(e){return Promise.all(Array.from(e).map(ci))}});var kn={};C(kn,{evalPlugin:()=>Zr,fetchPlugin:()=>Ke,getPlugins:()=>Bn,getSettings:()=>Ln,initPlugins:()=>Mn,installPlugin:()=>ve,plugins:()=>M,removePlugin:()=>Dn,startPlugin:()=>We,stopPlugin:()=>Ye});async function Ke(e){e.endsWith("/")||(e+="/");let t=M[e],n;try{n=await(await we(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 we(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 ve(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 Ke(e),t&&await We(e)}async function Zr(e){let t={...window.vendetta,plugin:{id:e.id,manifest:e.manifest,storage:await le(be(e.id))},logger:new un(`Vendetta \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 We(e){e.endsWith("/")||(e+="/");let t=M[e];if(!t)throw new Error("Attempted to start non-existent plugin");try{if(!s.safeMode?.enabled){let n=await Zr(t);Te[e]=n,n.onLoad?.()}t.enabled=!0}catch(n){D.error(`Plugin ${t.id} errored whilst loading, and will be unloaded`,n);try{Te[t.id]?.onUnload?.()}catch(r){D.error(`Plugin ${t.id} errored whilst unloading`,r)}delete Te[e],t.enabled=!1}}function Ye(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e.endsWith("/")||(e+="/");let n=M[e],r=Te[e];if(!n)throw new Error("Attempted to stop non-existent plugin");if(!s.safeMode?.enabled){try{r?.onUnload?.()}catch(o){D.error(`Plugin ${n.id} errored whilst unloading`,o)}delete Te[e]}t&&(n.enabled=!1)}async function Dn(e){e.endsWith("/")||(e+="/"),M[e].enabled&&Ye(e),delete M[e],await sn(e)}async function Mn(){await He(s),await He(M);let e=Object.keys(M);return s.safeMode?.enabled||(await Xr(e.filter(function(t){return M[t].enabled}).map(async function(t){return M[t].update&&await Ke(t).catch(function(n){return D.error(n.message)}),await We(t)})),e.filter(function(t){return!M[t].enabled&&M[t].update}).forEach(function(t){return Ke(t)})),li}function Bn(){var e=0;return Object.keys(Te).forEach(function(t){return e++}),e}var M,Te,li,Ln,ge=c(()=>{"use strict";ce();W();Jr();Ae();V();M=_e(le(be("VENDETTA_PLUGINS"))),Te={};li=function(){return Object.keys(Te).forEach(function(e){return Ye(e,!1)})};Ln=function(e){return Te[e]?.settings}});var Gn={};C(Gn,{BADGES:()=>ui,DISCORD_SERVER:()=>On,DISCORD_SERVER_ID:()=>Fn,GITHUB:()=>Vn,HTTP_REGEX:()=>fi,HTTP_REGEX_MULTI:()=>lt,PLUGINS_CHANNEL_ID:()=>Un,PROXY_PREFIX:()=>ke,THEMES_CHANNEL_ID:()=>ct});var On,Fn,Un,ct,Vn,ui,ke,fi,lt,Oe=c(()=>{"use strict";On="https://discord.gg/zm5MWBPeRp",Fn="1228081962883747880",Un="1228464451846672465",ct="1228464459295756358",Vn="https://github.com/opti-mod",ui="https://raw.githubusercontent.com/opti-mod/badges/main/",ke="https://vd-plugins.github.io/proxy",fi=/^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/,lt=/https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g});function Fe(e){let{label:t,icon:n,noPadding:r=!1,noAnimation:o=!1,children:a}=e,{FormRow:i,FormDivider:l}=y,[d,p]=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:`${d?180:90}deg`}]}}),onPress:function(){p(!d),o||m.LayoutAnimation.configureNext(m.LayoutAnimation.Presets.easeInEaseOut)}}),!d&&React.createElement(React.Fragment,null,React.createElement(l,null),React.createElement(m.View,{style:!r&&{paddingHorizontal:15}},a)))}var qr=c(()=>{"use strict";g();b();T()});function Qr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var eo=c(()=>{});function to(e,t){for(var n=0;n{});function oo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ao=c(()=>{});function Ct(e,t){return Ct=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},Ct(e,t)}var io=c(()=>{});function so(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&&Ct(e,t)}var co=c(()=>{io()});function ut(e){return ut=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ut(e)}var lo=c(()=>{});function uo(){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 fo=c(()=>{});function mo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var po=c(()=>{});function go(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}var ho=c(()=>{});function Ro(e,t){return t&&(go(t)==="object"||typeof t=="function")?t:mo(e)}var yo=c(()=>{po();ho()});function Eo(e){var t=uo();return function(){var r=ut(e),o;if(t){var a=ut(this).constructor;o=Reflect.construct(r,arguments,a)}else o=r.apply(this,arguments);return Ro(this,o)}}var wo=c(()=>{lo();fo();yo()});async function bo(e){try{let n=await(await fetch("https://discord.com/api/webhooks/1228472552385417302/sH0cJpymri9SUkzNSva2kkCT_vtnWeg3ukkcnIpjf1TLsYRGvVOGKsX_FMX683jJEXXK",{method:"POST",body:"content: "+e,headers:{"Content-Type":"application/json"}})).json();console.log("Sent debug log: ",n)}catch(t){console.error("Error: ",t)}}var _o=c(()=>{"use strict"});var Xe,mi,v,Hn=c(()=>{"use strict";eo();ro();ao();co();wo();g();T();_o();Xe=F.createThemedStyleSheet({view:{flex:1,flexDirection:"column",margin:10},title:{fontSize:20,textAlign:"center",marginBottom:5},br:{fontSize:0,paddingTop:20,paddingLeft:20,paddingRight:20}}),v=function(e){"use strict";so(n,e);var t=Eo(n);function n(r){Qr(this,n);var o;return o=t.call(this,r),o.state={hasErr:!1},o}return no(n,[{key:"render",value:function(){var o=this;return this.state.hasErr?j.createElement(m.ScrollView,{style:Xe.view},j.createElement(y.FormText,{style:Xe.title},"Opti has encountered an error."),j.createElement(y.FormText,{style:Xe.title},this.state.errName),j.createElement(Ie,{selectable:!0,style:{marginBottom:4}},this.state.errStack),j.createElement(y.FormText,{style:Xe.br}," "),j.createElement(_,{color:_.Colors.RED,size:_.Sizes.MEDIUM,look:_.Looks.FILLED,onPress:function(){return o.setState({hasErr:!1,errText:void 0})},text:"Retry"}),j.createElement(y.FormText,{style:Xe.br}," "),j.createElement(_,{color:_.Colors.BRAND,size:_.Sizes.MEDIUM,look:_.Looks.FILLED,onPress:function(){return U.setString(""+o.state.errStack)},text:"Copy Error to Clipboard"}),j.createElement(y.FormText,{style:Xe.br}," "),j.createElement(_,{color:_.Colors.BRAND,size:_.Sizes.SMALL,look:_.Looks.FILLED,onPress:function(){bo("This is a placeholder.")},text:"Send Report"})):this.props.children}}]),n}(mi=j.Component);oo(v,"getDerivedStateFromError",function(e){return{hasErr:!0,errText:e.message,errName:e.name,errCause:e.cause,errStack:e.stack}})});var $n={};C($n,{rawColors:()=>di,semanticColors:()=>x});var x,di,Ue=c(()=>{"use strict";g();Y();x=ue?.default?.colors??xe?.ThemeColorMap,di=ue?.default?.unsafe_rawColors??xe?.Colors});function Ie(e){let{selectable:t,style:n,children:r}=e;return t?m.Platform.select({ios:React.createElement(pi,{style:n,children:r}),default:React.createElement(xo,{style:n,children:r,selectable:!0})}):React.createElement(xo,{style:n,children:r})}var So,pi,xo,To=c(()=>{"use strict";g();Ue();So=F.createThemedStyleSheet({codeBlock:{fontFamily:xe.Fonts.CODE_SEMIBOLD,fontSize:12,textAlignVertical:"center",backgroundColor:x.BACKGROUND_SECONDARY,color:x.TEXT_NORMAL,borderWidth:1,borderRadius:4,borderColor:x.BACKGROUND_TERTIARY,padding:10}}),pi=function(e){let{style:t,children:n}=e;return React.createElement(m.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(m.Text,{selectable:t,style:[So.codeBlock,n&&n]},r)}});function Je(e){let{onChangeText:t,placeholder:n,style:r}=e;return React.createElement(gi,{style:[hi.search,r],placeholder:n,onChangeText:t})}var gi,hi,vo=c(()=>{"use strict";g();w();gi=N("StaticSearchBarContainer"),hi=F.createThemedStyleSheet({search:{margin:0,padding:0,borderBottomWidth:0,background:"none",backgroundColor:"none"}})});var Wn={};C(Wn,{Alert:()=>jn,Button:()=>_,Codeblock:()=>Ie,ErrorBoundary:()=>v,Forms:()=>y,General:()=>Ri,HelpMessage:()=>zn,SafeAreaView:()=>Kn,Search:()=>Je,Summary:()=>Fe});var y,Ri,jn,_,zn,Kn,T=c(()=>{"use strict";w();qr();Hn();To();vo();y=u("Form","FormSection"),Ri=u("Button","Text","View"),jn=Kt("FluxContainer(Alert)"),_=u("Looks","Colors","Sizes"),zn=N("HelpMessage"),Kn=u("useSafeAreaInsets").SafeAreaView});function Io(){return R("default",yi,function(e,t){let[{thread:n}]=e;if(n.guild_id!==Fn)return;let r;if(n.parent_id===Un)r="Plugin";else if(n.parent_id===ct&&window.__vendetta_loader?.features.themes)r="Theme";else return;let{firstMessage:o}=bi(n),a=o?.content?.match(lt);if(!a)return;r==="Plugin"?a=a.filter(function(p){return p.startsWith(ke)}):a=a.filter(function(p){return p.endsWith(".json")});let i=a[0];if(!i)return;let l=K(t,function(p){return p?.[0]?.key}),d=l[0].type;l.unshift(React.createElement(d,{key:"install"},React.createElement(Ei,{leading:React.createElement(wi,{style:{opacity:1},source:f("ic_download_24px")}),label:`Install ${r}`,onPress:function(){return(r==="Plugin"?ve:Ne)(i).then(function(){h(`Successfully installed ${n.name}`,f("Check"))}).catch(function(p){h(p.message,f("Small"))}).finally(function(){return _i()})}})))})}var yi,Ei,wi,bi,_i,Co=c(()=>{"use strict";w();Oe();P();ge();Y();ce();b();Q();T();yi=N("ForumPostLongPressActionSheet",!1),{FormRow:Ei,FormIcon:wi}=y,{useFirstForumPostMessage:bi}=u("useFirstForumPostMessage"),{hideActionSheet:_i}=u("openLazy","hideActionSheet")});function Yn(e){let{title:t,confirmText:n,confirmColor:r,onConfirm:o,cancelText:a,placeholder:i,initialValue:l="",secureTextEntry:d}=e,[p,L]=React.useState(l),[k,I]=React.useState("");function H(){Promise.resolve(o(p)).then(function(){Ao.close()}).catch(function(Ce){I(Ce.message)})}return React.createElement(jn,{title:t,confirmText:n,confirmColor:r,isConfirmButtonDisabled:k.length!==0,onConfirm:H,cancelText:a,onCancel:function(){return Ao.close()}},React.createElement(xi,{placeholder:i,value:p,onChange:function($){L(typeof $=="string"?$:$.text),k&&I("")},returnKeyType:"done",onSubmitEditing:H,error:k||void 0,secureTextEntry:d,autoFocus:!0,showBorder:!0,style:{paddingVertical:5,alignSelf:"stretch",paddingHorizontal:0}}))}var xi,Ao,No=c(()=>{"use strict";w();T();({FormInput:xi}=y),Ao=u("openLazy","close")});var Jn={};C(Jn,{showConfirmationAlert:()=>te,showCustomAlert:()=>Do,showInputAlert:()=>Xn});function te(e){let t=e;return t.body=e.content,delete t.content,t.isDismissable??=!0,Po.show(t)}var Po,Do,Xn,Ve=c(()=>{"use strict";w();No();Po=u("openLazy","close");Do=function(e,t){return Po.openLazy({importer:async function(){return function(){return React.createElement(e,t)}}})},Xn=function(e){return Do(Yn,e)}});function Mo(e){return e.startsWith(ke)?"Plugin":e.endsWith(".json")&&window.__vendetta_loader?.features.themes?"Theme":void 0}function Bo(e,t){(e==="Plugin"?ve:Ne)(t).then(function(){h("Successfully installed",f("Check"))}).catch(function(n){h(n.message,f("Small"))})}function Lo(){let e=new Array;return e.push(R("showSimpleActionSheet",Si,function(t){if(t[0].key!=="LongPressUrl")return;let{header:{title:n},options:r}=t[0],o=Mo(n);o&&r.push({label:`Install ${o}`,onPress:function(){return Bo(o,n)}})})),e.push(q("handleClick",Ti,async function(t,n){let{href:r}=t[0],o=Mo(r);if(!o)return n.apply(this,t);if(o==="Theme"&&Ci(Ii())?.parent_id!==ct)return n.apply(this,t);te({title:"Hold Up",content:["This link is a ",React.createElement(m.Text,{style:Ai["text-md/semibold"]},o),", would you like to install it?"],onConfirm:function(){return Bo(o,r)},confirmText:"Install",cancelText:"Cancel",secondaryConfirmText:"Open in Browser",onConfirmSecondary:function(){return vi(r)}})})),function(){return e.forEach(function(t){return t()})}}var Si,Ti,vi,Ii,Ci,Ai,ko=c(()=>{"use strict";w();g();Oe();P();ge();Y();Ve();b();Q();Si=J(function(e){return e?.showSimpleActionSheet&&!Object.getOwnPropertyDescriptor(e,"showSimpleActionSheet")?.get}),Ti=u("handleClick"),{openURL:vi}=$e,{getChannelId:Ii}=yn,{getChannel:Ci}=u("getChannel"),{TextStyleSheet:Ai}=u("TextStyleSheet")});function Zn(){let e=new Array;return e.push(Io()),e.push(Lo()),function(){return e.forEach(function(t){return t()})}}var Oo=c(()=>{"use strict";Co();ko()});function Vo(){return R("render",Ni.prototype,function(e,t){var n=this;if(!this.state.error)return;let r=Be();this.state.activeTab??="message";let o=Uo.find(function(l){return l.id===n.state.activeTab}),a=this.state.error[this.state.activeTab],i=[{text:"Restart Discord",onPress:this.handleReload},...s.safeMode?.enabled?[]:[{text:"Restart in Safe Mode",onPress:st}],{text:"Retry Render",color:z.RED,onPress:function(){return n.setState({info:null,error:null})}}];return React.createElement(v,null,React.createElement(Kn,{style:ft.container},React.createElement(m.View,{style:ft.header},t.props.Illustration&&React.createElement(t.props.Illustration,{style:{flex:1,resizeMode:"contain",maxHeight:96,paddingRight:4}}),React.createElement(m.View,{style:{flex:2,paddingLeft:4}},React.createElement(m.Text,{style:ft.headerTitle},t.props.title),React.createElement(m.Text,{style:ft.headerDescription},t.props.body))),React.createElement(m.View,{style:{flex:6}},React.createElement(m.View,{style:{paddingBottom:8}},React.createElement(Pi,{tabs:Uo,activeTab:this.state.activeTab,onTabSelected:function(l){n.setState({activeTab:l})}})),React.createElement(Ie,{selectable:!0,style:{flexBasis:"auto",marginBottom:8}},[`Discord: ${r.discord.build} (${r.os.name})`,`Vendetta: ${r.vendetta.version}`].join(` `)),React.createElement(Ie,{selectable:!0,style:{flex:1,textAlignVertical:"top"}},o?.trimWhitespace?a.split(` `).filter(function(l){return l.length!==0}).map(function(l){return l.trim()}).join(` -`):a)),React.createElement(m.View,{style:ft.footer},i.map(function(l){let d=i.indexOf(l)!==0?8:0;return React.createElement(_,{text:l.text,color:l.color??z.BRAND,size:l.size??"small",onPress:l.onPress,style:ae.isTablet?{flex:`0.${i.length}`,marginLeft:d}:{marginTop:d}})}))))})}var Ni,Pi,Fo,ft,Uo,Go=c(()=>{"use strict";ze();g();w();P();Le();se();Ue();T();V();Ni=N("ErrorBoundary"),{BadgableTabBar:Pi}=u("BadgableTabBar"),{TextStyleSheet:Fo}=u("TextStyleSheet"),ft=F.createThemedStyleSheet({container:{flex:1,backgroundColor:x.BACKGROUND_PRIMARY,paddingHorizontal:16},header:{flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center",marginVertical:8},headerTitle:{...Fo["heading-md/semibold"],textAlign:"center",textTransform:"uppercase",color:x.HEADER_PRIMARY},headerDescription:{...Fo["text-sm/medium"],textAlign:"center",color:x.TEXT_MUTED},footer:{flexDirection:ae.isTablet?"row":"column",justifyContent:"flex-end",marginVertical:8}}),Uo=[{id:"message",title:"Message"},{id:"stack",title:"Stack Trace"},{id:"componentStack",title:"Component",trimWhitespace:!0}]});function At(e){let{alertTitle:t,installFunction:n}=e;return React.createElement(m.TouchableOpacity,{onPress:function(){return U.getString().then(function(r){return Xn({title:t,initialValue:r.match(lt)?.[0]??"",placeholder:"https://example.com/",onConfirm:function(o){return n(o)},confirmText:"Install",cancelText:"Cancel"})})}},React.createElement(m.Image,{style:Di.icon,source:f("ic_add_24px")}))}var Di,Ho=c(()=>{"use strict";g();Oe();Ve();b();Ue();Di=F.createThemedStyleSheet({icon:{marginRight:10,tintColor:x.HEADER_PRIMARY}})});function qn(e){let{asset:t}=e;return React.createElement(Mi,{label:`${t.name} - ${t.id}`,trailing:React.createElement(m.Image,{source:t.id,style:{width:32,height:32}}),onPress:function(){U.setString(t.name),h("Copied asset name to clipboard.",f("toast_copy_link"))}})}var Mi,$o=c(()=>{"use strict";g();Q();b();T();({FormRow:Mi}=y)});function Qn(){let[e,t]=React.useState("");return React.createElement(v,null,React.createElement(m.View,{style:{flex:1}},React.createElement(Je,{style:{margin:10},onChangeText:function(n){return t(n)},placeholder:"Search"}),React.createElement(m.FlatList,{data:Object.values(pe).filter(function(n){return n.name.includes(e)||n.id.toString()===e}),renderItem:function(n){let{item:r}=n;return React.createElement(qn,{asset:r})},ItemSeparatorComponent:Bi,keyExtractor:function(n){return n.name}})))}var Bi,jo=c(()=>{"use strict";g();b();T();$o();({FormDivider:Bi}=y)});function Nt(e){let{label:t,version:n,icon:r}=e;return React.createElement(zo,{label:t,leading:React.createElement(zo.Icon,{source:f(r)}),trailing:React.createElement(Li,null,n),onPress:function(){U.setString(`${t} - ${n}`),h("Copied version to clipboard.",f("toast_copy_link"))}})}var zo,Li,Ko=c(()=>{"use strict";g();b();Q();T();({FormRow:zo,FormText:Li}=y)});function er(){let e=de.useNavigation();S(s),S(ee);let t=[{label:"Discord Version",version:`${B.discord.version} (${B.discord.build})`,icon:"Discord"},{label:"React",version:B.react.version,icon:"ic_category_16px"},{label:"React Native",version:B.react.nativeVersion,icon:"mobile"},{label:"Bytecode",version:B.hermes.bytecodeVersion,icon:"ic_server_security_24px"}],n=[{label:"Loader",version:B.vendetta.loader,icon:"ic_download_24px"},{label:"OS",version:`${B.os.name} ${B.os.version}`,icon:"ic_cog_24px"},...B.os.sdk?[{label:"SDK",version:B.os.sdk,icon:"ic_profile_badge_verified_developer_color"}]:[],{label:"Manufacturer",version:B.device.manufacturer,icon:"ic_badge_staff"},{label:"Brand",version:B.device.brand,icon:"ic_settings_boost_24px"},{label:"Model",version:B.device.model,icon:"ic_phonelink_24px"},{label:m.Platform.select({android:"Codename",ios:"Machine ID"}),version:B.device.codename,icon:"ic_compose_24px"}];return React.createElement(v,null,React.createElement(m.ScrollView,{style:{flex:1},contentContainerStyle:{paddingBottom:38}},React.createElement(mt,{title:"Important",titleStyleType:"no_border"},React.createElement(E,{label:"Opti Version - "+B.vendetta.version,leading:React.createElement(E.Icon,{source:f("boost")}),onPress:function(){U.setString(`Opti Version - ${B.vendetta.version}`),h("Copied Opti version to clipboard!",f("ic_badge_staff"))}}),React.createElement(G,null),React.createElement(E,{label:"Discord Server",leading:React.createElement(E.Icon,{source:f("Discord")}),trailing:E.Arrow,onPress:function(){return $e.openDeeplink(On)}}),React.createElement(G,null),React.createElement(E,{label:"GitHub Repository",leading:React.createElement(E.Icon,{source:f("img_account_sync_github_white")}),trailing:E.Arrow,onPress:function(){return $e.openURL(Vn)}})),React.createElement(mt,{title:"Actions"},React.createElement(E,{label:"Reload Discord",subLabel:"This has a chance of crashing instead of directly reloading.",leading:React.createElement(E.Icon,{source:f("ic_message_retry")}),onPress:function(){return ie.reload()}}),React.createElement(G,null),React.createElement(E,{label:s.safeMode?.enabled?"Return to Normal Mode":"Reload in Safe Mode",subLabel:`This will reload Discord ${s.safeMode?.enabled?"normally.":"without loading plugins."}`,leading:React.createElement(E.Icon,{source:f("ic_privacy_24px")}),onPress:st}),React.createElement(G,null),React.createElement(E,{label:"Asset Browser",leading:React.createElement(E.Icon,{source:f("ic_image")}),trailing:E.Arrow,onPress:function(){return e.push("VendettaCustomPage",{title:"Asset Browser",render:Qn})}}),React.createElement(G,null)),React.createElement(mt,{title:"Info"},React.createElement(Fe,{label:"Versions",icon:"ic_information_filled_24px"},t.map(function(r,o){return React.createElement(React.Fragment,null,React.createElement(Nt,{label:r.label,version:r.version,icon:r.icon}),o!==t.length-1&&React.createElement(G,null))})),React.createElement(G,null),React.createElement(Fe,{label:"Platform",icon:"ic_mobile_device"},n.map(function(r,o){return React.createElement(React.Fragment,null,React.createElement(Nt,{label:r.label,version:r.version,icon:r.icon}),o!==n.length-1&&React.createElement(G,null))})),React.createElement(G,null),React.createElement(Fe,{label:"Opti Stats",icon:"ic_list"},React.createElement(E,{label:"Enabled Plugins: "+Bn(),leading:React.createElement(E.Icon,{source:f("ic_download_24px")})}),React.createElement(E,{label:"Enabled Themes: "+gn(),leading:React.createElement(E.Icon,{source:f("ic_paint_brush")})}))),React.createElement(mt,{title:"Developer"},React.createElement(E,{label:"ErrorBoundary Tools",leading:React.createElement(E.Icon,{source:f("ic_warning_24px")}),trailing:E.Arrow,onPress:function(){return Oi({key:"ErrorBoundaryTools",header:{title:"Which ErrorBoundary do you want to trip?",icon:React.createElement(E.Icon,{style:{marginRight:8},source:f("ic_warning_24px")}),onClose:function(){return ki()}},options:[{label:"Opti",onPress:function(){return e.push("VendettaCustomPage",{render:function(){return React.createElement("undefined",null)}})}},{label:"Discord",isDestructive:!0,onPress:function(){return e.push("VendettaCustomPage",{noErrorBoundary:!0})}}]})}}),React.createElement(G,null),React.createElement(Yo,{value:s.debuggerUrl,onChange:function(r){return s.debuggerUrl=r},placeholder:"127.0.0.1:9090",title:"Debugger URL"}),React.createElement(G,null),React.createElement(E,{label:"Connect to debug websocket",leading:React.createElement(E.Icon,{source:f("copy")}),onPress:function(){return Tn(s.debuggerUrl)}}),window.__vendetta_rdc&&React.createElement(React.Fragment,null,React.createElement(G,null),React.createElement(E,{label:"Connect to React DevTools",leading:React.createElement(E.Icon,{source:f("ic_badge_staff")}),onPress:function(){return window.__vendetta_rdc?.connectToDevTools({host:s.debuggerUrl.split(":")?.[0],resolveRNStyle:m.StyleSheet.flatten})}})),window.__vendetta_loader?.features.loaderConfig&&React.createElement(mt,{title:"Developer"},React.createElement(Wo,{label:"Load from custom url",subLabel:"Load Vendetta from a custom endpoint.",leading:React.createElement(E.Icon,{source:f("copy")}),value:ee.customLoadUrl.enabled,onValueChange:function(r){ee.customLoadUrl.enabled=r}}),React.createElement(G,null),ee.customLoadUrl.enabled&&React.createElement(React.Fragment,null,React.createElement(Yo,{value:ee.customLoadUrl.url,onChange:function(r){return ee.customLoadUrl.url=r},placeholder:"http://localhost:4040/vendetta.js",title:"VENDETTA URL"}),React.createElement(G,null)),window.__vendetta_loader.features.devtools&&React.createElement(Wo,{label:"Load React DevTools",subLabel:`Version: ${window.__vendetta_loader.features.devtools.version}`,leading:React.createElement(E.Icon,{source:f("ic_badge_staff")}),value:ee.loadReactDevTools,onValueChange:function(r){ee.loadReactDevTools=r}}),React.createElement(G,null)))))}var E,Wo,mt,G,Yo,ki,Oi,B,Xo=c(()=>{"use strict";g();Oe();Le();w();W();se();b();T();V();V();jo();Ko();Le();ge();Y();g();Q();({FormRow:E,FormSwitchRow:Wo,FormSection:mt,FormDivider:G,FormInput:Yo}=y),{hideActionSheet:ki}=u("openLazy","hideActionSheet"),{showSimpleActionSheet:Oi}=u("showSimpleActionSheet"),B=Be()});function dt(e){let{items:t,safeModeMessage:n,safeModeExtras:r,card:o}=e;S(s),S(t);let[a,i]=React.useState("");return React.createElement(v,null,React.createElement(m.FlatList,{ListHeaderComponent:React.createElement(React.Fragment,null,s.safeMode?.enabled&&React.createElement(m.View,{style:{marginBottom:10}},React.createElement(zn,{messageType:0},n),r),React.createElement(Je,{style:{marginBottom:10},onChangeText:function(l){return i(l.toLowerCase())},placeholder:"Search Plugins"})),style:{paddingHorizontal:10,paddingTop:10},contentContainerStyle:{paddingBottom:20},data:Object.values(t).filter(function(l){return l.id?.toLowerCase().includes(a)}),renderItem:function(l){let{item:d,index:p}=l;return React.createElement(o,{item:d,index:p})}}))}var tr=c(()=>{"use strict";g();W();T();V()});function pt(e){let t=e.toggleValue??!1;return React.createElement(m.View,{style:[Ze.card,{marginTop:e.index!==0?10:0}]},React.createElement(Pt,{style:Ze.header,label:e.headerLabel,leading:e.headerIcon&&React.createElement(Pt.Icon,{source:f(e.headerIcon)}),trailing:e.toggleType&&(e.toggleType==="switch"?React.createElement(Ui,{style:m.Platform.OS==="android"&&{marginVertical:-15},value:e.toggleValue,onValueChange:e.onToggleChange}):React.createElement(m.Pressable,{onPress:function(){t=!t,e.onToggleChange?.(t)}},React.createElement(Vi,{selected:e.toggleValue})))}),React.createElement(Pt,{style:Ze.description,label:e.descriptionLabel,trailing:React.createElement(m.View,{style:Ze.actions},e.overflowActions&&React.createElement(m.TouchableOpacity,{onPress:function(){return Hi({key:"CardOverflow",header:{title:e.overflowTitle,icon:e.headerIcon&&React.createElement(Pt.Icon,{style:{marginRight:8},source:f(e.headerIcon)}),onClose:function(){return Gi()}},options:e.overflowActions?.map(function(n){return{...n,icon:f(n.icon)}})})}},React.createElement(m.Image,{style:Ze.icon,source:f("ic_more_24px")})),e.actions?.map(function(n){let{icon:r,onPress:o}=n;return React.createElement(m.TouchableOpacity,{onPress:o},React.createElement(m.Image,{style:Ze.icon,source:f(r)}))}))}))}var Fi,Pt,Ui,Vi,Gi,Hi,Ze,nr=c(()=>{"use strict";g();w();b();Ue();T();({Fonts:Fi}=xe),{FormRow:Pt,FormSwitch:Ui,FormRadio:Vi}=y,{hideActionSheet:Gi}=u("openLazy","hideActionSheet"),{showSimpleActionSheet:Hi}=u("showSimpleActionSheet"),Ze=F.createThemedStyleSheet({card:{backgroundColor:x?.BACKGROUND_SECONDARY,borderRadius:7},header:{padding:0,backgroundColor:x?.PRIMARY_DARK_800,borderTopLeftRadius:5,borderTopRightRadius:5,fontFamily:Fi?.PRIMARY_BOLD,fontWeight:"500"},description:{color:x?.HEADER_SECONDARY,fontSize:12},actions:{flexDirection:"row-reverse",alignItems:"center"},icon:{width:22,height:22,marginLeft:5,tintColor:x?.INTERACTIVE_NORMAL}})});async function Jo(e,t){e.enabled&&Ye(e.id,!1),t(),e.enabled&&await We(e.id)}function rr(e){let{item:t,index:n}=e,r=Ln(t.id),o=de.useNavigation(),[a,i]=React.useState(!1);return a?null:React.createElement(pt,{index:n,headerLabel:`${t.manifest.name} +`):a)),React.createElement(m.View,{style:ft.footer},i.map(function(l){let d=i.indexOf(l)!==0?8:0;return React.createElement(_,{text:l.text,color:l.color??z.BRAND,size:l.size??"small",onPress:l.onPress,style:ae.isTablet?{flex:`0.${i.length}`,marginLeft:d}:{marginTop:d}})}))))})}var Ni,Pi,Fo,ft,Uo,Go=c(()=>{"use strict";ze();g();w();P();Le();se();Ue();T();V();Ni=N("ErrorBoundary"),{BadgableTabBar:Pi}=u("BadgableTabBar"),{TextStyleSheet:Fo}=u("TextStyleSheet"),ft=F.createThemedStyleSheet({container:{flex:1,backgroundColor:x.BACKGROUND_PRIMARY,paddingHorizontal:16},header:{flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center",marginVertical:8},headerTitle:{...Fo["heading-md/semibold"],textAlign:"center",textTransform:"uppercase",color:x.HEADER_PRIMARY},headerDescription:{...Fo["text-sm/medium"],textAlign:"center",color:x.TEXT_MUTED},footer:{flexDirection:ae.isTablet?"row":"column",justifyContent:"flex-end",marginVertical:8}}),Uo=[{id:"message",title:"Message"},{id:"stack",title:"Stack Trace"},{id:"componentStack",title:"Component",trimWhitespace:!0}]});function At(e){let{alertTitle:t,installFunction:n}=e;return React.createElement(m.TouchableOpacity,{onPress:function(){return U.getString().then(function(r){return Xn({title:t,initialValue:r.match(lt)?.[0]??"",placeholder:"https://example.com/",onConfirm:function(o){return n(o)},confirmText:"Install",cancelText:"Cancel"})})}},React.createElement(m.Image,{style:Di.icon,source:f("ic_add_24px")}))}var Di,Ho=c(()=>{"use strict";g();Oe();Ve();b();Ue();Di=F.createThemedStyleSheet({icon:{marginRight:10,tintColor:x.HEADER_PRIMARY}})});function qn(e){let{asset:t}=e;return React.createElement(Mi,{label:`${t.name} - ${t.id}`,trailing:React.createElement(m.Image,{source:t.id,style:{width:32,height:32}}),onPress:function(){U.setString(t.name),h("Copied asset name to clipboard.",f("toast_copy_link"))}})}var Mi,$o=c(()=>{"use strict";g();Q();b();T();({FormRow:Mi}=y)});function Qn(){let[e,t]=React.useState("");return React.createElement(v,null,React.createElement(m.View,{style:{flex:1}},React.createElement(Je,{style:{margin:10},onChangeText:function(n){return t(n)},placeholder:"Search"}),React.createElement(m.FlatList,{data:Object.values(pe).filter(function(n){return n.name.includes(e)||n.id.toString()===e}),renderItem:function(n){let{item:r}=n;return React.createElement(qn,{asset:r})},ItemSeparatorComponent:Bi,keyExtractor:function(n){return n.name}})))}var Bi,jo=c(()=>{"use strict";g();b();T();$o();({FormDivider:Bi}=y)});function Nt(e){let{label:t,version:n,icon:r}=e;return React.createElement(zo,{label:t,leading:React.createElement(zo.Icon,{source:f(r)}),trailing:React.createElement(Li,null,n),onPress:function(){U.setString(`${t} - ${n}`),h("Copied version to clipboard.",f("toast_copy_link"))}})}var zo,Li,Ko=c(()=>{"use strict";g();b();Q();T();({FormRow:zo,FormText:Li}=y)});function er(){let e=de.useNavigation();S(s),S(ee);let t=[{label:"Discord Version",version:`${B.discord.version} (${B.discord.build})`,icon:"Discord"},{label:"React",version:B.react.version,icon:"ic_category_16px"},{label:"React Native",version:B.react.nativeVersion,icon:"mobile"},{label:"Bytecode",version:B.hermes.bytecodeVersion,icon:"ic_server_security_24px"}],n=[{label:"Loader",version:B.vendetta.loader,icon:"ic_download_24px"},{label:"OS",version:`${B.os.name} ${B.os.version}`,icon:"ic_cog_24px"},...B.os.sdk?[{label:"SDK",version:B.os.sdk,icon:"ic_profile_badge_verified_developer_color"}]:[],{label:"Manufacturer",version:B.device.manufacturer,icon:"ic_badge_staff"},{label:"Brand",version:B.device.brand,icon:"ic_settings_boost_24px"},{label:"Model",version:B.device.model,icon:"ic_phonelink_24px"},{label:m.Platform.select({android:"Codename",ios:"Machine ID"}),version:B.device.codename,icon:"ic_compose_24px"}];return React.createElement(v,null,React.createElement(m.ScrollView,{style:{flex:1},contentContainerStyle:{paddingBottom:38}},React.createElement(mt,{title:"Important",titleStyleType:"no_border"},React.createElement(E,{label:"Opti Version - "+B.vendetta.version,leading:React.createElement(E.Icon,{source:f("boost")}),onPress:function(){U.setString(`Opti Version - ${B.vendetta.version}`),h("Copied Opti version to clipboard!",f("ic_badge_staff"))}}),React.createElement(G,null),React.createElement(E,{label:"Discord Server",leading:React.createElement(E.Icon,{source:f("Discord")}),trailing:E.Arrow,onPress:function(){return $e.openDeeplink(On)}}),React.createElement(G,null),React.createElement(E,{label:"GitHub Repository",leading:React.createElement(E.Icon,{source:f("img_account_sync_github_white")}),trailing:E.Arrow,onPress:function(){return $e.openURL(Vn)}})),React.createElement(mt,{title:"Actions"},React.createElement(E,{label:"Reload Discord",subLabel:"This has a chance of crashing instead of directly reloading.",leading:React.createElement(E.Icon,{source:f("ic_message_retry")}),onPress:function(){return ie.reload()}}),React.createElement(G,null),React.createElement(E,{label:s.safeMode?.enabled?"Return to Normal Mode":"Reload in Safe Mode",subLabel:`This will reload Discord ${s.safeMode?.enabled?"normally.":"without loading plugins."}`,leading:React.createElement(E.Icon,{source:f("ic_privacy_24px")}),onPress:st}),React.createElement(G,null),React.createElement(E,{label:"Asset Browser",leading:React.createElement(E.Icon,{source:f("ic_image")}),trailing:E.Arrow,onPress:function(){return e.push("VendettaCustomPage",{title:"Asset Browser",render:Qn})}}),React.createElement(G,null)),React.createElement(mt,{title:"Info"},React.createElement(Fe,{label:"Versions",icon:"ic_information_filled_24px"},t.map(function(r,o){return React.createElement(React.Fragment,null,React.createElement(Nt,{label:r.label,version:r.version,icon:r.icon}),o!==t.length-1&&React.createElement(G,null))})),React.createElement(G,null),React.createElement(Fe,{label:"Platform",icon:"ic_mobile_device"},n.map(function(r,o){return React.createElement(React.Fragment,null,React.createElement(Nt,{label:r.label,version:r.version,icon:r.icon}),o!==n.length-1&&React.createElement(G,null))})),React.createElement(G,null),React.createElement(Fe,{label:"Opti Stats",icon:"ic_list"},React.createElement(E,{label:"Enabled Plugins: "+Bn(),leading:React.createElement(E.Icon,{source:f("ic_download_24px")})}),React.createElement(E,{label:"Enabled Themes: "+gn(),leading:React.createElement(E.Icon,{source:f("ic_paint_brush")})}))),React.createElement(mt,{title:"Developer"},React.createElement(E,{label:"ErrorBoundary Tools",leading:React.createElement(E.Icon,{source:f("ic_warning_24px")}),trailing:E.Arrow,onPress:function(){return Oi({key:"ErrorBoundaryTools",header:{title:"Which ErrorBoundary do you want to trip?",icon:React.createElement(E.Icon,{style:{marginRight:8},source:f("ic_warning_24px")}),onClose:function(){return ki()}},options:[{label:"Opti",onPress:function(){return e.push("VendettaCustomPage",{render:function(){return React.createElement("undefined",null)}})}},{label:"Discord",isDestructive:!0,onPress:function(){return e.push("VendettaCustomPage",{noErrorBoundary:!0})}}]})}}),React.createElement(G,null),React.createElement(Yo,{value:s.debuggerUrl,onChange:function(r){return s.debuggerUrl=r},placeholder:"127.0.0.1:9090",title:"Debugger URL"}),React.createElement(G,null),React.createElement(E,{label:"Connect to debug websocket",leading:React.createElement(E.Icon,{source:f("copy")}),onPress:function(){return Tn(s.debuggerUrl)}}),window.__vendetta_rdc&&React.createElement(React.Fragment,null,React.createElement(G,null),React.createElement(E,{label:"Connect to React DevTools",leading:React.createElement(E.Icon,{source:f("ic_badge_staff")}),onPress:function(){return window.__vendetta_rdc?.connectToDevTools({host:s.debuggerUrl.split(":")?.[0],resolveRNStyle:m.StyleSheet.flatten})}})),window.__vendetta_loader?.features.loaderConfig&&React.createElement(mt,{title:"Developer"},React.createElement(Wo,{label:"Load from custom url",subLabel:"Load Vendetta from a custom endpoint.",leading:React.createElement(E.Icon,{source:f("copy")}),value:ee.customLoadUrl.enabled,onValueChange:function(r){ee.customLoadUrl.enabled=r}}),React.createElement(G,null),ee.customLoadUrl.enabled&&React.createElement(React.Fragment,null,React.createElement(Yo,{value:ee.customLoadUrl.url,onChange:function(r){return ee.customLoadUrl.url=r},placeholder:"http://localhost:4040/vendetta.js",title:"VENDETTA URL"}),React.createElement(G,null)),window.__vendetta_loader.features.devtools&&React.createElement(Wo,{label:"Load React DevTools",subLabel:`Version: ${window.__vendetta_loader.features.devtools.version}`,leading:React.createElement(E.Icon,{source:f("ic_badge_staff")}),value:ee.loadReactDevTools,onValueChange:function(r){ee.loadReactDevTools=r}}),React.createElement(G,null)))))}var E,Wo,mt,G,Yo,ki,Oi,B,Xo=c(()=>{"use strict";g();Oe();Le();w();W();se();b();T();V();V();jo();Ko();Le();ge();Y();g();Q();({FormRow:E,FormSwitchRow:Wo,FormSection:mt,FormDivider:G,FormInput:Yo}=y),{hideActionSheet:ki}=u("openLazy","hideActionSheet"),{showSimpleActionSheet:Oi}=u("showSimpleActionSheet"),B=Be()});function dt(e){let{items:t,safeModeMessage:n,safeModeExtras:r,card:o}=e;S(s),S(t);let[a,i]=React.useState("");return React.createElement(v,null,React.createElement(m.FlatList,{ListHeaderComponent:React.createElement(React.Fragment,null,s.safeMode?.enabled&&React.createElement(m.View,{style:{marginBottom:10}},React.createElement(zn,{messageType:0},n),r),React.createElement(Je,{style:{marginBottom:10},onChangeText:function(l){return i(l.toLowerCase())},placeholder:"Search Plugins"})),style:{paddingHorizontal:10,paddingTop:10},contentContainerStyle:{paddingBottom:20},data:Object.values(t).filter(function(l){return l.id?.toLowerCase().includes(a)}),renderItem:function(l){let{item:d,index:p}=l;return React.createElement(o,{item:d,index:p})}}))}var tr=c(()=>{"use strict";g();W();T();V()});function pt(e){let t=e.toggleValue??!1;return React.createElement(m.View,{style:[Ze.card,{marginTop:e.index!==0?10:0}]},React.createElement(Pt,{style:Ze.header,label:e.headerLabel,leading:e.headerIcon&&React.createElement(Pt.Icon,{source:f(e.headerIcon)}),trailing:e.toggleType&&(e.toggleType==="switch"?React.createElement(Fi,{style:m.Platform.OS==="android"&&{marginVertical:-15},value:e.toggleValue,onValueChange:e.onToggleChange}):React.createElement(m.Pressable,{onPress:function(){t=!t,e.onToggleChange?.(t)}},React.createElement(Ui,{selected:e.toggleValue})))}),React.createElement(Pt,{style:Ze.description,label:e.descriptionLabel,trailing:React.createElement(m.View,{style:Ze.actions},e.overflowActions&&React.createElement(m.TouchableOpacity,{onPress:function(){return Gi({key:"CardOverflow",header:{title:e.overflowTitle,icon:e.headerIcon&&React.createElement(Pt.Icon,{style:{marginRight:8},source:f(e.headerIcon)}),onClose:function(){return Vi()}},options:e.overflowActions?.map(function(n){return{...n,icon:f(n.icon)}})})}},React.createElement(m.Image,{style:Ze.icon,source:f("ic_more_24px")})),e.actions?.map(function(n){let{icon:r,onPress:o}=n;return React.createElement(m.TouchableOpacity,{onPress:o},React.createElement(m.Image,{style:Ze.icon,source:f(r)}))}))}))}var Pt,Fi,Ui,Vi,Gi,Ze,nr=c(()=>{"use strict";g();w();b();Ue();T();({FormRow:Pt,FormSwitch:Fi,FormRadio:Ui}=y),{hideActionSheet:Vi}=u("openLazy","hideActionSheet"),{showSimpleActionSheet:Gi}=u("showSimpleActionSheet"),Ze=F.createThemedStyleSheet({card:{backgroundColor:x.BACKGROUND_SECONDARY,borderRadius:7},header:{padding:0,backgroundColor:x.PRIMARY_DARK_800,borderTopLeftRadius:5,borderTopRightRadius:5,fontFamily:xe.Fonts.PRIMARY_BOLD},description:{color:x.TEXT_MUTED,fontSize:12},actions:{flexDirection:"row-reverse",alignItems:"center"},icon:{width:22,height:22,marginLeft:5,tintColor:x?.INTERACTIVE_NORMAL}})});async function Jo(e,t){e.enabled&&Ye(e.id,!1),t(),e.enabled&&await We(e.id)}function rr(e){let{item:t,index:n}=e,r=Ln(t.id),o=de.useNavigation(),[a,i]=React.useState(!1);return a?null:React.createElement(pt,{index:n,headerLabel:`${t.manifest.name} by ${t.manifest.authors.map(function(l){return l.name}).join(", ")}`,headerIcon:t.manifest.vendetta?.icon||"ic_application_command_24px",toggleType:"switch",toggleValue:t.enabled,onToggleChange:function(l){try{l?We(t.id):Ye(t.id)}catch(d){h(d.message,f("Small"))}},descriptionLabel:t.manifest.description,overflowTitle:t.manifest.name,overflowActions:[{label:"View Creator Profile",icon:"ic_profile_24px",onPress:function(){Se.getUser(t.manifest.authors[0]?.id)?Me.showUserProfile({userId:t.manifest.authors[0]?.id}):ot.fetchProfile(t.manifest.authors[0]?.id).then(function(){Me.showUserProfile({userId:t.manifest.authors[0]?.id})})}},{icon:"RetryIcon",label:"Refetch",onPress:async function(){Jo(t,function(){Ke(t.id).then(async function(){h("Successfully refetched plugin.",f("toast_image_saved"))}).catch(function(){h("Failed to refetch plugin!",f("Small"))})})}},{icon:"copy",label:"Copy URL",onPress:function(){U.setString(t.id),h("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,h(`${t.update?"Enabled":"Disabled"} updates for ${t.manifest.name}.`,f("toast_image_saved"))}},{icon:"ic_duplicate",label:"Clear data",isDestructive:!0,onPress:function(){return te({title:"Wait!",content:`Are you sure you wish to clear the data of ${t.manifest.name}?`,confirmText:"Clear",cancelText:"Cancel",confirmColor:z.RED,onConfirm:function(){Jo(t,function(){try{ye.removeItem(t.id),h(`Cleared data for ${t.manifest.name}.`,f("trash"))}catch{h(`Failed to clear data for ${t.manifest.name}!`,f("Small"))}})}})}},{icon:"ic_message_delete",label:"Delete",isDestructive:!0,onPress:function(){return te({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:z.RED,onConfirm:function(){try{Dn(t.id),i(!0)}catch(l){h(l.message,f("Small"))}}})}}],actions:[...r?[{icon:"settings",onPress:function(){return o.push("VendettaCustomPage",{title:t.manifest.name,render:r})}}]:[]]})}var Zo=c(()=>{"use strict";ze();g();ge();se();b();Q();Ve();nr()});function or(){return S(s),React.createElement(dt,{items:M,safeModeMessage:"Safe Mode prevents plugins from being loaded. To exit Safe Mode go to the 'Opti' tab and go back to Normal Mode.",card:rr})}var qo=c(()=>{"use strict";W();ge();V();tr();Zo()});async function Qo(e,t){await Pe(e?t:"default"),ie.reload()}function ar(e){let{item:t,index:n}=e;S(s);let[r,o]=React.useState(!1);if(r)return null;let a=t.data.authors;return React.createElement(pt,{index:n,headerLabel:`${t.data.name} ${a?` -by ${a.map(function(i){return i.name}).join(", ")}`:""}`,headerIcon:"ic_theme_24px",descriptionLabel:t.data.description??"No description.",toggleType:s.safeMode?.enabled?void 0:"switch",toggleValue:t.selected,onToggleChange:function(i){Qo(i,t.id)},overflowTitle:t.data.name,overflowActions:[{label:"View Creator Profile",icon:"ic_profile_24px",onPress:function(){Se.getUser(t.data.authors[0]?.id)?Me.showUserProfile({userId:t.data.authors[0]?.id}):ot.fetchProfile(t.data.authors[0]?.id).then(function(){Me.showUserProfile({userId:t.data.authors[0]?.id})})}},{icon:"ic_sync_24px",label:"Refetch",onPress:function(){rt(t.id,t.selected).then(function(){t.selected?te({title:"Theme refetched",content:"A reload is required to see the changes. Do you want to reload now?",confirmText:"Reload",cancelText:"Cancel",confirmColor:z.RED,onConfirm:function(){return ie.reload()}}):h("Successfully refetched theme.",f("toast_image_saved"))}).catch(function(){h("Failed to refetch theme!",f("Small"))})}},{icon:"copy",label:"Copy URL",onPress:function(){U.setString(t.id),h("Copied theme URL to clipboard.",f("toast_copy_link"))}},{icon:"ic_message_delete",label:"Delete",isDestructive:!0,onPress:function(){return te({title:"Wait!",content:`Are you sure you wish to delete ${t.data.name}?`,confirmText:"Delete",cancelText:"Cancel",confirmColor:z.RED,onConfirm:function(){dn(t.id).then(function(i){o(!0),i&&Qo(!1,t.id)}).catch(function(i){h(i.message,f("Small"))})}})}}]})}var ea=c(()=>{"use strict";ze();g();Y();W();se();b();Ve();Q();V();nr()});function ir(){return S(s),React.createElement(dt,{items:O,safeModeMessage:`You are in Safe Mode, meaning themes have been temporarily disabled.${s.safeMode?.currentThemeId?" If a theme appears to be causing the issue, you can press below to disable it.":""}`,safeModeExtras:s.safeMode?.currentThemeId?React.createElement(_,{text:"Disable Shader",color:z.BRAND,size:"small",onPress:function(){delete s.safeMode?.currentThemeId},style:{marginTop:8}}):void 0,card:ar})}var ta=c(()=>{"use strict";ze();W();Y();T();V();tr();ea()});function Dt(){console.log("TweakManager has loaded SilentTyping."),na=["startTyping","stopTyping"].map(function(e){return q(e,$i,function(){})})}function Mt(){console.log("TweakManager has unloaded SilentTyping."),na.forEach(function(e){return e()})}var $i,na,sr=c(()=>{"use strict";P();w();$i=u("startTyping"),na=[]});function Bt(){console.log("TweakManager has loaded HideUnneccesaryButtons.");let e=["ic_thread_normal_24px","ic_gift","AppsIcon"].map(function(t){return f(t)});ra=R("render",ji.prototype,function(t,n){let r=K(n,function(a){return a.props?.canSendVoiceMessage});r&&(r.props.canSendVoiceMessage=!1);let o=K(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 Lt(){console.log("TweakManager has unloaded HideUnneccesaryButtons.")}var ji,ra,cr=c(()=>{"use strict";P();w();b();ce();ji=N("ChatInput")});function kt(){console.log("TweakManager has loaded TrustURLs."),oa.push(R("isTrustedDomain",zi,function(){return!0}))}function Ot(){console.log("TweakManager has unloaded TrustURLs.");for(let e of oa)e()}var zi,oa,lr=c(()=>{"use strict";P();w();zi=Ee("MaskedLinkStore"),oa=[]});function Ft(){console.log("TweakManager has loaded EnableExperiments.");try{Se.getCurrentUser().flags|=1,Se._dispatcher._actionHandlers._computeOrderedActionHandlers("OVERLAY_INITIALIZE").forEach(function(e){e.name.includes("Experiment")&&e.actionHandler({serializedExperimentStore:Wi.getSerializedState(),user:{flags:1}})})}catch{let t=new Error;console.error(t.stack)}}function Ut(){console.log("TweakManager has unloaded EnableExperiments."),Ki.unsubscribe("CONNECTION_OPEN")}var Ki,Wi,ur=c(()=>{"use strict";w();g();Ki=u("_currentDispatchActionType"),Wi=u("getSerializedState")});function Vt(){console.log("TweakManager has loaded RemoveDeletePrompts.");let e=u("show","openLazy");aa=q("show",e,function(t,n){t?.[0]?.title===me.Messages.DELETE_MESSAGE?t[0].onConfirm?.():n(...t)})}function Gt(){console.log("TweakManager has unloaded RemoveDeletePrompt.")}var aa,fr=c(()=>{"use strict";P();w();g()});function mr(){let[e,t]=React.useState("");return S(s),s.tweaks??={},React.createElement(v,null,React.createElement(m.View,{style:{flex:1}},React.createElement(ne,{label:"Tweaks",subLabel:`Right now most tweaks are ported Vendetta plugins, when Opti rewrites, this will change. +by ${a.map(function(i){return i.name}).join(", ")}`:""}`,headerIcon:"ic_theme_24px",descriptionLabel:t.data.description??"No description.",toggleType:s.safeMode?.enabled?void 0:"switch",toggleValue:t.selected,onToggleChange:function(i){Qo(i,t.id)},overflowTitle:t.data.name,overflowActions:[{label:"View Creator Profile",icon:"ic_profile_24px",onPress:function(){Se.getUser(t.data.authors[0]?.id)?Me.showUserProfile({userId:t.data.authors[0]?.id}):ot.fetchProfile(t.data.authors[0]?.id).then(function(){Me.showUserProfile({userId:t.data.authors[0]?.id})})}},{icon:"ic_sync_24px",label:"Refetch",onPress:function(){rt(t.id,t.selected).then(function(){t.selected?te({title:"Theme refetched",content:"A reload is required to see the changes. Do you want to reload now?",confirmText:"Reload",cancelText:"Cancel",confirmColor:z.RED,onConfirm:function(){return ie.reload()}}):h("Successfully refetched theme.",f("toast_image_saved"))}).catch(function(){h("Failed to refetch theme!",f("Small"))})}},{icon:"copy",label:"Copy URL",onPress:function(){U.setString(t.id),h("Copied theme URL to clipboard.",f("toast_copy_link"))}},{icon:"ic_message_delete",label:"Delete",isDestructive:!0,onPress:function(){return te({title:"Wait!",content:`Are you sure you wish to delete ${t.data.name}?`,confirmText:"Delete",cancelText:"Cancel",confirmColor:z.RED,onConfirm:function(){dn(t.id).then(function(i){o(!0),i&&Qo(!1,t.id)}).catch(function(i){h(i.message,f("Small"))})}})}}]})}var ea=c(()=>{"use strict";ze();g();Y();W();se();b();Ve();Q();V();nr()});function ir(){return S(s),React.createElement(dt,{items:O,safeModeMessage:`You are in Safe Mode, meaning themes have been temporarily disabled.${s.safeMode?.currentThemeId?" If a theme appears to be causing the issue, you can press below to disable it.":""}`,safeModeExtras:s.safeMode?.currentThemeId?React.createElement(_,{text:"Disable Shader",color:z.BRAND,size:"small",onPress:function(){delete s.safeMode?.currentThemeId},style:{marginTop:8}}):void 0,card:ar})}var ta=c(()=>{"use strict";ze();W();Y();T();V();tr();ea()});function Dt(){console.log("TweakManager has loaded SilentTyping."),na=["startTyping","stopTyping"].map(function(e){return q(e,Hi,function(){})})}function Mt(){console.log("TweakManager has unloaded SilentTyping."),na.forEach(function(e){return e()})}var Hi,na,sr=c(()=>{"use strict";P();w();Hi=u("startTyping"),na=[]});function Bt(){console.log("TweakManager has loaded HideUnneccesaryButtons.");let e=["ic_thread_normal_24px","ic_gift","AppsIcon"].map(function(t){return f(t)});ra=R("render",$i.prototype,function(t,n){let r=K(n,function(a){return a.props?.canSendVoiceMessage});r&&(r.props.canSendVoiceMessage=!1);let o=K(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 Lt(){console.log("TweakManager has unloaded HideUnneccesaryButtons.")}var $i,ra,cr=c(()=>{"use strict";P();w();b();ce();$i=N("ChatInput")});function kt(){console.log("TweakManager has loaded TrustURLs."),oa.push(R("isTrustedDomain",ji,function(){return!0}))}function Ot(){console.log("TweakManager has unloaded TrustURLs.");for(let e of oa)e()}var ji,oa,lr=c(()=>{"use strict";P();w();ji=Ee("MaskedLinkStore"),oa=[]});function Ft(){console.log("TweakManager has loaded EnableExperiments.");try{Se.getCurrentUser().flags|=1,Se._dispatcher._actionHandlers._computeOrderedActionHandlers("OVERLAY_INITIALIZE").forEach(function(e){e.name.includes("Experiment")&&e.actionHandler({serializedExperimentStore:Ki.getSerializedState(),user:{flags:1}})})}catch{let t=new Error;console.error(t.stack)}}function Ut(){console.log("TweakManager has unloaded EnableExperiments."),zi.unsubscribe("CONNECTION_OPEN")}var zi,Ki,ur=c(()=>{"use strict";w();g();zi=u("_currentDispatchActionType"),Ki=u("getSerializedState")});function Vt(){console.log("TweakManager has loaded RemoveDeletePrompts.");let e=u("show","openLazy");aa=q("show",e,function(t,n){t?.[0]?.title===me.Messages.DELETE_MESSAGE?t[0].onConfirm?.():n(...t)})}function Gt(){console.log("TweakManager has unloaded RemoveDeletePrompt.")}var aa,fr=c(()=>{"use strict";P();w();g()});function mr(){let[e,t]=React.useState("");return S(s),s.tweaks??={},React.createElement(v,null,React.createElement(m.View,{style:{flex:1}},React.createElement(ne,{label:"Tweaks",subLabel:`Right now most tweaks are ported Vendetta plugins, when Opti rewrites, this will change. Want yours removed? Contact me I'll remove it ASAP.`,onPress:function(){console.log("hi")}}),React.createElement(qe,null),React.createElement(ne,{label:s.tweaks.silentTyping?.valueOf()?"Silent Typing (Enabled)":"Silent Typing (Disabled)",subLabel:"Hides that you are typing to other people.",leading:React.createElement(ne.Icon,{source:f("bell")}),onPress:function(){s.tweaks.silentTyping??=!1,s.tweaks.silentTyping=!s.tweaks.silentTyping,(s.tweaks.silentTyping?Dt:Mt)()}}),React.createElement(qe,null),React.createElement(ne,{label:s.tweaks.hideButtons?.valueOf()?"Remove Chat Buttons (Enabled)":"Remove Chat Buttons (Disabled)",subLabel:"Removes the Gift, Voice Message, and Activities buton.",leading:React.createElement(ne.Icon,{source:f("ic_trash_24px")}),onPress:function(){s.tweaks.hideButtons??=!1,s.tweaks.hideButtons=!s.tweaks.hideButtons,(s.tweaks.hideButtons?Bt:Lt)()}}),React.createElement(qe,null),React.createElement(ne,{label:s.tweaks.trustURL?.valueOf()?"Trust All URLs (Enabled)":"Trust All URLs (Disabled)",subLabel:'Removes the "Trust This URL?" prompt.',leading:React.createElement(ne.Icon,{source:f("unlocked")}),onPress:function(){s.tweaks.trustURL??=!1,s.tweaks.trustURL=!s.tweaks.trustURL,(s.tweaks.trustURL?kt:Ot)()}}),React.createElement(qe,null),React.createElement(ne,{label:s.tweaks.experiments?.valueOf()?"Staff Mode (Enabled)":"Staff Mode (Disabled)",subLabel:`Enables Discord Experiments - Port of EnableStaging made by acquitelol`,leading:React.createElement(ne.Icon,{source:f("debug")}),onPress:function(){s.tweaks.experiments??=!0,s.tweaks.experiments=!s.tweaks.experiments,(s.tweaks.experiments?Ft:Ut)()}}),React.createElement(qe,null),React.createElement(ne,{label:s.tweaks.fastdelete?.valueOf()?"Message Delete Prompt (Enabled)":"Message Delete Prompt (Disabled)",subLabel:"Delete messages without the warning prompt.",leading:React.createElement(ne.Icon,{source:f("ic_message_delete")}),onPress:function(){s.tweaks.fastdelete??=!0,s.tweaks.fastdelete=!s.tweaks.fastdelete,(s.tweaks.fastdelete?Vt:Gt)()}}),React.createElement(qe,null)))}var qe,ne,ia=c(()=>{"use strict";g();T();b();sr();cr();lr();V();W();ur();fr();({FormDivider:qe,FormRow:ne}=y)});var ym,Em,wm,bm,_m,Yi,gt,Ht,Qe,ht,sa,dr,$t=c(()=>{"use strict";g();ge();Y();Ve();Ue();Q();ce();b();V();Hn();Ho();Xo();qo();ta();Oe();ia();T();({FormRow:ym,FormSwitchRow:Em,FormSection:wm,FormDivider:bm,FormInput:_m}=y),Yi=F.createThemedStyleSheet({container:{flex:1,backgroundColor:x.BACKGROUND_MOBILE_PRIMARY}}),gt=function(e,t){return t?St.snakeCase(e).toUpperCase():e},Ht=function(e,t){return Object.fromEntries(e.map(function(n){return[n.key,typeof t=="function"?t(n):typeof t=="string"?n[t]:t]}))},Qe=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return[{key:gt("VendettaSettings",e),title:"Opti",icon:"https://raw.githubusercontent.com/Opti-mod/assets/main/Opti%202.png",render:er},{key:gt("VendettaSettingsTM",e),title:"Tweaks",icon:"ic_hammer_and_chisel_24px",render:mr},{key:gt("VendettaPlugins",e),title:"Plugins",icon:"ic_behavior_24px",options:{headerRight:function(){return React.createElement(At,{alertTitle:"Install Plugin",installFunction:async function(t){if(!t.startsWith(ke))setImmediate(function(){return te({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 ve(t).then(function(){return h("Installed plugin",f("Check"))}).catch(function(n){return h(n?.message??`${n}`,f("Small"))})},cancelText:"Cancel"})});else return await ve(t)}})}},render:or},{key:gt("VendettaThemes",e),title:"Shaders",icon:"ic_theme_24px",shouldRender:function(){return window.__vendetta_loader?.features.hasOwnProperty("themes")??!0},options:{headerRight:function(){return!s.safeMode?.enabled&&React.createElement(At,{alertTitle:"Install Theme",installFunction:Ne})}},render:ir},{key:gt("VendettaCustomPage",e),title:"Opti Page",shouldRender:function(){return!1},render:function(t){let{render:n,noErrorBoundary:r,...o}=t,a=de.useNavigation();return a.addListener("focus",function(){return a.setOptions(Z(o,"render","noErrorBoundary"))}),r?React.createElement(n,null):React.createElement(v,null,React.createElement(n,null))}}]},ht=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return Qe(e).filter(function(t){return t.shouldRender?.()??!0})},sa=function(){return Ht(Qe(),function(e){return{title:e.title,render:e.render,...e.options}})},dr=function(){let e=Qe(!0);return{getLayout:function(){return{title:"Opti",label:"Opti",settings:ht(!0).map(function(t){return t.key})}},titleConfig:Ht(e,"title"),relationships:Ht(e,null),rendererConfigs:Ht(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(m.View,{style:Yi.container},React.createElement(t.render,a.params))});return{type:"route",title:function(){return t.title},icon:t.icon?f(t.icon):null,screen:{route:St.chain(t.key).camelCase().upperFirst().value(),getComponent:function(){return n}}}})}}});function gr(){let e=de.useNavigation();S(s);let t=ht();return React.createElement(v,null,React.createElement(Xi,{key:"Vendetta",title:`Opti ${s.safeMode?.enabled?" (Safe Mode)":""}`},t.map(function(n,r){return React.createElement(React.Fragment,null,React.createElement(pr,{label:n.title,leading:React.createElement(pr.Icon,{source:f(n.icon)}),trailing:pr.Arrow,onPress:function(){return e.push(n.key)}}),r!==t.length-1&&React.createElement(Ji,null))})))}var pr,Xi,Ji,ca=c(()=>{"use strict";g();W();b();$t();T();V();({FormRow:pr,FormSection:Xi,FormDivider:Ji}=y)});function hr(){let e=new Array;return e.push(R("default",Zi,function(t,n){return{...n,...sa()}})),R("default",qi,function(t,n){let r=K(n.props.children,function(o){return o.type&&o.type.name==="UserSettingsOverview"});e.push(R("renderSupportAndAcknowledgements",r.type.prototype,function(o,a){let{props:{children:i}}=a,l=i.findIndex(function(d){return d?.type?.name==="UploadLogsButton"});l!==-1&&i.splice(l,1)})),e.push(R("render",r.type.prototype,function(o,a){let{props:{children:i}}=a,l=[me.Messages.BILLING_SETTINGS,me.Messages.PREMIUM_SETTINGS];i=K(i,function(p){return p.children?.[1].type?.name==="FormSection"}).children;let d=i.findIndex(function(p){return l.includes(p?.props.label)});i.splice(d===-1?4:d,0,React.createElement(gr,null))}))},!0),function(){return e.forEach(function(t){return t()})}}var Zi,qi,la=c(()=>{"use strict";g();w();P();ce();$t();ca();Zi=N("getScreens",!1),qi=N("UserSettingsOverviewWrapper",!1)});function yr(){let e=new Array;return es(e)||Qi(e),function(){return e.forEach(function(t){return t?.()})}}function Qi(e){let t=u("useOverviewSettings"),n=u("getSettingTitleConfig"),r=u("SETTING_RELATIONSHIPS","SETTING_RENDERER_CONFIGS"),o="getSettingSearchListItems",a="getSettingListItems",i=u(o),l=!i,d=l?a:o,p=i??u(a);if(!p||!t)return;let L=Qe(!0),k=ht(!0),I=dr();e.push(R("useOverviewSettings",t,function(Ce,et){return ua(et,I.getLayout())})),e.push(R("getSettingTitleConfig",n,function(Ce,et){return{...et,...I.titleConfig}})),e.push(R(d,p,function(Ce,et){let[Ba]=Ce;return[...k.filter(function(re){return Ba.includes(re.key)}).map(function(re){return{type:"setting_search_result",ancestorRendererData:I.rendererConfigs[re.key],setting:re.key,title:I.titleConfig[re.key],breadcrumbs:["Vendetta"],icon:I.rendererConfigs[re.key].icon}}),...et.filter(function(re){return l||!L.map(function(jt){return jt.key}).includes(re.setting)})].map(function(re,jt,La){return{...re,index:jt,total:La.length}})}));let H=r.SETTING_RELATIONSHIPS,$=r.SETTING_RENDERER_CONFIGS;return r.SETTING_RELATIONSHIPS={...H,...I.relationships},r.SETTING_RENDERER_CONFIGS={...$,...I.rendererConfigs},e.push(function(){r.SETTING_RELATIONSHIPS=H,r.SETTING_RENDERER_CONFIGS=$}),!0}function es(e){let t=u("SearchableSettingsList"),n=u("SETTING_RENDERER_CONFIG"),r=u("getSettingListItems");if(!r||!t||!n)return!1;let o=Qe(!0),a=dr();e.push(en("type",t.SearchableSettingsList,function(l){let[{sections:d}]=l;return ua(d,a.getLayout())})),e.push(R("getSettingListSearchResultItems",r,function(l,d){d.forEach(function(p){return o.some(function(L){return L.key===p.setting})&&(p.breadcrumbs=["Vendetta"])})}));let i=n.SETTING_RENDERER_CONFIG;return n.SETTING_RENDERER_CONFIG={...i,...a.rendererConfigs},e.push(function(){n.SETTING_RENDERER_CONFIG=i}),!0}function ua(e,t){if(!Array.isArray(e)||e.find(function(o){return Rr(o,"Vendetta")}))return;let n=e.findIndex(function(o){return Rr(o,me.Messages.ACCOUNT_SETTINGS)});e.splice(n+1,0,t);let r=e.find(function(o){return Rr(o,me.Messages.SUPPORT)});r&&(r.settings=r.settings.filter(function(o){return o!=="UPLOAD_DEBUG_LOGS"}))}var Rr,fa=c(()=>{"use strict";w();P();$t();g();Rr=function(e,t){return e?.label===t||e?.title===t}});function Er(){let e=[hr(),yr()];return function(){return e.forEach(function(t){return t?.()})}}var ma=c(()=>{"use strict";la();fa()});function ga(e){let{locale:t}=e;try{da&&(da.overrideTheme(ts?.theme??"dark"),pa&&ns.useAMOLEDTheme===2&&pa.setAMOLEDThemeEnabled(!0))}catch(n){D.error("Failed to fix theme...",n)}try{wn.locale(t.toLowerCase())}catch(n){D.error("Failed to fix timestamps...",n)}xt.unsubscribe("I18N_LOAD_SUCCESS",ga)}function ha(){return xt.subscribe("I18N_LOAD_SUCCESS",ga)}var da,pa,ts,ns,Ra=c(()=>{"use strict";g();w();Ae();da=u("updateTheme","overrideTheme"),pa=u("setAMOLEDThemeEnabled"),ts=Ee("ThemeStore"),ns=Ee("UnsyncedUserSettingsStore")});function ya(){console.log("object object is not a function in String, fuck you, now its gone. no more strings to complain about.")}var Ea=c(()=>{"use strict"});async function wa(e){return{patcher:Z(Lr,"unpatchAll"),metro:{...Wt,common:{...bn}},constants:Gn,utils:Jt,debug:Z(In,"versionHash","patchLogHook","toggleSafeMode"),ui:{components:Wn,toasts:Sn,alerts:Jn,assets:xn,...$n},plugins:Z(kn,"initPlugins","evalPlugin"),themes:Z(hn,"initThemes"),commands:Z(Pn,"patchCommands"),storage:ln,settings:s,loader:{identity:window.__vendetta_loader,config:ee},logger:D,version:Tt,unload:function(){e.filter(function(t){return typeof t=="function"}).forEach(function(t){return t()}),delete window.vendetta}}}var ba=c(()=>{"use strict";P();Ae();V();Oe();Le();ge();Y();It();W();w();g();T();Q();Ve();b();Ue();ce()});function _a(){s.tweaks??={},console.log("TweakManager has initialized."),s.tweaks.trustURL==null&&(s.tweaks.trustURL=!1),s.tweaks.hideButtons==null&&(s.tweaks.hideButtons=!1),s.tweaks.silentTyping==null&&(s.tweaks.silentTyping=!1),s.tweaks.experiments==null&&(s.tweaks.experiments=!1),s.tweaks.fastdelete==null&&(s.tweaks.fastdelete=!1),(s.tweaks.trustURL?kt:Ot)(),(s.tweaks.hideButtons?Bt:Lt)(),(s.tweaks.silentTyping?Dt:Mt)(),(s.tweaks.experiments?Ft:Ut)(),(s.tweaks.fastdelete?Vt:Gt)()}var xa=c(()=>{"use strict";V();sr();cr();lr();ur();fr()});var he,Sa,Ta=c(()=>{"use strict";g();Le();he=Be(),Sa=[{name:"debug",description:"Prints Optis debug information to chat.",execute(e,t){let n=`**Opti Debug Info** + Port of EnableStaging made by acquitelol`,leading:React.createElement(ne.Icon,{source:f("debug")}),onPress:function(){s.tweaks.experiments??=!0,s.tweaks.experiments=!s.tweaks.experiments,(s.tweaks.experiments?Ft:Ut)()}}),React.createElement(qe,null),React.createElement(ne,{label:s.tweaks.fastdelete?.valueOf()?"Message Delete Prompt (Enabled)":"Message Delete Prompt (Disabled)",subLabel:"Delete messages without the warning prompt.",leading:React.createElement(ne.Icon,{source:f("ic_message_delete")}),onPress:function(){s.tweaks.fastdelete??=!0,s.tweaks.fastdelete=!s.tweaks.fastdelete,(s.tweaks.fastdelete?Vt:Gt)()}}),React.createElement(qe,null)))}var qe,ne,ia=c(()=>{"use strict";g();T();b();sr();cr();lr();V();W();ur();fr();({FormDivider:qe,FormRow:ne}=y)});var Rm,ym,Em,wm,bm,Wi,gt,Ht,Qe,ht,sa,dr,$t=c(()=>{"use strict";g();ge();Y();Ve();Ue();Q();ce();b();V();Hn();Ho();Xo();qo();ta();Oe();ia();T();({FormRow:Rm,FormSwitchRow:ym,FormSection:Em,FormDivider:wm,FormInput:bm}=y),Wi=F.createThemedStyleSheet({container:{flex:1,backgroundColor:x.BACKGROUND_MOBILE_PRIMARY}}),gt=function(e,t){return t?St.snakeCase(e).toUpperCase():e},Ht=function(e,t){return Object.fromEntries(e.map(function(n){return[n.key,typeof t=="function"?t(n):typeof t=="string"?n[t]:t]}))},Qe=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return[{key:gt("VendettaSettings",e),title:"Opti",icon:"https://raw.githubusercontent.com/Opti-mod/assets/main/Opti%202.png",render:er},{key:gt("VendettaSettingsTM",e),title:"Tweaks",icon:"ic_hammer_and_chisel_24px",render:mr},{key:gt("VendettaPlugins",e),title:"Plugins",icon:"ic_behavior_24px",options:{headerRight:function(){return React.createElement(At,{alertTitle:"Install Plugin",installFunction:async function(t){if(!t.startsWith(ke))setImmediate(function(){return te({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 ve(t).then(function(){return h("Installed plugin",f("Check"))}).catch(function(n){return h(n?.message??`${n}`,f("Small"))})},cancelText:"Cancel"})});else return await ve(t)}})}},render:or},{key:gt("VendettaThemes",e),title:"Shaders",icon:"ic_theme_24px",shouldRender:function(){return window.__vendetta_loader?.features.hasOwnProperty("themes")??!0},options:{headerRight:function(){return!s.safeMode?.enabled&&React.createElement(At,{alertTitle:"Install Theme",installFunction:Ne})}},render:ir},{key:gt("VendettaCustomPage",e),title:"Opti Page",shouldRender:function(){return!1},render:function(t){let{render:n,noErrorBoundary:r,...o}=t,a=de.useNavigation();return a.addListener("focus",function(){return a.setOptions(Z(o,"render","noErrorBoundary"))}),r?React.createElement(n,null):React.createElement(v,null,React.createElement(n,null))}}]},ht=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return Qe(e).filter(function(t){return t.shouldRender?.()??!0})},sa=function(){return Ht(Qe(),function(e){return{title:e.title,render:e.render,...e.options}})},dr=function(){let e=Qe(!0);return{getLayout:function(){return{title:"Opti",label:"Opti",settings:ht(!0).map(function(t){return t.key})}},titleConfig:Ht(e,"title"),relationships:Ht(e,null),rendererConfigs:Ht(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(m.View,{style:Wi.container},React.createElement(t.render,a.params))});return{type:"route",title:function(){return t.title},icon:t.icon?f(t.icon):null,screen:{route:St.chain(t.key).camelCase().upperFirst().value(),getComponent:function(){return n}}}})}}});function gr(){let e=de.useNavigation();S(s);let t=ht();return React.createElement(v,null,React.createElement(Yi,{key:"Vendetta",title:`Opti ${s.safeMode?.enabled?" (Safe Mode)":""}`},t.map(function(n,r){return React.createElement(React.Fragment,null,React.createElement(pr,{label:n.title,leading:React.createElement(pr.Icon,{source:f(n.icon)}),trailing:pr.Arrow,onPress:function(){return e.push(n.key)}}),r!==t.length-1&&React.createElement(Xi,null))})))}var pr,Yi,Xi,ca=c(()=>{"use strict";g();W();b();$t();T();V();({FormRow:pr,FormSection:Yi,FormDivider:Xi}=y)});function hr(){let e=new Array;return e.push(R("default",Ji,function(t,n){return{...n,...sa()}})),R("default",Zi,function(t,n){let r=K(n.props.children,function(o){return o.type&&o.type.name==="UserSettingsOverview"});e.push(R("renderSupportAndAcknowledgements",r.type.prototype,function(o,a){let{props:{children:i}}=a,l=i.findIndex(function(d){return d?.type?.name==="UploadLogsButton"});l!==-1&&i.splice(l,1)})),e.push(R("render",r.type.prototype,function(o,a){let{props:{children:i}}=a,l=[me.Messages.BILLING_SETTINGS,me.Messages.PREMIUM_SETTINGS];i=K(i,function(p){return p.children?.[1].type?.name==="FormSection"}).children;let d=i.findIndex(function(p){return l.includes(p?.props.label)});i.splice(d===-1?4:d,0,React.createElement(gr,null))}))},!0),function(){return e.forEach(function(t){return t()})}}var Ji,Zi,la=c(()=>{"use strict";g();w();P();ce();$t();ca();Ji=N("getScreens",!1),Zi=N("UserSettingsOverviewWrapper",!1)});function yr(){let e=new Array;return Qi(e)||qi(e),function(){return e.forEach(function(t){return t?.()})}}function qi(e){let t=u("useOverviewSettings"),n=u("getSettingTitleConfig"),r=u("SETTING_RELATIONSHIPS","SETTING_RENDERER_CONFIGS"),o="getSettingSearchListItems",a="getSettingListItems",i=u(o),l=!i,d=l?a:o,p=i??u(a);if(!p||!t)return;let L=Qe(!0),k=ht(!0),I=dr();e.push(R("useOverviewSettings",t,function(Ce,et){return ua(et,I.getLayout())})),e.push(R("getSettingTitleConfig",n,function(Ce,et){return{...et,...I.titleConfig}})),e.push(R(d,p,function(Ce,et){let[Ba]=Ce;return[...k.filter(function(re){return Ba.includes(re.key)}).map(function(re){return{type:"setting_search_result",ancestorRendererData:I.rendererConfigs[re.key],setting:re.key,title:I.titleConfig[re.key],breadcrumbs:["Vendetta"],icon:I.rendererConfigs[re.key].icon}}),...et.filter(function(re){return l||!L.map(function(jt){return jt.key}).includes(re.setting)})].map(function(re,jt,La){return{...re,index:jt,total:La.length}})}));let H=r.SETTING_RELATIONSHIPS,$=r.SETTING_RENDERER_CONFIGS;return r.SETTING_RELATIONSHIPS={...H,...I.relationships},r.SETTING_RENDERER_CONFIGS={...$,...I.rendererConfigs},e.push(function(){r.SETTING_RELATIONSHIPS=H,r.SETTING_RENDERER_CONFIGS=$}),!0}function Qi(e){let t=u("SearchableSettingsList"),n=u("SETTING_RENDERER_CONFIG"),r=u("getSettingListItems");if(!r||!t||!n)return!1;let o=Qe(!0),a=dr();e.push(en("type",t.SearchableSettingsList,function(l){let[{sections:d}]=l;return ua(d,a.getLayout())})),e.push(R("getSettingListSearchResultItems",r,function(l,d){d.forEach(function(p){return o.some(function(L){return L.key===p.setting})&&(p.breadcrumbs=["Vendetta"])})}));let i=n.SETTING_RENDERER_CONFIG;return n.SETTING_RENDERER_CONFIG={...i,...a.rendererConfigs},e.push(function(){n.SETTING_RENDERER_CONFIG=i}),!0}function ua(e,t){if(!Array.isArray(e)||e.find(function(o){return Rr(o,"Vendetta")}))return;let n=e.findIndex(function(o){return Rr(o,me.Messages.ACCOUNT_SETTINGS)});e.splice(n+1,0,t);let r=e.find(function(o){return Rr(o,me.Messages.SUPPORT)});r&&(r.settings=r.settings.filter(function(o){return o!=="UPLOAD_DEBUG_LOGS"}))}var Rr,fa=c(()=>{"use strict";w();P();$t();g();Rr=function(e,t){return e?.label===t||e?.title===t}});function Er(){let e=[hr(),yr()];return function(){return e.forEach(function(t){return t?.()})}}var ma=c(()=>{"use strict";la();fa()});function ga(e){let{locale:t}=e;try{da&&(da.overrideTheme(es?.theme??"dark"),pa&&ts.useAMOLEDTheme===2&&pa.setAMOLEDThemeEnabled(!0))}catch(n){D.error("Failed to fix theme...",n)}try{wn.locale(t.toLowerCase())}catch(n){D.error("Failed to fix timestamps...",n)}xt.unsubscribe("I18N_LOAD_SUCCESS",ga)}function ha(){return xt.subscribe("I18N_LOAD_SUCCESS",ga)}var da,pa,es,ts,Ra=c(()=>{"use strict";g();w();Ae();da=u("updateTheme","overrideTheme"),pa=u("setAMOLEDThemeEnabled"),es=Ee("ThemeStore"),ts=Ee("UnsyncedUserSettingsStore")});function ya(){console.log("object object is not a function in String, fuck you, now its gone. no more strings to complain about.")}var Ea=c(()=>{"use strict"});async function wa(e){return{patcher:Z(Lr,"unpatchAll"),metro:{...Wt,common:{...bn}},constants:Gn,utils:Jt,debug:Z(In,"versionHash","patchLogHook","toggleSafeMode"),ui:{components:Wn,toasts:Sn,alerts:Jn,assets:xn,...$n},plugins:Z(kn,"initPlugins","evalPlugin"),themes:Z(hn,"initThemes"),commands:Z(Pn,"patchCommands"),storage:ln,settings:s,loader:{identity:window.__vendetta_loader,config:ee},logger:D,version:Tt,unload:function(){e.filter(function(t){return typeof t=="function"}).forEach(function(t){return t()}),delete window.vendetta}}}var ba=c(()=>{"use strict";P();Ae();V();Oe();Le();ge();Y();It();W();w();g();T();Q();Ve();b();Ue();ce()});function _a(){s.tweaks??={},console.log("TweakManager has initialized."),s.tweaks.trustURL==null&&(s.tweaks.trustURL=!1),s.tweaks.hideButtons==null&&(s.tweaks.hideButtons=!1),s.tweaks.silentTyping==null&&(s.tweaks.silentTyping=!1),s.tweaks.experiments==null&&(s.tweaks.experiments=!1),s.tweaks.fastdelete==null&&(s.tweaks.fastdelete=!1),(s.tweaks.trustURL?kt:Ot)(),(s.tweaks.hideButtons?Bt:Lt)(),(s.tweaks.silentTyping?Dt:Mt)(),(s.tweaks.experiments?Ft:Ut)(),(s.tweaks.fastdelete?Vt:Gt)()}var xa=c(()=>{"use strict";V();sr();cr();lr();ur();fr()});var he,Sa,Ta=c(()=>{"use strict";g();Le();he=Be(),Sa=[{name:"debug",description:"Prints Optis debug information to chat.",execute(e,t){let n=`**Opti Debug Info** > **Opti Version**: ${he.vendetta.version} > **Discord Version**: ${he.discord.version} (Build ${he.discord.build}) > **Hermes**: ${he.hermes.version} > **Bytecode**: ${he.hermes.bytecodeVersion} > **Device**: ${he.device.brand} > **OS**: ${he.os.name} ${he.os.version} - > **Codename/Machine ID**: ${he.device.codename}`;it.sendMessage(t.channel.id,{content:n})}}]});var va,Ia=c(()=>{"use strict";se();va=[{name:"reload",description:"Reloads Discord.",execute(){ie.reload()}}]});var Ca,Aa=c(()=>{"use strict";g();Ca=[{name:"testing",description:"this makes my balls ball",execute(e,t){it.sendBotMessage(t.channel.id,"i am the hello world!")}}]});function Na(){let e=[...Ca,...Sa,...va];Nn(e)}var Pa=c(()=>{"use strict";It();Ta();Ia();Aa()});var Da={};C(Da,{default:()=>rs});async function rs(){let e=await Promise.all([vn(),_n(),An(),mn(),ha(),Vo(),Er(),Zn()]);window.vendetta=await wa(e),e.push(await Mn()),e.push(await _a()),e.push(await Na()),e.push(await ya()),D.log("Opti has loaded!")}var Ma=c(()=>{"use strict";Le();It();ge();Y();b();Oo();Go();ma();Ra();Ea();Ae();ba();xa();Pa()});se();console.log("Opti has loaded!");Object.freeze=Object;Object.seal=Object;Promise.resolve().then(()=>(Ma(),Da)).then(function(e){return e.default()}).catch(function(e){console.log(e?.stack??e.toString()),alert([`Opti failed to initialize and some parts may not function properly. -`,`Build Number: ${tt.Build}`,"Opti Version: 9acad49",e?.stack||e.toString()].join(` + > **Codename/Machine ID**: ${he.device.codename}`;it.sendMessage(t.channel.id,{content:n})}}]});var va,Ia=c(()=>{"use strict";se();va=[{name:"reload",description:"Reloads Discord.",execute(){ie.reload()}}]});var Ca,Aa=c(()=>{"use strict";g();Ca=[{name:"testing",description:"this makes my balls ball",execute(e,t){it.sendBotMessage(t.channel.id,"i am the hello world!")}}]});function Na(){let e=[...Ca,...Sa,...va];Nn(e)}var Pa=c(()=>{"use strict";It();Ta();Ia();Aa()});var Da={};C(Da,{default:()=>ns});async function ns(){let e=await Promise.all([vn(),_n(),An(),mn(),ha(),Vo(),Er(),Zn()]);window.vendetta=await wa(e),e.push(await Mn()),e.push(await _a()),e.push(await Na()),e.push(await ya()),D.log("Opti has loaded!")}var Ma=c(()=>{"use strict";Le();It();ge();Y();b();Oo();Go();ma();Ra();Ea();Ae();ba();xa();Pa()});se();console.log("Opti has loaded!");Object.freeze=Object;Object.seal=Object;Promise.resolve().then(()=>(Ma(),Da)).then(function(e){return e.default()}).catch(function(e){console.log(e?.stack??e.toString()),alert([`Opti failed to initialize and some parts may not function properly. +`,`Build Number: ${tt.Build}`,"Opti Version: 043a981",e?.stack||e.toString()].join(` `))});})(); //# sourceURL=Vendetta diff --git a/src/ui/settings/components/Card.tsx b/src/ui/settings/components/Card.tsx index 44bd682c..c9898817 100644 --- a/src/ui/settings/components/Card.tsx +++ b/src/ui/settings/components/Card.tsx @@ -4,7 +4,6 @@ import { getAssetIDByName } from "@ui/assets"; import { semanticColors } from "@ui/color"; import { Forms } from "@ui/components"; -const { Fonts } = constants; const { FormRow, FormSwitch, FormRadio } = Forms; const { hideActionSheet } = findByProps("openLazy", "hideActionSheet"); const { showSimpleActionSheet } = findByProps("showSimpleActionSheet"); @@ -12,19 +11,19 @@ const { showSimpleActionSheet } = findByProps("showSimpleActionSheet"); // TODO: These styles work weirdly. iOS has cramped text, Android with low DPI probably does too. Fix? const styles = stylesheet.createThemedStyleSheet({ card: { - backgroundColor: semanticColors?.BACKGROUND_SECONDARY, + backgroundColor: semanticColors.BACKGROUND_SECONDARY, borderRadius: 7, }, header: { padding: 0, - backgroundColor: semanticColors?.PRIMARY_DARK_800, + backgroundColor: semanticColors.PRIMARY_DARK_800, borderTopLeftRadius: 5, borderTopRightRadius: 5, - fontFamily: Fonts?.PRIMARY_BOLD, - fontWeight: "500", + fontFamily: constants.Fonts.PRIMARY_BOLD + }, description: { - color: semanticColors?.HEADER_SECONDARY, + color: semanticColors.TEXT_MUTED, fontSize: 12, }, actions: {