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,4 @@
// Metro module 4070 (f4071).
import { createContext } from "react";
const context = createContext(void 0);
export default context;
@@ -0,0 +1,169 @@
// Metro module 15134 (f15135).
import { useState, useRef, useEffect, useCallback } from "react";
import { View } from "react-native";
import SelectedGuildStore from "../../../stores/SelectedGuildStore";
import GuildThemeRuntimeStore from "../GuildThemeRuntimeStore";
import { ContentDismissActionType } from "../../dismissible_content/DismissibleContentConstants";
import Logger from "../../debug/Logger";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { getInitialGuildThemeNuxSelection, saveGuildThemeNuxPreference } from "../GuildThemeNuxUtils";
import { GuildThemeSourcePreference } from "../../../flow/Client";
import { useStateFromStores } from "../../../_bundle/Module589";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import { intl, t } from "../../../intl/index.native";
import { BottomSheet } from "../../../design/components/Sheet/native/BottomSheet.native";
import GuildThemeNuxPreviewGraphic from "./GuildThemeNuxPreviewGraphic";
import { Text } from "../../../design/components/Text/native/Text";
import { TableRadioGroup } from "../../../design/components/TableRow/native/TableRadioGroup.native";
import { TableRadioRow } from "../../../design/components/TableRow/native/TableRadioRow.native";
import { HelpMessage, HelpMessageTypes } from "../../../design/void/native";
import { Button } from "../../../design/components/Button/native/Button.native";
let c10735_12 = "GuildThemeNuxActionSheet";
let c10735_13 = new Logger("GuildThemeNuxActionSheet");
const useStyles = createStyles({
container: {
padding: Module712.space.PX_16,
paddingTop: Module712.space.PX_8,
paddingBottom: 0
},
title: {
textAlign: "center",
marginBottom: Module712.space.PX_8
},
description: {
textAlign: "center",
marginBottom: Module712.space.PX_24
},
options: {
marginBottom: Module712.space.PX_12
},
warning: {
marginBottom: Module712.space.PX_12
},
footer: {
gap: Module712.space.PX_8
}
});
export default function GuildThemeNuxActionSheet(props) {
let callback;
const { guildId, markAsDismissed } = props;
callback = void 0;
const styles = useStyles();
const [value, setState] = useState(getInitialGuildThemeNuxSelection);
const [state, setState2] = useState(null);
const [loading, setState3] = useState(false);
const ref = useRef(false);
const isPersonal = value === GuildThemeSourcePreference.PERSONAL;
let c21699_6 = isPersonal;
const stateFromStores = useStateFromStores([SelectedGuildStore], () => SelectedGuildStore.getGuildId());
const stateFromStores2 = useStateFromStores([GuildThemeRuntimeStore], () => {
const guildThemeSnapshot = GuildThemeRuntimeStore.getGuildThemeSnapshot(guildId);
const r1 = guildThemeSnapshot != null;
let r8 = null;
if (r1) {
const enabled = guildThemeSnapshot.enabled;
r8 = null;
if (enabled) {
let themeSettings = guildThemeSnapshot.themeSettings;
if (themeSettings == null) {
themeSettings = null;
}
r8 = themeSettings;
}
}
return r8;
}, [guildId]);
useEffect(() => {
if (stateFromStores !== guildId) {
ActionSheetActionCreators.hideActionSheet(c10735_12);
}
}, [guildId, stateFromStores]);
const callback2 = useCallback((a0) => {
setState2(null);
setState(a0);
}, []);
callback = useCallback((a0) => {
if (!ref.current) {
ref.current = true;
markAsDismissed(a0);
}
}, [markAsDismissed]);
const callback3 = useCallback(async () => {
let c27949_2;
let c27949_3 = 0;
let c30845_0;
L13: {
try {
if (stateFromStores === guildId) {
setState3(true);
setState2(null);
c27949_3 = 1;
await saveGuildThemeNuxPreference(guildId, c21699_6);
c27949_3 = 0;
ref.current = true;
markAsDismissed(ContentDismissActionType.TAKE_ACTION);
ActionSheetActionCreators.hideActionSheet(c10735_12);
break L13;
}
} catch ($e) {
const r29 = $e;
let r7 = r29;
c27949_2 = r29;
if (c27949_3 !== 0) {
while (true) {
try {
const r85 = c27949_2;
c27949_3 = 0;
c30845_0 = r85;
c10735_13.error("Failed to save guild theme NUX preference", c30845_0);
(0, setState2)(intl.string(t.fEptJP));
(0, setState3)(false);
} catch (r81) {
r7 = r81;
c27949_2 = r81;
if (c27949_3 === 0) {
break;
}
continue;
}
return void 0;
}
}
throw r7;
}
return void 0;
}
}, [guildId, isPersonal, markAsDismissed, stateFromStores]);
const callback4 = useCallback(() => {
callback(ContentDismissActionType.USER_DISMISS);
}, [callback]);
const text = isPersonal ? intl.string(t.cvoikF) : intl.string(t["cY+Oob"]);
return <BottomSheet startExpanded dismissAccessibilityLabel={intl.string(t.cpT0Cq)} onDismiss={callback4} contentStyles={styles.container}>
<GuildThemeNuxPreviewGraphic themeSettings={stateFromStores2} isPersonal={isPersonal} />
<Text accessibilityRole="header" variant="heading-xl/semibold" color="mobile-text-heading-primary" style={styles.title}>
{intl.string(t.Q9zFy9)}
</Text>
<Text variant="text-md/normal" color="text-default" style={styles.description}>
{intl.string(t.XLpBLj)}
</Text>
<View style={styles.options}>
<TableRadioGroup hasIcons={false} value={value} onChange={callback2}>
<TableRadioRow label={intl.string(t.aN3RNQ)} value={GuildThemeSourcePreference.GUILD} />
<TableRadioRow label={intl.string(t.js8y7t)} value={GuildThemeSourcePreference.PERSONAL} />
</TableRadioGroup>
</View>
{isPersonal ? <View style={styles.warning}>
<HelpMessage messageType={HelpMessageTypes.WARNING} borderRadius={Module712.radii.md}>
{intl.string(t.tTHQAy)}
</HelpMessage>
</View> : null}
{state != null ? <View style={styles.warning}>
<HelpMessage messageType={HelpMessageTypes.ERROR} borderRadius={Module712.radii.md}>{state}</HelpMessage>
</View> : null}
<View style={styles.footer}>
<Button text={text} variant={isPersonal ? "secondary" : "primary"} loading={loading} disabled={loading} onPress={callback3} />
</View>
</BottomSheet>;
};
export const GUILD_THEME_NUX_ACTION_SHEET_KEY = "GuildThemeNuxActionSheet";
@@ -0,0 +1,20 @@
// Metro module 15136 (f15137).
import { View } from "react-native";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import GuildThemePreviewArt from "./GuildThemePreviewArt";
const useStyles = createStyles({
container: {
width: "100%",
aspectRatio: 1.7777777777777777,
alignItems: "center",
justifyContent: "center",
marginBottom: Module712.space.PX_24
}
});
export default function GuildThemeNuxPreviewGraphic(props) {
const { themeSettings, isPersonal } = props;
return <View accessibilityElementsHidden importantForAccessibility="no-hide-descendants" style={useStyles().container}>
<GuildThemePreviewArt themeSettings={isPersonal ? null : themeSettings} />
</View>;
};
@@ -0,0 +1,81 @@
// Metro module 15137 (f15138).
import { useMemo } from "react";
import { View } from "react-native";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { getSingleColorGuildThemeGradientColors, getGuildThemePreset, getGuildThemePresetAppearance } from "../GuildThemePresets";
import GuildThemePreviewOverlay from "./GuildThemePreviewOverlay";
import useTheme from "../../../hooks/useTheme";
import Module4611 from "../../../_bundle/Module4611";
let useStyles;
const PreviewOverlay = function PreviewOverlay() {
return <View pointerEvents="none" style={useStyles().previewOverlay}>
<GuildThemePreviewOverlay />
</View>;
};
useStyles = createStyles({
previewArt: {
position: "relative",
width: 256,
aspectRatio: 1.5705521472392638,
overflow: "hidden",
borderRadius: Module712.radii.md,
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH
},
previewOverlay: {
position: "absolute",
top: 7.314,
left: 7.461,
width: 259.862,
height: 154.514
}
});
export default function GuildThemePreviewArt(props) {
const { themeSettings, style } = props;
const styles = useStyles();
const theme = useTheme();
let c21700_1 = theme;
const memo = useMemo(() => {
let r17;
L8: {
const r2 = themeSettings == null;
r17 = null;
if (!r2) {
const customUserThemeSettings = themeSettings.customUserThemeSettings;
if (customUserThemeSettings != null) {
const r10 = customUserThemeSettings.colors[0];
if (r10 != null) {
const colors = [...getSingleColorGuildThemeGradientColors(r10, c21700_1)];
let gradientAngle = customUserThemeSettings.gradientAngle;
if (gradientAngle == null) {
gradientAngle = 0;
}
r17 = {
colors,
angle: gradientAngle
};
break L8;
}
}
const guildThemePreset = getGuildThemePreset(themeSettings.presetId);
const r4 = guildThemePreset != null;
r17 = null;
if (r4) {
const guildThemePresetAppearance = getGuildThemePresetAppearance(guildThemePreset, c21700_1);
r17 = {
colors: guildThemePresetAppearance.colors.map((color) => color.hex),
locations: guildThemePresetAppearance.colors.map((color) => color.stop / 100),
angle: guildThemePresetAppearance.angle
};
}
}
}
return r17;
}, [themeSettings, theme]);
const style2 = [styles.previewArt, style];
return memo == null ? <View style={style2}>
<PreviewOverlay />
</View> : <Module4611 colors={memo.colors} locations={memo.locations} useAngle angle={memo.angle} style={style2}>
<PreviewOverlay />
</Module4611>;
};
@@ -0,0 +1,46 @@
// Metro module 15138 (f15139).
import Module8531, { G, Path } from "../../../_bundle/Module8531";
export default function GuildThemePreviewOverlay(props) {
return <Module8531 {...props} preserveAspectRatio="none" width="100%" height="100%" viewBox="0 0 259.862 154.514" fill="none">
<G>
<Path d="M20.8821 7.1867C20.8821 3.21759 24.0659 0 27.9932 0H84.8821V154.514H20.8821V7.1867Z" fill="black" fillOpacity="0.1" />
<Path d="M248.055 0.225335H85.0491V154.266H248.055V0.225335Z" fill="black" fillOpacity="0.25" />
<G opacity="0.2">
<Path d="M99.2224 43.2126C103.136 43.2126 106.31 40.0048 106.31 36.0479C106.31 32.091 103.136 28.8832 99.2224 28.8832C95.3082 28.8832 92.1351 32.091 92.1351 36.0479C92.1351 40.0048 95.3082 43.2126 99.2224 43.2126Z" fill="white" />
<Path d="M125.795 31.1038H112.802C111.824 31.1038 111.031 31.9059 111.031 32.8951C111.031 33.8842 111.824 34.6863 112.802 34.6863H125.795C126.774 34.6863 127.567 33.8842 127.567 32.8951C127.567 31.9059 126.774 31.1038 125.795 31.1038Z" fill="white" />
<Path d="M111.031 39.7954C111.031 39.1359 111.559 38.6011 112.212 38.6011H163.004C163.656 38.6011 164.185 39.1359 164.185 39.7954C164.185 40.4547 163.656 40.9895 163.004 40.9895H112.212C111.559 40.9895 111.031 40.4547 111.031 39.7954Z" fill="white" />
<Path d="M99.2224 67.095C103.136 67.095 106.31 63.8872 106.31 59.9303C106.31 55.9734 103.136 52.7656 99.2224 52.7656C95.3082 52.7656 92.1351 55.9734 92.1351 59.9303C92.1351 63.8872 95.3082 67.095 99.2224 67.095Z" fill="white" />
<Path d="M130.52 54.9867H112.802C111.824 54.9867 111.031 55.7886 111.031 56.7777C111.031 57.7671 111.824 58.569 112.802 58.569H130.52C131.499 58.569 132.292 57.7671 132.292 56.7777C132.292 55.7886 131.499 54.9867 130.52 54.9867Z" fill="white" />
<Path d="M111.031 63.6776C111.031 63.0181 111.559 62.4833 112.212 62.4833H137.017C137.67 62.4833 138.198 63.0181 138.198 63.6776C138.198 64.3369 137.67 64.8717 137.017 64.8717H112.212C111.559 64.8717 111.031 64.3369 111.031 63.6776Z" fill="white" />
<Path d="M99.2224 90.9774C103.136 90.9774 106.31 87.7696 106.31 83.8127C106.31 79.8558 103.136 76.6481 99.2224 76.6481C95.3082 76.6481 92.1351 79.8558 92.1351 83.8127C92.1351 87.7696 95.3082 90.9774 99.2224 90.9774Z" fill="white" />
<Path d="M143.514 78.8689H112.802C111.824 78.8689 111.031 79.671 111.031 80.6601C111.031 81.6493 111.824 82.4514 112.802 82.4514H143.514C144.492 82.4514 145.286 81.6493 145.286 80.6601C145.286 79.671 144.492 78.8689 143.514 78.8689Z" fill="white" />
<Path d="M111.031 87.5598C111.031 86.9005 111.559 86.3657 112.212 86.3657H158.279C158.931 86.3657 159.46 86.9005 159.46 87.5598C159.46 88.2193 158.931 88.7541 158.279 88.7541H112.212C111.559 88.7541 111.031 88.2193 111.031 87.5598Z" fill="white" />
</G>
<Path opacity="0.2" d="M76.1873 8.28431H28.9391C28.4497 8.28431 28.0532 8.68527 28.0532 9.1799C28.0532 9.67453 28.4497 10.0755 28.9391 10.0755H76.1873C76.6765 10.0755 77.0733 9.67453 77.0733 9.1799C77.0733 8.68527 76.6765 8.28431 76.1873 8.28431Z" fill="#D9D9D9" />
<Path opacity="0.2" d="M141.155 8.28431H93.9068C93.4174 8.28431 93.0208 8.68527 93.0208 9.1799C93.0208 9.67453 93.4174 10.0755 93.9068 10.0755H141.155C141.644 10.0755 142.041 9.67453 142.041 9.1799C142.041 8.68527 141.644 8.28431 141.155 8.28431Z" fill="#D9D9D9" />
<Path opacity="0.2" d="M9.44965 3.80698H4.72483C2.11537 3.80698 0 5.94547 0 8.58343V13.3599C0 15.9979 2.11537 18.1363 4.72483 18.1363H9.44965C12.0591 18.1363 14.1745 15.9979 14.1745 13.3599V8.58343C14.1745 5.94547 12.0591 3.80698 9.44965 3.80698Z" fill="white" />
<Path opacity="0.2" d="M13.5839 24.1077H0.590606C0.264409 24.1077 0 24.375 0 24.7049C0 25.0345 0.264409 25.3018 0.590606 25.3018H13.5839C13.91 25.3018 14.1745 25.0345 14.1745 24.7049C14.1745 24.375 13.91 24.1077 13.5839 24.1077Z" fill="white" fillOpacity="0.55" />
<Path opacity="0.2" d="M9.44965 31.2709H4.72483C2.11537 31.2709 0 33.4096 0 36.0474V40.8239C0 43.4618 2.11537 45.6005 4.72483 45.6005H9.44965C12.0591 45.6005 14.1745 43.4618 14.1745 40.8239V36.0474C14.1745 33.4096 12.0591 31.2709 9.44965 31.2709Z" fill="white" />
<Path opacity="0.5" d="M9.44965 51.5718H4.72483C2.11537 51.5718 0 53.7103 0 56.3481V61.1246C0 63.7627 2.11537 65.9012 4.72483 65.9012H9.44965C12.0591 65.9012 14.1745 63.7627 14.1745 61.1246V56.3481C14.1745 53.7103 12.0591 51.5718 9.44965 51.5718Z" fill="white" />
<Path opacity="0.05" d="M259.862 18.1359H21.2575V19.3299H259.862V18.1359Z" fill="white" />
<G opacity="0.2">
<Path d="M44.2994 29.7789H30.1249C29.6356 29.7789 29.239 30.18 29.239 30.6745C29.239 31.1692 29.6356 31.5701 30.1249 31.5701H44.2994C44.7885 31.5701 45.1853 31.1692 45.1853 30.6745C45.1853 30.18 44.7885 29.7789 44.2994 29.7789Z" fill="white" stroke="white" strokeWidth="0.723776" />
<Path d="M33.6659 47.9852C36.6001 47.9852 38.9791 45.5804 38.9791 42.6139C38.9791 39.6474 36.6001 37.2427 33.6659 37.2427C30.7315 37.2427 28.3528 39.6474 28.3528 42.6139C28.3528 45.5804 30.7315 47.9852 33.6659 47.9852Z" fill="white" />
<Path d="M59.6471 41.7178H45.4727C44.9833 41.7178 44.5868 42.1187 44.5868 42.6132C44.5868 43.1079 44.9833 43.5088 45.4727 43.5088H59.6471C60.1363 43.5088 60.5331 43.1079 60.5331 42.6132C60.5331 42.1187 60.1363 41.7178 59.6471 41.7178Z" fill="white" stroke="white" strokeWidth="0.723776" />
<Path d="M33.6659 63.5031C36.6001 63.5031 38.9791 61.0984 38.9791 58.1319C38.9791 55.1654 36.6001 52.7607 33.6659 52.7607C30.7315 52.7607 28.3528 55.1654 28.3528 58.1319C28.3528 61.0984 30.7315 63.5031 33.6659 63.5031Z" fill="white" />
<Path d="M73.8216 57.2358H45.4727C44.9833 57.2358 44.5868 57.6367 44.5868 58.1314C44.5868 58.6259 44.9833 59.0268 45.4727 59.0268H73.8216C74.311 59.0268 74.7075 58.6259 74.7075 58.1314C74.7075 57.6367 74.311 57.2358 73.8216 57.2358Z" fill="white" stroke="white" strokeWidth="0.723776" />
<Path d="M33.6659 79.0211C36.6001 79.0211 38.9791 76.6164 38.9791 73.6499C38.9791 70.6836 36.6001 68.2787 33.6659 68.2787C30.7315 68.2787 28.3528 70.6836 28.3528 73.6499C28.3528 76.6164 30.7315 79.0211 33.6659 79.0211Z" fill="white" />
<Path d="M67.9155 72.7538H45.4727C44.9833 72.7538 44.5868 73.1547 44.5868 73.6494C44.5868 74.1438 44.9833 74.5448 45.4727 74.5448H67.9155C68.4049 74.5448 68.8015 74.1438 68.8015 73.6494C68.8015 73.1547 68.4049 72.7538 67.9155 72.7538Z" fill="white" stroke="white" strokeWidth="0.723776" />
</G>
<Path d="M73.2348 124.413H4.72483C2.11537 124.413 0 126.551 0 129.189V143.519C0 146.157 2.11537 148.295 4.72483 148.295H73.2348C75.8444 148.295 77.9597 146.157 77.9597 143.519V129.189C77.9597 126.551 75.8444 124.413 73.2348 124.413Z" fill="white" fillOpacity="0.08" />
<Path opacity="0.3" d="M11.8111 143.518C15.7253 143.518 18.8983 140.31 18.8983 136.353C18.8983 132.396 15.7253 129.188 11.8111 129.188C7.89693 129.188 4.72387 132.396 4.72387 136.353C4.72387 140.31 7.89693 143.518 11.8111 143.518Z" fill="white" />
<G opacity="0.3">
<Path d="M56.1027 131.209H25.3914C24.4127 131.209 23.6196 132.011 23.6196 133C23.6196 133.989 24.4127 134.791 25.3914 134.791H56.1027C57.0811 134.791 57.8745 133.989 57.8745 133C57.8745 132.011 57.0811 131.209 56.1027 131.209Z" fill="white" />
<Path d="M44.2905 137.918H25.3914C24.4127 137.918 23.6196 138.72 23.6196 139.709C23.6196 140.698 24.4127 141.5 25.3914 141.5H44.2905C45.2693 141.5 46.0624 140.698 46.0624 139.709C46.0624 138.72 45.2693 137.918 44.2905 137.918Z" fill="white" />
</G>
<G opacity="0.5">
<Path d="M235.061 124.413H98.041C94.779 124.413 92.1349 127.086 92.1349 130.383V142.324C92.1349 145.622 94.779 148.295 98.041 148.295H235.061C238.322 148.295 240.966 145.622 240.966 142.324V130.383C240.966 127.086 238.322 124.413 235.061 124.413Z" fill="white" fillOpacity="0.08" />
</G>
</G>
</Module8531>;
};
@@ -0,0 +1,17 @@
// Metro module 15133 (f15134).
import { useCallback } from "react";
import ActionSheetStore from "../../action_sheet/native/ActionSheetStore";
import { useStateFromStores } from "../../../_bundle/Module589";
import { GUILD_THEME_NUX_ACTION_SHEET_KEY } from "./GuildThemeNuxActionSheet";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import useGuildThemeNuxTrigger2 from "../useGuildThemeNuxTrigger";
export default function useGuildThemeNuxTrigger(a0) {
useGuildThemeNuxTrigger2(a0, {
isNuxOpen: useStateFromStores([ActionSheetStore], () => ActionSheetStore.getKey() === GUILD_THEME_NUX_ACTION_SHEET_KEY),
openNux: useCallback((a0) => {
const r13 = import("./GuildThemeNuxActionSheet");
ActionSheetActionCreators.openLazy(r13, GUILD_THEME_NUX_ACTION_SHEET_KEY, a0, "stack");
return r13;
}, [])
});
};
@@ -0,0 +1,119 @@
// Metro module 4039 (f4040).
import { useContext, useState, useEffect } from "react";
import { ME } from "../../../Constants";
import { coerceMainRoute } from "../../main_tabs_v2/helpers/NavigationRouteUtils.native";
import { getRootNavigationRef } from "../../main_tabs_v2/RootNavigationRef.native";
import GuildThemeGuildIdOverrideContext from "./GuildThemeGuildIdOverrideContext";
import { useActiveGuildThemeForGuildId } from "../GuildThemeResolver";
let getActiveGuildThemeGuildIdSnapshot;
const getGuildIdFromNavigationState = function getGuildIdFromNavigationState(a0) {
if (a0 != null) {
const routes = a0.routes;
if (routes != null) {
const r6 = routes[a0.index];
let r9 = r6 == null ? void 0 : r6.params?.guildId;
if (r9 == null) {
r9 = getGuildIdFromNavigationState(r6?.state);
}
return r9;
}
}
};
getActiveGuildThemeGuildIdSnapshot = function getActiveGuildThemeGuildIdSnapshot() {
const rootNavigationRef = getRootNavigationRef();
if (rootNavigationRef != null && rootNavigationRef.isReady()) {
const rootState = rootNavigationRef.getRootState();
const r3 = rootState != null;
let r20 = void 0;
if (r3) {
const routes = rootState.routes;
const r21 = routes != null;
r20 = void 0;
if (r21) {
const r23 = routes[rootState.index];
let r25 = r23 == null ? void 0 : r23.params?.guildId;
if (r25 == null) {
const state = r23?.state;
const r29 = state != null;
let r30 = void 0;
if (r29) {
const routes2 = state.routes;
const r31 = routes2 != null;
r30 = void 0;
if (r31) {
const r14 = routes2[state.index];
let r34 = r14 == null ? void 0 : r14.params?.guildId;
if (r34 == null) {
r34 = getGuildIdFromNavigationState(r14?.state);
}
r30 = r34;
}
}
r25 = r30;
}
r20 = r25;
}
}
if (r20 == null) {
const r39 = rootState == null;
let r40 = void 0;
if (!r39) {
const routes3 = rootState.routes;
r40 = routes3 == null ? void 0 : routes3.map(coerceMainRoute).find((item) => item != null);
}
const state2 = r40?.state;
const r52 = state2 != null;
let r53 = void 0;
if (r52) {
const routes4 = state2.routes;
const r55 = routes4 != null;
r53 = void 0;
if (r55) {
const r57 = routes4[state2.index];
let r59 = r57 == null ? void 0 : r57.params?.guildId;
if (r59 == null) {
const state3 = r57?.state;
const r64 = state3 != null;
let r65 = void 0;
if (r64) {
const routes5 = state3.routes;
const r67 = routes5 != null;
r65 = void 0;
if (r67) {
const r69 = routes5[state3.index];
let r71 = r69 == null ? void 0 : r69.params?.guildId;
if (r71 == null) {
r71 = getGuildIdFromNavigationState(r69?.state);
}
r65 = r71;
}
}
r59 = r65;
}
r53 = r59;
}
}
r20 = r53;
}
return r20 == null ? null : r20 !== ME ? r20 : null;
}
return null;
};
export default function useRoutedActiveGuildTheme() {
const context = useContext(GuildThemeGuildIdOverrideContext);
let [state, setState] = useState(getActiveGuildThemeGuildIdSnapshot);
useEffect(() => {
const rootNavigationRef = getRootNavigationRef();
if (rootNavigationRef != null) {
const handleStateChange = function handleStateChange() {
setState(getActiveGuildThemeGuildIdSnapshot());
};
setState(getActiveGuildThemeGuildIdSnapshot());
return rootNavigationRef.addListener("state", handleStateChange);
}
}, []);
if (context !== void 0) {
state = context !== ME ? context : null;
}
return useActiveGuildThemeForGuildId(state);
};