decord/source/modules/auth/native/components/Welcome.tsx

332 lines
13 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 15308
// Function ID: 15309
2026-07-20 16:05:17 +00:00
// Name: InviteCard
2026-08-25 06:04:03 +00:00
// Dependencies: [19, 17, 15309, 4293, 7065, 11977, 1930, 4364, 9217, 676, 6050, 7340, 21, 4380, 712, 12217, 1236, 38, 1297, 4224, 4376, 12812, 7785, 13415, 1500, 1629, 589, 4831, 7081, 698, 595, 5933, 5822, 15310, 15305, 1501, 5257, 4815, 4108, 5373, 11456, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-25 06:04:03 +00:00
// Module 15308 (InviteCard)
2026-08-24 06:08:38 +00:00
import _modDef38 from "module_38" /* 38 */;
import ThemesDefault from "Themes" /* 712 */;
import getSystemLocale from "getSystemLocale" /* 1236 */;
import Button from "Button" /* 1297 */;
2026-08-25 06:04:03 +00:00
import nameFromUserDefault from "nameFromUser" /* 4224 */;
import Text from "Text" /* 4376 */;
import useIsWindowLargeDefault from "useIsWindowLarge" /* 7785 */;
import renderDefault from "render" /* 12217 */;
import registerAssetDefault from "registerAsset" /* 12812 */;
import registerAsset from "registerAsset" /* 13415 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
2026-08-25 06:04:03 +00:00
import closure_7 from "isUnderageAnonymous" /* 15309 */;
import closure_8 from "getHash" /* 4293 */;
import closure_9 from "handleGuildTemplateResolveSuccess" /* 7065 */;
import closure_10 from "initialize" /* 11977 */;
2026-08-24 06:08:38 +00:00
import closure_11 from "createdAt" /* 1930 */;
2026-08-25 06:04:03 +00:00
import closure_12 from "updateInvite" /* 4364 */;
import closure_13 from "getDisplayedInviteCode" /* 9217 */;
2026-08-24 06:08:38 +00:00
import ME from "ME" /* 676 */;
2026-08-25 06:04:03 +00:00
import { GuildTemplateStates } from "GUILD_TEMPLATES_MEMBER_COUNT_PROMOTION_THRESHOLD" /* 6050 */;
import { InviteTypes } from "InviteSendStates" /* 7340 */;
2026-08-24 06:08:38 +00:00
import jsxProd from "jsxProd" /* 21 */;
2026-08-25 06:04:03 +00:00
import createCacheKey from "createCacheKey" /* 4380 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function InviteCard(invite) {
invite = invite.invite;
2026-08-24 06:08:38 +00:00
const tmp = callback4();
2026-07-20 16:05:17 +00:00
({ guild, inviter } = invite);
if (invite.state !== constants.RESOLVED) {
return null;
} else {
if (null != guild) {
2026-07-29 08:29:29 +00:00
let obj = { guild: null };
obj[0] = guild;
2026-08-24 06:08:38 +00:00
let tmp14 = callback(renderDefault, obj);
const intl2 = getSystemLocale.intl;
let stringResult = intl2.string(getSystemLocale.t["3rE1P8"]);
2026-07-20 16:05:17 +00:00
let name = guild.name;
2026-07-29 08:29:29 +00:00
let tmp17 = require;
let tmp18 = callback;
2026-07-20 16:05:17 +00:00
} else if (null != tmp2) {
2026-08-24 06:08:38 +00:00
_modDef38(null != inviter, "Null inviter");
2026-08-25 06:04:03 +00:00
obj = { user: null, guildId: "a" };
2026-08-24 06:08:38 +00:00
const tmp12 = new closure_11(inviter);
2026-07-29 08:29:29 +00:00
obj[0] = tmp12;
2026-08-24 06:08:38 +00:00
tmp14 = callback(Button.Avatar, obj);
const intl = getSystemLocale.intl;
stringResult = intl.string(getSystemLocale.t.OsdY8B);
obj1 = nameFromUserDefault;
2026-07-20 16:05:17 +00:00
name = obj1.getFormattedName(inviter);
2026-07-29 08:29:29 +00:00
tmp17 = require;
tmp18 = callback;
2026-07-20 16:05:17 +00:00
} else if (null == inviter) {
return null;
} else {
2026-08-25 06:04:03 +00:00
obj = { user: null, guildId: "a" };
2026-08-24 06:08:38 +00:00
const tmp33 = new closure_11(inviter);
2026-07-29 08:29:29 +00:00
obj[0] = tmp33;
2026-08-24 06:08:38 +00:00
const intl3 = getSystemLocale.intl;
stringResult = intl3.string(getSystemLocale.t["+ITYkQ"]);
const tmp35 = callback(Button.Avatar, obj);
name = nameFromUserDefault.getFormattedName(inviter, true);
2026-07-29 08:29:29 +00:00
tmp14 = tmp35;
tmp17 = require;
tmp18 = callback;
2026-08-24 06:08:38 +00:00
const obj9 = nameFromUserDefault;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj1 = { style: null, children: null };
2026-07-20 16:05:17 +00:00
const items = [tmp.container, invite.style];
2026-07-29 08:29:29 +00:00
obj1[0] = items;
2026-07-20 16:05:17 +00:00
const items1 = [tmp14, ];
2026-07-29 08:29:29 +00:00
const obj2 = { style: null, children: null };
obj2[0] = tmp.text;
const obj3 = { variant: "text-sm/medium", color: "text-subtle", children: null };
obj3[2] = stringResult;
2026-08-25 06:04:03 +00:00
const items2 = [tmp18(tmp17(4376).Text, obj3), ];
2026-07-29 08:29:29 +00:00
const obj4 = { variant: "text-md/semibold", color: "mobile-text-heading-primary", children: null };
obj4[2] = name;
2026-08-25 06:04:03 +00:00
items2[1] = tmp18(tmp17(4376).Text, obj4);
2026-07-29 08:29:29 +00:00
obj2[1] = items2;
2026-07-23 10:11:24 +00:00
items1[1] = callback2(closure_4, obj2);
2026-07-29 08:29:29 +00:00
obj1[1] = items1;
2026-07-23 10:11:24 +00:00
return callback2(closure_4, obj1);
2026-07-20 16:05:17 +00:00
}
}
function GuildTemplateCard(arg0) {
({ guildTemplate, style } = arg0);
2026-08-24 06:08:38 +00:00
const tmp = callback4();
2026-07-29 08:29:29 +00:00
let obj = { style: items, children: null };
2026-07-23 10:11:24 +00:00
items = [tmp.container, style];
2026-08-24 06:08:38 +00:00
obj = { source: registerAssetDefault };
2026-07-23 10:11:24 +00:00
const items1 = [callback(closure_5, obj), ];
2026-07-29 08:29:29 +00:00
obj = { style: tmp.text, children: null };
2026-08-24 06:08:38 +00:00
obj1 = { variant: "text-sm/medium", color: "text-subtle", children: null };
const intl = getSystemLocale.intl;
obj1[2] = intl.string(getSystemLocale.t.QzUORX);
const items2 = [callback(Text.Text, obj1), callback(Text.Text, { variant: "text-md/semibold", color: "mobile-text-heading-primary", children: guildTemplate.name })];
2026-07-29 08:29:29 +00:00
obj[1] = items2;
2026-07-23 10:11:24 +00:00
items1[1] = callback2(closure_4, obj);
2026-07-29 08:29:29 +00:00
obj[1] = items1;
2026-07-23 10:11:24 +00:00
return callback2(closure_4, obj);
2026-07-20 16:05:17 +00:00
}
function Centerpiece(inlineButtons) {
({ invite, guildTemplate } = inlineButtons);
2026-08-24 06:08:38 +00:00
const tmp2 = useIsWindowLargeDefault();
2026-07-29 08:29:29 +00:00
const tmp3 = callback3(tmp2);
let tmp7 = null != guildTemplate;
if (tmp7) {
tmp7 = guildTemplate.state === GuildTemplateStates.RESOLVED;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj = { style: items, children: null };
items = [tmp3.centerpieceContainer];
obj = { alwaysBounceVertical: false, contentContainerStyle: tmp3.scrollViewContainer, children: null };
2026-08-24 06:08:38 +00:00
obj = { style: tmp3.logo, source: registerAsset };
2026-07-23 10:11:24 +00:00
const items1 = [callback(closure_5, obj), , ];
2026-08-24 06:08:38 +00:00
obj1 = { style: tmp3.header, lineClamp: null, variant: "display-md", color: "text-overlay-light", maxFontSizeMultiplier: 1, children: null };
2026-07-20 16:05:17 +00:00
let num = 2;
2026-07-29 08:29:29 +00:00
if (tmp2) {
2026-07-20 16:05:17 +00:00
num = 1;
}
2026-07-29 08:29:29 +00:00
obj1[1] = num;
const intl = tmp4(1236).intl;
2026-08-24 06:08:38 +00:00
obj1[5] = intl.string(getSystemLocale.t["3S2xmm"]);
const items2 = [callback(Text.Heading, obj1), , , ];
2026-07-29 08:29:29 +00:00
const items3 = [tmp3.subHeader, ];
2026-07-20 16:05:17 +00:00
if (null != invite) {
2026-07-29 08:29:29 +00:00
let subHeaderWithInvite = tmp3.subHeaderWithInvite;
2026-07-20 16:05:17 +00:00
} else {
subHeaderWithInvite = null;
}
2026-07-29 08:29:29 +00:00
const obj2 = { variant: "text-md/medium", color: "text-overlay-light", style: items3, maxFontSizeMultiplier: 3, children: null };
2026-07-20 16:05:17 +00:00
items3[1] = subHeaderWithInvite;
2026-07-29 08:29:29 +00:00
const intl2 = tmp4(1236).intl;
2026-08-24 06:08:38 +00:00
obj2[4] = intl2.string(getSystemLocale.t.Gtcthl);
items2[1] = callback(Text.Text, obj2);
2026-07-29 08:29:29 +00:00
let tmp9Result = null;
2026-07-20 16:05:17 +00:00
if (null != invite) {
2026-07-29 08:29:29 +00:00
const obj3 = { invite: null };
obj3[0] = invite;
tmp9Result = tmp9(InviteCard, obj3);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items2[2] = tmp9Result;
tmp9Result = null;
if (tmp7) {
const obj4 = { guildTemplate: null };
obj4[0] = guildTemplate;
tmp9Result = tmp9(GuildTemplateCard, obj4);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items2[3] = tmp9Result;
items1[1] = closure_21(closure_4, { children: items2 });
2026-07-20 16:05:17 +00:00
items1[2] = inlineButtons.inlineButtons;
2026-07-29 08:29:29 +00:00
obj[2] = items1;
obj[1] = closure_21(closure_6, obj);
2026-07-23 10:11:24 +00:00
return callback(closure_4, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ View: c4, Image: c5, ScrollView: closure_6 } = get_ActivityIndicator);
2026-07-23 10:11:24 +00:00
({ AnalyticEvents: closure_14, StorageKeys: closure_15, AuthStates: closure_16, InviteStates: closure_17 } = ME);
({ jsx: closure_20, jsxs: closure_21 } = jsxProd);
2026-07-29 08:29:29 +00:00
let closure_22 = createCacheKey.createStyles((arg0) => {
const obj = { container: { height: "100%", flex: 1, padding: 16 }, logo: { flex: 0, width: 93, height: 70, tintColor: "white", alignSelf: "center", marginBottom: 24 }, scrollViewContainer: { flexShrink: 0, flexGrow: 1, justifyContent: "center" }, header: { textAlign: "center", marginBottom: 8, textTransform: "uppercase" }, subHeader: null, subHeaderWithInvite: null, centerpieceContainer: null, buttonContainer: null };
2026-07-20 16:05:17 +00:00
let num = 300;
if (arg0) {
num = 480;
}
2026-07-29 08:29:29 +00:00
obj[4] = { fontSize: 18, textAlign: "center", alignSelf: "center", maxWidth: num, marginBottom: 24, marginHorizontal: 16 };
obj[5] = { marginBottom: 16 };
obj[6] = { flexGrow: 1, flexShrink: 1, justifyContent: "center" };
obj[7] = { paddingHorizontal: 28, maxWidth: 480, alignSelf: "center", width: "100%" };
2026-07-20 16:05:17 +00:00
return obj;
});
2026-07-29 08:29:29 +00:00
createCacheKey = { container: null, text: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { backgroundColor: ThemesDefault.colors.BACKGROUND_BASE_LOWEST, padding: 16, flexDirection: "row", borderRadius: ThemesDefault.radii.sm };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
createCacheKey[1] = { marginLeft: 16 };
2026-08-24 06:08:38 +00:00
let closure_23 = createCacheKey.createStyles(createCacheKey);
let result = require("set").fileFinishedImporting("modules/auth/native/components/Welcome.tsx");
2026-07-20 16:05:17 +00:00
export default function Welcome() {
2026-07-29 08:29:29 +00:00
const tmp3 = importDefault(stateFromStores[22])();
const tmp4 = callback3(tmp3);
2026-07-23 10:11:24 +00:00
let obj = _require(stateFromStores[24]);
_require = obj.useNavigation();
({ top, bottom } = importDefault(stateFromStores[25])());
2026-08-24 06:08:38 +00:00
obj1 = _require(stateFromStores[26]);
const items = [closure_13];
2026-07-29 08:29:29 +00:00
importDefault = obj1.useStateFromStores(items, () => displayedInviteCode.getDisplayedInviteCode());
2026-07-23 10:11:24 +00:00
let obj2 = _require(stateFromStores[26]);
2026-08-24 06:08:38 +00:00
const items1 = [closure_12];
2026-07-23 10:11:24 +00:00
stateFromStores = obj2.useStateFromStores(items1, () => {
2026-07-20 16:05:17 +00:00
let invite = null;
if (null != closure_1) {
2026-08-24 06:08:38 +00:00
invite = closure_1_12.getInvite(tmp);
2026-07-20 16:05:17 +00:00
}
return invite;
});
2026-07-23 10:11:24 +00:00
let obj3 = _require(stateFromStores[26]);
2026-08-24 06:08:38 +00:00
const items2 = [closure_9];
2026-07-29 08:29:29 +00:00
const stateFromStores1 = obj3.useStateFromStores(items2, () => store.getGuildTemplate(store.getDisplayedGuildTemplateCode()));
2026-07-23 10:11:24 +00:00
let obj4 = _require(stateFromStores[26]);
2026-08-24 06:08:38 +00:00
const items3 = [closure_7];
2026-07-29 08:29:29 +00:00
const React = obj4.useStateFromStores(items3, () => underageAnonymous.isUnderageAnonymous());
2026-07-23 10:11:24 +00:00
let obj5 = _require(stateFromStores[26]);
2026-08-24 06:08:38 +00:00
const items4 = [closure_10];
2026-07-29 08:29:29 +00:00
const stateFromStores2 = obj5.useStateFromStores(items4, () => store2.getHasLoggedInAccounts());
2026-07-23 10:11:24 +00:00
let obj6 = _require(stateFromStores[26]);
2026-08-24 06:08:38 +00:00
const items5 = [closure_10];
2026-07-29 08:29:29 +00:00
const stateFromStores3 = obj6.useStateFromStores(items5, () => store2.getCanUseMultiAccountMobile());
2026-07-23 10:11:24 +00:00
importDefault(stateFromStores[27])(() => {
2026-08-14 17:33:39 +00:00
let obj = navigation(stateFromStores[28]);
2026-07-20 16:05:17 +00:00
obj.trackAppUIViewed();
2026-08-14 17:33:39 +00:00
const result = navigation(stateFromStores[28]).trackAppLaunchCompleted();
2026-07-29 08:29:29 +00:00
let tmp6 = null;
2026-07-20 16:05:17 +00:00
if (null != stateFromStores) {
2026-07-29 08:29:29 +00:00
tmp6 = null;
if (null != tmp5.type) {
2026-08-24 06:08:38 +00:00
tmp6 = closure_1_19[tmp5.type];
2026-07-20 16:05:17 +00:00
}
}
2026-08-14 17:33:39 +00:00
const obj2 = navigation(stateFromStores[28]);
const tmp = navigation;
2026-07-29 08:29:29 +00:00
obj = { last_logout_ts: null, invite_type: null, guild_id: null, channel_id: null, invite_code: null };
const Storage = tmp(tmp2[30]).Storage;
2026-08-24 06:08:38 +00:00
obj[0] = Storage.get(closure_1_15.LOGOUT_TIMESTAMP_KEY);
2026-07-29 08:29:29 +00:00
obj[1] = tmp6;
2026-07-20 16:05:17 +00:00
let id;
2026-07-29 08:29:29 +00:00
if (stateFromStores != null) {
const guild = tmp5.guild;
if (guild != null) {
2026-07-20 16:05:17 +00:00
id = guild.id;
}
}
2026-07-29 08:29:29 +00:00
obj[2] = id;
2026-07-20 16:05:17 +00:00
let id1;
2026-07-29 08:29:29 +00:00
if (stateFromStores != null) {
const channel = tmp5.channel;
if (channel != null) {
2026-07-20 16:05:17 +00:00
id1 = channel.id;
}
}
2026-07-29 08:29:29 +00:00
obj[3] = id1;
2026-07-20 16:05:17 +00:00
let code;
2026-07-29 08:29:29 +00:00
if (stateFromStores != null) {
code = tmp5.code;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[4] = code;
2026-08-24 06:08:38 +00:00
callback(stateFromStores[29]).track(closure_1_14.APP_LANDING_VIEWED, obj);
2026-07-20 16:05:17 +00:00
});
const effect = React.useEffect(() => {
const locationMetadata = callback(stateFromStores[31]).getLocationMetadata();
}, []);
2026-07-23 10:11:24 +00:00
importDefault(stateFromStores[32])(hasLoadedExperiments.hasLoadedExperiments);
2026-07-20 16:05:17 +00:00
const effect1 = React.useEffect(() => {
});
const effect2 = React.useEffect(() => {
});
if (stateFromStores3) {
if (stateFromStores2) {
2026-07-29 08:29:29 +00:00
return callback(importDefault(tmp2[33]), {});
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj = { style: tmp4.buttonContainer, children: null };
obj = { children: null };
2026-07-20 16:05:17 +00:00
obj1 = {
2026-07-23 10:11:24 +00:00
size: "lg",
variant: "primary-overlay",
2026-07-20 16:05:17 +00:00
onPress: function handlePressRegister() {
2026-08-24 06:08:38 +00:00
if (closure_3) {
navigation.navigate(closure_1_16.AGE_GATE_UNDERAGE, { fromRegister: true });
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
const nextAuthState = navigation(stateFromStores[34]).getNextAuthState(closure_1_16.WELCOME);
2026-08-14 17:33:39 +00:00
const CommonActions = navigation(stateFromStores[35]).CommonActions;
navigation.dispatch(CommonActions.navigate(nextAuthState));
const obj = navigation(stateFromStores[34]);
2026-08-24 06:08:38 +00:00
callback(stateFromStores[29]).track(closure_1_14.REGISTER_VIEWED);
2026-07-20 16:05:17 +00:00
const obj2 = callback(stateFromStores[29]);
}
2026-07-29 08:29:29 +00:00
},
text: null
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
const intl = tmp5(tmp2[16]).intl;
obj1[3] = intl.string(_require(stateFromStores[16]).t.pV8xeR);
2026-08-06 08:05:19 +00:00
const items6 = [callback(_require(stateFromStores[37]).Button, obj1), ];
2026-07-20 16:05:17 +00:00
obj2 = {
2026-07-23 10:11:24 +00:00
size: "lg",
variant: "secondary-overlay",
2026-07-20 16:05:17 +00:00
onPress: function handlePressLogin() {
2026-08-24 06:08:38 +00:00
navigation.navigate(closure_1_16.LOGIN);
callback(stateFromStores[29]).track(closure_1_14.LOGIN_VIEWED, { source: "welcome" });
2026-07-29 08:29:29 +00:00
},
text: null
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
const intl2 = tmp5(tmp2[16]).intl;
obj2[3] = intl2.string(_require(stateFromStores[16]).t.dKhVQN);
2026-08-06 08:05:19 +00:00
items6[1] = callback(_require(stateFromStores[37]).Button, obj2);
2026-07-29 08:29:29 +00:00
obj[0] = items6;
2026-08-06 08:05:19 +00:00
obj[1] = callback2(_require(stateFromStores[36]).ButtonGroup, obj);
2026-07-29 08:29:29 +00:00
const tmp19 = callback(closure_4, obj);
obj3 = { style: null, children: null };
const items7 = [tmp4.container, ];
2026-08-24 06:08:38 +00:00
obj4 = { paddingTop: top + tmp5(tmp2[39]).NAV_BAR_HEIGHT, paddingBottom: bottom };
2026-07-29 08:29:29 +00:00
items7[1] = obj4;
obj3[0] = items7;
obj5 = { invite: stateFromStores, guildTemplate: stateFromStores1, inlineButtons: null };
let tmp21 = null;
if (tmp3) {
tmp21 = tmp19;
}
obj5[2] = tmp21;
const items8 = [callback(Centerpiece, obj5), , ];
let tmp22 = !tmp3;
if (!tmp3) {
tmp22 = tmp19;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj6 = { theme: "darker", children: null };
items8[1] = tmp22;
2026-08-06 08:05:19 +00:00
items8[2] = callback(_require(stateFromStores[40]).TTIFirstContentfulPaint, { label: "welcome" });
2026-07-29 08:29:29 +00:00
obj3[1] = items8;
obj6[1] = callback2(closure_4, obj3);
2026-08-06 08:05:19 +00:00
return callback(_require(stateFromStores[38]).ThemeContextProvider, obj6);
2026-07-20 16:05:17 +00:00
};