From f1ae179b037bf8a825ae9bd0fee90efb9d44bcc4 Mon Sep 17 00:00:00 2001 From: kmmiio99o Date: Fri, 2 Jan 2026 18:07:12 +0000 Subject: [PATCH] deploy: a5686e815cc6733ea93c5edb867eb0b305227ad2 --- Commands/index.js | 26 +++++++++++++------------- Commands/manifest.json | 2 +- multi-scrobbler/index.js | 2 +- multi-scrobbler/manifest.json | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Commands/index.js b/Commands/index.js index 4efbdf5..f16bfb9 100644 --- a/Commands/index.js +++ b/Commands/index.js @@ -1,19 +1,19 @@ -(function(re,ze,r,p,G,S,u,e,je,b,o,I,v,O,ie,He){"use strict";const Ke=async function(){const t=await(await fetch("https://uselessfacts.jsph.pl/api/v2/facts/random")).json();return{text:t.text,source:t.source,language:t.language}},qe=async function(){return{text:(await(await fetch("https://dogapi.dog/api/v2/facts?limit=1")).json()).data[0].attributes.body}},Ye=async function(){const t=await(await fetch("https://catfact.ninja/fact")).json();return{text:t.fact,length:t.length}},Xe=async function(t){return await(await fetch(`https://api.obamabot.me/v2/image/petpet?image=${t.replace("webp","png")}`)).json()},Je=async function(t="gary"){try{switch(t){case"gary":return(await(await fetch("https://api.garythe.cat/gary")).json()).url;case"goober":return(await(await fetch("https://api.garythe.cat/goober")).json()).url;case"catapi":return(await(await fetch("https://api.thecatapi.com/v1/images/search")).json())[0].url;case"minker":return"https://minky.materii.dev/";default:throw new Error("Invalid Gary image source value")}}catch(a){return console.error(`[Gary API] Error fetching image from ${t}:`,a),null}},se=p.findByProps("sendMessage"),oe=function(t){let a=t.text;return r.storage.factSettings?.includeCitation&&t.source&&(a+=` +(function(ne,He,r,p,W,w,u,e,ye,b,o,I,v,G,re,Ke){"use strict";const qe=async function(){const t=await(await fetch("https://uselessfacts.jsph.pl/api/v2/facts/random")).json();return{text:t.text,source:t.source,language:t.language}},Ye=async function(){return{text:(await(await fetch("https://dogapi.dog/api/v2/facts?limit=1")).json()).data[0].attributes.body}},Xe=async function(){const t=await(await fetch("https://catfact.ninja/fact")).json();return{text:t.fact,length:t.length}},Je=async function(t){return await(await fetch(`https://api.obamabot.me/v2/image/petpet?image=${t.replace("webp","png")}`)).json()},Qe=async function(t="gary"){try{switch(t){case"gary":return(await(await fetch("https://api.garythe.cat/gary")).json()).url;case"goober":return(await(await fetch("https://api.garythe.cat/goober")).json()).url;case"catapi":return(await(await fetch("https://api.thecatapi.com/v1/images/search")).json())[0].url;case"minker":return"https://minky.materii.dev/";default:throw new Error("Invalid Gary image source value")}}catch(a){return console.error(`[Gary API] Error fetching image from ${t}:`,a),null}},ie=p.findByProps("sendMessage"),se=function(t){let a=t.text;return r.storage.factSettings?.includeCitation&&t.source&&(a+=` -Source: ${t.source}`),a},Qe={name:"catfact",displayName:"catfact",description:"Sends a random cat fact.",displayDescription:"Sends a random cat fact.",applicationId:"-1",inputType:1,type:1,execute:async function(t,a){try{const n=await Ye(),i=Date.now().toString();return se.sendMessage(a.channel.id,{content:oe(n)},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[CatFact] Error:",n),{type:4}}}},Ze={name:"dogfact",displayName:"dogfact",description:"Sends a dog fact.",displayDescription:"Sends a dog fact.",applicationId:"-1",inputType:1,type:1,execute:async function(t,a){try{const n=await qe(),i=Date.now().toString();return se.sendMessage(a.channel.id,{content:oe(n)},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[DogFact] Error:",n),{type:4}}}},et={name:"useless",displayName:"useless",description:"Sends a useless fact.",displayDescription:"Sends a useless fact.",applicationId:"-1",inputType:1,type:1,execute:async function(t,a){try{const n=await Ke(),i=Date.now().toString();return se.sendMessage(a.channel.id,{content:oe(n)},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[UselessFact] Error:",n),{type:4}}}},T={CONTENT:"This list is over 2000 characters. Send anyway?",CONFIRM:"Send",CANCEL:"Cancel"},tt={DETAILED:"detailed"},ce="",z={SLM_NOT_INSTALLED:"This list is over 2000 characters. Install the Split Large Messages plugin to send it.",SLM_NOT_ENABLED:"This list is over 2000 characters. Enable the Split Large Messages plugin to send it."},pe={SEMICOL:"; ",NEW_LINE:` -`},at="Nothing to see here, huh...",me="github.com/fres621/vendetta-plugins",E={ENABLED:"\u2705",DISABLED:"\u274C",SELECTED:"\u2705",NOT_SELECTED:"\u274C"},nt=p.findByProps("sendMessage","receiveMessage"),D=p.findByProps("sendBotMessage"),he=(function(){try{return p.findByStoreName("UserStore").getCurrentUser()?.premiumType===2?4e3:2e3}catch{return 2e3}})(),Ce=function(t){return Object.keys(t).includes(me)},be=function(t){return Object.values(t).find(function(a){return a.id==me})?.enabled},Re=function(t){return t.find(function(a){return a.name===tt.DETAILED})?.value??!1},j=function(t){return!t||!Array.isArray(t)||t.length===0?"Unknown":t.filter(function(a){return a&&(typeof a=="string"||typeof a=="object"&&a.name)}).map(function(a){return typeof a=="string"?a:a.name||"Unknown"}).join(pe.SEMICOL)||"Unknown"},ve=function(t){return t.join(pe.NEW_LINE).trimEnd()},H=function(t){return ve(t).length},K=async function(t,a){const n=Date.now().toString();await nt.sendMessage(t,{content:ve(a)},void 0,{nonce:n})},Ie=function(t,a){return[`**My ${t} List | ${a} ${t}s**`,ce]};async function rt(t,a){try{const n=Re(t),i=r.storage.themeListAlwaysDetailed??!1;if(!G.themes||typeof G.themes!="object"){const g=a.channel.id;return D.sendBotMessage(g,"No themes found or themes not loaded yet."),{type:4}}const s=Object.values(G.themes),c=a.channel.id,d=Ie("Theme",Object.keys(G.themes).length);if(s.length)for(const g of s){if(!g||typeof g!="object")continue;const{selected:f,data:y,id:C}=g,N=y?.name||"Unknown Theme",A=y?.description||"No description",k=y?.authors;n||i?d.push(`> **Name**: ${N}`,`> **Selected**: ${f?E.SELECTED:E.NOT_SELECTED}`,`> **Description**: ${A}`,`> **Authors**: ${j(k)}`,`> **[Install!](${C||"unknown"})**`,ce):d.push(`> ${f?E.SELECTED:E.NOT_SELECTED} **${N}** by ${j(k)}`)}else d.push(at);const l=H(d)>he;if(l&&!Ce(S.plugins))D.sendBotMessage(c,z.SLM_NOT_INSTALLED);else if(l&&!be(S.plugins))D.sendBotMessage(c,z.SLM_NOT_ENABLED);else{if(H(d)>2e3)return u.alerts.showConfirmationAlert({content:T.CONTENT,confirmText:T.CONFIRM,cancelText:T.CANCEL,onConfirm:async function(){return await K(c,d)}});await K(c,d)}}catch(n){return console.error("[ThemeList] Error:",n),{type:4}}}async function it(t,a){try{const n=Re(t),i=r.storage.pluginListAlwaysDetailed??!1,s=a.channel.id;if(!S.plugins||typeof S.plugins!="object")return D.sendBotMessage(s,"No plugins found or plugins not loaded yet."),{type:4};const c=Ie("Plugin",Object.keys(S.plugins).length);for(const l of Object.values(S.plugins)){if(!l||typeof l!="object")continue;const{enabled:g,manifest:f,id:y}=l,C=f?.name||"Unknown Plugin",N=f?.description||"No description",A=f?.authors;n||i?c.push(`> **Name**: ${C}`,`> **Status**: ${g?E.ENABLED:E.DISABLED}`,`> **Description**: ${N}`,`> **Authors**: ${j(A)}`,`> **[Install!](${y||"unknown"})**`,ce):c.push(`> ${g?E.ENABLED:E.DISABLED} **${C}** by ${j(A)}`)}const d=H(c)>he;if(d&&!Ce(S.plugins))D.sendBotMessage(s,z.SLM_NOT_INSTALLED);else if(d&&!be(S.plugins))D.sendBotMessage(s,z.SLM_NOT_ENABLED);else{if(H(c)>2e3)return u.alerts.showConfirmationAlert({content:T.CONTENT,confirmText:T.CONFIRM,cancelText:T.CANCEL,onConfirm:async function(){return await K(s,c)}});await K(s,c)}}catch(n){return console.error("[PluginList] Error:",n),{type:4}}}const st={name:"plugin-list",displayName:"plugin list",description:"Send your plugin list to the current channel",displayDescription:"Send your plugin list to the current channel",options:[{name:"detailed",description:"Whether to send a list with detailed information.",type:5,required:!1,displayName:"detailed",displayDescription:"Whether to send a list with detailed information."}],execute:it,applicationId:"-1",inputType:1,type:1},ot={name:"theme-list",displayName:"theme list",description:"Send your theme list to the current channel",displayDescription:"Send your theme list to the current channel",options:[{name:"detailed",description:"Whether to send a list with detailed information.",type:5,required:!1,displayName:"detailed",displayDescription:"Whether to send a list with detailed information."}],execute:rt,applicationId:"-1",inputType:1,type:1},ct=p.findByStoreName("UserStore"),lt=p.findByProps("sendMessage"),dt={name:"petpet",displayName:"petpet",description:"PetPet someone",displayDescription:"PetPet someone",options:[{name:"user",description:"The user(or their id) to be patted",type:6,required:!0,displayName:"user",displayDescription:"The user(or their id) to be patted"}],execute:async function(t,a){try{const n=(await ct.getUser(t[0].value)).getAvatarURL(512),i=await Xe(n),s=Date.now().toString();return lt.sendMessage(a.channel.id,{content:i.url},void 0,{nonce:s}),{type:4}}catch(n){return console.error("[PetPet] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},ut=p.findByProps("sendMessage"),gt=p.findByProps("sendBotMessage","sendMessage","receiveMessage"),we=async function(t){const a="https://konachan.com/post.json",n=t?"rating:explicit":"rating:safe",i=Math.floor(Math.random()*100);try{const s=await(await fetch(`${a}?tags=${n}&limit=1&page=${i}`)).json();return!Array.isArray(s)||s.length===0?null:s[0].file_url}catch(s){return console.error("[KonoChan Randomizer] Error fetching image:",s),null}},Se=function(){return u.alerts.showConfirmationAlert({title:"NSFW Content Warning",content:"NSFW content can only be sent in NSFW channels!",confirmText:"Okay",cancelText:null,confirmColor:"brand",isDismissable:!0})},Ee={name:"nsfw",description:"Include NSFW content?",type:5,required:!1,displayName:"nsfw",displayDescription:"Include NSFW content?"},ft={name:"konoself",displayName:"konoself",description:"Fetch a random image from KonoChan for yourself.",displayDescription:"Fetch a random image from KonoChan for yourself.",options:[Ee],execute:async function(t,a){try{const n=new Map(t.map(function(c){return[c.name,c]})).get("nsfw")?.value||!1,i=r.storage.hiddenSettings?.konochanBypassNsfw||!1;if(console.log(`[KonoSelf] NSFW: ${n}, Channel NSFW: ${a.channel.nsfw}, Bypass: ${i}`),n&&!a.channel.nsfw&&!i)return Se(),{type:4};const s=await we(n);return s?(gt.sendBotMessage(a.channel.id,`Here's your random image: ${s}`),{type:4}):{type:4}}catch(n){return console.error("[KonoSelf] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},yt={name:"konosend",displayName:"konosend",description:"Fetch a random image from KonoChan and send it to the channel.",displayDescription:"Fetch a random image from KonoChan and send it to the channel.",options:[Ee],execute:async function(t,a){try{const n=new Map(t.map(function(d){return[d.name,d]})).get("nsfw")?.value||!1,i=r.storage.hiddenSettings?.konochanBypassNsfw||!1;if(console.log(`[KonoSend] NSFW: ${n}, Channel NSFW: ${a.channel.nsfw}, Bypass: ${i}`),n&&!a.channel.nsfw&&!i)return Se(),{type:4};const s=await we(n);if(!s)return{type:4};const c=Date.now().toString();return ut.sendMessage(a.channel.id,{content:s},void 0,{nonce:c}),{type:4}}catch(n){return console.error("[KonoSend] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},Ne=p.findByProps("getAPIBaseURL","get"),pt=p.findByProps("sendMessage"),mt=async function(t,a,n){const i=a?`&author_id=${a}`:"",s=n?`&channel_id=${n}`:"",c=a?"":"&min_id=0";return(await Ne.get({url:`/guilds/${t}/messages/search`,query:`include_nsfw=true${i}${s}${c}&sort_by=timestamp&sort_order=asc&offset=0`})).body.messages[0][0]},ht=async function(t,a){const n=a?`&author_id=${a}`:"",i=a?"":"&min_id=0";return(await Ne.get({url:`/channels/${t}/messages/search`,query:`&sort_by=timestamp&sort_order=asc&offset=0${n}${i}`})).body.messages[0][0]},Ct={name:"firstmessage",displayName:"firstmessage",description:"Tired of scrolling to first message?",displayDescription:"Tired of scrolling to first message?",options:[{name:"user",displayName:"user",description:"Target user to get their first message in this server/dm",displayDescription:"Target user to get their first message in this server/dm",type:6,required:!1},{name:"channel",displayName:"channel",description:"Target channel to get first message of",displayDescription:"Target channel to get first message of",type:7,required:!1},{name:"send",displayName:"send",description:"Whether to send the resulting url",displayDescription:"Whether to send the resulting url",type:5,required:!1}],execute:async function(t,a){try{const n=new Map(t.map(function(C){return[C.name,C]})),i=n.get("user")?.value,s=n.get("channel")?.value,c=n.get("send")?.value,d=a.guild?.id,l=a.channel.id,g=a.channel.type===1;if(g&&s)return{type:4};let f="https://discord.com/channels/",y;if(g)y=await ht(l,i),f+=`@me/${l}/${y.id}`;else{y=await mt(d,i,s);const C=s||y.channel_id;f+=`${d}/${C}/${y.id}`}if(c){const C=Date.now().toString();pt.sendMessage(a.channel.id,{content:f},void 0,{nonce:C})}else e.ReactNative.Linking.openURL(f);return{type:4}}catch(n){return console.error("[FirstMessage] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},bt=p.findByProps("sendMessage"),Rt=p.findByProps("sendBotMessage","sendMessage","receiveMessage");function vt(){let{height:t,width:a,scale:n}=e.ReactNative.Dimensions.get("screen");return t*=n,a*=n,{width:a,height:t}}function It(){try{const t=new Date,a=new Date(t.getTime()+t.getTimezoneOffset()*6e4),n=a.getFullYear(),i=String(a.getMonth()+1).padStart(2,"0"),s=String(a.getDate()).padStart(2,"0"),c=String(a.getHours()).padStart(2,"0"),d=String(a.getMinutes()).padStart(2,"0"),l=String(a.getSeconds()).padStart(2,"0");return`${n}-${i}-${s} ${c}:${d}:${l}`}catch{return"Unknown"}}function wt(){try{const t=p.findByProps("memory");if(!t)return{cpuCoreCount:"N/A",cpuPerc:"N/A",memUsage:"N/A"};const{cpuCoreCount:a,cpuPercentage:n,memory:i}=t,s=n?n.toFixed(2)+"%":"N/A",c=i?parseFloat((i/1e3).toPrecision(3))+" MB":"N/A";return{cpuCoreCount:a,cpuPerc:s,memUsage:c}}catch(t){return console.warn("Hardware info unavailable:",t),{cpuCoreCount:"N/A",cpuPerc:"N/A",memUsage:"N/A"}}}function St(){try{const{NativeModules:t}=e.ReactNative;return(t.InfoDictionaryManager??t.RTNClientInfoManager)||{}}catch(t){return console.warn("Discord info unavailable:",t),{}}}function Et(){try{const{cpuCoreCount:t,cpuPerc:a,memUsage:n}=wt(),i=St(),{vendetta:s,discord:c,react:d,hermes:l,os:g,device:f}=je.getDebugInfo(),y=It(),{version:C,bytecodeVersion:N}=l||{},{version:A,nativeVersion:k}=d||{},{name:U,version:R,sdk:w}=g||{},{manufacturer:ae,brand:W,model:Oe,codename:wa}=f||{},{version:Sa}=s||{},{version:Ea,build:Na}=c||{},Aa=U=="iOS"?wa:`${W} ${Oe}`,{width:Ta,height:Da}=vt(),ne={Device:{Device:Aa||"Unknown",Model:Oe||"Unknown",Manufacturer:ae||"Unknown",Brand:W||"Unknown",Display:`${Ta}x${Da}`},Hardware:{"CPU Cores":t||"N/A","CPU Usage":a,"Memory Usage":n},Software:{OS:U||"Unknown",Version:R||"Unknown"},Discord:{Version:Ea||"Unknown",Build:Na||"Unknown",Vendetta:Sa||"Unknown"},React:{Version:A||"Unknown","Hermes Bytecode":N||"Unknown",Hermes:C||"Unknown",Native:k||"Unknown"},Time:{UTC:y}};return window.enmity&&(ne.Discord.Enmity=window.enmity.version),window.aliucord&&(ne.Discord.Aliucord=window.aliucord.version),w&&(ne.Software["SDK Version"]=w),ne}catch(t){throw console.error("Error generating system info:",t),t}}const Ae=["device","hardware","software","discord","react","time","ephemeral"];for(const t of Ae)r.storage[t]===void 0&&(r.storage[t]=!0);function Nt(t,a){try{const n=[`__System Information__ -`],i=Et();Object.keys(i).forEach(function(d){const l=r.storage[d.toLowerCase()],g=t.find(function(f){return f.name==d.toLowerCase()})?.value??l;(g||l)&&!(l&&!g)&&(n.push(`[**${d}**]`),Object.keys(i[d]).forEach(function(f){n.push(`> ${f}: ${i[d][f]}`)}))});const s=r.storage.ephemeral,c=t.find(function(d){return d.name=="ephemeral"})?.value??s;if((c||s)&&!(s&&!c))return Rt.sendBotMessage(a.channel.id,n.join(` -`)),{type:4};{const d=Date.now().toString();return bt.sendMessage(a.channel.id,{content:n.join(` -`)},void 0,{nonce:d}),{type:4}}}catch(n){return console.error("[Sysinfo] Error:",n),{type:4}}}const At={name:"sysinfo",displayName:"sysinfo",description:"Display system information",displayDescription:"Display system information",options:[{name:"ephemeral",displayName:"ephemeral",description:"Keep sysinfo ephemeral (default: true)",displayDescription:"Keep sysinfo ephemeral (default: true)",type:5,required:!1},...Ae.slice(0,-1).map(function(t){return{name:t,displayName:t,description:`Display the ${t} section. Set default in settings.`,displayDescription:`Display the ${t} section. Set default in settings.`,type:5,required:!1}})],execute:Nt,applicationId:"-1",inputType:1,type:1},Te=p.findByProps("sendMessage","receiveMessage"),Tt=p.findByStoreName("SpotifyStore");async function Dt(t,a){return r.storage.enabledCommands?.spotifyTrack?q(a,function(n){return`https://open.spotify.com/track/${n.id}`}):{type:4}}async function kt(t,a){return r.storage.enabledCommands?.spotifyAlbum?q(a,function(n){return`https://open.spotify.com/album/${n.album.id}`}):{type:4}}async function Bt(t,a){return r.storage.enabledCommands?.spotifyArtists?q(a,function(n){return n.artists.map(function(i){return`[${i.name}](${i.external_urls.spotify})`}).join(` -`)}):{type:4}}async function xt(t,a){return r.storage.enabledCommands?.spotifyCover?q(a,function(n){return n.album.image.url}):{type:4}}async function q(t,a){try{const n=t.channel.id,i=Tt?.getTrack?.();if(!i){const d=Date.now().toString();return Te.sendMessage(n,{content:"You are not listening to any track."},void 0,{nonce:d}),{type:4}}const s=a(i),c=Date.now().toString();return Te.sendMessage(n,{content:s},void 0,{nonce:c}),{type:4}}catch(n){return console.error("[Spotify Command] Error:",n),{type:4}}}const Pt={name:"spotify track",displayName:"spotify track",description:"Sends your current Spotify track",displayDescription:"Sends your current Spotify track",applicationId:"-1",inputType:1,type:1,execute:Dt},$t={name:"spotify album",displayName:"spotify album",description:"Sends your current track's album",displayDescription:"Sends your current track's album",applicationId:"-1",inputType:1,type:1,execute:kt},Lt={name:"spotify artists",displayName:"spotify artists",description:"Sends your current track's artists",displayDescription:"Sends your current track's artists",applicationId:"-1",inputType:1,type:1,execute:Bt},Ft={name:"spotify cover",displayName:"spotify cover",description:"Sends your current track's cover",displayDescription:"Sends your current track's cover",applicationId:"-1",inputType:1,type:1,execute:xt},Mt=p.findByProps("sendMessage"),_t={name:"gary",displayName:"gary",description:"Send a random Gary image to the channel.",displayDescription:"Send a random Gary image to the channel.",options:[],execute:async function(t,a){try{r.storage.garySettings||(r.storage.garySettings={imageSource:"gary"});const n=r.storage.garySettings.imageSource||"gary";console.log(`[Gary Command] Using image source: ${n}`);const i=await Je(n);if(!i)return console.log("[Gary Command] No image URL received"),{type:4};console.log(`[Gary Command] Sending image: ${i}`);const s=Date.now().toString();return Mt.sendMessage(a.channel.id,{content:i},void 0,{nonce:s}),{type:4}}catch(n){return console.error("[Gary] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},De=p.findByProps("sendMessage","receiveMessage"),Vt=p.findByProps("getLastSelectedChannelId"),Ut=p.findByProps("createBotMessage"),Wt=p.findByProps("BOT_AVATARS");function Y(t,a,n){const i=t??Vt?.getChannelId?.(),s=Ut.createBotMessage({channelId:i,content:"",embeds:n});s.author.username="Astolfo",s.author.avatar="Astolfo",Wt.BOT_AVATARS.Astolfo="https://i.pinimg.com/736x/50/77/1f/50771f45b1c015cfbb8b0853ba7b8521.jpg",typeof a=="string"?s.content=a:Object.assign(s,a),De.receiveMessage(i,s)}const Gt={name:"lovefemboys",displayName:"lovefemboys",description:"Get an image of a femboy",displayDescription:"Get an image of a femboy",options:[{name:"nsfw",displayName:"nsfw",description:"Get the result from r/femboys instead of r/femboy (NSFW)",displayDescription:"Get the result from r/femboys instead of r/femboy (NSFW)",required:!1,type:5},{name:"sort",displayName:"sort",description:"Changes the way reddit sorts.",displayDescription:"Changes the way reddit sorts",required:!1,type:3},{name:"silent",displayName:"silent",description:"Makes it so only you can see the message.",displayDescription:"Makes it so only you can see the message.",required:!1,type:5}],applicationId:"-1",inputType:1,type:1,execute:async function(t,a){try{const n=t.find(function(l){return l.name==="nsfw"})?.value;let i=t.find(function(l){return l.name==="sort"})?.value;const s=t.find(function(l){return l.name==="silent"})?.value;if(typeof i>"u"&&(i=r.storage.sortdefs),!["best","hot","new","rising","top","controversial"].includes(i)){Y(a.channel.id,"Incorrect sorting type. Valid options are\n`best`, `hot`, `new`, `rising`, `top`, `controversial`.",[]);return}if(n&&!await new Promise(function(l){u.alerts.showConfirmationAlert({title:"\u26A0\uFE0F NSFW Content Warning",content:"This command will send NSFW (Not Safe For Work) content from r/femboys. Are you sure you want to continue?",confirmText:"Yes, Continue",onConfirm:function(){return l(!0)},cancelText:"Cancel",onCancel:function(){return l(!1)}})}))return{type:4};let c=await fetch(`https://www.reddit.com/r/femboy/${i}.json?limit=100`).then(function(l){return l.json()});if(!a.channel.nsfw_&&n&&r.storage.nsfwwarn&&!(s??!0)){Y(a.channel.id,`This channel is not marked as NSFW -(You can disable this check in plugin settings)`,[]);return}n&&(c=await fetch(`https://www.reddit.com/r/femboys/${i}.json?limit=100`).then(function(l){return l.json()})),c=c.data?.children?.[Math.floor(Math.random()*c.data?.children?.length)]?.data;const d=await fetch(`https://www.reddit.com/u/${c?.author}/about.json`).then(function(l){return l.json()});if(s??!0)Y(a.channel.id,"",[{type:"rich",title:c?.title,url:`https://reddit.com${c?.permalink}`,author:{name:`u/${c?.author} \u2022 r/${c?.subreddit}`,proxy_icon_url:d?.data.icon_img.split("?")[0],icon_url:d?.data.icon_img.split("?")[0]},image:{proxy_url:c?.url_overridden_by_dest?.replace(/.gifv$/g,".gif")??c?.url.replace(/.gifv$/g,".gif"),url:c?.url_overridden_by_dest?.replace(/.gifv$/g,".gif")??c?.url?.replace(/.gifv$/g,".gif"),width:c?.preview?.images?.[0]?.source?.width,height:c?.preview?.images?.[0]?.source?.height},color:"0xf4b8e4"}]);else{const l=Date.now().toString();De.sendMessage(a.channel.id,{content:c?.url_overridden_by_dest??c?.url},void 0,{nonce:l})}}catch(n){console.error("[LoveFemboys] Error:",n),Y(a.channel.id,"ERROR !!!!!!!!!!!! \u{1F62D}\u{1F62D}\u{1F62D} Check debug logs!! \u{1F97A}\u{1F97A}\u{1F97A}",[])}}},Ot=p.findByProps("sendMessage"),zt=p.findByProps("sendBotMessage","sendMessage","receiveMessage"),jt={name:"ip",displayName:"ip",description:"IP address and domain lookup",displayDescription:"IP address and domain lookup",options:[{name:"query",displayName:"query",description:"Enter IPv4/IPv6 address or domain name",displayDescription:"Enter IPv4/IPv6 address or domain name",type:3,required:!0},{name:"send",displayName:"send",description:"Send to chat",displayDescription:"Send to chat",type:5,required:!1},{name:"ephemeral",displayName:"ephemeral",description:"Send as ephemeral message (only you can see)",displayDescription:"Send as ephemeral message (only you can see)",type:5,required:!1}],execute:async function(t,a){try{const n=t.find(function(f){return f.name==="query"})?.value,i=t.find(function(f){return f.name==="send"})?.value||!1,s=t.find(function(f){return f.name==="ephemeral"})?.value||!1;if(!n){const f="\u274C Query parameter is required!";return s?{type:4,data:{content:f,flags:64}}:(b.showToast(f,o.getAssetIDByName("CircleXIcon")),{type:4})}!s&&!i&&b.showToast(`Looking up IP information for ${n}...`,o.getAssetIDByName("DownloadIcon"));const c=`http://ipwhois.app/json/${encodeURIComponent(n)}?objects=success,ip,type,as,org,isp,continent,country,country_capital,city,region,country_phone,latitude,longitude,timezone,currency,completed_requests`,d=await fetch(c);if(!d.ok)throw new Error(`HTTP ${d.status}: ${d.statusText}`);const l=await d.json();if(!l.success){const f=`\u274C Failed to lookup IP information for: ${n}`;return s?{type:4,data:{content:f,flags:64}}:(b.showToast(f,o.getAssetIDByName("CircleXIcon")),{type:4})}const g=`\`\`\`json +Source: ${t.source}`),a},Ze={name:"catfact",displayName:"catfact",description:"Sends a random cat fact.",displayDescription:"Sends a random cat fact.",applicationId:"-1",inputType:1,type:1,execute:async function(t,a){try{const n=await Xe(),i=Date.now().toString();return ie.sendMessage(a.channel.id,{content:se(n)},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[CatFact] Error:",n),{type:4}}}},et={name:"dogfact",displayName:"dogfact",description:"Sends a dog fact.",displayDescription:"Sends a dog fact.",applicationId:"-1",inputType:1,type:1,execute:async function(t,a){try{const n=await Ye(),i=Date.now().toString();return ie.sendMessage(a.channel.id,{content:se(n)},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[DogFact] Error:",n),{type:4}}}},tt={name:"useless",displayName:"useless",description:"Sends a useless fact.",displayDescription:"Sends a useless fact.",applicationId:"-1",inputType:1,type:1,execute:async function(t,a){try{const n=await qe(),i=Date.now().toString();return ie.sendMessage(a.channel.id,{content:se(n)},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[UselessFact] Error:",n),{type:4}}}},T={CONTENT:"This list is over 2000 characters. Send anyway?",CONFIRM:"Send",CANCEL:"Cancel"},at={DETAILED:"detailed"},oe="",O={SLM_NOT_INSTALLED:"This list is over 2000 characters. Install the Split Large Messages plugin to send it.",SLM_NOT_ENABLED:"This list is over 2000 characters. Enable the Split Large Messages plugin to send it."},pe={SEMICOL:"; ",NEW_LINE:` +`},nt="Nothing to see here, huh...",me="github.com/fres621/vendetta-plugins",S={ENABLED:"\u2705",DISABLED:"\u274C",SELECTED:"\u2705",NOT_SELECTED:"\u274C"},rt=p.findByProps("sendMessage","receiveMessage"),D=p.findByProps("sendBotMessage"),he=(function(){try{return p.findByStoreName("UserStore").getCurrentUser()?.premiumType===2?4e3:2e3}catch{return 2e3}})(),Ce=function(t){return Object.keys(t).includes(me)},be=function(t){return Object.values(t).find(function(a){return a.id==me})?.enabled},Re=function(t){return t.find(function(a){return a.name===at.DETAILED})?.value??!1},z=function(t){return!t||!Array.isArray(t)||t.length===0?"Unknown":t.filter(function(a){return a&&(typeof a=="string"||typeof a=="object"&&a.name)}).map(function(a){return typeof a=="string"?a:a.name||"Unknown"}).join(pe.SEMICOL)||"Unknown"},ve=function(t){return t.join(pe.NEW_LINE).trimEnd()},j=function(t){return ve(t).length},H=async function(t,a){const n=Date.now().toString();await rt.sendMessage(t,{content:ve(a)},void 0,{nonce:n})},Ie=function(t,a){return[`**My ${t} List | ${a} ${t}s**`,oe]};async function it(t,a){try{const n=Re(t),i=r.storage.themeListAlwaysDetailed??!1;if(!W.themes||typeof W.themes!="object"){const g=a.channel.id;return D.sendBotMessage(g,"No themes found or themes not loaded yet."),{type:4}}const s=Object.values(W.themes),c=a.channel.id,d=Ie("Theme",Object.keys(W.themes).length);if(s.length)for(const g of s){if(!g||typeof g!="object")continue;const{selected:f,data:y,id:C}=g,E=y?.name||"Unknown Theme",N=y?.description||"No description",k=y?.authors;n||i?d.push(`> **Name**: ${E}`,`> **Selected**: ${f?S.SELECTED:S.NOT_SELECTED}`,`> **Description**: ${N}`,`> **Authors**: ${z(k)}`,`> **[Install!](${C||"unknown"})**`,oe):d.push(`> ${f?S.SELECTED:S.NOT_SELECTED} **${E}** by ${z(k)}`)}else d.push(nt);const l=j(d)>he;if(l&&!Ce(w.plugins))D.sendBotMessage(c,O.SLM_NOT_INSTALLED);else if(l&&!be(w.plugins))D.sendBotMessage(c,O.SLM_NOT_ENABLED);else{if(j(d)>2e3)return u.alerts.showConfirmationAlert({content:T.CONTENT,confirmText:T.CONFIRM,cancelText:T.CANCEL,onConfirm:async function(){return await H(c,d)}});await H(c,d)}}catch(n){return console.error("[ThemeList] Error:",n),{type:4}}}async function st(t,a){try{const n=Re(t),i=r.storage.pluginListAlwaysDetailed??!1,s=a.channel.id;if(!w.plugins||typeof w.plugins!="object")return D.sendBotMessage(s,"No plugins found or plugins not loaded yet."),{type:4};const c=Ie("Plugin",Object.keys(w.plugins).length);for(const l of Object.values(w.plugins)){if(!l||typeof l!="object")continue;const{enabled:g,manifest:f,id:y}=l,C=f?.name||"Unknown Plugin",E=f?.description||"No description",N=f?.authors;n||i?c.push(`> **Name**: ${C}`,`> **Status**: ${g?S.ENABLED:S.DISABLED}`,`> **Description**: ${E}`,`> **Authors**: ${z(N)}`,`> **[Install!](${y||"unknown"})**`,oe):c.push(`> ${g?S.ENABLED:S.DISABLED} **${C}** by ${z(N)}`)}const d=j(c)>he;if(d&&!Ce(w.plugins))D.sendBotMessage(s,O.SLM_NOT_INSTALLED);else if(d&&!be(w.plugins))D.sendBotMessage(s,O.SLM_NOT_ENABLED);else{if(j(c)>2e3)return u.alerts.showConfirmationAlert({content:T.CONTENT,confirmText:T.CONFIRM,cancelText:T.CANCEL,onConfirm:async function(){return await H(s,c)}});await H(s,c)}}catch(n){return console.error("[PluginList] Error:",n),{type:4}}}const ot={name:"plugin-list",displayName:"plugin list",description:"Send your plugin list to the current channel",displayDescription:"Send your plugin list to the current channel",options:[{name:"detailed",description:"Whether to send a list with detailed information.",type:5,required:!1,displayName:"detailed",displayDescription:"Whether to send a list with detailed information."}],execute:st,applicationId:"-1",inputType:1,type:1},ct={name:"theme-list",displayName:"theme list",description:"Send your theme list to the current channel",displayDescription:"Send your theme list to the current channel",options:[{name:"detailed",description:"Whether to send a list with detailed information.",type:5,required:!1,displayName:"detailed",displayDescription:"Whether to send a list with detailed information."}],execute:it,applicationId:"-1",inputType:1,type:1},lt=p.findByStoreName("UserStore"),dt=p.findByProps("sendMessage"),ut={name:"petpet",displayName:"petpet",description:"PetPet someone",displayDescription:"PetPet someone",options:[{name:"user",description:"The user(or their id) to be patted",type:6,required:!0,displayName:"user",displayDescription:"The user(or their id) to be patted"}],execute:async function(t,a){try{const n=(await lt.getUser(t[0].value)).getAvatarURL(512),i=await Je(n),s=Date.now().toString();return dt.sendMessage(a.channel.id,{content:i.url},void 0,{nonce:s}),{type:4}}catch(n){return console.error("[PetPet] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},gt=p.findByProps("sendMessage"),ft=p.findByProps("sendBotMessage","sendMessage","receiveMessage"),we=async function(t){const a="https://konachan.com/post.json",n=t?"rating:explicit":"rating:safe",i=Math.floor(Math.random()*100);try{const s=await(await fetch(`${a}?tags=${n}&limit=1&page=${i}`)).json();return!Array.isArray(s)||s.length===0?null:s[0].file_url}catch(s){return console.error("[KonoChan Randomizer] Error fetching image:",s),null}},Se=function(){return new Promise(function(t){u.alerts.showConfirmationAlert({title:"NSFW Content Warning",content:"NSFW content can only be sent in NSFW channels!",confirmText:"Okay",cancelText:"Cancel",confirmColor:"brand",isDismissable:!0,onConfirm:function(){return t(!0)},onCancel:function(){return t(!1)}})})},Ee={name:"nsfw",description:"Include NSFW content?",type:5,required:!1,displayName:"nsfw",displayDescription:"Include NSFW content?"},yt={name:"konoself",displayName:"konoself",description:"Fetch a random image from KonoChan for yourself.",displayDescription:"Fetch a random image from KonoChan for yourself.",options:[Ee],execute:async function(t,a){try{const n=new Map((t||[]).map(function(c){return[c.name,c]})).get("nsfw")?.value||!1,i=r.storage.hiddenSettings?.konochanBypassNsfw||!1;if(console.log(`[KonoSelf] NSFW: ${n}, Channel NSFW: ${a.channel.nsfw}, Bypass: ${i}`),n&&!a.channel.nsfw&&!i)return Se(),{type:4};const s=await we(n);return s?(ft.sendBotMessage(a.channel.id,`Here's your random image: ${s}`),{type:4}):{type:4}}catch(n){return console.error("[KonoSelf] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},pt={name:"konosend",displayName:"konosend",description:"Fetch a random image from KonoChan and send it to the channel.",displayDescription:"Fetch a random image from KonoChan and send it to the channel.",options:[Ee],execute:async function(t,a){try{const n=new Map((t||[]).map(function(d){return[d.name,d]})).get("nsfw")?.value||!1,i=r.storage.hiddenSettings?.konochanBypassNsfw||!1;if(console.log(`[KonoSend] NSFW: ${n}, Channel NSFW: ${a.channel.nsfw}, Bypass: ${i}`),n&&!a.channel.nsfw&&!i)return Se(),{type:4};const s=await we(n);if(!s)return{type:4};const c=Date.now().toString();return gt.sendMessage(a.channel.id,{content:s},void 0,{nonce:c}),{type:4}}catch(n){return console.error("[KonoSend] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},Ne=p.findByProps("getAPIBaseURL","get"),mt=p.findByProps("sendMessage"),ht=async function(t,a,n){const i=a?`&author_id=${a}`:"",s=n?`&channel_id=${n}`:"",c=a?"":"&min_id=0";return(await Ne.get({url:`/guilds/${t}/messages/search`,query:`include_nsfw=true${i}${s}${c}&sort_by=timestamp&sort_order=asc&offset=0`})).body.messages[0][0]},Ct=async function(t,a){const n=a?`&author_id=${a}`:"",i=a?"":"&min_id=0";return(await Ne.get({url:`/channels/${t}/messages/search`,query:`&sort_by=timestamp&sort_order=asc&offset=0${n}${i}`})).body.messages[0][0]},bt={name:"firstmessage",displayName:"firstmessage",description:"Tired of scrolling to first message?",displayDescription:"Tired of scrolling to first message?",options:[{name:"user",displayName:"user",description:"Target user to get their first message in this server/dm",displayDescription:"Target user to get their first message in this server/dm",type:6,required:!1},{name:"channel",displayName:"channel",description:"Target channel to get first message of",displayDescription:"Target channel to get first message of",type:7,required:!1},{name:"send",displayName:"send",description:"Whether to send the resulting url",displayDescription:"Whether to send the resulting url",type:5,required:!1}],execute:async function(t,a){try{const n=new Map(t.map(function(C){return[C.name,C]})),i=n.get("user")?.value,s=n.get("channel")?.value,c=n.get("send")?.value,d=a.guild?.id,l=a.channel.id,g=a.channel.type===1;if(g&&s)return{type:4};let f="https://discord.com/channels/",y;if(g)y=await Ct(l,i),f+=`@me/${l}/${y.id}`;else{y=await ht(d,i,s);const C=s||y.channel_id;f+=`${d}/${C}/${y.id}`}if(c){const C=Date.now().toString();mt.sendMessage(a.channel.id,{content:f},void 0,{nonce:C})}else e.ReactNative.Linking.openURL(f);return{type:4}}catch(n){return console.error("[FirstMessage] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},Rt=p.findByProps("sendMessage"),vt=p.findByProps("sendBotMessage","sendMessage","receiveMessage");function It(){let{height:t,width:a,scale:n}=e.ReactNative.Dimensions.get("screen");return t*=n,a*=n,{width:a,height:t}}function wt(){try{const t=new Date,a=new Date(t.getTime()+t.getTimezoneOffset()*6e4),n=a.getFullYear(),i=String(a.getMonth()+1).padStart(2,"0"),s=String(a.getDate()).padStart(2,"0"),c=String(a.getHours()).padStart(2,"0"),d=String(a.getMinutes()).padStart(2,"0"),l=String(a.getSeconds()).padStart(2,"0");return`${n}-${i}-${s} ${c}:${d}:${l}`}catch{return"Unknown"}}function St(){try{const t=p.findByProps("memory");if(!t)return{cpuCoreCount:"N/A",cpuPerc:"N/A",memUsage:"N/A"};const{cpuCoreCount:a,cpuPercentage:n,memory:i}=t,s=n?n.toFixed(2)+"%":"N/A",c=i?parseFloat((i/1e3).toPrecision(3))+" MB":"N/A";return{cpuCoreCount:a,cpuPerc:s,memUsage:c}}catch(t){return console.warn("Hardware info unavailable:",t),{cpuCoreCount:"N/A",cpuPerc:"N/A",memUsage:"N/A"}}}function Et(){try{const{NativeModules:t}=e.ReactNative;return(t.InfoDictionaryManager??t.RTNClientInfoManager)||{}}catch(t){return console.warn("Discord info unavailable:",t),{}}}function Nt(){try{const{cpuCoreCount:t,cpuPerc:a,memUsage:n}=St(),i=Et(),s=(typeof ye.getDebugInfo=="function"?ye.getDebugInfo():{})||{},{vendetta:c,discord:d,react:l,hermes:g,os:f,device:y}=s,C=wt(),{version:E,bytecodeVersion:N}=g||{},{version:k,nativeVersion:te}=l||{},{name:R,version:A,sdk:U}=f||{},{manufacturer:ae,brand:Oe,model:ze,codename:Sa}=y||{},{version:Ea}=c||{},{version:Na,build:Aa}=d||{},Ta=R=="iOS"?Sa:`${Oe} ${ze}`,{width:Da,height:ka}=It(),je={Device:{Device:Ta||"Unknown",Model:ze||"Unknown",Manufacturer:ae||"Unknown",Brand:Oe||"Unknown",Display:`${Da}x${ka}`},Hardware:{"CPU Cores":t||"N/A","CPU Usage":a,"Memory Usage":n},Software:{OS:R||"Unknown",Version:A||"Unknown"},Discord:{Version:Na||"Unknown",Build:Aa||"Unknown",Vendetta:Ea||"Unknown"},React:{Version:k||"Unknown","Hermes Bytecode":N||"Unknown",Hermes:E||"Unknown",Native:te||"Unknown"},Time:{UTC:C}};return U&&(je.Software["SDK Version"]=U),je}catch(t){throw console.error("Error generating system info:",t),t}}const Ae=["device","hardware","software","discord","react","time","ephemeral"];for(const t of Ae)r.storage[t]===void 0&&(r.storage[t]=!0);function At(t,a){try{const n=[`__System Information__ +`],i=Nt();Object.keys(i).forEach(function(d){const l=r.storage[d.toLowerCase()],g=t.find(function(f){return f.name==d.toLowerCase()})?.value??l;(g||l)&&!(l&&!g)&&(n.push(`[**${d}**]`),Object.keys(i[d]).forEach(function(f){n.push(`> ${f}: ${i[d][f]}`)}))});const s=r.storage.ephemeral,c=t.find(function(d){return d.name=="ephemeral"})?.value??s;if((c||s)&&!(s&&!c))return vt.sendBotMessage(a.channel.id,n.join(` +`)),{type:4};{const d=Date.now().toString();return Rt.sendMessage(a.channel.id,{content:n.join(` +`)},void 0,{nonce:d}),{type:4}}}catch(n){return console.error("[Sysinfo] Error:",n),{type:4}}}const Tt={name:"sysinfo",displayName:"sysinfo",description:"Display system information",displayDescription:"Display system information",options:[{name:"ephemeral",displayName:"ephemeral",description:"Keep sysinfo ephemeral (default: true)",displayDescription:"Keep sysinfo ephemeral (default: true)",type:5,required:!1},...Ae.slice(0,-1).map(function(t){return{name:t,displayName:t,description:`Display the ${t} section. Set default in settings.`,displayDescription:`Display the ${t} section. Set default in settings.`,type:5,required:!1}})],execute:At,applicationId:"-1",inputType:1,type:1},Te=p.findByProps("sendMessage","receiveMessage"),Dt=p.findByStoreName("SpotifyStore");async function kt(t,a){return r.storage.enabledCommands?.spotifyTrack?K(a,function(n){return`https://open.spotify.com/track/${n.id}`}):{type:4}}async function Bt(t,a){return r.storage.enabledCommands?.spotifyAlbum?K(a,function(n){return`https://open.spotify.com/album/${n.album.id}`}):{type:4}}async function xt(t,a){return r.storage.enabledCommands?.spotifyArtists?K(a,function(n){return n.artists.map(function(i){return`[${i.name}](${i.external_urls.spotify})`}).join(` +`)}):{type:4}}async function Pt(t,a){return r.storage.enabledCommands?.spotifyCover?K(a,function(n){return n.album.image.url}):{type:4}}async function K(t,a){try{const n=t.channel.id,i=Dt?.getTrack?.();if(!i){const d=Date.now().toString();return Te.sendMessage(n,{content:"You are not listening to any track."},void 0,{nonce:d}),{type:4}}const s=a(i),c=Date.now().toString();return Te.sendMessage(n,{content:s},void 0,{nonce:c}),{type:4}}catch(n){return console.error("[Spotify Command] Error:",n),{type:4}}}const $t={name:"spotify track",displayName:"spotify track",description:"Sends your current Spotify track",displayDescription:"Sends your current Spotify track",applicationId:"-1",inputType:1,type:1,execute:kt},Lt={name:"spotify album",displayName:"spotify album",description:"Sends your current track's album",displayDescription:"Sends your current track's album",applicationId:"-1",inputType:1,type:1,execute:Bt},Ft={name:"spotify artists",displayName:"spotify artists",description:"Sends your current track's artists",displayDescription:"Sends your current track's artists",applicationId:"-1",inputType:1,type:1,execute:xt},Mt={name:"spotify cover",displayName:"spotify cover",description:"Sends your current track's cover",displayDescription:"Sends your current track's cover",applicationId:"-1",inputType:1,type:1,execute:Pt},_t=p.findByProps("sendMessage"),Vt={name:"gary",displayName:"gary",description:"Send a random Gary image to the channel.",displayDescription:"Send a random Gary image to the channel.",options:[],execute:async function(t,a){try{r.storage.garySettings||(r.storage.garySettings={imageSource:"gary"});const n=r.storage.garySettings.imageSource||"gary";console.log(`[Gary Command] Using image source: ${n}`);const i=await Qe(n);if(!i)return console.log("[Gary Command] No image URL received"),{type:4};console.log(`[Gary Command] Sending image: ${i}`);const s=Date.now().toString();return _t.sendMessage(a.channel.id,{content:i},void 0,{nonce:s}),{type:4}}catch(n){return console.error("[Gary] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},De=p.findByProps("sendMessage","receiveMessage"),Ut=p.findByProps("getLastSelectedChannelId"),Wt=p.findByProps("createBotMessage"),Gt=p.findByProps("BOT_AVATARS");function q(t,a,n){const i=t??Ut?.getChannelId?.(),s=Wt.createBotMessage({channelId:i,content:"",embeds:n});s.author.username="Astolfo",s.author.avatar="Astolfo",Gt.BOT_AVATARS.Astolfo="https://i.pinimg.com/736x/50/77/1f/50771f45b1c015cfbb8b0853ba7b8521.jpg",typeof a=="string"?s.content=a:Object.assign(s,a),De.receiveMessage(i,s)}const Ot={name:"lovefemboys",displayName:"lovefemboys",description:"Get an image of a femboy",displayDescription:"Get an image of a femboy",options:[{name:"nsfw",displayName:"nsfw",description:"Get the result from r/femboys instead of r/femboy (NSFW)",displayDescription:"Get the result from r/femboys instead of r/femboy (NSFW)",required:!1,type:5},{name:"sort",displayName:"sort",description:"Changes the way reddit sorts.",displayDescription:"Changes the way reddit sorts",required:!1,type:3},{name:"silent",displayName:"silent",description:"Makes it so only you can see the message.",displayDescription:"Makes it so only you can see the message.",required:!1,type:5}],applicationId:"-1",inputType:1,type:1,execute:async function(t,a){try{const n=t.find(function(l){return l.name==="nsfw"})?.value;let i=t.find(function(l){return l.name==="sort"})?.value;const s=t.find(function(l){return l.name==="silent"})?.value;if(typeof i>"u"&&(i=r.storage.sortdefs),!["best","hot","new","rising","top","controversial"].includes(i)){q(a.channel.id,"Incorrect sorting type. Valid options are\n`best`, `hot`, `new`, `rising`, `top`, `controversial`.",[]);return}if(n&&!await new Promise(function(l){u.alerts.showConfirmationAlert({title:"\u26A0\uFE0F NSFW Content Warning",content:"This command will send NSFW (Not Safe For Work) content from r/femboys. Are you sure you want to continue?",confirmText:"Yes, Continue",onConfirm:function(){return l(!0)},cancelText:"Cancel",onCancel:function(){return l(!1)}})}))return{type:4};let c=await fetch(`https://www.reddit.com/r/femboy/${i}.json?limit=100`).then(function(l){return l.json()});if(!a.channel.nsfw_&&n&&r.storage.nsfwwarn&&!(s??!0)){q(a.channel.id,`This channel is not marked as NSFW +(You can disable this check in plugin settings)`,[]);return}n&&(c=await fetch(`https://www.reddit.com/r/femboys/${i}.json?limit=100`).then(function(l){return l.json()})),c=c.data?.children?.[Math.floor(Math.random()*c.data?.children?.length)]?.data;const d=await fetch(`https://www.reddit.com/u/${c?.author}/about.json`).then(function(l){return l.json()});if(s??!0)q(a.channel.id,"",[{type:"rich",title:c?.title,url:`https://reddit.com${c?.permalink}`,author:{name:`u/${c?.author} \u2022 r/${c?.subreddit}`,proxy_icon_url:d?.data.icon_img.split("?")[0],icon_url:d?.data.icon_img.split("?")[0]},image:{proxy_url:c?.url_overridden_by_dest?.replace(/.gifv$/g,".gif")??c?.url.replace(/.gifv$/g,".gif"),url:c?.url_overridden_by_dest?.replace(/.gifv$/g,".gif")??c?.url?.replace(/.gifv$/g,".gif"),width:c?.preview?.images?.[0]?.source?.width,height:c?.preview?.images?.[0]?.source?.height},color:"0xf4b8e4"}]);else{const l=Date.now().toString();De.sendMessage(a.channel.id,{content:c?.url_overridden_by_dest??c?.url},void 0,{nonce:l})}}catch(n){console.error("[LoveFemboys] Error:",n),q(a.channel.id,"ERROR !!!!!!!!!!!! \u{1F62D}\u{1F62D}\u{1F62D} Check debug logs!! \u{1F97A}\u{1F97A}\u{1F97A}",[])}}},zt=p.findByProps("sendMessage"),jt=p.findByProps("sendBotMessage","sendMessage","receiveMessage"),Ht={name:"ip",displayName:"ip",description:"IP address and domain lookup",displayDescription:"IP address and domain lookup",options:[{name:"query",displayName:"query",description:"Enter IPv4/IPv6 address or domain name",displayDescription:"Enter IPv4/IPv6 address or domain name",type:3,required:!0},{name:"send",displayName:"send",description:"Send to chat",displayDescription:"Send to chat",type:5,required:!1},{name:"ephemeral",displayName:"ephemeral",description:"Send as ephemeral message (only you can see)",displayDescription:"Send as ephemeral message (only you can see)",type:5,required:!1}],execute:async function(t,a){try{const n=t.find(function(f){return f.name==="query"})?.value,i=t.find(function(f){return f.name==="send"})?.value||!1,s=t.find(function(f){return f.name==="ephemeral"})?.value||!1;if(!n){const f="\u274C Query parameter is required!";return s?{type:4,data:{content:f,flags:64}}:(b.showToast(f,o.getAssetIDByName("CircleXIcon")),{type:4})}!s&&!i&&b.showToast(`Looking up IP information for ${n}...`,o.getAssetIDByName("DownloadIcon"));const c=`http://ipwhois.app/json/${encodeURIComponent(n)}?objects=success,ip,type,as,org,isp,continent,country,country_capital,city,region,country_phone,latitude,longitude,timezone,currency,completed_requests`,d=await fetch(c);if(!d.ok)throw new Error(`HTTP ${d.status}: ${d.statusText}`);const l=await d.json();if(!l.success){const f=`\u274C Failed to lookup IP information for: ${n}`;return s?{type:4,data:{content:f,flags:64}}:(b.showToast(f,o.getAssetIDByName("CircleXIcon")),{type:4})}const g=`\`\`\`json ${JSON.stringify(l,null,4)} -\`\`\``;if(s)return{type:4,data:{content:g,flags:64}};if(i){const f=Date.now().toString();return Ot.sendMessage(a.channel.id,{content:g},void 0,{nonce:f}),{type:4}}else return zt.sendBotMessage(a.channel.id,g),{type:4}}catch(n){console.error("[IP] Command error:",n);const i=`\u274C An error occurred while looking up IP information: ${n.message||"Unknown error"}`;return t?.find?.(function(s){return s.name==="ephemeral"})?.value??!1?{type:4,data:{content:i,flags:64}}:(b.showToast(i,o.getAssetIDByName("CircleXIcon")),{type:4})}},applicationId:"-1",inputType:1,type:1},Ht=p.findByProps("sendMessage"),Kt=p.findByProps("sendBotMessage","sendMessage","receiveMessage"),qt=["avatar","classic","cuddle","fox_girl","gecg","holo","kemonomimi","kiss","neko","ngif","smug","spank","tickle","waifu","wallpaper","woof"];async function Yt(t,a){const n=[];for(let i=0;i0&&await new Promise(function(d){return setTimeout(d,1e3)});const s=await fetch(`https://nekos.life/api/v2/img/${t}`);if(!s.ok){console.error(`[NekosLife] API request failed: ${s.status}`);continue}const c=await s.json();c.url&&n.push(c.url)}catch(s){console.error(`[NekosLife] Error fetching image ${i+1}:`,s)}return n}function Xt(t){return!t||typeof t!="string"?!1:qt.includes(t.toLowerCase().trim())}const Jt={name:"nekoslife",displayName:"nekoslife",description:"Get SFW images/gifs from nekos.life",displayDescription:"Get SFW images/gifs from nekos.life",options:[{name:"category",displayName:"category",description:"Category name (e.g. neko, waifu, cuddle, etc.)",displayDescription:"Category name (e.g. neko, waifu, cuddle, etc.)",type:3,required:!0},{name:"limit",displayName:"limit",description:"Number of images (1-5, default: 1)",displayDescription:"Number of images (1-5, default: 1)",type:4,required:!1},{name:"send",displayName:"send",description:"Send to chat",displayDescription:"Send to chat",type:5,required:!1},{name:"ephemeral",displayName:"ephemeral",description:"Send as ephemeral message (only you can see)",displayDescription:"Send as ephemeral message (only you can see)",type:5,required:!1}],execute:async function(t,a){try{console.log("[NekosLife] Command executed with args:",t);const n=t.find(function(y){return y.name==="category"})?.value,i=t.find(function(y){return y.name==="limit"})?.value,s=t.find(function(y){return y.name==="send"})?.value||!1,c=t.find(function(y){return y.name==="ephemeral"})?.value||!1;if(console.log("[NekosLife] Parsed values:",{categoryInput:n,limitInput:i,shouldSend:s,isEphemeral:c}),!n||typeof n!="string"){const y="\u274C Category is required! Examples: neko, waifu, cuddle, kiss";return console.error("[NekosLife] No category provided"),c?{type:4,data:{content:y,flags:64}}:(b.showToast(y,o.getAssetIDByName("CircleXIcon")),{type:4})}const d=n.toLowerCase().trim();if(!Xt(d)){const y=`\u274C Invalid SFW category "${n}". Valid: neko, waifu, cuddle, kiss, holo, etc.`;return c?{type:4,data:{content:y,flags:64}}:(b.showToast(y,o.getAssetIDByName("CircleXIcon")),{type:4})}let l=1;i!=null&&(l=parseInt(String(i))||1,l=Math.max(1,Math.min(5,l))),console.log("[NekosLife] Processing SFW request:",{category:d,limit:l,shouldSend:s,isEphemeral:c}),c||b.showToast(`Fetching ${l} SFW image(s) from nekos.life...`,o.getAssetIDByName("DownloadIcon"));const g=await Yt(d,l);if(g.length===0){const y="\u274C Failed to fetch images from nekos.life. Try again later!";return c?{type:4,data:{content:y,flags:64}}:(b.showToast(y,o.getAssetIDByName("CircleXIcon")),{type:4})}const f=g.join(` -`);if(c)return console.log("[NekosLife] Sending ephemeral response"),{type:4,data:{content:f,flags:64}};if(s){console.log("[NekosLife] Sending to chat");const y=Date.now().toString();return Ht.sendMessage(a.channel.id,{content:f},void 0,{nonce:y}),{type:4}}else return console.log("[NekosLife] Sending as bot message"),Kt.sendBotMessage(a.channel.id,f),{type:4}}catch(n){console.error("[NekosLife] Command error:",n);const i="\u274C An error occurred while fetching images.";return t?.find?.(function(s){return s.name==="ephemeral"})?.value??!1?{type:4,data:{content:i,flags:64}}:(b.showToast(i,o.getAssetIDByName("CircleXIcon")),{type:4})}},applicationId:"-1",inputType:1,type:1},Qt=p.findByProps("sendBotMessage","sendMessage"),B=p.findByProps("getAllFriendInvites","createFriendInvite","revokeFriendInvites");p.findByProps("get","post");const Zt=p.findByProps("getCurrentUser")?.getCurrentUser;function X(t,a){const n=Date.now().toString();Qt.sendMessage(t.channel.id,{content:a},void 0,{nonce:n})}const ea={name:"invite create",displayName:"invite create",description:"Generates a friend invite link.",displayDescription:"Generates a friend invite link.",type:1,applicationId:"-1",inputType:1,execute:async function(t,a){try{if(!Zt?.().phone)return b.showToast("You need a phone number connected to your account!",getAssetIDByName("Small")),{type:4};const n=await B.createFriendInvite({code:null,recipient_phone_number_or_email:null,contact_visibility:0,filter_visibilities:[],filtered_invite_suggestions_index:0});if(n?.code){const i=Math.floor(new Date(n.expires_at).getTime()/1e3),s=`https://discord.gg/${n.code} \xB7 Expires: `;X(a,s),b.showToast("Friend invite created!",getAssetIDByName("Check"))}else throw new Error("No invite code generated");return{type:4}}catch(n){return console.error("[FriendInvite] Create error:",n),b.showToast("Error creating friend invite",getAssetIDByName("Small")),{type:4}}}},ta={name:"view invites",displayName:"view invites",description:"View your current friend invite links that you've made.",displayDescription:"View your current friend invite links that you've made.",type:1,applicationId:"-1",execute:async function(t,a){try{const n=await B.getAllFriendInvites();if(!n?.length)return b.showToast("No active friend invites found",getAssetIDByName("Info")),{type:4};const i=n.map(function(s){const c=Math.floor(new Date(s.expires_at).getTime()/1e3);return`_https://discord.gg/${s.code}_ \xB7 Expires: \xB7 Uses: \`${s.uses}/${s.max_uses}\``});return X(a,`**Your Active Friend Invites:** +\`\`\``;if(s)return{type:4,data:{content:g,flags:64}};if(i){const f=Date.now().toString();return zt.sendMessage(a.channel.id,{content:g},void 0,{nonce:f}),{type:4}}else return jt.sendBotMessage(a.channel.id,g),{type:4}}catch(n){console.error("[IP] Command error:",n);const i=`\u274C An error occurred while looking up IP information: ${n.message||"Unknown error"}`;return t?.find?.(function(s){return s.name==="ephemeral"})?.value??!1?{type:4,data:{content:i,flags:64}}:(b.showToast(i,o.getAssetIDByName("CircleXIcon")),{type:4})}},applicationId:"-1",inputType:1,type:1},Kt=p.findByProps("sendMessage"),qt=p.findByProps("sendBotMessage","sendMessage","receiveMessage"),Yt=["avatar","classic","cuddle","fox_girl","gecg","holo","kemonomimi","kiss","neko","ngif","smug","spank","tickle","waifu","wallpaper","woof"];async function Xt(t,a){const n=[];for(let i=0;i0&&await new Promise(function(d){return setTimeout(d,1e3)});const s=await fetch(`https://nekos.life/api/v2/img/${t}`);if(!s.ok){console.error(`[NekosLife] API request failed: ${s.status}`);continue}const c=await s.json();c.url&&n.push(c.url)}catch(s){console.error(`[NekosLife] Error fetching image ${i+1}:`,s)}return n}function Jt(t){return!t||typeof t!="string"?!1:Yt.includes(t.toLowerCase().trim())}const Qt={name:"nekoslife",displayName:"nekoslife",description:"Get SFW images/gifs from nekos.life",displayDescription:"Get SFW images/gifs from nekos.life",options:[{name:"category",displayName:"category",description:"Category name (e.g. neko, waifu, cuddle, etc.)",displayDescription:"Category name (e.g. neko, waifu, cuddle, etc.)",type:3,required:!0},{name:"limit",displayName:"limit",description:"Number of images (1-5, default: 1)",displayDescription:"Number of images (1-5, default: 1)",type:4,required:!1},{name:"send",displayName:"send",description:"Send to chat",displayDescription:"Send to chat",type:5,required:!1},{name:"ephemeral",displayName:"ephemeral",description:"Send as ephemeral message (only you can see)",displayDescription:"Send as ephemeral message (only you can see)",type:5,required:!1}],execute:async function(t,a){try{console.log("[NekosLife] Command executed with args:",t);const n=t.find(function(y){return y.name==="category"})?.value,i=t.find(function(y){return y.name==="limit"})?.value,s=t.find(function(y){return y.name==="send"})?.value||!1,c=t.find(function(y){return y.name==="ephemeral"})?.value||!1;if(console.log("[NekosLife] Parsed values:",{categoryInput:n,limitInput:i,shouldSend:s,isEphemeral:c}),!n||typeof n!="string"){const y="\u274C Category is required! Examples: neko, waifu, cuddle, kiss";return console.error("[NekosLife] No category provided"),c?{type:4,data:{content:y,flags:64}}:(b.showToast(y,o.getAssetIDByName("CircleXIcon")),{type:4})}const d=n.toLowerCase().trim();if(!Jt(d)){const y=`\u274C Invalid SFW category "${n}". Valid: neko, waifu, cuddle, kiss, holo, etc.`;return c?{type:4,data:{content:y,flags:64}}:(b.showToast(y,o.getAssetIDByName("CircleXIcon")),{type:4})}let l=1;i!=null&&(l=parseInt(String(i))||1,l=Math.max(1,Math.min(5,l))),console.log("[NekosLife] Processing SFW request:",{category:d,limit:l,shouldSend:s,isEphemeral:c}),c||b.showToast(`Fetching ${l} SFW image(s) from nekos.life...`,o.getAssetIDByName("DownloadIcon"));const g=await Xt(d,l);if(g.length===0){const y="\u274C Failed to fetch images from nekos.life. Try again later!";return c?{type:4,data:{content:y,flags:64}}:(b.showToast(y,o.getAssetIDByName("CircleXIcon")),{type:4})}const f=g.join(` +`);if(c)return console.log("[NekosLife] Sending ephemeral response"),{type:4,data:{content:f,flags:64}};if(s){console.log("[NekosLife] Sending to chat");const y=Date.now().toString();return Kt.sendMessage(a.channel.id,{content:f},void 0,{nonce:y}),{type:4}}else return console.log("[NekosLife] Sending as bot message"),qt.sendBotMessage(a.channel.id,f),{type:4}}catch(n){console.error("[NekosLife] Command error:",n);const i="\u274C An error occurred while fetching images.";return t?.find?.(function(s){return s.name==="ephemeral"})?.value??!1?{type:4,data:{content:i,flags:64}}:(b.showToast(i,o.getAssetIDByName("CircleXIcon")),{type:4})}},applicationId:"-1",inputType:1,type:1},Zt=p.findByProps("sendBotMessage","sendMessage"),B=p.findByProps("getAllFriendInvites","createFriendInvite","revokeFriendInvites");p.findByProps("get","post");const ea=p.findByProps("getCurrentUser")?.getCurrentUser;function Y(t,a){const n=Date.now().toString();Zt.sendMessage(t.channel.id,{content:a},void 0,{nonce:n})}const ta={name:"invite create",displayName:"invite create",description:"Generates a friend invite link.",displayDescription:"Generates a friend invite link.",type:1,applicationId:"-1",inputType:1,execute:async function(t,a){try{if(!ea?.().phone)return b.showToast("You need a phone number connected to your account!",o.getAssetIDByName("Small")),{type:4};const n=await B.createFriendInvite({code:null,recipient_phone_number_or_email:null,contact_visibility:0,filter_visibilities:[],filtered_invite_suggestions_index:0});if(n?.code){const i=Math.floor(new Date(n.expires_at).getTime()/1e3),s=`https://discord.gg/${n.code} \xB7 Expires: `;Y(a,s),b.showToast("Friend invite created!",o.getAssetIDByName("Check"))}else throw new Error("No invite code generated");return{type:4}}catch(n){return console.error("[FriendInvite] Create error:",n),b.showToast("Error creating friend invite",o.getAssetIDByName("Small")),{type:4}}}},aa={name:"view invites",displayName:"view invites",description:"View your current friend invite links that you've made.",displayDescription:"View your current friend invite links that you've made.",type:1,applicationId:"-1",execute:async function(t,a){try{const n=await B.getAllFriendInvites();if(!n?.length)return b.showToast("No active friend invites found",o.getAssetIDByName("Info")),{type:4};const i=n.map(function(s){const c=Math.floor(new Date(s.expires_at).getTime()/1e3);return`_https://discord.gg/${s.code}_ \xB7 Expires: \xB7 Uses: \`${s.uses}/${s.max_uses}\``});return Y(a,`**Your Active Friend Invites:** ${i.join(` -`)}`),{type:4}}catch(n){return console.error("[FriendInvite] View error:",n),b.showToast("Error viewing friend invites",getAssetIDByName("Small")),{type:4}}}},aa={name:"revoke invites",displayName:"revoke invites",description:"Revoke all your friend invite links.",displayDescription:"Revoke all your friend invite links.",type:1,applicationId:"-1",inputType:1,execute:async function(t,a){try{const n=await B.getAllFriendInvites();if(!n?.length)return b.showToast("No active friend invites to revoke",getAssetIDByName("Info")),{type:4};await B.revokeFriendInvites();const i=await B.getAllFriendInvites();return i.length===0?(X(a,`\u2705 Successfully revoked all ${n.length} friend invite(s)!`),b.showToast(`Revoked ${n.length} invite(s)`,getAssetIDByName("Check"))):(X(a,`\u26A0\uFE0F Partially revoked invites. ${i.length} invite(s) remain active.`),b.showToast("Partial revocation",getAssetIDByName("Warning"))),{type:4}}catch(n){return console.error("[FriendInvite] Revoke error:",n),b.showToast("Error revoking friend invites",getAssetIDByName("Small")),{type:4}}}};function na(){const[t,a]=e.React.useState(0),[n,i]=e.React.useState(null),[s,c]=e.React.useState(null),[d,l]=e.React.useState(!1);e.React.useEffect(function(){r.storage.sidebarEnabled===void 0&&(r.storage.sidebarEnabled=!0)},[]);const g=p.findByProps("getUser","getCurrentUser")?.getCurrentUser?.(),{getUserAvatarURL:f}=p.findByProps("getUserAvatarURL")||{},{getDefaultAvatarURL:y}=p.findByProps("getDefaultAvatarURL")||{},C=e.stylesheet.createThemedStyleSheet({container:{flexDirection:"row",alignItems:"center",paddingVertical:24,paddingHorizontal:16,width:"100%",justifyContent:"center"},leftSection:{flexDirection:"row",alignItems:"center",flex:1,gap:20,maxWidth:500},avatarContainer:{position:"relative",width:96,height:96,justifyContent:"center",alignItems:"center"},avatarWrapper:{width:96,height:96,borderRadius:24,backgroundColor:u.semanticColors.BACKGROUND_SECONDARY,justifyContent:"center",alignItems:"center",overflow:"hidden",borderWidth:2,borderColor:u.semanticColors.BACKGROUND_TERTIARY},avatar:{width:92,height:92,borderRadius:22},cogwheelBackground:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",borderRadius:24,justifyContent:"center",alignItems:"center",opacity:0},cogwheelIcon:{width:32,height:32,tintColor:u.semanticColors.INTERACTIVE_ACTIVE},textContainer:{flex:1,marginLeft:4},title:{fontSize:28,fontWeight:"700",color:u.semanticColors.MOBILE_TEXT_HEADING_PRIMARY,marginBottom:4,textAlign:"left"},subtitle:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"left",lineHeight:20},avatarPlaceholder:{width:48,height:48,tintColor:u.semanticColors.INTERACTIVE_NORMAL},animatedIndicator:{position:"absolute",top:8,right:8,backgroundColor:"rgba(0, 0, 0, 0.7)",borderRadius:10,width:20,height:20,justifyContent:"center",alignItems:"center",zIndex:1},gifText:{color:"#FFFFFF",fontSize:10,fontWeight:"bold"}});e.React.useEffect(function(){if(g){let R,w=!1;const ae=g.avatar?.startsWith("a_");if(f&&g.avatar)R=f(g,ae),w=ae;else if(y)R=y(g);else if(g.avatar){const W=g.avatar.startsWith("a_");R=`https://cdn.discordapp.com/avatars/${g.id}/${g.avatar}.${W?"gif":"png"}?size=256`,w=W}else R=`https://cdn.discordapp.com/embed/avatars/${g.discriminator?parseInt(g.discriminator)%5:(parseInt(g.id)>>22)%6}.png`;c(R),l(w)}},[g]);const N=function(){if(r.storage.hiddenSettings?.enabled){r.storage.hiddenSettings.visible=!r.storage.hiddenSettings.visible,b.showToast(`Hidden settings ${r.storage.hiddenSettings.visible?"visible":"hidden"}`,o.getAssetIDByName("SettingsIcon"));return}n&&clearTimeout(n);const R=setTimeout(function(){a(0)},1e3);i(R);const w=t+1;a(w),!(w<10)&&(b.showToast("Hidden settings unlocked!",o.getAssetIDByName("CheckmarkIcon")),r.storage.hiddenSettings={...r.storage.hiddenSettings,enabled:!0,visible:!0},a(0))},A=function(){const R=!r.storage.sidebarEnabled;r.storage.sidebarEnabled=R,r.storage.pendingRestart=!0,b.showToast(`Sidebar ${R?"enabled":"disabled"}. Restart Discord to apply.`,o.getAssetIDByName(R?"CheckmarkIcon":"XIcon"))},[k,U]=e.React.useState(!1);return e.React.createElement(e.ReactNative.View,{style:C.container},e.React.createElement(e.ReactNative.View,{style:C.leftSection},e.React.createElement(e.ReactNative.Pressable,{style:C.avatarContainer,onPress:N,onPressIn:function(){return U(!0)},onPressOut:function(){return U(!1)},delayLongPress:500,onLongPress:A},e.React.createElement(e.ReactNative.View,{style:C.avatarWrapper},s?e.React.createElement(e.React.Fragment,null,e.React.createElement(e.ReactNative.Image,{source:{uri:s},style:C.avatar,resizeMode:"cover"}),d&&e.React.createElement(e.ReactNative.View,{style:C.animatedIndicator},e.React.createElement(e.ReactNative.Text,{style:C.gifText},"GIF"))):e.React.createElement(e.ReactNative.Image,{source:o.getAssetIDByName("ic_account_circle_24px"),style:C.avatarPlaceholder})),e.React.createElement(e.ReactNative.View,{style:[C.cogwheelBackground,{opacity:k?.8:0}]},e.React.createElement(e.ReactNative.Image,{source:o.getAssetIDByName("SettingsIcon"),style:C.cogwheelIcon}))),e.React.createElement(e.ReactNative.View,{style:C.textContainer},e.React.createElement(e.ReactNative.Text,{style:C.title},"Commands"),e.React.createElement(e.ReactNative.Text,{style:C.subtitle},"A collection of useful commands for Vendetta like clients"))))}function m({title:t,icon:a,children:n,padding:i=!1}){const s=e.stylesheet.createThemedStyleSheet({main:{backgroundColor:u.rawColors.PLUM_18,borderColor:u.semanticColors.CARD_BACKGROUND_DEFAULT,borderWidth:1,borderRadius:16,overflow:"hidden",flex:1,maxWidth:"100%"},titleContainer:{marginBottom:8,marginHorizontal:16,marginTop:8,gap:4,flexDirection:"row",alignItems:"center"},icon:{width:16,height:16,marginTop:1.5,tintColor:u.semanticColors.TEXT_MUTED},titleText:{fontSize:14,fontWeight:"600",color:u.semanticColors.TEXT_MUTED},wrapper:{marginHorizontal:16,marginTop:16,maxWidth:"100%"}});return e.React.createElement(e.ReactNative.View,{style:s.wrapper},t&&e.React.createElement(e.ReactNative.View,{style:s.titleContainer},a&&e.React.createElement(e.ReactNative.Image,{style:s.icon,source:a,resizeMode:"cover"}),e.React.createElement(e.ReactNative.Text,{style:s.titleText},t.toUpperCase())),e.React.createElement(e.ReactNative.View,{style:s.main},i?e.React.createElement(e.ReactNative.View,{style:{paddingHorizontal:16,paddingVertical:16}},n):n))}const{FormSwitchRow:x,FormRow:P}=v.Forms;function ra(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(a){return a+1},0);return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Fact Display Settings",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement(x,{label:"Send as Reply",subLabel:"Send facts as a reply to the command message",leading:e.React.createElement(P.Icon,{source:o.getAssetIDByName("ArrowAngleLeftUpIcon")}),value:r.storage.factSettings.sendAsReply,onValueChange:function(a){r.storage.factSettings.sendAsReply=a}}),e.React.createElement(x,{label:"Include Source Citation",subLabel:"Include the source of facts when available",leading:e.React.createElement(P.Icon,{source:o.getAssetIDByName("LinkIcon")}),value:r.storage.factSettings.includeCitation,onValueChange:function(a){r.storage.factSettings.includeCitation=a}})),e.React.createElement(m,{title:"Available Fact Commands",icon:o.getAssetIDByName("BookmarkIcon")},e.React.createElement(x,{label:"/catfact",subLabel:"Get random cat facts",leading:e.React.createElement(P.Icon,{source:o.getAssetIDByName("BookCheckIcon")}),value:r.storage.enabledCommands.catfact,onValueChange:function(a){r.storage.enabledCommands.catfact=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement(x,{label:"/dogfact",subLabel:"Get random dog facts",leading:e.React.createElement(P.Icon,{source:o.getAssetIDByName("BookCheckIcon")}),value:r.storage.enabledCommands.dogfact,onValueChange:function(a){r.storage.enabledCommands.dogfact=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement(x,{label:"/useless",subLabel:"Get random useless facts",leading:e.React.createElement(P.Icon,{source:o.getAssetIDByName("BookCheckIcon")}),value:r.storage.enabledCommands.useless,onValueChange:function(a){r.storage.enabledCommands.useless=a,r.storage.pendingRestart=!0,t()}})))}const{FormSwitchRow:J,FormRow:Q}=v.Forms;function ia(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(a){return a+1},0);return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"List Display Settings",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement(J,{label:"Always Send Detailed Plugin List",subLabel:"Always use detailed mode when listing plugins",leading:e.React.createElement(Q.Icon,{source:o.getAssetIDByName("PuzzlePieceIcon")}),value:r.storage.listSettings.pluginListAlwaysDetailed,onValueChange:function(a){r.storage.listSettings.pluginListAlwaysDetailed=a}}),e.React.createElement(J,{label:"Always Send Detailed Theme List",subLabel:"Always use detailed mode when listing themes",leading:e.React.createElement(Q.Icon,{source:o.getAssetIDByName("PaintPaletteIcon")}),value:r.storage.listSettings.themeListAlwaysDetailed,onValueChange:function(a){r.storage.listSettings.themeListAlwaysDetailed=a}})),e.React.createElement(m,{title:"Available List Commands",icon:o.getAssetIDByName("ListViewIcon")},e.React.createElement(J,{label:"/plugin-list",subLabel:"List all installed plugins",leading:e.React.createElement(Q.Icon,{source:o.getAssetIDByName("PuzzlePieceIcon")}),value:r.storage.enabledCommands.pluginList,onValueChange:function(a){r.storage.enabledCommands.pluginList=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement(J,{label:"/theme-list",subLabel:"List all installed themes",leading:e.React.createElement(Q.Icon,{source:o.getAssetIDByName("PaintPaletteIcon")}),value:r.storage.enabledCommands.themeList,onValueChange:function(a){r.storage.enabledCommands.themeList=a,r.storage.pendingRestart=!0,t()}})))}const{FormSwitchRow:le,FormRow:de}=v.Forms;function sa(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(a){return a+1},0);return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Image Commands",icon:o.getAssetIDByName("ImageIcon")},e.React.createElement(le,{label:"/petpet",subLabel:"Create pet-pet GIF of a user",leading:e.React.createElement(de.Icon,{source:o.getAssetIDByName("HandRequestSpeakIcon")}),value:r.storage.enabledCommands.petpet,onValueChange:function(a){r.storage.enabledCommands.petpet=a,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"KonoChan Commands",icon:o.getAssetIDByName("ImageIcon")},e.React.createElement(le,{label:"/konoself",subLabel:"Get random image from KonoChan (private)",leading:e.React.createElement(de.Icon,{source:o.getAssetIDByName("EyeIcon")}),value:r.storage.enabledCommands.konoself,onValueChange:function(a){r.storage.enabledCommands.konoself=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement(le,{label:"/konosend",subLabel:"Send random image from KonoChan to channel",leading:e.React.createElement(de.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:r.storage.enabledCommands.konosend,onValueChange:function(a){r.storage.enabledCommands.konosend=a,r.storage.pendingRestart=!0,t()}})))}const{FormSwitchRow:$,FormRow:L}=v.Forms;function oa(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(i){return i+1},0),a=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},infoText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,marginBottom:16,textAlign:"center"},currentText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"center",fontWeight:"600"}}),n=r.storage.garySettings.imageSource;return e.React.createElement(e.ReactNative.ScrollView,{style:a.container,contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Gary Command Settings",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement($,{label:"/gary",subLabel:"Send random Gary images to channel",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("AttachmentIcon")}),value:r.storage.enabledCommands.gary,onValueChange:function(i){r.storage.enabledCommands.gary=i,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"Image Source Selection",icon:o.getAssetIDByName("DownloadIcon"),padding:!0},e.React.createElement(e.ReactNative.Text,{style:a.infoText},"Choose which API the /gary command should use to fetch images.")),e.React.createElement(m,{title:"API Options",icon:o.getAssetIDByName("CloudIcon")},e.React.createElement($,{label:"Gary API",subLabel:"Original Gary the cat images from api.garythe.cat",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="gary",onValueChange:function(i){i&&(r.storage.garySettings.imageSource="gary",t())}}),e.React.createElement($,{label:"Cat API",subLabel:"Random cat pictures from thecatapi.com",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="catapi",onValueChange:function(i){i&&(r.storage.garySettings.imageSource="catapi",t())}}),e.React.createElement($,{label:"Minker API",subLabel:"Minky images from minky.materii.dev",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="minker",onValueChange:function(i){i&&(r.storage.garySettings.imageSource="minker",t())}}),e.React.createElement($,{label:"Goober API",subLabel:"Goober images from api.garythe.cat/goober",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="goober",onValueChange:function(i){i&&(r.storage.garySettings.imageSource="goober",t())}})),e.React.createElement(m,{title:"Current Selection",icon:o.getAssetIDByName("CheckmarkIcon"),padding:!0},e.React.createElement(e.ReactNative.Text,{style:a.currentText},"Currently using:"," ",n==="gary"?"Gary API":n==="catapi"?"Cat API":n==="minker"?"Minker API":n==="goober"?"Goober API":"Gary API")))}const{FormSwitchRow:Z,FormRow:ee}=v.Forms;function ca(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(n){return n+1},0),a=e.stylesheet.createThemedStyleSheet({infoText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"center",lineHeight:20}});return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Spotify Commands",icon:o.getAssetIDByName("SpotifyNeutralIcon")},e.React.createElement(Z,{label:"/spotify track",subLabel:"Share your current Spotify track",leading:e.React.createElement(ee.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),value:r.storage.enabledCommands.spotifyTrack,onValueChange:function(n){r.storage.enabledCommands.spotifyTrack=n,r.storage.pendingRestart=!0,t()}}),e.React.createElement(Z,{label:"/spotify album",subLabel:"Share your current track's album",leading:e.React.createElement(ee.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),value:r.storage.enabledCommands.spotifyAlbum,onValueChange:function(n){r.storage.enabledCommands.spotifyAlbum=n,r.storage.pendingRestart=!0,t()}}),e.React.createElement(Z,{label:"/spotify artists",subLabel:"Share your current track's artists",leading:e.React.createElement(ee.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),value:r.storage.enabledCommands.spotifyArtists,onValueChange:function(n){r.storage.enabledCommands.spotifyArtists=n,r.storage.pendingRestart=!0,t()}}),e.React.createElement(Z,{label:"/spotify cover",subLabel:"Share your current track's cover",leading:e.React.createElement(ee.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),value:r.storage.enabledCommands.spotifyCover,onValueChange:function(n){r.storage.enabledCommands.spotifyCover=n,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"About Spotify Commands",icon:o.getAssetIDByName("InfoIcon"),padding:!0},e.React.createElement(e.ReactNative.Text,{style:a.infoText},"These commands allow you to share your current Spotify activity in Discord. Make sure you have Spotify connected to Discord for these commands to work properly.")))}function la(){const t=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},tableHeader:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:16,backgroundColor:u.semanticColors.BACKGROUND_MODIFIER_ACCENT,borderBottomWidth:2,borderBottomColor:u.semanticColors.BORDER_STRONG},headerText:{fontSize:14,fontWeight:"700",color:u.semanticColors.HEADER_PRIMARY,textTransform:"uppercase"},nameHeader:{flex:2},codeHeader:{flex:2,textAlign:"center"},badgeHeader:{flex:1,textAlign:"center"},categoryItem:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:16,borderBottomWidth:1,borderBottomColor:u.semanticColors.BORDER_FAINT},categoryName:{fontSize:16,fontWeight:"500",color:u.semanticColors.HEADER_PRIMARY,flex:2},categoryValue:{fontSize:14,color:u.semanticColors.TEXT_MUTED,fontFamily:"monospace",flex:2,textAlign:"center"},sfwBadgeContainer:{flex:1,alignItems:"center"},sfwBadge:{backgroundColor:u.semanticColors.STATUS_POSITIVE,paddingHorizontal:8,paddingVertical:4,borderRadius:12},badgeText:{fontSize:12,fontWeight:"600",color:u.semanticColors.TEXT_NORMAL},infoText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"center",lineHeight:20}}),a=[{name:"Avatar",value:"avatar"},{name:"Classic",value:"classic"},{name:"Cuddle",value:"cuddle"},{name:"Fox Girl",value:"fox_girl"},{name:"Gecg",value:"gecg"},{name:"Holo",value:"holo"},{name:"Kemonomimi",value:"kemonomimi"},{name:"Kiss",value:"kiss"},{name:"Neko",value:"neko"},{name:"Neko GIF",value:"ngif"},{name:"Smug",value:"smug"},{name:"Spank",value:"spank"},{name:"Tickle",value:"tickle"},{name:"Waifu",value:"waifu"},{name:"Wallpaper",value:"wallpaper"},{name:"Woof",value:"woof"}],n=a.sort(function(i,s){return i.name.localeCompare(s.name)});return e.React.createElement(e.ReactNative.ScrollView,{style:t.container,contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"\u{1F4CA} Category Statistics",icon:o.getAssetIDByName("ChartIcon"),padding:!0},e.React.createElement(e.ReactNative.Text,{style:t.infoText},"Total SFW Categories: ",a.length,` +`)}`),{type:4}}catch(n){return console.error("[FriendInvite] View error:",n),b.showToast("Error viewing friend invites",o.getAssetIDByName("Small")),{type:4}}}},na={name:"revoke invites",displayName:"revoke invites",description:"Revoke all your friend invite links.",displayDescription:"Revoke all your friend invite links.",type:1,applicationId:"-1",inputType:1,execute:async function(t,a){try{const n=await B.getAllFriendInvites();if(!n?.length)return b.showToast("No active friend invites to revoke",o.getAssetIDByName("Info")),{type:4};await B.revokeFriendInvites();const i=await B.getAllFriendInvites();return i.length===0?(Y(a,`\u2705 Successfully revoked all ${n.length} friend invite(s)!`),b.showToast(`Revoked ${n.length} invite(s)`,o.getAssetIDByName("Check"))):(Y(a,`\u26A0\uFE0F Partially revoked invites. ${i.length} invite(s) remain active.`),b.showToast("Partial revocation",o.getAssetIDByName("Warning"))),{type:4}}catch(n){return console.error("[FriendInvite] Revoke error:",n),b.showToast("Error revoking friend invites",o.getAssetIDByName("Small")),{type:4}}}};function ra(){const[t,a]=e.React.useState(0),[n,i]=e.React.useState(null),[s,c]=e.React.useState(null),[d,l]=e.React.useState(!1);e.React.useEffect(function(){r.storage.sidebarEnabled===void 0&&(r.storage.sidebarEnabled=!0)},[]);const g=p.findByProps("getUser","getCurrentUser")?.getCurrentUser?.(),{getUserAvatarURL:f}=p.findByProps("getUserAvatarURL")||{},{getDefaultAvatarURL:y}=p.findByProps("getDefaultAvatarURL")||{},C=e.stylesheet.createThemedStyleSheet({container:{flexDirection:"row",alignItems:"center",paddingVertical:24,paddingHorizontal:16,width:"100%",justifyContent:"center"},leftSection:{flexDirection:"row",alignItems:"center",flex:1,gap:20,maxWidth:500},avatarContainer:{position:"relative",width:96,height:96,justifyContent:"center",alignItems:"center"},avatarWrapper:{width:96,height:96,borderRadius:24,backgroundColor:u.semanticColors.BACKGROUND_SECONDARY,justifyContent:"center",alignItems:"center",overflow:"hidden",borderWidth:2,borderColor:u.semanticColors.BACKGROUND_TERTIARY},avatar:{width:92,height:92,borderRadius:22},cogwheelBackground:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",borderRadius:24,justifyContent:"center",alignItems:"center",opacity:0},cogwheelIcon:{width:32,height:32,tintColor:u.semanticColors.INTERACTIVE_ACTIVE},textContainer:{flex:1,marginLeft:4},title:{fontSize:28,fontWeight:"700",color:u.semanticColors.MOBILE_TEXT_HEADING_PRIMARY,marginBottom:4,textAlign:"left"},subtitle:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"left",lineHeight:20},avatarPlaceholder:{width:48,height:48,tintColor:u.semanticColors.INTERACTIVE_NORMAL},animatedIndicator:{position:"absolute",top:8,right:8,backgroundColor:"rgba(0, 0, 0, 0.7)",borderRadius:10,width:20,height:20,justifyContent:"center",alignItems:"center",zIndex:1},gifText:{color:"#FFFFFF",fontSize:10,fontWeight:"bold"}});e.React.useEffect(function(){if(g){let R,A=!1;const U=g.avatar?.startsWith("a_");if(f&&g.avatar)R=f(g,U),A=U;else if(y)R=y(g);else if(g.avatar){const ae=g.avatar.startsWith("a_");R=`https://cdn.discordapp.com/avatars/${g.id}/${g.avatar}.${ae?"gif":"png"}?size=256`,A=ae}else R=`https://cdn.discordapp.com/embed/avatars/${g.discriminator?parseInt(g.discriminator)%5:(parseInt(g.id)>>22)%6}.png`;c(R),l(A)}},[g]);const E=function(){if(r.storage.hiddenSettings?.enabled){r.storage.hiddenSettings.visible=!r.storage.hiddenSettings.visible,b.showToast(`Hidden settings ${r.storage.hiddenSettings.visible?"visible":"hidden"}`,o.getAssetIDByName("SettingsIcon"));return}n&&clearTimeout(n);const R=setTimeout(function(){a(0)},1e3);i(R);const A=t+1;a(A),!(A<10)&&(b.showToast("Hidden settings unlocked!",o.getAssetIDByName("CheckmarkIcon")),r.storage.hiddenSettings={...r.storage.hiddenSettings,enabled:!0,visible:!0},a(0))},N=function(){const R=!r.storage.sidebarEnabled;r.storage.sidebarEnabled=R,r.storage.pendingRestart=!0,b.showToast(`Sidebar ${R?"enabled":"disabled"}. Restart Discord to apply.`,o.getAssetIDByName(R?"CheckmarkIcon":"XIcon"))},[k,te]=e.React.useState(!1);return e.React.createElement(e.ReactNative.View,{style:C.container},e.React.createElement(e.ReactNative.View,{style:C.leftSection},e.React.createElement(e.ReactNative.Pressable,{style:C.avatarContainer,onPress:E,onPressIn:function(){return te(!0)},onPressOut:function(){return te(!1)},delayLongPress:500,onLongPress:N},e.React.createElement(e.ReactNative.View,{style:C.avatarWrapper},s?e.React.createElement(e.React.Fragment,null,e.React.createElement(e.ReactNative.Image,{source:{uri:s},style:C.avatar,resizeMode:"cover"}),d&&e.React.createElement(e.ReactNative.View,{style:C.animatedIndicator},e.React.createElement(e.ReactNative.Text,{style:C.gifText},"GIF"))):e.React.createElement(e.ReactNative.Image,{source:o.getAssetIDByName("ic_account_circle_24px"),style:C.avatarPlaceholder})),e.React.createElement(e.ReactNative.View,{style:[C.cogwheelBackground,{opacity:k?.8:0}]},e.React.createElement(e.ReactNative.Image,{source:o.getAssetIDByName("SettingsIcon"),style:C.cogwheelIcon}))),e.React.createElement(e.ReactNative.View,{style:C.textContainer},e.React.createElement(e.ReactNative.Text,{style:C.title},"Commands"),e.React.createElement(e.ReactNative.Text,{style:C.subtitle},"A collection of useful commands for Vendetta like clients"))))}function m({title:t,icon:a,children:n,padding:i=!1}){const s=e.stylesheet.createThemedStyleSheet({main:{backgroundColor:u.rawColors.PLUM_18,borderColor:u.semanticColors.CARD_BACKGROUND_DEFAULT,borderWidth:1,borderRadius:16,overflow:"hidden",flex:1,maxWidth:"100%"},titleContainer:{marginBottom:8,marginHorizontal:16,marginTop:8,gap:4,flexDirection:"row",alignItems:"center"},icon:{width:16,height:16,marginTop:1.5,tintColor:u.semanticColors.TEXT_MUTED},titleText:{fontSize:14,fontWeight:"600",color:u.semanticColors.TEXT_MUTED},wrapper:{marginHorizontal:16,marginTop:16,maxWidth:"100%"}});return e.React.createElement(e.ReactNative.View,{style:s.wrapper},t&&e.React.createElement(e.ReactNative.View,{style:s.titleContainer},a&&e.React.createElement(e.ReactNative.Image,{style:s.icon,source:a,resizeMode:"cover"}),e.React.createElement(e.ReactNative.Text,{style:s.titleText},t.toUpperCase())),e.React.createElement(e.ReactNative.View,{style:s.main},i?e.React.createElement(e.ReactNative.View,{style:{paddingHorizontal:16,paddingVertical:16}},n):n))}const{FormSwitchRow:x,FormRow:P}=v.Forms;function ia(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(a){return a+1},0);return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Fact Display Settings",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement(x,{label:"Send as Reply",subLabel:"Send facts as a reply to the command message",leading:e.React.createElement(P.Icon,{source:o.getAssetIDByName("ArrowAngleLeftUpIcon")}),value:r.storage.factSettings.sendAsReply,onValueChange:function(a){r.storage.factSettings.sendAsReply=a}}),e.React.createElement(x,{label:"Include Source Citation",subLabel:"Include the source of facts when available",leading:e.React.createElement(P.Icon,{source:o.getAssetIDByName("LinkIcon")}),value:r.storage.factSettings.includeCitation,onValueChange:function(a){r.storage.factSettings.includeCitation=a}})),e.React.createElement(m,{title:"Available Fact Commands",icon:o.getAssetIDByName("BookmarkIcon")},e.React.createElement(x,{label:"/catfact",subLabel:"Get random cat facts",leading:e.React.createElement(P.Icon,{source:o.getAssetIDByName("BookCheckIcon")}),value:r.storage.enabledCommands.catfact,onValueChange:function(a){r.storage.enabledCommands.catfact=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement(x,{label:"/dogfact",subLabel:"Get random dog facts",leading:e.React.createElement(P.Icon,{source:o.getAssetIDByName("BookCheckIcon")}),value:r.storage.enabledCommands.dogfact,onValueChange:function(a){r.storage.enabledCommands.dogfact=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement(x,{label:"/useless",subLabel:"Get random useless facts",leading:e.React.createElement(P.Icon,{source:o.getAssetIDByName("BookCheckIcon")}),value:r.storage.enabledCommands.useless,onValueChange:function(a){r.storage.enabledCommands.useless=a,r.storage.pendingRestart=!0,t()}})))}const{FormSwitchRow:X,FormRow:J}=v.Forms;function sa(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(a){return a+1},0);return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"List Display Settings",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement(X,{label:"Always Send Detailed Plugin List",subLabel:"Always use detailed mode when listing plugins",leading:e.React.createElement(J.Icon,{source:o.getAssetIDByName("PuzzlePieceIcon")}),value:r.storage.listSettings.pluginListAlwaysDetailed,onValueChange:function(a){r.storage.listSettings.pluginListAlwaysDetailed=a}}),e.React.createElement(X,{label:"Always Send Detailed Theme List",subLabel:"Always use detailed mode when listing themes",leading:e.React.createElement(J.Icon,{source:o.getAssetIDByName("PaintPaletteIcon")}),value:r.storage.listSettings.themeListAlwaysDetailed,onValueChange:function(a){r.storage.listSettings.themeListAlwaysDetailed=a}})),e.React.createElement(m,{title:"Available List Commands",icon:o.getAssetIDByName("ListViewIcon")},e.React.createElement(X,{label:"/plugin-list",subLabel:"List all installed plugins",leading:e.React.createElement(J.Icon,{source:o.getAssetIDByName("PuzzlePieceIcon")}),value:r.storage.enabledCommands.pluginList,onValueChange:function(a){r.storage.enabledCommands.pluginList=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement(X,{label:"/theme-list",subLabel:"List all installed themes",leading:e.React.createElement(J.Icon,{source:o.getAssetIDByName("PaintPaletteIcon")}),value:r.storage.enabledCommands.themeList,onValueChange:function(a){r.storage.enabledCommands.themeList=a,r.storage.pendingRestart=!0,t()}})))}const{FormSwitchRow:ce,FormRow:le}=v.Forms;function oa(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(a){return a+1},0);return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Image Commands",icon:o.getAssetIDByName("ImageIcon")},e.React.createElement(ce,{label:"/petpet",subLabel:"Create pet-pet GIF of a user",leading:e.React.createElement(le.Icon,{source:o.getAssetIDByName("HandRequestSpeakIcon")}),value:r.storage.enabledCommands.petpet,onValueChange:function(a){r.storage.enabledCommands.petpet=a,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"KonoChan Commands",icon:o.getAssetIDByName("ImageIcon")},e.React.createElement(ce,{label:"/konoself",subLabel:"Get random image from KonoChan (private)",leading:e.React.createElement(le.Icon,{source:o.getAssetIDByName("EyeIcon")}),value:r.storage.enabledCommands.konoself,onValueChange:function(a){r.storage.enabledCommands.konoself=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement(ce,{label:"/konosend",subLabel:"Send random image from KonoChan to channel",leading:e.React.createElement(le.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:r.storage.enabledCommands.konosend,onValueChange:function(a){r.storage.enabledCommands.konosend=a,r.storage.pendingRestart=!0,t()}})))}const{FormSwitchRow:$,FormRow:L}=v.Forms;function ca(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(i){return i+1},0),a=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},infoText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,marginBottom:16,textAlign:"center"},currentText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"center",fontWeight:"600"}}),n=r.storage.garySettings.imageSource;return e.React.createElement(e.ReactNative.ScrollView,{style:a.container,contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Gary Command Settings",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement($,{label:"/gary",subLabel:"Send random Gary images to channel",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("AttachmentIcon")}),value:r.storage.enabledCommands.gary,onValueChange:function(i){r.storage.enabledCommands.gary=i,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"Image Source Selection",icon:o.getAssetIDByName("DownloadIcon"),padding:!0},e.React.createElement(e.ReactNative.Text,{style:a.infoText},"Choose which API the /gary command should use to fetch images.")),e.React.createElement(m,{title:"API Options",icon:o.getAssetIDByName("CloudIcon")},e.React.createElement($,{label:"Gary API",subLabel:"Original Gary the cat images from api.garythe.cat",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="gary",onValueChange:function(i){i&&(r.storage.garySettings.imageSource="gary",t())}}),e.React.createElement($,{label:"Cat API",subLabel:"Random cat pictures from thecatapi.com",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="catapi",onValueChange:function(i){i&&(r.storage.garySettings.imageSource="catapi",t())}}),e.React.createElement($,{label:"Minker API",subLabel:"Minky images from minky.materii.dev",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="minker",onValueChange:function(i){i&&(r.storage.garySettings.imageSource="minker",t())}}),e.React.createElement($,{label:"Goober API",subLabel:"Goober images from api.garythe.cat/goober",leading:e.React.createElement(L.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:n==="goober",onValueChange:function(i){i&&(r.storage.garySettings.imageSource="goober",t())}})),e.React.createElement(m,{title:"Current Selection",icon:o.getAssetIDByName("CheckmarkIcon"),padding:!0},e.React.createElement(e.ReactNative.Text,{style:a.currentText},"Currently using:"," ",n==="gary"?"Gary API":n==="catapi"?"Cat API":n==="minker"?"Minker API":n==="goober"?"Goober API":"Gary API")))}const{FormSwitchRow:Q,FormRow:Z}=v.Forms;function la(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(n){return n+1},0),a=e.stylesheet.createThemedStyleSheet({infoText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"center",lineHeight:20}});return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Spotify Commands",icon:o.getAssetIDByName("SpotifyNeutralIcon")},e.React.createElement(Q,{label:"/spotify track",subLabel:"Share your current Spotify track",leading:e.React.createElement(Z.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),value:r.storage.enabledCommands.spotifyTrack,onValueChange:function(n){r.storage.enabledCommands.spotifyTrack=n,r.storage.pendingRestart=!0,t()}}),e.React.createElement(Q,{label:"/spotify album",subLabel:"Share your current track's album",leading:e.React.createElement(Z.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),value:r.storage.enabledCommands.spotifyAlbum,onValueChange:function(n){r.storage.enabledCommands.spotifyAlbum=n,r.storage.pendingRestart=!0,t()}}),e.React.createElement(Q,{label:"/spotify artists",subLabel:"Share your current track's artists",leading:e.React.createElement(Z.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),value:r.storage.enabledCommands.spotifyArtists,onValueChange:function(n){r.storage.enabledCommands.spotifyArtists=n,r.storage.pendingRestart=!0,t()}}),e.React.createElement(Q,{label:"/spotify cover",subLabel:"Share your current track's cover",leading:e.React.createElement(Z.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),value:r.storage.enabledCommands.spotifyCover,onValueChange:function(n){r.storage.enabledCommands.spotifyCover=n,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"About Spotify Commands",icon:o.getAssetIDByName("InfoIcon"),padding:!0},e.React.createElement(e.ReactNative.Text,{style:a.infoText},"These commands allow you to share your current Spotify activity in Discord. Make sure you have Spotify connected to Discord for these commands to work properly.")))}function da(){const t=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},tableHeader:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:16,backgroundColor:u.semanticColors.BACKGROUND_MODIFIER_ACCENT,borderBottomWidth:2,borderBottomColor:u.semanticColors.BORDER_STRONG},headerText:{fontSize:14,fontWeight:"700",color:u.semanticColors.HEADER_PRIMARY,textTransform:"uppercase"},nameHeader:{flex:2},codeHeader:{flex:2,textAlign:"center"},badgeHeader:{flex:1,textAlign:"center"},categoryItem:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:16,borderBottomWidth:1,borderBottomColor:u.semanticColors.BORDER_FAINT},categoryName:{fontSize:16,fontWeight:"500",color:u.semanticColors.HEADER_PRIMARY,flex:2},categoryValue:{fontSize:14,color:u.semanticColors.TEXT_MUTED,fontFamily:"monospace",flex:2,textAlign:"center"},sfwBadgeContainer:{flex:1,alignItems:"center"},sfwBadge:{backgroundColor:u.semanticColors.STATUS_POSITIVE,paddingHorizontal:8,paddingVertical:4,borderRadius:12},badgeText:{fontSize:12,fontWeight:"600",color:u.semanticColors.TEXT_NORMAL},infoText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"center",lineHeight:20}}),a=[{name:"Avatar",value:"avatar"},{name:"Classic",value:"classic"},{name:"Cuddle",value:"cuddle"},{name:"Fox Girl",value:"fox_girl"},{name:"Gecg",value:"gecg"},{name:"Holo",value:"holo"},{name:"Kemonomimi",value:"kemonomimi"},{name:"Kiss",value:"kiss"},{name:"Neko",value:"neko"},{name:"Neko GIF",value:"ngif"},{name:"Smug",value:"smug"},{name:"Spank",value:"spank"},{name:"Tickle",value:"tickle"},{name:"Waifu",value:"waifu"},{name:"Wallpaper",value:"wallpaper"},{name:"Woof",value:"woof"}],n=a.sort(function(i,s){return i.name.localeCompare(s.name)});return e.React.createElement(e.ReactNative.ScrollView,{style:t.container,contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"\u{1F4CA} Category Statistics",icon:o.getAssetIDByName("ChartIcon"),padding:!0},e.React.createElement(e.ReactNative.Text,{style:t.infoText},"Total SFW Categories: ",a.length,` `,"Use these category names with the /nekoslife command.",` -`,"All categories are Safe For Work (SFW).")),e.React.createElement(m,{title:"\u{1F4CB} SFW Categories",icon:o.getAssetIDByName("ListViewIcon")},e.React.createElement(e.ReactNative.View,{style:t.tableHeader},e.React.createElement(e.ReactNative.Text,{style:[t.headerText,t.nameHeader]},"Category Name"),e.React.createElement(e.ReactNative.Text,{style:[t.headerText,t.codeHeader]},"Command Code"),e.React.createElement(e.ReactNative.Text,{style:[t.headerText,t.badgeHeader]},"Type")),n.map(function(i,s){return e.React.createElement(e.ReactNative.View,{key:s,style:t.categoryItem},e.React.createElement(e.ReactNative.Text,{style:t.categoryName},i.name),e.React.createElement(e.ReactNative.Text,{style:t.categoryValue},i.value),e.React.createElement(e.ReactNative.View,{style:t.sfwBadgeContainer},e.React.createElement(e.ReactNative.View,{style:t.sfwBadge},e.React.createElement(e.ReactNative.Text,{style:t.badgeText},"SFW"))))})))}const{FormSwitchRow:ke,FormRow:F}=v.Forms;function da(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(n){return n+1},0),a=e.NavigationNative.useNavigation();return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"IP Commands",icon:o.getAssetIDByName("GlobeEarthIcon")},e.React.createElement(ke,{label:"/ip",subLabel:"Get your current IP address",leading:e.React.createElement(F.Icon,{source:o.getAssetIDByName("GlobeEarthIcon")}),value:r.storage.enabledCommands.ip,onValueChange:function(n){r.storage.enabledCommands.ip=n,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"NekosLife Commands",icon:o.getAssetIDByName("ImageIcon")},e.React.createElement(ke,{label:"/nekoslife",subLabel:"Get images/gifs from nekos.life",leading:e.React.createElement(F.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:r.storage.enabledCommands.nekoslife,onValueChange:function(n){r.storage.enabledCommands.nekoslife=n,r.storage.pendingRestart=!0,t()}}),e.React.createElement(F,{label:"View Categories",subLabel:"See all 16 available categories",leading:e.React.createElement(F.Icon,{source:o.getAssetIDByName("BookOpenIcon")}),trailing:e.React.createElement(F.Arrow,null),onPress:function(){return a.push("VendettaCustomPage",{title:"NekosLife Categories",render:la})}})),e.React.createElement(e.ReactNative.View,{style:{height:32}}))}const{FormSwitchRow:M,FormRow:Be}=v.Forms;function ua(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(a){return a+1},0);return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Message Commands",icon:o.getAssetIDByName("ChatIcon")},e.React.createElement(M,{label:"/firstmessage",subLabel:"Get the first message in a channel",leading:e.React.createElement(Be.Icon,{source:o.getAssetIDByName("ChatIcon")}),value:r.storage.enabledCommands.firstmessage,onValueChange:function(a){r.storage.enabledCommands.firstmessage=a,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"System Commands",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement(M,{label:"/sysinfo",subLabel:"Display system information",leading:e.React.createElement(Be.Icon,{source:o.getAssetIDByName("SettingsIcon")}),value:r.storage.enabledCommands.sysinfo,onValueChange:function(a){r.storage.enabledCommands.sysinfo=a,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"Friend Invites",icon:o.getAssetIDByName("UserAddIcon")},e.React.createElement(M,{label:"/invite create",subLabel:"Generate a friend invite link",value:r.storage.enabledCommands.friendInviteCreate,onValueChange:function(a){r.storage.enabledCommands.friendInviteCreate=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement(M,{label:"/view invites",subLabel:"View your current friend invites",value:r.storage.enabledCommands.friendInviteView,onValueChange:function(a){r.storage.enabledCommands.friendInviteView=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement(M,{label:"/revoke invites",subLabel:"Revoke all your friend invites",value:r.storage.enabledCommands.friendInviteRevoke,onValueChange:function(a){r.storage.enabledCommands.friendInviteRevoke=a,r.storage.pendingRestart=!0,t()}})))}const{FormSwitchRow:ue,FormRow:_}=v.Forms;function ga(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(n){return n+1},0),a=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},warningText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"center",lineHeight:20,fontWeight:"600"},infoText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"center",lineHeight:20,marginTop:8}});return e.React.createElement(e.ReactNative.ScrollView,{style:a.container,contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Warning",icon:o.getAssetIDByName("WarningIcon"),padding:!0},e.React.createElement(e.ReactNative.Text,{style:a.warningText},"These are hidden commands that may contain mature content or experimental features."),e.React.createElement(e.ReactNative.Text,{style:a.infoText},"Use at your own discretion. Commands in this section are disabled by default.")),e.React.createElement(m,{title:"Hidden Commands",icon:o.getAssetIDByName("EyeIcon")},e.React.createElement(ue,{label:"/lovefemboys",subLabel:"Get random femboy images from r/femboys (NSFW content available)",leading:e.React.createElement(_.Icon,{source:o.getAssetIDByName("HeartIcon")}),value:r.storage.enabledCommands.lovefemboys,onValueChange:function(n){r.storage.enabledCommands.lovefemboys=n,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"NSFW Bypass Options",icon:o.getAssetIDByName("WarningIcon")},e.React.createElement(ue,{label:"KonoChan NSFW Bypass",subLabel:"Allow NSFW KonoChan content in non-NSFW channels (USE WITH CAUTION)",leading:e.React.createElement(_.Icon,{source:o.getAssetIDByName("ShieldIcon")}),value:r.storage.hiddenSettings.konochanBypassNsfw,onValueChange:function(n){n?u.alerts.showConfirmationAlert({title:"\u26A0\uFE0F NSFW Bypass Warning",content:"Enabling this allows NSFW content from KonoChan to be sent in any channel, including non-NSFW channels. This could violate server rules or Discord ToS. Use responsibly!",confirmText:"I Understand",cancelText:"Cancel",onConfirm:function(){r.storage.hiddenSettings.konochanBypassNsfw=!0,t()},onCancel:function(){}}):(r.storage.hiddenSettings.konochanBypassNsfw=!1,t())}})),e.React.createElement(m,{title:"Hidden Settings Control",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement(ue,{label:"Keep Hidden Settings Visible",subLabel:"Keep this section visible even when navigating away",leading:e.React.createElement(_.Icon,{source:o.getAssetIDByName("EyeIcon")}),value:r.storage.hiddenSettings.visible,onValueChange:function(n){r.storage.hiddenSettings.visible=n}}),e.React.createElement(_,{label:"Reset Hidden Settings",subLabel:"Hide this section and disable all hidden commands",leading:e.React.createElement(_.Icon,{source:o.getAssetIDByName("TrashIcon")}),onPress:function(){u.alerts.showConfirmationAlert({title:"Reset Hidden Settings",content:"This will hide the hidden settings section and disable all hidden commands. Are you sure?",confirmText:"Reset",onConfirm:function(){r.storage.hiddenSettings.enabled=!1,r.storage.hiddenSettings.visible=!1,r.storage.hiddenSettings.konochanBypassNsfw=!1,r.storage.enabledCommands.lovefemboys=!1,r.storage.pendingRestart=!0,b.showToast("Hidden settings reset",o.getAssetIDByName("CheckmarkIcon"))},cancelText:"Cancel"})}})))}function fa(){const t=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},scrollContent:{paddingVertical:16,paddingHorizontal:12,alignItems:"stretch"},groupWrapper:{marginHorizontal:16,marginTop:16,maxWidth:"100%"},groupMain:{backgroundColor:u.rawColors.PLUM_18,borderColor:u.semanticColors.CARD_BACKGROUND_DEFAULT,borderWidth:1,borderRadius:16,overflow:"hidden",flex:1,maxWidth:"100%"},cardPressable:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:12},avatarContainer:{width:56,height:56,borderRadius:12,overflow:"hidden",backgroundColor:u.semanticColors.BACKGROUND_SECONDARY,justifyContent:"center",alignItems:"center",marginRight:12},avatar:{width:56,height:56,borderRadius:12,resizeMode:"cover"},textContainer:{flex:1,justifyContent:"center"},commandText:{fontSize:16,fontWeight:"700",color:u.semanticColors.MOBILE_TEXT_HEADING_PRIMARY,marginBottom:2},authorText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,marginBottom:6},linkText:{fontSize:13,color:u.semanticColors.LINK,fontWeight:"600"},infoText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,marginBottom:20,textAlign:"center",lineHeight:20},versionText:{fontSize:15,color:u.semanticColors.TEXT_MUTED,textAlign:"center",fontWeight:"600",lineHeight:22}}),a=[{command:"Facts Commands",author:"jdev082",avatar:"https://github.com/jdev082.png",github:"https://github.com/jdev082"},{command:"List Commands",author:"Kitomanari",avatar:"https://github.com/Kitosight.png",github:"https://github.com/Kitosight"},{command:"PetPet",author:"wolfieeee",avatar:"https://github.com/WolfPlugs.png",github:"https://github.com/WolfPlugs"},{command:"KonoChan Commands",author:"btmc727 & Rico040",avatar:"https://github.com/OTKUSteyler.png",github:"https://github.com/OTKUSteyler"},{command:"FirstMessage Command",author:"sapphire",avatar:"https://github.com/aeongdesu.png",github:"https://github.com/aeongdesu"},{command:"Sysinfo Command",author:"mugman",avatar:"https://github.com/mugman174.png",github:"https://github.com/mugman174"},{command:"Spotify Commands",author:"Kitomanari",avatar:"https://github.com/Kitosight.png",github:"https://github.com/Kitosight"},{command:"Gary Command",author:"Zach Orange",avatar:"https://github.com/IAmGaryTheCat.png",github:"https://github.com/IAmGaryTheCat"},{command:"IP & NekosLife Commands",author:"scruzism",avatar:"https://github.com/scrazzz.png",github:"https://github.com/scrazzz"},{command:"FriendInvites",author:"nikosszzz",avatar:"https://github.com/nikosszzz.png",github:"https://github.com/nikosszzz"}],n=function(l){e.ReactNative.Linking.openURL(l)},i=o.getAssetIDByName("HeartIcon"),s=o.getAssetIDByName("ic_information_24px"),c=typeof i=="number"?i:void 0,d=typeof s=="number"?s:void 0;return e.React.createElement(e.ReactNative.ScrollView,{style:t.container,contentContainerStyle:t.scrollContent},e.React.createElement(m,{title:"Plugin Authors",icon:c,padding:!0},e.React.createElement(e.ReactNative.Text,{style:t.infoText},"Thanks to these developers for creating such great plugins!",` +`,"All categories are Safe For Work (SFW).")),e.React.createElement(m,{title:"\u{1F4CB} SFW Categories",icon:o.getAssetIDByName("ListViewIcon")},e.React.createElement(e.ReactNative.View,{style:t.tableHeader},e.React.createElement(e.ReactNative.Text,{style:[t.headerText,t.nameHeader]},"Category Name"),e.React.createElement(e.ReactNative.Text,{style:[t.headerText,t.codeHeader]},"Command Code"),e.React.createElement(e.ReactNative.Text,{style:[t.headerText,t.badgeHeader]},"Type")),n.map(function(i,s){return e.React.createElement(e.ReactNative.View,{key:s,style:t.categoryItem},e.React.createElement(e.ReactNative.Text,{style:t.categoryName},i.name),e.React.createElement(e.ReactNative.Text,{style:t.categoryValue},i.value),e.React.createElement(e.ReactNative.View,{style:t.sfwBadgeContainer},e.React.createElement(e.ReactNative.View,{style:t.sfwBadge},e.React.createElement(e.ReactNative.Text,{style:t.badgeText},"SFW"))))})))}const{FormSwitchRow:ke,FormRow:F}=v.Forms;function ua(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(n){return n+1},0),a=e.NavigationNative.useNavigation();return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"IP Commands",icon:o.getAssetIDByName("GlobeEarthIcon")},e.React.createElement(ke,{label:"/ip",subLabel:"Get your current IP address",leading:e.React.createElement(F.Icon,{source:o.getAssetIDByName("GlobeEarthIcon")}),value:r.storage.enabledCommands.ip,onValueChange:function(n){r.storage.enabledCommands.ip=n,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"NekosLife Commands",icon:o.getAssetIDByName("ImageIcon")},e.React.createElement(ke,{label:"/nekoslife",subLabel:"Get images/gifs from nekos.life",leading:e.React.createElement(F.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:r.storage.enabledCommands.nekoslife,onValueChange:function(n){r.storage.enabledCommands.nekoslife=n,r.storage.pendingRestart=!0,t()}}),e.React.createElement(F,{label:"View Categories",subLabel:"See all 16 available categories",leading:e.React.createElement(F.Icon,{source:o.getAssetIDByName("BookOpenIcon")}),trailing:e.React.createElement(F.Arrow,null),onPress:function(){return a.push("VendettaCustomPage",{title:"NekosLife Categories",render:da})}})),e.React.createElement(e.ReactNative.View,{style:{height:32}}))}const{FormSwitchRow:M,FormRow:Be}=v.Forms;function ga(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(a){return a+1},0);return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Message Commands",icon:o.getAssetIDByName("ChatIcon")},e.React.createElement(M,{label:"/firstmessage",subLabel:"Get the first message in a channel",leading:e.React.createElement(Be.Icon,{source:o.getAssetIDByName("ChatIcon")}),value:r.storage.enabledCommands.firstmessage,onValueChange:function(a){r.storage.enabledCommands.firstmessage=a,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"System Commands",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement(M,{label:"/sysinfo",subLabel:"Display system information",leading:e.React.createElement(Be.Icon,{source:o.getAssetIDByName("SettingsIcon")}),value:r.storage.enabledCommands.sysinfo,onValueChange:function(a){r.storage.enabledCommands.sysinfo=a,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"Friend Invites",icon:o.getAssetIDByName("UserAddIcon")},e.React.createElement(M,{label:"/invite create",subLabel:"Generate a friend invite link",value:r.storage.enabledCommands.friendInviteCreate,onValueChange:function(a){r.storage.enabledCommands.friendInviteCreate=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement(M,{label:"/view invites",subLabel:"View your current friend invites",value:r.storage.enabledCommands.friendInviteView,onValueChange:function(a){r.storage.enabledCommands.friendInviteView=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement(M,{label:"/revoke invites",subLabel:"Revoke all your friend invites",value:r.storage.enabledCommands.friendInviteRevoke,onValueChange:function(a){r.storage.enabledCommands.friendInviteRevoke=a,r.storage.pendingRestart=!0,t()}})))}const{FormSwitchRow:de,FormRow:_}=v.Forms;function fa(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(n){return n+1},0),a=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},warningText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"center",lineHeight:20,fontWeight:"600"},infoText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"center",lineHeight:20,marginTop:8}});return e.React.createElement(e.ReactNative.ScrollView,{style:a.container,contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Warning",icon:o.getAssetIDByName("WarningIcon"),padding:!0},e.React.createElement(e.ReactNative.Text,{style:a.warningText},"These are hidden commands that may contain mature content or experimental features."),e.React.createElement(e.ReactNative.Text,{style:a.infoText},"Use at your own discretion. Commands in this section are disabled by default.")),e.React.createElement(m,{title:"Hidden Commands",icon:o.getAssetIDByName("EyeIcon")},e.React.createElement(de,{label:"/lovefemboys",subLabel:"Get random femboy images from r/femboys (NSFW content available)",leading:e.React.createElement(_.Icon,{source:o.getAssetIDByName("HeartIcon")}),value:r.storage.enabledCommands.lovefemboys,onValueChange:function(n){r.storage.enabledCommands.lovefemboys=n,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"NSFW Bypass Options",icon:o.getAssetIDByName("WarningIcon")},e.React.createElement(de,{label:"KonoChan NSFW Bypass",subLabel:"Allow NSFW KonoChan content in non-NSFW channels (USE WITH CAUTION)",leading:e.React.createElement(_.Icon,{source:o.getAssetIDByName("ShieldIcon")}),value:r.storage.hiddenSettings.konochanBypassNsfw,onValueChange:function(n){n?u.alerts.showConfirmationAlert({title:"\u26A0\uFE0F NSFW Bypass Warning",content:"Enabling this allows NSFW content from KonoChan to be sent in any channel, including non-NSFW channels. This could violate server rules or Discord ToS. Use responsibly!",confirmText:"I Understand",cancelText:"Cancel",onConfirm:function(){r.storage.hiddenSettings.konochanBypassNsfw=!0,t()},onCancel:function(){}}):(r.storage.hiddenSettings.konochanBypassNsfw=!1,t())}})),e.React.createElement(m,{title:"Hidden Settings Control",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement(de,{label:"Keep Hidden Settings Visible",subLabel:"Keep this section visible even when navigating away",leading:e.React.createElement(_.Icon,{source:o.getAssetIDByName("EyeIcon")}),value:r.storage.hiddenSettings.visible,onValueChange:function(n){r.storage.hiddenSettings.visible=n}}),e.React.createElement(_,{label:"Reset Hidden Settings",subLabel:"Hide this section and disable all hidden commands",leading:e.React.createElement(_.Icon,{source:o.getAssetIDByName("TrashIcon")}),onPress:function(){u.alerts.showConfirmationAlert({title:"Reset Hidden Settings",content:"This will hide the hidden settings section and disable all hidden commands. Are you sure?",confirmText:"Reset",onConfirm:function(){r.storage.hiddenSettings.enabled=!1,r.storage.hiddenSettings.visible=!1,r.storage.hiddenSettings.konochanBypassNsfw=!1,r.storage.enabledCommands.lovefemboys=!1,r.storage.pendingRestart=!0,b.showToast("Hidden settings reset",o.getAssetIDByName("CheckmarkIcon"))},cancelText:"Cancel"})}})))}function ya(){const t=e.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},scrollContent:{paddingVertical:16,paddingHorizontal:12,alignItems:"stretch"},groupWrapper:{marginHorizontal:16,marginTop:16,maxWidth:"100%"},groupMain:{backgroundColor:u.rawColors.PLUM_18,borderColor:u.semanticColors.CARD_BACKGROUND_DEFAULT,borderWidth:1,borderRadius:16,overflow:"hidden",flex:1,maxWidth:"100%"},rippleContainer:{borderRadius:16,overflow:"hidden"},cardPressable:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:12},avatarContainer:{width:56,height:56,borderRadius:12,overflow:"hidden",backgroundColor:u.semanticColors.BACKGROUND_SECONDARY,justifyContent:"center",alignItems:"center",marginRight:12},avatar:{width:56,height:56,borderRadius:12,resizeMode:"cover"},textContainer:{flex:1,justifyContent:"center"},commandText:{fontSize:16,fontWeight:"700",color:u.semanticColors.MOBILE_TEXT_HEADING_PRIMARY,marginBottom:2},authorText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,marginBottom:6},linkText:{fontSize:13,color:u.semanticColors.LINK,fontWeight:"600"},infoText:{fontSize:14,color:u.semanticColors.TEXT_MUTED,marginBottom:20,textAlign:"center",lineHeight:20},versionText:{fontSize:15,color:u.semanticColors.TEXT_MUTED,textAlign:"center",fontWeight:"600",lineHeight:22}}),a=[{command:"Facts Commands",author:"jdev082",avatar:"https://github.com/jdev082.png",github:"https://github.com/jdev082"},{command:"List Commands",author:"Kitomanari",avatar:"https://github.com/Kitosight.png",github:"https://github.com/Kitosight"},{command:"PetPet",author:"wolfieeee",avatar:"https://github.com/WolfPlugs.png",github:"https://github.com/WolfPlugs"},{command:"KonoChan Commands",author:"btmc727 & Rico040",avatar:"https://github.com/OTKUSteyler.png",github:"https://github.com/OTKUSteyler"},{command:"FirstMessage Command",author:"sapphire",avatar:"https://github.com/aeongdesu.png",github:"https://github.com/aeongdesu"},{command:"Sysinfo Command",author:"mugman",avatar:"https://github.com/mugman174.png",github:"https://github.com/mugman174"},{command:"Spotify Commands",author:"Kitomanari",avatar:"https://github.com/Kitosight.png",github:"https://github.com/Kitosight"},{command:"Gary Command",author:"Zach Orange",avatar:"https://github.com/IAmGaryTheCat.png",github:"https://github.com/IAmGaryTheCat"},{command:"IP & NekosLife Commands",author:"scruzism",avatar:"https://github.com/scrazzz.png",github:"https://github.com/scrazzz"},{command:"FriendInvites",author:"nikosszzz",avatar:"https://github.com/nikosszzz.png",github:"https://github.com/nikosszzz"}],n=function(l){e.ReactNative.Linking.openURL(l)},i=o.getAssetIDByName("HeartIcon"),s=o.getAssetIDByName("ic_information_24px"),c=typeof i=="number"?i:void 0,d=typeof s=="number"?s:void 0;return e.React.createElement(e.ReactNative.ScrollView,{style:t.container,contentContainerStyle:t.scrollContent},e.React.createElement(m,{title:"Plugin Authors",icon:c,padding:!0},e.React.createElement(e.ReactNative.Text,{style:t.infoText},"Thanks to these developers for creating such great plugins!",` `,"Tap any developer to visit their GitHub profile.")),a.map(function(l){return e.React.createElement(e.ReactNative.View,{key:l.github,style:t.groupWrapper},e.React.createElement(e.ReactNative.View,{style:t.groupMain},e.React.createElement(e.ReactNative.View,{style:t.rippleContainer},e.React.createElement(e.ReactNative.Pressable,{style:t.cardPressable,onPress:function(){return n(l.github)},android_ripple:{color:u.semanticColors.ANDROID_RIPPLE,borderless:!1,radius:200},accessibilityRole:"button"},e.React.createElement(e.ReactNative.View,{style:t.avatarContainer},e.React.createElement(e.ReactNative.Image,{source:{uri:l.avatar},style:t.avatar})),e.React.createElement(e.ReactNative.View,{style:t.textContainer},e.React.createElement(e.ReactNative.Text,{numberOfLines:1,style:t.commandText},l.command),e.React.createElement(e.ReactNative.Text,{numberOfLines:1,style:t.authorText},"by ",l.author))))))}),e.React.createElement(m,{title:"About",icon:d,padding:!0},e.React.createElement(e.ReactNative.Text,{style:t.versionText},"Commands Plugin Collection",` -`,"Version 1.3.0")))}var xe,Pe,$e,Le,Fe,Me,_e;const{FormRow:h}=v.Forms;(xe=r.storage).factSettings??(xe.factSettings={sendAsReply:!0,includeCitation:!1}),(Pe=r.storage).listSettings??(Pe.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),($e=r.storage).garySettings??($e.garySettings={imageSource:"gary"}),(Le=r.storage).enabledCommands??(Le.enabledCommands={catfact:!0,dogfact:!0,useless:!0,petpet:!0,pluginList:!0,themeList:!0,konoself:!0,konosend:!0,firstmessage:!0,sysinfo:!0,spotifyTrack:!0,spotifyAlbum:!0,spotifyArtists:!0,spotifyCover:!0,gary:!0,ip:!0,lovefemboys:!1,nekoslife:!1,friendInviteCreate:!0,friendInviteView:!0,friendInviteRevoke:!0}),(Fe=r.storage).pendingRestart??(Fe.pendingRestart=!1),(Me=r.storage).hiddenSettings??(Me.hiddenSettings={enabled:!1,visible:!1,konochanBypassNsfw:!1}),(_e=r.storage).sidebarEnabled??(_e.sidebarEnabled=!0);function Ve(){I.useProxy(r.storage);const t=e.NavigationNative.useNavigation();return e.React.useEffect(function(){return function(){r.storage.pendingRestart&&(r.storage.pendingRestart=!1,u.alerts.showConfirmationAlert({title:"Restart Required",content:"You have made changes to commands. Please restart Discord to apply these changes.",confirmText:"Okay",cancelText:null,onConfirm:function(){}}))}},[]),e.React.createElement(e.ReactNative.View,{style:{flex:1}},e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,maxWidth:"100%"},showsVerticalScrollIndicator:!1},e.React.createElement(na,null),e.React.createElement(m,{title:"Command Categories",icon:o.getAssetIDByName("ChannelListIcon")},e.React.createElement(h,{label:"Facts Commands",subLabel:"Cat facts, dog facts, and useless facts",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("BookmarkIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Facts Commands",render:ra})}}),e.React.createElement(h,{label:"List Commands",subLabel:"Plugin lists and theme lists",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("ListViewIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"List Commands",render:ia})}}),e.React.createElement(h,{label:"Image Commands",subLabel:"PetPet, KonoChan, and image utilities",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("ImageIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Image Commands",render:sa})}}),e.React.createElement(h,{label:"Gary Commands",subLabel:`Gary images - Current: ${r.storage.garySettings.imageSource==="gary"?"Gary API":r.storage.garySettings.imageSource==="catapi"?"Cat API":r.storage.garySettings.imageSource==="minker"?"Minker API":r.storage.garySettings.imageSource==="goober"?"Goober API":"Gary API"}`,leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("CameraIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Gary Commands",render:oa})}}),e.React.createElement(h,{label:"Spotify Commands",subLabel:"Share your Spotify activity",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Spotify Commands",render:ca})}}),e.React.createElement(h,{label:"Aliucord Commands",subLabel:"Commands from Aliucord",leading:e.React.createElement(h.Icon,{source:{uri:"https://avatars.githubusercontent.com/u/78881422?s=200&v=4"}}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Aliucord",render:da})}}),e.React.createElement(h,{label:"Other Commands",subLabel:"Utility and system commands",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("WrenchIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Other Commands",render:ua})}})),r.storage.hiddenSettings?.visible&&e.React.createElement(m,{title:"Hidden Settings",icon:o.getAssetIDByName("EyeIcon")},e.React.createElement(h,{label:"Hidden Commands",subLabel:"Access to experimental and NSFW commands",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("EyeIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Hidden Settings",render:ga})}})),e.React.createElement(m,{title:"Other",icon:o.getAssetIDByName("CircleInformationIcon-primary")},e.React.createElement(h,{label:"Credits",subLabel:"View original authors of the plugins",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("HeartIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Credits",render:fa})}})),e.React.createElement(e.ReactNative.View,{style:{height:32}})))}const{FormSection:ya,FormRow:ge}=v.Forms,{TableRowIcon:pa}=p.findByProps("TableRowIcon"),V=window.bunny,Ue=V?.metro?.findByPropsLazy("getRootNavigationRef"),fe=V?.metro?.findByPropsLazy("SETTING_RENDERER_CONFIG"),We=V?.metro?.findByPropsLazy("createList"),Ge=V?.metro?.findByNameLazy("SettingsOverviewScreen",!1);function ma({tabs:t}){const a=e.NavigationNative.useNavigation();return e.React.createElement(ge,{label:t.title(),leading:e.React.createElement(ge.Icon,{source:t.icon}),trailing:e.React.createElement(e.React.Fragment,{},[t.trailing?t.trailing():null,e.React.createElement(ge.Arrow,{key:"arrow"})]),onPress:function(){const n=t.page;a.navigate("VendettaCustomPage",{title:t.title(),render:function(){return e.React.createElement(n)}})}})}function ha(t,a){try{a.push(O.after("default",V?.metro?.findByPropsLazy(["renderTitle","sections"],!1),function(n,i){const s=ie.findInReactTree(i.props.children,function(c){return c.type?.name==="UserSettingsOverview"});s&&a.push(O.after("render",s.type.prototype,function(c,d){const l=ie.findInReactTree(d.props.children,function(g){return g?.children?.[1]?.type===ya})?.children;if(l){const g=l.findIndex(function(f){return["BILLING_SETTINGS","PREMIUM_SETTINGS"].includes(f?.props?.label)});l.splice(-~g||4,0,e.React.createElement(ma,{key:t.key,tabs:t}))}}))},!0))}catch(n){He.logger.info("Panel UI patch failed graciously \u{1F494}",n)}}function Ca(t,a){if(!fe||!Ue){console.warn("[Commands Plugin] Missing required constants for tabs UI patch");return}const n={[t.key]:{type:"pressable",title:t.title,icon:t.icon,IconComponent:t.icon&&function(){return e.React.createElement(pa,{source:t.icon})},usePredicate:t.predicate,useTrailing:t.trailing,onPress:function(){const c=Ue.getRootNavigationRef(),d=t.page;c.navigate("VendettaCustomPage",{title:t.title(),render:function(){return e.React.createElement(d)}})},withArrow:!0}};let i=fe.SETTING_RENDERER_CONFIG;Object.defineProperty(fe,"SETTING_RENDERER_CONFIG",{enumerable:!0,configurable:!0,get:function(){return{...i,...n}},set:function(c){return i=c}});const s=Symbol("pinToSettings meow meow");try{if(!We)return;a.push(O.after("createList",We,function(c,d){if(!c[0][s]){c[0][s]=!0;const[l]=c,g=l.sections?.find(function(f){return["Bunny","Revenge","Kettu","Vencore","ShiggyCord"].some(function(y){return f.label===y&&f.title===y})});g?.settings&&(g.settings=[...g.settings,t.key])}}))}catch{if(!Ge)return;a.push(O.after("default",Ge,function(c,d){if(!c[0][s]){c[0][s]=!0;const{sections:l}=ie.findInReactTree(d,function(f){return f.props?.sections}).props,g=l?.find(function(f){return["Bunny","Revenge","Kettu","Vencore","ShiggyCord"].some(function(y){return f.label===y&&f.title===y})});g?.settings&&(g.settings=[...g.settings,t.key])}}))}}function ba(t){const a=[];let n=!1;const i=t.predicate||function(){return!0};return t.predicate=function(){return n?!1:i()},ha(t,a),Ca(t,a),a.push(function(){return n=!0}),function(){for(const s of a)s()}}function Ra(){if(r.storage.sidebarEnabled===!1)return console.log("[Commands Plugin] Sidebar disabled in settings"),function(){};console.log("[Commands Plugin] Patching sidebar...");try{const t=ba({key:"CommandsPlugin",icon:o.getAssetIDByName("SettingsIcon"),title:function(){return"Commands"},predicate:function(){return r.storage.sidebarEnabled!==!1},page:Ve});return console.log("[Commands Plugin] Successfully patched sidebar"),t}catch(t){return console.error("[Commands Plugin] Failed to patch sidebar:",t),function(){}}}r.storage.factSettings||(r.storage.factSettings={sendAsReply:!0,includeCitation:!1}),r.storage.listSettings||(r.storage.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),r.storage.garySettings||(r.storage.garySettings={imageSource:"gary"}),r.storage.enabledCommands||(r.storage.enabledCommands={catfact:!0,dogfact:!0,useless:!0,petpet:!0,pluginList:!0,themeList:!0,konoself:!0,konosend:!0,firstmessage:!0,sysinfo:!0,spotifyTrack:!0,spotifyAlbum:!0,spotifyArtists:!0,spotifyCover:!0,gary:!0,ip:!0,lovefemboys:!1,nekoslife:!1,friendInviteCreate:!0,friendInviteView:!0,friendInviteRevoke:!0}),r.storage.hiddenSettings||(r.storage.hiddenSettings={enabled:!1,visible:!1,konochanBypassNsfw:!1}),r.storage.sidebarEnabled===void 0&&(r.storage.sidebarEnabled=!0);const va={catfact:Qe,dogfact:Ze,useless:et,petpet:dt,pluginList:st,themeList:ot,konoself:ft,konosend:yt,firstmessage:Ct,sysinfo:At,spotifyTrack:Pt,spotifyAlbum:$t,spotifyArtists:Lt,spotifyCover:Ft,gary:_t,ip:jt,lovefemboys:Gt,nekoslife:Jt,friendInviteCreate:ea,friendInviteView:ta,friendInviteRevoke:aa};let ye=[],te;var Ia={onLoad:function(){if(console.log("[Commands Plugin] Loading..."),r.storage.sidebarEnabled!==!1)try{te=Ra(),console.log("[Commands Plugin] Sidebar patched successfully")}catch(t){console.error("[Commands Plugin] Failed to patch sidebar:",t)}for(const[t,a]of Object.entries(va))if(r.storage.enabledCommands[t])try{ye.push(ze.registerCommand(a)),console.log(`[Commands Plugin] Registered command: ${t}`)}catch(n){console.error(`[Commands Plugin] Failed to register command ${t}:`,n)}},onUnload:function(){if(console.log("[Commands Plugin] Unloading..."),ye.forEach(function(t){try{t()}catch{}}),ye=[],te)try{te(),te=void 0,console.log("[Commands Plugin] Sidebar unpatched")}catch(t){console.error("[Commands Plugin] Failed to unpatch sidebar:",t)}},settings:Ve};return re.default=Ia,Object.defineProperty(re,"__esModule",{value:!0}),re})({},vendetta.commands,vendetta.plugin,vendetta.metro,vendetta.themes,vendetta.plugins,vendetta.ui,vendetta.metro.common,vendetta.debug,vendetta.ui.toasts,vendetta.ui.assets,vendetta.storage,vendetta.ui.components,vendetta.patcher,vendetta.utils,vendetta); +`,"Version 1.3.0")))}var xe,Pe,$e,Le,Fe,Me,_e;const{FormRow:h}=v.Forms;(xe=r.storage).factSettings??(xe.factSettings={sendAsReply:!0,includeCitation:!1}),(Pe=r.storage).listSettings??(Pe.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),($e=r.storage).garySettings??($e.garySettings={imageSource:"gary"}),(Le=r.storage).enabledCommands??(Le.enabledCommands={catfact:!0,dogfact:!0,useless:!0,petpet:!0,pluginList:!0,themeList:!0,konoself:!0,konosend:!0,firstmessage:!0,sysinfo:!0,spotifyTrack:!0,spotifyAlbum:!0,spotifyArtists:!0,spotifyCover:!0,gary:!0,ip:!0,lovefemboys:!1,nekoslife:!1,friendInviteCreate:!0,friendInviteView:!0,friendInviteRevoke:!0}),(Fe=r.storage).pendingRestart??(Fe.pendingRestart=!1),(Me=r.storage).hiddenSettings??(Me.hiddenSettings={enabled:!1,visible:!1,konochanBypassNsfw:!1}),(_e=r.storage).sidebarEnabled??(_e.sidebarEnabled=!0);function Ve(){I.useProxy(r.storage);const t=e.NavigationNative.useNavigation();return e.React.useEffect(function(){return function(){r.storage.pendingRestart&&(r.storage.pendingRestart=!1,u.alerts.showConfirmationAlert({title:"Restart Required",content:"You have made changes to commands. Please restart Discord to apply these changes.",confirmText:"Okay",cancelText:null,onConfirm:function(){}}))}},[]),e.React.createElement(e.ReactNative.View,{style:{flex:1}},e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,maxWidth:"100%"},showsVerticalScrollIndicator:!1},e.React.createElement(ra,null),e.React.createElement(m,{title:"Command Categories",icon:o.getAssetIDByName("ChannelListIcon")},e.React.createElement(h,{label:"Facts Commands",subLabel:"Cat facts, dog facts, and useless facts",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("BookmarkIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Facts Commands",render:ia})}}),e.React.createElement(h,{label:"List Commands",subLabel:"Plugin lists and theme lists",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("ListViewIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"List Commands",render:sa})}}),e.React.createElement(h,{label:"Image Commands",subLabel:"PetPet, KonoChan, and image utilities",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("ImageIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Image Commands",render:oa})}}),e.React.createElement(h,{label:"Gary Commands",subLabel:`Gary images - Current: ${r.storage.garySettings.imageSource==="gary"?"Gary API":r.storage.garySettings.imageSource==="catapi"?"Cat API":r.storage.garySettings.imageSource==="minker"?"Minker API":r.storage.garySettings.imageSource==="goober"?"Goober API":"Gary API"}`,leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("CameraIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Gary Commands",render:ca})}}),e.React.createElement(h,{label:"Spotify Commands",subLabel:"Share your Spotify activity",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Spotify Commands",render:la})}}),e.React.createElement(h,{label:"Aliucord Commands",subLabel:"Commands from Aliucord",leading:e.React.createElement(h.Icon,{source:{uri:"https://avatars.githubusercontent.com/u/78881422?s=200&v=4"}}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Aliucord",render:ua})}}),e.React.createElement(h,{label:"Other Commands",subLabel:"Utility and system commands",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("WrenchIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Other Commands",render:ga})}})),r.storage.hiddenSettings?.visible&&e.React.createElement(m,{title:"Hidden Settings",icon:o.getAssetIDByName("EyeIcon")},e.React.createElement(h,{label:"Hidden Commands",subLabel:"Access to experimental and NSFW commands",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("EyeIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Hidden Settings",render:fa})}})),e.React.createElement(m,{title:"Other",icon:o.getAssetIDByName("CircleInformationIcon-primary")},e.React.createElement(h,{label:"Credits",subLabel:"View original authors of the plugins",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("HeartIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Credits",render:ya})}})),e.React.createElement(e.ReactNative.View,{style:{height:32}})))}const{FormSection:pa,FormRow:ue}=v.Forms,{TableRowIcon:ma}=p.findByProps("TableRowIcon"),V=window.bunny,Ue=V?.metro?.findByPropsLazy("getRootNavigationRef"),ge=V?.metro?.findByPropsLazy("SETTING_RENDERER_CONFIG"),We=V?.metro?.findByPropsLazy("createList"),Ge=V?.metro?.findByNameLazy("SettingsOverviewScreen",!1);function ha({tabs:t}){const a=e.NavigationNative.useNavigation();return e.React.createElement(ue,{label:t.title(),leading:e.React.createElement(ue.Icon,{source:t.icon}),trailing:e.React.createElement(e.React.Fragment,{},[t.trailing?t.trailing():null,e.React.createElement(ue.Arrow,{key:"arrow"})]),onPress:function(){const n=t.page;a.navigate("VendettaCustomPage",{title:t.title(),render:function(){return e.React.createElement(n)}})}})}function Ca(t,a){try{a.push(G.after("default",V?.metro?.findByPropsLazy(["renderTitle","sections"],!1),function(n,i){const s=re.findInReactTree(i.props.children,function(c){return c.type?.name==="UserSettingsOverview"});s&&a.push(G.after("render",s.type.prototype,function(c,d){const l=re.findInReactTree(d.props.children,function(g){return g?.children?.[1]?.type===pa})?.children;if(l){const g=l.findIndex(function(f){return["BILLING_SETTINGS","PREMIUM_SETTINGS"].includes(f?.props?.label)});l.splice(-~g||4,0,e.React.createElement(ha,{key:t.key,tabs:t}))}}))},!0))}catch(n){Ke.logger.info("Panel UI patch failed graciously \u{1F494}",n)}}function ba(t,a){if(!ge||!Ue){console.warn("[Commands Plugin] Missing required constants for tabs UI patch");return}const n={[t.key]:{type:"pressable",title:t.title,icon:t.icon,IconComponent:t.icon&&function(){return e.React.createElement(ma,{source:t.icon})},usePredicate:t.predicate,useTrailing:t.trailing,onPress:function(){const c=Ue.getRootNavigationRef(),d=t.page;c.navigate("VendettaCustomPage",{title:t.title(),render:function(){return e.React.createElement(d)}})},withArrow:!0}};let i=ge.SETTING_RENDERER_CONFIG;Object.defineProperty(ge,"SETTING_RENDERER_CONFIG",{enumerable:!0,configurable:!0,get:function(){return{...i,...n}},set:function(c){return i=c}});const s=Symbol("pinToSettings meow meow");try{if(!We)return;a.push(G.after("createList",We,function(c,d){if(!c[0][s]){c[0][s]=!0;const[l]=c,g=l.sections?.find(function(f){return["Bunny","Revenge","Kettu","Vencore","ShiggyCord"].some(function(y){return f.label===y&&f.title===y})});g?.settings&&(g.settings=[...g.settings,t.key])}}))}catch{if(!Ge)return;a.push(G.after("default",Ge,function(c,d){if(!c[0][s]){c[0][s]=!0;const{sections:l}=re.findInReactTree(d,function(f){return f.props?.sections}).props,g=l?.find(function(f){return["Bunny","Revenge","Kettu","Vencore","ShiggyCord"].some(function(y){return f.label===y&&f.title===y})});g?.settings&&(g.settings=[...g.settings,t.key])}}))}}function Ra(t){const a=[];let n=!1;const i=t.predicate||function(){return!0};return t.predicate=function(){return n?!1:i()},Ca(t,a),ba(t,a),a.push(function(){return n=!0}),function(){for(const s of a)s()}}function va(){if(r.storage.sidebarEnabled===!1)return console.log("[Commands Plugin] Sidebar disabled in settings"),function(){};console.log("[Commands Plugin] Patching sidebar...");try{const t=Ra({key:"CommandsPlugin",icon:o.getAssetIDByName("SettingsIcon"),title:function(){return"Commands"},predicate:function(){return r.storage.sidebarEnabled!==!1},page:Ve});return console.log("[Commands Plugin] Successfully patched sidebar"),t}catch(t){return console.error("[Commands Plugin] Failed to patch sidebar:",t),function(){}}}r.storage.factSettings||(r.storage.factSettings={sendAsReply:!0,includeCitation:!1}),r.storage.listSettings||(r.storage.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),r.storage.garySettings||(r.storage.garySettings={imageSource:"gary"}),r.storage.enabledCommands||(r.storage.enabledCommands={catfact:!0,dogfact:!0,useless:!0,petpet:!0,pluginList:!0,themeList:!0,konoself:!0,konosend:!0,firstmessage:!0,sysinfo:!0,spotifyTrack:!0,spotifyAlbum:!0,spotifyArtists:!0,spotifyCover:!0,gary:!0,ip:!0,lovefemboys:!1,nekoslife:!1,friendInviteCreate:!0,friendInviteView:!0,friendInviteRevoke:!0}),r.storage.hiddenSettings||(r.storage.hiddenSettings={enabled:!1,visible:!1,konochanBypassNsfw:!1}),r.storage.sidebarEnabled===void 0&&(r.storage.sidebarEnabled=!0);const Ia={catfact:Ze,dogfact:et,useless:tt,petpet:ut,pluginList:ot,themeList:ct,konoself:yt,konosend:pt,firstmessage:bt,sysinfo:Tt,spotifyTrack:$t,spotifyAlbum:Lt,spotifyArtists:Ft,spotifyCover:Mt,gary:Vt,ip:Ht,lovefemboys:Ot,nekoslife:Qt,friendInviteCreate:ta,friendInviteView:aa,friendInviteRevoke:na};let fe=[],ee;var wa={onLoad:function(){if(console.log("[Commands Plugin] Loading..."),r.storage.sidebarEnabled!==!1)try{ee=va(),console.log("[Commands Plugin] Sidebar patched successfully")}catch(t){console.error("[Commands Plugin] Failed to patch sidebar:",t)}for(const[t,a]of Object.entries(Ia))if(r.storage.enabledCommands[t])try{fe.push(He.registerCommand(a)),console.log(`[Commands Plugin] Registered command: ${t}`)}catch(n){console.error(`[Commands Plugin] Failed to register command ${t}:`,n)}},onUnload:function(){if(console.log("[Commands Plugin] Unloading..."),fe.forEach(function(t){try{t()}catch{}}),fe=[],ee)try{ee(),ee=void 0,console.log("[Commands Plugin] Sidebar unpatched")}catch(t){console.error("[Commands Plugin] Failed to unpatch sidebar:",t)}},settings:Ve};return ne.default=wa,Object.defineProperty(ne,"__esModule",{value:!0}),ne})({},vendetta.commands,vendetta.plugin,vendetta.metro,vendetta.themes,vendetta.plugins,vendetta.ui,vendetta.metro.common,vendetta.debug,vendetta.ui.toasts,vendetta.ui.assets,vendetta.storage,vendetta.ui.components,vendetta.patcher,vendetta.utils,vendetta); diff --git a/Commands/manifest.json b/Commands/manifest.json index 99a9e96..6b68fb4 100644 --- a/Commands/manifest.json +++ b/Commands/manifest.json @@ -1 +1 @@ -{"authors":[{"name":"kmmiio99o","id":"879393496627306587"}],"main":"index.js","vendetta":{"icon":"ic_badge_staff","original":"plugins/all-in-one"},"name":"Commands","description":"A collection of fixed commands including facts, petpet, and more.","version":"1.0.0","hash":"68ba57347171e6f89e402339c78da49080c396ad7cee67f2edfbd29289198fc3"} \ No newline at end of file +{"authors":[{"name":"kmmiio99o","id":"879393496627306587"}],"main":"index.js","vendetta":{"icon":"ic_badge_staff","original":"plugins/all-in-one"},"name":"Commands","description":"A collection of fixed commands including facts, petpet, and more.","version":"1.0.0","hash":"1e088d3859005de115f089259500a2b4aa533cd964da45edb99fe95da0a64c12"} \ No newline at end of file diff --git a/multi-scrobbler/index.js b/multi-scrobbler/index.js index 110d0e1..b6b61be 100644 --- a/multi-scrobbler/index.js +++ b/multi-scrobbler/index.js @@ -1 +1 @@ -(function(G,p,r,z,Dt,D,re,T,v,H,rt,ne){"use strict";const h={DEFAULT_APP_NAME:"Music",DEFAULT_TIME_INTERVAL:5,APPLICATION_ID:"1368513179272871956",MIN_UPDATE_INTERVAL:3,MAX_RETRY_ATTEMPTS:3,RETRY_DELAY:5e3,SERVICES:{lastfm:{name:"Last.fm",baseUrl:"https://ws.audioscrobbler.com/2.0",requiresApiKey:!0,requiresToken:!1},librefm:{name:"Libre.fm",baseUrl:"https://libre.fm/api",requiresApiKey:!0,requiresToken:!1},listenbrainz:{name:"ListenBrainz",baseUrl:"https://api.listenbrainz.org/1",requiresApiKey:!1,requiresToken:!0}},DEFAULT_HEADERS:{},DEFAULT_COVER_HASHES:["2a96cbd8b46e442fc41c2b86b821562f"],DEFAULT_SETTINGS:{username:"",apiKey:"",appName:"Music",timeInterval:5,showTimestamp:!0,listeningTo:!0,service:void 0,librefmUsername:"",librefmApiKey:"",listenbrainzUsername:"",listenbrainzToken:""},API_ERROR_CODES:{2:"Invalid service",3:"Invalid method",4:"Invalid format",5:"Invalid parameters",6:"Invalid resource specified",7:"Invalid session key",8:"Invalid API key",9:"Invalid session",10:"Invalid API signature",11:"Service offline",13:"Invalid method signature supplied",16:"Service temporarily unavailable",26:"Suspended API key",29:"Rate limit exceeded"}};function M(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ve(e,t){for(var n=0;n10&&(w.serviceErrors[e]=w.serviceErrors[e].slice(-10)),Se(`${e} error:`,t)}function Ie(){w.lastSuccessfulUpdate=new Date().toISOString(),Q("Successful update recorded at:",w.lastSuccessfulUpdate)}function Z(e){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Z(e)}function ke(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ke=function(){return!!e})()}function ot(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lt(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function ct(e,t){return t&&(lt(t)==="object"||typeof t=="function")?t:ot(e)}function se(e,t,n){return t=Z(t),ct(e,ke()?Reflect.construct(t,n||[],Z(e).constructor):t.apply(e,n))}function oe(e,t){return oe=Object.setPrototypeOf||function(a,s){return a.__proto__=s,a},oe(e,t)}function le(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&&oe(e,t)}let ce=(function(){function e(){M(this,e)}return B(e,[{key:"log",value:function(...t){console.log(`[${this.getServiceName()}]`,...t)}},{key:"logError",value:function(...t){console.error(`[${this.getServiceName()}] Error:`,...t)}},{key:"logVerbose",value:function(...t){console.log(`[${this.getServiceName()}] Verbose:`,...t)}},{key:"handleError",value:async function(t){this.lastError=t.error||0;const n=this.getErrorMessage(t);throw this.logError(n),J(this.getServiceName().toLowerCase(),n),new Error(`${this.getServiceName()} API Error: ${n}`)}},{key:"getErrorMessage",value:function(t){return t.error&&h.API_ERROR_CODES[t.error]?h.API_ERROR_CODES[t.error]:t.message||t.toString()||"Unknown error"}},{key:"makeRequest",value:async function(t,n={}){try{this.logVerbose(`Making request to: ${t}`),Te();const a=await fetch(t,{...n,headers:{"User-Agent":"Vendetta Multi-Service Scrobbler/3.0.0",...n.headers}});if(!a.ok){const i=new Error(`HTTP ${a.status}: ${a.statusText}`);throw J(this.getServiceName().toLowerCase(),i.message),i}const s=await a.json();return s.error&&await this.handleError(s),this.retryCount=0,s}catch(a){if(this.retryCount++,this.retryCount>h.MAX_RETRY_ATTEMPTS)throw this.retryCount=0,J(this.getServiceName().toLowerCase(),`Max retries exceeded: ${a.message}`),a;return this.logVerbose(`Request failed, retrying (${this.retryCount}/${h.MAX_RETRY_ATTEMPTS})`),await new Promise(function(s){return setTimeout(s,h.RETRY_DELAY)}),this.makeRequest(t,n)}}},{key:"isDefaultCover",value:function(t){return t?h.DEFAULT_COVER_HASHES.some(function(n){return t.includes(n)}):!0}},{key:"processAlbumArt",value:function(t){return!t||this.isDefaultCover(t)?null:t}},{key:"getLastError",value:function(){return this.lastError}},{key:"resetRetryCount",value:function(){this.retryCount=0}}]),e})(),ut=(function(e){le(t,e);function t(){return M(this,t),se(this,t,arguments)}return B(t,[{key:"getServiceName",value:function(){return"Last.fm"}},{key:"logVerbose",value:function(...n){o.verboseLogging&&console.log(`[${this.getServiceName()}] Verbose:`,...n)}},{key:"validateCredentials",value:async function(){try{if(!o.username||!o.apiKey)throw new Error("Username or API key not set");const n=new URLSearchParams({method:"user.getinfo",user:o.username,api_key:o.apiKey,format:"json"}),a=`${h.SERVICES.lastfm.baseUrl}?${n}`;return await this.makeRequest(a),this.log("Credentials validation successful"),!0}catch(n){return this.logError("Credentials validation failed:",n),!1}}},{key:"fetchLatestScrobble",value:async function(){try{if(!o.username||!o.apiKey)throw new Error("Username or API key not set");this.logVerbose("Fetching latest scrobble for user:",o.username);const n=new URLSearchParams({method:"user.getrecenttracks",user:o.username,api_key:o.apiKey,limit:"1",extended:"1",format:"json"}),a=`${h.SERVICES.lastfm.baseUrl}?${n}`,s=(await this.makeRequest(a))?.recenttracks?.track?.[0];if(!s)throw new Error("No tracks found");this.logVerbose("Raw track data:",s);const i=!!s["@attr"]?.nowplaying,u=s.date?.uts?parseInt(s.date.uts):Math.floor(Date.now()/1e3);let g=null,f=null;if(i)try{const L=new URLSearchParams({method:"track.getInfo",track:s.name,artist:s.artist.name,api_key:o.apiKey,format:"json"}),C=`${h.SERVICES.lastfm.baseUrl}?${L}`,A=await this.makeRequest(C);A?.track?.duration&&(g=parseInt(A.track.duration),g>0&&(g=Math.floor(g/1e3),f=u+g))}catch(L){this.logVerbose("Failed to fetch track duration:",L)}const b=this.processAlbumArt(s.image?.find(function(L){return L.size==="large"})?.["#text"]),k={name:s.name,artist:s.artist.name,album:s.album["#text"],albumArt:b,url:s.url,date:s.date?.["#text"]??"now",nowPlaying:i,loved:s.loved==="1",from:u,to:f,duration:g};return this.logVerbose("Processed track:",k),this.log(`${i?"Now playing":"Last played"}:`,`${k.artist} - ${k.name}`),k}catch(n){throw this.logError("Failed to fetch latest scrobble:",n),n}}}]),t})(ce),gt=(function(e){le(t,e);function t(){return M(this,t),se(this,t,arguments)}return B(t,[{key:"getServiceName",value:function(){return"Libre.fm"}},{key:"logVerbose",value:function(...n){o.verboseLogging&&console.log(`[${this.getServiceName()}] Verbose:`,...n)}},{key:"validateCredentials",value:async function(){try{const n=o.librefmUsername,a=o.librefmApiKey;if(!n||!a)throw new Error("Username or API key not set for Libre.fm");const s=new URLSearchParams({method:"user.getinfo",user:n,api_key:a,format:"json"}),i=`${h.SERVICES.librefm.baseUrl}?${s}`;return await this.makeRequest(i),this.log("Credentials validation successful"),!0}catch(n){return this.logError("Credentials validation failed:",n),!1}}},{key:"fetchLatestScrobble",value:async function(){try{const n=o.librefmUsername,a=o.librefmApiKey;if(!n||!a)throw new Error("Username or API key not set for Libre.fm");this.logVerbose("Fetching latest scrobble for user:",n);const s=new URLSearchParams({method:"user.getrecenttracks",user:n,api_key:a,limit:"1",extended:"1",format:"json"}),i=`${h.SERVICES.librefm.baseUrl}?${s}`,u=(await this.makeRequest(i))?.recenttracks?.track?.[0];if(!u)throw new Error("No tracks found");this.logVerbose("Raw track data:",u);const g=!!u["@attr"]?.nowplaying,f=u.date?.uts?parseInt(u.date.uts):Math.floor(Date.now()/1e3);let b=null,k=null;if(g)try{const A=new URLSearchParams({method:"track.getInfo",track:u.name,artist:u.artist.name,api_key:a,format:"json"}),U=`${h.SERVICES.librefm.baseUrl}?${A}`,te=await this.makeRequest(U);te?.track?.duration&&(b=parseInt(te.track.duration),b>0&&(b=Math.floor(b/1e3),k=f+b))}catch(A){this.logVerbose("Failed to fetch track duration:",A)}const L=this.processAlbumArt(u.image?.find(function(A){return A.size==="large"})?.["#text"]),C={name:u.name,artist:u.artist.name,album:u.album["#text"],albumArt:L,url:u.url,date:u.date?.["#text"]??"now",nowPlaying:g,loved:u.loved==="1",from:f,to:k,duration:b};return this.logVerbose("Processed track:",C),this.log(`${g?"Now playing":"Last played"}:`,`${C.artist} - ${C.name}`),C}catch(n){throw this.logError("Failed to fetch latest scrobble:",n),n}}}]),t})(ce),ft=(function(e){le(t,e);function t(){return M(this,t),se(this,t,arguments)}return B(t,[{key:"getServiceName",value:function(){return"ListenBrainz"}},{key:"logVerbose",value:function(...n){o.verboseLogging&&console.log(`[${this.getServiceName()}] Verbose:`,...n)}},{key:"validateCredentials",value:async function(){try{const n=o.listenbrainzUsername,a=o.listenbrainzToken;if(!n)throw new Error("Username not set for ListenBrainz");const s=`${h.SERVICES.listenbrainz.baseUrl}/user/${encodeURIComponent(n)}/listens?count=1`,i={};return a&&(i.Authorization=`Token ${a}`),await this.makeRequest(s,{headers:i}),this.log("Credentials validation successful"),!0}catch(n){return this.logError("Credentials validation failed:",n),!1}}},{key:"fetchLatestScrobble",value:async function(){try{const n=o.listenbrainzUsername,a=o.listenbrainzToken;if(!n)throw new Error("Username not set for ListenBrainz");this.logVerbose("Fetching latest scrobble for user:",n);let s=null;try{const C=`${h.SERVICES.listenbrainz.baseUrl}/user/${encodeURIComponent(n)}/playing-now`,A={};a&&(A.Authorization=`Token ${a}`);const U=await this.makeRequest(C,{headers:A});U.listens&&U.listens.length>0&&(s=U.listens[0],s.playing_now=!0)}catch(C){this.logVerbose("No currently playing track or failed to fetch:",C)}let i;if(s)i=s,this.logVerbose("Using currently playing track");else{const C=`${h.SERVICES.listenbrainz.baseUrl}/user/${encodeURIComponent(n)}/listens?count=1`,A={};a&&(A.Authorization=`Token ${a}`);const U=await this.makeRequest(C,{headers:A});if(!U.listens||U.listens.length===0)throw new Error("No listens found");i=U.listens[0],this.logVerbose("Using latest completed listen")}this.logVerbose("Raw listen data:",i);const u=!!i.playing_now,g=i.listened_at||Math.floor(Date.now()/1e3);let f=null,b=null;i.track_metadata.additional_info?.duration_ms&&(f=Math.floor(i.track_metadata.additional_info.duration_ms/1e3),u&&f>0&&(b=g+f));const k=null;i.track_metadata.additional_info?.release_mbid;const L={name:i.track_metadata.track_name,artist:i.track_metadata.artist_name,album:i.track_metadata.release_name||"",albumArt:k,url:i.track_metadata.additional_info?.origin_url||`https://listenbrainz.org/user/${n}`,date:u?"now":new Date(g*1e3).toISOString(),nowPlaying:u,loved:!1,from:g,to:b,duration:f};return this.logVerbose("Processed track:",L),this.log(`${u?"Now playing":"Last played"}:`,`${L.artist} - ${L.name}`),L}catch(n){throw this.logError("Failed to fetch latest listen:",n),n}}},{key:"getErrorMessage",value:function(n){return n.error?n.error:n.message?n.message:n.toString()||"Unknown error"}}]),t})(ce);const x=(function(){function e(){M(this,e),this.serviceInstances=new Map}return B(e,[{key:"getService",value:function(t){this.serviceInstances||(this.serviceInstances=new Map);const n=t||o.service;if(!n)throw new Error("[ServiceFactory] No service type specified and no default service configured");return this.serviceInstances.has(n)||this.serviceInstances.set(n,this.createService(n)),this.serviceInstances.get(n)}},{key:"getCurrentService",value:function(){return this.getService(o.service)}},{key:"createService",value:function(t){switch(t){case"lastfm":return new ut;case"librefm":return new gt;case"listenbrainz":return new ft;default:throw new Error(`[ServiceFactory] Unknown service type: ${t}`)}}},{key:"clearCache",value:function(){this.serviceInstances?this.serviceInstances.clear():this.serviceInstances=new Map}},{key:"validateCurrentService",value:function(){return this.getCurrentService().validateCredentials()}},{key:"testService",value:async function(t){try{return await this.getService(t).validateCredentials()}catch(n){return console.error(`[ServiceFactory] Failed to test ${t}:`,n),!1}}},{key:"getSupportedServices",value:function(){return["lastfm","librefm","listenbrainz"]}},{key:"getServiceDisplayName",value:function(t){return this.getService(t).getServiceName()}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e})().getInstance();function Le(e){if(!e||e<0)return"0:00";const t=Math.floor(e/3600),n=Math.floor(e%3600/60),a=Math.floor(e%60);return t>0?`${t}:${n.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`:`${n}:${a.toString().padStart(2,"0")}`}function Ae(){return Math.floor(Date.now()/1e3)}var dt=(function(e){return e[e.PLAYING=0]="PLAYING",e[e.STREAMING=1]="STREAMING",e[e.LISTENING=2]="LISTENING",e[e.COMPETING=5]="COMPETING",e})(dt||{});const N=function(...e){return console.log("[Scrobble Plugin]",...e)},K=function(...e){return console.error("[Scrobble Plugin] Error:",...e)},$=function(...e){return o.verboseLogging&&console.log("[Scrobble Plugin] Verbose:",...e)},ue=(function(){function e(){M(this,e)}return B(e,[{key:"updateActivity",value:async function(){if(S.pluginStopped){$("Plugin is stopped, skipping update"),this.stopUpdates();return}const t=x.getCurrentService().getServiceName();$(`Fetching latest track from ${t}...`);let n=!1;try{if(o.ignoreList&&o.ignoreList.length>0){const u=at.findActivity(function(g){return g.name?o.ignoreList.some(function(f){return g.name.toLowerCase().includes(f.toLowerCase())}):!1});if(u){$(`Ignored app (${u.name}) is currently playing, clearing activity`),ae();return}}Te();const a=await x.getCurrentService().fetchLatestScrobble();if(ie("lastTrack",a),!a.nowPlaying){$("Track is not currently playing"),ae();return}if(S.lastTrackUrl===a.url){$("Track hasn't changed"),Ie(),this.consecutiveFailures=0;return}n=!0,N(`\u{1F3B5} Track changed: ${a.artist} - ${a.name}`);let s;if(a.nowPlaying&&o.showTimestamp&&a.from){const u=Ae();let g=a.from;if(g0){const f=Math.min(a.duration*.1,30);g=u-f}else g=u;$("had to estimate start time")}s={start:g*1e3},a.to&&(s.end=a.to*1e3)}$(`\u{1F3AF} Preparing RPC update for: ${a.artist} - ${a.name}`);const i={name:o.appName||h.DEFAULT_APP_NAME,flags:0,type:o.listeningTo?2:0,details:a.name,state:`${a.artist}`,status_display_type:1,application_id:h.APPLICATION_ID};if(i.name.includes("{{")){const u={artist:a.artist,name:a.name,album:a.album,service:t};for(const[g,f]of Object.entries(u))i.name=i.name.replace(new RegExp(`{{${g}}}`,"g"),f||"")}if(s&&(i.timestamps=s,$("Timestamps set:",{start:new Date(s.start).toISOString(),end:s.end?new Date(s.end).toISOString():"none",duration:a.duration?Le(a.duration):"unknown"})),a.album||a.albumArt){const u=a.albumArt?[a.albumArt]:[];let g=(await st(u))[0];if(g){if(i.assets={large_image:g},o.showLargeText){let f="";if(o.showAlbumInTooltip&&a.album&&(f+=`on ${a.album}`),o.showDurationInTooltip&&a.duration){const b=Le(a.duration);f?f+=` \u2022 ${b}`:f=b}f&&(i.assets.large_text=f)}$("Album art set:",g),i.assets.large_text&&$("Tooltip text set:",i.assets.large_text)}else a.album&&o.showLargeText&&o.showAlbumInTooltip&&(i.assets={large_text:`on ${a.album}`})}$("Setting Discord activity:",i),ie("lastActivity",i),await Ee(i),S.lastTrackUrl=a.url,this.currentActivity=i,S.lastActivity=i,this.consecutiveFailures=0,this.lastUpdateTime=Ae(),Ie(),N(`\u2705 RPC updated successfully: ${a.artist} - ${a.name}`)}catch(a){K("Update failed:",a),J(o.service,a.message),this.handleError(a)}}},{key:"handleError",value:function(t){this.consecutiveFailures++,ie("lastError",t),K(`Failure ${this.consecutiveFailures}/${h.MAX_RETRY_ATTEMPTS}:`,t.message),this.consecutiveFailures>=h.MAX_RETRY_ATTEMPTS&&(K("Max retry attempts reached, initiating reconnection..."),this.startReconnection())}},{key:"startReconnection",value:function(){var t=this;this.isReconnecting||(this.isReconnecting=!0,this.stopUpdates(),N("Starting reconnection process..."),this.reconnectTimer=setInterval(function(){N("Attempting to reconnect..."),t.initialize().then(function(){N("Reconnection successful!"),t.stopReconnection()}).catch(function(n){K("Reconnection attempt failed:",n.message)})},h.RETRY_DELAY))}},{key:"stopReconnection",value:function(){try{this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=void 0),this.isReconnecting=!1,this.consecutiveFailures=0}catch(t){console.error("[Scrobble Plugin] Reconnection cleanup error:",t)}}},{key:"stopUpdates",value:function(){try{this.updateTimer&&(clearInterval(this.updateTimer),this.updateTimer=void 0)}catch(t){console.error("[Scrobble Plugin] Timer cleanup error:",t)}}},{key:"initialize",value:async function(){var t=this;if(S.pluginStopped)throw new Error("Plugin is stopped");const n=x.getCurrentService().getServiceName();N(`Initializing with ${n}...`);try{if(!await x.validateCurrentService())throw new Error(`Invalid credentials for ${n}`);N(`${n} credentials validated successfully`)}catch(s){throw K(`Failed to validate ${n} credentials:`,s),s}this.stopUpdates(),N("\u{1F3B5} checking for already playing songs..."),await this.updateActivity();const a=Math.max((Number(o.timeInterval)||h.DEFAULT_SETTINGS.timeInterval)*1e3,h.MIN_UPDATE_INTERVAL*1e3);this.updateTimer=setInterval(function(){return t.updateActivity()},a),N(`Update timer started with interval: ${a}ms (${a/1e3}s)`)}},{key:"stop",value:function(){if(!S.pluginStopped){N("Stopping plugin..."),S.pluginStopped=!0;try{this.stopUpdates(),this.stopReconnection(),ae(),N("Plugin stopped successfully")}catch(t){console.error("[Scrobble Plugin] Stop error:",t)}}}},{key:"switchService",value:async function(t){if(S.pluginStopped)return;N(`Switching to ${t}...`);const n=!S.pluginStopped;this.stop();try{x.clearCache(),S.lastTrackUrl=void 0,this.currentActivity=void 0,this.lastUpdateTime=0,n&&(S.pluginStopped=!1,await this.initialize())}catch(a){K("Failed to switch service:",a)}}},{key:"getStatus",value:function(){const t=x.getCurrentService().getServiceName();return{running:!S.pluginStopped,service:t,consecutiveFailures:this.consecutiveFailures,isReconnecting:this.isReconnecting,lastTrackUrl:S.lastTrackUrl,updateInterval:this.updateTimer?"Active":"Inactive"}}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e})().getInstance(),pt=function(){return ue.initialize()},ge=function(){return ue.stop()},ht=function(e){return ue.switchService(e)},{ScrollView:F}=z.findByProps("ScrollView"),{TableRowGroup:E,TableSwitchRow:Ce,TableCheckboxRow:j,Stack:P,TableRow:c}=z.findByProps("TableSwitchRow","TableCheckboxRow","TableRowGroup","Stack","TableRow"),{TextInput:_}=z.findByProps("TextInput");function bt(){D.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(n){return n+1},0),t=async function(){T.showToast("Testing Last.fm connection...",v.getAssetIDByName("ClockIcon"));try{await Y.testService("lastfm")?T.showToast("\u2705 Last.fm connection successful!",v.getAssetIDByName("CheckIcon")):T.showToast("\u274C Last.fm connection failed",v.getAssetIDByName("XIcon"))}catch{T.showToast("\u274C Connection error",v.getAssetIDByName("XIcon"))}};return r.React.createElement(F,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"Credentials"},r.React.createElement(P,{spacing:4},r.React.createElement(_,{placeholder:"Last.fm Username",value:l("username"),onChange:function(n){I("username",n),e()},isClearable:!0}),r.React.createElement(_,{placeholder:"Last.fm API Key",value:l("apiKey"),onChange:function(n){I("apiKey",n),e()},secureTextEntry:!0,isClearable:!0}))),r.React.createElement(E,{title:"Actions"},r.React.createElement(c,{label:"Test Connection",subLabel:"Verify your Last.fm credentials",trailing:r.React.createElement(c.Arrow,null),onPress:t}),r.React.createElement(c,{label:"Get API Key",subLabel:"Create a Last.fm API key at last.fm/api/account/create",trailing:r.React.createElement(c.Arrow,null),onPress:async function(){try{await re.Linking.openURL("https://www.last.fm/api/account/create")}catch(n){console.error("Failed to open Last.fm API URL:",n),T.showToast("Failed to open web browser. Please visit: https://www.last.fm/api/account/create",v.getAssetIDByName("XIcon"))}}}))))}function yt(){D.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(n){return n+1},0),t=async function(){T.showToast("Testing Libre.fm connection...",v.getAssetIDByName("ClockIcon"));try{await Y.testService("librefm")?T.showToast("\u2705 Libre.fm connection successful!",v.getAssetIDByName("CheckIcon")):T.showToast("\u274C Libre.fm connection failed",v.getAssetIDByName("XIcon"))}catch{T.showToast("\u274C Connection error",v.getAssetIDByName("XIcon"))}};return r.React.createElement(F,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"Credentials"},r.React.createElement(P,{spacing:4},r.React.createElement(_,{placeholder:"Libre.fm Username",value:l("librefmUsername"),onChange:function(n){I("librefmUsername",n),e()},isClearable:!0}),r.React.createElement(_,{placeholder:"Libre.fm API Key",value:l("librefmApiKey"),onChange:function(n){I("librefmApiKey",n),e()},secureTextEntry:!0,isClearable:!0}))),r.React.createElement(E,{title:"Actions"},r.React.createElement(c,{label:"Test Connection",subLabel:"Verify your Libre.fm credentials",trailing:r.React.createElement(c.Arrow,null),onPress:t}),r.React.createElement(c,{label:"Get API Key",subLabel:"Create a Last.fm API key (compatible with Libre.fm)",trailing:r.React.createElement(c.Arrow,null),onPress:async function(){try{await re.Linking.openURL("https://www.last.fm/api/account/create")}catch(n){console.error("Failed to open Last.fm API URL:",n),T.showToast("Failed to open web browser. Please visit: https://www.last.fm/api/account/create",v.getAssetIDByName("XIcon"))}}}))))}function mt(){D.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(n){return n+1},0),t=async function(){T.showToast("Testing ListenBrainz connection...",v.getAssetIDByName("ClockIcon"));try{await Y.testService("listenbrainz")?T.showToast("\u2705 ListenBrainz connection successful!",v.getAssetIDByName("CheckIcon")):T.showToast("\u274C ListenBrainz connection failed",v.getAssetIDByName("XIcon"))}catch{T.showToast("\u274C Connection error",v.getAssetIDByName("XIcon"))}};return r.React.createElement(F,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"Credentials"},r.React.createElement(P,{spacing:4},r.React.createElement(_,{placeholder:"ListenBrainz Username",value:l("listenbrainzUsername"),onChange:function(n){I("listenbrainzUsername",n),e()},isClearable:!0}),r.React.createElement(_,{placeholder:"ListenBrainz Token (for private profiles)",value:l("listenbrainzToken"),onChange:function(n){I("listenbrainzToken",n),e()},secureTextEntry:!0,isClearable:!0}))),r.React.createElement(E,{title:"Actions"},r.React.createElement(c,{label:"Test Connection",subLabel:"Verify your ListenBrainz credentials",trailing:r.React.createElement(c.Arrow,null),onPress:t}),r.React.createElement(c,{label:"Get User Token",subLabel:"Get your ListenBrainz user token at listenbrainz.org/settings/",trailing:r.React.createElement(c.Arrow,null),onPress:async function(){try{await re.Linking.openURL("https://listenbrainz.org/settings/")}catch(n){console.error("Failed to open ListenBrainz settings URL:",n),T.showToast("Failed to open web browser. Please visit: https://listenbrainz.org/settings/",v.getAssetIDByName("XIcon"))}}}))))}function vt(){D.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(t){return t+1},0);return r.React.createElement(F,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"Activity Display"},r.React.createElement(P,{spacing:4},r.React.createElement(_,{placeholder:`App Name (Default: ${h.DEFAULT_SETTINGS.appName})`,value:l("appName",h.DEFAULT_SETTINGS.appName),onChange:function(t){I("appName",t),e()},isClearable:!0}),r.React.createElement(_,{placeholder:`Update Interval (Default: ${h.DEFAULT_SETTINGS.timeInterval}s)`,value:String(l("timeInterval",h.DEFAULT_SETTINGS.timeInterval)),onChange:function(t){const n=Number(t);n>=h.MIN_UPDATE_INTERVAL&&(I("timeInterval",n),e())},keyboardType:"numeric",isClearable:!0}))),r.React.createElement(E,{title:"About Display Settings"},r.React.createElement(c,{label:"App Name",subLabel:"The name shown in Discord for your activity"}),r.React.createElement(c,{label:"Update Interval",subLabel:"How often the plugin checks for new tracks (in seconds)"}),r.React.createElement(c,{label:"Minimum Interval",subLabel:`The plugin will never check more frequently than ${h.MIN_UPDATE_INTERVAL} seconds`}))))}function wt(){D.useProxy(p.plugin.storage);const[e,t]=r.React.useState(null),[n,a]=r.React.useState(!0),[s,i]=r.React.useState(0),[u,g]=r.React.useState(!1),f={name:"Bohemian Rhapsody",artist:"Queen",artists:["Queen"],album:"A Night at the Opera",image:null,nowPlaying:!0,duration:354,startTime:Math.floor(Date.now()/1e3)-120},b=function(d){return d?Array.isArray(d)?d.filter(function(y){return y&&typeof y=="string"}):d["#text"]?d["#text"].split(/[,;&]/).map(function(y){return y.trim()}).filter(function(y){return y.length>0}):typeof d=="string"?d.split(/[,;&]/).map(function(y){return y.trim()}).filter(function(y){return y.length>0}):["Unknown Artist"]:["Unknown Artist"]},k=function(d){return!d||d.length===0?"Unknown Artist":d.length===1?d[0]:d.length===2?`${d[0]} & ${d[1]}`:`${d.slice(0,-1).join(", ")} & ${d[d.length-1]}`};r.React.useEffect(function(){(async function(){if(!l("username")||!l("apiKey")){t(f),g(!0),a(!1);return}try{a(!0);const d=await(await fetch(`https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=${l("username")}&api_key=${l("apiKey")}&format=json&limit=1`)).json();if(d.recenttracks&&d.recenttracks.track&&d.recenttracks.track.length>0){const y=d.recenttracks.track[0],O=b(y.artist);let tt=180;try{const Ut=O[0]||"Unknown Artist",me=await(await fetch(`https://ws.audioscrobbler.com/2.0/?method=track.getInfo&api_key=${l("apiKey")}&artist=${encodeURIComponent(Ut)}&track=${encodeURIComponent(y.name)}&format=json&username=${l("username")}`)).json();me.track&&me.track.duration&&(tt=Math.floor(me.track.duration/1e3))}catch{console.log("Could not fetch track duration, using default")}t({name:y.name||"Unknown Track",artist:k(O),artists:O,album:y.album?.["#text"]||"Unknown Album",image:y.image?.[2]?.["#text"]||y.image?.[1]?.["#text"]||null,nowPlaying:y["@attr"]?.nowplaying==="true",duration:tt,startTime:y["@attr"]?.nowplaying==="true"?Math.floor(Date.now()/1e3)-60:null}),g(!1)}else t(f),g(!0)}catch(d){console.error("Failed to fetch preview data, using fallback:",d),t(f),g(!0)}finally{a(!1)}})()},[l("username"),l("apiKey")]),r.React.useEffect(function(){if(!e?.nowPlaying||!l("showTimestamp"))return;const d=setInterval(function(){if(e.startTime&&e.duration){const y=Math.floor(Date.now()/1e3)-e.startTime,O=Math.min(y/e.duration,1);i(O)}},1e3);return function(){return clearInterval(d)}},[e,l("showTimestamp")]);const L=function(d){const y=Math.floor(d/60),O=Math.floor(d%60);return`${y}:${O.toString().padStart(2,"0")}`},C=function(){let d="";if(l("showAlbumInTooltip")&&e?.album&&(d+=`on ${e.album}`),l("showDurationInTooltip")&&e?.duration){const y=` \u2022 ${L(e.duration)}`;d?d+=y:d=L(e.duration)}return d||"No tooltip text"},A=function(){return e?.duration?e.nowPlaying?{current:s*e.duration,total:e.duration,progress:s}:{current:e.duration*.3,total:e.duration,progress:.3}:{current:0,total:0,progress:0}},U=l("listeningTo")?"Listening to":"Playing",te=l("appName","Music");if(n)return r.React.createElement(r.ReactNative.View,{style:m.container},r.React.createElement(r.ReactNative.View,{style:m.loadingContent},r.React.createElement(r.ReactNative.View,{style:m.loadingSpinner}),r.React.createElement(r.ReactNative.Text,{style:m.loadingText},"Loading preview...")));if(!e)return r.React.createElement(r.ReactNative.View,{style:m.container},r.React.createElement(r.ReactNative.Text,{style:m.centeredText},"Unable to load preview"));const ye=A(),et=C();return r.React.createElement(r.ReactNative.View,{style:m.previewContainer},r.React.createElement(r.ReactNative.View,{style:m.header},r.React.createElement(r.ReactNative.Text,{style:m.activityType},U," ",te),r.React.createElement(r.ReactNative.Text,{style:m.rpcPreviewText,numberOfLines:1},"RPC Preview")),r.React.createElement(r.ReactNative.View,{style:m.content},r.React.createElement(r.ReactNative.View,{style:m.albumArt},e.image?r.React.createElement(r.ReactNative.Image,{source:{uri:e.image},style:m.albumImage,resizeMode:"cover"}):r.React.createElement(r.ReactNative.Text,{style:m.musicIcon},"\u{1F3B5}")),r.React.createElement(r.ReactNative.View,{style:m.trackInfo},r.React.createElement(r.ReactNative.Text,{style:m.trackName,numberOfLines:1},e.name),r.React.createElement(r.ReactNative.Text,{style:m.artistName,numberOfLines:1},e.artist),l("showLargeText")&&et!=="No tooltip text"&&r.React.createElement(r.ReactNative.Text,{style:m.tooltipText,numberOfLines:1},et),l("showTimestamp")&&e.duration&&r.React.createElement(r.ReactNative.View,{style:m.progressContainer},r.React.createElement(r.ReactNative.Text,{style:m.timeText},L(ye.current)),r.React.createElement(r.ReactNative.View,{style:m.progressBar},r.React.createElement(r.ReactNative.View,{style:[m.progressFill,{width:`${ye.progress*100}%`}]})),r.React.createElement(r.ReactNative.Text,{style:m.timeText},L(ye.total))))))}const m=r.ReactNative.StyleSheet.create({container:{backgroundColor:"#1e1f22",borderRadius:12,padding:16,marginHorizontal:10,marginBottom:16,borderWidth:1,borderColor:"#3a3c41",alignItems:"center",justifyContent:"center",minHeight:120},loadingContent:{alignItems:"center",justifyContent:"center"},loadingSpinner:{width:20,height:20,borderRadius:10,borderWidth:2,borderColor:"#5865f2",borderTopColor:"transparent",marginBottom:8},previewContainer:{backgroundColor:"#1e1f22",borderRadius:12,padding:16,marginHorizontal:10,marginBottom:16,borderWidth:1,borderColor:"#3a3c41"},header:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:12,gap:8},content:{flexDirection:"row",alignItems:"center"},albumArt:{width:80,height:80,backgroundColor:"#2b2d31",borderRadius:12,justifyContent:"center",alignItems:"center",marginRight:16,borderWidth:1,borderColor:"#40444b",overflow:"hidden",flexShrink:0},trackInfo:{flex:1,minWidth:0},progressContainer:{flexDirection:"row",alignItems:"center",gap:8,marginTop:6},progressBar:{flex:1,height:2,backgroundColor:"#2b2d31",borderRadius:3,overflow:"hidden"},progressFill:{height:2,backgroundColor:"#5865f2",borderRadius:3},loadingText:{color:"#949ba4",fontSize:14,fontWeight:"500"},centeredText:{color:"#949ba4",fontSize:14,fontWeight:"500",textAlign:"center"},activityType:{color:"#dbdee1",fontSize:14,fontWeight:"600",flex:1},rpcPreviewText:{color:"#80848e",fontSize:12,fontStyle:"italic",flexShrink:0},albumImage:{width:80,height:80,borderRadius:12},musicIcon:{color:"#80848e",fontSize:32},trackName:{color:"#ffffff",fontSize:16,fontWeight:"700",marginBottom:4},artistName:{color:"#b5bac1",fontSize:14,fontWeight:"500",marginBottom:4},tooltipText:{color:"#80848e",fontSize:12,fontStyle:"italic",marginBottom:6},timeText:{color:"#80848e",fontSize:11,fontWeight:"500",minWidth:35,textAlign:"center"}});function Rt(){D.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(i){return i+1},0),t=l("listeningTo",h.DEFAULT_SETTINGS.listeningTo),n=l("showTimestamp",h.DEFAULT_SETTINGS.showTimestamp),a=function(){const i=!t;I("listeningTo",i),!i&&n&&I("showTimestamp",!1),e()},s=function(){t&&(I("showTimestamp",!n),e())};return r.React.createElement(F,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(wt,null),r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"RPC Display Options"},r.React.createElement(j,{label:"Show as Listening",subLabel:"Display as 'Listening to' instead of 'Playing'",checked:t,onPress:a}),r.React.createElement(j,{label:"Show Tooltip Text",subLabel:"Show album name and track duration in Discord activity tooltip",checked:l("showLargeText",!0),onPress:function(){const i=l("showLargeText",!0);I("showLargeText",!i),e()}}),!t&&r.React.createElement(c,{label:"Timestamp Unavailable",subLabel:"Enable 'Show as Listening' to use timestamp feature",disabled:!0,dimmed:!0}),r.React.createElement(j,{label:"Show Timestamp",subLabel:"Display track progress and duration",checked:n,onPress:s,disabled:!t}),r.React.createElement(j,{label:"Show Album in Tooltip",subLabel:"Include album name in the tooltip text",checked:l("showAlbumInTooltip",!0),onPress:function(){const i=l("showAlbumInTooltip",!0);I("showAlbumInTooltip",!i),e()}}),r.React.createElement(j,{label:"Show Duration in Tooltip",subLabel:"Include track duration in the tooltip text",checked:l("showDurationInTooltip",!0),onPress:function(){const i=l("showDurationInTooltip",!0);I("showDurationInTooltip",!i),e()}}))))}function Et(){D.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(i){return i+1},0),[t,n]=r.React.useState(""),a=function(){if(!t.trim()){T.showToast("Please enter an app name",v.getAssetIDByName("Small"));return}const i=l("ignoreList",[]);i.includes(t.trim())?T.showToast("App already in ignore list",v.getAssetIDByName("Warning")):(I("ignoreList",[...i,t.trim()]),n(""),e(),T.showToast("App added to ignore list",v.getAssetIDByName("Check")))},s=function(i){const u=l("ignoreList",[]);I("ignoreList",u.filter(function(g){return g!==i})),e(),T.showToast("App removed from ignore list",v.getAssetIDByName("Check"))};return r.React.createElement(F,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"Add App to Ignore"},r.React.createElement(P,{spacing:4},r.React.createElement(_,{placeholder:"Enter app name",value:t,onChange:n,isClearable:!0,onSubmitEditing:a,returnKeyType:"done"}))),r.React.createElement(E,null,r.React.createElement(c,{label:"Add to Ignore List",subLabel:"Add the current app name to your ignore list",trailing:r.React.createElement(c.Arrow,null),onPress:a})),l("ignoreList",[]).length>0&&r.React.createElement(E,{title:"Ignored Apps"},l("ignoreList",[]).map(function(i,u){return r.React.createElement(c,{key:u,label:i,trailing:r.React.createElement(r.ReactNative.TouchableOpacity,{onPress:function(){return s(i)},style:{padding:8,backgroundColor:"#ff4d4d",borderRadius:12,width:24,height:24,justifyContent:"center",alignItems:"center"}},r.React.createElement(r.ReactNative.Image,{source:v.getAssetIDByName("TrashIcon"),style:{width:14,height:14,tintColor:"#ffffff"}}))})})),r.React.createElement(E,{title:"About Ignore List"},r.React.createElement(c,{label:"How it Works",subLabel:"When any app in your ignore list is active, your music status will be hidden"}),r.React.createElement(c,{label:"Detection",subLabel:"Apps are detected by their Discord activity name"}),r.React.createElement(c,{label:"Examples",subLabel:"Spotify, YouTube Music, Kizzy, Metrolist, echo"}))))}function St(){D.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(t){return t+1},0);return r.React.createElement(F,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"Logging Options"},r.React.createElement(Ce,{label:"Verbose Logging",subLabel:"Enable detailed console logging for debugging",value:l("verboseLogging",h.DEFAULT_SETTINGS.verboseLogging),onValueChange:function(t){I("verboseLogging",t),e()}})),r.React.createElement(E,{title:"Debug Information"},r.React.createElement(c,{label:"Console Logging",subLabel:"Logs are written to the browser/app console when verbose is enabled"}),r.React.createElement(c,{label:"Error Tracking",subLabel:"Connection errors and API failures are automatically logged"})),r.React.createElement(E,{title:"Log Information"},r.React.createElement(c,{label:"API Calls",subLabel:"All API requests are logged when verbose is enabled"}),r.React.createElement(c,{label:"Track Updates",subLabel:"Song changes and RPC updates are logged"}),r.React.createElement(c,{label:"Error Details",subLabel:"Connection errors and retries are logged"}))))}var Pe,Ne,$e,Ue,De,_e,ze,xe,Fe,Ve,Me,Be,Oe,Ke,je,Ge,qe;(Pe=p.plugin.storage).username??(Pe.username=""),(Ne=p.plugin.storage).apiKey??(Ne.apiKey=""),($e=p.plugin.storage).appName??($e.appName="Music"),(Ue=p.plugin.storage).timeInterval??(Ue.timeInterval=5),(De=p.plugin.storage).showTimestamp??(De.showTimestamp=!0),(_e=p.plugin.storage).listeningTo??(_e.listeningTo=!0),(ze=p.plugin.storage).verboseLogging??(ze.verboseLogging=!1),(xe=p.plugin.storage).service??(xe.service="lastfm"),(Fe=p.plugin.storage).librefmUsername??(Fe.librefmUsername=""),(Ve=p.plugin.storage).librefmApiKey??(Ve.librefmApiKey=""),(Me=p.plugin.storage).listenbrainzUsername??(Me.listenbrainzUsername=""),(Be=p.plugin.storage).listenbrainzToken??(Be.listenbrainzToken=""),(Oe=p.plugin.storage).addToSidebar??(Oe.addToSidebar=!0),(Ke=p.plugin.storage).showLargeText??(Ke.showLargeText=!0),(je=p.plugin.storage).ignoreList??(je.ignoreList=[]),(Ge=p.plugin.storage).showAlbumInTooltip??(Ge.showAlbumInTooltip=!0),(qe=p.plugin.storage).showDurationInTooltip??(qe.showDurationInTooltip=!0);const l=function(e,t){return p.plugin.storage[e]??t},I=function(e,t){return p.plugin.storage[e]=t},Y=(function(){function e(){M(this,e)}return B(e,null,[{key:"getServiceDisplayName",value:function(t){switch(t){case"lastfm":return"Last.fm";case"librefm":return"Libre.fm";case"listenbrainz":return"ListenBrainz";default:return"Unknown"}}},{key:"testService",value:async function(t){try{switch(t){case"lastfm":return await this.testLastFmConnection();case"librefm":return await this.testLibreFmConnection();case"listenbrainz":return await this.testListenBrainzConnection();default:return!1}}catch(n){return console.error(`Error testing ${t}:`,n),!1}}},{key:"testLastFmConnection",value:async function(){const t=l("username"),n=l("apiKey");if(!t||!n)return!1;try{return!(await(await fetch(`https://ws.audioscrobbler.com/2.0/?method=user.getinfo&user=${t}&api_key=${n}&format=json`)).json()).error}catch(a){return console.error("Last.fm connection test failed:",a),!1}}},{key:"testLibreFmConnection",value:async function(){const t=l("librefmUsername"),n=l("librefmApiKey");if(!t||!n)return!1;try{return!(await(await fetch(`https://libre.fm/2.0/?method=user.getinfo&user=${t}&api_key=${n}&format=json`)).json()).error}catch(a){return console.error("Libre.fm connection test failed:",a),!1}}},{key:"testListenBrainzConnection",value:async function(){const t=l("listenbrainzUsername"),n=l("listenbrainzToken");if(!t)return!1;try{const a={"Content-Type":"application/json"};return n&&(a.Authorization=`Token ${n}`),(await fetch(`https://api.listenbrainz.org/1/user/${t}/listen-count`,{headers:a})).status===200}catch(a){return console.error("ListenBrainz connection test failed:",a),!1}}}]),e})();function Ye(){D.useProxy(p.plugin.storage);const e=r.NavigationNative.useNavigation(),[,t]=r.React.useReducer(function(s){return s+1},0),n=l("service"),a=function(s){switch(s){case"lastfm":return l("username")&&l("apiKey")?"\u2705 Configured":"\u274C Missing credentials";case"librefm":return l("librefmUsername")&&l("librefmApiKey")?"\u2705 Configured":"\u274C Missing credentials";case"listenbrainz":return l("listenbrainzUsername")?"\u2705 Configured":"\u274C Missing username";default:return"\u2753 Unknown"}};return r.React.createElement(F,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(E,{title:"Active Service"},r.React.createElement(c,{label:"Current Service",subLabel:n?`Using: ${Y.getServiceDisplayName(n)}`:"No service selected"}),["lastfm","librefm","listenbrainz"].map(function(s){return r.React.createElement(j,{key:s,label:Y.getServiceDisplayName(s),subLabel:a(s),checked:n===s,onPress:function(){s!==n&&(I("service",s),t())}})})),r.React.createElement(E,{title:"Service Configuration"},r.React.createElement(c,{label:"Last.fm Settings",subLabel:"Configure Last.fm credentials and options",trailing:r.React.createElement(c.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Last.fm Settings",render:bt})}}),r.React.createElement(c,{label:"Libre.fm Settings",subLabel:"Configure Libre.fm credentials and options",trailing:r.React.createElement(c.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Libre.fm Settings",render:yt})}}),r.React.createElement(c,{label:"ListenBrainz Settings",subLabel:"Configure ListenBrainz credentials and options",trailing:r.React.createElement(c.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"ListenBrainz Settings",render:mt})}})),r.React.createElement(E,{title:"Plugin Configuration"},r.React.createElement(c,{label:"Display Settings",subLabel:"Customize app name and update interval",trailing:r.React.createElement(c.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Display Settings",render:vt})}}),r.React.createElement(c,{label:"RPC Customization",subLabel:"Customize Discord rich presence display options",trailing:r.React.createElement(c.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"RPC Customization",render:Rt})}}),r.React.createElement(c,{label:"Ignore List",subLabel:"Configure apps that should hide your status",trailing:r.React.createElement(c.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Ignore List Settings",render:Et})}}),r.React.createElement(c,{label:"Logging Settings",subLabel:"Configure logging and debugging options",trailing:r.React.createElement(c.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Logging Settings",render:St})}}),r.React.createElement(Ce,{label:"Add to Sidebar",subLabel:"Show plugin in Discord settings",value:l("addToSidebar",!1),onValueChange:function(s){I("addToSidebar",s),t()}})),r.React.createElement(E,{title:"About"},r.React.createElement(c,{label:"Multi Scrobbler",subLabel:"Show off your music status from multiple services"}),r.React.createElement(c,{label:"Author",subLabel:"kmmiio99o"}),r.React.createElement(c,{label:"Version",subLabel:"1.3.2"}))))}const{FormSection:Tt,FormRow:fe}=rt.Forms,{TableRowIcon:It}=z.findByProps("TableRowIcon"),W=window.bunny,We=W?.metro?.findByPropsLazy("getRootNavigationRef"),de=W?.metro?.findByPropsLazy("SETTING_RENDERER_CONFIG"),Xe=W?.metro?.findByPropsLazy("createList"),He=W?.metro?.findByNameLazy("SettingsOverviewScreen",!1);function kt({tabs:e}){const t=r.NavigationNative.useNavigation();return r.React.createElement(fe,{label:e.title(),leading:r.React.createElement(fe.Icon,{source:e.icon}),trailing:r.React.createElement(r.React.Fragment,{},[e.trailing?e.trailing():null,r.React.createElement(fe.Arrow,{key:"arrow"})]),onPress:function(){const n=e.page;t.navigate("VendettaCustomPage",{title:e.title(),render:function(){return r.React.createElement(n)}})}})}function Lt(e,t){try{t.push(H.after("default",W?.metro?.findByPropsLazy(["renderTitle","sections"],!1),function(n,a){const s=ne.findInReactTree(a.props.children,function(i){return i.type?.name==="UserSettingsOverview"});s&&t.push(H.after("render",s.type.prototype,function(i,u){const g=ne.findInReactTree(u.props.children,function(f){return f?.children?.[1]?.type===Tt})?.children;if(g){const f=g.findIndex(function(b){return["BILLING_SETTINGS","PREMIUM_SETTINGS"].includes(b?.props?.label)});g.splice(-~f||4,0,r.React.createElement(kt,{key:e.key,tabs:e}))}}))},!0))}catch(n){p.logger.info("Panel UI patch failed graciously \u{1F494}",n)}}function At(e,t){if(!de||!We){console.warn("[LastFm] Missing required constants for tabs UI patch");return}const n={[e.key]:{type:"pressable",title:e.title,icon:e.icon,IconComponent:e.icon&&function(){return r.React.createElement(It,{source:e.icon})},usePredicate:e.predicate,useTrailing:e.trailing,onPress:function(){const i=We.getRootNavigationRef(),u=e.page;i.navigate("VendettaCustomPage",{title:e.title(),render:function(){return r.React.createElement(u)}})},withArrow:!0}};let a=de.SETTING_RENDERER_CONFIG;Object.defineProperty(de,"SETTING_RENDERER_CONFIG",{enumerable:!0,configurable:!0,get:function(){return{...a,...n}},set:function(i){return a=i}});const s=Symbol("pinToSettings meow meow");try{if(!Xe)return;t.push(H.after("createList",Xe,function(i,u){if(!i[0][s]){i[0][s]=!0;const[g]=i,f=g.sections?.find(function(b){return["Bunny","Revenge","Kettu","Vencore","ShiggyCord"].some(function(k){return b.label===k&&b.title===k})});f?.settings&&(f.settings=[...f.settings,e.key])}}))}catch{if(!He)return;t.push(H.after("default",He,function(i,u){if(!i[0][s]){i[0][s]=!0;const{sections:g}=ne.findInReactTree(u,function(b){return b.props?.sections}).props,f=g?.find(function(b){return["Bunny","Revenge","Kettu","Vencore","ShiggyCord"].some(function(k){return b.label===k&&b.title===k})});f?.settings&&(f.settings=[...f.settings,e.key])}}))}}function Ct(e){const t=[];let n=!1;const a=e.predicate||function(){return!0};return e.predicate=function(){return n?!1:a()},Lt(e,t),At(e,t),t.push(function(){return n=!0}),function(){for(const s of t)s()}}function Qe(){if(!p.plugin.storage.addToSidebar)return console.log("[Multi Scrobbler] Sidebar disabled in settings"),function(){};console.log("[Multi Scrobbler] Patching sidebar using custom patchSettingsPin...");try{const e=Ct({key:"LastFmScrobbler",icon:v.getAssetIDByName("MusicIcon"),title:function(){return"Multi Scrobbler"},predicate:function(){return p.plugin.storage.addToSidebar===!0},page:Ye});return console.log("[Multi Scrobbler] Successfully patched sidebar"),e}catch(e){return console.error("[Multi Scrobbler] Failed to patch sidebar:",e),function(){}}}var Je;const S={pluginStopped:!1,lastActivity:void 0,updateInterval:void 0,lastTrackUrl:void 0},pe=[];let V;const Ze=h.DEFAULT_SETTINGS;for(const e of Object.keys(Ze))p.plugin.storage[e]=p.plugin.storage[e]??Ze[e];(Je=p.plugin.storage).addToSidebar??(Je.addToSidebar=!1);const o=new Proxy(p.plugin.storage,{get(e,t){return e[t]},set(e,t,n){return e[t]=n,!0}});let ee=0;const he=3,Pt=5e3,R=function(...e){return console.log("[Scrobble Plugin]",...e)},be=function(...e){return console.error("[Scrobble Plugin] Error:",...e)};async function X(){try{await pt(),ee=0,R("Plugin initialized successfully")}catch(e){be("Initialization failed:",e),ee++,ee10&&(R.serviceErrors[e]=R.serviceErrors[e].slice(-10)),Se(`${e} error:`,t)}function Ie(){R.lastSuccessfulUpdate=new Date().toISOString(),Z("Successful update recorded at:",R.lastSuccessfulUpdate)}function te(e){return te=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},te(e)}function ke(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ke=function(){return!!e})()}function ot(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lt(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function ct(e,t){return t&&(lt(t)==="object"||typeof t=="function")?t:ot(e)}function oe(e,t,n){return t=te(t),ct(e,ke()?Reflect.construct(t,n||[],te(e).constructor):t.apply(e,n))}function le(e,t){return le=Object.setPrototypeOf||function(a,i){return a.__proto__=i,a},le(e,t)}function ce(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&&le(e,t)}let ue=(function(){function e(){O(this,e)}return K(e,[{key:"log",value:function(...t){console.log(`[${this.getServiceName()}]`,...t)}},{key:"logError",value:function(...t){console.error(`[${this.getServiceName()}] Error:`,...t)}},{key:"logVerbose",value:function(...t){console.log(`[${this.getServiceName()}] Verbose:`,...t)}},{key:"handleError",value:async function(t){this.lastError=t.error||0;const n=this.getErrorMessage(t);throw this.logError(n),ee(this.getServiceName().toLowerCase(),n),new Error(`${this.getServiceName()} API Error: ${n}`)}},{key:"getErrorMessage",value:function(t){return t.error&&h.API_ERROR_CODES[t.error]?h.API_ERROR_CODES[t.error]:t.message||t.toString()||"Unknown error"}},{key:"makeRequest",value:async function(t,n={}){try{this.logVerbose(`Making request to: ${t}`),Te();const a=await fetch(t,{...n,headers:{"User-Agent":"Vendetta Multi-Service Scrobbler/3.0.0",...n.headers}});if(!a.ok){const s=new Error(`HTTP ${a.status}: ${a.statusText}`);throw ee(this.getServiceName().toLowerCase(),s.message),s}const i=await a.json();return i.error&&await this.handleError(i),this.retryCount=0,i}catch(a){if(this.retryCount++,this.retryCount>h.MAX_RETRY_ATTEMPTS)throw this.retryCount=0,ee(this.getServiceName().toLowerCase(),`Max retries exceeded: ${a.message}`),a;return this.logVerbose(`Request failed, retrying (${this.retryCount}/${h.MAX_RETRY_ATTEMPTS})`),await new Promise(function(i){return setTimeout(i,h.RETRY_DELAY)}),this.makeRequest(t,n)}}},{key:"isDefaultCover",value:function(t){return t?h.DEFAULT_COVER_HASHES.some(function(n){return t.includes(n)}):!0}},{key:"processAlbumArt",value:function(t){return!t||this.isDefaultCover(t)?null:t}},{key:"getLastError",value:function(){return this.lastError}},{key:"resetRetryCount",value:function(){this.retryCount=0}}]),e})(),ut=(function(e){ce(t,e);function t(){return O(this,t),oe(this,t,arguments)}return K(t,[{key:"getServiceName",value:function(){return"Last.fm"}},{key:"logVerbose",value:function(...n){o.verboseLogging&&console.log(`[${this.getServiceName()}] Verbose:`,...n)}},{key:"validateCredentials",value:async function(){try{if(!o.username||!o.apiKey)throw new Error("Username or API key not set");const n=new URLSearchParams({method:"user.getinfo",user:o.username,api_key:o.apiKey,format:"json"}),a=`${h.SERVICES.lastfm.baseUrl}?${n}`;return await this.makeRequest(a),this.log("Credentials validation successful"),!0}catch(n){return this.logError("Credentials validation failed:",n),!1}}},{key:"fetchLatestScrobble",value:async function(){try{if(!o.username||!o.apiKey)throw new Error("Username or API key not set");this.logVerbose("Fetching latest scrobble for user:",o.username);const n=new URLSearchParams({method:"user.getrecenttracks",user:o.username,api_key:o.apiKey,limit:"1",extended:"1",format:"json"}),a=`${h.SERVICES.lastfm.baseUrl}?${n}`,i=(await this.makeRequest(a))?.recenttracks?.track?.[0];if(!i)throw new Error("No tracks found");this.logVerbose("Raw track data:",i);const s=!!i["@attr"]?.nowplaying,l=i.date?.uts?parseInt(i.date.uts):Math.floor(Date.now()/1e3);let g=null,f=null;if(s)try{const C=new URLSearchParams({method:"track.getInfo",track:i.name,artist:i.artist.name,api_key:o.apiKey,format:"json"}),N=`${h.SERVICES.lastfm.baseUrl}?${C}`,y=await this.makeRequest(N);y?.track?.duration&&(g=parseInt(y.track.duration),g>0&&(g=Math.floor(g/1e3),f=l+g))}catch(C){this.logVerbose("Failed to fetch track duration:",C)}const b=this.processAlbumArt(i.image?.find(function(C){return C.size==="large"})?.["#text"]),A={name:i.name,artist:i.artist.name,album:i.album["#text"],albumArt:b,url:i.url,date:i.date?.["#text"]??"now",nowPlaying:s,loved:i.loved==="1",from:l,to:f,duration:g};return this.logVerbose("Processed track:",A),this.log(`${s?"Now playing":"Last played"}:`,`${A.artist} - ${A.name}`),A}catch(n){throw this.logError("Failed to fetch latest scrobble:",n),n}}}]),t})(ue),gt=(function(e){ce(t,e);function t(){return O(this,t),oe(this,t,arguments)}return K(t,[{key:"getServiceName",value:function(){return"Libre.fm"}},{key:"logVerbose",value:function(...n){o.verboseLogging&&console.log(`[${this.getServiceName()}] Verbose:`,...n)}},{key:"validateCredentials",value:async function(){try{const n=o.librefmUsername,a=o.librefmApiKey;if(!n||!a)throw new Error("Username or API key not set for Libre.fm");const i=new URLSearchParams({method:"user.getinfo",user:n,api_key:a,format:"json"}),s=`${h.SERVICES.librefm.baseUrl}?${i}`;return await this.makeRequest(s),this.log("Credentials validation successful"),!0}catch(n){return this.logError("Credentials validation failed:",n),!1}}},{key:"fetchLatestScrobble",value:async function(){try{const n=o.librefmUsername,a=o.librefmApiKey;if(!n||!a)throw new Error("Username or API key not set for Libre.fm");this.logVerbose("Fetching latest scrobble for user:",n);const i=new URLSearchParams({method:"user.getrecenttracks",user:n,api_key:a,limit:"1",extended:"1",format:"json"}),s=`${h.SERVICES.librefm.baseUrl}?${i}`,l=(await this.makeRequest(s))?.recenttracks?.track?.[0];if(!l)throw new Error("No tracks found");this.logVerbose("Raw track data:",l);const g=!!l["@attr"]?.nowplaying,f=l.date?.uts?parseInt(l.date.uts):Math.floor(Date.now()/1e3);let b=null,A=null;if(g)try{const y=new URLSearchParams({method:"track.getInfo",track:l.name,artist:l.artist.name,api_key:a,format:"json"}),x=`${h.SERVICES.librefm.baseUrl}?${y}`,L=await this.makeRequest(x);L?.track?.duration&&(b=parseInt(L.track.duration),b>0&&(b=Math.floor(b/1e3),A=f+b))}catch(y){this.logVerbose("Failed to fetch track duration:",y)}const C=this.processAlbumArt(l.image?.find(function(y){return y.size==="large"})?.["#text"]),N={name:l.name,artist:l.artist.name,album:l.album["#text"],albumArt:C,url:l.url,date:l.date?.["#text"]??"now",nowPlaying:g,loved:l.loved==="1",from:f,to:A,duration:b};return this.logVerbose("Processed track:",N),this.log(`${g?"Now playing":"Last played"}:`,`${N.artist} - ${N.name}`),N}catch(n){throw this.logError("Failed to fetch latest scrobble:",n),n}}}]),t})(ue),ft=(function(e){ce(t,e);function t(){return O(this,t),oe(this,t,arguments)}return K(t,[{key:"getServiceName",value:function(){return"ListenBrainz"}},{key:"logVerbose",value:function(...n){o.verboseLogging&&console.log(`[${this.getServiceName()}] Verbose:`,...n)}},{key:"validateCredentials",value:async function(){try{const n=o.listenbrainzUsername,a=o.listenbrainzToken;if(!n)throw new Error("Username not set for ListenBrainz");const i=`${h.SERVICES.listenbrainz.baseUrl}/user/${encodeURIComponent(n)}/listens?count=1`,s={};return a&&(s.Authorization=`Token ${a}`),await this.makeRequest(i,{headers:s}),this.log("Credentials validation successful"),!0}catch(n){return this.logError("Credentials validation failed:",n),!1}}},{key:"fetchLatestScrobble",value:async function(){try{const n=o.listenbrainzUsername,a=o.listenbrainzToken;if(!n)throw new Error("Username not set for ListenBrainz");this.logVerbose("Fetching latest scrobble for user:",n);let i=null;const s=function(y){if(y){if(Array.isArray(y.listens))return y.listens;if(y.payload&&Array.isArray(y.payload.listens))return y.payload.listens;if(y.data&&Array.isArray(y.data.listens))return y.data.listens}};try{const y=`${h.SERVICES.listenbrainz.baseUrl}/user/${encodeURIComponent(n)}/playing-now`,x={};a&&(x.Authorization=`Token ${a}`);const L=await this.makeRequest(y,{headers:x}),D=s(L);D&&D.length>0&&(i=D[0],i.playing_now=!0)}catch(y){this.logVerbose("No currently playing track or failed to fetch:",y)}let l;if(i)l=i,this.logVerbose("Using currently playing track");else{const y=`${h.SERVICES.listenbrainz.baseUrl}/user/${encodeURIComponent(n)}/listens?count=1`,x={};a&&(x.Authorization=`Token ${a}`);const L=await this.makeRequest(y,{headers:x}),D=(function(){if(L){if(Array.isArray(L.listens))return L.listens;if(L.payload&&Array.isArray(L.payload.listens))return L.payload.listens;if(L.data&&Array.isArray(L.data.listens))return L.data.listens}})();if(!D||D.length===0)throw new Error("No listens found");l=D[0],this.logVerbose("Using latest completed listen")}this.logVerbose("Raw listen data:",l);const g=!!l.playing_now,f=l.listened_at||Math.floor(Date.now()/1e3);let b=null,A=null;l.track_metadata.additional_info?.duration_ms&&(b=Math.floor(l.track_metadata.additional_info.duration_ms/1e3),g&&b>0&&(A=f+b));const C=null;l.track_metadata.additional_info?.release_mbid;const N={name:l.track_metadata.track_name,artist:l.track_metadata.artist_name,album:l.track_metadata.release_name||"",albumArt:C,url:l.track_metadata.additional_info?.origin_url||`https://listenbrainz.org/user/${n}`,date:g?"now":new Date(f*1e3).toISOString(),nowPlaying:g,loved:!1,from:f,to:A,duration:b};return this.logVerbose("Processed track:",N),this.log(`${g?"Now playing":"Last played"}:`,`${N.artist} - ${N.name}`),N}catch(n){throw this.logError("Failed to fetch latest listen:",n),n}}},{key:"getErrorMessage",value:function(n){return n.error?n.error:n.message?n.message:n.toString()||"Unknown error"}}]),t})(ue);const V=(function(){function e(){O(this,e),this.serviceInstances=new Map}return K(e,[{key:"getService",value:function(t){this.serviceInstances||(this.serviceInstances=new Map);const n=t||o.service;if(!n)throw new Error("[ServiceFactory] No service type specified and no default service configured");return this.serviceInstances.has(n)||this.serviceInstances.set(n,this.createService(n)),this.serviceInstances.get(n)}},{key:"getCurrentService",value:function(){return this.getService(o.service)}},{key:"createService",value:function(t){switch(t){case"lastfm":return new ut;case"librefm":return new gt;case"listenbrainz":return new ft;default:throw new Error(`[ServiceFactory] Unknown service type: ${t}`)}}},{key:"clearCache",value:function(){this.serviceInstances?this.serviceInstances.clear():this.serviceInstances=new Map}},{key:"validateCurrentService",value:function(){return this.getCurrentService().validateCredentials()}},{key:"testService",value:async function(t){try{return await this.getService(t).validateCredentials()}catch(n){return console.error(`[ServiceFactory] Failed to test ${t}:`,n),!1}}},{key:"getSupportedServices",value:function(){return["lastfm","librefm","listenbrainz"]}},{key:"getServiceDisplayName",value:function(t){return this.getService(t).getServiceName()}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e})().getInstance();function Ae(e){if(!e||e<0)return"0:00";const t=Math.floor(e/3600),n=Math.floor(e%3600/60),a=Math.floor(e%60);return t>0?`${t}:${n.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`:`${n}:${a.toString().padStart(2,"0")}`}function Le(){return Math.floor(Date.now()/1e3)}var dt=(function(e){return e[e.PLAYING=0]="PLAYING",e[e.STREAMING=1]="STREAMING",e[e.LISTENING=2]="LISTENING",e[e.COMPETING=5]="COMPETING",e})(dt||{});const $=function(...e){return console.log("[Scrobble Plugin]",...e)},G=function(...e){return console.error("[Scrobble Plugin] Error:",...e)},U=function(...e){return o.verboseLogging&&console.log("[Scrobble Plugin] Verbose:",...e)},ge=(function(){function e(){O(this,e)}return K(e,[{key:"updateActivity",value:async function(){if(T.pluginStopped){U("Plugin is stopped, skipping update"),this.stopUpdates();return}const t=V.getCurrentService().getServiceName();U(`Fetching latest track from ${t}...`);let n=!1;try{if(o.ignoreList&&o.ignoreList.length>0){const l=at.findActivity(function(g){return g.name?o.ignoreList.some(function(f){return g.name.toLowerCase().includes(f.toLowerCase())}):!1});if(l){U(`Ignored app (${l.name}) is currently playing, clearing activity`),ie();return}}Te();const a=await V.getCurrentService().fetchLatestScrobble();if(se("lastTrack",a),!a.nowPlaying){U("Track is not currently playing"),ie();return}if(T.lastTrackUrl===a.url){U("Track hasn't changed"),Ie(),this.consecutiveFailures=0;return}n=!0,$(`\u{1F3B5} Track changed: ${a.artist} - ${a.name}`);let i;if(a.nowPlaying&&o.showTimestamp&&a.from){const l=Le();let g=a.from;if(g0){const f=Math.min(a.duration*.1,30);g=l-f}else g=l;U("had to estimate start time")}i={start:g*1e3},a.to&&(i.end=a.to*1e3)}U(`\u{1F3AF} Preparing RPC update for: ${a.artist} - ${a.name}`);const s={name:o.appName||h.DEFAULT_APP_NAME,flags:0,type:o.listeningTo?2:0,details:a.name,state:`${a.artist}`,status_display_type:1,application_id:h.APPLICATION_ID};if(s.name.includes("{{")){const l={artist:a.artist,name:a.name,album:a.album,service:t};for(const[g,f]of Object.entries(l))s.name=s.name.replace(new RegExp(`{{${g}}}`,"g"),f||"")}if(i&&(s.timestamps=i,U("Timestamps set:",{start:new Date(i.start).toISOString(),end:i.end?new Date(i.end).toISOString():"none",duration:a.duration?Ae(a.duration):"unknown"})),a.album||a.albumArt){const l=a.albumArt?[a.albumArt]:[];let g=(await st(l))[0];if(g){if(s.assets={large_image:g},o.showLargeText){let f="";if(o.showAlbumInTooltip&&a.album&&(f+=`on ${a.album}`),o.showDurationInTooltip&&a.duration){const b=Ae(a.duration);f?f+=` \u2022 ${b}`:f=b}f&&(s.assets.large_text=f)}U("Album art set:",g),s.assets.large_text&&U("Tooltip text set:",s.assets.large_text)}else a.album&&o.showLargeText&&o.showAlbumInTooltip&&(s.assets={large_text:`on ${a.album}`})}U("Setting Discord activity:",s),se("lastActivity",s),await Ee(s),T.lastTrackUrl=a.url,this.currentActivity=s,T.lastActivity=s,this.consecutiveFailures=0,this.lastUpdateTime=Le(),Ie(),$(`\u2705 RPC updated successfully: ${a.artist} - ${a.name}`)}catch(a){G("Update failed:",a),ee(o.service,a.message),this.handleError(a)}}},{key:"handleError",value:function(t){this.consecutiveFailures++,se("lastError",t),G(`Failure ${this.consecutiveFailures}/${h.MAX_RETRY_ATTEMPTS}:`,t.message),this.consecutiveFailures>=h.MAX_RETRY_ATTEMPTS&&(G("Max retry attempts reached, initiating reconnection..."),this.startReconnection())}},{key:"startReconnection",value:function(){var t=this;this.isReconnecting||(this.isReconnecting=!0,this.stopUpdates(),$("Starting reconnection process..."),this.reconnectTimer=setInterval(function(){$("Attempting to reconnect..."),t.initialize().then(function(){$("Reconnection successful!"),t.stopReconnection()}).catch(function(n){G("Reconnection attempt failed:",n.message)})},h.RETRY_DELAY))}},{key:"stopReconnection",value:function(){try{this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=void 0),this.isReconnecting=!1,this.consecutiveFailures=0}catch(t){console.error("[Scrobble Plugin] Reconnection cleanup error:",t)}}},{key:"stopUpdates",value:function(){try{this.updateTimer&&(clearInterval(this.updateTimer),this.updateTimer=void 0)}catch(t){console.error("[Scrobble Plugin] Timer cleanup error:",t)}}},{key:"initialize",value:async function(){var t=this;if(T.pluginStopped)throw new Error("Plugin is stopped");const n=V.getCurrentService().getServiceName();$(`Initializing with ${n}...`);try{if(!await V.validateCurrentService())throw new Error(`Invalid credentials for ${n}`);$(`${n} credentials validated successfully`)}catch(i){throw G(`Failed to validate ${n} credentials:`,i),i}this.stopUpdates(),$("\u{1F3B5} checking for already playing songs..."),await this.updateActivity();const a=Math.max((Number(o.timeInterval)||h.DEFAULT_SETTINGS.timeInterval)*1e3,h.MIN_UPDATE_INTERVAL*1e3);this.updateTimer=setInterval(function(){return t.updateActivity()},a),$(`Update timer started with interval: ${a}ms (${a/1e3}s)`)}},{key:"stop",value:function(){if(!T.pluginStopped){$("Stopping plugin..."),T.pluginStopped=!0;try{this.stopUpdates(),this.stopReconnection(),ie(),$("Plugin stopped successfully")}catch(t){console.error("[Scrobble Plugin] Stop error:",t)}}}},{key:"switchService",value:async function(t){if(T.pluginStopped)return;$(`Switching to ${t}...`);const n=!T.pluginStopped;this.stop();try{V.clearCache(),T.lastTrackUrl=void 0,this.currentActivity=void 0,this.lastUpdateTime=0,n&&(T.pluginStopped=!1,await this.initialize())}catch(a){G("Failed to switch service:",a)}}},{key:"getStatus",value:function(){const t=V.getCurrentService().getServiceName();return{running:!T.pluginStopped,service:t,consecutiveFailures:this.consecutiveFailures,isReconnecting:this.isReconnecting,lastTrackUrl:T.lastTrackUrl,updateInterval:this.updateTimer?"Active":"Inactive"}}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e})().getInstance(),pt=function(){return ge.initialize()},fe=function(){return ge.stop()},ht=function(e){return ge.switchService(e)},{ScrollView:M}=F.findByProps("ScrollView"),{TableRowGroup:S,TableSwitchRow:Ce,TableCheckboxRow:q,Stack:P,TableRow:u}=F.findByProps("TableSwitchRow","TableCheckboxRow","TableRowGroup","Stack","TableRow"),{TextInput:z}=F.findByProps("TextInput");function bt(){_.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(n){return n+1},0),t=async function(){I.showToast("Testing Last.fm connection...",w.getAssetIDByName("ClockIcon"));try{await X.testService("lastfm")?I.showToast("\u2705 Last.fm connection successful!",w.getAssetIDByName("CheckIcon")):I.showToast("\u274C Last.fm connection failed",w.getAssetIDByName("XIcon"))}catch{I.showToast("\u274C Connection error",w.getAssetIDByName("XIcon"))}};return r.React.createElement(M,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(S,{title:"Credentials"},r.React.createElement(P,{spacing:4},r.React.createElement(z,{placeholder:"Last.fm Username",value:c("username"),onChange:function(n){k("username",n),e()},isClearable:!0}),r.React.createElement(z,{placeholder:"Last.fm API Key",value:c("apiKey"),onChange:function(n){k("apiKey",n),e()},secureTextEntry:!0,isClearable:!0}))),r.React.createElement(S,{title:"Actions"},r.React.createElement(u,{label:"Test Connection",subLabel:"Verify your Last.fm credentials",trailing:r.React.createElement(u.Arrow,null),onPress:t}),r.React.createElement(u,{label:"Get API Key",subLabel:"Create a Last.fm API key at last.fm/api/account/create",trailing:r.React.createElement(u.Arrow,null),onPress:async function(){try{await ne.Linking.openURL("https://www.last.fm/api/account/create")}catch(n){console.error("Failed to open Last.fm API URL:",n),I.showToast("Failed to open web browser. Please visit: https://www.last.fm/api/account/create",w.getAssetIDByName("XIcon"))}}}))))}function yt(){_.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(n){return n+1},0),t=async function(){I.showToast("Testing Libre.fm connection...",w.getAssetIDByName("ClockIcon"));try{await X.testService("librefm")?I.showToast("\u2705 Libre.fm connection successful!",w.getAssetIDByName("CheckIcon")):I.showToast("\u274C Libre.fm connection failed",w.getAssetIDByName("XIcon"))}catch{I.showToast("\u274C Connection error",w.getAssetIDByName("XIcon"))}};return r.React.createElement(M,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(S,{title:"Credentials"},r.React.createElement(P,{spacing:4},r.React.createElement(z,{placeholder:"Libre.fm Username",value:c("librefmUsername"),onChange:function(n){k("librefmUsername",n),e()},isClearable:!0}),r.React.createElement(z,{placeholder:"Libre.fm API Key",value:c("librefmApiKey"),onChange:function(n){k("librefmApiKey",n),e()},secureTextEntry:!0,isClearable:!0}))),r.React.createElement(S,{title:"Actions"},r.React.createElement(u,{label:"Test Connection",subLabel:"Verify your Libre.fm credentials",trailing:r.React.createElement(u.Arrow,null),onPress:t}),r.React.createElement(u,{label:"Get API Key",subLabel:"Create a Last.fm API key (compatible with Libre.fm)",trailing:r.React.createElement(u.Arrow,null),onPress:async function(){try{await ne.Linking.openURL("https://www.last.fm/api/account/create")}catch(n){console.error("Failed to open Last.fm API URL:",n),I.showToast("Failed to open web browser. Please visit: https://www.last.fm/api/account/create",w.getAssetIDByName("XIcon"))}}}))))}function mt(){_.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(n){return n+1},0),t=async function(){I.showToast("Testing ListenBrainz connection...",w.getAssetIDByName("ClockIcon"));try{await X.testService("listenbrainz")?I.showToast("\u2705 ListenBrainz connection successful!",w.getAssetIDByName("CheckIcon")):I.showToast("\u274C ListenBrainz connection failed",w.getAssetIDByName("XIcon"))}catch{I.showToast("\u274C Connection error",w.getAssetIDByName("XIcon"))}};return r.React.createElement(M,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(S,{title:"Credentials"},r.React.createElement(P,{spacing:4},r.React.createElement(z,{placeholder:"ListenBrainz Username",value:c("listenbrainzUsername"),onChange:function(n){k("listenbrainzUsername",n),e()},isClearable:!0}),r.React.createElement(z,{placeholder:"ListenBrainz Token (for private profiles)",value:c("listenbrainzToken"),onChange:function(n){k("listenbrainzToken",n),e()},secureTextEntry:!0,isClearable:!0}))),r.React.createElement(S,{title:"Actions"},r.React.createElement(u,{label:"Test Connection",subLabel:"Verify your ListenBrainz credentials",trailing:r.React.createElement(u.Arrow,null),onPress:t}),r.React.createElement(u,{label:"Get User Token",subLabel:"Get your ListenBrainz user token at listenbrainz.org/settings/",trailing:r.React.createElement(u.Arrow,null),onPress:async function(){try{await ne.Linking.openURL("https://listenbrainz.org/settings/")}catch(n){console.error("Failed to open ListenBrainz settings URL:",n),I.showToast("Failed to open web browser. Please visit: https://listenbrainz.org/settings/",w.getAssetIDByName("XIcon"))}}}))))}function vt(){_.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(t){return t+1},0);return r.React.createElement(M,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(S,{title:"Activity Display"},r.React.createElement(P,{spacing:4},r.React.createElement(z,{placeholder:`App Name (Default: ${h.DEFAULT_SETTINGS.appName})`,value:c("appName",h.DEFAULT_SETTINGS.appName),onChange:function(t){k("appName",t),e()},isClearable:!0}),r.React.createElement(z,{placeholder:`Update Interval (Default: ${h.DEFAULT_SETTINGS.timeInterval}s)`,value:String(c("timeInterval",h.DEFAULT_SETTINGS.timeInterval)),onChange:function(t){const n=Number(t);n>=h.MIN_UPDATE_INTERVAL&&(k("timeInterval",n),e())},keyboardType:"numeric",isClearable:!0}))),r.React.createElement(S,{title:"About Display Settings"},r.React.createElement(u,{label:"App Name",subLabel:"The name shown in Discord for your activity"}),r.React.createElement(u,{label:"Update Interval",subLabel:"How often the plugin checks for new tracks (in seconds)"}),r.React.createElement(u,{label:"Minimum Interval",subLabel:`The plugin will never check more frequently than ${h.MIN_UPDATE_INTERVAL} seconds`}))))}function wt(){_.useProxy(p.plugin.storage);const[e,t]=r.React.useState(null),[n,a]=r.React.useState(!0),[i,s]=r.React.useState(0),[l,g]=r.React.useState(!1),f={name:"Bohemian Rhapsody",artist:"Queen",artists:["Queen"],album:"A Night at the Opera",image:null,nowPlaying:!0,duration:354,startTime:Math.floor(Date.now()/1e3)-120},b=function(d){return d?Array.isArray(d)?d.filter(function(m){return m&&typeof m=="string"}):d["#text"]?d["#text"].split(/[,;&]/).map(function(m){return m.trim()}).filter(function(m){return m.length>0}):typeof d=="string"?d.split(/[,;&]/).map(function(m){return m.trim()}).filter(function(m){return m.length>0}):["Unknown Artist"]:["Unknown Artist"]},A=function(d){return!d||d.length===0?"Unknown Artist":d.length===1?d[0]:d.length===2?`${d[0]} & ${d[1]}`:`${d.slice(0,-1).join(", ")} & ${d[d.length-1]}`};r.React.useEffect(function(){(async function(){if(!c("username")||!c("apiKey")){t(f),g(!0),a(!1);return}try{a(!0);const d=await(await fetch(`https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=${c("username")}&api_key=${c("apiKey")}&format=json&limit=1`)).json();if(d.recenttracks&&d.recenttracks.track&&d.recenttracks.track.length>0){const m=d.recenttracks.track[0],j=b(m.artist);let tt=180;try{const Ut=j[0]||"Unknown Artist",me=await(await fetch(`https://ws.audioscrobbler.com/2.0/?method=track.getInfo&api_key=${c("apiKey")}&artist=${encodeURIComponent(Ut)}&track=${encodeURIComponent(m.name)}&format=json&username=${c("username")}`)).json();me.track&&me.track.duration&&(tt=Math.floor(me.track.duration/1e3))}catch{console.log("Could not fetch track duration, using default")}t({name:m.name||"Unknown Track",artist:A(j),artists:j,album:m.album?.["#text"]||"Unknown Album",image:m.image?.[2]?.["#text"]||m.image?.[1]?.["#text"]||null,nowPlaying:m["@attr"]?.nowplaying==="true",duration:tt,startTime:m["@attr"]?.nowplaying==="true"?Math.floor(Date.now()/1e3)-60:null}),g(!1)}else t(f),g(!0)}catch(d){console.error("Failed to fetch preview data, using fallback:",d),t(f),g(!0)}finally{a(!1)}})()},[c("username"),c("apiKey")]),r.React.useEffect(function(){if(!e?.nowPlaying||!c("showTimestamp"))return;const d=setInterval(function(){if(e.startTime&&e.duration){const m=Math.floor(Date.now()/1e3)-e.startTime,j=Math.min(m/e.duration,1);s(j)}},1e3);return function(){return clearInterval(d)}},[e,c("showTimestamp")]);const C=function(d){const m=Math.floor(d/60),j=Math.floor(d%60);return`${m}:${j.toString().padStart(2,"0")}`},N=function(){let d="";if(c("showAlbumInTooltip")&&e?.album&&(d+=`on ${e.album}`),c("showDurationInTooltip")&&e?.duration){const m=` \u2022 ${C(e.duration)}`;d?d+=m:d=C(e.duration)}return d||"No tooltip text"},y=function(){return e?.duration?e.nowPlaying?{current:i*e.duration,total:e.duration,progress:i}:{current:e.duration*.3,total:e.duration,progress:.3}:{current:0,total:0,progress:0}},x=c("listeningTo")?"Listening to":"Playing",L=c("appName","Music");if(n)return r.React.createElement(r.ReactNative.View,{style:v.container},r.React.createElement(r.ReactNative.View,{style:v.loadingContent},r.React.createElement(r.ReactNative.View,{style:v.loadingSpinner}),r.React.createElement(r.ReactNative.Text,{style:v.loadingText},"Loading preview...")));if(!e)return r.React.createElement(r.ReactNative.View,{style:v.container},r.React.createElement(r.ReactNative.Text,{style:v.centeredText},"Unable to load preview"));const D=y(),et=N();return r.React.createElement(r.ReactNative.View,{style:v.previewContainer},r.React.createElement(r.ReactNative.View,{style:v.header},r.React.createElement(r.ReactNative.Text,{style:v.activityType},x," ",L),r.React.createElement(r.ReactNative.Text,{style:v.rpcPreviewText,numberOfLines:1},"RPC Preview")),r.React.createElement(r.ReactNative.View,{style:v.content},r.React.createElement(r.ReactNative.View,{style:v.albumArt},e.image?r.React.createElement(r.ReactNative.Image,{source:{uri:e.image},style:v.albumImage,resizeMode:"cover"}):r.React.createElement(r.ReactNative.Text,{style:v.musicIcon},"\u{1F3B5}")),r.React.createElement(r.ReactNative.View,{style:v.trackInfo},r.React.createElement(r.ReactNative.Text,{style:v.trackName,numberOfLines:1},e.name),r.React.createElement(r.ReactNative.Text,{style:v.artistName,numberOfLines:1},e.artist),c("showLargeText")&&et!=="No tooltip text"&&r.React.createElement(r.ReactNative.Text,{style:v.tooltipText,numberOfLines:1},et),c("showTimestamp")&&e.duration&&r.React.createElement(r.ReactNative.View,{style:v.progressContainer},r.React.createElement(r.ReactNative.Text,{style:v.timeText},C(D.current)),r.React.createElement(r.ReactNative.View,{style:v.progressBar},r.React.createElement(r.ReactNative.View,{style:[v.progressFill,{width:`${D.progress*100}%`}]})),r.React.createElement(r.ReactNative.Text,{style:v.timeText},C(D.total))))))}const v=r.ReactNative.StyleSheet.create({container:{backgroundColor:"#1e1f22",borderRadius:12,padding:16,marginHorizontal:10,marginBottom:16,borderWidth:1,borderColor:"#3a3c41",alignItems:"center",justifyContent:"center",minHeight:120},loadingContent:{alignItems:"center",justifyContent:"center"},loadingSpinner:{width:20,height:20,borderRadius:10,borderWidth:2,borderColor:"#5865f2",borderTopColor:"transparent",marginBottom:8},previewContainer:{backgroundColor:"#1e1f22",borderRadius:12,padding:16,marginHorizontal:10,marginBottom:16,borderWidth:1,borderColor:"#3a3c41"},header:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:12,gap:8},content:{flexDirection:"row",alignItems:"center"},albumArt:{width:80,height:80,backgroundColor:"#2b2d31",borderRadius:12,justifyContent:"center",alignItems:"center",marginRight:16,borderWidth:1,borderColor:"#40444b",overflow:"hidden",flexShrink:0},trackInfo:{flex:1,minWidth:0},progressContainer:{flexDirection:"row",alignItems:"center",gap:8,marginTop:6},progressBar:{flex:1,height:2,backgroundColor:"#2b2d31",borderRadius:3,overflow:"hidden"},progressFill:{height:2,backgroundColor:"#5865f2",borderRadius:3},loadingText:{color:"#949ba4",fontSize:14,fontWeight:"500"},centeredText:{color:"#949ba4",fontSize:14,fontWeight:"500",textAlign:"center"},activityType:{color:"#dbdee1",fontSize:14,fontWeight:"600",flex:1},rpcPreviewText:{color:"#80848e",fontSize:12,fontStyle:"italic",flexShrink:0},albumImage:{width:80,height:80,borderRadius:12},musicIcon:{color:"#80848e",fontSize:32},trackName:{color:"#ffffff",fontSize:16,fontWeight:"700",marginBottom:4},artistName:{color:"#b5bac1",fontSize:14,fontWeight:"500",marginBottom:4},tooltipText:{color:"#80848e",fontSize:12,fontStyle:"italic",marginBottom:6},timeText:{color:"#80848e",fontSize:11,fontWeight:"500",minWidth:35,textAlign:"center"}});function Rt(){_.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(s){return s+1},0),t=c("listeningTo",h.DEFAULT_SETTINGS.listeningTo),n=c("showTimestamp",h.DEFAULT_SETTINGS.showTimestamp),a=function(){const s=!t;k("listeningTo",s),!s&&n&&k("showTimestamp",!1),e()},i=function(){t&&(k("showTimestamp",!n),e())};return r.React.createElement(M,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(wt,null),r.React.createElement(P,{spacing:8},r.React.createElement(S,{title:"RPC Display Options"},r.React.createElement(q,{label:"Show as Listening",subLabel:"Display as 'Listening to' instead of 'Playing'",checked:t,onPress:a}),r.React.createElement(q,{label:"Show Tooltip Text",subLabel:"Show album name and track duration in Discord activity tooltip",checked:c("showLargeText",!0),onPress:function(){const s=c("showLargeText",!0);k("showLargeText",!s),e()}}),!t&&r.React.createElement(u,{label:"Timestamp Unavailable",subLabel:"Enable 'Show as Listening' to use timestamp feature",disabled:!0,dimmed:!0}),r.React.createElement(q,{label:"Show Timestamp",subLabel:"Display track progress and duration",checked:n,onPress:i,disabled:!t}),r.React.createElement(q,{label:"Show Album in Tooltip",subLabel:"Include album name in the tooltip text",checked:c("showAlbumInTooltip",!0),onPress:function(){const s=c("showAlbumInTooltip",!0);k("showAlbumInTooltip",!s),e()}}),r.React.createElement(q,{label:"Show Duration in Tooltip",subLabel:"Include track duration in the tooltip text",checked:c("showDurationInTooltip",!0),onPress:function(){const s=c("showDurationInTooltip",!0);k("showDurationInTooltip",!s),e()}}))))}function Et(){_.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(s){return s+1},0),[t,n]=r.React.useState(""),a=function(){if(!t.trim()){I.showToast("Please enter an app name",w.getAssetIDByName("Small"));return}const s=c("ignoreList",[]);s.includes(t.trim())?I.showToast("App already in ignore list",w.getAssetIDByName("Warning")):(k("ignoreList",[...s,t.trim()]),n(""),e(),I.showToast("App added to ignore list",w.getAssetIDByName("Check")))},i=function(s){const l=c("ignoreList",[]);k("ignoreList",l.filter(function(g){return g!==s})),e(),I.showToast("App removed from ignore list",w.getAssetIDByName("Check"))};return r.React.createElement(M,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(S,{title:"Add App to Ignore"},r.React.createElement(P,{spacing:4},r.React.createElement(z,{placeholder:"Enter app name",value:t,onChange:n,isClearable:!0,onSubmitEditing:a,returnKeyType:"done"}))),r.React.createElement(S,null,r.React.createElement(u,{label:"Add to Ignore List",subLabel:"Add the current app name to your ignore list",trailing:r.React.createElement(u.Arrow,null),onPress:a})),c("ignoreList",[]).length>0&&r.React.createElement(S,{title:"Ignored Apps"},c("ignoreList",[]).map(function(s,l){return r.React.createElement(u,{key:l,label:s,trailing:r.React.createElement(r.ReactNative.TouchableOpacity,{onPress:function(){return i(s)},style:{padding:8,backgroundColor:"#ff4d4d",borderRadius:12,width:24,height:24,justifyContent:"center",alignItems:"center"}},r.React.createElement(r.ReactNative.Image,{source:w.getAssetIDByName("TrashIcon"),style:{width:14,height:14,tintColor:"#ffffff"}}))})})),r.React.createElement(S,{title:"About Ignore List"},r.React.createElement(u,{label:"How it Works",subLabel:"When any app in your ignore list is active, your music status will be hidden"}),r.React.createElement(u,{label:"Detection",subLabel:"Apps are detected by their Discord activity name"}),r.React.createElement(u,{label:"Examples",subLabel:"Spotify, YouTube Music, Kizzy, Metrolist, echo"}))))}function St(){_.useProxy(p.plugin.storage);const[,e]=r.React.useReducer(function(t){return t+1},0);return r.React.createElement(M,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(S,{title:"Logging Options"},r.React.createElement(Ce,{label:"Verbose Logging",subLabel:"Enable detailed console logging for debugging",value:c("verboseLogging",h.DEFAULT_SETTINGS.verboseLogging),onValueChange:function(t){k("verboseLogging",t),e()}})),r.React.createElement(S,{title:"Debug Information"},r.React.createElement(u,{label:"Console Logging",subLabel:"Logs are written to the browser/app console when verbose is enabled"}),r.React.createElement(u,{label:"Error Tracking",subLabel:"Connection errors and API failures are automatically logged"})),r.React.createElement(S,{title:"Log Information"},r.React.createElement(u,{label:"API Calls",subLabel:"All API requests are logged when verbose is enabled"}),r.React.createElement(u,{label:"Track Updates",subLabel:"Song changes and RPC updates are logged"}),r.React.createElement(u,{label:"Error Details",subLabel:"Connection errors and retries are logged"}))))}var Pe,Ne,$e,Ue,De,_e,ze,xe,Fe,Ve,Me,Be,Oe,Ke,je,Ge,qe;(Pe=p.plugin.storage).username??(Pe.username=""),(Ne=p.plugin.storage).apiKey??(Ne.apiKey=""),($e=p.plugin.storage).appName??($e.appName="Music"),(Ue=p.plugin.storage).timeInterval??(Ue.timeInterval=5),(De=p.plugin.storage).showTimestamp??(De.showTimestamp=!0),(_e=p.plugin.storage).listeningTo??(_e.listeningTo=!0),(ze=p.plugin.storage).verboseLogging??(ze.verboseLogging=!1),(xe=p.plugin.storage).service??(xe.service="lastfm"),(Fe=p.plugin.storage).librefmUsername??(Fe.librefmUsername=""),(Ve=p.plugin.storage).librefmApiKey??(Ve.librefmApiKey=""),(Me=p.plugin.storage).listenbrainzUsername??(Me.listenbrainzUsername=""),(Be=p.plugin.storage).listenbrainzToken??(Be.listenbrainzToken=""),(Oe=p.plugin.storage).addToSidebar??(Oe.addToSidebar=!0),(Ke=p.plugin.storage).showLargeText??(Ke.showLargeText=!0),(je=p.plugin.storage).ignoreList??(je.ignoreList=[]),(Ge=p.plugin.storage).showAlbumInTooltip??(Ge.showAlbumInTooltip=!0),(qe=p.plugin.storage).showDurationInTooltip??(qe.showDurationInTooltip=!0);const c=function(e,t){return p.plugin.storage[e]??t},k=function(e,t){return p.plugin.storage[e]=t},X=(function(){function e(){O(this,e)}return K(e,null,[{key:"getServiceDisplayName",value:function(t){switch(t){case"lastfm":return"Last.fm";case"librefm":return"Libre.fm";case"listenbrainz":return"ListenBrainz";default:return"Unknown"}}},{key:"testService",value:async function(t){try{switch(t){case"lastfm":return await this.testLastFmConnection();case"librefm":return await this.testLibreFmConnection();case"listenbrainz":return await this.testListenBrainzConnection();default:return!1}}catch(n){return console.error(`Error testing ${t}:`,n),!1}}},{key:"testLastFmConnection",value:async function(){const t=c("username"),n=c("apiKey");if(!t||!n)return!1;try{return!(await(await fetch(`https://ws.audioscrobbler.com/2.0/?method=user.getinfo&user=${t}&api_key=${n}&format=json`)).json()).error}catch(a){return console.error("Last.fm connection test failed:",a),!1}}},{key:"testLibreFmConnection",value:async function(){const t=c("librefmUsername"),n=c("librefmApiKey");if(!t||!n)return!1;try{return!(await(await fetch(`https://libre.fm/2.0/?method=user.getinfo&user=${t}&api_key=${n}&format=json`)).json()).error}catch(a){return console.error("Libre.fm connection test failed:",a),!1}}},{key:"testListenBrainzConnection",value:async function(){const t=c("listenbrainzUsername"),n=c("listenbrainzToken");if(!t)return!1;try{const a={"Content-Type":"application/json"};return n&&(a.Authorization=`Token ${n}`),(await fetch(`https://api.listenbrainz.org/1/user/${t}/listen-count`,{headers:a})).status===200}catch(a){return console.error("ListenBrainz connection test failed:",a),!1}}}]),e})();function Ye(){_.useProxy(p.plugin.storage);const e=r.NavigationNative.useNavigation(),[,t]=r.React.useReducer(function(i){return i+1},0),n=c("service"),a=function(i){switch(i){case"lastfm":return c("username")&&c("apiKey")?"\u2705 Configured":"\u274C Missing credentials";case"librefm":return c("librefmUsername")&&c("librefmApiKey")?"\u2705 Configured":"\u274C Missing credentials";case"listenbrainz":return c("listenbrainzUsername")?"\u2705 Configured":"\u274C Missing username";default:return"\u2753 Unknown"}};return r.React.createElement(M,{style:{flex:1},contentContainerStyle:{padding:10}},r.React.createElement(P,{spacing:8},r.React.createElement(S,{title:"Active Service"},r.React.createElement(u,{label:"Current Service",subLabel:n?`Using: ${X.getServiceDisplayName(n)}`:"No service selected"}),["lastfm","librefm","listenbrainz"].map(function(i){return r.React.createElement(q,{key:i,label:X.getServiceDisplayName(i),subLabel:a(i),checked:n===i,onPress:function(){i!==n&&(k("service",i),t())}})})),r.React.createElement(S,{title:"Service Configuration"},r.React.createElement(u,{label:"Last.fm Settings",subLabel:"Configure Last.fm credentials and options",trailing:r.React.createElement(u.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Last.fm Settings",render:bt})}}),r.React.createElement(u,{label:"Libre.fm Settings",subLabel:"Configure Libre.fm credentials and options",trailing:r.React.createElement(u.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Libre.fm Settings",render:yt})}}),r.React.createElement(u,{label:"ListenBrainz Settings",subLabel:"Configure ListenBrainz credentials and options",trailing:r.React.createElement(u.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"ListenBrainz Settings",render:mt})}})),r.React.createElement(S,{title:"Plugin Configuration"},r.React.createElement(u,{label:"Display Settings",subLabel:"Customize app name and update interval",trailing:r.React.createElement(u.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Display Settings",render:vt})}}),r.React.createElement(u,{label:"RPC Customization",subLabel:"Customize Discord rich presence display options",trailing:r.React.createElement(u.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"RPC Customization",render:Rt})}}),r.React.createElement(u,{label:"Ignore List",subLabel:"Configure apps that should hide your status",trailing:r.React.createElement(u.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Ignore List Settings",render:Et})}}),r.React.createElement(u,{label:"Logging Settings",subLabel:"Configure logging and debugging options",trailing:r.React.createElement(u.Arrow,null),onPress:function(){return e.push("VendettaCustomPage",{title:"Logging Settings",render:St})}}),r.React.createElement(Ce,{label:"Add to Sidebar",subLabel:"Show plugin in Discord settings",value:c("addToSidebar",!1),onValueChange:function(i){k("addToSidebar",i),t()}})),r.React.createElement(S,{title:"About"},r.React.createElement(u,{label:"Multi Scrobbler",subLabel:"Show off your music status from multiple services"}),r.React.createElement(u,{label:"Author",subLabel:"kmmiio99o"}),r.React.createElement(u,{label:"Version",subLabel:"1.3.2"}))))}const{FormSection:Tt,FormRow:de}=rt.Forms,{TableRowIcon:It}=F.findByProps("TableRowIcon"),H=window.bunny,We=H?.metro?.findByPropsLazy("getRootNavigationRef"),pe=H?.metro?.findByPropsLazy("SETTING_RENDERER_CONFIG"),Xe=H?.metro?.findByPropsLazy("createList"),He=H?.metro?.findByNameLazy("SettingsOverviewScreen",!1);function kt({tabs:e}){const t=r.NavigationNative.useNavigation();return r.React.createElement(de,{label:e.title(),leading:r.React.createElement(de.Icon,{source:e.icon}),trailing:r.React.createElement(r.React.Fragment,{},[e.trailing?e.trailing():null,r.React.createElement(de.Arrow,{key:"arrow"})]),onPress:function(){const n=e.page;t.navigate("VendettaCustomPage",{title:e.title(),render:function(){return r.React.createElement(n)}})}})}function At(e,t){try{t.push(J.after("default",H?.metro?.findByPropsLazy(["renderTitle","sections"],!1),function(n,a){const i=ae.findInReactTree(a.props.children,function(s){return s.type?.name==="UserSettingsOverview"});i&&t.push(J.after("render",i.type.prototype,function(s,l){const g=ae.findInReactTree(l.props.children,function(f){return f?.children?.[1]?.type===Tt})?.children;if(g){const f=g.findIndex(function(b){return["BILLING_SETTINGS","PREMIUM_SETTINGS"].includes(b?.props?.label)});g.splice(-~f||4,0,r.React.createElement(kt,{key:e.key,tabs:e}))}}))},!0))}catch(n){p.logger.info("Panel UI patch failed graciously \u{1F494}",n)}}function Lt(e,t){if(!pe||!We){console.warn("[LastFm] Missing required constants for tabs UI patch");return}const n={[e.key]:{type:"pressable",title:e.title,icon:e.icon,IconComponent:e.icon&&function(){return r.React.createElement(It,{source:e.icon})},usePredicate:e.predicate,useTrailing:e.trailing,onPress:function(){const s=We.getRootNavigationRef(),l=e.page;s.navigate("VendettaCustomPage",{title:e.title(),render:function(){return r.React.createElement(l)}})},withArrow:!0}};let a=pe.SETTING_RENDERER_CONFIG;Object.defineProperty(pe,"SETTING_RENDERER_CONFIG",{enumerable:!0,configurable:!0,get:function(){return{...a,...n}},set:function(s){return a=s}});const i=Symbol("pinToSettings meow meow");try{if(!Xe)return;t.push(J.after("createList",Xe,function(s,l){if(!s[0][i]){s[0][i]=!0;const[g]=s,f=g.sections?.find(function(b){return["Bunny","Revenge","Kettu","Vencore","ShiggyCord"].some(function(A){return b.label===A&&b.title===A})});f?.settings&&(f.settings=[...f.settings,e.key])}}))}catch{if(!He)return;t.push(J.after("default",He,function(s,l){if(!s[0][i]){s[0][i]=!0;const{sections:g}=ae.findInReactTree(l,function(b){return b.props?.sections}).props,f=g?.find(function(b){return["Bunny","Revenge","Kettu","Vencore","ShiggyCord"].some(function(A){return b.label===A&&b.title===A})});f?.settings&&(f.settings=[...f.settings,e.key])}}))}}function Ct(e){const t=[];let n=!1;const a=e.predicate||function(){return!0};return e.predicate=function(){return n?!1:a()},At(e,t),Lt(e,t),t.push(function(){return n=!0}),function(){for(const i of t)i()}}function Qe(){if(!p.plugin.storage.addToSidebar)return console.log("[Multi Scrobbler] Sidebar disabled in settings"),function(){};console.log("[Multi Scrobbler] Patching sidebar using custom patchSettingsPin...");try{const e=Ct({key:"LastFmScrobbler",icon:w.getAssetIDByName("MusicIcon"),title:function(){return"Multi Scrobbler"},predicate:function(){return p.plugin.storage.addToSidebar===!0},page:Ye});return console.log("[Multi Scrobbler] Successfully patched sidebar"),e}catch(e){return console.error("[Multi Scrobbler] Failed to patch sidebar:",e),function(){}}}var Je;const T={pluginStopped:!1,lastActivity:void 0,updateInterval:void 0,lastTrackUrl:void 0},he=[];let B;const Ze=h.DEFAULT_SETTINGS;for(const e of Object.keys(Ze))p.plugin.storage[e]=p.plugin.storage[e]??Ze[e];(Je=p.plugin.storage).addToSidebar??(Je.addToSidebar=!1);const o=new Proxy(p.plugin.storage,{get(e,t){return e[t]},set(e,t,n){return e[t]=n,!0}});let re=0;const be=3,Pt=5e3,E=function(...e){return console.log("[Scrobble Plugin]",...e)},ye=function(...e){return console.error("[Scrobble Plugin] Error:",...e)};async function Q(){try{await pt(),re=0,E("Plugin initialized successfully")}catch(e){ye("Initialization failed:",e),re++,re