This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,66 @@
// Metro module 6141 (f6142).
import AuthenticationStore from "../../stores/AuthenticationStore";
import PoggermodeSettingsStore from "./PoggermodeSettingsStore";
import PoggermodeStore from "./PoggermodeStore";
import Dispatcher from "../../Dispatcher";
import trackPoggermodeSettingsUpdated from "./trackPoggermodeSettingsUpdated";
export function updatePoggermodeSettings(a0) {
Dispatcher.dispatch({
type: "POGGERMODE_SETTINGS_UPDATE",
settings: a0
});
trackPoggermodeSettingsUpdated({
...PoggermodeSettingsStore.getState(),
...a0
});
}
export function updateCombo(a0) {
Dispatcher.dispatch({
type: "POGGERMODE_UPDATE_COMBO",
...a0
});
}
export function clearMessageCombo(a0) {
Dispatcher.dispatch({
type: "POGGERMODE_UPDATE_MESSAGE_COMBO",
comboMessage: {
...a0,
displayed: true
}
});
}
export function updateComboOnMessageSend(a0, a1) {
const id = AuthenticationStore.getId();
const userCombo = PoggermodeStore.getUserCombo(id, a0);
if (userCombo != null) {
Dispatcher.dispatch({
type: "POGGERMODE_UPDATE_MESSAGE_COMBO",
comboMessage: {
combo: userCombo,
channelId: a0,
messageId: a1,
displayed: false
}
});
}
const r21 = userCombo != null;
let multiplier = 1;
if (r21) {
const r25 = userCombo?.value > 0;
multiplier = 1;
if (r25) {
let r27 = userCombo?.multiplier;
if (r27 == null) {
r27 = 0;
}
multiplier = r27 + 1;
}
}
Dispatcher.dispatch({
type: "POGGERMODE_UPDATE_COMBO",
channelId: a0,
userId: id,
multiplier,
value: 0
});
}
@@ -0,0 +1,77 @@
// Metro module 5964 (f5965).
const r18 = {
CHAT_INPUT: 0,
0: "CHAT_INPUT",
REACTION: 1,
1: "REACTION",
MEMBER_USER: 2,
2: "MEMBER_USER",
CALL_TILE: 3,
3: "CALL_TILE"
};
const r23 = {
CHAT_INPUT: 0,
0: "CHAT_INPUT",
VOICE_USER: 1,
1: "VOICE_USER",
MENTION: 2,
2: "MENTION"
};
const r26 = {
LEVEL_1: 0,
0: "LEVEL_1",
LEVEL_2: 1,
1: "LEVEL_2",
LEVEL_3: 2,
2: "LEVEL_3",
LEVEL_4: 3,
3: "LEVEL_4",
LEVEL_5: 4,
4: "LEVEL_5"
};
const r13 = {};
r13[r26.LEVEL_1] = [[1, 0.0001], [25, 0.05], [50, 0.1], [100, 0.5], [250, 1], [500, 2], [1000, 3], [9001, 4]];
r13[r26.LEVEL_2] = [[1, 0.0001], [25, 0.25], [50, 0.5], [100, 1], [250, 2.5], [500, 5], [1000, 7.5], [9001, 10]];
r13[r26.LEVEL_3] = [[1, 0.001], [25, 0.5], [50, 1], [100, 2], [250, 4], [500, 8], [1000, 12], [9001, 16]];
r13[r26.LEVEL_4] = [[1, 0.25], [25, 0.75], [50, 1], [100, 2], [250, 4], [500, 8], [1000, 20], [9001, 50]];
r13[r26.LEVEL_5] = [[1, 0.001], [25, 0.5], [50, 1], [100, 2], [250, 5], [500, 10], [1000, 100], [9001, 10000]];
let c3754_0 = r13;
const r15 = Object.keys(c3754_0);
const r84 = {};
r84[r26.LEVEL_1] = [];
r84[r26.LEVEL_2] = [];
r84[r26.LEVEL_3] = [];
r84[r26.LEVEL_4] = [];
r84[r26.LEVEL_5] = [];
const r95 = r15.reduce((acc, a1) => {
const r1 = {
...acc
};
r1[a1] = c3754_0[a1].map((item) => {
const [r8] = item;
return r8;
});
return r1;
}, r84);
const r98 = Object.keys(c3754_0);
const r100 = {};
r100[r26.LEVEL_1] = [];
r100[r26.LEVEL_2] = [];
r100[r26.LEVEL_3] = [];
r100[r26.LEVEL_4] = [];
r100[r26.LEVEL_5] = [];
const r112 = r98.reduce((acc, a1) => {
const r1 = {
...acc
};
r1[a1] = c3754_0[a1].map((item) => {
const [, r13] = item;
return r13;
});
return r1;
}, r100);
export { r18 as ConfettiLocation };
export { r23 as ShakeLocation };
export { r26 as ShakeLevel };
export { r95 as SHAKE_STEPS };
export { r112 as SHAKE_STEP_DIVIDER };
@@ -0,0 +1,85 @@
// Metro module 5963 (f5964).
import * as _PoggermodeConstants from "./PoggermodeConstants";
import { cloneDeep } from "../../_bundle/Module12";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
const { ShakeLocation, ConfettiLocation } = _PoggermodeConstants;
let c3753_0 = false;
const screenshakeEnabledLocations2 = {};
screenshakeEnabledLocations2[ShakeLocation.CHAT_INPUT] = true;
screenshakeEnabledLocations2[ShakeLocation.VOICE_USER] = false;
screenshakeEnabledLocations2[ShakeLocation.MENTION] = false;
const confettiEnabledLocations = {};
confettiEnabledLocations[ConfettiLocation.CHAT_INPUT] = true;
confettiEnabledLocations[ConfettiLocation.REACTION] = true;
confettiEnabledLocations[ConfettiLocation.MEMBER_USER] = true;
confettiEnabledLocations[ConfettiLocation.CALL_TILE] = true;
const r26 = {
settingsVisible: false,
enabled: false,
combosEnabled: true,
combosRequiredCount: 5,
comboSoundsEnabled: true,
screenshakeEnabled: true,
screenshakeEnabledLocations: screenshakeEnabledLocations2,
shakeIntensity: 1,
confettiEnabled: true,
confettiEnabledLocations,
confettiSize: 16,
confettiCount: 5,
warningSeen: false
};
let c3753_1 = cloneDeep(r26);
class PoggermodeSettingsStore extends Module589.DeviceSettingsStore {
static displayName = "PoggermodeSettingsStore";
static persistKey = "PoggermodeSettingsStore";
initialize(a0) {
c3753_1 = {
...c3753_1,
...a0
};
}
getUserAgnosticState() {
return c3753_1;
}
get settingsVisible() {
return c3753_1.settingsVisible;
}
isEnabled(r1 = {}) {
const { confettiLocation, shakeLocation } = r1;
const r3 = confettiLocation == null || c3753_1.confettiEnabled && c3753_1.confettiEnabledLocations[confettiLocation];
const r11 = shakeLocation == null || c3753_1.screenshakeEnabled && c3753_1.screenshakeEnabledLocations[shakeLocation];
return this.settingsVisible && !c3753_0 && c3753_1.enabled && r3 && r11;
}
get shakeIntensity() {
return this.isEnabled() ? c3753_1.shakeIntensity : 0;
}
get combosRequiredCount() {
return this.isEnabled() ? c3753_1.combosRequiredCount : 0;
}
get screenshakeEnabled() {
return c3753_1.screenshakeEnabled;
}
get screenshakeEnabledLocations() {
return c3753_1.screenshakeEnabledLocations;
}
get combosEnabled() {
return c3753_1.combosEnabled;
}
get comboSoundsEnabled() {
return c3753_1.comboSoundsEnabled;
}
}
const poggermodeSettingsStore = new PoggermodeSettingsStore(Dispatcher, {
POGGERMODE_SETTINGS_UPDATE: function handlePoggermodeSettingsUpdate(a0) {
c3753_1 = {
...c3753_1,
...a0.settings
};
},
POGGERMODE_TEMPORARILY_DISABLED: function handlePoggermodeTemporarilyDisabled() {
c3753_0 = true;
}
});
export default poggermodeSettingsStore;
export { r26 as initialState };
+203
View File
@@ -0,0 +1,203 @@
// Metro module 6142 (f6143).
import AuthenticationStore from "../../stores/AuthenticationStore";
import SelectedChannelStore from "../../stores/SelectedChannelStore";
import PoggermodeSettingsStore from "./PoggermodeSettingsStore";
import { ShakeLevel, ShakeLocation } from "./PoggermodeConstants";
import { ComponentActions } from "../../Constants";
import { SecondaryIndexMap } from "../../_bundle/Module3813";
import { Interval } from "../../_bundle/Timeout";
import * as _PoggermodeUtils from "./PoggermodeUtils";
import { getComboShakeIntensity } from "./PoggermodeUtils";
import { ComponentDispatch } from "../../utils/ComponentDispatchUtils";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let c3884_8, c3884_9, c3884_10, c3884_12;
const updateCombo = function updateCombo(rest) {
const r1 = void 0 === void 0 ? true : void 0;
const r25 = c3884_9.get(`${rest.userId}-${rest.channelId}`);
let value = rest.value;
if (value == null) {
value = r25?.value;
}
if (value == null) {
value = 0;
}
const r16 = Math;
let multiplier = rest.multiplier;
if (multiplier == null) {
multiplier = r25?.multiplier;
}
if (multiplier == null) {
multiplier = 1;
}
const r26 = {
...r25,
...rest,
value,
multiplier: r16.min(multiplier, 7)
};
let decayInterval2 = r25?.decayInterval;
if (decayInterval2 == null) {
decayInterval2 = new Interval();
}
r26.decayInterval = decayInterval2;
let c15497_0 = r26;
c3884_9.set(`${rest.userId}-${rest.channelId}`, r26);
if (r1) {
const decayInterval = r26.decayInterval;
if (decayInterval != null) {
decayInterval.start(1000, () => {
L10: {
const r21 = c3884_9.get(`${c15497_0.userId}-${c15497_0.channelId}`);
if (r21 != null) {
const r2 = c15497_0.multiplier !== r21.multiplier && c15497_0.value !== r21.value;
if (!(r21.value <= 0) && !r2) {
updateCombo({
...r21,
value: r21.value - 1
});
c3884_12.emitChange();
break L10;
}
const decayInterval = r21.decayInterval;
if (decayInterval != null) {
decayInterval.stop();
}
if (r21.value <= 0) {
updateCombo({
...r21,
value: 0,
multiplier: 1
});
c3884_12.emitChange();
}
}
}
});
}
}
};
c3884_8 = new Set();
c3884_9 = new SecondaryIndexMap(function(a0) {
return [a0.userId, a0.channelId];
}, function(a0) {
return `${a0.channelId}-${a0.userId}`;
});
c3884_10 = new SecondaryIndexMap(function(a0) {
return [a0.messageId, a0.channelId, a0.combo.userId];
}, function(a0) {
return `${a0.channelId}-${a0.combo.userId}-${a0.messageId}`;
});
class PoggermodeStore extends Module589.Store {
static displayName = "PoggermodeStore";
initialize() {
this.waitFor(AuthenticationStore, PoggermodeSettingsStore, SelectedChannelStore);
}
getComboScore(a0, a1) {
const r12 = c3884_9.get(`${a0}-${a1}`);
return r12 == null ? 0 : _PoggermodeUtils.getComboScore(r12);
}
getUserCombo(a0, a1) {
return c3884_9.get(`${a0}-${a1}`);
}
isComboing(a0, a1) {
const userCombo = this.getUserCombo(a0, a1);
return userCombo != null && userCombo.value >= PoggermodeSettingsStore.combosRequiredCount && (userCombo != null && (userCombo.value > 0 || userCombo?.multiplier > 1));
}
getMessageCombo(a0) {
let r8 = c3884_10.get(a0)?.combo;
if (r8 == null) {
r8 = void 0;
}
return r8;
}
getMostRecentMessageCombo(a0) {
const r5 = c3884_10.values(a0);
return r5[r5.length - 1];
}
getUserComboShakeIntensity(a0, a1, a2, a3) {
const userCombo = this.getUserCombo(a0, a1);
return userCombo != null ? getComboShakeIntensity(userCombo, a3) * a2 : 0;
}
}
c3884_12 = new PoggermodeStore(Dispatcher, {
POGGERMODE_UPDATE_COMBO: function handleComboing(a0) {
a0.type;
const { type, ...rest } = a0;
if (PoggermodeSettingsStore.isEnabled()) {
updateCombo(rest);
return void 0;
}
return false;
},
POGGERMODE_UPDATE_MESSAGE_COMBO: function handleUpdateMessageCombo({ comboMessage }) {
if (PoggermodeSettingsStore.isEnabled()) {
c3884_10.set(comboMessage.messageId, comboMessage);
return void 0;
}
return false;
},
MESSAGE_CREATE: function handleIncomingMessage({ channelId, message }) {
let intensity;
let id;
const { mentions, author, nonce } = message;
id = void 0;
if (PoggermodeSettingsStore.isEnabled()) {
id = AuthenticationStore.getId();
let r25 = author?.id === id;
if (r25) {
let r1 = nonce != null && !c3884_8.has(nonce);
if (r1) {
c3884_8.add(nonce);
r1 = true;
}
r25 = r1;
}
if (r25) {
let r16 = author?.id;
if (r16 == null) {
r16 = "???";
}
const r39 = c3884_9.get(`${r16}-${channelId}`);
if (PoggermodeSettingsStore.screenshakeEnabled && PoggermodeSettingsStore.screenshakeEnabledLocations[ShakeLocation.MENTION] && mentions != null && mentions.find((mention) => mention.id === id) != null) {
if (r39 != null) {
let r60 = getComboShakeIntensity(r39, ShakeLevel.LEVEL_4);
if (r60 == null) {
r60 = 0.001;
}
intensity = r60;
} else {
intensity = 4 * Math.random();
}
ComponentDispatch.dispatch(ComponentActions.SHAKE_APP, {
duration: 1000,
intensity
});
return true;
}
return false;
}
return false;
}
return false;
}
});
export default c3884_12;
export function isComboing(a0) {
return a0 != null && (a0.value > 0 || a0?.multiplier > 1);
}
export function getComboId(a0) {
return `${a0.userId}-${a0.channelId}`;
}
export function shouldTrackMessage(a0, a1, a2, a3) {
let r1 = a0 === a1;
if (r1) {
let r7 = a2 != null && !a3.has(a2);
if (r7) {
a3.add(a2);
r7 = true;
}
r1 = r7;
}
return r1;
}
+140
View File
@@ -0,0 +1,140 @@
// Metro module 6143 (f6144).
import { SHAKE_STEPS, SHAKE_STEP_DIVIDER, ShakeLevel } from "./PoggermodeConstants";
import { unsafe_getRawColor } from "../../_bundle/Module711";
function $mk77795($env) {
return (a0, a1, a2) => {
const r3 = $env;
const r6 = r3[2];
if (r6 > a1) {
const r9 = r3[1];
const r10 = r9[a2];
const r8 = a2 + 1;
const r5 = r3[0];
if (r8 === r5.length) {
return r9[a2];
}
return (r6 - a1) / (r5[a2 + 1] - a1) * (r9[a2 + 1] - r10) + r10;
}
return r6 === a1 ? r3[1][a2] : a0;
};
}
let c3885_6;
const r17 = [[1, 0.001], [25, 0.3], [100, 0.5], [250, 0.8], [500, 0.9], [2500, 0.95], [9001, 1]];
let c3885_5 = r17.map((item) => {
const [r8] = item;
return r8;
});
c3885_6 = r17.map((item) => {
const [, r13] = item;
return r13;
});
export function getComboShakeIntensity(a0, r6 = ShakeLevel.LEVEL_3) {
let r23, r24;
let env15499;
const r28 = [SHAKE_STEPS[r6], SHAKE_STEP_DIVIDER[r6]];
const r29 = env15499 = {};
env15499[0] = void 0;
env15499[1] = void 0;
const { multiplier, value } = a0;
let r32 = r28[Symbol.iterator]();
const next = r32.next;
const r9 = r32 === void 0 ? void 0 : (r23 = next.call(r32)).done ? r32 = void 0 : r23.value;
let r1 = r32 === void 0;
const r36 = r1 ? void 0 : r9;
env15499[0] = r36;
let r37 = void 0;
if (!r1) {
const r38 = r32 === void 0 ? void 0 : (r24 = next.call(r32)).done ? r32 = void 0 : r24.value;
const r3 = r32 === void 0;
r37 = void 0;
r1 = r3;
if (!r3) {
r37 = r38;
r1 = r3;
}
}
env15499[1] = r37;
if (!r1 && r32 !== void 0 && typeof r32.return === "function") {
r32.return();
}
env15499[2] = void 0;
const r39 = value * multiplier;
env15499[2] = r39;
return r39 <= 0 ? 0 : Math.min(100000, r36.reduce($mk77795(r29), 0));
}
export function getComboPercentage(a0) {
let r23, r24;
const r5 = [c3885_5, c3885_6];
const { multiplier, value } = a0;
let r8 = r5[Symbol.iterator]();
const next = r8.next;
const r30 = r8 === void 0 ? void 0 : (r23 = next.call(r8)).done ? r8 = void 0 : r23.value;
let r1 = r8 === void 0;
const r32 = r1 ? void 0 : r30;
let env15500;
const r33 = env15500 = {};
env15500[0] = r32;
let r9 = void 0;
if (!r1) {
const r34 = r8 === void 0 ? void 0 : (r24 = next.call(r8)).done ? r8 = void 0 : r24.value;
const r3 = r8 === void 0;
r9 = void 0;
r1 = r3;
if (!r3) {
r9 = r34;
r1 = r3;
}
}
env15500[1] = r9;
if (!r1 && r8 !== void 0 && typeof r8.return === "function") {
r8.return();
}
env15500[2] = void 0;
const r35 = value * multiplier;
env15500[2] = r35;
return r35 <= 0 ? 0 : Math.min(1, r32.reduce($mk77795(r33), 0));
}
export function getComboStyles(a0) {
let r17;
L14: {
if (a0 === 1) {
r17 = {
color: unsafe_getRawColor("BRAND_500")
};
} else {
if (a0 !== 2 && a0 !== 3) {
if (a0 !== 4 && a0 !== 5) {
if (a0 === 6) {
r17 = {
color: unsafe_getRawColor("RED_400"),
square: true
};
break L14;
}
r17 = {
color: unsafe_getRawColor("ORANGE_345"),
flair: true
};
break L14;
}
r17 = {
color: unsafe_getRawColor("YELLOW_300"),
square: true
};
break L14;
}
r17 = {
color: unsafe_getRawColor("GREEN_360")
};
}
}
return r17;
}
export function getComboScore(a0) {
const value = a0.value;
let multiplier = a0.multiplier;
if (multiplier == null) {
multiplier = 1;
}
return value * multiplier;
}
@@ -0,0 +1,67 @@
// Metro module 6144 (f6145).
import { ConfettiLocation, ShakeLocation } from "./PoggermodeConstants";
import { AnalyticEvents } from "../../Constants";
import Module12 from "../../_bundle/Module12";
import AnalyticsUtils from "../../utils/AnalyticsUtils";
function $mk77796() {
return (a0) => {
const [, r13] = a0;
return r13;
};
}
function $mk77797($env) {
return (a0) => {
const [r5] = a0;
return (0, $env[0])(Number.parseInt(r5));
};
}
let getConfettiLocationName;
const getScreenshakeLocationName = function getScreenshakeLocationName(a0) {
if (ShakeLocation.CHAT_INPUT === a0) {
return "chat_input";
}
if (ShakeLocation.MENTION === a0) {
return "mention";
}
if (ShakeLocation.VOICE_USER === a0) {
return "voice_user";
}
};
getConfettiLocationName = function getConfettiLocationName(a0) {
if (ConfettiLocation.CHAT_INPUT === a0) {
return "chat_input";
}
if (ConfettiLocation.MEMBER_USER === a0) {
return "member_user";
}
if (ConfettiLocation.REACTION === a0) {
return "reaction";
}
if (ConfettiLocation.CALL_TILE === a0) {
return "call_tile";
}
};
const r26 = Module12.throttle(({ enabled, combosEnabled, combosRequiredCount, screenshakeEnabled, shakeIntensity, screenshakeEnabledLocations, confettiEnabled, confettiSize, confettiCount, confettiEnabledLocations }) => {
let env15501;
let env15502;
const POGGERMODE_SETTINGS_UPDATED = AnalyticEvents.POGGERMODE_SETTINGS_UPDATED;
const r22 = env15501 = {};
env15501[0] = getScreenshakeLocationName;
const r20 = {
enabled,
combos_enabled: combosEnabled,
combos_required_count: combosRequiredCount,
screenshake_enabled: screenshakeEnabled,
shake_intensity: shakeIntensity,
screenshake_enabled_locations: Object.entries(screenshakeEnabledLocations).filter($mk77796()).map($mk77797(r22)),
confetti_enabled: confettiEnabled,
confetti_size: confettiSize,
confetti_count: confettiCount,
confetti_enabled_locations: null
};
const r34 = env15502 = {};
env15502[0] = getConfettiLocationName;
r20.confetti_enabled_locations = Object.entries(confettiEnabledLocations).filter($mk77796()).map($mk77797(r34));
AnalyticsUtils.track(POGGERMODE_SETTINGS_UPDATED, r20);
}, 5000);
export default r26;