function I(e,t,o){window.enmity.settings.set(e,t,o)}function B(e,t,o){return window.enmity.settings.get(e,t,o)}function q(e){window.enmity.plugins.registerPlugin(e)}const a=window.enmity.modules.common.Constants;window.enmity.modules.common.Clipboard,window.enmity.modules.common.Assets,window.enmity.modules.common.Messages,window.enmity.modules.common.Clyde,window.enmity.modules.common.Avatars;const E=window.enmity.modules.common.Native,n=window.enmity.modules.common.React;window.enmity.modules.common.Dispatcher;const p=window.enmity.modules.common.Storage,D=window.enmity.modules.common.Toasts,V=window.enmity.modules.common.Dialog;window.enmity.modules.common.Token;const P=window.enmity.modules.common.REST;window.enmity.modules.common.Settings,window.enmity.modules.common.Users,window.enmity.modules.common.Navigation,window.enmity.modules.common.NavigationNative,window.enmity.modules.common.NavigationStack,window.enmity.modules.common.Theme,window.enmity.modules.common.Linking;const R=window.enmity.modules.common.StyleSheet;window.enmity.modules.common.ColorMap,window.enmity.modules.common.Components,window.enmity.modules.common.Locale,window.enmity.modules.common.Profiles,window.enmity.modules.common.Lodash,window.enmity.modules.common.Logger,window.enmity.modules.common.Flux,window.enmity.modules.common.SVG,window.enmity.modules.common.Scenes;const{components:s}=window.enmity;s.Alert,s.Button,s.FlatList;const H=s.Image;s.ImageBackground,s.KeyboardAvoidingView,s.Modal,s.Pressable,s.RefreshControl;const J=s.ScrollView;s.SectionList,s.StatusBar,s.StyleSheet,s.Switch;const g=s.Text;s.TextInput,s.TouchableHighlight;const v=s.TouchableOpacity;s.TouchableWithoutFeedback,s.Touchable;const b=s.View;s.VirtualizedList,s.Form,s.FormArrow,s.FormCTA,s.FormCTAButton,s.FormCardSection,s.FormCheckbox;const M=s.FormDivider;s.FormHint,s.FormIcon,s.FormInput,s.FormLabel,s.FormRadio;const c=s.FormRow,U=s.FormSection;s.FormSelect,s.FormSubLabel;const K=s.FormSwitch;s.FormTernaryCheckBox,s.FormText,s.FormTextColors,s.FormTextSizes;const L={byProps:(...e)=>window.enmity.modules.filters.byProps(...e),byName:(e,t)=>window.enmity.modules.filters.byName(e,t),byTypeName:(e,t)=>window.enmity.modules.filters.byTypeName(e,t),byDisplayName:(e,t)=>window.enmity.modules.filters.byDisplayName(e,t)};function N(...e){return window.enmity.modules.bulk(...e)}function X(...e){return window.enmity.modules.getByProps(...e)}window.enmity.modules.common;const O=e=>{let t=0;for(let o in e)t++;return t};function r(e){return window.enmity.assets.getIDByName(e)}const u={Debug:r("debug"),Retry:r("ic_message_retry"),Failed:r("Small"),Cancel:r("ic_megaphone_nsfw_16px"),Add:r("add_white"),Delete:r("ic_message_delete"),Clear:r("ic_clear_all_24px"),Pencil:r("ic_pencil_24px"),Success:r("ic_selection_checked_24px"),Warning:r("ic_warning_24px"),Copy:r("toast_copy_link"),Open:r("ic_leave_stage"),Clipboard:r("pending-alert"),Initial:r("coffee"),Shield:r("ic_person_shield"),Debug_Command:{Sent:r("ic_application_command_24px"),Clock:r("clock")},Settings:{Toasts:{Context:r("toast_image_saved"),Settings:r("ic_selection_checked_24px")},Self:r("friends_toast_icon"),Share:r("share"),Robot:r("ic_robot_24px"),Commands:r("ic_profile_badge_bot_commands"),Debug:r("ic_rulebook_16px")}},F=e=>{D.open({content:`Copied ${e} to clipboard.`,source:u.Clipboard})},Q=e=>{let t=e.split(` `).map(o=>{if(o!="")return`"${o.replaceAll(":",'":"').replace(" ","")}",`});return t[0]=`{${t[0]}`,t[O(t)]=`${t[O(t)]}}`,t=t.join(""),t=t.replaceAll("undefined",""),t=t.split("").reverse().join("").replace(",","").split("").reverse().join(""),t};async function Z(){try{let e=await p.getItem("device_list");if(e)return JSON.parse(e);let t=(await P.get("https://gist.githubusercontent.com/adamawolf/3048717/raw/1ee7e1a93dff9416f6ff34dd36b0ffbad9b956e9/Apple_mobile_device_types.txt")).text,o=Q(t);await p.setItem("device_list",o);let i=await p.getItem("device_list");return JSON.parse(i)}catch(e){console.warn(`[SpinsPlugins Local Error \u2014 Issue when getting devices: ${e}]`);return}}async function ee(e,t,o){let i=await Z();return`**[${e}] Debug Information** > **Plugin Version:** ${t} > **Plugin Build:** ${o.split("-")[1]} > **Discord Build:** ${E.InfoDictionaryManager.Version} (${E.InfoDictionaryManager.Build}) > **Software Version:** ${E.DCDDeviceManager.systemVersion} > **Device:** ${i[E.DCDDeviceManager.device]}`}const{native:S}=window.enmity;function te(){S.reload()}S.version,S.build,S.device,S.version;const oe=X("transitionToGuild");async function ne({manifest:e}){const t=`${e.sourceUrl}?${Math.floor(Math.random()*1001)}.js`,o=await(await P.get(t)).text;let i=o.match(/\d\.\d\.\d+/g),l=o.match(/patch\-\d\.\d\.\d+/g);return!i||!l?T(e.name,e.version):(i=i[0],l=l[0],i!=e.version?C(t,i,l.split("-")[1],e,!1):l!=e.build?C(t,i,l.split("-")[1],e,!0):T(e.name,e.version))}const C=(e,t,o,i,l)=>{const w=l?o:t;V.show({title:"Update found",body:`A newer ${l?"build":"version"} is available for ${i.name}. ${l?` The version will remain at ${t}, but the build will update to ${o}.`:""} Would you like to install ${l?`build \`${o}\``:`version \`${t}\``} now?`,confirmText:"Update",cancelText:"Not now",onConfirm:()=>se(e,w,i,l)})},T=(e,t)=>{console.log(`[${e}] Plugin is on the latest version, which is ${t}`),D.open({content:`${e} is on latest version (${t})`,source:u.Success})};async function se(e,t,o,i){window.enmity.plugins.installPlugin(e,({data:l})=>{l=="installed_plugin"||l=="overridden_plugin"?V.show({title:`Updated ${o.name}`,body:`Successfully updated to ${i?"build":"version"} \`${t}\`. Would you like to reload Discord now?`,confirmText:"Yep!",cancelText:"Not now",onConfirm:()=>{te()}}):V.show({title:"Error",body:`Something went wrong while updating ${o.name}.`,confirmText:"Report this issue",cancelText:"Cancel",onConfirm:()=>{oe.openURL(`https://github.com/spinfal/enmity-plugins/issues/new?assignees=&labels=bug&template=bug_report.md&title=%5BBUG%5D%20${o.name}%20Update%20Error%3A%20${i?`b${t}`:`v${t}`}`)}})})}const $=window.enmity.modules.common.Components.General.Animated,[x,ie]=N(L.byProps("transitionToGuild"),L.byProps("setString")),m=R.createThemedStyleSheet({container:{paddingTop:30,paddingLeft:20,marginBottom:-5,flexDirection:"row"},text_container:{paddingLeft:15,paddingTop:5,flexDirection:"column",flexWrap:"wrap"},image:{width:75,height:75,borderRadius:10},main_text:{opacity:.975,letterSpacing:.25,fontFamily:a.Fonts.DISPLAY_NORMAL},header:{color:a.ThemeColorMap.HEADER_PRIMARY,fontFamily:a.Fonts.DISPLAY_BOLD,fontSize:25,letterSpacing:.25},sub_header:{color:a.ThemeColorMap.HEADER_SECONDARY,opacity:.975,fontSize:12.75}});var le=({manifest:e})=>{const t=n.useRef(new $.Value(1)).current,o=()=>{$.spring(t,{toValue:1.1,duration:250,useNativeDriver:!0}).start()},i=()=>{$.spring(t,{toValue:1,duration:250,useNativeDriver:!0}).start()},l=()=>{x.openURL("https://spin.rip/")},w={transform:[{scale:t}]};return n.createElement(n.Fragment,null,n.createElement(b,{style:m.container},n.createElement(v,{onPress:l,onPressIn:o,onPressOut:i},n.createElement($.View,{style:[w]},n.createElement(H,{style:[m.image],source:{uri:"https://cdn.spin.rip/r/l9uevwe4ia0.jpg"}}))),n.createElement(b,{style:m.text_container},n.createElement(v,{onPress:()=>{x.openURL(e.sourceUrl)}},n.createElement(g,{style:[m.main_text,m.header]},e.name," ")),n.createElement(b,{style:{flexDirection:"row"}},n.createElement(g,{style:[m.main_text,m.sub_header]},"A plugin by"),n.createElement(v,{onPress:()=>{x.openURL("https://spin.rip/")}},n.createElement(g,{style:[m.main_text,m.sub_header,{paddingLeft:4,fontFamily:a.Fonts.DISPLAY_BOLD}]},e.authors[0].name))),n.createElement(b,{style:{flexDirection:"row"}},n.createElement(g,{style:[m.main_text,m.sub_header]},"Settings page by"),n.createElement(v,{onPress:()=>{x.openURL("https://github.com/acquitelol/")}},n.createElement(g,{style:[m.main_text,m.sub_header,{paddingLeft:4,fontFamily:a.Fonts.DISPLAY_BOLD}]},"Rosie<3"))),n.createElement(b,null,n.createElement(v,{style:{flexDirection:"row"},onPress:()=>{ie.setString(`**${e.name}** v${e.version}`),F("plugin name and version")}},n.createElement(g,{style:[m.main_text,m.sub_header]},"Version:"),n.createElement(g,{style:[m.main_text,m.sub_header,{paddingLeft:4,fontFamily:a.Fonts.DISPLAY_BOLD}]},e.version," "))))))};const[ae,k]=N(L.byProps("transitionToGuild","openURL"),L.byProps("setString","getString")),h=R.createThemedStyleSheet({bottom_padding:{paddingBottom:25},icon:{color:a.ThemeColorMap.INTERACTIVE_NORMAL},item:{color:a.ThemeColorMap.TEXT_MUTED},text_container:{display:"flex",flexDirection:"column"}});var re=({manifest:e,settings:t,hasToasts:o,children:i,commands:l})=>n.createElement(J,null,n.createElement(le,{manifest:e}),i,l&&n.createElement(U,{title:"Plugin Commands"},l.map(w=>n.createElement(c,{label:`/${w.name}`,subLabel:w.description,leading:n.createElement(c.Icon,{style:h.icon,source:u.Settings.Commands}),trailing:c.Arrow,onPress:function(){k.setString(`/${w.name}`),F(`the command ${w.name}`)}}))),n.createElement(U,{title:"Utility"},o&&n.createElement(n.Fragment,null,n.createElement(c,{label:"Initialization Toasts",leading:n.createElement(c.Icon,{style:h.icon,source:u.Settings.Toasts.Context}),subLabel:`If available, show toasts when ${e.name} is starting`,trailing:n.createElement(K,{value:t.getBoolean(`${e.name}-toastEnable`,!1),onValueChange:()=>{t.toggle(`${e.name}-toastEnable`,!1),D.open({content:`Successfully ${t.getBoolean(`${e.name}-toastEnable`,!1)?"enabled":"disabled"} initialization toasts.`,source:u.Success})}})}),n.createElement(M,null)),n.createElement(c,{label:"Copy Debug Info",subLabel:`Copy useful debug information of ${e.name} to clipboard.`,leading:n.createElement(c.Icon,{style:h.icon,source:u.Settings.Debug}),trailing:c.Arrow,onPress:async function(){k.setString(await ee(e.name,e.version,e.build)),F("plugin debug information")}}),n.createElement(M,null),n.createElement(c,{label:"Clear Device List Cache",subLabel:"Remove the fetched device list storage. This will not clear Discord's or your iDevice's cache.",leading:n.createElement(c.Icon,{style:h.icon,source:u.Delete}),trailing:c.Arrow,onPress:async function(){await p.removeItem("device_list"),D.open({content:"Cleared device list storage.",source:u.Success})}})),n.createElement(U,{title:"Source"},n.createElement(c,{label:"Check for Updates",subLabel:`Check for any plugin updates for ${e.name}.`,leading:n.createElement(c.Icon,{style:h.icon,source:u.Copy}),trailing:c.Arrow,onPress:()=>{ne({manifest:e})}}),n.createElement(M,null),n.createElement(c,{label:"Source",subLabel:`View ${e.name} source code`,leading:n.createElement(c.Icon,{style:h.icon,source:u.Open}),trailing:c.Arrow,onPress:()=>{ae.openURL(`https://github.com/spinfal/enmity-plugins/tree/master/${e.name}`)}})),n.createElement(c,{style:h.bottom_padding,label:`Plugin Version: ${e.version} Plugin Build: ${e.build.split("-").pop()}`})),ce="CustomSlowmode",me="1.0.0",de="patch-1.0.6",ue="Add custom values to the slowmode slider or remove values that you do not want!",we=[{name:"spin",id:"308440976723148800"}],ge="#ff0069",he="https://raw.githubusercontent.com/spinfal/enmity-plugins/master/dist/CustomSlowmode.js",A={name:ce,version:me,build:de,description:ue,authors:we,color:ge,sourceUrl:he};function d(e,t,o,i){window.enmity.clyde.sendReply(e,t,o,i)}var W;(function(e){e[e.BuiltIn=0]="BuiltIn",e[e.Guild=1]="Guild",e[e.DM=2]="DM"})(W||(W={}));var y;(function(e){e[e.Chat=1]="Chat",e[e.User=2]="User",e[e.Message=3]="Message"})(y||(y={}));var f;(function(e){e[e.BuiltIn=0]="BuiltIn",e[e.BuiltInText=1]="BuiltInText",e[e.BuiltInIntegration=2]="BuiltInIntegration",e[e.Bot=3]="Bot",e[e.Placeholder=4]="Placeholder"})(f||(f={}));var G;(function(e){e[e.Role=1]="Role",e[e.User=2]="User"})(G||(G={}));var _;(function(e){e[e.SubCommand=1]="SubCommand",e[e.SubCommandGroup=2]="SubCommandGroup",e[e.String=3]="String",e[e.Integer=4]="Integer",e[e.Boolean=5]="Boolean",e[e.User=6]="User",e[e.Channel=7]="Channel",e[e.Role=8]="Role",e[e.Mentionnable=9]="Mentionnable",e[e.Number=10]="Number",e[e.Attachment=11]="Attachment"})(_||(_={}));var j;(function(e){e[e.ApplicationCommand=2]="ApplicationCommand",e[e.MessageComponent=3]="MessageComponent"})(j||(j={}));const ye={id:"add-slowmode-value",name:"slowmode add",displayName:"slowmode add",description:"Add a value to the slowmode list",displayDescription:"Add a value to the slowmode list",type:y.Chat,inputType:f.BuiltInText,options:[{name:"seconds",displayName:"seconds",description:"The new value (in seconds) that you want to add",displayDescription:"The new value (in seconds) that you want to add",type:_.Integer,required:!0}],execute:async function(e,t){const o=parseInt(e[e.findIndex(i=>i.name==="seconds")].value);try{if(a.SLOWMODE_VALUES.includes(o)){d(t?.channel.id??"0",`The value \`${o}\` already exists.`);return}else if(o<1){d(t?.channel.id??"0",`The value \`${o}\` must be greater than 0.`);return}a.SLOWMODE_VALUES.push(o),a.SLOWMODE_VALUES.sort((i,l)=>i-l),d(t?.channel.id??"0",`The value \`${o}\` has been added.`),I("_customSlowmode","slowmodeValues",a.SLOWMODE_VALUES)}catch(i){console.log("[ addSlowmodeValue Error ]",i),d(t?.channel.id??"0","An error occured while adding a slowmode value. Check debug logs for more info.")}}},fe={id:"list-slowmode-values",name:"slowmode list",displayName:"slowmode list",description:"List the values that are currently in the slowmode list",displayDescription:"List the values that are currently in the slowmode list",type:y.Chat,inputType:f.BuiltInText,options:[{name:"whisper",displayName:"whisper",description:"Only you can see the response",displayDescription:"Only you can see the response",type:_.Boolean,required:!1}],execute:async function(e,t){const o=e[e.findIndex(i=>i.name==="whisper")];try{const i={type:"rich",title:"Slowmode Values",description:a.SLOWMODE_VALUES?.length>0?a.SLOWMODE_VALUES.map(l=>`${l}s (${Math.floor(l/60)}m)`).join(` `):"No values found",footer:{text:"Not every value will work. This is a limitation set by Discord."},color:"0xff0069"};if(o?.value??!0){d(t?.channel.id??"0",{embeds:[i]});return}else return{content:a.SLOWMODE_VALUES?.length>0?a.SLOWMODE_VALUES.map(l=>`${l}s (${Math.floor(l/60)}m)`).join(` `):"No values found"}}catch(i){console.log("[ listSlowmodeValues Error ]",i),d(t?.channel.id??"0","An error occured while fetching and listing the slowmode values. Check debug logs for more info.")}}},ve={id:"remove-slowmode-value",name:"slowmode remove",displayName:"slowmode remove",description:"Remove a value to the slowmode list",displayDescription:"Remove a value to the slowmode list",type:y.Chat,inputType:f.BuiltInText,options:[{name:"value",displayName:"value",description:"The value that you want to remove",displayDescription:"The value that you want to remove",type:_.Integer,required:!0}],execute:async function(e,t){const o=parseInt(e[e.findIndex(i=>i.name==="value")].value);try{if(!a.SLOWMODE_VALUES.includes(o)){d(t?.channel.id??"0",`The value \`${o}\` does not exist.`);return}a.SLOWMODE_VALUES.splice(a.SLOWMODE_VALUES.indexOf(o),1),a.SLOWMODE_VALUES.sort((i,l)=>i-l),I("_customSlowmode","slowmodeValues",a.SLOWMODE_VALUES),d(t?.channel.id??"0",`The value \`${o}\` has been removed.`)}catch(i){console.log("[ removeSlowmodeValue Error ]",i),d(t?.channel.id??"0","An error occured while removing a slowmode value. Check debug logs for more info.")}}},be={id:"reset-slowmode-values",name:"slowmode reset",displayName:"slowmode reset",description:"Reset the slowmode values to Discord's default values",displayDescription:"Reset the slowmode values to Discord's default values",type:y.Chat,inputType:f.BuiltInText,execute:async function(e,t){try{const o=[0,5,10,15,30,60,120,300,600,900,1800,3600,7200,21600];if(a.SLOWMODE_VALUES=o,I("_customSlowmode","slowmodeValues",a.SLOWMODE_VALUES),a.SLOWMODE_VALUES===o&&B("_customSlowmode","slowmodeValues",null)===o){d(t?.channel.id??"0","Slowmode values have been reset to Discord's default values.");return}else{d(t?.channel.id??"0","An error occured while resetting the slowmode values.");return}}catch(o){console.log("[ resetSlowmodeValues Error ]",o),d(t?.channel.id??"0","An error occured while resetting the slowmode values. Check debug logs for more info.")}}},Y=[ye,ve,fe,be],z=[0,5,10,15,30,60,120,300,600,900,1800,3600,7200,21600],Se={...A,onStart(){this.commands=Y,a.SLOWMODE_VALUES=B("_customSlowmode","slowmodeValues",z)},onStop(){this.commands=[],a.SLOWMODE_VALUES=z},patches:[],getSettingsPanel({settings:e}){return n.createElement(re,{manifest:A,settings:e,hasToasts:!1,commands:Y})}};q(Se);