Last active
April 4, 2022 17:58
-
-
Save vmfunc/66641a6cb6f96d0a6db505ebda6b035f to your computer and use it in GitHub Desktop.
Testing stuff don't mind this
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){"use strict";function styleInject(e,o){void 0===o&&(o={});var t=o.insertAt;if(e&&"undefined"!=typeof document){var s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&s.firstChild?s.insertBefore(n,s.firstChild):s.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}var css_248z='.gm-store-card{background-color:var(--background-secondary);border-radius:8px;box-shadow:var(--elevation-medium);box-sizing:border-box;height:380px;margin:10px;padding:12px;position:relative;width:330px}.gm-store-card>:first-child{-webkit-user-drag:none;background-color:var(--background-secondary-alt);border-radius:8px 8px 0 0;height:200px;margin-left:-12px;margin-top:-12px;object-fit:contain;user-select:none;width:calc(100% + 24px)}.gm-store-card>:nth-child(2){background-color:rgba(0,0,0,.5);border-radius:16px;cursor:default;opacity:.95;padding-right:10px;position:absolute;right:10px;top:152px;width:fit-content}.gm-store-card>:nth-child(2).no-pfp{padding:0 8px}.gm-store-card>:nth-child(3){-webkit-line-clamp:1;margin-top:10px}.gm-store-card>:nth-child(3),.gm-store-card>:nth-child(4){-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden;width:85%}.gm-store-card>:nth-child(4){-webkit-line-clamp:3;clear:both;margin-top:5px}.gm-store-card>:nth-child(5){align-items:center;display:flex;flex-direction:column;margin-left:auto;order:2;position:absolute;right:12px;top:208px;width:calc(15% - 12px)}.gm-store-card>:nth-child(5)>:first-child{width:max-content}.gm-store-card>:nth-child(5)>:first-child>:first-child{font-size:18px;font-weight:600;position:relative;top:7px}.gm-store-card>:nth-child(5)>:first-child>:nth-child(2){margin-left:5px;position:relative;top:8px}.gm-store-card>:nth-child(5)>:nth-child(2){-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;line-break:anywhere;margin-top:20px;overflow:hidden;text-align:center;width:100%}.gm-store-card>:nth-child(6){bottom:12px;display:flex;gap:5px;position:absolute;width:calc(100% - 32px)}.gm-store-card>:nth-child(6)>:first-child{cursor:pointer;display:inline-flex;width:90px}.gm-store-card>:nth-child(6)>:nth-child(2){color:#ddd;cursor:pointer;display:inline-flex;margin-left:14px;min-width:0;padding:2px 5px;width:auto}.gm-store-card>:nth-child(6)>:nth-child(3){margin-top:4px;position:absolute;right:-10px}.gm-store-card>:nth-child(6)>:nth-child(3).hide-toggle{display:none!important}#gm-settings-inject>div,.gm-store-settings{align-items:center;display:flex;flex-flow:row wrap;justify-content:center}.gm-store-settings>h1{flex-basis:100%}.gm-inline-dropdown{align-items:center;display:flex;margin-left:12px}.gm-inline-dropdown>.select-2TCrqx{margin-left:8px;width:120px}.gm-settings-note-markdown{color:inherit!important;font-size:inherit}.gm-settings-note-markdown .paragraph-3Ejjt0{margin:0}.gm-settings-label-icon{vertical-align:sub}.gm-settings-label-text{margin-left:6px;vertical-align:top}.gm-settings-header-collapser{float:right;height:22px;margin-top:-3px;width:22px}.gm-settings-header-collapser.collapsed{transform:rotate(-90deg)}.gm-store-category{width:100%}.gm-store-category>:nth-child(2){display:grid;grid-auto-flow:column;grid-template-columns:repeat(auto-fill,350px);overflow-x:scroll;width:100%}.gm-store-header{margin-bottom:0;max-width:100%;width:100%}.gm-store-search{flex-grow:1;margin-right:12px}.gm-highlight #app-mount:after{box-shadow:0 0 0 99999px rgb(0 0 0/50%);content:"";display:block;z-index:9}.gm-highlight .content-3YMskv [id*=gm]{background:var(--background-modifier-selected);border-radius:0;filter:brightness(2);transition:all .5s;z-index:10}.gm-ootb-modal{width:600px}.gm-modules-preview .guildIcon-cyDh6h{display:none}.gm-modules-preview .cardHeader-2XrQbx{margin-bottom:12px}.gm-modules-preview .card-3_CqkU{background-color:var(--background-tertiary)}.gm-store-author-pfp{border-radius:50%;display:inline;margin-right:5px;vertical-align:bottom}.gm-store-author-name{line-height:32px}.gm-carousel-modal{background-color:var(--background-primary);border-radius:6px;padding:12px;pointer-events:all}.gm-carousel-modal .outer-s4sY2_{background-color:var(--background-secondary-alt);height:30vw;padding-top:0!important;width:50vw}.gm-carousel-modal .root-3tU4d2{background-color:unset}.gm-carousel-modal .smallCarouselImage-2Qvg9S{cursor:default}.gm-store-loading-container{align-items:center;display:flex;height:100%;justify-content:center}.gm-store-card-mini{height:74px;width:100%}.gm-store-card-mini>:first-child{background-color:unset;border-radius:0 8px 8px 0;height:100%;position:absolute;right:0;width:120px}.gm-store-card-mini>:nth-child(3){margin-top:0}.gm-store-card-mini>:nth-child(4){-webkit-line-clamp:1;width:75%}.gm-store-card-mini>:nth-child(2),.gm-store-card-mini>:nth-child(5),.gm-store-card-mini>:nth-child(6){display:none}.gm-modules-container{display:flex;flex-flow:row wrap;grid-template-columns:none;justify-content:center}.gm-repos-modal-icon-Verified{color:var(--status-positive-background)}.gm-repos-modal-icon-Alert{color:var(--status-danger-background)}.gm-repos-modal-icon-Alert .icon-1ihkOt{height:12px;width:12px}.gm-repos-modal-icon-Help{color:var(--status-warning-background)}.gm-error-boundary{display:flex;flex-flow:column;height:100%;width:100%}.gm-error-boundary>:first-child{display:flex;justify-content:center;width:100%}.gm-error-boundary>:first-child>:first-child{background-image:url(https://goosemod.com/img/goose_glitch.jpg);background-position:50%;background-repeat:no-repeat;background-size:contain;border-radius:50%;display:block;height:48px;margin-right:22px;object-fit:cover;overflow:hidden;pointer-events:none;width:48px}.gm-error-boundary>:first-child>:nth-child(2){margin-top:-2px}.gm-error-boundary>:first-child>:nth-child(2) .title-3KTIjF{color:var(--interactive-normal);font-family:var(--font-primary);margin-bottom:0;margin-left:1px}.gm-error-boundary>:nth-child(2){display:flex;gap:40px;justify-content:center;margin-top:28px;width:100%}.gm-error-boundary>:nth-child(3){align-items:center;color:var(--header-secondary);display:flex;justify-content:flex-end;margin-top:28px}.gm-error-boundary>:nth-child(3)>:first-child{height:24px;margin-right:4px;width:24px}.gm-error-boundary>:nth-child(4){margin-top:8px;width:100%}.gm-error-boundary>:nth-child(4) pre{margin-bottom:28px}.layer-v9HyYc{z-index:999}#gm-sponsor-modal .headerTitle-1_9Kor{background-image:url(https://goosemod.com/img/goose_gold.jpg);background-position:50%;background-repeat:no-repeat;background-size:contain;border-radius:50%;height:60px}#gm-sponsor-modal .headerTitle-1_9Kor:after{color:var(--text-normal);content:"GooseMod Sponsor";display:block;font-family:var(--font-display);font-size:24px;margin-left:70px;margin-top:6px;width:140px}#gm-sponsor-modal .guildBackground-3UtSZ2>svg:first-child{display:none}#gm-sponsor-modal .contentWrapper-3INYJy{padding:16px 8px 16px 16px}#gm-sponsor-modal .contentWrapper-3INYJy>div>div:not(:last-child){margin-bottom:32px}#gm-sponsor-modal .contentWrapper-3INYJy>div>.footer-2gL1pp{left:-16px;top:16px;width:calc(100% - 8px)}#gm-sponsor-modal .contentWrapper-3INYJy>div>div:first-child{color:var(--text-normal);font-family:var(--font-primary);font-size:16px;line-height:20px}';styleInject(css_248z);var sleep=e=>new Promise((o=>setTimeout(o,e)));const fromStr=e=>e.replace("rgb(","").replace(")","").split(", "),toStr=([e,o,t])=>`rgb(${e}, ${o}, ${t})`,light=(e,o)=>toStr(fromStr(e).map((e=>e*o))),gmColor="88, 101, 242",regionColor="114, 137, 218",makeRegionStyle=e=>`background-color: rgb(${e}); color: white; border-radius: 4px; border: 2px solid ${light(e,.5)}; padding: 3px 6px 3px 6px; font-weight: bold;`,debug=(e,...o)=>{const t=e.split("."),s=t.map((e=>`%c${e}%c`)),n=t.reduce((e=>e.concat(makeRegionStyle(regionColor),"")),[]);console.log(`%cGooseMod%c ${s.join(" ")}`,makeRegionStyle(gmColor),"",...n,...o)};var Logger={__proto__:null,debug:debug};let wpRequire;wpRequire=window.webpackJsonp.push([[],{get_require:(e,o,t)=>e.exports=t},[["get_require"]]]),delete wpRequire.m.get_require,delete wpRequire.c.get_require;const all=()=>Object.keys(wpRequire.c).map((e=>wpRequire.c[e].exports)).filter((e=>e)),find=e=>{for(const o of all()){if(o.default&&e(o.default))return o.default;if(e(o))return o}},findAll=e=>{const o=[];for(const t of all())t.default&&e(t.default)&&o.push(t.default),e(t)&&o.push(t);return o},findByProps=(...e)=>find((o=>e.every((e=>void 0!==o[e])))),findByPropsAll=(...e)=>findAll((o=>e.every((e=>void 0!==o[e])))),findByPrototypes=(...e)=>find((o=>o.prototype&&e.every((e=>void 0!==o.prototype[e])))),findByDisplayName=e=>find((o=>o.displayName===e)),common={React:findByProps("createElement"),ReactDOM:findByProps("render","hydrate"),Flux:findByProps("Store","CachedStore","PersistedStore"),FluxDispatcher:findByProps("_waitQueue","_orderedActionHandlers"),i18n:findByProps("Messages","_requestedLocale"),channels:findByProps("getSelectedChannelState","getChannelId"),constants:findByProps("API_HOST","CaptchaTypes")};var WebpackModules={__proto__:null,all:all,find:find,findAll:findAll,findByProps:findByProps,findByPropsAll:findByPropsAll,findByPrototypes:findByPrototypes,findByDisplayName:findByDisplayName,common:common},_GMErrorBoundary=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("Header"),t=goosemod.webpackModules.findByProps("Sizes","Colors","Looks","DropdownSizes"),s=goosemod.webpackModules.findByDisplayName("Markdown"),n=goosemod.webpackModules.findByDisplayName("DropdownArrow");return class extends e.PureComponent{constructor(e){super(e),this.state={error:!1}}componentDidCatch(e,o){console.log("honk",{error:e,moreInfo:o});const t=decodeURI(e.stack.split("\n").filter((e=>!e.includes("/assets/"))).join("\n")),s=decodeURI(o.componentStack.split("\n").slice(1,9).join("\n")),n=t.match(/\((.*) \| GM Module:/)?.[1]||s.match(/\((.*) \| GM Module:/)?.[1],a=n||(t.includes("GooseMod")||s.includes("GooseMod")?"GooseMod Internals":"Unknown"),r=n?"Plugin":"Cause";this.setState({error:!0,suspectedCause:{name:a,type:r},errorStack:{raw:e.stack,useful:t},componentStack:{raw:o.componentStack,useful:s}})}render(){return this.state.toRetry&&(this.state.error=!1),setTimeout((()=>{this.state.toRetry=!0}),100),this.state.error?e.createElement("div",{className:"gm-error-boundary"},e.createElement("div",{},e.createElement("div",{}),e.createElement(o,{size:o.Sizes.SIZE_24},"GooseMod has handled an error",e.createElement(s,{},`## Suspected ${this.state.suspectedCause.type}: ${this.state.suspectedCause.name}`))),e.createElement("div",{},e.createElement(t,{color:t.Colors.RED,size:t.Sizes.LARGE,onClick:()=>{location.reload()}},"Refresh")),e.createElement("div",{onClick:()=>{this.state.toRetry=!1,this.state.showDetails=!this.state.showDetails,this.forceUpdate()}},e.createElement("div",{style:{transform:`rotate(${this.state.showDetails?"0":"-90"}deg)`}},e.createElement(n,{width:24,height:24})),this.state.showDetails?"Hide Details":"Show Details"),this.state.showDetails?e.createElement("div",{},e.createElement(s,{},"# Error Stack"),e.createElement(s,{},`\`\`\`\n${this.state.errorStack.useful}\n\`\`\``),e.createElement(s,{},"# Component Stack"),e.createElement(s,{},`\`\`\`\n${this.state.componentStack.useful}\n\`\`\``)):null):this.props.children}}};let GMErrorBoundary;const generateIdSegment=()=>Math.random().toString(16).substring(2),generateId=(e=3)=>new Array(e).fill(0).map((()=>generateIdSegment())).join(""),modIndex={},isReactComponent=e=>!(!e||!e.prototype?.render&&!e.displayName),beforePatches=(e,o,t,s,n)=>{const a=modIndex[t][n].before;if(0===a.length)return o;let r=o;for(const n of a)try{let t=n.call(e,r);if(!1===t)return!1;Array.isArray(t)&&(r=o)}catch(e){console.error(`Before patch (${t} - ${s}) failed, skipping`,e)}return r},afterPatches=(e,o,t,s,n,a)=>{const r=modIndex[s][a].after;let i=t;for(const t of r)try{let s=t.call(e,o,i);s&&(i=s)}catch(e){console.error(`After patch (${s} - ${n}) failed, skipping`,e)}return i},generateNewFunction=(e,o,t,s)=>function(...n){const a=beforePatches(this,n,o,t,s);let r;if(Array.isArray(a)){const n=e.call(this,...a);r=afterPatches(this,a,n,o,t,s)}const{harden:i}=modIndex[o][s];if(i){GMErrorBoundary||(GMErrorBoundary=_GMErrorBoundary());const{React:e}=goosemod.webpackModules.common;return e.createElement(GMErrorBoundary,{},r)}return r},patch$a=(e,o,t,s=!1)=>{if(!e._goosemodPatcherId){const o=generateId();e._goosemodPatcherId=o,modIndex[o]={}}const n=e._goosemodPatcherId,a=`gm-${o}`;if(!modIndex[n][a]){const t=Object.assign({},e)[o];e[o]=Object.assign(generateNewFunction(e[o],n,o,a),t),e[o].toString=()=>t.toString();let s=!1;isReactComponent(e[o])&&(s=!0),e.render&&("render"!==o?patch$a(e,"render",(()=>{})):s=!0),modIndex[n][a]={before:[],after:[],harden:s}}const r=modIndex[n][a][s?"before":"after"].push(t);return()=>{modIndex[n][a][s?"before":"after"].splice(r-1,1)}},uninjectors$1={},inject=(e,o,t,s,n=!1)=>{uninjectors$1[e]=patch$a(o,t,s,n)},uninject=e=>!!uninjectors$1[e]&&(uninjectors$1[e](),!0),getReactInstance=e=>e&&e[Object.keys(e).find((e=>e.startsWith("__reactInternalInstance")||e.startsWith("__reactFiber$")))],getNodeInternals=e=>e&&e._reactInternalFiber||e._reactInternals,getOwnerInstance=e=>{let o=getReactInstance(e);for(;o.return;)if(o=o.return,o.stateNode?._reactInternals)return o.stateNode},findInTree=(e,o,t)=>{const{walkable:s=null,ignore:n=[]}=t;return e&&"object"==typeof e?"string"==typeof o?e[o]:o(e)?e:Array.isArray(e)?e.map((e=>findInTree(e,o,t))).find((e=>e)):(s||Object.keys(e)).map((s=>!n.includes(s)&&findInTree(e[s],o,t))).find((e=>e)):null},findInReactTree=(e,o)=>findInTree(e,o,{walkable:["props","children","child","sibling"]});var ReactUtils={__proto__:null,getReactInstance:getReactInstance,getNodeInternals:getNodeInternals,getOwnerInstance:getOwnerInstance,findInTree:findInTree,findInReactTree:findInReactTree};let goosemodScope$k={};const setThisScope$m=e=>{goosemodScope$k=e},labelToId=e=>e.toLowerCase().replace(/ /g,"-"),getInjectId=e=>`gm-cm-${e}`,patchTypeToNavId=e=>{switch(e){case"user":return"user-context";case"message":return"message";default:return e}},getExtraInfo=e=>{try{switch(e){case"message":return getNodeInternals(getOwnerInstance(document.getElementById("message"))).return.return.memoizedProps;case"message-actions":return getNodeInternals(getOwnerInstance(document.getElementById("message-actions"))).return.return.memoizedProps;case"user-context":return getNodeInternals(getOwnerInstance(document.getElementById("user-context"))).return.return.return.return.return.return.memoizedProps;default:return}}catch(e){return}},generateElement=(e,o,t,s,n,{Menu:a,React:r})=>{const i=void 0!==e.checked;e.id=e.id||labelToId(e.label);let d=o;"function"==typeof d&&(d=d()),d&&(d=d.map((e=>(e.originalAction||(e.originalAction=e.action),e)))),e.action=function(){return i?(e.checked=!e.checked,c.props.checked=e.checked,getOwnerInstance(document.getElementById(`${t}-${e.id}`)).props.onMouseEnter(),e.originalAction(arguments,n,e.checked)):e.originalAction(arguments,n)};const l=i?a.MenuCheckboxItem:a.MenuItem,c=void 0!==d?r.createElement(l,e,...d.map((e=>generateElement(e,e.sub,t,s,n,{Menu:a,React:r})))):r.createElement(l,e);return c},patch$9=(e,o)=>{const{React:t}=goosemodScope$k.webpackModules.common,s=goosemodScope$k.webpackModules.findByProps("MenuItem"),n=patchTypeToNavId(e);return o.originalAction=o.action,patch$a(s,"default",(a=>{const[{navId:r,children:i}]=a;if(r!==n&&("message"!==n||"message-actions"!==r))return a;if(findInReactTree(i,(e=>e&&e.props&&e.props.id===(o.id||labelToId(o.label)))))return a;const d=Object.assign({},o),l=generateElement(d,d.sub,n,e,Object.assign({},getExtraInfo(r)),{Menu:s,React:t});let c=findInReactTree(i,(e=>e&&e.props&&!0===e.props.goosemod));return c?(Array.isArray(c.props.children)||(c.props.children=[c.props.children]),c.props.children.push(l)):(c=t.createElement(s.MenuGroup,{goosemod:!0},l),i.push([t.createElement(s.MenuSeparator),c])),a}),!0)},uninjectors={},add$1=(e,o)=>{uninjectors[getInjectId(o.id||labelToId(o.label))]=patch$9(e,o)},remove$3=e=>{const o=getInjectId(labelToId(e));return!!uninjectors[o]&&(uninjectors[o](),!0)};var _contextMenu={__proto__:null,setThisScope:setThisScope$m,labelToId:labelToId,getInjectId:getInjectId,patchTypeToNavId:patchTypeToNavId,getExtraInfo:getExtraInfo,patch:patch$9,add:add$1,remove:remove$3};let goosemodScope$j={};const setThisScope$l=e=>{goosemodScope$j=e},patch$8=(e,o,t)=>{const{React:s}=goosemodScope$j.webpackModules.common,n=goosemodScope$j.webpackModules.findByDisplayName("Tooltip"),{icon:a}=goosemodScope$j.webpackModules.findByProps("icon","isHeader"),r=goosemodScope$j.webpackModules.find((e=>e.default&&"MiniPopover"===e.default.displayName));return patch$a(r,"default",((i,d)=>{const l=findInReactTree(d,(e=>e&&e.message));return l?(d.props.children.unshift(s.createElement(n,{position:"top",text:e},(({onMouseLeave:e,onMouseEnter:n})=>s.createElement(r.Button,{onClick:()=>{t(l)},onMouseEnter:n,onMouseLeave:e},"string"!=typeof o?o:s.createElement("img",{src:o,width:"24px",height:"24px",className:a}))))),d):d}))};var _miniPopover={__proto__:null,setThisScope:setThisScope$l,patch:patch$8};let goosemodScope$i={};const setThisScope$k=e=>{goosemodScope$i=e},patch$7=(e,o,t,{inUpload:s=!1,inReadonlyChannels:n=!1}={})=>{const{React:a}=goosemodScope$i.webpackModules.common,r=goosemodScope$i.webpackModules.findByDisplayName("Tooltip"),i=goosemodScope$i.webpackModules.findByProps("Looks","DropdownSizes"),d=goosemodScope$i.webpackModules.findByProps("button"),l=goosemodScope$i.webpackModules.findByProps("buttonWrapper","pulseButton"),c=goosemodScope$i.webpackModules.findByProps("button","textArea"),m=goosemodScope$i.webpackModules.find((e=>e.type&&e.type.render&&"ChannelTextAreaContainer"===e.type.render.displayName));return patch$a(m.type,"render",((m,p)=>{const g=findInReactTree(p,(e=>e&&e.className&&0===e.className.indexOf("buttons-")));return!g||!s&&!0===p.props.children[0].ref.current?.classList?.contains("channelTextAreaUpload-3t7EIx")||!n&&!0===p.props.children[0].ref.current?.classList?.contains("channelTextAreaDisabled-8rmlrp")||g.children.unshift(a.createElement("div",null,a.createElement(r,{position:"top",text:e},(({onMouseLeave:e,onMouseEnter:s})=>a.createElement(i,{look:i.Looks.BLANK,size:i.Sizes.ICON,onClick:()=>{t(g)},onMouseEnter:s,onMouseLeave:e},"string"!=typeof o?o:a.createElement("img",{src:o,width:"24px",height:"24px",className:`${c.button} ${d.contents} ${l.button}`})))))),p}))};var _channelTextAreaButtons={__proto__:null,setThisScope:setThisScope$k,patch:patch$7};let goosemodScope$h={},Commands;const setThisScope$j=e=>{goosemodScope$h=e,Commands=goosemodScope$h.webpackModules.findByProps("BUILT_IN_COMMANDS","BUILT_IN_SECTIONS");const o=goosemodScope$h.webpackModules.findByProps("useApplicationCommandsDiscoveryState");goosemodScope$h.patcher.patch(o,"useApplicationCommandsDiscoveryState",((e,o)=>{if(o.applicationCommandSections.find((e=>e.id===applicationId)))return;const t=o.commands.filter(((e,t)=>e.applicationId===applicationId&&o.commands.indexOf(e)===t)),s=Commands.BUILT_IN_SECTIONS[applicationId];return o.discoveryCommands.push(...t),o.discoverySections.push({data:t,section:s,key:applicationId}),o.applicationCommandSections.push(s),o}))},applicationId="827187782140428288",addSection=e=>Commands.BUILT_IN_SECTIONS[e.id]=e,removeSection=e=>delete Commands.BUILT_IN_COMMANDS[e],hasSection=e=>!!Commands.BUILT_IN_SECTIONS[e],add=(e,o,t,s=[])=>{const n=Commands;hasSection(applicationId)||addSection({id:applicationId,icon:"7f274cc3c1216505238ce047ce6e35e9",name:"GooseMod",type:1}),n.BUILT_IN_COMMANDS.push({applicationId:applicationId,type:0,target:1,description:o,name:e,execute:t,options:s,id:`-${Math.random().toString().split(".")[1].substring(0,5)}`})},remove$2=e=>{const o=Commands;o.BUILT_IN_COMMANDS=o.BUILT_IN_COMMANDS.filter((o=>o.name!==e));0===o.BUILT_IN_COMMANDS.filter((e=>e.applicationId===applicationId)).length&&removeSection(applicationId)};var _commands={__proto__:null,setThisScope:setThisScope$j,add:add,remove:remove$2};let goosemodScope$g={};const setThisScope$i=e=>{goosemodScope$g=e;const{BOT_AVATARS:o}=goosemodScope$g.webpackModules.findByProps("BOT_AVATARS","DEFAULT_AVATARS");o.GooseMod="https://cdn.discordapp.com/avatars/760559484342501406/5125aff2f446ad7c45cf2dfd6abf92ed.webp"},send=(e,o="GooseMod")=>{const{createBotMessage:t}=goosemodScope$g.webpackModules.findByProps("createBotMessage"),{getChannelId:s}=goosemodScope$g.webpackModules.findByProps("getChannelId"),{receiveMessage:n}=goosemodScope$g.webpackModules.findByProps("receiveMessage","sendBotMessage"),a=t(s(),"");"string"==typeof e?a.content=e:a.embeds.push(e),a.state="SENT",a.author.id="1",a.author.bot=!0,a.author.discriminator="0000",a.author.avatar="GooseMod",a.author.username=o,n(s(),a)};let notices$1=[],goosemodScope$f={},updateCall;const setThisScope$h=async e=>{goosemodScope$f=e;const o=goosemodScope$f.webpackModules.findByProps("base","sidebar");for(;void 0===document.getElementsByClassName(o.base)[0];)await sleep(10);const t=getOwnerInstance(document.getElementsByClassName(o.base)[0]),{React:s}=goosemodScope$f.webpackModules.common;class n extends s.PureComponent{constructor(e){super(e),this._updateCall=()=>this.forceUpdate()}componentDidMount(){updateCall=this._updateCall}componentWillUnmount(){}render(){return notices$1.length>0?notices$1.shift().react:null}}patch$a(t.props.children,"type",((e,o)=>(o.props.children[1].props.children.props.children.unshift(s.createElement(n)),o))),t.forceUpdate()},patch$6=(e,o,t,s="brand")=>{const n=goosemodScope$f.webpackModules.findByProps("colorDanger","notice")[`color${s[0].toUpperCase()+s.substring(1).toLowerCase()}`],a=goosemodScope$f.webpackModules.findByProps("NoticeCloseButton","NoticeButton"),{React:r}=goosemodScope$f.webpackModules.common,i=generateId(),d=r.createElement(a.default,{class:"goosemod-notice",id:i,color:n},r.createElement(a.NoticeCloseButton,{onClick:()=>{notices$1=notices$1.filter((e=>e.id!==i)),updateCall()}}),e,r.createElement(a.NoticeButton,{onClick:()=>{t()}},o));notices$1.push({react:d,id:i}),updateCall()};var _notices={__proto__:null,get notices(){return notices$1},setThisScope:setThisScope$h,patch:patch$6};let goosemodScope$e={};const setThisScope$g=e=>{goosemodScope$e=e},patch$5=(e,o,t,{atEnd:s=!1,showWhere:n=["dm","channel"]}={})=>{const{React:a}=goosemodScope$e.webpackModules.common,r=goosemod.webpackModules.findByProps("title","themed","icon","icon","iconBadge"),i=goosemodScope$e.webpackModules.find((e=>e.default&&"HeaderBar"===e.default.displayName));return patch$a(i,"default",((d,l)=>{const c=l.props.children.props.children[1].props.children.props.children;let m="other";if(null===c[1])m="home";else switch(c[0][1].key){case"mute":m="channel";break;case"calls":m="dm"}return n.includes(m)?(c[s?"push":"unshift"](a.createElement(i.Icon,{"aria-label":e,tooltip:e,disabled:!1,showBadge:!1,selected:!1,icon:()=>"string"!=typeof o?o:a.createElement("img",{src:o,width:"24px",height:"24px",className:`${r}.icon`}),onClick:()=>{t()}})),l):l}))};var _headerBarButtons={__proto__:null,setThisScope:setThisScope$g,patch:patch$5};let goosemodScope$d={};const setThisScope$f=e=>{goosemodScope$d=e},patch$4=(e,o,t,s=(()=>{}),{round:n=!1}={})=>{const{React:a}=goosemodScope$d.webpackModules.common,r=goosemodScope$d.webpackModules.findByDisplayName("Tooltip"),i=goosemodScope$d.webpackModules.findByDisplayName("Clickable"),d=goosemodScope$d.webpackModules.findByProps("profileBadge24","profileBadge22"),l=goosemodScope$d.webpackModules.find((e=>e.default&&"UserProfileBadgeList"===e.default.displayName));return patch$a(l,"default",(([{user:l,size:c}],m)=>{if(!t().includes(l.id))return m;let p=d.profileBadge24;switch(c){case 1:p=d.profileBadge22;break;case 2:p=d.profileBadge18}return m.props.children.unshift(a.createElement(r,{position:"top",text:e},(({onMouseLeave:e,onMouseEnter:t})=>a.createElement(i,{onClick:()=>{s()},onMouseEnter:t,onMouseLeave:e},a.createElement("div",{style:{backgroundImage:`url("${o}")`,borderRadius:n?"50%":""},className:`${d.profileBadge} ${p}`}))))),m}))};var _userBadges={__proto__:null,setThisScope:setThisScope$f,patch:patch$4};let goosemodScope$c={};const setThisScope$e=e=>{goosemodScope$c=e},patch$3=e=>{const o=goosemodScope$c.webpackModules.find((e=>e.default&&!e.default.displayName&&e.default.toString().indexOf("headerText")>-1));return patch$a(o,"default",((o,t)=>{const s=goosemod.reactUtils.findInReactTree(t,(e=>Array.isArray(e?.props?.children)&&e.props.children.find((e=>e?.props?.message))));return s.props.children.push(e(s.props.children[0].props)),t}))};var _username={__proto__:null,setThisScope:setThisScope$e,patch:patch$3};let goosemodScope$b={};const setThisScope$d=e=>{goosemodScope$b=e},patch$2=(e,o,t,s=(()=>{}),{round:n=!1}={})=>{const{React:a}=goosemodScope$b.webpackModules.common,r=goosemodScope$b.webpackModules.findByDisplayName("Tooltip"),i=goosemodScope$b.webpackModules.findByDisplayName("Clickable"),d=goosemodScope$b.webpackModules.findByProps("guildIconContainer"),l=goosemodScope$b.webpackModules.findByDisplayName("GuildHeader");return patch$a(l.prototype,"renderHeader",(function(l,c){return t().includes(this.props.guild?.id)?(c.props.children.unshift(a.createElement(r,{position:"top",text:e},(({onMouseLeave:e,onMouseEnter:t})=>a.createElement(i,{onClick:()=>{s()},onMouseEnter:t,onMouseLeave:e},a.createElement("div",{style:{backgroundImage:`url("${o}")`,borderRadius:n?"50%":"",width:"16px",height:"16px",backgroundRepeat:"no-repeat",backgroundSize:"contain",backgroundPosition:"50%",objectFit:"cover"},className:`${d.guildIconContainer}`}))))),c):c}))};var _guildBadges={__proto__:null,setThisScope:setThisScope$d,patch:patch$2};const contextMenu=_contextMenu,miniPopover=_miniPopover,channelTextAreaButtons=_channelTextAreaButtons,commands=_commands,internalMessage=send,notices=_notices,headerBarButtons=_headerBarButtons,userBadges=_userBadges,username=_username,guildBadges=_guildBadges,setThisScope$c=e=>{setThisScope$m(e),setThisScope$l(e),setThisScope$k(e),setThisScope$j(e),setThisScope$i(e),setThisScope$h(e),setThisScope$g(e),setThisScope$f(e),setThisScope$e(e),setThisScope$d(e)};var Patcher={__proto__:null,contextMenu:contextMenu,miniPopover:miniPopover,channelTextAreaButtons:channelTextAreaButtons,commands:commands,internalMessage:internalMessage,notices:notices,headerBarButtons:headerBarButtons,userBadges:userBadges,username:username,guildBadges:guildBadges,setThisScope:setThisScope$c,patch:patch$a,inject:inject,uninject:uninject};let goosemodScope$a={};const setThisScope$b=e=>{goosemodScope$a=e},patch$1=()=>{const{React:e}=goosemodScope$a.webpackModules.common,o=goosemodScope$a.webpackModules.findByProps("Sizes","AnimatedAvatar");goosemodScope$a.patcher.patch(o,"default",(([{src:e}],o)=>{if(e.includes("/avatars"))return o.props["data-user-id"]=e.match(/\/avatars\/([0-9]+)\//)[1],o})),goosemodScope$a.patcher.patch(o.AnimatedAvatar,"type",((t,s)=>e.createElement(o.default,{...s.props})))};var _avatar={__proto__:null,setThisScope:setThisScope$b,patch:patch$1};const avatar=_avatar,setThisScope$a=e=>{setThisScope$b(e)},patch=()=>{patch$1()};var Attrs={__proto__:null,avatar:avatar,setThisScope:setThisScope$a,patch:patch};const toastCSS=".gm-toasts {\n position: fixed;\n display: flex;\n top: 0;\n flex-direction: column;\n align-items: center;\n justify-content: flex-end;\n pointer-events: none;\n z-index: 4000;\n\n bottom: 80px;\n right: 40px;\n}\n\n@keyframes gm-toast-up {\n from {\n transform: translateY(0);\n opacity: 0;\n }\n}\n\n.gm-toast {\n animation: gm-toast-up 300ms ease;\n background: rgba(79,84,92,0.5);\n backdrop-filter: blur(2px);\n padding: 22px;\n border-radius: 6px;\n box-shadow: var(--elevation-high);\n font-weight: 500;\n color: #fff;\n user-select: text;\n font-size: 20px;\n opacity: 1;\n margin-top: 40px;\n pointer-events: none;\n user-select: none;\n\n width: 280px;\n text-align: left;\n\n overflow-wrap: break-word;\n}\n\n.gm-toast > :first-child {\n margin-bottom: 12px;\n}\n\n.gm-toast > :last-child {\n color: var(--header-secondary);\n font-size: 18px;\n}\n\n@keyframes gm-toast-down {\n to {\n transform: translateY(0px);\n opacity: 0;\n }\n}\n\n.gm-toast.closing {\n animation: gm-toast-down 200ms ease;\n animation-fill-mode: forwards;\n opacity: 1;\n transform: translateY(-10px);\n}\n\n\n.gm-toast.toast-info {\n background-color: hsla(197,calc(var(--saturation-factor, 1)*100%),47.8%, 0.5);\n}\n\n.gm-toast.toast-success {\n background-color: hsla(139,calc(var(--saturation-factor, 1)*66.8%),58.6%, 0.5);\n}\n\n.gm-toast.toast-danger,\n.gm-toast.toast-error {\n background-color: hsla(359,calc(var(--saturation-factor, 1)*82.6%),59.4%, 0.5);\n}\n\n.gm-toast.toast-warning,\n.gm-toast.toast-warn {\n background-color: hsla(38,calc(var(--saturation-factor, 1)*95.7%),54.1%, 0.5);\n}",styleSheet=document.createElement("style");styleSheet.textContent=toastCSS,document.head.appendChild(styleSheet);var showToast=(e,o={})=>{if(o?.type?.startsWith("debug")){if(!goosemod.settings.gmSettings.get().debugToasts)return;o.type=o.type.replace("debug","")}if(!document.querySelector(".gm-toasts")){const e=document.createElement("div");e.classList.add("gm-toasts"),document.querySelector("#app-mount").appendChild(e)}let{subtext:t="",type:s="",timeout:n=3e3}=o;n*=1.5;const a=document.createElement("div");a.classList.add("gm-toast"),s&&a.classList.add("toast-"+s);const r=document.createElement("div");r.textContent=e,a.appendChild(r);const i=document.createElement("div");i.textContent=t,a.appendChild(i),document.querySelector(".gm-toasts").appendChild(a);const d=()=>{a.classList.add("closing"),setTimeout((()=>{a.remove(),document.querySelectorAll(".gm-toasts .gm-toast").length||document.querySelector(".gm-toasts").remove()}),300)};return setTimeout(d,n),{toastElem:a,closeFn:d}};let goosemodScope$9={};const setThisScope$9=e=>{goosemodScope$9=e},show$1=(e,o,t,s,n)=>new Promise((a=>{const{React:r}=goosemodScope$9.webpackModules.common,{findByDisplayName:i,findByProps:d}=goosemodScope$9.webpackModules,l=i("Text"),c=i("Markdown"),m=d("button","colorRed");(0,d("openModal").openModal)((p=>(3===p.transitionState&&a(!1),r.createElement(i("ConfirmModal"),{header:o,confirmText:e,cancelText:s||d("Messages").Messages.CANCEL,confirmButtonColor:m[`color${n?n[0].toUpperCase()+n.substring(1).toLowerCase():"Red"}`],onClose:()=>{a(!1)},onCancel:()=>{a(!1),p.onClose()},onConfirm:()=>{a(!0),p.onClose()},transitionState:p.transitionState},...t.split("\n").map((e=>r.createElement(c,{size:l.Sizes.SIZE_16},e)))))))}));let goosemodScope$8={},showHideMod={},originalChangelog={};const setThisScope$8=e=>{goosemodScope$8=e,showHideMod=goosemodScope$8.webpackModules.findByProps("showChangeLog");const o=goosemodScope$8.webpackModules.findByProps("changeLog").changeLog;originalChangelog=Object.assign({},o)},showChangelog=()=>{showHideMod.showChangeLog()},hideChangelog=()=>{showHideMod.hideChangeLog()},resetChangelog=()=>{setChangelog(originalChangelog)},setChangelog=e=>{const o=goosemodScope$8.webpackModules.findByProps("changeLog"),t={template:"standard",revision:1,locale:"en-us",...e};for(const e of Object.keys(o.changeLog))delete o.changeLog[e];for(const e of Object.keys(t))o.changeLog[e]=t[e]};var Changelog={__proto__:null,setThisScope:setThisScope$8,showChangelog:showChangelog,hideChangelog:hideChangelog,resetChangelog:resetChangelog,setChangelog:setChangelog};const image="https://wallpaperaccess.com/full/1890776.jpg";let version,generated,goosemodScope$7={};const setThisScope$7=e=>{goosemodScope$7=e},show=async()=>{generated||generate(),goosemodScope$7.changelog.resetChangelog(),goosemodScope$7.changelog.setChangelog(generated),goosemodScope$7.changelog.showChangelog(),await sleep(300);const e=()=>{document.querySelector(".modal-1TF_VN .size20-17Iy80").textContent=`MirukuClient ${version}`,document.querySelector(".modal-1TF_VN .footer-2gL1pp").remove()};e(),goosemodScope$7.changelog.resetChangelog(),setTimeout(e,300)},generate=()=>{const e=JSON.parse("{\"version\":\"v11.1\",\"date\":\"2021-08-10\r\",\"body\":\"Store {added marginTop}\\n======================\\n\\n* **Repos modal now has a new header.** Now reports statistics of repos (theme, plugin, and developer count) and matches Discord's new styling.\\n* **Removed toast appearing on module updates.**\\n\\nSettings {added}\\n======================\\n\\n* **Removed GM Storage Impl from settings sidebar.** Also added it to \\\"Copy Debug Info\\\" setting output.\\n\\nTweaks and Fixes {progress}\\n======================\\n\\n* **Fixed Tour crashing.**\\n* **Fixed some plugins failing to save settings.**\\n* **Changed how settings implementation is chosen to use extension variable.**\\n* **Fixed being unable to open Store in Home if no DMs are in sidebar.**\\n* **Fixed Snippets mistakenly appearing if Store in Home is disabled.**\\n* **Fixed Store in settings hiding all plugins and themes.**\\n* **Fixed Store categories sorting being interferred with by sort by dropdown.**\"}");version=e.version,generated={image:image,date:e.date,body:e.body}};var GoosemodChangelog={__proto__:null,setThisScope:setThisScope$7,show:show,generate:generate};let enabled=!1,todo=["themes","plugins"];const done=e=>{todo.splice(todo.indexOf(e),1)},themes=async()=>{const e=(await Promise.resolve().then((function(){return modulesPreview$1}))).default(),{React:o}=goosemod.webpackModules.common,t=goosemod.webpackModules.findByDisplayName("Header"),s=goosemod.webpackModules.findByDisplayName("Text"),n=goosemod.moduleStoreAPI.modules.filter((e=>e.tags.includes("theme")&&e.images&&e.images[0])).sort(((e,o)=>o.github.stars-e.github.stars)),a=Math.floor(Math.random()*(n.length-5));goosemod.webpackModules.findByProps("show").show({className:"gm-ootb-modal",title:"Themes\$#",confirmText:"Browse Themes\$#",onConfirm:async()=>{0===goosemod.ootb.todo.length&&(await sleep(2e3),goosemod.ootb.settings())},body:o.createElement("div",{className:"container-1rn8Cv"},o.createElement(e,{modules:n.slice(a,a+3)}),o.createElement(t,{className:"header-2MiVco",size:t.Sizes.SIZE_24},"Beautify your Discord with Themes\$#"),o.createElement(s,{className:"byline-3REiHf",size:s.Sizes.SIZE_16,color:s.Colors.HEADER_SECONDARY},"Pick from over 100 themes to tweak and enhance your user interface\$#"))})},plugins=async()=>{const e=(await Promise.resolve().then((function(){return modulesPreview$1}))).default(),{React:o}=goosemod.webpackModules.common,t=goosemod.webpackModules.findByDisplayName("Header"),s=goosemod.webpackModules.findByDisplayName("Text"),n=goosemod.moduleStoreAPI.modules.filter((e=>!e.tags.includes("theme")&&e.images&&e.images[0])).sort(((e,o)=>o.github.stars-e.github.stars)),a=Math.floor(Math.random()*(n.length-5));goosemod.webpackModules.findByProps("show").show({className:"gm-ootb-modal",title:"Plugins\$#",confirmText:"Browse Plugins\$#",onConfirm:async()=>{0===goosemod.ootb.todo.length&&(await sleep(2e3),goosemod.ootb.settings())},body:o.createElement("div",{className:"container-1rn8Cv"},o.createElement(e,{modules:n.slice(a,a+3)}),o.createElement(t,{className:"header-2MiVco",size:t.Sizes.SIZE_24},"Amplify your Discord under the hood\$#"),o.createElement(s,{className:"byline-3REiHf",size:s.Sizes.SIZE_16,color:s.Colors.HEADER_SECONDARY},"Plugins augment your experience with improvements in the app itself\$#"))})},store=async()=>{const e=(await Promise.resolve().then((function(){return modulesPreview$1}))).default(),{React:o}=goosemod.webpackModules.common,t=goosemod.webpackModules.findByProps("transitionTo"),s=goosemod.webpackModules.findByDisplayName("Header"),n=goosemod.webpackModules.findByDisplayName("Text"),a=goosemod.moduleStoreAPI.modules.filter((e=>e.images&&e.images[0])).sort(((e,o)=>o.github.stars-e.github.stars)),r=Math.floor(Math.random()*(a.length-5));goosemod.webpackModules.findByProps("show").show({className:"gm-ootb-modal",title:"Only for Goosemod Plugin Store",confirmText:"View Store in Home\$#",onConfirm:async()=>{t.transitionTo("/channels/@me"),await sleep(100),document.body.classList.add("gm-highlight"),await sleep(3e3),document.body.classList.remove("gm-highlight")},body:o.createElement("div",{className:"container-1rn8Cv"},o.createElement(e,{modules:a.slice(r,r+3)}),o.createElement(s,{className:"header-2MiVco",size:s.Sizes.SIZE_24},"Browse Themes and Plugins in the Store\$#"),o.createElement(n,{className:"byline-3REiHf",size:n.Sizes.SIZE_16,color:n.Colors.HEADER_SECONDARY},"GooseMod uses it\'s own Store, where you can easily look around and install\$#"))})},settings=async()=>{const e=(await Promise.resolve().then((function(){return modulesPreview$1}))).default(),{React:o}=goosemod.webpackModules.common,t=goosemod.webpackModules.findByDisplayName("Header"),s=goosemod.webpackModules.findByDisplayName("Text");goosemod.webpackModules.findByProps("show").show({className:"gm-ootb-modal",title:"Settings\$#",confirmText:"View GooseMod Settings\$#",onConfirm:async()=>{goosemod.settings.openSettings(),await sleep(20),document.querySelector('[aria-controls="gm-#terms.settings#-tab"]').click();const e=document.querySelector(".sidebarRegionScroller-3MXcoP");for(e.scrollTop=e.offsetHeight-270;document.querySelector(".closeButton-1tv5uR");)await sleep(100);goosemod.ootb.community()},body:o.createElement("div",{className:"container-1rn8Cv"},o.createElement(e,{modules:[{name:"Experimental Features\$#",description:"Try out new experimental features\$#"},{name:"Utilities\$#",description:"Make backups, reset GooseMod, and more\$#"},{name:"Tweaks\$#",description:"Tweak GooseMod to how you want it\$#"}]}),o.createElement(t,{className:"header-2MiVco",size:t.Sizes.SIZE_24},"Use GooseMod\'s Settings to customise it\'s features\$#"),o.createElement(s,{className:"byline-3REiHf",size:s.Sizes.SIZE_16,color:s.Colors.HEADER_SECONDARY},"There are various options for you to change\$#"))})},community=async()=>{const e=(await Promise.resolve().then((function(){return modulesPreview$1}))).default(),{React:o}=goosemod.webpackModules.common,t=goosemod.webpackModules.findByDisplayName("Header"),s=goosemod.webpackModules.findByDisplayName("Text");goosemod.webpackModules.findByProps("show").show({className:"gm-ootb-modal",title:"Community\$#",confirmText:"Join our Discord server\$#",onConfirm:()=>{window.open("https://discord.gg/pKUe35krcZ")},body:o.createElement("div",{className:"container-1rn8Cv"},o.createElement(e,{modules:[{name:"Ask Questions\$#",description:"Ask any questions and get support\$#"},{name:"News\$#",description:"Get the latest news and announcements\$#"},{name:"Get Involved\$#",description:"Help out with suggestions, supporting others, and more\$#"}]}),o.createElement(t,{className:"header-2MiVco",size:t.Sizes.SIZE_24},"Join our Community\$#"),o.createElement(s,{className:"byline-3REiHf",size:s.Sizes.SIZE_16,color:s.Colors.HEADER_SECONDARY},"Join our Discord for further information and more\$#"))})},start=async()=>{const e=(await Promise.resolve().then((function(){return modulesPreview$1}))).default(),{React:o}=goosemod.webpackModules.common,t=goosemod.webpackModules.findByDisplayName("Header"),s=goosemod.webpackModules.findByDisplayName("Text");goosemod.webpackModules.findByProps("show").show({className:"gm-ootb-modal",title:"Miruku",confirmText:"Learn More\$#",cancelText:"Not Interested\$#",onConfirm:()=>{goosemod.ootb.enabled=!0,goosemod.ootb.store()},body:o.createElement("div",{className:"container-1rn8Cv"},o.createElement(e,{modules:[{name:"#terms.community#",description:"Join our Discord to ask questions, give feedback, keep up to date with news, and more\$#"}]}),o.createElement(t,{className:"header-2MiVco",size:t.Sizes.SIZE_24},"Welcome to the MirukuClient !\$#"),o.createElement(s,{className:"byline-3REiHf",size:s.Sizes.SIZE_16,color:s.Colors.HEADER_SECONDARY},"You successfully installed the Miruku Client.\$#"))})};var OOTB={__proto__:null,enabled:enabled,todo:todo,done:done,themes:themes,plugins:plugins,store:store,settings:settings,community:community,start:start};const setThisScope$6=e=>{},startLoadingScreen=()=>{},updateLoadingScreen=e=>{},stopLoadingScreen=()=>{};let cache;const defaultSettings={changelog:!0,separators:!0,gmBadges:!0,attrs:!1,home:!1,devchannel:!1,snippets:!1,autoupdate:!1,allThemeSettings:!1,debugToasts:!1},get$2=()=>cache||(cache=JSON.parse(goosemod.storage.get("mirukuGMSettings"))||defaultSettings,cache={...defaultSettings,...cache},cache),set$2=(e,o)=>{const t=get$2();t[e]=o,goosemod.storage.set("mirukuGMSettings",JSON.stringify(t)),cache=t};var GMSettings={__proto__:null,get:get$2,set:set$2},addToHome=async e=>{const{React:o,ReactDOM:t}=e.webpackModules.common,s=e.webpackModules.find((e=>e.default&&"ConnectedPrivateChannelsList"===e.default.displayName)),n=e.webpackModules.findByDisplayName("ListSectionItem"),{LinkButton:a}=e.webpackModules.findByProps("LinkButton"),r=e.webpackModules.findByProps("selected","wrappedName"),i=e.webpackModules.findByProps("channel","linkButtonIcon"),d=e.webpackModules.findByProps("headerText","privateChannelsHeaderContainer"),l=e.webpackModules.findByProps("icon","iconBadge","title"),c=e.webpackModules.findByProps("scrollerBase","auto"),m={themes:o.createElement(e.webpackModules.findByDisplayName("Eye"),{width:24,height:24}),plugins:o.createElement(e.webpackModules.findByDisplayName("InlineCode"),{width:24,height:24}),snippets:o.createElement(e.webpackModules.findByDisplayName("Pictures"),{width:24,height:24}),expandable:o.createElement(goosemod.webpackModules.findByDisplayName("DropdownArrow"),{className:`${l.icon}`,width:24,height:24})},p=(await Promise.resolve().then((function(){return header$3}))).default(),g=e.webpackModules.findByDisplayName("LoadingPopout"),u=(e,t,s)=>o.createElement(p,{icon:e,title:t,id:s}),h=(e,t)=>o.createElement("div",{className:e?"":`${c.auto}`,id:"gm-settings-inject",style:{padding:"22px",backgroundColor:"var(--background-primary)",height:"100%",overflow:e?"":"hidden scroll"}},t),f=e.webpackModules.findByProps("transitionTo"),S=(e,o,t=0)=>{if(t>5)return!1;const s=e.parentElement;return s.classList.contains(o)&&s||S(s,o,t+1)};let y=goosemod.storage.get("goosemodHomeExpanded")||!0,b={plugins:e.settings.items.find((e=>"#terms.store.plugins#"===e[1])),themes:e.settings.items.find((e=>"#terms.store.themes#"===e[1])),snippets:e.settings.items.find((e=>"Snippets\$#"===e[1]))},w={plugins:e.settings._createItem(b.plugins[1],b.plugins[2],!1),themes:e.settings._createItem(b.themes[1],b.themes[2],!1),snippets:e.settings._createItem(b.snippets[1],b.snippets[2],!1)};const x=(s,n)=>{const a=[...document.querySelector(".content-98HsJk").children].find(((e,o)=>0!==o&&!e.classList.contains("erd_scroll_detection_container")));for(const e of document.querySelector(".scroller-1JbKMe").children[0].children)e.className?.replace&&(e.className=e.className.replace(r.selected,r.clickable));setTimeout((()=>{const e=document.getElementById(`gm-home-${n}`);e.className=e.className.replace(r.clickable,r.selected)}),0);const i="snippets"!==n&&Array.isArray(w[n].props.children)?w[n].props.children.filter((e=>"card"===e.props.type)).length:0,d="snippets"!==n?e.moduleStoreAPI.modules.filter((e=>"plugins"===n?!e.tags.includes("theme"):e.tags.includes("theme"))).length:0;if((i!==d||e.settings[`regen${n}`])&&(delete e.settings[`regen${n}`],w[n]=o.createElement("div",{className:"gm-store-loading-container"},o.createElement(g)),(async()=>{"snippets"!==n&&b[n][2].filter((e=>"card"===e.type)).length!==d&&await e.moduleStoreAPI.updateStoreSetting(),w[n]=e.settings._createItem(b[n][1],b[n][2],!1),document.querySelector(`#gm-home-${n}`).click()})()),1===a.children.length&&t.render(((e,t,s,n)=>o.createElement("div",{style:{height:"100%",overflow:"hidden"}},u(e,t,s),h(!1,n)))(m[n],s,n,w[n]),a.children[0]),2===a.children.length||3===a.children.length){let e=a.children.length-2;const o=a.children[e+1].classList.contains("stickyScroller-24zUyY");o&&(e=0),a.children[e+0].className="",t.render(u(m[n],s,n),a.children[e+0]),0!==e&&a.children[e+1].children[1]&&(a.children[e+1].children[1].style.display="none"),o&&(e=1),t.render(h(o,w[n]),0!==e?a.children[e+1].children[0]:a.children[e+1])}e.ootb.enabled&&e.ootb.todo.includes(n)&&(e.ootb[n](),e.ootb.done(n))},v=e.settings.gmSettings.get().snippets;e.settingsUninjects.push(e.patcher.patch(s,"default",((e,t)=>{t.props.children.slice(3).find((e=>e?.toString()?.includes("GooseMod")))||(setTimeout((()=>{document.querySelector(".scroller-1JbKMe").addEventListener("click",(e=>{const o=S(e.target,i.channel);o&&!o.id.startsWith("gm-home-")&&(document.querySelectorAll('[id^="gm-home-"]').forEach((e=>e.className=e.className.replace(r.selected,r.clickable))),setTimeout((()=>{null!==document.getElementById("gm-settings-inject")&&(f.transitionTo("/invalid"),f.back())}),1))}))}),10),t.props.children.push((()=>o.createElement(n,{className:d.privateChannelsHeaderContainer},o.createElement("span",{className:d.headerText},"GooseMod"),o.createElement("div",{className:`${d.privateChannelRecipientsInviteButtonIcon} ${l.iconWrapper} ${l.clickable}`,style:{transform:`rotate(${y?"0":"-90"}deg)`,width:"22px",left:y?"0px":"-2px",top:y?"-6px":"-2px"},onClick:()=>{y=!y,goosemod.storage.set("goosemodHomeExpanded",y),document.querySelector(".scroller-1JbKMe").dispatchEvent(new Event("focusin")),document.querySelector(".scroller-1JbKMe").dispatchEvent(new Event("focusout"))}},m.expandable))),(()=>o.createElement(a,{style:{display:y||"#terms.store.themes#"===document.querySelector(".title-29uC1r")?.textContent?"block":"none"},icon:()=>m.themes,onClick:()=>x("#terms.store.themes#","themes"),id:"gm-home-themes",text:"#terms.store.themes#",selected:!1})),(()=>o.createElement(a,{style:{display:y||"#terms.store.plugins#"===document.querySelector(".title-29uC1r")?.textContent?"block":"none"},icon:()=>m.plugins,onClick:()=>x("#terms.store.plugins#","plugins"),id:"gm-home-plugins",text:"#terms.store.plugins#",selected:!1})),v?()=>o.createElement(a,{style:{display:y||"#terms.store.snippets#"===document.querySelector(".title-29uC1r")?.textContent?"block":"none"},icon:()=>m.snippets,onClick:()=>x("#terms.store.snippets#","snippets"),id:"gm-home-snippets",text:"#terms.store.snippets#",selected:!1}):null))}))),document.querySelector(".privateChannels-1nO12o")&&(f.transitionTo("/invalid"),f.back()),(async()=>{await e.moduleStoreAPI.updateStoreSetting();const o=JSON.parse(goosemod.storage.get("goosemodSnippets"))||{};for(const e in o){const t=o[e];o[e]=document.createElement("style"),o[e].appendChild(document.createTextNode(t)),document.body.appendChild(o[e])}const t=async(t,s)=>{const{fetchMessages:n}=e.webpackModules.findByProps("fetchMessages"),{getRawMessages:a}=e.webpackModules.findByProps("getMessages"),{getChannel:r,hasChannel:i}=e.webpackModules.findByProps("getChannel");if(!i(t))return;await n({channelId:t});const d=r(t),l=Object.values(a(t)).filter((e=>e.content.includes("```css")&&!e.message_reference&&!e.content.includes("quick CSS")&&!e.content.includes("Theme Toggler"))).sort(((e,o)=>o.attachments.length+o.embeds.length-(e.attachments.length+e.embeds.length))),c=e.settings.items.find((e=>"#terms.store.snippets#"===e[1]));c[2].push({type:"store-header",text:s},...l.map((t=>({type:"card",tags:[t.id],lastUpdated:0,discordMessage:{guild:d.guild_id,channel:d.id,message:t.id},images:t.attachments[0]?[t.attachments[0].proxy_url]:t.embeds[0]?[t.embeds[0].thumbnail.proxy_url]:[],name:"",author:[{name:t.author.username,id:t.author.id,avatar:t.author.avatar}],subtext:t.content.replace(/```css(.*)```/gs,""),buttonText:o[t.id]?"Remove\$#":"Add\$#",buttonType:o[t.id]?"danger":"brand",onclick:()=>{const s=c[2].find((e=>e.tags?.includes(t.id))),n=document.querySelector(`[class*="${t.id}"]`).querySelector("button");e.settings.regensnippets=!0,o[t.id]?(o[t.id].remove(),delete o[t.id],n.className=n.className.replace("lookOutlined-3sRXeN colorRed-1TFJan","lookFilled-1Gx00P colorBrand-3pXr91"),n.textContent="#terms.add#",s.buttonText="#terms.add#",s.buttonType="brand"):(o[t.id]=document.createElement("style"),o[t.id].appendChild(document.createTextNode(/```css(.*)```/s.exec(t.content)[1])),document.body.appendChild(o[t.id]),n.className=n.className.replace("lookFilled-1Gx00P colorBrand-3pXr91","lookOutlined-3sRXeN colorRed-1TFJan"),n.textContent="#terms.remove#",s.buttonText="#terms.remove#",s.buttonType="danger");const a=Object.assign({},o);for(const e in a)a[e]=a[e].textContent;goosemod.storage.set("goosemodSnippets",JSON.stringify(a))},showToggle:!1,isToggled:()=>!1}))))};await t("755005803303403570","Powercord CSS Snippets"),await t("836694789898109009","BetterDiscord CSS Snippets"),await t("449569809613717518","Black Box CSS Snippets");for(const o of["themes","plugins","snippets"])w[o]=e.settings._createItem(b[o][1],b[o][2],!1)})()},addToContextMenu=(e,o)=>{const t=o=>({label:o,action:async()=>{e.settings.openSettings(),await sleep(10),[...document.getElementsByClassName("side-8zPYf6")[0].children].find((e=>e.textContent===o)).click()}});e.settingsUninjects.push(e.patcher.contextMenu.patch("user-settings-cog",{label:"MirukuClient",sub:[t("MirukuClient Settings"),o?void 0:t("MirukuClient Plugins"),o?void 0:t("MirukuClient Themes"),t("Changelog")].filter((e=>e))})),e.settingsUninjects.push(e.patcher.contextMenu.patch("user-settings-cog",{label:"GooseMod Modules\$#",sub:()=>e.settings.items.slice(e.settings.items.indexOf(e.settings.items.find((e=>"#terms.goosemod.modules#"===e[1])))+1).map((e=>t(e[1])))}))},addToSettingsSidebar=(e,o)=>{const t=e.webpackModules.findByDisplayName("SettingsView"),s=e.webpackModules.findByDisplayName("Text"),n=e.webpackModules.findByProps("versionHash","line"),{React:a}=e.webpackModules.common;e.settingsUninjects.push(e.patcher.patch(t.prototype,"getPredicateSections",((t,r)=>{const i=r.find((e=>"logout"===e.section));return i?(r.splice(r.indexOf(i),0,...e.settings.items.filter((e=>!(o.get().home&&("#terms.store.plugins#"===e[1]||"#terms.store.themes#"===e[1]||"#terms.store.snippets#"===e[1])||!o.get().snippets&&"#terms.store.snippets#"===e[1]))).map((o=>{switch(o[0]){case"item":let t={section:"gm-"+o[1],label:o[1],predicate:()=>{},element:function(){if("function"==typeof o[3])return document.getElementsByClassName("selected-3s45Ha")[0].click(),o[3](),a.createElement("div");const t=document.querySelector('div[aria-label="USER_SETTINGS"]').querySelector("nav > div");return"#terms.store.plugins#"!==o[1]&&"#terms.store.themes#"!==o[1]&&"#terms.store.snippets#"!==o[1]||(setTimeout((()=>{document.querySelector(".sidebarRegion-VFTUkN").style.maxWidth="218px",document.querySelector(".contentColumnDefault-1VQkGM").style.maxWidth="calc(100vw - 218px - 60px - 20px)"}),10),t.addEventListener("click",(e=>{0!==e.clientX&&"#terms.store.plugins#"!==e.target.textContent&&"#terms.store.themes#"!==e.target.textContent&&"#terms.store.snippets#"!==e.target.textContent&&(document.querySelector(".sidebarRegion-VFTUkN").style.maxWidth="50%",document.querySelector(".contentColumnDefault-1VQkGM").style.maxWidth="740px")}))),e.settings._createItem(o[1],o[2])}};return o[4]&&(t.color="#f04747"),t;case"heading":return{section:"HEADER",label:o[1]};case"separator":return{section:"DIVIDER"}}})),{section:"DIVIDER"}),r.push({section:"DIVIDER"},{section:"CUSTOM",element:()=>a.createElement("div",{className:n.info},a.createElement(s,{className:n.line,size:s.Sizes.SIZE_12,color:s.Colors.MUTED,tag:"span"},"GooseMod"," ",e.versioning.version," ",a.createElement("span",{className:n.versionHash},"(",e.versioning.hash.substring(0,7),")")),a.createElement(s,{className:n.line,size:s.Sizes.SIZE_12,color:s.Colors.MUTED,tag:"span"},"GooseMod Ext"," ",window.gmExtension))}),r):r})))},addBaseItems=(e,o,t)=>{let s=e.settings.items;e.settings.items=[],e.settings.createHeading("GooseMod");const n=async(t,s)=>{switch(t){case"changelog":if(s){const t=[["item","Change Log\$#",[""],async()=>{show()},!1]];o.get().separators&&t.unshift(["separator"]),e.settings.items.splice(e.settings.items.indexOf(e.settings.items.find((e=>"Themes"===e[1])))+1,0,...t)}else e.settings.items.splice(e.settings.items.indexOf(e.settings.items.find((e=>"Change Log"===e[1]))),o.get().separators?2:1);await e.settings.reopenSettings(),e.settings.openSettingItem("Settings");break;case"devchannel":s?goosemod.storage.set("goosemodUntetheredBranch","dev"):goosemod.storage.remove("goosemodUntetheredBranch");break;case"separators":if(s)o.get().home||goosemod.settings.items.splice(2,0,["separator"]),o.get().changelog&&goosemod.settings.items.splice(4,0,["separator"]);else{let o=!0;e.settings.items=e.settings.items.filter(((t,s)=>(e.settings.items[s+1]&&e.settings.items[s+1][1]&&"#terms.goosemod.modules#"===e.settings.items[s+1][1]&&(o=!1),!("separator"===t[0]&&o))))}await e.settings.reopenSettings(),e.settings.openSettingItem("Settings");break;case"gmBadges":e.gmBadges[s?"addBadges":"removeBadges"]()}o.set(t,s)},a=async()=>{await e.confirmDialog("Refresh","Refresh Required","This setting **requires a refresh to take effect**. You **may experience some strange behaviour** in this session before refreshing.")&&location.reload()};e.settings.createItem("#terms.settings#",["",{type:"header",text:"#terms.settings#"},{type:"toggle",text:"Change Log\$#",subtext:"Show the Miruku \"Change Log\"\$#",onToggle:e=>n("changelog",e),isToggled:()=>o.get().changelog},{type:"toggle",text:"Main Separators\$#",subtext:"Show separators between main settings\$#",onToggle:e=>n("separators",e),isToggled:()=>o.get().separators},{type:"toggle",text:"Store In Home\$#",subtext:"Put the GooseMod Store options in home instead of in settings\$#",onToggle:e=>{n("home",e),a()},isToggled:()=>o.get().home},{type:"header",text:"Store\$#"},{type:"toggle",text:"Auto Update\$#",subtext:"Automatically update repos and modules every hour. This only applies to GooseMod Plugins\$#",onToggle:e=>n("autoupdate",e),isToggled:()=>o.get().autoupdate},{type:"header",text:"Appearance\$#"},{type:"toggle",text:"Miruku Badges\$#",subtext:"Shows custom badges.\$#",onToggle:e=>n("gmBadges",e),isToggled:()=>o.get().gmBadges},{type:"header",text:"Utilities\$#"},{type:"text-and-button",text:"Purge Caches\$#",subtext:"Purges (completely removes) most cache of the client\$#",buttonText:"Purge\$#",onclick:async()=>{goosemod.storage.keys().filter((e=>e.toLowerCase().startsWith("goosemod")&&e.includes("Cache"))).forEach((e=>goosemod.storage.remove(e))),a()}},{type:"text-and-button",text:"Copy Debug Info\$#",subtext:"Copies information on setup and the Miruku Client for reporting and debugging\$#",buttonText:"Copy\$#",onclick:async()=>{const{copy:o}=e.webpackModules.findByProps("copy","SUPPORTS_COPY"),t={powercord:"powercord",vizality:"vizality",ED:"enhanceddiscord",BdApi:"betterdiscord"};o(`Discord:\nClient: ${window.DiscordNative?"desktop":"web"}\nUser Agent: ${navigator.userAgent}\nRelease Channel: ${GLOBAL_ENV.RELEASE_CHANNEL}\nOther Mods: ${Object.keys(t).filter((e=>Object.keys(window).includes(e))).map((e=>t[e])).join(", ")}\n\nGooseMod:\nGM Version: ${e.versioning.version} (${e.versioning.hash})\nGM Branch: ${e.storage.get("goosemodUntetheredBranch")}\nGM Extension Version: ${window.gmExtension}\nGM Storage Impl: ${e.storage.type}\nModules: ${Object.keys(e.modules).join(", ")}\n`)}},{type:"text-and-danger-button",text:"Reset the client\$#",subtext:"Resets the MirukuClient completely: removes all preferences and modules; like a first-time install\$#",buttonText:"Reset\$#",onclick:async()=>{await e.confirmDialog("Reset","Reset GooseMod","Confirming will completely reset GooseMod, removing all preferences and modules; as if you had installed GooseMod for the first time. This is irreversible.")&&(e.remove(),window.location.reload())}},{type:"header",text:"Backup\$#"},{type:"text-and-button",text:"Create Backup\$#",subtext:"Creates a file for backup of your modules and settings\$#",buttonText:"Backup\$#",onclick:()=>{const e=goosemod.storage.keys().filter((e=>e.toLowerCase().startsWith("goosemod")&&!e.includes("Cache"))).reduce(((e,o)=>(e[o]=goosemod.storage.get(o),e)),{}),o=JSON.stringify(e),t=document.createElement("a");t.style.display="none";const s=new Blob([o],{type:"application/json"});t.href=URL.createObjectURL(s),t.download="goosemodBackup.json",document.body.appendChild(t),t.click(),t.remove()}},{type:"text-and-button",text:"Restore Backup\$#",subtext:"Restore your modules and settings via a backup file, **only restore backups you trust**\$#",buttonText:"Restore\$#",onclick:async()=>{const e=document.createElement("input");e.style.display="none",e.type="file",e.click(),await new Promise((o=>{e.onchange=()=>{o()}}));const o=e.files[0];if(!o)return;const t=new FileReader;t.onload=()=>{const e=JSON.parse(t.result);for(const o in e)o.startsWith("goosemod")&&goosemod.storage.set(o,e[o]);location.reload()},t.readAsText(o)}},{type:"header",text:"Experimental\$#"},{type:"subtext",text:"Experimental settings are likely incomplete and unstable, which may result in a reduced experience\$#"},{type:"toggle",experimental:!0,text:"Switch to GooseMod\$#",subtext:"Tired of using Miruku\'s fork of GooseMod? Switch to the standard GooseMod Install \$#",onToggle:e=>{n("devchannel",e),a()},isToggled:()=>"dev"===goosemod.storage.get("goosemodUntetheredBranch")},{type:"toggle",experimental:!0,text:"Data Attributes\$#",subtext:"Add data attributes to some elements for some themes to use\$#",onToggle:e=>{n("attrs",e),a()},isToggled:()=>o.get().attrs},{type:"toggle",experimental:!0,text:"Snippets\$#",subtext:"Enable Snippets tab in Store\$#",onToggle:e=>{n("snippets",e),a()},isToggled:()=>o.get().snippets},{type:"toggle",experimental:!0,text:"Force Theme Settings\$#",subtext:"Force auto-generated settings for all themes\$#",onToggle:e=>{n("allThemeSettings",e),a()},isToggled:()=>o.get().allThemeSettings},{type:"gm-footer"}]),o.get().separators&&!o.get().home&&e.settings.createSeparator();let r="Stars\$#",i="All\$#",d="";const l=()=>{const o=document.querySelectorAll(":not(.gm-store-category) > div > .gm-store-card"),t=new RegExp(`.*${d}.*`,"i");let s=document.querySelector(".selected-3s45Ha").textContent;"Store\$#"!==s&&"Installed\$#"!==s&&(s="#store.options.tabs.store#");for(let n of o){const o=n.getElementsByClassName("title-31JmR4"),a=o[1],d=[...o[0].getElementsByClassName("gm-store-author-name")].map((e=>e.textContent.split("#")[0])),l=a.childNodes[0].wholeText,c=n.getElementsByClassName("description-3_Ncsb")[0].innerText,m=t.test(l)||t.test(c),p=n.getElementsByClassName("container-3auIfb")[0].classList.contains("hide-toggle")?"#store.options.tabs.store#":"#store.options.tabs.imported#";switch(r){case"A-Z\$#":n.style.order="";break;case"Last Updated\$#":{const o=e.moduleStoreAPI.modules.find((e=>e.name===l.trim()));n.style.order=3e9-o.lastUpdated;break}case"#store.options.sort.stars#":n.style.order=1e4-parseInt(n.children[4].children[0].children[0].textContent)}n.style.display=!m||"#store.options.tabs.store#"!==s&&s!==p||"#store.options.author.all#"!==i&&!d.includes(i.split(" (").slice(0,-1).join(" ("))?"none":"block"}const n=""===d&&"#store.options.tabs.store#"===s&&"#store.options.author.all#"===i;[...document.getElementsByClassName("gm-store-category")].forEach((e=>e.style.display=n?"block":"none"));const a=document.querySelector(":not(.gm-store-category) > .gm-store-header");a.style.height=n?"":"0px",a.style.opacity=n?"":"0",a.style.margin=n?"":"0"};e.settings.updateModuleStoreUI=l;const c=new Date,m=e=>{const o=(c-1e3*e.lastUpdated)/1e3/60/60/24;return e.github.stars/o-e.github.stars/2+(1-o)};["#terms.store.plugins#","#terms.store.themes#"].forEach(((o,t)=>e.settings.createItem(o,["",{type:"search",placeholder:0===t?"Search Plugins\$#":"Search Themes\$#",onchange:e=>{d=e,l()},storeSpecific:!0},{type:"dropdown-individual",label:"Sort by\$#",options:["#store.options.sort.stars#","#store.options.sort.az#","#store.options.sort.last_updated#"],onchange:e=>{r=e,l()}},{type:"dropdown-individual",label:"Author\$#",options:()=>{const o=e.moduleStoreAPI.idCache.getCache(),t=[...e.moduleStoreAPI.modules.reduce(((e,t)=>{let s=t.authors;Array.isArray(s)||(s=[s]);for(const t of s){let s=t;if("object"==typeof t)s=t.n;else if(t.match(/^[0-9]{17,18}$/))s=o[t]?.data?.username;else{const e=t.match(/(.*) \(([0-9]{17,18})\)/);null!==e&&(s=e[1])}s&&e.set(s,(e.get(s)||0)+1)}return e}),new Map).entries()].sort(((e,o)=>o[1]-e[1])).map((e=>`${e[0]} (${e[1]})`));return t.unshift("#store.options.author.all#"),t},onchange:e=>{i=e,l()}},{type:"store-category",text:"Top Starred\$#",sort:(e,o)=>o.github.stars-e.github.stars},{type:"store-category",text:"Recently Updated\$#",sort:(e,o)=>o.lastUpdated-e.lastUpdated},{type:"store-category",text:"Upcoming\$#",sort:(e,o)=>m(o)-m(e)},{type:"store-header",text:0===t?"All Plugins\$#":"All Themes\$#"},{type:"gm-footer"}]))),e.settings.createItem("#terms.store.snippets#",["",{type:"search",placeholder:"Search Snippets",onchange:e=>{const o=document.getElementsByClassName("gm-store-card"),t=new RegExp(`.*${e}.*`,"i");for(const e of o){const o=e.getElementsByClassName("markdown-11q6EU")[0].textContent,s=t.test(o);e.style.display=s?"":"none"}},storeSpecific:!0}]),o.get().changelog&&(o.get().separators&&e.settings.createSeparator(),e.settings.createItem("#terms.changelog#",[""],(async()=>{show()}))),e.settings.createSeparator(),e.settings.createHeading("#terms.goosemod.modules#"),e.settings.items=e.settings.items.concat(s)},getItems=async()=>({divider:(await Promise.resolve().then((function(){return divider}))).default(),header:(await Promise.resolve().then((function(){return header$1}))).default(),toggle:(await Promise.resolve().then((function(){return toggle$1}))).default(),text:(await Promise.resolve().then((function(){return text$1}))).default(),"text-and-button":(await Promise.resolve().then((function(){return textAndButton$1}))).default(),"text-and-color":(await Promise.resolve().then((function(){return textAndColor$1}))).default(),button:(await Promise.resolve().then((function(){return button$1}))).default(),search:(await Promise.resolve().then((function(){return search$1}))).default(),"dropdown-individual":(await Promise.resolve().then((function(){return dropdownIndividual$1}))).default(),"store-header":(await Promise.resolve().then((function(){return storeHeader}))).default(),card:(await Promise.resolve().then((function(){return card}))).default(),"store-category":(await Promise.resolve().then((function(){return storeCategory$1}))).default(),custom:(await Promise.resolve().then((function(){return custom$1}))).default(),"text-input":(await Promise.resolve().then((function(){return textInput$1}))).default(),subtext:(await Promise.resolve().then((function(){return subtext$1}))).default()});const gmSettings=GMSettings;let Items={},goosemodScope$6={};const setThisScope$5=async e=>{goosemodScope$6=e,Items=await getItems()},removeModuleUI=(e,o)=>{const t=void 0===goosemodScope$6.modules[e];t&&(goosemodScope$6.modules[e]=Object.assign({},goosemodScope$6.disabledModules[e]),delete goosemodScope$6.disabledModules[e]),goosemodScope$6.moduleStoreAPI.moduleRemoved(goosemodScope$6.modules[e]),t||goosemodScope$6.modules[e].goosemodHandlers.onRemove(),delete goosemodScope$6.modules[e],goosemodScope$6.moduleSettingsStore.clearModuleSetting(e),o&&goosemodScope$6.settings.openSettingItem(o)},isSettingsOpen=()=>null!==document.querySelector('div[aria-label="USER_SETTINGS"] .closeButton-1tv5uR'),closeSettings=()=>{let e=document.querySelector('div[aria-label="USER_SETTINGS"] .closeButton-1tv5uR');if(null===e)return!1;e.click()},openSettings=()=>{document.querySelector('.flex-1xMQg5.flex-1O1GKY.horizontal-1ae9ci.horizontal-2EEEnY.flex-1O1GKY.directionRow-3v3tfG.justifyStart-2NDFzi.alignStretch-DpGPf3.noWrap-3jynv6 > [type="button"]:last-child').click()},openSettingItem=e=>{try{const o=[...document.querySelector('div[aria-label="USER_SETTINGS"]').querySelector("nav > div").children];return o[1].click(),setTimeout((()=>o.find((o=>o.textContent===e)).click()),5),!0}catch(e){return!1}},reopenSettings=async()=>{goosemodScope$6.settings.closeSettings(),await sleep(500),goosemodScope$6.settings.openSettings(),await sleep(100)};let items=[];const createItem=(e,o,t,s=!1)=>{goosemodScope$6.settings.items.push(["item",e,o,t,s])},removeItem=e=>{const o=goosemodScope$6.settings.items.indexOf(goosemodScope$6.settings.items.find((o=>o[1]===e)));if(-1===o)return!1;goosemodScope$6.settings.items.splice(o,1)},createHeading=e=>{goosemodScope$6.settings.items.push(["heading",e])},createSeparator=()=>{goosemodScope$6.settings.items.push(["separator"])},_createItem=(e,o,t=!0)=>{const{React:s}=goosemodScope$6.webpackModules.common,n=goosemodScope$6.webpackModules.findByDisplayName("FormSection"),a=goosemodScope$6.webpackModules.findByDisplayName("FormTitle"),r=()=>o.slice(1).map(((o,t)=>{o.type.includes("danger-button")&&(o.type=o.type.replace("danger-",""),o.danger=!0);const n=Items[o.type];return n?s.createElement(n,{i:t,...o,itemName:e}):s.createElement("div")}));return t?s.createElement(n,{className:"#terms.store.plugins#"===e||"#terms.store.themes#"===e?"gm-store-settings":""},s.createElement(a,{tag:"h1"},e),r()):s.createElement("div",{},r())},makeGooseModSettings=()=>{goosemodScope$6.settingsUninjects=[],addBaseItems(goosemodScope$6,gmSettings),addToSettingsSidebar(goosemodScope$6,gmSettings),addToContextMenu(goosemodScope$6,gmSettings.get().home),gmSettings.get().home&&addToHome(goosemodScope$6),loadColorPicker()},loadColorPicker=()=>{const{findInReactTree:e}=goosemodScope$6.reactUtils;if(!goosemodScope$6.webpackModules.findByDisplayName("ColorPicker")){e(goosemodScope$6.webpackModules.findByDisplayName("GuildFolderSettingsModal").prototype.render.call({props:{},state:{}}).props.children,(e=>e.props?.colors)).type().props.children.type._ctor()}};var Settings={__proto__:null,gmSettings:gmSettings,setThisScope:setThisScope$5,removeModuleUI:removeModuleUI,isSettingsOpen:isSettingsOpen,closeSettings:closeSettings,openSettings:openSettings,openSettingItem:openSettingItem,reopenSettings:reopenSettings,items:items,createItem:createItem,removeItem:removeItem,createHeading:createHeading,createSeparator:createSeparator,_createItem:_createItem,makeGooseModSettings:makeGooseModSettings},ab2str=e=>(new TextDecoder).decode(e);const evalGlobal=eval,makeSourceURL=e=>`${e} | GM Module`.replace(/ /g,"%20");let goosemodScope$5={};const setThisScope$4=e=>{goosemodScope$5=e},importModule=async(e,o=!1)=>{let t=e.name;goosemodScope$5.logger.debug("import",`Importing module: "${t}"`),void 0!==goosemodScope$5.modules[t]?.goosemodHandlers?.onImport&&(goosemodScope$5.logger.debug(`import.load.module.${t}`,"Module already imported, removing then installing new version"),await goosemodScope$5.modules[t].goosemodHandlers.onRemove()),"object"==typeof e.data&&(e.data=ab2str(e.data));goosemodScope$5[o?"disabledModules":"modules"][t]=Object.assign(evalGlobal("const goosemodScope=goosemod;"+e.data+` //# sourceURL=${makeSourceURL(e.name)}`),e.metadata),o||await goosemodScope$5.modules[t].goosemodHandlers.onImport()};let goosemodScope$4={};const setThisScope$3=e=>{goosemodScope$4=e},disableModule=e=>{let o=JSON.parse(goosemod.storage.get("goosemodDisabled"))||{};o[e]=!0,goosemod.storage.set("goosemodDisabled",JSON.stringify(o))},enableModule=e=>{let o=JSON.parse(goosemod.storage.get("goosemodDisabled"))||{};delete o[e],goosemod.storage.set("goosemodDisabled",JSON.stringify(o))},checkDisabled=e=>Object.keys(JSON.parse(goosemod.storage.get("goosemodDisabled"))||{}).includes(e),saveModuleSettings=async()=>{let e=JSON.parse(goosemod.storage.get("goosemodModules"))||{};for(let o in goosemodScope$4.modules)if(goosemodScope$4.modules.hasOwnProperty(o))try{e[o]=await(goosemodScope$4.modules[o].goosemodHandlers.getSettings||(async()=>[]))()}catch(e){console.error("Failed to load settings to save module",o,e)}JSON.stringify(JSON.parse(goosemod.storage.get("goosemodModules")))!==JSON.stringify(e)&&goosemod.storage.set("goosemodModules",JSON.stringify(e))},clearModuleSetting=e=>{let o=JSON.parse(goosemod.storage.get("goosemodModules"));o&&o[e]&&(delete o[e],goosemod.storage.set("goosemodModules",JSON.stringify(o)))},clearSettings=()=>{goosemod.storage.remove("goosemodModules")},loadSavedModuleSetting=async e=>{let o=JSON.parse(goosemod.storage.get("goosemodModules"));o&&o[e]&&await(goosemodScope$4.modules[e].goosemodHandlers.loadSettings||(async()=>[]))(o[e])};var ModuleSettingsStore={__proto__:null,setThisScope:setThisScope$3,disableModule:disableModule,enableModule:enableModule,checkDisabled:checkDisabled,saveModuleSettings:saveModuleSettings,clearModuleSetting:clearModuleSetting,clearSettings:clearSettings,loadSavedModuleSetting:loadSavedModuleSetting};let openpgp;const loadLibrary=async()=>{const js=await(await fetch("https://api.goosemod.com/pgp.js",{cache:"force-cache"})).text();openpgp=eval(js+";openpgp")},verifySignature=async(e,o,t)=>{openpgp||await loadLibrary();const s=await openpgp.readKey({armoredKey:e}),n=await openpgp.createMessage({text:t}),a=await openpgp.readSignature({armoredSignature:o}),r=await openpgp.verify({message:n,signature:a,verificationKeys:s}),{verified:i,keyID:d}=r.signatures[0];try{return await i,goosemod.logger.debug("pgp","verified, key id:",d.toHex()),!0}catch(e){return goosemod.logger.debug("pgp","failed to verify",e.message),!1}},hash=async(e,o)=>{const t=await crypto.subtle.digest(o,new TextEncoder("utf-8").encode(e));return Array.prototype.map.call(new Uint8Array(t),(e=>("00"+e.toString(16)).slice(-2))).join("")},sha512=e=>hash(e,"SHA-512");let goosemodScope$3={};const setThisScope$2=e=>{goosemodScope$3=e},getCache$1=()=>JSON.parse(goosemod.storage.get("goosemodJSCache")||"{}"),purgeCache$1=()=>goosemod.storage.remove("goosemodJSCache"),updateCache$1=(e,o,t)=>{let s=goosemodScope$3.moduleStoreAPI.jsCache.getCache();s[e]={hash:o,js:t},goosemod.storage.set("goosemodJSCache",JSON.stringify(s))},getJSForModule=async e=>{const o=goosemodScope$3.moduleStoreAPI.modules.find((o=>o.name===e)),t=goosemodScope$3.moduleStoreAPI.jsCache.getCache();if(t[e]&&o.hash===t[e].hash)return t[e].js;{const t=o.repo.split("/").slice(0,-1).join("/"),s=await(await fetch(`${t}/module/${e}.js?_=${Date.now()}`)).text();return goosemodScope$3.moduleStoreAPI.jsCache.updateCache(e,o.hash,s),s}};var JSCache={__proto__:null,setThisScope:setThisScope$2,getCache:getCache$1,purgeCache:purgeCache$1,updateCache:updateCache$1,getJSForModule:getJSForModule};const currentDate=new Date-0;let goosemodScope$2={},getUser,queueProcessInterval;const setThisScope$1=e=>{goosemodScope$2=e,getUser=goosemodScope$2.webpackModules.findByProps("getUser","fetchCurrentUser").getUser},queue=[],queueReturns=[],processQueue=async()=>{if(0===queue.length)return clearInterval(queueProcessInterval),void(queueProcessInterval=void 0);const e=queue.pop();queueReturns.push(await getUser(e))},getCache=()=>JSON.parse(goosemod.storage.get("goosemodIDCache")||"{}"),purgeCache=()=>goosemod.storage.remove("goosemodIDCache"),updateCache=(e,o)=>{let t=getCache();t[e]={data:o,time:currentDate},goosemod.storage.set("goosemodIDCache",JSON.stringify(t))},getDataForID=async e=>{const o=getCache();if(o[e]&&o[e].time>currentDate-864e5)return o[e].data;{let o;for(queue.push(e),queueProcessInterval||(queueProcessInterval=setInterval(processQueue,500),processQueue());;){if(o=queueReturns.find((o=>o.id===e)),o){queueReturns.splice(queueReturns.indexOf(o),1);break}await sleep(500)}return updateCache(e,o),o}};var IDCache={__proto__:null,setThisScope:setThisScope$1,getCache:getCache,purgeCache:purgeCache,updateCache:updateCache,getDataForID:getDataForID};let goosemodScope$1={};var moduleStoreAPI={setThisScope:e=>{goosemodScope$1=e,setThisScope$2(e),setThisScope$1(e)},modules:[],repos:[],apiBaseURL:"https://api.goosemod.com",storeApiBaseURL:"https://store.goosemod.com",jsCache:JSCache,idCache:IDCache,getSettingItemName:e=>e.tags.includes("theme")?"#terms.store.themes#":"#terms.store.plugins#",hotupdate:async(e=!1)=>{e&&goosemodScope$1.updateLoadingScreen("Getting modules from repos..."),await goosemodScope$1.moduleStoreAPI.updateModules(),await goosemodScope$1.moduleStoreAPI.updateStoreSetting(),e&&goosemodScope$1.updateLoadingScreen("Updating modules...");const o={},t=[];for(const s in goosemodScope$1.modules){const n=goosemodScope$1.moduleStoreAPI.modules.find((e=>e.name===s))?.hash,a=goosemodScope$1.moduleStoreAPI.jsCache.getCache()[s]?.hash;if(void 0!==n&&void 0!==a&&n!==a){if(void 0===o[s.repo]){const e=goosemodScope$1.moduleStoreAPI.repos.find((e=>e.url===s.repo));if("untrusted"===goosemodScope$1.moduleStoreAPI.verifyPgp(e).trustState){goosemodScope$1.showToast(`Failed to verify repo ${e.meta.name}, refusing to update it's modules`,{timeout:1e4,type:"error",subtext:"GooseMod Store\$#"}),o[s.repo]=!1;continue}o[s.repo]=!0}!1!==o[s.repo]&&(e&&goosemodScope$1.updateLoadingScreen(`Updating modules...\n${s}`),t.push(goosemodScope$1.moduleStoreAPI.importModule(s,goosemodScope$1.moduleSettingsStore.checkDisabled(s)).then((async()=>{}))))}}await Promise.all(t)},initRepos:async()=>{const e=async e=>(await(await fetch(`${e}?_=${Date.now()}`)).json()).meta,o=async o=>({url:o,enabled:!0,meta:await e(o)});goosemodScope$1.moduleStoreAPI.repos=JSON.parse(goosemod.storage.get("goosemodRepos"))||[await o("https://store.goosemod.com/goosemod.json"),await o("https://store.goosemod.com/ms2porter.json"),await o("https://store.goosemod.com/bdthemes.json"),await o("https://store.goosemod.com/pcthemes.json"),await o("https://store.goosemod.com/pcplugins.json")]},updateModules:async()=>{let e=[];goosemodScope$1.moduleStoreAPI.repos=(await Promise.all(goosemodScope$1.moduleStoreAPI.repos.map((async o=>{if(!o.enabled)return o;try{const t=await(await fetch(`${o.url}?_=${Date.now()}`)).text(),s=JSON.parse(t);return"untrusted"===await goosemodScope$1.moduleStoreAPI.verifyPgp(o).trustState?(goosemodScope$1.showToast(`Failed to verify repo: ${o.meta.name}, refusing to use new modules`,{timeout:1e4,type:"error",subtext:"#terms.goosemod.store#"}),e=e.concat(goosemodScope$1.moduleStoreAPI.modules.filter((e=>e.repo===o.url))).sort(((e,o)=>e.name.localeCompare(o.name))),o):(e=e.concat(s.modules.map((e=>(e.repo=o.url,e)))).sort(((e,o)=>e.name.localeCompare(o.name))),{...o,meta:s.meta,resp:t})}catch(e){goosemodScope$1.showToast(`Failed to get repo: ${o.url}`,{timeout:5e3,type:"error",subtext:"#terms.goosemod.store#"}),console.error(e)}return o})))).sort(((e,o)=>goosemodScope$1.moduleStoreAPI.repos.indexOf(e.url)-goosemodScope$1.moduleStoreAPI.repos.indexOf(o.url))),goosemodScope$1.moduleStoreAPI.modules=e,goosemod.storage.set("goosemodRepos",JSON.stringify(goosemodScope$1.moduleStoreAPI.repos.map((e=>(delete e.resp,e))))),goosemod.storage.set("goosemodCachedModules",JSON.stringify(goosemodScope$1.moduleStoreAPI.modules))},importModule:async(e,o=!1)=>{try{const t=goosemodScope$1.moduleStoreAPI.modules.find((o=>o.name===e)),s=await goosemodScope$1.moduleStoreAPI.jsCache.getJSForModule(e),n=await sha512(s);if(n!==t.hash)return goosemodScope$1.showToast(`Cancelled importing of ${e} due to hash mismatch`,{timeout:2e3,type:"danger",subtext:"#terms.goosemod.store#"}),void console.warn("Hash mismatch",n,t.hash);await goosemodScope$1.importModule({name:e,data:s,metadata:t},o),o||(void 0!==goosemodScope$1.modules[e].goosemodHandlers.onLoadingFinished&&await goosemodScope$1.modules[e].goosemodHandlers.onLoadingFinished(),await goosemodScope$1.moduleSettingsStore.loadSavedModuleSetting(e));try{const e=goosemodScope$1.settings.items.find((e=>e[1]===goosemodScope$1.moduleStoreAPI.getSettingItemName(t)))[2].find((e=>e.subtext===t.description));e.buttonType="danger",e.buttonText="#terms.remove#",e.showToggle=!0}catch(e){}if(document.querySelector("#gm-settings-inject")){const e=[...document.querySelectorAll(".title-31JmR4 + .colorStandard-2KCXvj")].filter((e=>e.textContent===t.description)).map((e=>e.parentElement));if(0===e.length)return;for(const o of e){const e=o.querySelector(".colorBrand-3pXr91");e.className=e.className.replace("lookFilled-1Gx00P colorBrand-3pXr91","lookOutlined-3sRXeN colorRed-1TFJan"),e.textContent="#terms.remove#";o.querySelector(".container-3auIfb").classList.remove("hide-toggle")}}}catch(o){goosemodScope$1.showToast(`Failed to import module ${e}`,{timeout:2e3,type:"error",subtext:"#terms.goosemod.store#"}),console.error(o)}},moduleRemoved:e=>{let o=goosemodScope$1.settings.items.find((o=>o[1]===goosemodScope$1.moduleStoreAPI.getSettingItemName(e)))[2].find((o=>o.subtext===e.description));if(void 0!==o&&(o.buttonType="brand",o.buttonText="Install",o.showToggle=!1,document.querySelector("#gm-settings-inject"))){const o=[...document.querySelectorAll(".title-31JmR4 + .colorStandard-2KCXvj")].filter((o=>o.textContent===e.description)).map((e=>e.parentElement));if(0===o.length)return;for(const e of o){const o=e.querySelector(".colorRed-1TFJan");o.className=o.className.replace("lookOutlined-3sRXeN colorRed-1TFJan","lookFilled-1Gx00P colorBrand-3pXr91"),o.textContent="Install";e.querySelector(".container-3auIfb").classList.add("hide-toggle")}}},parseAuthors:async e=>{const o="string"==typeof e?e.split(", "):e;return await Promise.all(o.map((async e=>{if("object"==typeof e)return{name:e.n,id:e.i,avatar:e.a};if(e.match(/^[0-9]{17,18}$/)){const o=await getDataForID(e);return{name:o.username,id:o.id,avatar:o.avatar}}const o=e.match(/(.*) \(([0-9]{17,18})\)/);return{name:o?.[1]||e,id:o?.[2]}})))},updateStoreSetting:async()=>{let e=goosemodScope$1.settings.items.filter((e=>"#terms.store.plugins#"===e[1]||"#terms.store.themes#"===e[1]));for(const o of e)o[2]=o[2].filter((e=>"card"!==e.type));for(const o of goosemodScope$1.moduleStoreAPI.modules){const t=goosemodScope$1.moduleStoreAPI.getSettingItemName(o),s=e.find((e=>e[1]===t)),n=o.tags.includes("theme")?"themes":"plugins";s[2].push({type:"card",tags:o.tags,github:o.github,images:o.images?.map((e=>{if(e.startsWith("/")){e=o.repo.split("/").slice(0,-1).join("/")+e}return e})),lastUpdated:o.lastUpdated,buttonType:goosemodScope$1.modules[o.name]||goosemodScope$1.disabledModules[o.name]?"danger":"brand",showToggle:goosemodScope$1.modules[o.name]||goosemodScope$1.disabledModules[o.name],name:o.name,author:await goosemodScope$1.moduleStoreAPI.parseAuthors(o.authors),subtext:o.description,subtext2:"0"===o.version||o.version.toLowerCase().includes("auto")?"":`v${o.version}`,buttonText:goosemodScope$1.modules[o.name]||goosemodScope$1.disabledModules[o.name]?"Remove":"Install",onclick:async()=>{if(goosemodScope$1.settings[`regen${n}`]=!0,goosemodScope$1.modules[o.name]||goosemodScope$1.disabledModules[o.name])goosemodScope$1.settings.removeModuleUI(o.name,t);else{if(o.dependencies&&o.dependencies.length>0)for(const e of o.dependencies)await goosemodScope$1.moduleStoreAPI.importModule(e);await goosemodScope$1.moduleStoreAPI.importModule(o.name)}},isToggled:()=>void 0===goosemodScope$1.disabledModules[o.name],onToggle:async e=>{if(goosemodScope$1.settings.ignoreVisualToggle)delete goosemodScope$1.settings.ignoreVisualToggle;else if(goosemodScope$1.settings[`regen${n}`]=!0,e?(goosemodScope$1.modules[o.name]=Object.assign({},goosemodScope$1.disabledModules[o.name]),delete goosemodScope$1.disabledModules[o.name],await goosemodScope$1.modules[o.name].goosemodHandlers.onImport(),void 0!==goosemodScope$1.modules[o.name].goosemodHandlers.onLoadingFinished&&await goosemodScope$1.modules[o.name].goosemodHandlers.onLoadingFinished(),await goosemodScope$1.moduleSettingsStore.loadSavedModuleSetting(o.name),goosemodScope$1.moduleSettingsStore.enableModule(o.name)):(goosemodScope$1.disabledModules[o.name]=Object.assign({},goosemodScope$1.modules[o.name]),await goosemodScope$1.modules[o.name].goosemodHandlers.onRemove(),delete goosemodScope$1.modules[o.name],goosemodScope$1.moduleSettingsStore.disableModule(o.name)),document.querySelector("#gm-settings-inject")){const e=[...document.querySelectorAll(".title-31JmR4 + .colorStandard-2KCXvj")].filter((e=>e.textContent===o.description)).map((e=>e.parentElement));if(0===e.length)return;for(const o of e){goosemodScope$1.settings.ignoreVisualToggle=!0;o.querySelector(".input-rwLH4i").click()}}}})}},verifyPgp:async e=>{const o=o=>{const t={result:o,trustState:"verified"!==o&&e.oncePgp||"invalid_signature"===o||"no_signature"===o?"untrusted":"verified"===o?"trusted":"unknown",when:Date.now()},s=goosemodScope$1.moduleStoreAPI.repos.find((o=>o.url===e.url));return s?(s.pgp=t,"verified"===o&&(s.oncePgp=!0),goosemod.logger.debug("pgp.save",s),goosemod.storage.set("goosemodRepos",JSON.stringify(goosemodScope$1.moduleStoreAPI.repos)),s.pgp):t};goosemod.logger.debug("pgp","verifying repo:",e.meta.name);const t=async e=>{const o=await fetch(e+"?_="+Date.now());return!!o.ok&&await o.text()},s=await t(`https://goosemod.github.io/Keyserver/repos/${e.meta.name}.gpg`);if(!s)return goosemod.logger.debug("pgp","no public key, aborting"),o("no_public_key");const n=await t(e.url+".sig");if(!n)return goosemod.logger.debug("pgp","no signature, aborting"),o("no_signature");const a=e.resp||await t(e.url);return o(await verifySignature(s,n,a)?"verified":"invalid_signature")}};let css="",toSaveNext=!1;const init$2=()=>{injectHooks(),setInterval((()=>{toSaveNext&&(toSaveNext=!1,save())}),1e4)},save=()=>{[...document.body.classList].forEach((e=>{css=css.replace(new RegExp(`body.${e}`,"g"),"body")})),goosemod.storage.set("goosemodCSSCache",css),goosemod.showToast("Saved",{subtext:"CSS Cache",type:"debuginfo"})},injectHooks=()=>{const e=()=>toSaveNext=!0,o=CSSStyleSheet.prototype.insertRule,t=Node.prototype.appendChild;CSSStyleSheet.prototype.insertRule=function(t){o.apply(this,arguments),t.includes("body.")&&(css+=t,e())};const s=[document.body,document.head],n=o=>{o.appendChild=function(o){if(t.apply(this,arguments),"STYLE"===o.tagName){if(o.id.startsWith("ace"))return;n(o);for(const e of o.childNodes)css+=e.textContent;e()}o.data&&(css+=o.textContent,e())}};for(const e of s)n(e)},load=()=>{const e=document.createElement("style");e.id="gm-css-cache",e.appendChild(document.createTextNode(goosemod.storage.get("goosemodCSSCache")||"")),document.body.appendChild(e),goosemod.showToast("Loaded",{subtext:"CSS Cache",type:"debuginfo"}),init$2()},removeStyle=()=>{const e=document.getElementById("gm-css-cache");e&&e.remove()};var CSSCache={__proto__:null,init:init$2,load:load,removeStyle:removeStyle};let goosemodScope={},unpatchers=[];const setThisScope=e=>{goosemodScope=e},showSponsorModal=()=>{const{React:e}=goosemodScope.webpackModules.common,o=goosemodScope.webpackModules.findByDisplayName("PremiumFeaturesList"),t=goosemodScope.webpackModules.findByProps("roleIcon","profileBadgeIcon"),s=goosemodScope.webpackModules.findByDisplayName("PersonShield"),n=goosemodScope.webpackModules.findByProps("ModalFooter"),{Button:a}=goosemodScope.webpackModules.findByPropsAll("Button")[1],r=goosemodScope.webpackModules.findByProps("button","colorRed"),{PremiumGuildSubscriptionPurchaseModal:i}=goosemodScope.webpackModules.findByProps("PremiumGuildSubscriptionPurchaseModal"),d={default:i},l=(o,s="")=>()=>e.createElement("div",{style:{flexShrink:"0",marginRight:"10px",width:"24px",height:"24px"},className:t[o]},s);goosemodScope.patcher.patch(d,"default",(([{onClose:t}],i)=>(i.props.id="gm-sponsor-modal",i.props.children[1].props.children=[],i.props.children[1].props.children.unshift(e.createElement("div",{},e.createElement("div",{},"You can sponsor (donate regularly or one-time) GooseMod to help support it's development."),e.createElement(o,{columns:2,features:[{description:"Sponsor badge in GooseMod",overrideIcon:l("profileBadgeIcon")},{description:"Sponsor role in GooseNest Discord",overrideIcon:l("roleIcon",e.createElement(s,{width:"24px",height:"24px"}))}]}),e.createElement(n.ModalFooter,{},e.createElement(a,{color:r.colorBrand,type:"submit",onClick:()=>{window.open("https://github.com/sponsors/CanadaHonk"),t()}},"Sponsor"),e.createElement(a,{color:r.colorPrimary,look:r.lookLink,type:"button",onClick:()=>{t()}},"Close")))),i)));const{openModal:c}=goosemodScope.webpackModules.findByProps("openModal");c((o=>e.createElement(d.default,{...o})))},badgeUsers={sponsor:["852884085021737001","285418210965323776"],dev:["852884085021737001"],translator:["852884085021737001","686166148882104337"]},addBadges=()=>{unpatchers.push(goosemodScope.patcher.userBadges.patch("Miruku Sponsor","https://emoji.gg/assets/emoji/3858-blurple-star.png",(()=>goosemodScope.settings.gmSettings.get().gmBadges?badgeUsers.sponsor:[]),(()=>{showSponsorModal()}),{round:!0}),goosemodScope.patcher.userBadges.patch("Miruku Early Supporter","https://emoji.gg/assets/emoji/6326-blurple-shop.png",(()=>goosemodScope.settings.gmSettings.get().gmBadges?badgeUsers.sponsor:[]),(()=>{showSponsorModal()}),{round:!0}),goosemodScope.patcher.userBadges.patch("Miruku Staff Team","https://emoji.gg/assets/emoji/9098-blurple-announcements.png",(()=>goosemodScope.settings.gmSettings.get().gmBadges?badgeUsers.translator:[]),(()=>{}),{round:!0}),goosemodScope.patcher.userBadges.patch("Official MirukuClient Dev","https://emoji.gg/assets/emoji/6817_Discord_Verified.png",(()=>goosemodScope.settings.gmSettings.get().gmBadges?badgeUsers.dev:[]),(()=>{}),{round:!0}),goosemod.patcher.guildBadges.patch("Miruku-Verified Server","https://emoji.gg/assets/emoji/6817_Discord_Verified.png",(()=>goosemodScope.settings.gmSettings.get().gmBadges?["873898245422723113"]:[]),(()=>{}),{round:!0}))},removeBadges=()=>{for(const e of unpatchers)e()};var GMBadges={__proto__:null,setThisScope:setThisScope,addBadges:addBadges,removeBadges:removeBadges};function getLocalStoragePropertyDescriptor(){const e=document.createElement("frame");e.src="about:blank",document.body.appendChild(e);let o=Object.getOwnPropertyDescriptor(e.contentWindow,"localStorage");return e.remove(),o}var fixLocalStorage=()=>{Object.defineProperty(window,"localStorage",getLocalStoragePropertyDescriptor())};const init$1=()=>{fixLocalStorage()},type$1="LocalStorage",set$1=(e,o)=>localStorage.setItem(e,o),get$1=e=>localStorage.getItem(e),remove$1=e=>localStorage.removeItem(e),keys$1=()=>Object.keys(localStorage);var impl_localstorage={__proto__:null,init:init$1,type:type$1,set:set$1,get:get$1,remove:remove$1,keys:keys$1};let storageCache={};const type="Extension";document.addEventListener("gmes_get_return",(({detail:e})=>{storageCache=e}),{once:!0}),document.dispatchEvent(new CustomEvent("gmes_get"));const set=(e,o)=>{storageCache[e]=o,document.dispatchEvent(new CustomEvent("gmes_set",{detail:{key:e,value:o}}))},get=e=>storageCache[e]||null,remove=e=>{delete storageCache[e],document.dispatchEvent(new CustomEvent("gmes_remove",{detail:{key:e}}))},keys=()=>Object.keys(storageCache);var impl_extension={__proto__:null,type:type,set:set,get:get,remove:remove,keys:keys};const impl=window.gmExtension?impl_extension:impl_localstorage;impl.init&&impl.init();var _Card=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByProps("Sizes","Colors","Looks","DropdownSizes"),t=goosemod.webpackModules.findByDisplayName("Switch"),s=goosemod.webpackModules.findByDisplayName("Markdown"),n=goosemod.webpackModules.findByDisplayName("FormText"),a=goosemod.webpackModules.findByProps("formText","placeholder"),r=goosemod.webpackModules.findByProps("title","dividerDefault"),i=goosemod.webpackModules.findByProps("openModal"),d=goosemod.webpackModules.findByDisplayName("SmallMediaCarousel"),l=goosemod.webpackModules.findByDisplayName("Discord");return class extends e.PureComponent{render(){return this.props.checked!==this.props.isToggled()&&(this.props.checked=this.props.isToggled()),e.createElement("div",{className:["gm-store-card",this.props.mini?"gm-store-card-mini":"",...this.props.tags.map((e=>e.replace(/ /g,"|")))].join(" "),onClick:this.props.onClick},e.createElement("img",{loading:"lazy",alt:"",draggable:"false",src:this.props.images?.[0],onClick:()=>{this.props.images?.length&&i.openModal((()=>e.createElement("div",{className:"gm-carousel-modal"},e.createElement(d,{items:this.props.images.map((e=>({type:1,src:e}))),autoplayInterval:5e3}))))}}),e.createElement("div",{className:[r.title,this.props.author.every((e=>!e.avatar))?"no-pfp":""].join(" ")},...this.props.author.map(((o,t)=>[o.avatar?e.createElement("img",{loading:"lazy",src:`https://cdn.discordapp.com/avatars/${o.id}/${o.avatar}.png?size=32`,className:"gm-store-author-pfp"}):null,e.createElement("span",{className:"gm-store-author-name"},o.name),t!==this.props.author.length-1?e.createElement("span",{className:a.description},","):null]))),e.createElement("div",{className:r.title},this.props.name),e.createElement(n,{className:this.props.name?a.description:""},e.createElement(s,{className:"gm-settings-note-markdown"},this.props.subtext)),e.createElement("div",{},this.props.github?e.createElement(n,{className:a.description},e.createElement("span",{},this.props.github.stars),e.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor"},e.createElement("path",{d:"M12 .587l3.668 7.568 8.332 1.151-6.064 5.828 1.48 8.279-7.416-3.967-7.417 3.967 1.481-8.279-6.064-5.828 8.332-1.151z"}))):e.createElement("div"),e.createElement(n,{className:a.description},this.props.subtext2)),e.createElement("div",{},e.createElement(o,{color:"danger"===this.props.buttonType?o.Colors.RED:o.Colors.BRAND,look:"danger"===this.props.buttonType?o.Looks.OUTLINED:o.Looks.FILLED,size:o.Sizes.SMALL,onClick:()=>{this.props.onclick()}},this.props.buttonText),this.props.github?e.createElement(o,{color:o.Colors.GREY,size:o.Sizes.SMALL,onClick:()=>{window.open(`https://github.com/${this.props.github.repo}`)}},e.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor"},e.createElement("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"}))):null,this.props.discordMessage?e.createElement(o,{color:o.Colors.GREY,size:o.Sizes.SMALL,onClick:()=>{const{transitionTo:e}=goosemod.webpackModules.findByProps("transitionTo"),{jumpToMessage:o}=goosemod.webpackModules.findByProps("jumpToMessage");e(`/channels/${this.props.discordMessage.guild}/${this.props.discordMessage.channel}`),o({channelId:this.props.discordMessage.channel,messageId:this.props.discordMessage.message,flash:!0})}},e.createElement(l,{width:"24",height:"24"})):null,e.createElement(t,{className:this.props.showToggle?"":"hide-toggle",checked:this.props.checked,disabled:!1,onChange:e=>{this.props.checked=!this.props.checked,this.forceUpdate(),this.props.onToggle(this.props.checked)}})))}}},card={__proto__:null,default:_Card},ProfileStoreInit=()=>{const e=_Card(),{React:o,ReactDOM:t}=goosemod.webpackModules.common,s=goosemod.webpackModules.find((e=>"UserProfileModal"===e.default?.displayName)),n=goosemod.webpackModules.findByProps("auto","scrollerBase");goosemod.patcher.patch(s,"default",((s,a)=>{const r=goosemod.reactUtils.findInReactTree(a.props.children,(e=>e.props?.section));r&&goosemod.patcher.patch(r,"type",(([{user:{id:s}}],a)=>{const r=goosemod.moduleStoreAPI.modules.filter((e=>e.authors.some&&e.authors.some((e=>e.i===s))));if(0===r.length)return;const i=goosemod.settings.items.find((e=>"Themes from GooseMod"===e[1]))[2],d=goosemod.settings.items.find((e=>"Plugins from Goosemod"===e[1]))[2],l=r.filter((e=>e.tags.includes("theme"))),c=r.filter((e=>!e.tags.includes("theme"))),m=a.props.children,p=m.props.children[0],g=t=>o.createElement(e,{...t,mini:!0,onClick:async()=>{document.querySelector(".backdrop-1wrmKB").click();goosemod.webpackModules.findByProps("transitionTo").transitionTo("/channels/@me"),await sleep(200),document.getElementById("gm-home-"+(t.tags.includes("theme")?"themes":"plugins")).click(),await sleep(200);const e=[...document.querySelectorAll(".title-31JmR4 + .colorStandard-2KCXvj")].filter((e=>e.textContent===t.subtext)).pop().parentElement;document.querySelector("#gm-settings-inject").scrollTo({top:e.offsetTop-12,behavior:"smooth"}),e.style.boxShadow="0 0 12px 6px rgb(88 101 242 / 30%)"}});return goosemod.patcher.patch(m.props,"onItemSelect",(([e])=>{e.startsWith("GM_")&&setTimeout((()=>{const e=document.querySelector(".body-r6_QPy > :first-child");t.render(o.createElement("div",{className:[n.auto,"gm-modules-container"].join(" ")},...l.map((e=>i.find((o=>o.name===e.name)))).map((e=>g(e))),...c.map((e=>d.find((o=>o.name===e.name)))).map((e=>g(e)))),e)}),1)})),m.props.children.push(o.cloneElement(p,{id:"GM_MODULES"},"#terms.goosemod.modules#")),a}))}))};const scopeSetterFncs=[setThisScope$6,setThisScope$5,setThisScope$4,moduleStoreAPI.setThisScope,setThisScope$8,setThisScope$7,setThisScope$c,setThisScope$a,setThisScope$3,setThisScope$9,setThisScope],importsToAssign={startLoadingScreen:startLoadingScreen,stopLoadingScreen:stopLoadingScreen,updateLoadingScreen:updateLoadingScreen,settings:Settings,importModule:importModule,moduleSettingsStore:ModuleSettingsStore,webpackModules:WebpackModules,logger:Logger,showToast:showToast,confirmDialog:show$1,moduleStoreAPI:moduleStoreAPI,changelog:Changelog,goosemodChangelog:GoosemodChangelog,patcher:Patcher,attrs:Attrs,reactUtils:ReactUtils,cssCache:CSSCache,gmBadges:GMBadges,ootb:OOTB,storage:impl},init=async function(){for(Object.assign(this,importsToAssign),this.cssCache.load();0===document.querySelectorAll('.flex-1xMQg5.flex-1O1GKY.horizontal-1ae9ci.horizontal-2EEEnY.flex-1O1GKY.directionRow-3v3tfG.justifyStart-2NDFzi.alignStretch-DpGPf3.noWrap-3jynv6 > [type="button"]:last-child').length||void 0===window.webpackJsonp;)await sleep(10);for(let e of scopeSetterFncs)await e(this);this.versioning={version:"12.0-dev",hash:"77fa89e960f1023e7807c98305104000108eb33c",lastUsedVersion:this.storage.get("goosemodLastVersion")},this.versioning.isDeveloperBuild="<hash>"===this.versioning.hash,this.storage.set("goosemodLastVersion",this.versioning.version),this.logger.debug("import.version.goosemod",`${this.versioning.version} (${this.versioning.hash})`),void 0!==window.DiscordNative&&this.logger.debug("import.version.discord",`${DiscordNative.app.getReleaseChannel()} ${DiscordNative.app.getVersion()}`),window.gmUntethered&&(this.untetheredVersion=window.gmUntethered.slice()),this.versioning.lastUsedVersion&&this.versioning.version!==this.versioning.lastUsedVersion&&this.goosemodChangelog.show(),this.startLoadingScreen(),this.updateLoadingScreen("Initialising internals...");let e=Object.keys(JSON.parse(this.storage.get("goosemodModules"))||{}),o=Object.keys(JSON.parse(this.storage.get("goosemodDisabled"))||{});this.modules=e.filter((e=>-1===o.indexOf(e))).reduce(((e,o)=>(e[o]={goosemodHandlers:{}},e)),{}),this.disabledModules=e.filter((e=>-1!==o.indexOf(e))).reduce(((e,o)=>(e[o]={goosemodHandlers:{}},e)),{}),this.moduleStoreAPI.modules=JSON.parse(this.storage.get("goosemodCachedModules"))||[],this.moduleStoreAPI.modules.cached=!0,this.settings.makeGooseModSettings(),await this.moduleStoreAPI.initRepos(),this.removed=!1,this.storage.get("goosemodCachedModules")||await this.moduleStoreAPI.updateModules(!0);let t=!1;0===e.length&&(t=!0),e=e.filter((e=>void 0!==this.moduleStoreAPI.modules.find((o=>o.name===e))));let s=e.find((e=>e.toLowerCase().includes("theme")));s&&e.unshift(e.splice(e.indexOf(s),1)[0]);let n=e.find((e=>"Hardcoded Color Fixer"===e));n&&e.unshift(e.splice(e.indexOf(n),1)[0]),t&&(e=["Fucklytics","Custom CSS","Who Reacted","Sticky Notes","Voice chat utilities","Channel Icons"]),this.updateLoadingScreen("Importing modules from Store...");const a=[];for(let t of e)a.push(this.moduleStoreAPI.importModule(t,o.includes(t)));if(await Promise.all(a),this.cssCache.removeStyle(),this.settings.gmSettings.get().gmBadges&&this.gmBadges.addBadges(),this.settings.gmSettings.get().attrs&&this.attrs.patch(),this.saveInterval=setInterval((()=>{this.moduleSettingsStore.saveModuleSettings()}),3e3),this.remove=()=>{this.settingsUninjects.forEach((e=>e())),clearInterval(this.saveInterval),clearInterval(this.hotupdateInterval),this.storage.keys().filter((e=>e.toLowerCase().startsWith("goosemod"))).forEach((e=>this.storage.remove(e))),this.removed=!0;for(let e in this.modules)if(this.modules.hasOwnProperty(e)&&void 0!==this.modules[e].goosemodHandlers.onRemove)try{this.modules[e].goosemodHandlers.onRemove()}catch(e){}},this.moduleStoreAPI.hotupdate(!0),this.hotupdateInterval=setInterval((()=>{this.settings.gmSettings.get().autoupdate&&this.moduleStoreAPI.hotupdate()}),36e5),this.stopLoadingScreen(),this.settings.isSettingsOpen()&&this.settings.reopenSettings(),!this.storage.get("goosemodOOTB")){for(await sleep(1e3);document.querySelector(".modal-3O0aXp");)await sleep(100);this.ootb.start(),this.storage.set("goosemodOOTB",!0)}ProfileStoreInit()};window.goosemod={},init.bind(window.goosemod)();var modulesPreview=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("DiscoverStaticGuildCard"),t=e=>e.images?.map((o=>{if(o.startsWith("/")){o=e.repo.split("/").slice(0,-1).join("/")+o}return o}));return class extends e.PureComponent{render(){return setTimeout((()=>{try{const e=document.querySelectorAll(".discoverPreview-3q1szX .splashImage-352DQ1");e[e.length-3].src=t(this.props.modules[1])[0],e[e.length-2].src=t(this.props.modules[0])[0],e[e.length-1].src=t(this.props.modules[2])[0]}catch(e){}}),100),e.createElement("div",{className:"discoverPreview-3q1szX gm-modules-preview"},e.createElement(o,{className:"placeholderCard-3Zu1qO",disabled:!0,small:!0,loading:!1,guild:{banner:null,splash:null,discoverySplash:null,icon:null,id:null,memberCount:null,presenceCount:null,...this.props.modules[1]}}),e.createElement(o,{className:"placeholderCard-3Zu1qO",guild:{banner:null,splash:null,discoverySplash:null,icon:null,id:null,memberCount:null,presenceCount:null,...this.props.modules[0]}}),e.createElement(o,{className:"placeholderCard-3Zu1qO",disabled:!0,small:!0,loading:!1,guild:{banner:null,splash:null,discoverySplash:null,icon:null,id:null,memberCount:null,presenceCount:null,...this.props.modules[2]}}))}}},modulesPreview$1={__proto__:null,default:modulesPreview},openReposModal=async()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("SwitchItem");class t extends e.Component{constructor(e){const o=e.onChange;e.onChange=e=>{o(e),this.props.value=e,this.forceUpdate()},super(e)}render(){return e.createElement("div",{},e.createElement(r,{style:{width:"92px",position:"absolute",right:"10px",marginTop:"33px"},color:i.colorRed,size:i.sizeSmall,onClick:this.props.buttonOnClick},"#terms.remove#"),e.createElement(o,{...this.props}))}}let s;const n=async()=>{await goosemod.moduleStoreAPI.updateModules(),await goosemod.moduleStoreAPI.updateStoreSetting(),document.querySelector(".selected-aXhQR6").click()},a=async()=>{s(),await n(),b()},{Button:r}=goosemod.webpackModules.findByProps("Button"),i=goosemod.webpackModules.findByProps("button","colorRed"),d=goosemod.webpackModules.findByProps("ModalRoot"),l=goosemod.webpackModules.findByProps("socialLink","date"),c=goosemod.webpackModules.findByDisplayName("Header"),m=goosemod.webpackModules.findByDisplayName("Text"),{openModal:p}=goosemod.webpackModules.findByProps("openModal"),g=goosemod.webpackModules.findByDisplayName("Flex"),u=goosemod.webpackModules.findByDisplayName("TextInput"),h=goosemod.webpackModules.findByDisplayName("Tooltip"),f=goosemod.webpackModules.findByDisplayName("FlowerStar"),S=goosemod.webpackModules.findByDisplayName("Verified"),y=goosemod.webpackModules.findAll((e=>"Alert"===e.displayName)).pop(),b=()=>{const o=[];let b=0;for(const s of goosemod.moduleStoreAPI.repos){const r=[s.meta.name];if(s.pgp?.trustState){let o="",t=null;switch(s.pgp.trustState){case"trusted":o="PGP Verified\$#",t=e.createElement(S,{className:"icon-1ihkOt"});break;case"untrusted":o="PGP Untrusted\$#",t=e.createElement(y,{className:"icon-1ihkOt"});break;case"unknown":o="No PGP\$#",t=e.createElement(y,{className:"icon-1ihkOt"})}r.unshift(e.createElement("span",{style:{display:"inline-flex",position:"relative",top:"2px",marginRight:"4px"}},e.createElement(h,{position:"top",color:"primary",text:o},(({onMouseLeave:s,onMouseEnter:n})=>e.createElement(f,{className:`gm-repos-modal-icon-${t.type.displayName}`,"aria-label":o,onMouseEnter:n,onMouseLeave:s},t)))))}o.push(e.createElement(t,{style:{marginTop:0===b?"16px":""},note:s.meta.description,value:s.enabled,onChange:e=>{s.enabled=e,n()},buttonOnClick:async()=>{goosemod.moduleStoreAPI.repos.splice(goosemod.moduleStoreAPI.repos.indexOf(s),1),a()}},...r)),b++}let w="";p((t=>(s=t.onClose,e.createElement(d.ModalRoot,{transitionState:t.transitionState,size:"medium"},e.createElement(d.ModalHeader,{},e.createElement(g.Child,{basis:"auto",grow:1,shrink:1,wrap:!1},e.createElement(c,{tag:"h2",size:c.Sizes.SIZE_20},"Repos\$#"),e.createElement(m,{size:m.Sizes.SIZE_12,className:l.date},goosemod.moduleStoreAPI.modules.filter((e=>e.tags.includes("theme"))).length," Themes",", ",goosemod.moduleStoreAPI.modules.filter((e=>!e.tags.includes("theme"))).length," Plugins",", ",Object.keys(goosemod.moduleStoreAPI.modules.reduce(((e,o)=>{let t=o.authors;return t.forEach||(t=[t]),t.forEach((o=>e[o.n||o.match(/(.*) \(([0-9]{17,18})\)/)?.[1]||o]=!0)),e}),{})).length," Developers")),e.createElement("FlexChild",{basis:"auto",grow:0,shrink:1,wrap:!1},e.createElement(d.ModalCloseButton,{onClick:t.onClose}))),e.createElement(d.ModalContent,{},...o,e.createElement(g,{style:{marginBottom:"16px"},basis:"auto",grow:1,shrink:1},e.createElement(u,{className:"codeRedemptionInput-3JOJea",placeholder:"https://example.com/modules.json",onChange:e=>{w=e}}),e.createElement(r,{style:{width:"112px"},size:i.sizeMedium,onClick:async()=>{let e={};try{e=await(await fetch(w)).json()}catch(e){}if(void 0===e.meta?.name)return void goosemod.showToast("Invalid Repo\$#",{type:"error",timeout:5e3,subtext:"Invalid Format\$#"});if(!confirm("External repos pose security risks as they are not controlled by our team. We are not responsible for any dangers because of external repos added by users.\n\nIf you do not trust the owner of this repo do not use it as it could compromise your Discord install.\n\nPlease confirm adding this repo by pressing OK.\$#"))return void goosemod.showToast("Cancelled Adding Repo\$#",{type:"danger",timeout:5e3,subtext:"Refused Security Prompt\$#"});const o={url:w,meta:e.meta,enabled:!0},t=await goosemod.moduleStoreAPI.verifyPgp(o,!1);"untrusted"!==t.trustState?"trusted"===t.trustState||confirm("This repo is not known or trusted (no PGP verification), please be extra careful. Make sure you trust the owner(s) of this repo completely.\n\nTo solve this issue ask the repo maintainer to add PGP support.\n\nPlease reconfirm adding this repo by pressing OK.\$#")?(goosemod.moduleStoreAPI.repos.push(o),a()):goosemod.showToast("#toasts.add_repo.cancelled.text#",{type:"danger",timeout:5e3,subtext:"#toasts.add_repo.cancelled.reasons.refused#"}):goosemod.showToast("#toasts.add_repo.cancelled.text#",{type:"danger",timeout:5e3,subtext:"PGP Untrusted Failure\$#"})}},"#terms.add#")))))))};b()},header$2=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByProps("headerBarContainer","pageContent"),t=goosemod.webpackModules.findByProps("updateAvailable"),s=goosemod.webpackModules.findByProps("icon","iconBadge","title"),n=e.createElement(goosemod.webpackModules.findByDisplayName("Retry"),{width:24,height:24,className:s.icon}),a=e.createElement(goosemod.webpackModules.findByDisplayName("Cloud"),{width:24,height:24,className:s.icon}),r=goosemod.webpackModules.findByDisplayName("HeaderBarContainer"),i=goosemod.webpackModules.findByDisplayName("TabBar"),d=goosemod.webpackModules.findByProps("topPill"),l=goosemod.webpackModules.findByProps("tabBar","nowPlayingColumn"),c={themes:"STORE",plugins:"STORE"};return class extends e.PureComponent{constructor(e){super(e)}render(){return e.createElement(r,{className:o.headerBarContainer,isAuthenticated:!0,transparent:!1},e.createElement(r.Icon,{icon:()=>this.props.icon,className:s.icon}),e.createElement(r.Title,{},this.props.title),c[this.props.id]?e.createElement(r.Divider):null,c[this.props.id]?e.createElement(i,{selectedItem:c[this.props.id],type:d.topPill,className:l.tabBar,onItemSelect:e=>{c[this.props.id]=e,this.forceUpdate(),setTimeout(goosemod.settings.updateModuleStoreUI,10)}},e.createElement(i.Item,{id:"STORE",look:0,className:l.item},"#store.options.tabs.store#"),e.createElement(i.Item,{id:"IMPORTED",look:0,className:l.item},"#store.options.tabs.imported#")):null,"snippets"!==this.props.id?e.createElement("div",{className:s.toolbar,style:{position:"absolute",right:"0px"}},e.createElement(r.Icon,{icon:()=>n,tooltip:"Refresh\$#",onClick:async()=>{document.querySelector(`.${s.toolbar} > [role="button"] > svg`).classList.add(t.updateAvailable),await goosemod.moduleStoreAPI.hotupdate(!0),document.querySelector(".selected-aXhQR6").click()}}),e.createElement(r.Icon,{icon:()=>a,tooltip:"#terms.store.repos#",onClick:openReposModal})):"")}}},header$3={__proto__:null,default:header$2},_Divider=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("FormDivider"),t=goosemod.webpackModules.findByProps("dividerDefault","titleDefault");return class extends e.PureComponent{render(){return e.createElement(o,{className:t.dividerDefault})}}},divider={__proto__:null,default:_Divider},header=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("FormTitle"),t=goosemod.webpackModules.findByProps("marginTop20","marginBottom20"),s=goosemod.webpackModules.findByDisplayName("Tooltip"),n=goosemod.webpackModules.findByDisplayName("Science");return class extends e.PureComponent{constructor(o){o.experimental&&(o.text=[e.createElement(s,{position:"top",color:"primary",text:"Experimental"},(({onMouseLeave:o,onMouseEnter:t})=>e.createElement(n,{width:18,height:18,className:"gm-settings-label-icon",onMouseLeave:o,onMouseEnter:t}))),e.createElement("span",{style:{verticalAlign:"unset"},className:"gm-settings-label-text"},o.text)]),o.id=`gm-settings-header-${Math.random().toString().substring(2)}`,o.collapsed=!1,super(o),this.props.handleCollapse=()=>{const e=[...document.querySelectorAll(`#${this.props.id} ~ *`)],o=e.slice(0,e.indexOf(e.find((e=>"H5"===e.tagName))));for(const e of o)e.style.display=this.props.collapsed?"none":""}}render(){return setTimeout(this.props.handleCollapse,100),e.createElement(o,{tag:"h5",className:(0!==this.props.i?t.marginTop20+" ":"")+t.marginBottom8,onClick:()=>{this.props.collapsed=!this.props.collapsed,this.props.handleCollapse(),this.forceUpdate()},id:this.props.id},this.props.text,e.createElement(goosemod.webpackModules.findByDisplayName("DropdownArrow"),{className:["gm-settings-header-collapser",this.props.collapsed?"collapsed":""].join(" "),width:22,height:22}))}}},header$1={__proto__:null,default:header},toggle=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("SwitchItem"),t=goosemod.webpackModules.findByDisplayName("Markdown"),s=goosemod.webpackModules.findByDisplayName("Tooltip"),n=goosemod.webpackModules.findByDisplayName("Science"),a=goosemod.webpackModules.findByDisplayName("InfoFilled");return class extends e.Component{constructor(o){const t=o.onToggle;o.onChange=e=>{this.props.value=e,this.forceUpdate(),t(e)},o.experimental&&(o.text=[e.createElement(s,{position:"top",color:"primary",text:"Experimental"},(({onMouseLeave:o,onMouseEnter:t})=>e.createElement(n,{width:22,height:22,className:"gm-settings-label-icon",onMouseLeave:o,onMouseEnter:t}))),e.createElement("span",{className:"gm-settings-label-text"},o.text)],o.subtext="**Experimental:** "+o.subtext),o.debug&&(o.text=[e.createElement(s,{position:"top",color:"primary",text:"Debug"},(({onMouseLeave:o,onMouseEnter:t})=>e.createElement(a,{width:22,height:22,className:"gm-settings-label-icon",onMouseLeave:o,onMouseEnter:t}))),e.createElement("span",{className:"gm-settings-label-text"},o.text)],o.subtext="**Debug:** "+o.subtext),super(o)}render(){return e.createElement(o,{value:this.props.isToggled(),note:e.createElement(t,{className:"gm-settings-note-markdown"},this.props.subtext||""),disabled:!!this.props.disabled&&this.props.disabled(),onChange:this.props.onChange},this.props.text)}}},toggle$1={__proto__:null,default:toggle},text=()=>{const e=_Divider(),{React:o}=goosemod.webpackModules.common,t=goosemod.webpackModules.findByDisplayName("FormItem"),s=goosemod.webpackModules.findByDisplayName("FormText"),n=goosemod.webpackModules.findByDisplayName("Flex"),a=goosemod.webpackModules.findByProps("marginTop20","marginBottom20"),r=goosemod.webpackModules.findByProps("title","dividerDefault"),i=goosemod.webpackModules.findByProps("formText","placeholder");return class extends o.PureComponent{render(){return o.createElement(t,{className:[n.Direction.VERTICAL,n.Justify.START,n.Align.STRETCH,n.Wrap.NO_WRAP,a.marginBottom20].join(" ")},o.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},o.createElement("div",{},o.createElement("div",{className:r.labelRow,style:{marginBottom:"4px"}},o.createElement("label",{class:r.title},this.props.text)),o.createElement(s,{className:i.description},this.props.subtext))),o.createElement(e))}}},text$1={__proto__:null,default:text},textAndButton=()=>{const{React:e}=goosemod.webpackModules.common,o=_Divider(),t=goosemod.webpackModules.findByProps("Sizes","Colors","Looks","DropdownSizes"),s=goosemod.webpackModules.findByDisplayName("Markdown"),n=goosemod.webpackModules.findByDisplayName("FormItem"),a=goosemod.webpackModules.findByDisplayName("FormText"),r=goosemod.webpackModules.findByDisplayName("Flex"),i=goosemod.webpackModules.findByProps("marginTop20","marginBottom20"),d=goosemod.webpackModules.findByProps("title","dividerDefault"),l=goosemod.webpackModules.findByProps("formText","placeholder");return class extends e.PureComponent{render(){return e.createElement(n,{className:[r.Direction.VERTICAL,r.Justify.START,r.Align.STRETCH,r.Wrap.NO_WRAP,i.marginBottom20].join(" ")},e.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},e.createElement("div",{},e.createElement("div",{className:d.labelRow,style:{marginBottom:"4px"}},e.createElement("label",{class:d.title},this.props.text)),e.createElement(a,{className:l.description},e.createElement(s,{className:"gm-settings-note-markdown"},this.props.subtext||""))),e.createElement(t,{color:this.props.danger?t.Colors.RED:t.Colors.BRAND,disabled:this.props.disabled,onClick:()=>this.props.onclick()},this.props.buttonText)),e.createElement(o))}}},textAndButton$1={__proto__:null,default:textAndButton},textAndColor=()=>{const{React:e,constants:{DEFAULT_ROLE_COLOR:o,ROLE_COLORS:t}}=goosemod.webpackModules.common,s=_Divider(),n=goosemod.webpackModules.findByDisplayName("FormItem"),a=goosemod.webpackModules.findByDisplayName("FormTitle"),r=goosemod.webpackModules.findByProps("marginTop20","marginBottom20"),i=goosemod.webpackModules.findByProps("defaultMarginh5");return class extends e.PureComponent{constructor(e){e.default=(e=>{if(e&&7===e.length)return parseInt(e.slice(1),16)})((e.initialValue||(()=>{}))())||0,e.value=e.default,super(e)}render(){const d=goosemod.webpackModules.find((e=>"ColorPicker"===e.default?.displayName));return e.createElement(n,{className:[r.marginBottom20].join(" ")},e.createElement(a,{tag:"h5",className:(0!==this.props.i?r.marginTop20+" ":"")+i.defaultMarginh5},this.props.text),e.createElement(d.default,{colors:t,defaultColor:this.props.default||o,disabled:!1,value:this.props.value,customColor:null,renderDefaultButton:o=>e.createElement(d.DefaultColorButton,o),renderCustomButton:o=>e.createElement(d.CustomColorButton,o),customPickerPosition:"bottom",onChange:e=>{var o;this.props.value=e,this.forceUpdate(),this.props.oninput("#"+((16711680&(o=e))>>>16).toString(16).padStart(2,"0")+((65280&o)>>>8).toString(16).padStart(2,"0")+(255&o).toString(16).padStart(2,"0"))}}),e.createElement(s))}}},textAndColor$1={__proto__:null,default:textAndColor},button=()=>{const{React:e}=goosemod.webpackModules.common;return goosemod.webpackModules.findByProps("Sizes","Colors","Looks","DropdownSizes"),class o extends e.PureComponent{render(){return e.createElement(o,{color:o.Colors.BRAND,size:o.Sizes.SMALL,disabled:this.props.disabled,onClick:()=>this.props.onclick()},this.props.text)}}},button$1={__proto__:null,default:button},search=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("SearchBar");return class extends e.PureComponent{render(){return this.props.text||(this.props.text=""),setTimeout((()=>{this.props.onchange(this.props.text)}),10),e.createElement(o,{...o.defaultProps,className:this.props.storeSpecific?"gm-store-search":"",size:o.Sizes.MEDIUM,query:this.props.text,placeholder:this.props.placeholder||"Search",onClear:()=>{this.props.text="",this.forceUpdate()},onChange:e=>{this.props.text=e,this.forceUpdate()}})}}},search$1={__proto__:null,default:search},dropdownIndividual=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("SelectTempWrapper"),t=goosemod.webpackModules.findByDisplayName("FormText"),s=goosemod.webpackModules.findByProps("formText","placeholder");return class extends e.PureComponent{render(){return"function"==typeof this.props.options&&(this.props.options=this.props.options()),this.props.value||(this.props.value=(this.props.selected||(()=>{}))()||this.props.options[0]),setTimeout((()=>{this.props.onchange(this.props.value)}),10),e.createElement("div",{className:"gm-inline-dropdown"},e.createElement(t,{className:s.description},this.props.label),e.createElement(o,{searchable:!1,onChange:e=>{this.props.value=e.value,this.forceUpdate()},value:this.props.value,options:this.props.options.map((e=>({label:e,value:e})))}))}}},dropdownIndividual$1={__proto__:null,default:dropdownIndividual},_StoreHeader=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("Text"),t=goosemod.webpackModules.findByProps("pageHeader");return class extends e.PureComponent{render(){return e.createElement("div",{className:[t.headerContainer,"gm-store-header"].join(" ")},e.createElement(o,{color:o.Colors.HEADER_PRIMARY,size:o.Sizes.SIZE_20,className:t.pageHeader},this.props.text))}}},storeHeader={__proto__:null,default:_StoreHeader},storeCategory=()=>{const{React:e}=goosemod.webpackModules.common,o=_StoreHeader(),t=_Card(),s=goosemod.webpackModules.findByProps("auto","scrollerBase");return class extends e.PureComponent{render(){return this.props.cards||(this.props.cards=goosemod.settings.items.find((e=>e[1]===this.props.itemName))[2].filter((e=>"card"===e.type)).sort(this.props.sort).slice(0,10).map((o=>e.createElement(t,o)))),e.createElement("div",{className:"gm-store-category"},e.createElement(o,{text:this.props.text}),e.createElement("div",{className:s.auto},...this.props.cards))}}},storeCategory$1={__proto__:null,default:storeCategory},custom=()=>{const{React:e}=goosemod.webpackModules.common;return class extends e.PureComponent{render(){return e.createElement("div",{ref:e=>{e&&e.appendChild("function"==typeof this.props.element?this.props.element():this.props.element)}})}}},custom$1={__proto__:null,default:custom},textInput=()=>{const{React:e}=goosemod.webpackModules.common,o=_Divider(),t=goosemod.webpackModules.findByDisplayName("FormItem"),s=goosemod.webpackModules.findByDisplayName("FormText"),n=goosemod.webpackModules.findByDisplayName("TextInput"),a=goosemod.webpackModules.findByDisplayName("Flex"),r=goosemod.webpackModules.findByProps("marginTop20","marginBottom20"),i=goosemod.webpackModules.findByProps("formText","description");return class extends e.PureComponent{render(){return e.createElement(t,{title:this.props.text,className:[a.Direction.VERTICAL,a.Justify.START,a.Align.STRETCH,a.Wrap.NO_WRAP,r.marginBottom20].join(" ")},e.createElement(n,{onChange:e=>{this.props.oninput(e)},defaultValue:this.props.initialValue?this.props.initialValue():""}),this.props.subtext&&e.createElement(s,{className:[i.description,r.marginTop8].join(" ")},this.props.subtext),e.createElement(o))}}},textInput$1={__proto__:null,default:textInput},subtext=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("FormText"),t=goosemod.webpackModules.findByDisplayName("Markdown"),s=goosemod.webpackModules.findByProps("marginTop20","marginBottom20");return class extends e.PureComponent{render(){return e.createElement(o,{type:"description",className:s.marginBottom20},e.createElement(t,{className:"gm-settings-note-markdown"},this.props.text||""))}}},subtext$1={__proto__:null,default:subtext}})();//# sourceURL=GooseMod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){"use strict";var sleep=e=>new Promise((o=>setTimeout(o,e)));const fromStr=e=>e.replace("rgb(","").replace(")","").split(", "),toStr=([e,o,t])=>`rgb(${e}, ${o}, ${t})`,light=(e,o)=>toStr(fromStr(e).map((e=>e*o))),gmColor="88, 101, 242",regionColor="114, 137, 218",makeRegionStyle=e=>`background-color: rgb(${e}); color: white; border-radius: 4px; border: 2px solid ${light(e,.5)}; padding: 3px 6px 3px 6px; font-weight: bold;`,debug=(e,...o)=>{const t=e.split("."),s=t.map((e=>`%c${e}%c`)),n=t.reduce((e=>e.concat(makeRegionStyle(regionColor),"")),[]);console.log(`%cGooseMod%c ${s.join(" ")}`,makeRegionStyle(gmColor),"",...n,...o)};var Logger={__proto__:null,debug:debug};let wpRequire;wpRequire=window.webpackJsonp.push([[],{get_require:(e,o,t)=>e.exports=t},[["get_require"]]]),delete wpRequire.m.get_require,delete wpRequire.c.get_require;const all=()=>Object.keys(wpRequire.c).map((e=>wpRequire.c[e].exports)).filter((e=>e)),find=e=>{for(const o of all()){if(o.default&&e(o.default))return o.default;if(e(o))return o}},findAll=e=>{const o=[];for(const t of all())t.default&&e(t.default)&&o.push(t.default),e(t)&&o.push(t);return o},findByProps=(...e)=>find((o=>e.every((e=>void 0!==o[e])))),findByPropsAll=(...e)=>findAll((o=>e.every((e=>void 0!==o[e])))),findByPrototypes=(...e)=>find((o=>o.prototype&&e.every((e=>void 0!==o.prototype[e])))),findByDisplayName=e=>find((o=>o.displayName===e)),common={React:findByProps("createElement"),ReactDOM:findByProps("render","hydrate"),Flux:findByProps("Store","CachedStore","PersistedStore"),FluxDispatcher:findByProps("_waitQueue","_orderedActionHandlers"),i18n:findByProps("Messages","_requestedLocale"),channels:findByProps("getSelectedChannelState","getChannelId"),constants:findByProps("API_HOST","CaptchaTypes")};var WebpackModules={__proto__:null,all:all,find:find,findAll:findAll,findByProps:findByProps,findByPropsAll:findByPropsAll,findByPrototypes:findByPrototypes,findByDisplayName:findByDisplayName,common:common},_GMErrorBoundary=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("Header"),t=goosemod.webpackModules.findByProps("Sizes","Colors","Looks","DropdownSizes"),s=goosemod.webpackModules.findByDisplayName("Markdown"),n=goosemod.webpackModules.findByDisplayName("DropdownArrow");return class extends e.PureComponent{constructor(e){super(e),this.state={error:!1}}componentDidCatch(e,o){console.log("honk",{error:e,moreInfo:o});const t=decodeURI(e.stack.split("\n").filter((e=>!e.includes("/assets/"))).join("\n")),s=decodeURI(o.componentStack.split("\n").slice(1,9).join("\n")),n=t.match(/\((.*) \| GM Module:/)?.[1]||s.match(/\((.*) \| GM Module:/)?.[1],a=n||(t.includes("GooseMod")||s.includes("GooseMod")?"GooseMod Internals":"Unknown"),r=n?"Plugin":"Cause";this.setState({error:!0,suspectedCause:{name:a,type:r},errorStack:{raw:e.stack,useful:t},componentStack:{raw:o.componentStack,useful:s}})}render(){return this.state.toRetry&&(this.state.error=!1),setTimeout((()=>{this.state.toRetry=!0}),100),this.state.error?e.createElement("div",{className:"gm-error-boundary"},e.createElement("div",{},e.createElement("div",{}),e.createElement(o,{size:o.Sizes.SIZE_24},"GooseMod has handled an error",e.createElement(s,{},`## Suspected ${this.state.suspectedCause.type}: ${this.state.suspectedCause.name}`))),e.createElement("div",{},e.createElement(t,{color:t.Colors.RED,size:t.Sizes.LARGE,onClick:()=>{location.reload()}},"Refresh")),e.createElement("div",{onClick:()=>{this.state.toRetry=!1,this.state.showDetails=!this.state.showDetails,this.forceUpdate()}},e.createElement("div",{style:{transform:`rotate(${this.state.showDetails?"0":"-90"}deg)`}},e.createElement(n,{width:24,height:24})),this.state.showDetails?"Hide Details":"Show Details"),this.state.showDetails?e.createElement("div",{},e.createElement(s,{},"# Error Stack"),e.createElement(s,{},`\`\`\`\n${this.state.errorStack.useful}\n\`\`\``),e.createElement(s,{},"# Component Stack"),e.createElement(s,{},`\`\`\`\n${this.state.componentStack.useful}\n\`\`\``)):null):this.props.children}}};let GMErrorBoundary;const generateIdSegment=()=>Math.random().toString(16).substring(2),generateId=(e=3)=>new Array(e).fill(0).map((()=>generateIdSegment())).join(""),modIndex={},isReactComponent=e=>!(!e||!e.prototype?.render&&!e.displayName),beforePatches=(e,o,t,s,n)=>{const a=modIndex[t][n].before;if(0===a.length)return o;let r=o;for(const n of a)try{let t=n.call(e,r);if(!1===t)return!1;Array.isArray(t)&&(r=o)}catch(e){console.error(`Before patch (${t} - ${s}) failed, skipping`,e)}return r},afterPatches=(e,o,t,s,n,a)=>{const r=modIndex[s][a].after;let i=t;for(const t of r)try{let s=t.call(e,o,i);s&&(i=s)}catch(e){console.error(`After patch (${s} - ${n}) failed, skipping`,e)}return i},generateNewFunction=(e,o,t,s)=>function(...n){const a=beforePatches(this,n,o,t,s);let r;if(Array.isArray(a)){const n=e.call(this,...a);r=afterPatches(this,a,n,o,t,s)}const{harden:i}=modIndex[o][s];if(i){GMErrorBoundary||(GMErrorBoundary=_GMErrorBoundary());const{React:e}=goosemod.webpackModules.common;return e.createElement(GMErrorBoundary,{},r)}return r},patch$a=(e,o,t,s=!1)=>{if(!e._goosemodPatcherId){const o=generateId();e._goosemodPatcherId=o,modIndex[o]={}}const n=e._goosemodPatcherId,a=`gm-${o}`;if(!modIndex[n][a]){const t=Object.assign({},e)[o];e[o]=Object.assign(generateNewFunction(e[o],n,o,a),t),e[o].toString=()=>t.toString();let s=!1;isReactComponent(e[o])&&(s=!0),e.render&&("render"!==o?patch$a(e,"render",(()=>{})):s=!0),modIndex[n][a]={before:[],after:[],harden:s}}const r=modIndex[n][a][s?"before":"after"].push(t);return()=>{modIndex[n][a][s?"before":"after"].splice(r-1,1)}},uninjectors$1={},inject=(e,o,t,s,n=!1)=>{uninjectors$1[e]=patch$a(o,t,s,n)},uninject=e=>!!uninjectors$1[e]&&(uninjectors$1[e](),!0),getReactInstance=e=>e&&e[Object.keys(e).find((e=>e.startsWith("__reactInternalInstance")||e.startsWith("__reactFiber$")))],getNodeInternals=e=>e&&e._reactInternalFiber||e._reactInternals,getOwnerInstance=e=>{let o=getReactInstance(e);for(;o.return;)if(o=o.return,o.stateNode?._reactInternals)return o.stateNode},findInTree=(e,o,t)=>{const{walkable:s=null,ignore:n=[]}=t;return e&&"object"==typeof e?"string"==typeof o?e[o]:o(e)?e:Array.isArray(e)?e.map((e=>findInTree(e,o,t))).find((e=>e)):(s||Object.keys(e)).map((s=>!n.includes(s)&&findInTree(e[s],o,t))).find((e=>e)):null},findInReactTree=(e,o)=>findInTree(e,o,{walkable:["props","children","child","sibling"]});var ReactUtils={__proto__:null,getReactInstance:getReactInstance,getNodeInternals:getNodeInternals,getOwnerInstance:getOwnerInstance,findInTree:findInTree,findInReactTree:findInReactTree};let goosemodScope$o={};const setThisScope$p=e=>{goosemodScope$o=e},labelToId=e=>e.toLowerCase().replace(/ /g,"-"),getInjectId=e=>`gm-cm-${e}`,patchTypeToNavId=e=>{switch(e){case"user":return"user-context";case"message":return"message";default:return e}},getExtraInfo=e=>{try{switch(e){case"message":return getNodeInternals(getOwnerInstance(document.getElementById("message"))).return.return.memoizedProps;case"message-actions":return getNodeInternals(getOwnerInstance(document.getElementById("message-actions"))).return.return.memoizedProps;case"user-context":return getNodeInternals(getOwnerInstance(document.getElementById("user-context"))).return.return.return.return.return.return.memoizedProps;default:return}}catch(e){return}},generateElement=(e,o,t,s,n,{Menu:a,React:r})=>{const i=void 0!==e.checked;e.id=e.id||labelToId(e.label);let d=o;"function"==typeof d&&(d=d()),d&&(d=d.map((e=>(e.originalAction||(e.originalAction=e.action),e)))),e.action=function(){return i?(e.checked=!e.checked,c.props.checked=e.checked,getOwnerInstance(document.getElementById(`${t}-${e.id}`)).props.onMouseEnter(),e.originalAction(arguments,n,e.checked)):e.originalAction(arguments,n)};const l=i?a.MenuCheckboxItem:a.MenuItem,c=void 0!==d?r.createElement(l,e,...d.map((e=>generateElement(e,e.sub,t,s,n,{Menu:a,React:r})))):r.createElement(l,e);return c},patch$9=(e,o)=>{const{React:t}=goosemodScope$o.webpackModules.common,s=goosemodScope$o.webpackModules.findByProps("MenuItem"),n=patchTypeToNavId(e);return o.originalAction=o.action,patch$a(s,"default",(a=>{const[{navId:r,children:i}]=a;if(r!==n&&("message"!==n||"message-actions"!==r))return a;if(findInReactTree(i,(e=>e&&e.props&&e.props.id===(o.id||labelToId(o.label)))))return a;const d=Object.assign({},o),l=generateElement(d,d.sub,n,e,Object.assign({},getExtraInfo(r)),{Menu:s,React:t});let c=findInReactTree(i,(e=>e&&e.props&&!0===e.props.goosemod));return c?(Array.isArray(c.props.children)||(c.props.children=[c.props.children]),c.props.children.push(l)):(c=t.createElement(s.MenuGroup,{goosemod:!0},l),i.push([t.createElement(s.MenuSeparator),c])),a}),!0)},uninjectors={},add$1=(e,o)=>{uninjectors[getInjectId(o.id||labelToId(o.label))]=patch$9(e,o)},remove$3=e=>{const o=getInjectId(labelToId(e));return!!uninjectors[o]&&(uninjectors[o](),!0)};var _contextMenu={__proto__:null,setThisScope:setThisScope$p,labelToId:labelToId,getInjectId:getInjectId,patchTypeToNavId:patchTypeToNavId,getExtraInfo:getExtraInfo,patch:patch$9,add:add$1,remove:remove$3};let goosemodScope$n={};const setThisScope$o=e=>{goosemodScope$n=e},patch$8=(e,o,t)=>{const{React:s}=goosemodScope$n.webpackModules.common,n=goosemodScope$n.webpackModules.findByDisplayName("Tooltip"),{icon:a}=goosemodScope$n.webpackModules.findByProps("icon","isHeader"),r=goosemodScope$n.webpackModules.find((e=>e.default&&"MiniPopover"===e.default.displayName));return patch$a(r,"default",((i,d)=>{const l=findInReactTree(d,(e=>e&&e.message));return l?(d.props.children.unshift(s.createElement(n,{position:"top",text:e},(({onMouseLeave:e,onMouseEnter:n})=>s.createElement(r.Button,{onClick:()=>{t(l)},onMouseEnter:n,onMouseLeave:e},"string"!=typeof o?o:s.createElement("img",{src:o,width:"24px",height:"24px",className:a}))))),d):d}))};var _miniPopover={__proto__:null,setThisScope:setThisScope$o,patch:patch$8};let goosemodScope$m={};const setThisScope$n=e=>{goosemodScope$m=e},patch$7=(e,o,t,{inUpload:s=!1,inReadonlyChannels:n=!1}={})=>{const{React:a}=goosemodScope$m.webpackModules.common,r=goosemodScope$m.webpackModules.findByDisplayName("Tooltip"),i=goosemodScope$m.webpackModules.findByProps("Looks","DropdownSizes"),d=goosemodScope$m.webpackModules.findByProps("button"),l=goosemodScope$m.webpackModules.findByProps("buttonWrapper","pulseButton"),c=goosemodScope$m.webpackModules.findByProps("button","textArea"),p=goosemodScope$m.webpackModules.find((e=>e.type&&e.type.render&&"ChannelTextAreaContainer"===e.type.render.displayName));return patch$a(p.type,"render",((p,m)=>{const g=findInReactTree(m,(e=>e&&e.className&&0===e.className.indexOf("buttons-")));return!g||!s&&!0===m.props.children[0].ref.current?.classList?.contains("channelTextAreaUpload-3t7EIx")||!n&&!0===m.props.children[0].ref.current?.classList?.contains("channelTextAreaDisabled-8rmlrp")||g.children.unshift(a.createElement("div",null,a.createElement(r,{position:"top",text:e},(({onMouseLeave:e,onMouseEnter:s})=>a.createElement(i,{look:i.Looks.BLANK,size:i.Sizes.ICON,onClick:()=>{t(g)},onMouseEnter:s,onMouseLeave:e},"string"!=typeof o?o:a.createElement("img",{src:o,width:"24px",height:"24px",className:`${c.button} ${d.contents} ${l.button}`})))))),m}))};var _channelTextAreaButtons={__proto__:null,setThisScope:setThisScope$n,patch:patch$7};let goosemodScope$l={},Commands;const setThisScope$m=e=>{goosemodScope$l=e,Commands=goosemodScope$l.webpackModules.findByProps("BUILT_IN_COMMANDS","BUILT_IN_SECTIONS");const o=goosemodScope$l.webpackModules.findByProps("useApplicationCommandsDiscoveryState");goosemodScope$l.patcher.patch(o,"useApplicationCommandsDiscoveryState",((e,o)=>{if(o.applicationCommandSections.find((e=>e.id===applicationId)))return;const t=o.commands.filter(((e,t)=>e.applicationId===applicationId&&o.commands.indexOf(e)===t)),s=Commands.BUILT_IN_SECTIONS[applicationId];return o.discoveryCommands.push(...t),o.discoverySections.push({data:t,section:s,key:applicationId}),o.applicationCommandSections.push(s),o}))},applicationId="827187782140428288",addSection=e=>Commands.BUILT_IN_SECTIONS[e.id]=e,removeSection=e=>delete Commands.BUILT_IN_COMMANDS[e],hasSection=e=>!!Commands.BUILT_IN_SECTIONS[e],add=(e,o,t,s=[])=>{const n=Commands;hasSection(applicationId)||addSection({id:applicationId,icon:"7f274cc3c1216505238ce047ce6e35e9",name:"GooseMod",type:1}),n.BUILT_IN_COMMANDS.push({applicationId:applicationId,type:0,target:1,description:o,name:e,execute:t,options:s,id:`-${Math.random().toString().split(".")[1].substring(0,5)}`})},remove$2=e=>{const o=Commands;o.BUILT_IN_COMMANDS=o.BUILT_IN_COMMANDS.filter((o=>o.name!==e));0===o.BUILT_IN_COMMANDS.filter((e=>e.applicationId===applicationId)).length&&removeSection(applicationId)};var _commands={__proto__:null,setThisScope:setThisScope$m,add:add,remove:remove$2};let goosemodScope$k={};const setThisScope$l=e=>{goosemodScope$k=e;const{BOT_AVATARS:o}=goosemodScope$k.webpackModules.findByProps("BOT_AVATARS","DEFAULT_AVATARS");o.GooseMod="https://cdn.discordapp.com/avatars/760559484342501406/5125aff2f446ad7c45cf2dfd6abf92ed.webp"},send=(e,o="GooseMod")=>{const{createBotMessage:t}=goosemodScope$k.webpackModules.findByProps("createBotMessage"),{getChannelId:s}=goosemodScope$k.webpackModules.findByProps("getChannelId"),{receiveMessage:n}=goosemodScope$k.webpackModules.findByProps("receiveMessage","sendBotMessage"),a=t(s(),"");"string"==typeof e?a.content=e:a.embeds.push(e),a.state="SENT",a.author.id="1",a.author.bot=!0,a.author.discriminator="0000",a.author.avatar="GooseMod",a.author.username=o,n(s(),a)};let notices$1=[],goosemodScope$j={},updateCall;const setThisScope$k=async e=>{goosemodScope$j=e;const o=goosemodScope$j.webpackModules.findByProps("base","sidebar");for(;void 0===document.getElementsByClassName(o.base)[0];)await sleep(10);const t=getOwnerInstance(document.getElementsByClassName(o.base)[0]),{React:s}=goosemodScope$j.webpackModules.common;class n extends s.PureComponent{constructor(e){super(e),this._updateCall=()=>this.forceUpdate()}componentDidMount(){updateCall=this._updateCall}componentWillUnmount(){}render(){return notices$1.length>0?notices$1.shift().react:null}}patch$a(t.props.children,"type",((e,o)=>(o.props.children[1].props.children.props.children.unshift(s.createElement(n)),o))),t.forceUpdate()},patch$6=(e,o,t,s="brand")=>{const n=goosemodScope$j.webpackModules.findByProps("colorDanger","notice")[`color${s[0].toUpperCase()+s.substring(1).toLowerCase()}`],a=goosemodScope$j.webpackModules.findByProps("NoticeCloseButton","NoticeButton"),{React:r}=goosemodScope$j.webpackModules.common,i=generateId(),d=r.createElement(a.default,{class:"goosemod-notice",id:i,color:n},r.createElement(a.NoticeCloseButton,{onClick:()=>{notices$1=notices$1.filter((e=>e.id!==i)),updateCall()}}),e,r.createElement(a.NoticeButton,{onClick:()=>{t()}},o));notices$1.push({react:d,id:i}),updateCall()};var _notices={__proto__:null,get notices(){return notices$1},setThisScope:setThisScope$k,patch:patch$6};let goosemodScope$i={};const setThisScope$j=e=>{goosemodScope$i=e},patch$5=(e,o,t,{atEnd:s=!1,showWhere:n=["dm","channel"]}={})=>{const{React:a}=goosemodScope$i.webpackModules.common,r=goosemod.webpackModules.findByProps("title","themed","icon","icon","iconBadge"),i=goosemodScope$i.webpackModules.find((e=>e.default&&"HeaderBar"===e.default.displayName));return patch$a(i,"default",((d,l)=>{const c=l.props.children.props.children[1].props.children.props.children;let p="other";if(null===c[1])p="home";else switch(c[0][1].key){case"mute":p="channel";break;case"calls":p="dm"}return n.includes(p)?(c[s?"push":"unshift"](a.createElement(i.Icon,{"aria-label":e,tooltip:e,disabled:!1,showBadge:!1,selected:!1,icon:()=>"string"!=typeof o?o:a.createElement("img",{src:o,width:"24px",height:"24px",className:`${r}.icon`}),onClick:()=>{t()}})),l):l}))};var _headerBarButtons={__proto__:null,setThisScope:setThisScope$j,patch:patch$5};let goosemodScope$h={};const setThisScope$i=e=>{goosemodScope$h=e},patch$4=(e,o,t,s=(()=>{}),{round:n=!1}={})=>{const{React:a}=goosemodScope$h.webpackModules.common,r=goosemodScope$h.webpackModules.findByDisplayName("Tooltip"),i=goosemodScope$h.webpackModules.findByDisplayName("Clickable"),d=goosemodScope$h.webpackModules.findByProps("profileBadge24","profileBadge22"),l=goosemodScope$h.webpackModules.find((e=>e.default&&"UserProfileBadgeList"===e.default.displayName));return patch$a(l,"default",(([{user:l,size:c}],p)=>{if(!t().includes(l.id))return p;let m=d.profileBadge24;switch(c){case 1:m=d.profileBadge22;break;case 2:m=d.profileBadge18}return p.props.children.unshift(a.createElement(r,{position:"top",text:e},(({onMouseLeave:e,onMouseEnter:t})=>a.createElement(i,{onClick:()=>{s()},onMouseEnter:t,onMouseLeave:e},a.createElement("div",{style:{backgroundImage:`url("${o}")`,borderRadius:n?"50%":""},className:`${d.profileBadge} ${m}`}))))),p}))};var _userBadges={__proto__:null,setThisScope:setThisScope$i,patch:patch$4};let goosemodScope$g={};const setThisScope$h=e=>{goosemodScope$g=e},patch$3=e=>{const o=goosemodScope$g.webpackModules.find((e=>e.default&&!e.default.displayName&&e.default.toString().indexOf("headerText")>-1));return patch$a(o,"default",((o,t)=>{const s=goosemod.reactUtils.findInReactTree(t,(e=>Array.isArray(e?.props?.children)&&e.props.children.find((e=>e?.props?.message))));return s.props.children.push(e(s.props.children[0].props)),t}))};var _username={__proto__:null,setThisScope:setThisScope$h,patch:patch$3};let goosemodScope$f={};const setThisScope$g=e=>{goosemodScope$f=e},patch$2=(e,o,t,s=(()=>{}),{round:n=!1}={})=>{const{React:a}=goosemodScope$f.webpackModules.common,r=goosemodScope$f.webpackModules.findByDisplayName("Tooltip"),i=goosemodScope$f.webpackModules.findByDisplayName("Clickable"),d=goosemodScope$f.webpackModules.findByProps("guildIconContainer"),l=goosemodScope$f.webpackModules.findByDisplayName("GuildHeader");return patch$a(l.prototype,"renderHeader",(function(l,c){return t().includes(this.props.guild?.id)?(c.props.children.unshift(a.createElement(r,{position:"top",text:e},(({onMouseLeave:e,onMouseEnter:t})=>a.createElement(i,{onClick:()=>{s()},onMouseEnter:t,onMouseLeave:e},a.createElement("div",{style:{backgroundImage:`url("${o}")`,borderRadius:n?"50%":"",width:"16px",height:"16px",backgroundRepeat:"no-repeat",backgroundSize:"contain",backgroundPosition:"50%",objectFit:"cover"},className:`${d.guildIconContainer}`}))))),c):c}))};var _guildBadges={__proto__:null,setThisScope:setThisScope$g,patch:patch$2};const contextMenu=_contextMenu,miniPopover=_miniPopover,channelTextAreaButtons=_channelTextAreaButtons,commands=_commands,internalMessage=send,notices=_notices,headerBarButtons=_headerBarButtons,userBadges=_userBadges,username=_username,guildBadges=_guildBadges,setThisScope$f=e=>{setThisScope$p(e),setThisScope$o(e),setThisScope$n(e),setThisScope$m(e),setThisScope$l(e),setThisScope$k(e),setThisScope$j(e),setThisScope$i(e),setThisScope$h(e),setThisScope$g(e)};var Patcher={__proto__:null,contextMenu:contextMenu,miniPopover:miniPopover,channelTextAreaButtons:channelTextAreaButtons,commands:commands,internalMessage:internalMessage,notices:notices,headerBarButtons:headerBarButtons,userBadges:userBadges,username:username,guildBadges:guildBadges,setThisScope:setThisScope$f,patch:patch$a,inject:inject,uninject:uninject};let goosemodScope$e={};const setThisScope$e=e=>{goosemodScope$e=e},patch$1=()=>{const{React:e}=goosemodScope$e.webpackModules.common,o=goosemodScope$e.webpackModules.findByProps("Sizes","AnimatedAvatar");goosemodScope$e.patcher.patch(o,"default",(([{src:e}],o)=>{if(e.includes("/avatars"))return o.props["data-user-id"]=e.match(/\/avatars\/([0-9]+)\//)[1],o})),goosemodScope$e.patcher.patch(o.AnimatedAvatar,"type",((t,s)=>e.createElement(o.default,{...s.props})))};var _avatar={__proto__:null,setThisScope:setThisScope$e,patch:patch$1};const avatar=_avatar,setThisScope$d=e=>{setThisScope$e(e)},patch=()=>{patch$1()};var Attrs={__proto__:null,avatar:avatar,setThisScope:setThisScope$d,patch:patch};const toastCSS=".gm-toasts {\n position: fixed;\n display: flex;\n top: 0;\n flex-direction: column;\n align-items: center;\n justify-content: flex-end;\n pointer-events: none;\n z-index: 4000;\n\n bottom: 80px;\n right: 40px;\n}\n\n@keyframes gm-toast-up {\n from {\n transform: translateY(0);\n opacity: 0;\n }\n}\n\n.gm-toast {\n animation: gm-toast-up 300ms ease;\n background: rgba(79,84,92,0.5);\n backdrop-filter: blur(2px);\n padding: 22px;\n border-radius: 6px;\n box-shadow: var(--elevation-high);\n font-weight: 500;\n color: #fff;\n user-select: text;\n font-size: 20px;\n opacity: 1;\n margin-top: 40px;\n pointer-events: none;\n user-select: none;\n\n width: 280px;\n text-align: left;\n\n overflow-wrap: break-word;\n}\n\n.gm-toast > :first-child {\n margin-bottom: 12px;\n}\n\n.gm-toast > :last-child {\n color: var(--header-secondary);\n font-size: 18px;\n}\n\n@keyframes gm-toast-down {\n to {\n transform: translateY(0px);\n opacity: 0;\n }\n}\n\n.gm-toast.closing {\n animation: gm-toast-down 200ms ease;\n animation-fill-mode: forwards;\n opacity: 1;\n transform: translateY(-10px);\n}\n\n\n.gm-toast.toast-info {\n background-color: hsla(197,calc(var(--saturation-factor, 1)*100%),47.8%, 0.5);\n}\n\n.gm-toast.toast-success {\n background-color: hsla(139,calc(var(--saturation-factor, 1)*66.8%),58.6%, 0.5);\n}\n\n.gm-toast.toast-danger,\n.gm-toast.toast-error {\n background-color: hsla(359,calc(var(--saturation-factor, 1)*82.6%),59.4%, 0.5);\n}\n\n.gm-toast.toast-warning,\n.gm-toast.toast-warn {\n background-color: hsla(38,calc(var(--saturation-factor, 1)*95.7%),54.1%, 0.5);\n}",styleSheet=document.createElement("style");styleSheet.textContent=toastCSS,document.head.appendChild(styleSheet);var showToast=(e,o={})=>{if(o?.type?.startsWith("debug")){if(!goosemod.settings.gmSettings.get().debugToasts)return;o.type=o.type.replace("debug","")}if(!document.querySelector(".gm-toasts")){const e=document.createElement("div");e.classList.add("gm-toasts"),document.querySelector("#app-mount").appendChild(e)}let{subtext:t="",type:s="",timeout:n=3e3}=o;n*=1.5;const a=document.createElement("div");a.classList.add("gm-toast"),s&&a.classList.add("toast-"+s);const r=document.createElement("div");r.textContent=e,a.appendChild(r);const i=document.createElement("div");i.textContent=t,a.appendChild(i),document.querySelector(".gm-toasts").appendChild(a);const d=()=>{a.classList.add("closing"),setTimeout((()=>{a.remove(),document.querySelectorAll(".gm-toasts .gm-toast").length||document.querySelector(".gm-toasts").remove()}),300)};return setTimeout(d,n),{toastElem:a,closeFn:d}};let goosemodScope$d={};const setThisScope$c=e=>{goosemodScope$d=e},show$1=(e,o,t,s,n)=>new Promise((a=>{const{React:r}=goosemodScope$d.webpackModules.common,{findByDisplayName:i,findByProps:d}=goosemodScope$d.webpackModules,l=i("Text"),c=i("Markdown"),p=d("button","colorRed");(0,d("openModal").openModal)((m=>(3===m.transitionState&&a(!1),r.createElement(i("ConfirmModal"),{header:o,confirmText:e,cancelText:s||d("Messages").Messages.CANCEL,confirmButtonColor:p[`color${n?n[0].toUpperCase()+n.substring(1).toLowerCase():"Red"}`],onClose:()=>{a(!1)},onCancel:()=>{a(!1),m.onClose()},onConfirm:()=>{a(!0),m.onClose()},transitionState:m.transitionState},...t.split("\n").map((e=>r.createElement(c,{size:l.Sizes.SIZE_16},e)))))))}));let goosemodScope$c={},showHideMod={},originalChangelog={};const setThisScope$b=e=>{goosemodScope$c=e,showHideMod=goosemodScope$c.webpackModules.findByProps("showChangeLog");const o=goosemodScope$c.webpackModules.findByProps("changeLog").changeLog;originalChangelog=Object.assign({},o)},showChangelog=()=>{showHideMod.showChangeLog()},hideChangelog=()=>{showHideMod.hideChangeLog()},resetChangelog=()=>{setChangelog(originalChangelog)},setChangelog=e=>{const o=goosemodScope$c.webpackModules.findByProps("changeLog"),t={template:"standard",revision:1,locale:"en-us",...e};for(const e of Object.keys(o.changeLog))delete o.changeLog[e];for(const e of Object.keys(t))o.changeLog[e]=t[e]};var Changelog={__proto__:null,setThisScope:setThisScope$b,showChangelog:showChangelog,hideChangelog:hideChangelog,resetChangelog:resetChangelog,setChangelog:setChangelog};const image="https://media.discordapp.net/attachments/756146058924392542/771374562184658944/2018-11-14-11-36-30-1200x800.png";let version,generated,goosemodScope$b={};const setThisScope$a=e=>{goosemodScope$b=e},show=async()=>{generated||generate(),goosemodScope$b.changelog.resetChangelog(),goosemodScope$b.changelog.setChangelog(generated),goosemodScope$b.changelog.showChangelog(),await sleep(300);const e=()=>{document.querySelector(".modal-1TF_VN .size20-17Iy80").textContent=`GooseMod ${version}`,document.querySelector(".modal-1TF_VN .footer-2gL1pp").remove()};e(),goosemodScope$b.changelog.resetChangelog(),setTimeout(e,300)},generate=()=>{const e=JSON.parse("{\"version\":\"v11.1\",\"date\":\"2021-08-10\",\"body\":\"Store {added marginTop}\\n======================\\n\\n* **Repos modal now has a new header.** Now reports statistics of repos (theme, plugin, and developer count) and matches Discord's new styling.\\n* **Removed toast appearing on module updates.**\\n\\nSettings {added}\\n======================\\n\\n* **Removed GM Storage Impl from settings sidebar.** Also added it to \\\"Copy Debug Info\\\" setting output.\\n\\nTweaks and Fixes {progress}\\n======================\\n\\n* **Fixed Tour crashing.**\\n* **Fixed some plugins failing to save settings.**\\n* **Changed how settings implementation is chosen to use extension variable.**\\n* **Fixed being unable to open Store in Home if no DMs are in sidebar.**\\n* **Fixed Snippets mistakenly appearing if Store in Home is disabled.**\\n* **Fixed Store in settings hiding all plugins and themes.**\\n* **Fixed Store categories sorting being interferred with by sort by dropdown.**\"}");version=e.version,generated={image:image,date:e.date,body:e.body}};var GoosemodChangelog={__proto__:null,setThisScope:setThisScope$a,show:show,generate:generate};let goosemodScope$a={};const setThisScope$9=e=>{goosemodScope$a=e};let themes$1=["Dracula Theme","Darkest Theme","Solarized Dark Theme"],packs=[{text:"Minimal",subtext:"A basic installation with no visual changes; only analytics blocking and fixes",modules:["Hardcoded Color Fixer","Fucklytics"]},{text:"Recommended",subtext:"The recommended starting experience: a few visual improvements and customisation options",modules:["Visual Tweaks","Username In Author","Custom Sounds","Better Message Deletion","Nickname Panel"],base:"Minimal"},{text:"Complete",subtext:"A large amount of the avaliable modules which overhauls the UI and adds extra features",modules:["WYSIWYG Messages","Twitch Emotes","RadialStatus","Simple Status Icons","User Popout Creation Date","Clear Recent Games","Game Activity Button","Macros","Role Colored Messages"],base:"Recommended"}];packs=packs.map((e=>{if(e.base){let o=packs.find((o=>o.text===e.base));e.modules=o.modules.concat(...e.modules)}return e}));const selectionModal=(e,o)=>new Promise((t=>{goosemodScope$a.webpackModules.findByPropsAll("show")[0].show({title:e,body:"Body"});let s=[...document.getElementsByClassName("form-26zE04")].pop();s.lastChild.remove();let n=s.firstChild.firstChild;n.firstChild.style.flex="unset",n.lastChild.remove();let a=s.parentElement;a.style.maxHeight="none";let r=document.createElement("div");r.style.display="flex",r.style.flexDirection="column",r.style.justifyContent="center",r.style.flexGrow="1";for(let e of o){let o=document.createElement("div");o.style.margin="20px",o.style.display="flex",o.style.flexDirection="column";let s=document.createElement("button");s.classList.add("primaryButton-2BsGPp","button-38aScr","lookFilled-1Gx00P","colorBrand-3pXr91","sizeXlarge-2yFAlZ","grow-q77ONN"),s.onclick=()=>{t(e)},e.onmouseenter&&(s.onmouseenter=()=>{e.onmouseenter(a)}),e.onmouseleave&&(s.onmouseleave=()=>{e.onmouseleave(a)});let n=document.createElement("div");n.classList.add("contents-18-Yxp");let i=e.text;n.textContent=i,s.appendChild(n),s.style.flex="unset",o.appendChild(s);let d=document.createElement("div");d.classList.add("minorContainer-Oi4S_y"),d.style.cursor="default";let l=document.createElement("div");l.classList.add("colorStandard-2KCXvj","size12-3cLvbJ"),l.style.textAlign="center",l.style.opacity=".6",l.textContent=e.subtext,d.appendChild(l),o.appendChild(d),r.appendChild(o)}n.appendChild(r)})),installModules=async e=>{for(let o of e)goosemodScope$a.updateLoadingScreen(`${goosemodScope$a.moduleStoreAPI.modules.find((e=>e.name===o)).name} - ${e.indexOf(o)+1}/${e.length}`),await goosemodScope$a.moduleStoreAPI.importModule(o)},ask=()=>new Promise((async e=>{goosemodScope$a.stopLoadingScreen();let o=(await selectionModal("Please pick a pack",packs)).modules;goosemodScope$a.startLoadingScreen(),await installModules(o);let t=themes$1.map((e=>{let o=goosemodScope$a.moduleStoreAPI.modules.find((o=>o.name===e));return{text:o.name.replace(" Theme",""),subtext:o.description,actual:e,onmouseenter:async function(e){e.style.transition="opacity 1s",e.style.opacity="0.2";let t=document.getElementsByClassName("backdrop-1wrmKB")[0];t.style.transition="opacity 1s",t.style.opacity="0",await goosemodScope$a.moduleStoreAPI.importModule(o.name)},onmouseleave:function(e){e.style.opacity="1",document.getElementsByClassName("backdrop-1wrmKB")[0].style.opacity="0.85",goosemodScope$a.modules[o.name]&&goosemodScope$a.settings.removeModuleUI(o.name)}}}));t.unshift({text:"None",subtext:"No additonal theming, stick with default Discord",actual:""}),goosemodScope$a.stopLoadingScreen();const s=(await selectionModal("Please pick a theme",t)).actual;let n=document.getElementsByClassName("gm-setup-theme");for(let e of n)e.remove();return goosemodScope$a.startLoadingScreen(),s&&await installModules([s]),e(o)}));var PackModal={__proto__:null,setThisScope:setThisScope$9,ask:ask};let enabled=!1,todo=["themes","plugins"];const done=e=>{todo.splice(todo.indexOf(e),1)},themes=async()=>{const e=(await Promise.resolve().then((function(){return modulesPreview$1}))).default(),{React:o}=goosemod.webpackModules.common,t=goosemod.webpackModules.findByDisplayName("Header"),s=goosemod.webpackModules.findByDisplayName("Text"),n=goosemod.moduleStoreAPI.modules.filter((e=>e.tags.includes("theme")&&e.images&&e.images[0])).sort(((e,o)=>o.github.stars-e.github.stars)),a=Math.floor(Math.random()*(n.length-5));goosemod.webpackModules.findByProps("show").show({className:"gm-ootb-modal",title:"Themes",confirmText:"Browse Themes",onConfirm:async()=>{0===goosemod.ootb.todo.length&&(await sleep(2e3),goosemod.ootb.settings())},body:o.createElement("div",{className:"container-1rn8Cv"},o.createElement(e,{modules:n.slice(a,a+3)}),o.createElement(t,{className:"header-2MiVco",size:t.Sizes.SIZE_24},"Beautify your Discord with Themes"),o.createElement(s,{className:"byline-3REiHf",size:s.Sizes.SIZE_16,color:s.Colors.HEADER_SECONDARY},"Pick from over 100 themes to tweak and enhance your user interface"))})},plugins=async()=>{const e=(await Promise.resolve().then((function(){return modulesPreview$1}))).default(),{React:o}=goosemod.webpackModules.common,t=goosemod.webpackModules.findByDisplayName("Header"),s=goosemod.webpackModules.findByDisplayName("Text"),n=goosemod.moduleStoreAPI.modules.filter((e=>!e.tags.includes("theme")&&e.images&&e.images[0])).sort(((e,o)=>o.github.stars-e.github.stars)),a=Math.floor(Math.random()*(n.length-5));goosemod.webpackModules.findByProps("show").show({className:"gm-ootb-modal",title:"Plugins",confirmText:"Browse Plugins",onConfirm:async()=>{0===goosemod.ootb.todo.length&&(await sleep(2e3),goosemod.ootb.settings())},body:o.createElement("div",{className:"container-1rn8Cv"},o.createElement(e,{modules:n.slice(a,a+3)}),o.createElement(t,{className:"header-2MiVco",size:t.Sizes.SIZE_24},"Amplify your Discord under the hood"),o.createElement(s,{className:"byline-3REiHf",size:s.Sizes.SIZE_16,color:s.Colors.HEADER_SECONDARY},"Plugins augment your experience with improvements in the app itself"))})},store=async()=>{const e=(await Promise.resolve().then((function(){return modulesPreview$1}))).default(),{React:o}=goosemod.webpackModules.common,t=goosemod.webpackModules.findByProps("transitionTo"),s=goosemod.webpackModules.findByDisplayName("Header"),n=goosemod.webpackModules.findByDisplayName("Text"),a=goosemod.moduleStoreAPI.modules.filter((e=>e.images&&e.images[0])).sort(((e,o)=>o.github.stars-e.github.stars)),r=Math.floor(Math.random()*(a.length-5));goosemod.webpackModules.findByProps("show").show({className:"gm-ootb-modal",title:"Store",confirmText:"View Store in Home",onConfirm:async()=>{t.transitionTo("/channels/@me"),await sleep(100),document.body.classList.add("gm-highlight"),await sleep(3e3),document.body.classList.remove("gm-highlight")},body:o.createElement("div",{className:"container-1rn8Cv"},o.createElement(e,{modules:a.slice(r,r+3)}),o.createElement(s,{className:"header-2MiVco",size:s.Sizes.SIZE_24},"Browse Themes and Plugins in the Store"),o.createElement(n,{className:"byline-3REiHf",size:n.Sizes.SIZE_16,color:n.Colors.HEADER_SECONDARY},"GooseMod uses it's own Store, where you can easily look around and install"))})},settings=async()=>{const e=(await Promise.resolve().then((function(){return modulesPreview$1}))).default(),{React:o}=goosemod.webpackModules.common,t=goosemod.webpackModules.findByDisplayName("Header"),s=goosemod.webpackModules.findByDisplayName("Text");goosemod.webpackModules.findByProps("show").show({className:"gm-ootb-modal",title:"Settings",confirmText:"View GooseMod Settings",onConfirm:async()=>{goosemod.settings.openSettings(),await sleep(20),document.querySelector(`[aria-controls="gm-${goosemod.i18n.discordStrings.SETTINGS}-tab"]`).click();const e=document.querySelector(".sidebarRegionScroller-3MXcoP");for(e.scrollTop=e.offsetHeight-270;document.querySelector(".closeButton-1tv5uR");)await sleep(100);goosemod.ootb.community()},body:o.createElement("div",{className:"container-1rn8Cv"},o.createElement(e,{modules:[{name:"Experimental Features",description:"Try out new experimental features"},{name:"Utilities",description:"Make backups, reset GooseMod, and more"},{name:"Tweaks",description:"Tweak GooseMod to how you want it"}]}),o.createElement(t,{className:"header-2MiVco",size:t.Sizes.SIZE_24},"Use GooseMod's Settings to customise it's features"),o.createElement(s,{className:"byline-3REiHf",size:s.Sizes.SIZE_16,color:s.Colors.HEADER_SECONDARY},"There are various options for you to change"))})},community=async()=>{const e=(await Promise.resolve().then((function(){return modulesPreview$1}))).default(),{React:o}=goosemod.webpackModules.common,t=goosemod.webpackModules.findByDisplayName("Header"),s=goosemod.webpackModules.findByDisplayName("Text");goosemod.webpackModules.findByProps("show").show({className:"gm-ootb-modal",title:"Community",confirmText:"Join GooseMod Discord",onConfirm:()=>{window.open("https://goosemod.com/discord")},body:o.createElement("div",{className:"container-1rn8Cv"},o.createElement(e,{modules:[{name:"Ask Questions",description:"Ask any questions and get support"},{name:"News",description:"Get the latest news and announcements around GooseMod and related projects"},{name:"Get Involved",description:"Help out with suggestions, supporting others, and more"}]}),o.createElement(t,{className:"header-2MiVco",size:t.Sizes.SIZE_24},"Join GooseMod's Community"),o.createElement(s,{className:"byline-3REiHf",size:s.Sizes.SIZE_16,color:s.Colors.HEADER_SECONDARY},"Join our Discord for further information and more"))})},start=async()=>{const e=(await Promise.resolve().then((function(){return modulesPreview$1}))).default(),{React:o}=goosemod.webpackModules.common,t=goosemod.webpackModules.findByDisplayName("Header"),s=goosemod.webpackModules.findByDisplayName("Text");goosemod.webpackModules.findByProps("show").show({className:"gm-ootb-modal",title:"GooseMod",confirmText:"Learn More",cancelText:"Not Interested",onConfirm:()=>{goosemod.ootb.enabled=!0,goosemod.ootb.store()},body:o.createElement("div",{className:"container-1rn8Cv"},o.createElement(e,{modules:[{name:"Store",description:"Learn about GooseMod's Store and what's in it"},{name:"Settings",description:"Find out about the settings for GooseMod and plugins"},{name:"Community",description:"Join our Discord to ask questions, give feedback, keep up to date with news, and more"}]}),o.createElement(t,{className:"header-2MiVco",size:t.Sizes.SIZE_24},"Learn about GooseMod"),o.createElement(s,{className:"byline-3REiHf",size:s.Sizes.SIZE_16,color:s.Colors.HEADER_SECONDARY},"Go through a short tour through GooseMod's core functions"))})};var OOTB={__proto__:null,enabled:enabled,todo:todo,done:done,themes:themes,plugins:plugins,store:store,settings:settings,community:community,start:start};let loadingEl,descEl,goosemodScope$9={};const setThisScope$8=e=>{goosemodScope$9=e},startLoadingScreen=()=>{loadingEl=document.createElement("div"),loadingEl.style.position="absolute",loadingEl.style.transform="translateX(-25%)",loadingEl.style.left="50%",loadingEl.style.top="60px",loadingEl.style.zIndex="9999",loadingEl.style.backgroundColor="var(--background-floating)",loadingEl.style.opacity="0.9",loadingEl.style.borderRadius="8px",loadingEl.style.padding="16px",loadingEl.style.boxShadow="var(--elevation-high)",loadingEl.style.display="flex",loadingEl.style.flexDirection="column",loadingEl.style.alignItems="center";const e=document.createElement("h1");e.classList.add("name-1jkAdW","header-2V-4Sw"),e.style.marginBottom="5px",e.style.display="block",e.style.boxShadow="none",e.style.webkitBoxShadow="none",e.textContent="Loading GooseMod";const o=document.createElement("div");o.classList.add("colorStandard-2KCXvj","size14-e6ZScH","description-3_Ncsb","formText-3fs7AJ","modeDefault-3a2Ph1"),o.textContent=`v${goosemodScope$9.versioning.version} (${goosemodScope$9.versioning.hash.substring(0,7)})`,o.style.marginBottom="20px",descEl=document.createElement("div"),descEl.classList.add("colorStandard-2KCXvj","size14-e6ZScH","description-3_Ncsb","formText-3fs7AJ","modeDefault-3a2Ph1"),descEl.style.textAlign="center",descEl.style.whiteSpace="pre-line",descEl.textContent="Starting up...",loadingEl.appendChild(e),loadingEl.appendChild(o),loadingEl.appendChild(descEl),document.body.appendChild(loadingEl)},updateLoadingScreen=e=>{descEl.textContent=e},stopLoadingScreen=()=>{loadingEl.remove()};let cache$1;const defaultSettings={changelog:!0,separators:!0,gmBadges:!0,attrs:!1,home:!0,devchannel:!1,snippets:!1,autoupdate:!0,allThemeSettings:!1,debugToasts:!1},get$2=()=>cache$1||(cache$1=JSON.parse(goosemod.storage.get("goosemodGMSettings"))||defaultSettings,cache$1={...defaultSettings,...cache$1},cache$1),set$2=(e,o)=>{const t=get$2();t[e]=o,goosemod.storage.set("goosemodGMSettings",JSON.stringify(t)),cache$1=t};var GMSettings={__proto__:null,get:get$2,set:set$2},addToHome=async e=>{const{React:o,ReactDOM:t}=e.webpackModules.common,s=e.webpackModules.find((e=>e.default&&"ConnectedPrivateChannelsList"===e.default.displayName)),n=e.webpackModules.findByDisplayName("ListSectionItem"),{LinkButton:a}=e.webpackModules.findByProps("LinkButton"),r=e.webpackModules.findByProps("selected","wrappedName"),i=e.webpackModules.findByProps("channel","linkButtonIcon"),d=e.webpackModules.findByProps("headerText","privateChannelsHeaderContainer"),l=e.webpackModules.findByProps("icon","iconBadge","title"),c=e.webpackModules.findByProps("scrollerBase","auto"),p={themes:o.createElement(e.webpackModules.findByDisplayName("Eye"),{width:24,height:24}),plugins:o.createElement(e.webpackModules.findByDisplayName("InlineCode"),{width:24,height:24}),snippets:o.createElement(e.webpackModules.findByDisplayName("Pictures"),{width:24,height:24}),expandable:o.createElement(goosemod.webpackModules.findByDisplayName("DropdownArrow"),{className:`${l.icon}`,width:24,height:24})},m=(await Promise.resolve().then((function(){return header$3}))).default(),g=e.webpackModules.findByDisplayName("LoadingPopout"),u=(e,t)=>o.createElement(m,{icon:e,title:t}),h=(e,t)=>o.createElement("div",{className:e?"":`${c.auto}`,id:"gm-settings-inject",style:{padding:"22px",backgroundColor:"var(--background-primary)",height:"100%",overflow:e?"":"hidden scroll"}},t),S=e.webpackModules.findByProps("transitionTo"),f=(e,o,t=0)=>{if(t>5)return!1;const s=e.parentElement;return s.classList.contains(o)&&s||f(s,o,t+1)};let y=goosemod.storage.get("goosemodHomeExpanded")||!0,b={plugins:e.settings.items.find((o=>o[1]===e.i18n.goosemodStrings.settings.itemNames.plugins)),themes:e.settings.items.find((o=>o[1]===e.i18n.goosemodStrings.settings.itemNames.themes)),snippets:e.settings.items.find((e=>"Snippets"===e[1]))},w={plugins:e.settings._createItem(b.plugins[1],b.plugins[2],!1),themes:e.settings._createItem(b.themes[1],b.themes[2],!1),snippets:e.settings._createItem(b.snippets[1],b.snippets[2],!1)};const x=s=>{const n=[...document.querySelector(".content-98HsJk").children].find(((e,o)=>0!==o&&!e.classList.contains("erd_scroll_detection_container")));for(const e of document.querySelector(".scroller-1JbKMe").children[0].children)e.className?.replace&&(e.className=e.className.replace(r.selected,r.clickable));setTimeout((()=>{const e=document.getElementById(`gm-home-${s}`);e.className=e.className.replace(r.clickable,r.selected)}),0);const a="snippets"!==s&&Array.isArray(w[s].props.children)?w[s].props.children.filter((e=>"card"===e.props.type)).length:0,i="snippets"!==s?e.moduleStoreAPI.modules.filter((e=>"plugins"===s?!e.tags.includes("theme"):e.tags.includes("theme"))).length:0;var d,l,c;if((a!==i||e.settings[`regen${s}`])&&(delete e.settings[`regen${s}`],w[s]=o.createElement("div",{className:"gm-store-loading-container"},o.createElement(g)),(async()=>{"snippets"!==s&&b[s][2].filter((e=>"card"===e.type)).length!==i&&await e.moduleStoreAPI.updateStoreSetting(),w[s]=e.settings._createItem(b[s][1],b[s][2],!1),document.querySelector(`#gm-home-${s}`).click()})()),1===n.children.length&&t.render((d=p[s],l=s,c=w[s],o.createElement("div",{style:{height:"100%",overflow:"hidden"}},u(d,l),h(!1,c))),n.children[0]),2===n.children.length||3===n.children.length){let e=n.children.length-2;const o=n.children[e+1].classList.contains("stickyScroller-24zUyY");o&&(e=0),n.children[e+0].className="",t.render(u(p[s],s),n.children[e+0]),0!==e&&n.children[e+1].children[1]&&(n.children[e+1].children[1].style.display="none"),o&&(e=1),t.render(h(o,w[s]),0!==e?n.children[e+1].children[0]:n.children[e+1])}e.ootb.enabled&&e.ootb.todo.includes(s)&&(e.ootb[s](),e.ootb.done(s))},v=e.settings.gmSettings.get().snippets;e.settingsUninjects.push(e.patcher.patch(s,"default",((t,s)=>{s.props.children.slice(3).find((e=>e?.toString()?.includes("GooseMod")))||(setTimeout((()=>{document.querySelector(".scroller-1JbKMe").addEventListener("click",(e=>{const o=f(e.target,i.channel);o&&!o.id.startsWith("gm-home-")&&(document.querySelectorAll('[id^="gm-home-"]').forEach((e=>e.className=e.className.replace(r.selected,r.clickable))),setTimeout((()=>{null!==document.getElementById("gm-settings-inject")&&(S.transitionTo("/invalid"),S.back())}),1))}))}),10),s.props.children.push((()=>o.createElement(n,{className:d.privateChannelsHeaderContainer},o.createElement("span",{className:d.headerText},"GooseMod"),o.createElement("div",{className:`${d.privateChannelRecipientsInviteButtonIcon} ${l.iconWrapper} ${l.clickable}`,style:{transform:`rotate(${y?"0":"-90"}deg)`,width:"22px",left:y?"0px":"-2px",top:y?"-6px":"-2px"},onClick:()=>{y=!y,goosemod.storage.set("goosemodHomeExpanded",y),document.querySelector(".scroller-1JbKMe").dispatchEvent(new Event("focusin")),document.querySelector(".scroller-1JbKMe").dispatchEvent(new Event("focusout"))}},p.expandable))),(()=>o.createElement(a,{style:{display:y||document.querySelector(".title-29uC1r")?.textContent===e.i18n.goosemodStrings.settings.itemNames.themes?"block":"none"},icon:()=>p.themes,onClick:()=>x("themes"),id:"gm-home-themes",text:e.i18n.goosemodStrings.settings.itemNames.themes,selected:!1})),(()=>o.createElement(a,{style:{display:y||document.querySelector(".title-29uC1r")?.textContent===e.i18n.goosemodStrings.settings.itemNames.plugins?"block":"none"},icon:()=>p.plugins,onClick:()=>x("plugins"),id:"gm-home-plugins",text:e.i18n.goosemodStrings.settings.itemNames.plugins,selected:!1})),v?()=>o.createElement(a,{style:{display:y||"Snippets"===document.querySelector(".title-29uC1r")?.textContent?"block":"none"},icon:()=>p.snippets,onClick:()=>x("snippets"),id:"gm-home-snippets",text:"Snippets",selected:!1}):null))}))),document.querySelector(".privateChannels-1nO12o")&&(S.transitionTo("/invalid"),S.back()),(async()=>{await e.moduleStoreAPI.updateStoreSetting();const o=JSON.parse(goosemod.storage.get("goosemodSnippets"))||{};for(const e in o){const t=o[e];o[e]=document.createElement("style"),o[e].appendChild(document.createTextNode(t)),document.body.appendChild(o[e])}const t=async(t,s)=>{const{fetchMessages:n}=e.webpackModules.findByProps("fetchMessages"),{getRawMessages:a}=e.webpackModules.findByProps("getMessages"),{getChannel:r,hasChannel:i}=e.webpackModules.findByProps("getChannel");if(!i(t))return;await n({channelId:t});const d=r(t),l=Object.values(a(t)).filter((e=>e.content.includes("```css")&&!e.message_reference&&!e.content.includes("quick CSS")&&!e.content.includes("Theme Toggler"))).sort(((e,o)=>o.attachments.length+o.embeds.length-(e.attachments.length+e.embeds.length))),c=e.settings.items.find((e=>"Snippets"===e[1]));c[2].push({type:"store-header",text:s},...l.map((t=>({type:"card",tags:[t.id],lastUpdated:0,discordMessage:{guild:d.guild_id,channel:d.id,message:t.id},images:t.attachments[0]?[t.attachments[0].proxy_url]:t.embeds[0]?[t.embeds[0].thumbnail.proxy_url]:[],name:"",author:`<img style="display: inline; border-radius: 50%; margin-right: 5px; vertical-align: bottom;" src="https://cdn.discordapp.com/avatars/${t.author.id}/${t.author.avatar}.png?size=32"><span class="author" style="line-height: 32px;">${t.author.username}</span>`,subtext:t.content.replace(/```css(.*)```/gs,""),buttonText:o[t.id]?e.i18n.discordStrings.REMOVE:e.i18n.discordStrings.ADD,buttonType:o[t.id]?"danger":"brand",onclick:()=>{const s=c[2].find((e=>e.tags?.includes(t.id))),n=document.querySelector(`[class*="${t.id}"]`).querySelector("button");e.settings.regensnippets=!0,o[t.id]?(o[t.id].remove(),delete o[t.id],n.className=n.className.replace("lookOutlined-3sRXeN colorRed-1TFJan","lookFilled-1Gx00P colorBrand-3pXr91"),n.textContent=e.i18n.discordStrings.ADD,s.buttonText=e.i18n.discordStrings.ADD,s.buttonType="brand"):(o[t.id]=document.createElement("style"),o[t.id].appendChild(document.createTextNode(/```css(.*)```/s.exec(t.content)[1])),document.body.appendChild(o[t.id]),n.className=n.className.replace("lookFilled-1Gx00P colorBrand-3pXr91","lookOutlined-3sRXeN colorRed-1TFJan"),n.textContent=e.i18n.discordStrings.REMOVE,s.buttonText=e.i18n.discordStrings.REMOVE,s.buttonType="danger");const a=Object.assign({},o);for(const e in a)a[e]=a[e].textContent;goosemod.storage.set("goosemodSnippets",JSON.stringify(a))},showToggle:!1,isToggled:()=>!1}))))};await t("755005803303403570","Powercord CSS Snippets"),await t("836694789898109009","BetterDiscord CSS Snippets"),await t("449569809613717518","Black Box CSS Snippets");for(const o of["themes","plugins","snippets"])w[o]=e.settings._createItem(b[o][1],b[o][2],!1)})()},addToContextMenu=(e,o)=>{const t=o=>({label:o,action:async()=>{e.settings.openSettings(),await sleep(10),[...document.getElementsByClassName("side-8zPYf6")[0].children].find((e=>e.textContent===o)).click()}});e.settingsUninjects.push(e.patcher.contextMenu.patch("user-settings-cog",{label:"GooseMod",sub:[t(e.i18n.discordStrings.SETTINGS),o?void 0:t(e.i18n.goosemodStrings.settings.itemNames.plugins),o?void 0:t(e.i18n.goosemodStrings.settings.itemNames.themes),t(e.i18n.discordStrings.CHANGE_LOG)].filter((e=>e))})),e.settingsUninjects.push(e.patcher.contextMenu.patch("user-settings-cog",{label:e.i18n.goosemodStrings.settings.itemNames.goosemodModules,sub:()=>e.settings.items.slice(e.settings.items.indexOf(e.settings.items.find((o=>o[1]===e.i18n.goosemodStrings.settings.itemNames.goosemodModules)))+1).map((e=>t(e[1])))}))},addToSettingsSidebar=(e,o)=>{const t=e.webpackModules.findByDisplayName("SettingsView"),s=e.webpackModules.findByDisplayName("Text"),n=e.webpackModules.findByProps("versionHash","line"),{React:a}=e.webpackModules.common;e.settingsUninjects.push(e.patcher.patch(t.prototype,"getPredicateSections",((t,r)=>{const i=r.find((e=>"logout"===e.section));return i?(r.splice(r.indexOf(i),0,...e.settings.items.filter((t=>!(o.get().home&&(t[1]===e.i18n.goosemodStrings.settings.itemNames.plugins||t[1]===e.i18n.goosemodStrings.settings.itemNames.themes||"Snippets"===t[1])||!o.get().snippets&&"Snippets"===t[1]))).map((o=>{switch(o[0]){case"item":let t={section:"gm-"+o[1],label:o[1],predicate:()=>{},element:function(){if("function"==typeof o[3])return document.getElementsByClassName("selected-3s45Ha")[0].click(),o[3](),a.createElement("div");const t=document.querySelector('div[aria-label="USER_SETTINGS"]').querySelector("nav > div");return o[1]!==e.i18n.goosemodStrings.settings.itemNames.plugins&&o[1]!==e.i18n.goosemodStrings.settings.itemNames.themes&&"Snippets"!==o[1]||(setTimeout((()=>{document.querySelector(".sidebarRegion-VFTUkN").style.maxWidth="218px",document.querySelector(".contentColumnDefault-1VQkGM").style.maxWidth="calc(100vw - 218px - 60px - 20px)"}),10),t.addEventListener("click",(o=>{0!==o.clientX&&o.target.textContent!==e.i18n.goosemodStrings.settings.itemNames.plugins&&o.target.textContent!==e.i18n.goosemodStrings.settings.itemNames.themes&&"Snippets"!==o.target.textContent&&(document.querySelector(".sidebarRegion-VFTUkN").style.maxWidth="50%",document.querySelector(".contentColumnDefault-1VQkGM").style.maxWidth="740px")}))),e.settings._createItem(o[1],o[2])}};return o[4]&&(t.color="#f04747"),t;case"heading":return{section:"HEADER",label:o[1]};case"separator":return{section:"DIVIDER"}}})),{section:"DIVIDER"}),r.push({section:"DIVIDER"},{section:"CUSTOM",element:()=>a.createElement("div",{className:n.info},a.createElement(s,{className:n.line,size:s.Sizes.SIZE_12,color:s.Colors.MUTED,tag:"span"},"GooseMod"," ",e.versioning.version," ",a.createElement("span",{className:n.versionHash},"(",e.versioning.hash.substring(0,7),")")),a.createElement(s,{className:n.line,size:s.Sizes.SIZE_12,color:s.Colors.MUTED,tag:"span"},"GooseMod Ext"," ",window.gmExtension))}),r):r})))},addBaseItems=(e,o,t)=>{let s=e.settings.items;e.settings.items=[],e.settings.createHeading("GooseMod");const n=async(t,s)=>{switch(t){case"changelog":if(s){const t=[["item",e.i18n.discordStrings.CHANGE_LOG,[""],async()=>{show()},!1]];o.get().separators&&t.unshift(["separator"]),e.settings.items.splice(e.settings.items.indexOf(e.settings.items.find((e=>"Themes"===e[1])))+1,0,...t)}else e.settings.items.splice(e.settings.items.indexOf(e.settings.items.find((e=>"Change Log"===e[1]))),o.get().separators?2:1);await e.settings.reopenSettings(),e.settings.openSettingItem("Settings");break;case"devchannel":s?goosemod.storage.set("goosemodUntetheredBranch","dev"):goosemod.storage.remove("goosemodUntetheredBranch");break;case"separators":if(s)o.get().home||goosemod.settings.items.splice(2,0,["separator"]),o.get().changelog&&goosemod.settings.items.splice(4,0,["separator"]);else{let o=!0;e.settings.items=e.settings.items.filter(((t,s)=>(e.settings.items[s+1]&&e.settings.items[s+1][1]&&"GooseMod Modules"===e.settings.items[s+1][1]&&(o=!1),!("separator"===t[0]&&o))))}await e.settings.reopenSettings(),e.settings.openSettingItem("Settings");break;case"gmBadges":e.gmBadges[s?"addBadges":"removeBadges"]()}o.set(t,s)},a=async()=>{await e.confirmDialog("Refresh","Refresh Required","This setting **requires a refresh to take effect**. You **may experience some strange behaviour** in this session before refreshing.")&&location.reload()};e.settings.createItem(e.i18n.discordStrings.SETTINGS,["",{type:"header",text:"Settings"},{type:"toggle",text:"GooseMod Change Log",subtext:'Show GooseMod "Change Log" setting',onToggle:e=>n("changelog",e),isToggled:()=>o.get().changelog},{type:"toggle",text:"Main Separators",subtext:"Show separators between main GooseMod settings",onToggle:e=>n("separators",e),isToggled:()=>o.get().separators},{type:"toggle",text:"Store In Home",subtext:"Put GooseMod Store options in home instead of in settings",onToggle:e=>{n("home",e),a()},isToggled:()=>o.get().home},{type:"header",text:"Store"},{type:"toggle",text:"Auto Update",subtext:"Automatically update repos and modules every hour",onToggle:e=>n("autoupdate",e),isToggled:()=>o.get().autoupdate},{type:"header",text:"Appearance"},{type:"toggle",text:"GooseMod Badges",subtext:"Shows GooseMod's badges",onToggle:e=>n("gmBadges",e),isToggled:()=>o.get().gmBadges},{type:"header",text:"Utilities"},{type:"text-and-button",text:"Purge Caches",subtext:"Purges (completely removes) most caches GooseMod uses",buttonText:"Purge",onclick:async()=>{goosemod.storage.keys().filter((e=>e.toLowerCase().startsWith("goosemod")&&e.includes("Cache"))).forEach((e=>goosemod.storage.remove(e))),a()}},{type:"text-and-button",text:"Start Tour",subtext:"Go through GooseMod's startup tour again",buttonText:"Tour",onclick:async()=>{e.ootb.start()}},{type:"text-and-button",text:"Copy Debug Info",subtext:"Copies information on setup and GooseMod for reporting and debugging",buttonText:"Copy",onclick:async()=>{const{copy:o}=e.webpackModules.findByProps("copy","SUPPORTS_COPY"),t={powercord:"powercord",vizality:"vizality",ED:"enhanceddiscord",BdApi:"betterdiscord"};o(`Discord:\nClient: ${window.DiscordNative?"desktop":"web"}\nUser Agent: ${navigator.userAgent}\nRelease Channel: ${GLOBAL_ENV.RELEASE_CHANNEL}\nOther Mods: ${Object.keys(t).filter((e=>Object.keys(window).includes(e))).map((e=>t[e])).join(", ")}\n\nGooseMod:\nGM Version: ${e.versioning.version} (${e.versioning.hash})\nGM Branch: ${e.storage.get("goosemodUntetheredBranch")}\nGM Extension Version: ${window.gmExtension}\nGM Storage Impl: ${e.storage.type}\nModules: ${Object.keys(e.modules).join(", ")}\n`)}},{type:"text-and-danger-button",text:"Reset GooseMod",subtext:"Resets GooseMod completely: removes all preferences and modules; like a first-time install",buttonText:"Reset",onclick:async()=>{await e.confirmDialog("Reset","Reset GooseMod","Confirming will completely reset GooseMod, removing all preferences and modules; as if you had installed GooseMod for the first time. This is irreversible.")&&(e.remove(),window.location.reload())}},{type:"header",text:"Backup"},{type:"text-and-button",text:"Create Backup",subtext:"Creates a file for backup of your GooseMod modules and settings",buttonText:"Backup",onclick:()=>{const e=goosemod.storage.keys().filter((e=>e.toLowerCase().startsWith("goosemod")&&!e.includes("Cache"))).reduce(((e,o)=>(e[o]=goosemod.storage.get(o),e)),{}),o=JSON.stringify(e),t=document.createElement("a");t.style.display="none";const s=new Blob([o],{type:"application/json"});t.href=URL.createObjectURL(s),t.download="goosemodBackup.json",document.body.appendChild(t),t.click(),t.remove()}},{type:"text-and-button",text:"Restore Backup",subtext:"Restore your GooseMod modules and settings via a backup file, **only restore backups you trust**",buttonText:"Restore",onclick:async()=>{const e=document.createElement("input");e.style.display="none",e.type="file",e.click(),await new Promise((o=>{e.onchange=()=>{o()}}));const o=e.files[0];if(!o)return;const t=new FileReader;t.onload=()=>{const e=JSON.parse(t.result);for(const o in e)o.startsWith("goosemod")&&goosemod.storage.set(o,e[o]);location.reload()},t.readAsText(o)}},{type:"header",text:"Experimental"},{type:"subtext",text:"Experimental settings are likely incomplete and unstable, which may result in a reduced experience"},{type:"toggle",experimental:!0,text:"Development Channel",subtext:"Use experimental development GooseMod builds",onToggle:e=>{n("devchannel",e),a()},isToggled:()=>"dev"===goosemod.storage.get("goosemodUntetheredBranch")},{type:"toggle",experimental:!0,text:"Data Attributes",subtext:"Add data attributes to some elements for some themes to use",onToggle:e=>{n("attrs",e),a()},isToggled:()=>o.get().attrs},{type:"toggle",experimental:!0,text:"Snippets",subtext:"Enable Snippets tab in Store",onToggle:e=>{n("snippets",e),a()},isToggled:()=>o.get().snippets},{type:"toggle",experimental:!0,text:"Force Theme Settings",subtext:"Force auto-generated settings for all themes",onToggle:e=>{n("allThemeSettings",e),a()},isToggled:()=>o.get().allThemeSettings},{type:"gm-footer"}]),o.get().separators&&!o.get().home&&e.settings.createSeparator();let r="Stars",i="All",d="";const l=()=>{const o=document.querySelectorAll(":not(.gm-store-category) > div > .gm-store-card"),t=new RegExp(`.*${d}.*`,"i");let s=document.querySelector(".selected-3s45Ha").textContent;"Store"!==s&&"Imported"!==s&&(s="Store");for(let n of o){const o=n.getElementsByClassName("title-31JmR4"),a=o[1],d=[...o[0].getElementsByClassName("author")].map((e=>e.textContent.split("#")[0])),l=a.childNodes[0].wholeText,c=n.getElementsByClassName("description-3_Ncsb")[0].innerText,p=t.test(l)||t.test(c),m=n.getElementsByClassName("container-3auIfb")[0].classList.contains("hide-toggle")?"Store":"Imported";switch(r){case"A-Z":n.style.order="";break;case"Last Updated":{const o=e.moduleStoreAPI.modules.find((e=>e.name===l.trim()));n.style.order=3e9-o.lastUpdated;break}case"Stars":n.style.order=1e4-parseInt(n.children[4].children[0].children[0].textContent)}n.style.display=!p||"Store"!==s&&s!==m||"All"!==i&&!d.includes(i.split(" (").slice(0,-1).join(" ("))?"none":"block"}const n=""===d&&"Store"===s&&"All"===i;[...document.getElementsByClassName("gm-store-category")].forEach((e=>e.style.display=n?"block":"none"));const a=document.querySelector(":not(.gm-store-category) > .gm-store-header");a.style.height=n?"":"0px",a.style.opacity=n?"":"0",a.style.margin=n?"":"0"};e.settings.updateModuleStoreUI=l;const c=new Date,p=e=>{const o=(c-1e3*e.lastUpdated)/1e3/60/60/24;return e.github.stars/o-e.github.stars/2+(1-o)};[e.i18n.goosemodStrings.settings.itemNames.plugins,e.i18n.goosemodStrings.settings.itemNames.themes].forEach((o=>e.settings.createItem(o,["",{type:"search",placeholder:`${e.i18n.discordStrings.SEARCH} ${o}`,onchange:e=>{d=e,l()},storeSpecific:!0},{type:"dropdown-individual",label:"Sort by",options:["Stars","A-Z","Last Updated"],onchange:e=>{r=e,l()}},{type:"dropdown-individual",label:"Author",options:()=>{const o=e.moduleStoreAPI.idCache.getCache(),t=[...e.moduleStoreAPI.modules.reduce(((e,t)=>{let s=t.authors;Array.isArray(s)||(s=[s]);for(const t of s){let s=t;if("object"==typeof t)s=t.n;else if(t.match(/^[0-9]{17,18}$/))s=o[t]?.data?.username;else{const e=t.match(/(.*) \(([0-9]{17,18})\)/);null!==e&&(s=e[1])}s&&e.set(s,(e.get(s)||0)+1)}return e}),new Map).entries()].sort(((e,o)=>o[1]-e[1])).map((e=>`${e[0]} (${e[1]})`));return t.unshift("All"),t},onchange:e=>{i=e,l()}},{type:"store-category",text:"Top Starred",sort:(e,o)=>o.github.stars-e.github.stars},{type:"store-category",text:"Recently Updated",sort:(e,o)=>o.lastUpdated-e.lastUpdated},{type:"store-category",text:"Upcoming",sort:(e,o)=>p(o)-p(e)},{type:"store-header",text:`All ${o}`},{type:"gm-footer"}]))),e.settings.createItem("Snippets",["",{type:"search",placeholder:"Search Snippets",onchange:e=>{const o=document.getElementsByClassName("gm-store-card"),t=new RegExp(`.*${e}.*`,"i");for(const e of o){const o=e.getElementsByClassName("markdown-11q6EU")[0].textContent,s=t.test(o);e.style.display=s?"":"none"}},storeSpecific:!0}]),o.get().changelog&&(o.get().separators&&e.settings.createSeparator(),e.settings.createItem(e.i18n.discordStrings.CHANGE_LOG,[""],(async()=>{show()}))),e.settings.createSeparator(),e.settings.createHeading(e.i18n.goosemodStrings.settings.itemNames.goosemodModules),e.settings.items=e.settings.items.concat(s)},addCustomCss=()=>{const e=document.createElement("style");e.appendChild(document.createTextNode('\n#gm-settings-inject > div, .gm-store-settings {\n display: flex;\n flex-flow: row wrap;\n\n align-items: center;\n justify-content: center;\n}\n\n.gm-store-settings > h1 {\n flex-basis: 100%;\n}\n\n.gm-inline-dropdown {\n display: flex;\n align-items: center;\n\n margin-left: 12px;\n}\n\n.gm-inline-dropdown > .select-2TCrqx {\n width: 120px;\n margin-left: 8px;\n}\n\n.gm-store-search {\n flex-grow: 1;\n\n margin-right: 12px;\n}\n\n.gm-store-header {\n margin-bottom: 0;\n\n width: 100%;\n max-width: 100%;\n}\n\n\n.gm-store-card {\n box-shadow: var(--elevation-medium);\n background-color: var(--background-secondary);\n\n border-radius: 8px;\n box-sizing: border-box;\n\n padding: 12px;\n margin: 10px;\n\n width: 330px;\n height: 380px;\n\n position: relative;\n}\n\n.gm-store-card > :nth-child(1) {\n width: calc(100% + 24px);\n height: 200px;\n\n border-radius: 8px 8px 0 0;\n\n margin-top: -12px;\n margin-left: -12px;\n\n background-color: var(--background-secondary-alt);\n background-repeat: no-repeat;\n background-size: contain;\n background-position: 50%;\n\n text-align: center;\n line-height: 200px;\n\n color: var(--interactive-normal);\n font-family: var(--font-display);\n font-size: 36px;\n}\n\n.gm-store-card > :nth-child(2) {\n position: absolute;\n top: 152px;\n right: 10px;\n\n opacity: 0.95;\n\n border-radius: 16px;\n\n background-color: rgba(0, 0, 0, 0.5);\n width: fit-content;\n\n padding-right: 10px;\n}\n\n.gm-store-card > :nth-child(2).no-pfp {\n padding: 4px 8px;\n}\n\n.gm-store-card > :nth-child(3) {\n width: 85%;\n margin-top: 10px;\n\n overflow: hidden;\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n}\n\n.gm-store-card > :nth-child(4) {\n width: 85%;\n margin-top: 5px;\n\n overflow: hidden;\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n\n clear: both;\n}\n\n.gm-store-card > :nth-child(5) {\n display: flex;\n align-items: center;\n flex-direction: column;\n order: 2;\n margin-left: auto;\n position: absolute;\n top: 208px;\n right: 12px;\n width: calc(15% - 12px);\n}\n\n.gm-store-card > :nth-child(5) > :nth-child(1) {\n width: max-content;\n}\n\n.gm-store-card > :nth-child(5) > :nth-child(1) > :nth-child(1) {\n position: relative;\n top: 7px;\n font-size: 18px;\n font-weight: 600;\n}\n\n.gm-store-card > :nth-child(5) > :nth-child(1) > :nth-child(2) {\n position: relative;\n top: 8px;\n margin-left: 5px;\n}\n\n.gm-store-card > :nth-child(5) > :nth-child(2) {\n margin-top: 20px;\n\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n width: 100%;\n line-break: anywhere;\n}\n\n.gm-store-card > :nth-child(6) {\n position: absolute;\n bottom: 12px;\n width: calc(100% - 32px);\n display: flex;\n gap: 5px;\n}\n\n.gm-store-card > :nth-child(6) > :nth-child(1) {\n display: inline-flex;\n cursor: pointer;\n width: 90px;\n}\n\n.gm-store-card > :nth-child(6) > :nth-child(2) {\n width: auto;\n margin-left: 14px;\n min-width: 0px;\n padding: 2px 5px;\n color: rgb(221, 221, 221);\n display: inline-flex;\n cursor: pointer;\n}\n\n.gm-store-card > :nth-child(6) > :nth-child(3) {\n margin-top: 4px;\n position: absolute;\n right: -10px;\n}\n\n.gm-store-card > :nth-child(6) > :nth-child(3).hide-toggle {\n display: none !important;\n}\n\n/* Mini cards (profile store) */\n.gm-store-card-mini {\n width: 100%;\n height: 74px;\n}\n\n.gm-store-card-mini > :nth-child(1) {\n background-color: unset;\n right: 0px;\n position: absolute;\n width: 120px;\n border-radius: 0 8px 8px 0;\n height: 100%;\n}\n\n.gm-store-card-mini > :nth-child(3) {\n margin-top: 0;\n}\n\n.gm-store-card-mini > :nth-child(4) {\n -webkit-line-clamp: 1;\n width: 75%;\n}\n\n.gm-store-card-mini > :nth-child(2), .gm-store-card-mini > :nth-child(5), .gm-store-card-mini > :nth-child(6) {\n display: none;\n}\n\n.gm-modules-container {\n display: flex;\n grid-template-columns: none;\n flex-flow: row wrap;\n justify-content: center;\n}\n\n\n.gm-store-category {\n width: 100%;\n}\n\n.gm-store-category > :nth-child(2) {\n display: grid;\n overflow-x: scroll;\n grid-template-columns: repeat(auto-fill, 350px);\n grid-auto-flow: column;\n width: 100%;\n}\n\n\n.gm-store-loading-container {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n}\n\n\n.gm-settings-note-markdown {\n font-size: inherit;\n color: inherit !important;\n}\n\n.gm-settings-note-markdown .paragraph-3Ejjt0 {\n margin: 0;\n}\n\n.gm-settings-label-icon {\n vertical-align: sub;\n}\n\n.gm-settings-label-text {\n vertical-align: top;\n margin-left: 6px;\n}\n\n.gm-settings-header-collapser {\n margin-top: -3px;\n float: right;\n width: 22px;\n height: 22px;\n}\n\n.gm-settings-header-collapser.collapsed {\n transform: rotate(-90deg);\n}\n\n\n/* Store image carousel */\n.gm-carousel-modal {\n background-color: var(--background-primary);\n border-radius: 6px;\n padding: 12px;\n\n pointer-events: all;\n}\n\n.gm-carousel-modal .outer-s4sY2_ {\n width: 50vw;\n height: 30vw;\n\n padding-top: 0 !important;\n\n background-color: var(--background-secondary-alt);\n}\n\n.gm-carousel-modal .root-3tU4d2 {\n background-color: unset;\n}\n\n.gm-carousel-modal .smallCarouselImage-2Qvg9S {\n cursor: default;\n}\n\n\n/* OOTB */\n.gm-modules-preview .guildIcon-cyDh6h {\n display: none;\n}\n\n.gm-modules-preview .cardHeader-2XrQbx {\n margin-bottom: 12px;\n}\n\n.gm-modules-preview .card-3_CqkU {\n background-color: var(--background-tertiary);\n}\n\n.gm-ootb-modal {\n width: 600px;\n}\n\n.gm-highlight #app-mount::after {\n display: block;\n content: \'\';\n\n box-shadow: 0 0 0 99999px rgb(0 0 0 / 50%);\n z-index: 9;\n}\n\n.gm-highlight .content-3YMskv [id*="gm"] {\n filter: brightness(2);\n background: var(--background-modifier-selected);\n\n border-radius: 0;\n z-index: 10;\n\n transition: all .5s;\n}\n\n/* Repos modal icons */\n.gm-repos-modal-icon-Verified {\n color: var(--status-positive-background);\n}\n\n.gm-repos-modal-icon-Alert {\n color: var(--status-danger-background);\n}\n\n.gm-repos-modal-icon-Alert .icon-1ihkOt {\n width: 12px;\n height: 12px;\n}\n\n.gm-repos-modal-icon-Help {\n color: var(--status-warning-background);\n}\n\n/* GM Error Boundary */\n.gm-error-boundary {\n display: flex;\n flex-flow: column;\n\n width: 100%;\n height: 100%;\n}\n\n.gm-error-boundary > :first-child {\n display: flex;\n justify-content: center;\n\n width: 100%;\n}\n\n.gm-error-boundary > :first-child > :first-child {\n display: block;\n background-repeat: no-repeat;\n background-size: contain;\n background-position: 50%;\n overflow: hidden;\n pointer-events: none;\n object-fit: cover;\n\n height: 48px;\n width: 48px;\n margin-right: 22px;\n\n border-radius: 50%;\n background-image: url("https://goosemod.com/img/goose_glitch.jpg");\n}\n\n.gm-error-boundary > :first-child > :nth-child(2) {\n margin-top: -2px;\n}\n\n.gm-error-boundary > :first-child > :nth-child(2) .title-3KTIjF {\n color: var(--interactive-normal);\n font-family: var(--font-primary);\n\n margin-left: 1px;\n margin-bottom: 0;\n}\n\n.gm-error-boundary > :nth-child(2) {\n display: flex;\n justify-content: center;\n\n width: 100%;\n\n margin-top: 28px;\n gap: 40px;\n}\n\n.gm-error-boundary > :nth-child(3) {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n margin-top: 28px;\n color: var(--header-secondary);\n}\n\n.gm-error-boundary > :nth-child(3) > :nth-child(1) {\n width: 24px;\n height: 24px;\n\n margin-right: 4px;\n}\n\n.gm-error-boundary > :nth-child(4) {\n width: 100%;\n margin-top: 8px;\n}\n\n.gm-error-boundary > :nth-child(4) pre {\n margin-bottom: 28px;\n}\n\n/* Discord fixes */\n/* Color picker is behind settings layer (and other things like modals / etc) */\n.layer-v9HyYc {\n z-index: 999;\n}\n')),document.body.appendChild(e)},getItems=async()=>({divider:(await Promise.resolve().then((function(){return divider}))).default(),header:(await Promise.resolve().then((function(){return header$1}))).default(),toggle:(await Promise.resolve().then((function(){return toggle$1}))).default(),text:(await Promise.resolve().then((function(){return text$1}))).default(),"text-and-button":(await Promise.resolve().then((function(){return textAndButton$1}))).default(),"text-and-color":(await Promise.resolve().then((function(){return textAndColor$1}))).default(),button:(await Promise.resolve().then((function(){return button$1}))).default(),search:(await Promise.resolve().then((function(){return search$1}))).default(),"dropdown-individual":(await Promise.resolve().then((function(){return dropdownIndividual$1}))).default(),"store-header":(await Promise.resolve().then((function(){return storeHeader}))).default(),card:(await Promise.resolve().then((function(){return card}))).default(),"store-category":(await Promise.resolve().then((function(){return storeCategory$1}))).default(),custom:(await Promise.resolve().then((function(){return custom$1}))).default(),"text-input":(await Promise.resolve().then((function(){return textInput$1}))).default(),subtext:(await Promise.resolve().then((function(){return subtext$1}))).default()});const gmSettings=GMSettings;let Items={},goosemodScope$8={};const setThisScope$7=async e=>{goosemodScope$8=e,Items=await getItems()},removeModuleUI=(e,o)=>{const t=void 0===goosemodScope$8.modules[e];t&&(goosemodScope$8.modules[e]=Object.assign({},goosemodScope$8.disabledModules[e]),delete goosemodScope$8.disabledModules[e]),goosemodScope$8.moduleStoreAPI.moduleRemoved(goosemodScope$8.modules[e]),t||goosemodScope$8.modules[e].goosemodHandlers.onRemove(),delete goosemodScope$8.modules[e],goosemodScope$8.moduleSettingsStore.clearModuleSetting(e),o&&goosemodScope$8.settings.openSettingItem(o)},isSettingsOpen=()=>null!==document.querySelector('div[aria-label="USER_SETTINGS"] .closeButton-1tv5uR'),closeSettings=()=>{let e=document.querySelector('div[aria-label="USER_SETTINGS"] .closeButton-1tv5uR');if(null===e)return!1;e.click()},openSettings=()=>{document.querySelector('.flex-1xMQg5.flex-1O1GKY.horizontal-1ae9ci.horizontal-2EEEnY.flex-1O1GKY.directionRow-3v3tfG.justifyStart-2NDFzi.alignStretch-DpGPf3.noWrap-3jynv6 > [type="button"]:last-child').click()},openSettingItem=e=>{try{const o=[...document.querySelector('div[aria-label="USER_SETTINGS"]').querySelector("nav > div").children];return o[1].click(),setTimeout((()=>o.find((o=>o.textContent===e)).click()),5),!0}catch(e){return!1}},reopenSettings=async()=>{goosemodScope$8.settings.closeSettings(),await sleep(500),goosemodScope$8.settings.openSettings(),await sleep(100)};let items=[];const createItem=(e,o,t,s=!1)=>{goosemodScope$8.settings.items.push(["item",e,o,t,s])},removeItem=e=>{const o=goosemodScope$8.settings.items.indexOf(goosemodScope$8.settings.items.find((o=>o[1]===e)));if(-1===o)return!1;goosemodScope$8.settings.items.splice(o,1)},createHeading=e=>{goosemodScope$8.settings.items.push(["heading",e])},createSeparator=()=>{goosemodScope$8.settings.items.push(["separator"])},_createItem=(e,o,t=!0)=>{const{React:s}=goosemodScope$8.webpackModules.common,n=goosemodScope$8.webpackModules.findByDisplayName("FormSection"),a=goosemodScope$8.webpackModules.findByDisplayName("FormTitle"),r=()=>o.slice(1).map(((o,t)=>{o.type.includes("danger-button")&&(o.type=o.type.replace("danger-",""),o.danger=!0);const n=Items[o.type];return n?s.createElement(n,{i:t,...o,itemName:e}):s.createElement("div")}));return t?s.createElement(n,{className:e===goosemodScope$8.i18n.goosemodStrings.settings.itemNames.plugins||e===goosemodScope$8.i18n.goosemodStrings.settings.itemNames.themes?"gm-store-settings":""},s.createElement(a,{tag:"h1"},e),r()):s.createElement("div",{},r())},makeGooseModSettings=()=>{goosemodScope$8.settingsUninjects=[],addBaseItems(goosemodScope$8,gmSettings),addToSettingsSidebar(goosemodScope$8,gmSettings),addToContextMenu(goosemodScope$8,gmSettings.get().home),gmSettings.get().home&&addToHome(goosemodScope$8),addCustomCss(),loadColorPicker()},loadColorPicker=()=>{const{findInReactTree:e}=goosemodScope$8.reactUtils;if(!goosemodScope$8.webpackModules.findByDisplayName("ColorPicker")){e(goosemodScope$8.webpackModules.findByDisplayName("GuildFolderSettingsModal").prototype.render.call({props:{},state:{}}).props.children,(e=>e.props?.colors)).type().props.children.type._ctor()}};var Settings={__proto__:null,gmSettings:gmSettings,setThisScope:setThisScope$7,removeModuleUI:removeModuleUI,isSettingsOpen:isSettingsOpen,closeSettings:closeSettings,openSettings:openSettings,openSettingItem:openSettingItem,reopenSettings:reopenSettings,items:items,createItem:createItem,removeItem:removeItem,createHeading:createHeading,createSeparator:createSeparator,_createItem:_createItem,makeGooseModSettings:makeGooseModSettings},ab2str=e=>(new TextDecoder).decode(e);const evalGlobal=eval,makeSourceURL=e=>`${e} | GM Module`.replace(/ /g,"%20");let goosemodScope$7={};const setThisScope$6=e=>{goosemodScope$7=e},importModule=async(e,o=!1)=>{let t=e.name;goosemodScope$7.logger.debug("import",`Importing module: "${t}"`),void 0!==goosemodScope$7.modules[t]?.goosemodHandlers?.onImport&&(goosemodScope$7.logger.debug(`import.load.module.${t}`,"Module already imported, removing then installing new version"),await goosemodScope$7.modules[t].goosemodHandlers.onRemove()),"object"==typeof e.data&&(e.data=ab2str(e.data));goosemodScope$7[o?"disabledModules":"modules"][t]=Object.assign(evalGlobal("const goosemodScope=goosemod;"+e.data+` //# sourceURL=${makeSourceURL(e.name)}`),e.metadata),o||await goosemodScope$7.modules[t].goosemodHandlers.onImport()};let goosemodScope$6={};const setThisScope$5=e=>{goosemodScope$6=e},disableModule=e=>{let o=JSON.parse(goosemod.storage.get("goosemodDisabled"))||{};o[e]=!0,goosemod.storage.set("goosemodDisabled",JSON.stringify(o))},enableModule=e=>{let o=JSON.parse(goosemod.storage.get("goosemodDisabled"))||{};delete o[e],goosemod.storage.set("goosemodDisabled",JSON.stringify(o))},checkDisabled=e=>Object.keys(JSON.parse(goosemod.storage.get("goosemodDisabled"))||{}).includes(e),saveModuleSettings=async()=>{let e=JSON.parse(goosemod.storage.get("goosemodModules"))||{};for(let o in goosemodScope$6.modules)if(goosemodScope$6.modules.hasOwnProperty(o))try{e[o]=await(goosemodScope$6.modules[o].goosemodHandlers.getSettings||(async()=>[]))()}catch(e){console.error("Failed to load settings to save module",o,e)}JSON.stringify(JSON.parse(goosemod.storage.get("goosemodModules")))!==JSON.stringify(e)&&goosemod.storage.set("goosemodModules",JSON.stringify(e))},clearModuleSetting=e=>{let o=JSON.parse(goosemod.storage.get("goosemodModules"));o&&o[e]&&(delete o[e],goosemod.storage.set("goosemodModules",JSON.stringify(o)))},clearSettings=()=>{goosemod.storage.remove("goosemodModules")},loadSavedModuleSetting=async e=>{let o=JSON.parse(goosemod.storage.get("goosemodModules"));o&&o[e]&&await(goosemodScope$6.modules[e].goosemodHandlers.loadSettings||(async()=>[]))(o[e])};var ModuleSettingsStore={__proto__:null,setThisScope:setThisScope$5,disableModule:disableModule,enableModule:enableModule,checkDisabled:checkDisabled,saveModuleSettings:saveModuleSettings,clearModuleSetting:clearModuleSetting,clearSettings:clearSettings,loadSavedModuleSetting:loadSavedModuleSetting};let openpgp;const loadLibrary=async()=>{const js=await(await fetch("https://api.goosemod.com/pgp.js",{cache:"force-cache"})).text();openpgp=eval(js+";openpgp")},verifySignature=async(e,o,t)=>{openpgp||await loadLibrary();const s=await openpgp.readKey({armoredKey:e}),n=await openpgp.createMessage({text:t}),a=await openpgp.readSignature({armoredSignature:o}),r=await openpgp.verify({message:n,signature:a,verificationKeys:s}),{verified:i,keyID:d}=r.signatures[0];try{return await i,goosemod.logger.debug("pgp","verified, key id:",d.toHex()),!0}catch(e){return goosemod.logger.debug("pgp","failed to verify",e.message),!1}},hash=async(e,o)=>{const t=await crypto.subtle.digest(o,new TextEncoder("utf-8").encode(e));return Array.prototype.map.call(new Uint8Array(t),(e=>("00"+e.toString(16)).slice(-2))).join("")},sha512=e=>hash(e,"SHA-512");let goosemodScope$5={};const setThisScope$4=e=>{goosemodScope$5=e},getCache$2=()=>JSON.parse(goosemod.storage.get("goosemodJSCache")||"{}"),purgeCache$2=()=>goosemod.storage.remove("goosemodJSCache"),updateCache$2=(e,o,t)=>{let s=goosemodScope$5.moduleStoreAPI.jsCache.getCache();s[e]={hash:o,js:t},goosemod.storage.set("goosemodJSCache",JSON.stringify(s))},getJSForModule=async e=>{const o=goosemodScope$5.moduleStoreAPI.modules.find((o=>o.name===e)),t=goosemodScope$5.moduleStoreAPI.jsCache.getCache();if(t[e]&&o.hash===t[e].hash)return t[e].js;{const t=o.repo.split("/").slice(0,-1).join("/"),s=await(await fetch(`${t}/module/${e}.js?_=${Date.now()}`)).text();return goosemodScope$5.moduleStoreAPI.jsCache.updateCache(e,o.hash,s),s}};var JSCache={__proto__:null,setThisScope:setThisScope$4,getCache:getCache$2,purgeCache:purgeCache$2,updateCache:updateCache$2,getJSForModule:getJSForModule};const currentDate=new Date-0;let goosemodScope$4={},getUser,queueProcessInterval;const setThisScope$3=e=>{goosemodScope$4=e,getUser=goosemodScope$4.webpackModules.findByProps("getUser","fetchCurrentUser").getUser},queue=[],queueReturns=[],processQueue=async()=>{if(0===queue.length)return clearInterval(queueProcessInterval),void(queueProcessInterval=void 0);const e=queue.pop();queueReturns.push(await getUser(e))},getCache$1=()=>JSON.parse(goosemod.storage.get("goosemodIDCache")||"{}"),purgeCache$1=()=>goosemod.storage.remove("goosemodIDCache"),updateCache$1=(e,o)=>{let t=getCache$1();t[e]={data:o,time:currentDate},goosemod.storage.set("goosemodIDCache",JSON.stringify(t))},getDataForID=async e=>{const o=getCache$1();if(o[e]&&o[e].time>currentDate-864e5)return o[e].data;{let o;for(queue.push(e),queueProcessInterval||(queueProcessInterval=setInterval(processQueue,500),processQueue());;){if(o=queueReturns.find((o=>o.id===e)),o){queueReturns.splice(queueReturns.indexOf(o),1);break}await sleep(500)}return updateCache$1(e,o),o}};var IDCache={__proto__:null,setThisScope:setThisScope$3,getCache:getCache$1,purgeCache:purgeCache$1,updateCache:updateCache$1,getDataForID:getDataForID};let goosemodScope$3={};var moduleStoreAPI={setThisScope:e=>{goosemodScope$3=e,setThisScope$4(e),setThisScope$3(e)},modules:[],repos:[],apiBaseURL:"https://api.goosemod.com",storeApiBaseURL:"https://store.goosemod.com",jsCache:JSCache,idCache:IDCache,getSettingItemName:e=>{let o=goosemodScope$3.i18n.goosemodStrings.settings.itemNames.plugins;return e.tags.includes("theme")&&(o=goosemodScope$3.i18n.goosemodStrings.settings.itemNames.themes),o},hotupdate:async(e=!1)=>{e&&goosemodScope$3.updateLoadingScreen("Getting modules from repos..."),await goosemodScope$3.moduleStoreAPI.updateModules(),await goosemodScope$3.moduleStoreAPI.updateStoreSetting(),e&&goosemodScope$3.updateLoadingScreen("Updating modules...");const o={},t=[];for(const s in goosemodScope$3.modules){const n=goosemodScope$3.moduleStoreAPI.modules.find((e=>e.name===s))?.hash,a=goosemodScope$3.moduleStoreAPI.jsCache.getCache()[s]?.hash;if(void 0!==n&&void 0!==a&&n!==a){if(void 0===o[s.repo]){const e=goosemodScope$3.moduleStoreAPI.repos.find((e=>e.url===s.repo));if("untrusted"===goosemodScope$3.moduleStoreAPI.verifyPgp(e).trustState){goosemodScope$3.showToast(`Failed to verify repo ${e.meta.name}, refusing to update it's modules`,{timeout:1e4,type:"error",subtext:"GooseMod Store (PGP)"}),o[s.repo]=!1;continue}o[s.repo]=!0}!1!==o[s.repo]&&(e&&goosemodScope$3.updateLoadingScreen(`Updating modules...\n${s}`),t.push(goosemodScope$3.moduleStoreAPI.importModule(s,goosemodScope$3.moduleSettingsStore.checkDisabled(s)).then((async()=>{}))))}}await Promise.all(t)},initRepos:async()=>{const e=async e=>(await(await fetch(`${e}?_=${Date.now()}`)).json()).meta,o=async o=>({url:o,enabled:!0,meta:await e(o)});goosemodScope$3.moduleStoreAPI.repos=JSON.parse(goosemod.storage.get("goosemodRepos"))||[await o("https://store.goosemod.com/goosemod.json"),await o("https://store.goosemod.com/ms2porter.json"),await o("https://store.goosemod.com/bdthemes.json"),await o("https://store.goosemod.com/pcthemes.json"),await o("https://store.goosemod.com/pcplugins.json")]},updateModules:async()=>{let e=[];goosemodScope$3.moduleStoreAPI.repos=(await Promise.all(goosemodScope$3.moduleStoreAPI.repos.map((async o=>{if(!o.enabled)return o;try{const t=await(await fetch(`${o.url}?_=${Date.now()}`)).text(),s=JSON.parse(t);return"untrusted"===await goosemodScope$3.moduleStoreAPI.verifyPgp(o).trustState?(goosemodScope$3.showToast(`Failed to verify repo: ${o.meta.name}, refusing to use new modules`,{timeout:1e4,type:"error",subtext:"GooseMod Store (PGP)"}),e=e.concat(goosemodScope$3.moduleStoreAPI.modules.filter((e=>e.repo===o.url))).sort(((e,o)=>e.name.localeCompare(o.name))),o):(e=e.concat(s.modules.map((e=>(e.repo=o.url,e)))).sort(((e,o)=>e.name.localeCompare(o.name))),{...o,meta:s.meta,resp:t})}catch(e){goosemodScope$3.showToast(`Failed to get repo: ${o.url}`,{timeout:5e3,type:"error",subtext:"GooseMod Store"}),console.error(e)}return o})))).sort(((e,o)=>goosemodScope$3.moduleStoreAPI.repos.indexOf(e.url)-goosemodScope$3.moduleStoreAPI.repos.indexOf(o.url))),goosemodScope$3.moduleStoreAPI.modules=e,goosemod.storage.set("goosemodRepos",JSON.stringify(goosemodScope$3.moduleStoreAPI.repos.map((e=>(delete e.resp,e))))),goosemod.storage.set("goosemodCachedModules",JSON.stringify(goosemodScope$3.moduleStoreAPI.modules))},importModule:async(e,o=!1)=>{try{const t=goosemodScope$3.moduleStoreAPI.modules.find((o=>o.name===e)),s=await goosemodScope$3.moduleStoreAPI.jsCache.getJSForModule(e),n=await sha512(s);if(n!==t.hash)return goosemodScope$3.showToast(`Cancelled importing of ${e} due to hash mismatch`,{timeout:2e3,type:"danger",subtext:"GooseMod Store"}),void console.warn("Hash mismatch",n,t.hash);await goosemodScope$3.importModule({name:e,data:s,metadata:t},o),o||(void 0!==goosemodScope$3.modules[e].goosemodHandlers.onLoadingFinished&&await goosemodScope$3.modules[e].goosemodHandlers.onLoadingFinished(),await goosemodScope$3.moduleSettingsStore.loadSavedModuleSetting(e));try{const e=goosemodScope$3.settings.items.find((e=>e[1]===goosemodScope$3.moduleStoreAPI.getSettingItemName(t)))[2].find((e=>e.subtext===t.description));e.buttonType="danger",e.buttonText=goosemodScope$3.i18n.discordStrings.REMOVE,e.showToggle=!0}catch(e){}if(document.querySelector("#gm-settings-inject")){const e=[...document.querySelectorAll(".title-31JmR4 + .colorStandard-2KCXvj")].filter((e=>e.textContent===t.description)).map((e=>e.parentElement));if(0===e.length)return;for(const o of e){const e=o.querySelector(".colorBrand-3pXr91");e.className=e.className.replace("lookFilled-1Gx00P colorBrand-3pXr91","lookOutlined-3sRXeN colorRed-1TFJan"),e.textContent=goosemodScope$3.i18n.discordStrings.REMOVE;o.querySelector(".container-3auIfb").classList.remove("hide-toggle")}}}catch(o){goosemodScope$3.showToast(`Failed to import module ${e}`,{timeout:2e3,type:"error",subtext:"GooseMod Store"}),console.error(o)}},moduleRemoved:e=>{let o=goosemodScope$3.settings.items.find((o=>o[1]===goosemodScope$3.moduleStoreAPI.getSettingItemName(e)))[2].find((o=>o.subtext===e.description));if(void 0!==o&&(o.buttonType="brand",o.buttonText=goosemodScope$3.i18n.goosemodStrings.moduleStore.card.button.import,o.showToggle=!1,document.querySelector("#gm-settings-inject"))){const o=[...document.querySelectorAll(".title-31JmR4 + .colorStandard-2KCXvj")].filter((o=>o.textContent===e.description)).map((e=>e.parentElement));if(0===o.length)return;for(const e of o){const o=e.querySelector(".colorRed-1TFJan");o.className=o.className.replace("lookOutlined-3sRXeN colorRed-1TFJan","lookFilled-1Gx00P colorBrand-3pXr91"),o.textContent=goosemodScope$3.i18n.goosemodStrings.moduleStore.card.button.import;e.querySelector(".container-3auIfb").classList.add("hide-toggle")}}},parseAuthors:async e=>{let o=[];return"string"==typeof e?o=e.split(", "):Array.isArray(e)&&(o=e),(await Promise.all(o.map((async(e,o)=>{if("object"==typeof e){const t=`<img style="display: inline; border-radius: 50%; margin-right: 5px; vertical-align: bottom;" src="https://cdn.discordapp.com/avatars/${e.i}/${e.a}.png?size=32">`,s=`<span class="author" style="cursor: pointer; line-height: 32px;" onmouseover="this.style.color = '#ccc'" onmouseout="this.style.color = '#fff'" onclick="try { window.goosemod.webpackModules.findByProps('open', 'fetchMutualFriends').open('${e.i}') } catch (e) { }">${e.n}</span>`;return o>1?t:t+s}if(e.match(/^[0-9]{17,18}$/)){const t=await getDataForID(e),s=`<img style="display: inline; border-radius: 50%; margin-right: 5px; vertical-align: bottom;" src="https://cdn.discordapp.com/avatars/${t.id}/${t.avatar}.png?size=32">`,n=`<span class="author" style="cursor: pointer; line-height: 32px;" onmouseover="this.style.color = '#ccc'" onmouseout="this.style.color = '#fff'" onclick="try { window.goosemod.webpackModules.findByProps('open', 'fetchMutualFriends').open('${t.id}') } catch (e) { }">${t.username}</span>`;return o>1?s:s+n}let t=e.match(/(.*) \(([0-9]{17,18})\)/);return null===t?`<span class="author">${e}</span>`:`<span class="author" style="cursor: pointer;" onmouseover="this.style.color = '#ccc'" onmouseout="this.style.color = '#fff'" onclick="try { window.goosemod.webpackModules.findByProps('open', 'fetchMutualFriends').open('${t[2]}') } catch (e) { }">${t[1]}</span>`})))).join('<span class="description-3_Ncsb">,</span> ')},updateStoreSetting:async()=>{let e=goosemodScope$3.settings.items.filter((e=>e[1]===goosemodScope$3.i18n.goosemodStrings.settings.itemNames.plugins||e[1]===goosemodScope$3.i18n.goosemodStrings.settings.itemNames.themes));for(const o of e)o[2]=o[2].filter((e=>"card"!==e.type));for(const o of goosemodScope$3.moduleStoreAPI.modules){const t=goosemodScope$3.moduleStoreAPI.getSettingItemName(o),s=e.find((e=>e[1]===t)),n=o.tags.includes("theme")?"themes":"plugins";s[2].push({type:"card",tags:o.tags,github:o.github,images:o.images?.map((e=>{if(e.startsWith("/")){e=o.repo.split("/").slice(0,-1).join("/")+e}return e})),lastUpdated:o.lastUpdated,buttonType:goosemodScope$3.modules[o.name]||goosemodScope$3.disabledModules[o.name]?"danger":"brand",showToggle:goosemodScope$3.modules[o.name]||goosemodScope$3.disabledModules[o.name],name:o.name,author:await goosemodScope$3.moduleStoreAPI.parseAuthors(o.authors),subtext:o.description,subtext2:"0"===o.version||o.version.toLowerCase().includes("auto")?"":`v${o.version}`,buttonText:goosemodScope$3.modules[o.name]||goosemodScope$3.disabledModules[o.name]?goosemodScope$3.i18n.discordStrings.REMOVE:goosemodScope$3.i18n.goosemodStrings.moduleStore.card.button.import,onclick:async()=>{if(goosemodScope$3.settings[`regen${n}`]=!0,goosemodScope$3.modules[o.name]||goosemodScope$3.disabledModules[o.name])goosemodScope$3.settings.removeModuleUI(o.name,t);else{if(o.dependencies&&o.dependencies.length>0){const e=1===o.dependencies.length?"dependency":"dependencies";if(!await goosemod.confirmDialog("Continue",`${o.name} has ${1===o.dependencies.length?"a ":""}${e}`,`**${o.name}** has **${o.dependencies.length}** ${e}:\n${o.dependencies.map((e=>` - **${e}**\n`))}\nTo continue importing this module the dependencies need to be imported.`,void 0,"brand"))return;for(const e of o.dependencies)await goosemodScope$3.moduleStoreAPI.importModule(e)}await goosemodScope$3.moduleStoreAPI.importModule(o.name)}},isToggled:()=>void 0===goosemodScope$3.disabledModules[o.name],onToggle:async e=>{if(goosemodScope$3.settings.ignoreVisualToggle)delete goosemodScope$3.settings.ignoreVisualToggle;else if(goosemodScope$3.settings[`regen${n}`]=!0,e?(goosemodScope$3.modules[o.name]=Object.assign({},goosemodScope$3.disabledModules[o.name]),delete goosemodScope$3.disabledModules[o.name],await goosemodScope$3.modules[o.name].goosemodHandlers.onImport(),void 0!==goosemodScope$3.modules[o.name].goosemodHandlers.onLoadingFinished&&await goosemodScope$3.modules[o.name].goosemodHandlers.onLoadingFinished(),await goosemodScope$3.moduleSettingsStore.loadSavedModuleSetting(o.name),goosemodScope$3.moduleSettingsStore.enableModule(o.name)):(goosemodScope$3.disabledModules[o.name]=Object.assign({},goosemodScope$3.modules[o.name]),await goosemodScope$3.modules[o.name].goosemodHandlers.onRemove(),delete goosemodScope$3.modules[o.name],goosemodScope$3.moduleSettingsStore.disableModule(o.name)),document.querySelector("#gm-settings-inject")){const e=[...document.querySelectorAll(".title-31JmR4 + .colorStandard-2KCXvj")].filter((e=>e.textContent===o.description)).map((e=>e.parentElement));if(0===e.length)return;for(const o of e){goosemodScope$3.settings.ignoreVisualToggle=!0;o.querySelector(".input-rwLH4i").click()}}}})}},verifyPgp:async e=>{const o=o=>{const t={result:o,trustState:"verified"!==o&&e.oncePgp||"invalid_signature"===o||"no_signature"===o?"untrusted":"verified"===o?"trusted":"unknown",when:Date.now()},s=goosemodScope$3.moduleStoreAPI.repos.find((o=>o.url===e.url));return s?(s.pgp=t,"verified"===o&&(s.oncePgp=!0),goosemod.logger.debug("pgp.save",s),goosemod.storage.set("goosemodRepos",JSON.stringify(goosemodScope$3.moduleStoreAPI.repos)),s.pgp):t};goosemod.logger.debug("pgp","verifying repo:",e.meta.name);const t=async e=>{const o=await fetch(e+"?_="+Date.now());return!!o.ok&&await o.text()},s=await t(`https://goosemod.github.io/Keyserver/repos/${e.meta.name}.gpg`);if(!s)return goosemod.logger.debug("pgp","no public key, aborting"),o("no_public_key");const n=await t(e.url+".sig");if(!n)return goosemod.logger.debug("pgp","no signature, aborting"),o("no_signature");const a=e.resp||await t(e.url);return o(await verifySignature(s,n,a)?"verified":"invalid_signature")}};let goosemodScope$2={};const setThisScope$2=e=>{goosemodScope$2=e},getCache=()=>JSON.parse(goosemod.storage.get("goosemodi18nCache")||"{}"),purgeCache=()=>goosemod.storage.remove("goosemodi18nCache"),updateCache=(e,o,t)=>{let s=getCache();s[e]={hash:o,goosemodStrings:t},goosemod.storage.set("goosemodi18nCache",JSON.stringify(s))},geti18nData$1=async e=>{const o=getCache();if(o[e])return o[e].goosemodStrings;{const o=await goosemodScope$2.i18n.geti18nData(e),t=await sha512(JSON.stringify(o));return updateCache(e,t,o),o}};var Cache={__proto__:null,setThisScope:setThisScope$2,getCache:getCache,purgeCache:purgeCache,updateCache:updateCache,geti18nData:geti18nData$1};const cache=Cache;let goosemodScope$1={},forced=!1,goosemodStrings,discordStrings;const setThisScope$1=e=>{setThisScope$2(e),goosemodScope$1=e,goosemodScope$1.i18nCheckNewLangInterval=setInterval(checkForNewLang,1e3)},getDiscordLang=()=>goosemodScope$1.webpackModules.findByProps("getLocaleInfo").getLocaleInfo();let lastLangCode;const checkForNewLang=async()=>{if(forced)return;const{code:e}=getDiscordLang();e!==lastLangCode&&await updateExports(e)},updateExports=async e=>{lastLangCode=e,goosemodStrings=await geti18nData$1(e);const o=goosemodScope$1.webpackModules.findByProps("getLocaleInfo"),t=o._proxyContext||o._provider._context;discordStrings={...t.defaultMessages,...t.messages}},geti18nData=async(e=getDiscordLang().code)=>{let o;try{o=await(await fetch(`https://raw.githubusercontent.com/GooseMod/i18n/main/langs/${e}.json`)).json()}catch(t){e="en-US",console.log(`Failed to get GooseMod i18n data, falling back to ${e}`,t),o=await(await fetch(`https://raw.githubusercontent.com/GooseMod/i18n/main/langs/${e}.json`)).json()}return o},forceLang=async e=>{if("Unspecified"===e)return forced=!1,void await checkForNewLang();forced=!0,await updateExports(e)};var i18n={__proto__:null,cache:cache,get forced(){return forced},get goosemodStrings(){return goosemodStrings},get discordStrings(){return discordStrings},setThisScope:setThisScope$1,checkForNewLang:checkForNewLang,updateExports:updateExports,geti18nData:geti18nData,forceLang:forceLang};let css="",toSaveNext=!1;const init$2=()=>{injectHooks(),setInterval((()=>{toSaveNext&&(toSaveNext=!1,save())}),1e4)},save=()=>{[...document.body.classList].forEach((e=>{css=css.replace(new RegExp(`body.${e}`,"g"),"body")})),goosemod.storage.set("goosemodCSSCache",css),goosemod.showToast("Saved",{subtext:"CSS Cache",type:"debuginfo"})},injectHooks=()=>{const e=()=>toSaveNext=!0,o=CSSStyleSheet.prototype.insertRule,t=Node.prototype.appendChild;CSSStyleSheet.prototype.insertRule=function(t){o.apply(this,arguments),t.includes("body.")&&(css+=t,e())};const s=[document.body,document.head],n=o=>{o.appendChild=function(o){if(t.apply(this,arguments),"STYLE"===o.tagName){if(o.id.startsWith("ace"))return;n(o);for(const e of o.childNodes)css+=e.textContent;e()}o.data&&(css+=o.textContent,e())}};for(const e of s)n(e)},load=()=>{const e=document.createElement("style");e.id="gm-css-cache",e.appendChild(document.createTextNode(goosemod.storage.get("goosemodCSSCache")||"")),document.body.appendChild(e),goosemod.showToast("Loaded",{subtext:"CSS Cache",type:"debuginfo"}),init$2()},removeStyle=()=>{const e=document.getElementById("gm-css-cache");e&&e.remove()};var CSSCache={__proto__:null,init:init$2,load:load,removeStyle:removeStyle};let goosemodScope={},unpatchers=[],cssEl;const setThisScope=e=>{goosemodScope=e,cssEl=document.createElement("style"),cssEl.textContent="\n/* Custom title replacing \"Server Boost\" */\n#gm-sponsor-modal .headerTitle-1_9Kor {\n background-image: url(https://goosemod.com/img/goose_gold.jpg);\n\n background-repeat: no-repeat;\n background-size: contain;\n background-position: 50%;\n\n border-radius: 50%;\n\n height: 60px;\n}\n\n#gm-sponsor-modal .headerTitle-1_9Kor::after {\n font-family: var(--font-display);\n font-size: 24px;\n\n color: var(--text-normal);\n\n width: 140px;\n display: block;\n\n margin-left: 70px;\n margin-top: 6px;\n\n content: 'GooseMod Sponsor';\n}\n\n#gm-sponsor-modal .guildBackground-3UtSZ2 > svg:first-child { /* Hide Lottie hands animation */\n display: none;\n}\n\n#gm-sponsor-modal .contentWrapper-3INYJy {\n padding: 16px;\n padding-right: 8px;\n}\n\n#gm-sponsor-modal .contentWrapper-3INYJy > div > div:not(:last-child) {\n margin-bottom: 32px;\n}\n\n#gm-sponsor-modal .contentWrapper-3INYJy > div > .footer-2gL1pp {\n left: -16px;\n top: 16px;\n width: calc(100% - 8px);\n}\n\n#gm-sponsor-modal .contentWrapper-3INYJy > div > div:first-child {\n font-family: var(--font-primary);\n font-size: 16px;\n line-height: 20px;\n\n color: var(--text-normal);\n}"},showSponsorModal=()=>{const{React:e}=goosemodScope.webpackModules.common,o=goosemodScope.webpackModules.findByDisplayName("PremiumFeaturesList"),t=goosemodScope.webpackModules.findByProps("roleIcon","profileBadgeIcon"),s=goosemodScope.webpackModules.findByDisplayName("PersonShield"),n=goosemodScope.webpackModules.findByProps("ModalFooter"),{Button:a}=goosemodScope.webpackModules.findByPropsAll("Button")[1],r=goosemodScope.webpackModules.findByProps("button","colorRed"),{PremiumGuildSubscriptionPurchaseModal:i}=goosemodScope.webpackModules.findByProps("PremiumGuildSubscriptionPurchaseModal"),d={default:i},l=(o,s="")=>()=>e.createElement("div",{style:{flexShrink:"0",marginRight:"10px",width:"24px",height:"24px"},className:t[o]},s);goosemodScope.patcher.patch(d,"default",(([{onClose:t}],i)=>(i.props.id="gm-sponsor-modal",i.props.children[1].props.children=[],i.props.children[1].props.children.unshift(e.createElement("div",{},e.createElement("div",{},"You can sponsor (donate regularly or one-time) GooseMod to help support it's development."),e.createElement(o,{columns:2,features:[{description:"Sponsor badge in GooseMod",overrideIcon:l("profileBadgeIcon")},{description:"Sponsor role in GooseNest Discord",overrideIcon:l("roleIcon",e.createElement(s,{width:"24px",height:"24px"}))}]}),e.createElement(n.ModalFooter,{},e.createElement(a,{color:r.colorBrand,type:"submit",onClick:()=>{window.open("https://github.com/sponsors/CanadaHonk"),t()}},"Sponsor"),e.createElement(a,{color:r.colorPrimary,look:r.lookLink,type:"button",onClick:()=>{t()}},"Close")))),i)));const{openModal:c}=goosemodScope.webpackModules.findByProps("openModal");c((o=>e.createElement(d.default,{...o})))},badgeUsers={sponsor:["506482395269169153","597905003717459968","405400327370571786","707309693449535599","302734867425132545","557429876618166283","250353310698176522","301088721984552961","700698485560705084","274209973196816385","274926795285987328","293094733159333889","202740603790819328","541210648982585354"],dev:["852884085021737001"],translator:["506482395269169153","394579914860396565","787017887877169173","274213297316691968","500656746440949761","326359466171826176","396360155480064003","169175121037099008","189079074054995969","302734867425132545","172866400900218881","751092600890458203","266001128318042113"]},addBadges=()=>{document.head.appendChild(cssEl),unpatchers.push(goosemodScope.patcher.userBadges.patch("GooseMod Sponsor","https://goosemod.com/img/goose_gold.jpg",(()=>goosemodScope.settings.gmSettings.get().gmBadges?badgeUsers.sponsor:[]),(()=>{showSponsorModal()}),{round:!0}),goosemodScope.patcher.userBadges.patch("GooseMod Translator","https://goosemod.com/img/goose_globe.png",(()=>goosemodScope.settings.gmSettings.get().gmBadges?badgeUsers.translator:[]),(()=>{}),{round:!0}),goosemodScope.patcher.userBadges.patch("GooseMod Developer","https://goosemod.com/img/goose_glitch.jpg",(()=>goosemodScope.settings.gmSettings.get().gmBadges?badgeUsers.dev:[]),(()=>{}),{round:!0}),goosemod.patcher.guildBadges.patch("GooseMod Official Discord","https://goosemod.com/img/logo.jpg",(()=>goosemodScope.settings.gmSettings.get().gmBadges?["756146058320674998"]:[]),(()=>{}),{round:!0}))},removeBadges=()=>{for(const e of unpatchers)e();cssEl.remove()};var GMBadges={__proto__:null,setThisScope:setThisScope,addBadges:addBadges,removeBadges:removeBadges};function getLocalStoragePropertyDescriptor(){const e=document.createElement("frame");e.src="about:blank",document.body.appendChild(e);let o=Object.getOwnPropertyDescriptor(e.contentWindow,"localStorage");return e.remove(),o}var fixLocalStorage=()=>{Object.defineProperty(window,"localStorage",getLocalStoragePropertyDescriptor())};const init$1=()=>{fixLocalStorage()},type$1="LocalStorage",set$1=(e,o)=>localStorage.setItem(e,o),get$1=e=>localStorage.getItem(e),remove$1=e=>localStorage.removeItem(e),keys$1=()=>Object.keys(localStorage);var impl_localstorage={__proto__:null,init:init$1,type:type$1,set:set$1,get:get$1,remove:remove$1,keys:keys$1};let storageCache={};const type="Extension";document.addEventListener("gmes_get_return",(({detail:e})=>{storageCache=e}),{once:!0}),document.dispatchEvent(new CustomEvent("gmes_get"));const set=(e,o)=>{storageCache[e]=o,document.dispatchEvent(new CustomEvent("gmes_set",{detail:{key:e,value:o}}))},get=e=>storageCache[e]||null,remove=e=>{delete storageCache[e],document.dispatchEvent(new CustomEvent("gmes_remove",{detail:{key:e}}))},keys=()=>Object.keys(storageCache);var impl_extension={__proto__:null,type:type,set:set,get:get,remove:remove,keys:keys};const impl=window.gmExtension?impl_extension:impl_localstorage;impl.init&&impl.init();var _Card=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByProps("Sizes","Colors","Looks","DropdownSizes"),t=goosemod.webpackModules.findByDisplayName("Switch"),s=goosemod.webpackModules.findByDisplayName("Markdown"),n=goosemod.webpackModules.findByDisplayName("FormText"),a=goosemod.webpackModules.findByProps("formText","placeholder"),r=goosemod.webpackModules.findByProps("title","dividerDefault"),i=goosemod.webpackModules.findByProps("openModal"),d=goosemod.webpackModules.findByDisplayName("SmallMediaCarousel"),l=goosemod.webpackModules.findByDisplayName("Discord");return class extends e.PureComponent{render(){return this.props.checked!==this.props.isToggled()&&(this.props.checked=this.props.isToggled()),e.createElement("div",{className:["gm-store-card",this.props.mini?"gm-store-card-mini":"",...this.props.tags.map((e=>e.replace(/ /g,"|")))].join(" "),onClick:this.props.onClick},e.createElement("div",{style:{backgroundImage:this.props.images?.length?`url("${this.props.images[0]}")`:""},onClick:()=>{this.props.images?.length&&i.openModal((()=>e.createElement("div",{className:"gm-carousel-modal"},e.createElement(d,{items:this.props.images.map((e=>({type:1,src:e}))),autoplayInterval:5e3}))))}},this.props.images?.length?"":"No Preview"),e.createElement("div",{className:[r.title,this.props.author.includes("avatar")?"":"no-pfp"].join(" "),ref:e=>{e&&(e.innerHTML=this.props.author)}}),e.createElement("div",{className:r.title},this.props.name),e.createElement(n,{className:this.props.name?a.description:""},e.createElement(s,{className:"gm-settings-note-markdown"},this.props.subtext)),e.createElement("div",{},this.props.github?e.createElement(n,{className:a.description},e.createElement("span",{},this.props.github.stars),e.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor"},e.createElement("path",{d:"M12 .587l3.668 7.568 8.332 1.151-6.064 5.828 1.48 8.279-7.416-3.967-7.417 3.967 1.481-8.279-6.064-5.828 8.332-1.151z"}))):e.createElement("div"),e.createElement(n,{className:a.description},this.props.subtext2)),e.createElement("div",{},e.createElement(o,{color:"danger"===this.props.buttonType?o.Colors.RED:o.Colors.BRAND,look:"danger"===this.props.buttonType?o.Looks.OUTLINED:o.Looks.FILLED,size:o.Sizes.SMALL,onClick:()=>{this.props.onclick()}},this.props.buttonText),this.props.github?e.createElement(o,{color:o.Colors.GREY,size:o.Sizes.SMALL,onClick:()=>{window.open(`https://github.com/${this.props.github.repo}`)}},e.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor"},e.createElement("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"}))):null,this.props.discordMessage?e.createElement(o,{color:o.Colors.GREY,size:o.Sizes.SMALL,onClick:()=>{const{transitionTo:e}=goosemod.webpackModules.findByProps("transitionTo"),{jumpToMessage:o}=goosemod.webpackModules.findByProps("jumpToMessage");e(`/channels/${this.props.discordMessage.guild}/${this.props.discordMessage.channel}`),o({channelId:this.props.discordMessage.channel,messageId:this.props.discordMessage.message,flash:!0})}},e.createElement(l,{width:"24",height:"24"})):null,e.createElement(t,{className:this.props.showToggle?"":"hide-toggle",checked:this.props.checked,disabled:!1,onChange:e=>{this.props.checked=!this.props.checked,this.forceUpdate(),this.props.onToggle(this.props.checked)}})))}}},card={__proto__:null,default:_Card},ProfileStoreInit=()=>{const{React:e,ReactDOM:o}=goosemod.webpackModules.common,t=goosemod.webpackModules.find((e=>"UserProfileModal"===e.default?.displayName)),s=goosemod.webpackModules.findByProps("auto","scrollerBase");goosemod.patcher.patch(t,"default",((t,n)=>{const a=goosemod.reactUtils.findInReactTree(n.props.children,(e=>e.props?.section));a&&goosemod.patcher.patch(a,"type",(([{user:{id:t}}],n)=>{const a=goosemod.moduleStoreAPI.modules.filter((e=>e.authors.some&&e.authors.some((e=>e.i===t))));if(0===a.length)return;const r=goosemod.settings.items.find((e=>e[1]===goosemod.i18n.goosemodStrings.settings.itemNames.themes))[2],i=goosemod.settings.items.find((e=>e[1]===goosemod.i18n.goosemodStrings.settings.itemNames.plugins))[2],d=a.filter((e=>e.tags.includes("theme"))),l=a.filter((e=>!e.tags.includes("theme"))),c=n.props.children,p=c.props.children[0],m=o=>e.createElement(_Card,{...o,mini:!0,onClick:async()=>{document.querySelector(".backdrop-1wrmKB").click();goosemod.webpackModules.findByProps("transitionTo").transitionTo("/channels/@me"),await sleep(200),document.getElementById("gm-home-"+(o.tags.includes("theme")?"themes":"plugins")).click(),await sleep(200);const e=[...document.querySelectorAll(".title-31JmR4 + .colorStandard-2KCXvj")].filter((e=>e.textContent===o.subtext)).pop().parentElement;document.querySelector("#gm-settings-inject").scrollTo({top:e.offsetTop-12,behavior:"smooth"}),e.style.boxShadow="0 0 12px 6px rgb(88 101 242 / 30%)"}});return goosemod.patcher.patch(c.props,"onItemSelect",(([t])=>{t.startsWith("GM_")&&setTimeout((()=>{const t=document.querySelector(".body-r6_QPy > :first-child");o.render(e.createElement("div",{className:[s.auto,"gm-modules-container"].join(" ")},...d.map((e=>r.find((o=>o.name===e.name)))).map((e=>m(e))),...l.map((e=>i.find((o=>o.name===e.name)))).map((e=>m(e)))),t)}),1)})),c.props.children.push(e.cloneElement(p,{id:"GM_MODULES"},"GooseMod Modules")),n}))}))};const scopeSetterFncs=[setThisScope$8,setThisScope$7,setThisScope$6,moduleStoreAPI.setThisScope,setThisScope$b,setThisScope$a,setThisScope$9,setThisScope$f,setThisScope$d,setThisScope$5,setThisScope$c,setThisScope$1,setThisScope],importsToAssign={startLoadingScreen:startLoadingScreen,stopLoadingScreen:stopLoadingScreen,updateLoadingScreen:updateLoadingScreen,settings:Settings,importModule:importModule,moduleSettingsStore:ModuleSettingsStore,webpackModules:WebpackModules,logger:Logger,showToast:showToast,confirmDialog:show$1,moduleStoreAPI:moduleStoreAPI,changelog:Changelog,goosemodChangelog:GoosemodChangelog,packModal:PackModal,patcher:Patcher,attrs:Attrs,reactUtils:ReactUtils,i18n:i18n,cssCache:CSSCache,gmBadges:GMBadges,ootb:OOTB,storage:impl},init=async function(){for(Object.assign(this,importsToAssign),this.cssCache.load();0===document.querySelectorAll('.flex-1xMQg5.flex-1O1GKY.horizontal-1ae9ci.horizontal-2EEEnY.flex-1O1GKY.directionRow-3v3tfG.justifyStart-2NDFzi.alignStretch-DpGPf3.noWrap-3jynv6 > [type="button"]:last-child').length||void 0===window.webpackJsonp;)await sleep(10);for(let e of scopeSetterFncs)await e(this);this.versioning={version:"11.1",hash:"48fd6879ba535cfa6b1eb64f68f093f5865cd471",lastUsedVersion:this.storage.get("goosemodLastVersion")},this.versioning.isDeveloperBuild="<hash>"===this.versioning.hash,this.storage.set("goosemodLastVersion",this.versioning.version),this.logger.debug("import.version.goosemod",`${this.versioning.version} (${this.versioning.hash})`),void 0!==window.DiscordNative&&this.logger.debug("import.version.discord",`${DiscordNative.app.getReleaseChannel()} ${DiscordNative.app.getVersion()}`),window.gmUntethered&&(this.untetheredVersion=window.gmUntethered.slice()),this.versioning.lastUsedVersion&&this.versioning.version!==this.versioning.lastUsedVersion&&this.goosemodChangelog.show(),this.startLoadingScreen(),this.updateLoadingScreen("Getting i18n data..."),await this.i18n.checkForNewLang(),this.updateLoadingScreen("Initialising internals...");let e=Object.keys(JSON.parse(this.storage.get("goosemodModules"))||{}),o=Object.keys(JSON.parse(this.storage.get("goosemodDisabled"))||{});this.modules=e.filter((e=>-1===o.indexOf(e))).reduce(((e,o)=>(e[o]={goosemodHandlers:{}},e)),{}),this.disabledModules=e.filter((e=>-1!==o.indexOf(e))).reduce(((e,o)=>(e[o]={goosemodHandlers:{}},e)),{}),this.moduleStoreAPI.modules=JSON.parse(this.storage.get("goosemodCachedModules"))||[],this.moduleStoreAPI.modules.cached=!0,this.settings.makeGooseModSettings(),await this.moduleStoreAPI.initRepos(),this.removed=!1,this.storage.get("goosemodCachedModules")||await this.moduleStoreAPI.updateModules(!0);let t=!1;0===e.length&&(t=!0),e=e.filter((e=>void 0!==this.moduleStoreAPI.modules.find((o=>o.name===e))));let s=e.find((e=>e.toLowerCase().includes("theme")));s&&e.unshift(e.splice(e.indexOf(s),1)[0]);let n=e.find((e=>"Hardcoded Color Fixer"===e));n&&e.unshift(e.splice(e.indexOf(n),1)[0]),t&&(e=["Fucklytics","Custom CSS"]),this.updateLoadingScreen("Importing modules from Store...");const a=[];for(let t of e)a.push(this.moduleStoreAPI.importModule(t,o.includes(t)));if(await Promise.all(a),this.cssCache.removeStyle(),this.settings.gmSettings.get().gmBadges&&this.gmBadges.addBadges(),this.settings.gmSettings.get().attrs&&this.attrs.patch(),this.saveInterval=setInterval((()=>{this.moduleSettingsStore.saveModuleSettings()}),3e3),this.remove=()=>{this.settingsUninjects.forEach((e=>e())),clearInterval(this.saveInterval),clearInterval(this.i18nCheckNewLangInterval),clearInterval(this.hotupdateInterval),this.storage.keys().filter((e=>e.toLowerCase().startsWith("goosemod"))).forEach((e=>this.storage.remove(e))),this.removed=!0;for(let e in this.modules)if(this.modules.hasOwnProperty(e)&&void 0!==this.modules[e].goosemodHandlers.onRemove)try{this.modules[e].goosemodHandlers.onRemove()}catch(e){}},this.moduleStoreAPI.hotupdate(!0),this.hotupdateInterval=setInterval((()=>{this.settings.gmSettings.get().autoupdate&&this.moduleStoreAPI.hotupdate()}),36e5),this.stopLoadingScreen(),this.settings.isSettingsOpen()&&this.settings.reopenSettings(),!this.storage.get("goosemodOOTB")){for(await sleep(1e3);document.querySelector(".modal-3O0aXp");)await sleep(100);this.ootb.start(),this.storage.set("goosemodOOTB",!0)}ProfileStoreInit()};window.goosemod={},init.bind(window.goosemod)();var modulesPreview=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("DiscoverStaticGuildCard"),t=e=>e.images?.map((o=>{if(o.startsWith("/")){o=e.repo.split("/").slice(0,-1).join("/")+o}return o}));return class extends e.PureComponent{render(){return setTimeout((()=>{try{const e=document.querySelectorAll(".discoverPreview-3q1szX .splashImage-352DQ1");e[e.length-3].src=t(this.props.modules[1])[0],e[e.length-2].src=t(this.props.modules[0])[0],e[e.length-1].src=t(this.props.modules[2])[0]}catch(e){}}),100),e.createElement("div",{className:"discoverPreview-3q1szX gm-modules-preview"},e.createElement(o,{className:"placeholderCard-3Zu1qO",disabled:!0,small:!0,loading:!1,guild:{banner:null,splash:null,discoverySplash:null,icon:null,id:null,memberCount:null,presenceCount:null,...this.props.modules[1]}}),e.createElement(o,{className:"placeholderCard-3Zu1qO",guild:{banner:null,splash:null,discoverySplash:null,icon:null,id:null,memberCount:null,presenceCount:null,...this.props.modules[0]}}),e.createElement(o,{className:"placeholderCard-3Zu1qO",disabled:!0,small:!0,loading:!1,guild:{banner:null,splash:null,discoverySplash:null,icon:null,id:null,memberCount:null,presenceCount:null,...this.props.modules[2]}}))}}},modulesPreview$1={__proto__:null,default:modulesPreview},openReposModal=async()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("SwitchItem");class t extends e.Component{constructor(e){const o=e.onChange;e.onChange=e=>{o(e),this.props.value=e,this.forceUpdate()},super(e)}render(){return e.createElement("div",{},e.createElement(r,{style:{width:"92px",position:"absolute",right:"10px",marginTop:"33px"},color:i.colorRed,size:i.sizeSmall,onClick:this.props.buttonOnClick},goosemod.i18n.discordStrings.REMOVE),e.createElement(o,{...this.props}))}}let s;const n=async()=>{await goosemod.moduleStoreAPI.updateModules(),await goosemod.moduleStoreAPI.updateStoreSetting(),document.querySelector(".selected-aXhQR6").click()},a=async()=>{s(),await n(),b()},{Button:r}=goosemod.webpackModules.findByProps("Button"),i=goosemod.webpackModules.findByProps("button","colorRed"),d=goosemod.webpackModules.findByProps("ModalRoot"),l=goosemod.webpackModules.findByProps("socialLink","date"),c=goosemod.webpackModules.findByDisplayName("Header"),p=goosemod.webpackModules.findByDisplayName("Text"),{openModal:m}=goosemod.webpackModules.findByProps("openModal"),g=goosemod.webpackModules.findByDisplayName("Flex"),u=goosemod.webpackModules.findByDisplayName("TextInput"),h=goosemod.webpackModules.findByDisplayName("Tooltip"),S=goosemod.webpackModules.findByDisplayName("FlowerStar"),f=goosemod.webpackModules.findByDisplayName("Verified"),y=goosemod.webpackModules.findAll((e=>"Alert"===e.displayName)).pop(),b=()=>{const o=[];let b=0;for(const s of goosemod.moduleStoreAPI.repos){const r=[s.meta.name];if(s.pgp?.trustState){let o="",t=null;switch(s.pgp.trustState){case"trusted":o="PGP Verified",t=e.createElement(f,{className:"icon-1ihkOt"});break;case"untrusted":o="PGP Untrusted",t=e.createElement(y,{className:"icon-1ihkOt"});break;case"unknown":o="No PGP",t=e.createElement(y,{className:"icon-1ihkOt"})}r.unshift(e.createElement("span",{style:{display:"inline-flex",position:"relative",top:"2px",marginRight:"4px"}},e.createElement(h,{position:"top",color:"primary",text:o},(({onMouseLeave:s,onMouseEnter:n})=>e.createElement(S,{className:`gm-repos-modal-icon-${t.type.displayName}`,"aria-label":o,onMouseEnter:n,onMouseLeave:s},t)))))}o.push(e.createElement(t,{style:{marginTop:0===b?"16px":""},note:s.meta.description,value:s.enabled,onChange:e=>{s.enabled=e,n()},buttonOnClick:async()=>{goosemod.moduleStoreAPI.repos.splice(goosemod.moduleStoreAPI.repos.indexOf(s),1),a()}},...r)),b++}let w="";m((t=>(s=t.onClose,e.createElement(d.ModalRoot,{transitionState:t.transitionState,size:"medium"},e.createElement(d.ModalHeader,{},e.createElement(g.Child,{basis:"auto",grow:1,shrink:1,wrap:!1},e.createElement(c,{tag:"h2",size:c.Sizes.SIZE_20},goosemod.i18n.goosemodStrings.moduleStore.repos.repos),e.createElement(p,{size:p.Sizes.SIZE_12,className:l.date},goosemod.moduleStoreAPI.modules.filter((e=>e.tags.includes("theme"))).length," Themes",", ",goosemod.moduleStoreAPI.modules.filter((e=>!e.tags.includes("theme"))).length," Plugins",", ",Object.keys(goosemod.moduleStoreAPI.modules.reduce(((e,o)=>{let t=o.authors;return t.forEach||(t=[t]),t.forEach((o=>e[o.n||o.match(/(.*) \(([0-9]{17,18})\)/)?.[1]||o]=!0)),e}),{})).length," Developers")),e.createElement("FlexChild",{basis:"auto",grow:0,shrink:1,wrap:!1},e.createElement(d.ModalCloseButton,{onClick:t.onClose}))),e.createElement(d.ModalContent,{},...o,e.createElement(g,{style:{marginBottom:"16px"},basis:"auto",grow:1,shrink:1},e.createElement(u,{className:"codeRedemptionInput-3JOJea",placeholder:"https://example.com/modules.json",onChange:e=>{w=e}}),e.createElement(r,{style:{width:"112px"},size:i.sizeMedium,onClick:async()=>{let e={};try{e=await(await fetch(w)).json()}catch(e){}if(void 0===e.meta?.name)return void goosemod.showToast("Invalid Repo",{type:"error",timeout:5e3,subtext:"GooseMod Store"});if(!confirm("External repos pose security risks as they are not controlled by GooseMod developers. We are not responsible for any dangers because of external repos added by users.\n\nIf you do not trust the owner of this repo do not use it as it could compromise your Discord install.\n\nPlease confirm adding this repo by pressing OK."))return void goosemod.showToast("Cancelled Adding Repo",{type:"danger",timeout:5e3,subtext:"Refused Security Prompt"});const o={url:w,meta:e.meta,enabled:!0},t=await goosemod.moduleStoreAPI.verifyPgp(o,!1);"untrusted"!==t.trustState?"trusted"===t.trustState||confirm("This repo is not known or trusted (no PGP verification), please be extra careful. Make sure you trust the owner(s) of this repo completely.\n\nTo solve this issue ask the repo maintainer to add PGP support.\n\nPlease reconfirm adding this repo by pressing OK.")?(goosemod.moduleStoreAPI.repos.push(o),a()):goosemod.showToast("Cancelled Adding Repo",{type:"danger",timeout:5e3,subtext:"Refused Security Prompt"}):goosemod.showToast("Cancelled Adding Repo",{type:"danger",timeout:5e3,subtext:"PGP Untrusted Failure"})}},goosemod.i18n.discordStrings.ADD)))))))};b()},header$2=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByProps("headerBarContainer","pageContent"),t=goosemod.webpackModules.findByProps("updateAvailable"),s=goosemod.webpackModules.findByProps("icon","iconBadge","title"),n=e.createElement(goosemod.webpackModules.findByDisplayName("Retry"),{width:24,height:24,className:s.icon}),a=e.createElement(goosemod.webpackModules.findByDisplayName("Cloud"),{width:24,height:24,className:s.icon}),r=goosemod.webpackModules.findByDisplayName("HeaderBarContainer"),i=goosemod.webpackModules.findByDisplayName("TabBar"),d=goosemod.webpackModules.findByProps("topPill"),l=goosemod.webpackModules.findByProps("tabBar","nowPlayingColumn"),c={themes:"STORE",plugins:"STORE"};return class extends e.PureComponent{constructor(e){super(e)}render(){return e.createElement(r,{className:o.headerBarContainer,isAuthenticated:!0,transparent:!1},e.createElement(r.Icon,{icon:()=>this.props.icon,className:s.icon}),e.createElement(r.Title,{},goosemod.i18n.goosemodStrings.settings.itemNames[this.props.title]||this.props.title[0].toUpperCase()+this.props.title.substring(1)),c[this.props.title]?e.createElement(r.Divider):null,c[this.props.title]?e.createElement(i,{selectedItem:c[this.props.title],type:d.topPill,className:l.tabBar,onItemSelect:e=>{c[this.props.title]=e,this.forceUpdate(),setTimeout(goosemod.settings.updateModuleStoreUI,10)}},e.createElement(i.Item,{id:"STORE",look:0,className:l.item},"Store"),e.createElement(i.Item,{id:"IMPORTED",look:0,className:l.item},"Imported")):null,"snippets"!==this.props.title?e.createElement("div",{className:s.toolbar,style:{position:"absolute",right:"0px"}},e.createElement(r.Icon,{icon:()=>n,tooltip:goosemod.i18n.discordStrings.STAGE_DISCOVERY_REFRESH_ICON_LABEL,onClick:async()=>{document.querySelector(`.${s.toolbar} > [role="button"] > svg`).classList.add(t.updateAvailable),await goosemod.moduleStoreAPI.hotupdate(!0),document.querySelector(".selected-aXhQR6").click()}}),e.createElement(r.Icon,{icon:()=>a,tooltip:goosemod.i18n.goosemodStrings.moduleStore.repos.repos,onClick:openReposModal})):"")}}},header$3={__proto__:null,default:header$2},_Divider=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("FormDivider"),t=goosemod.webpackModules.findByProps("dividerDefault","titleDefault");return class extends e.PureComponent{render(){return e.createElement(o,{className:t.dividerDefault})}}},divider={__proto__:null,default:_Divider},header=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("FormTitle"),t=goosemod.webpackModules.findByProps("marginTop20","marginBottom20"),s=goosemod.webpackModules.findByDisplayName("Tooltip"),n=goosemod.webpackModules.findByDisplayName("Science");return class extends e.PureComponent{constructor(o){o.experimental&&(o.text=[e.createElement(s,{position:"top",color:"primary",text:"Experimental"},(({onMouseLeave:o,onMouseEnter:t})=>e.createElement(n,{width:18,height:18,className:"gm-settings-label-icon",onMouseLeave:o,onMouseEnter:t}))),e.createElement("span",{style:{verticalAlign:"unset"},className:"gm-settings-label-text"},o.text)]),o.id=`gm-settings-header-${Math.random().toString().substring(2)}`,o.collapsed=!1,super(o),this.props.handleCollapse=()=>{const e=[...document.querySelectorAll(`#${this.props.id} ~ *`)],o=e.slice(0,e.indexOf(e.find((e=>"H5"===e.tagName))));for(const e of o)e.style.display=this.props.collapsed?"none":""}}render(){return setTimeout(this.props.handleCollapse,100),e.createElement(o,{tag:"h5",className:(0!==this.props.i?t.marginTop20+" ":"")+t.marginBottom8,onClick:()=>{this.props.collapsed=!this.props.collapsed,this.props.handleCollapse(),this.forceUpdate()},id:this.props.id},this.props.text,e.createElement(goosemod.webpackModules.findByDisplayName("DropdownArrow"),{className:["gm-settings-header-collapser",this.props.collapsed?"collapsed":""].join(" "),width:22,height:22}))}}},header$1={__proto__:null,default:header},toggle=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("SwitchItem"),t=goosemod.webpackModules.findByDisplayName("Markdown"),s=goosemod.webpackModules.findByDisplayName("Tooltip"),n=goosemod.webpackModules.findByDisplayName("Science"),a=goosemod.webpackModules.findByDisplayName("InfoFilled");return class extends e.Component{constructor(o){const t=o.onToggle;o.onChange=e=>{this.props.value=e,this.forceUpdate(),t(e)},o.experimental&&(o.text=[e.createElement(s,{position:"top",color:"primary",text:"Experimental"},(({onMouseLeave:o,onMouseEnter:t})=>e.createElement(n,{width:22,height:22,className:"gm-settings-label-icon",onMouseLeave:o,onMouseEnter:t}))),e.createElement("span",{className:"gm-settings-label-text"},o.text)],o.subtext="**Experimental:** "+o.subtext),o.debug&&(o.text=[e.createElement(s,{position:"top",color:"primary",text:"Debug"},(({onMouseLeave:o,onMouseEnter:t})=>e.createElement(a,{width:22,height:22,className:"gm-settings-label-icon",onMouseLeave:o,onMouseEnter:t}))),e.createElement("span",{className:"gm-settings-label-text"},o.text)],o.subtext="**Debug:** "+o.subtext),super(o)}render(){return e.createElement(o,{value:this.props.isToggled(),note:e.createElement(t,{className:"gm-settings-note-markdown"},this.props.subtext||""),disabled:!!this.props.disabled&&this.props.disabled(),onChange:this.props.onChange},this.props.text)}}},toggle$1={__proto__:null,default:toggle},text=()=>{const e=_Divider(),{React:o}=goosemod.webpackModules.common,t=goosemod.webpackModules.findByDisplayName("FormItem"),s=goosemod.webpackModules.findByDisplayName("FormText"),n=goosemod.webpackModules.findByDisplayName("Flex"),a=goosemod.webpackModules.findByProps("marginTop20","marginBottom20"),r=goosemod.webpackModules.findByProps("title","dividerDefault"),i=goosemod.webpackModules.findByProps("formText","placeholder");return class extends o.PureComponent{render(){return o.createElement(t,{className:[n.Direction.VERTICAL,n.Justify.START,n.Align.STRETCH,n.Wrap.NO_WRAP,a.marginBottom20].join(" ")},o.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},o.createElement("div",{},o.createElement("div",{className:r.labelRow,style:{marginBottom:"4px"}},o.createElement("label",{class:r.title},this.props.text)),o.createElement(s,{className:i.description},this.props.subtext))),o.createElement(e))}}},text$1={__proto__:null,default:text},textAndButton=()=>{const{React:e}=goosemod.webpackModules.common,o=_Divider(),t=goosemod.webpackModules.findByProps("Sizes","Colors","Looks","DropdownSizes"),s=goosemod.webpackModules.findByDisplayName("Markdown"),n=goosemod.webpackModules.findByDisplayName("FormItem"),a=goosemod.webpackModules.findByDisplayName("FormText"),r=goosemod.webpackModules.findByDisplayName("Flex"),i=goosemod.webpackModules.findByProps("marginTop20","marginBottom20"),d=goosemod.webpackModules.findByProps("title","dividerDefault"),l=goosemod.webpackModules.findByProps("formText","placeholder");return class extends e.PureComponent{render(){return e.createElement(n,{className:[r.Direction.VERTICAL,r.Justify.START,r.Align.STRETCH,r.Wrap.NO_WRAP,i.marginBottom20].join(" ")},e.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},e.createElement("div",{},e.createElement("div",{className:d.labelRow,style:{marginBottom:"4px"}},e.createElement("label",{class:d.title},this.props.text)),e.createElement(a,{className:l.description},e.createElement(s,{className:"gm-settings-note-markdown"},this.props.subtext||""))),e.createElement(t,{color:this.props.danger?t.Colors.RED:t.Colors.BRAND,disabled:this.props.disabled,onClick:()=>this.props.onclick()},this.props.buttonText)),e.createElement(o))}}},textAndButton$1={__proto__:null,default:textAndButton},textAndColor=()=>{const{React:e,constants:{DEFAULT_ROLE_COLOR:o,ROLE_COLORS:t}}=goosemod.webpackModules.common,s=_Divider(),n=goosemod.webpackModules.findByDisplayName("FormItem"),a=goosemod.webpackModules.findByDisplayName("FormTitle"),r=goosemod.webpackModules.findByProps("marginTop20","marginBottom20"),i=goosemod.webpackModules.findByProps("defaultMarginh5");return class extends e.PureComponent{constructor(e){e.default=(e=>{if(e&&7===e.length)return parseInt(e.slice(1),16)})((e.initialValue||(()=>{}))())||0,e.value=e.default,super(e)}render(){const d=goosemod.webpackModules.find((e=>"ColorPicker"===e.default?.displayName));return e.createElement(n,{className:[r.marginBottom20].join(" ")},e.createElement(a,{tag:"h5",className:(0!==this.props.i?r.marginTop20+" ":"")+i.defaultMarginh5},this.props.text),e.createElement(d.default,{colors:t,defaultColor:this.props.default||o,disabled:!1,value:this.props.value,customColor:null,renderDefaultButton:o=>e.createElement(d.DefaultColorButton,o),renderCustomButton:o=>e.createElement(d.CustomColorButton,o),customPickerPosition:"bottom",onChange:e=>{var o;this.props.value=e,this.forceUpdate(),this.props.oninput("#"+((16711680&(o=e))>>>16).toString(16).padStart(2,"0")+((65280&o)>>>8).toString(16).padStart(2,"0")+(255&o).toString(16).padStart(2,"0"))}}),e.createElement(s))}}},textAndColor$1={__proto__:null,default:textAndColor},button=()=>{const{React:e}=goosemod.webpackModules.common;return goosemod.webpackModules.findByProps("Sizes","Colors","Looks","DropdownSizes"),class o extends e.PureComponent{render(){return e.createElement(o,{color:o.Colors.BRAND,size:o.Sizes.SMALL,disabled:this.props.disabled,onClick:()=>this.props.onclick()},this.props.text)}}},button$1={__proto__:null,default:button},search=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("SearchBar");return class extends e.PureComponent{render(){return this.props.text||(this.props.text=""),setTimeout((()=>{this.props.onchange(this.props.text)}),10),e.createElement(o,{...o.defaultProps,className:this.props.storeSpecific?"gm-store-search":"",size:o.Sizes.MEDIUM,query:this.props.text,placeholder:this.props.placeholder||"Search",onClear:()=>{this.props.text="",this.forceUpdate()},onChange:e=>{this.props.text=e,this.forceUpdate()}})}}},search$1={__proto__:null,default:search},dropdownIndividual=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("SelectTempWrapper"),t=goosemod.webpackModules.findByDisplayName("FormText"),s=goosemod.webpackModules.findByProps("formText","placeholder");return class extends e.PureComponent{render(){return"function"==typeof this.props.options&&(this.props.options=this.props.options()),this.props.value||(this.props.value=(this.props.selected||(()=>{}))()||this.props.options[0]),setTimeout((()=>{this.props.onchange(this.props.value)}),10),e.createElement("div",{className:"gm-inline-dropdown"},e.createElement(t,{className:s.description},this.props.label),e.createElement(o,{searchable:!1,onChange:e=>{this.props.value=e.value,this.forceUpdate()},value:this.props.value,options:this.props.options.map((e=>({label:e,value:e})))}))}}},dropdownIndividual$1={__proto__:null,default:dropdownIndividual},_StoreHeader=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("Text"),t=goosemod.webpackModules.findByProps("pageHeader");return class extends e.PureComponent{render(){return e.createElement("div",{className:[t.headerContainer,"gm-store-header"].join(" ")},e.createElement(o,{color:o.Colors.HEADER_PRIMARY,size:o.Sizes.SIZE_20,className:t.pageHeader},this.props.text))}}},storeHeader={__proto__:null,default:_StoreHeader},storeCategory=()=>{const{React:e}=goosemod.webpackModules.common,o=_StoreHeader(),t=_Card(),s=goosemod.webpackModules.findByProps("auto","scrollerBase");return class extends e.PureComponent{render(){return this.props.cards||(this.props.cards=goosemod.settings.items.find((e=>e[1]===this.props.itemName))[2].filter((e=>"card"===e.type)).sort(this.props.sort).slice(0,10).map((o=>e.createElement(t,o)))),e.createElement("div",{className:"gm-store-category"},e.createElement(o,{text:this.props.text}),e.createElement("div",{className:s.auto},...this.props.cards))}}},storeCategory$1={__proto__:null,default:storeCategory},custom=()=>{const{React:e}=goosemod.webpackModules.common;return class extends e.PureComponent{render(){return e.createElement("div",{ref:e=>{e&&e.appendChild("function"==typeof this.props.element?this.props.element():this.props.element)}})}}},custom$1={__proto__:null,default:custom},textInput=()=>{const{React:e}=goosemod.webpackModules.common,o=_Divider,t=goosemod.webpackModules.findByDisplayName("FormItem"),s=goosemod.webpackModules.findByDisplayName("FormText"),n=goosemod.webpackModules.findByDisplayName("TextInput"),a=goosemod.webpackModules.findByDisplayName("Flex"),r=goosemod.webpackModules.findByProps("marginTop20","marginBottom20"),i=goosemod.webpackModules.findByProps("formText","description");return class extends e.PureComponent{render(){return e.createElement(t,{title:this.props.text,className:[a.Direction.VERTICAL,a.Justify.START,a.Align.STRETCH,a.Wrap.NO_WRAP,r.marginBottom20].join(" ")},e.createElement(n,{onChange:e=>{this.props.oninput(e)},defaultValue:this.props.initialValue?this.props.initialValue():""}),this.props.subtext&&e.createElement(s,{className:[i.description,r.marginTop8].join(" ")},this.props.subtext),e.createElement(o))}}},textInput$1={__proto__:null,default:textInput},subtext=()=>{const{React:e}=goosemod.webpackModules.common,o=goosemod.webpackModules.findByDisplayName("FormText"),t=goosemod.webpackModules.findByDisplayName("Markdown"),s=goosemod.webpackModules.findByProps("marginTop20","marginBottom20");return class extends e.PureComponent{render(){return e.createElement(o,{type:"description",className:s.marginBottom20},e.createElement(t,{className:"gm-settings-note-markdown"},this.props.text||""))}}},subtext$1={__proto__:null,default:subtext}})();//# sourceURL=GooseMod |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment