decord/source/modules/guild_themes/native/GuildThemeNuxActionSheet.tsx

262 lines
9.8 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 15486
// Function ID: 15487
2026-07-20 16:05:17 +00:00
// Name: GuildThemeNuxActionSheet
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 32, 19, 17, 4201, 4264, 1388, 21, 3, 4668, 712, 15487, 4310, 589, 4346, 1236, 6988, 15488, 4739, 8140, 8139, 1297, 4750, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 15486 (GuildThemeNuxActionSheet)
import timestampDefault from "timestamp" /* 3 */;
import ThemesDefault from "Themes" /* 712 */;
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "_slicedToArray" /* 32 */;
import closure_5 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import closure_7 from "handleConnectionOpen" /* 4201 */;
import closure_8 from "snapshotSelectedGuildId" /* 4264 */;
import { ContentDismissActionType } from "ContentDismissActionType" /* 1388 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ jsx: c10, jsxs: unpackModuleId } = jsxProd);
const GuildThemeNuxActionSheet = "GuildThemeNuxActionSheet";
2026-08-24 06:08:38 +00:00
let closure_13 = new timestampDefault("GuildThemeNuxActionSheet");
2026-07-29 08:29:29 +00:00
createCacheKey = { container: null, title: null, description: null, options: null, warning: null, footer: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { padding: ThemesDefault.space.PX_16, paddingTop: ThemesDefault.space.PX_8, paddingBottom: 0 };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
2026-08-24 06:08:38 +00:00
const tmp3 = new timestampDefault("GuildThemeNuxActionSheet");
createCacheKey[1] = { textAlign: "center", marginBottom: ThemesDefault.space.PX_8 };
let obj1 = { textAlign: "center", marginBottom: ThemesDefault.space.PX_8 };
createCacheKey[2] = { textAlign: "center", marginBottom: ThemesDefault.space.PX_24 };
let obj2 = { textAlign: "center", marginBottom: ThemesDefault.space.PX_24 };
createCacheKey[3] = { marginBottom: ThemesDefault.space.PX_12 };
let obj3 = { marginBottom: ThemesDefault.space.PX_12 };
createCacheKey[4] = { marginBottom: ThemesDefault.space.PX_12 };
let obj4 = { marginBottom: ThemesDefault.space.PX_12 };
createCacheKey[5] = { gap: ThemesDefault.space.PX_8 };
let closure_14 = createCacheKey.createStyles(createCacheKey);
let obj5 = { gap: ThemesDefault.space.PX_8 };
const result = require("set").fileFinishedImporting("modules/guild_themes/native/GuildThemeNuxActionSheet.tsx");
2026-07-20 16:05:17 +00:00
export default function GuildThemeNuxActionSheet(guildId) {
guildId = guildId.guildId;
const markAsDismissed = guildId.markAsDismissed;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-29 08:29:29 +00:00
let callback;
let callback2;
let React;
2026-08-24 06:08:38 +00:00
closure_6 = undefined;
2026-07-29 08:29:29 +00:00
let stateFromStores;
let callback1;
2026-08-24 06:08:38 +00:00
const tmp = callback5();
[tmp5, c2] = callback2(React.useState(guildId(15487).getInitialGuildThemeNuxSelection), 2);
const tmp4 = callback2(React.useState(guildId(15487).getInitialGuildThemeNuxSelection), 2);
2026-07-29 08:29:29 +00:00
[tmp7, c3] = callback2(React.useState(null), 2);
const tmp6 = callback2(React.useState(null), 2);
[tmp9, c4] = callback2(React.useState(false), 2);
2026-07-23 10:11:24 +00:00
React = React.useRef(false);
2026-08-24 06:08:38 +00:00
const tmp10 = tmp5 === guildId(4310).GuildThemeSourcePreference.PERSONAL;
closure_6 = tmp10;
2026-07-29 08:29:29 +00:00
let obj = guildId(589);
2026-07-23 10:11:24 +00:00
const items = [stateFromStores];
stateFromStores = obj.useStateFromStores(items, () => stateFromStores.getGuildId());
2026-08-24 06:08:38 +00:00
obj1 = guildId(589);
2026-07-23 10:11:24 +00:00
const items1 = [callback1];
2026-07-20 16:05:17 +00:00
const items2 = [guildId];
const items3 = [guildId, stateFromStores];
const stateFromStores1 = obj1.useStateFromStores(items1, () => {
const guildThemeSnapshot = callback1.getGuildThemeSnapshot(guildId);
let tmp2 = null;
if (null != guildThemeSnapshot) {
tmp2 = null;
if (guildThemeSnapshot.enabled) {
2026-07-29 08:29:29 +00:00
let themeSettings = guildThemeSnapshot.themeSettings;
if (themeSettings == null) {
themeSettings = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp2 = themeSettings;
2026-07-20 16:05:17 +00:00
}
}
return tmp2;
}, items2);
const effect = React.useEffect(() => {
if (stateFromStores !== guildId) {
2026-08-24 06:08:38 +00:00
markAsDismissed(_undefined[14]).hideActionSheet(closure_1_12);
2026-07-29 08:29:29 +00:00
const obj = markAsDismissed(_undefined[14]);
2026-07-20 16:05:17 +00:00
}
}, items3);
const items4 = [markAsDismissed];
2026-07-29 08:29:29 +00:00
callback = React.useCallback((arg0) => {
_undefined2(null);
_undefined(arg0);
}, []);
callback1 = React.useCallback((arg0) => {
2026-07-20 16:05:17 +00:00
if (!ref.current) {
2026-07-29 08:29:29 +00:00
tmp.current = true;
2026-07-20 16:05:17 +00:00
markAsDismissed(arg0);
}
2026-07-29 08:29:29 +00:00
}, items4);
const items5 = [guildId, tmp10, markAsDismissed, stateFromStores];
2026-07-20 16:05:17 +00:00
const items6 = [callback1];
2026-07-29 08:29:29 +00:00
callback2 = React.useCallback(callback(function*() {
if (c5 === 2) {
c5 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp6 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c5 = 2;
if (0 === v02) {
if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 === 2) {
c5 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
const callback = tmp3;
2026-08-24 06:08:38 +00:00
closure_0 = tmp7;
if (closure_1_7 === closure_1_0) {
2026-07-29 08:29:29 +00:00
v02(true);
v0(null);
v0 = 1;
2026-08-24 06:08:38 +00:00
let obj3 = closure_1_0(closure_1_2[11]);
2026-07-29 08:29:29 +00:00
v02 = 2;
c5 = 1;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: false };
obj1[0] = obj3.saveGuildThemeNuxPreference(tmp49, closure_1_6);
2026-07-29 08:29:29 +00:00
return obj1;
} else {
c5 = 3;
}
}
} else if (1 === tmp7) {
v0 = 0;
closure_0 = closure_2;
2026-08-24 06:08:38 +00:00
closure_1_13.error("Failed to save guild theme NUX preference", closure_0);
const intl = closure_1_0(closure_1_2[15]).intl;
v0(intl.string(closure_1_0(closure_1_2[15]).t.fEptJP));
2026-07-29 08:29:29 +00:00
v02(false);
c5 = 3;
const obj2 = { value: null, done: true };
obj2[0] = undefined;
return obj2;
} else if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 !== 2) {
v0 = 0;
c5.current = true;
2026-08-24 06:08:38 +00:00
callback(closure_1_9.TAKE_ACTION);
obj = closure_1_1(closure_1_2[14]);
obj.hideActionSheet(closure_1_12);
2026-07-29 08:29:29 +00:00
}
v0 = 0;
c5 = 3;
obj3 = { value: null, done: true };
obj3[0] = arg1;
return obj3;
} catch (tmp39) {
closure_2 = tmp39;
if (tmp4 === v0) {
c5 = tmp2;
throw tmp39;
} else {
v02 = tmp;
}
}
}
}), items5);
2026-07-20 16:05:17 +00:00
const callback3 = React.useCallback(() => {
2026-08-24 06:08:38 +00:00
callback1(closure_1_9.USER_DISMISS);
2026-07-20 16:05:17 +00:00
}, items6);
2026-07-29 08:29:29 +00:00
let intl = guildId(1236).intl;
2026-07-20 16:05:17 +00:00
const string = intl.string;
2026-07-29 08:29:29 +00:00
const t = guildId(1236).t;
if (tmp10) {
2026-07-20 16:05:17 +00:00
let stringResult = string(t.cvoikF);
} else {
2026-07-23 10:11:24 +00:00
stringResult = string(t["cY+Oob"]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { startExpanded: true, dismissAccessibilityLabel: null, onDismiss: null, contentStyles: null, children: null };
const intl2 = tmp2(1236).intl;
obj[1] = intl2.string(guildId(1236).t.cpT0Cq);
obj[2] = callback3;
obj[3] = tmp.container;
2026-08-24 06:08:38 +00:00
const items7 = [callback3(markAsDismissed(15488), { themeSettings: stateFromStores1, isPersonal: tmp10 }), , , , , , ];
2026-07-29 08:29:29 +00:00
obj = { accessibilityRole: "header", variant: "heading-xl/semibold", color: "mobile-text-heading-primary", style: tmp.title, children: null };
const intl3 = tmp2(1236).intl;
obj[4] = intl3.string(guildId(1236).t.Q9zFy9);
2026-08-24 06:08:38 +00:00
items7[1] = callback3(guildId(4739).Text, obj);
2026-07-29 08:29:29 +00:00
obj1 = { variant: "text-md/normal", color: "text-default", style: tmp.description, children: null };
const intl4 = tmp2(1236).intl;
obj1[3] = intl4.string(guildId(1236).t.XLpBLj);
2026-08-24 06:08:38 +00:00
items7[2] = callback3(guildId(4739).Text, obj1);
2026-07-29 08:29:29 +00:00
let obj2 = { style: tmp.options, children: null };
let obj3 = { hasIcons: false, value: tmp5, onChange: callback, children: null };
const obj4 = { label: null, value: null };
const intl5 = tmp2(1236).intl;
obj4[0] = intl5.string(guildId(1236).t.aN3RNQ);
2026-08-24 06:08:38 +00:00
obj4[1] = guildId(4310).GuildThemeSourcePreference.GUILD;
const items8 = [callback3(guildId(8139).TableRadioRow, obj4), ];
2026-07-29 08:29:29 +00:00
const obj5 = { label: null, value: null };
const intl6 = tmp2(1236).intl;
obj5[0] = intl6.string(guildId(1236).t.js8y7t);
2026-08-24 06:08:38 +00:00
obj5[1] = guildId(4310).GuildThemeSourcePreference.PERSONAL;
items8[1] = callback3(guildId(8139).TableRadioRow, obj5);
2026-07-29 08:29:29 +00:00
obj3[3] = items8;
2026-08-24 06:08:38 +00:00
obj2[1] = callback4(guildId(8140).TableRadioGroup, obj3);
items7[3] = callback3(closure_6, obj2);
2026-07-29 08:29:29 +00:00
let tmp20Result = null;
if (tmp10) {
const obj6 = { style: null, children: null };
obj6[0] = tmp.warning;
const obj7 = { messageType: null, borderRadius: null, children: null };
obj7[0] = tmp2(1297).HelpMessageTypes.WARNING;
obj7[1] = tmp21(712).radii.md;
const intl7 = tmp2(1236).intl;
obj7[2] = intl7.string(tmp2(1236).t.tTHQAy);
obj6[1] = tmp20(tmp2(1297).HelpMessage, obj7);
tmp20Result = tmp20(tmp22, obj6);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items7[4] = tmp20Result;
tmp20Result = null;
if (null != tmp7) {
const obj8 = { style: null, children: null };
obj8[0] = tmp.warning;
const obj9 = { messageType: null, borderRadius: null, children: null };
obj9[0] = tmp2(1297).HelpMessageTypes.ERROR;
obj9[1] = tmp21(712).radii.md;
obj9[2] = tmp7;
obj8[1] = tmp20(tmp2(1297).HelpMessage, obj9);
tmp20Result = tmp20(tmp22, obj8);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items7[5] = tmp20Result;
const obj10 = { style: tmp.footer, children: null };
const obj11 = { text: stringResult, variant: null, loading: null, disabled: null, onPress: null };
2026-07-20 16:05:17 +00:00
let str = "primary";
2026-07-29 08:29:29 +00:00
if (tmp10) {
2026-07-20 16:05:17 +00:00
str = "secondary";
}
2026-07-29 08:29:29 +00:00
obj11[1] = str;
obj11[2] = tmp9;
obj11[3] = tmp9;
obj11[4] = callback2;
2026-08-24 06:08:38 +00:00
obj10[1] = callback3(guildId(4750).Button, obj11);
items7[6] = callback3(closure_6, obj10);
2026-07-29 08:29:29 +00:00
obj[4] = items7;
2026-08-24 06:08:38 +00:00
return callback4(guildId(6988).BottomSheet, obj);
2026-07-20 16:05:17 +00:00
};
export const GUILD_THEME_NUX_ACTION_SHEET_KEY = "GuildThemeNuxActionSheet";