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,132 @@
// Metro module 2485 (f2486).
import { loadJsonAsset } from "../asset_json/native/AssetJsonUtils";
import * as _Module2486 from "../../_bundle/Module2486";
import * as _Module2487 from "../../_bundle/Module2487";
import * as _Module2488 from "../../_bundle/Module2488";
import * as _Module2489 from "../../_bundle/Module2489";
import * as _Module2490 from "../../_bundle/Module2490";
import * as _Module2491 from "../../_bundle/Module2491";
import * as _Module2492 from "../../_bundle/Module2492";
import * as _Module2493 from "../../_bundle/Module2493";
import * as _Module2494 from "../../_bundle/Module2494";
import * as _Module2495 from "../../_bundle/Module2495";
import * as _Module2496 from "../../_bundle/Module2496";
import * as _Module2497 from "../../_bundle/Module2497";
import * as _Module2498 from "../../_bundle/Module2498";
import * as _Module2499 from "../../_bundle/Module2499";
import * as _Module2500 from "../../_bundle/Module2500";
import * as _Module2501 from "../../_bundle/Module2501";
import * as _Module2502 from "../../_bundle/Module2502";
import * as _Module2503 from "../../_bundle/Module2503";
import * as _Module2504 from "../../_bundle/Module2504";
import * as _Module2505 from "../../_bundle/Module2505";
import * as _Module2506 from "../../_bundle/Module2506";
import * as _Module2507 from "../../_bundle/Module2507";
import * as _Module2508 from "../../_bundle/Module2508";
import * as _Module2509 from "../../_bundle/Module2509";
import * as _Module2510 from "../../_bundle/Module2510";
import * as _Module2511 from "../../_bundle/Module2511";
import * as _Module2512 from "../../_bundle/Module2512";
import * as _Module2513 from "../../_bundle/Module2513";
import * as _Module2514 from "../../_bundle/Module2514";
import * as _Module2515 from "../../_bundle/Module2515";
import * as _Module2516 from "../../_bundle/Module2516";
import { createLoader, makeMessagesProxy } from "../../_bundle/Module1274";
const loader = createLoader({
bg: () => loadJsonAsset(_Module2486).then((result) => ({
default: result
})),
cs: () => loadJsonAsset(_Module2487).then((result) => ({
default: result
})),
da: () => loadJsonAsset(_Module2488).then((result) => ({
default: result
})),
de: () => loadJsonAsset(_Module2489).then((result) => ({
default: result
})),
el: () => loadJsonAsset(_Module2490).then((result) => ({
default: result
})),
"en-GB": () => loadJsonAsset(_Module2491).then((result) => ({
default: result
})),
"es-419": () => loadJsonAsset(_Module2492).then((result) => ({
default: result
})),
"es-ES": () => loadJsonAsset(_Module2493).then((result) => ({
default: result
})),
fi: () => loadJsonAsset(_Module2494).then((result) => ({
default: result
})),
fr: () => loadJsonAsset(_Module2495).then((result) => ({
default: result
})),
hi: () => loadJsonAsset(_Module2496).then((result) => ({
default: result
})),
hr: () => loadJsonAsset(_Module2497).then((result) => ({
default: result
})),
hu: () => loadJsonAsset(_Module2498).then((result) => ({
default: result
})),
it: () => loadJsonAsset(_Module2499).then((result) => ({
default: result
})),
ja: () => loadJsonAsset(_Module2500).then((result) => ({
default: result
})),
ko: () => loadJsonAsset(_Module2501).then((result) => ({
default: result
})),
lt: () => loadJsonAsset(_Module2502).then((result) => ({
default: result
})),
nl: () => loadJsonAsset(_Module2503).then((result) => ({
default: result
})),
no: () => loadJsonAsset(_Module2504).then((result) => ({
default: result
})),
pl: () => loadJsonAsset(_Module2505).then((result) => ({
default: result
})),
"pt-BR": () => loadJsonAsset(_Module2506).then((result) => ({
default: result
})),
ro: () => loadJsonAsset(_Module2507).then((result) => ({
default: result
})),
ru: () => loadJsonAsset(_Module2508).then((result) => ({
default: result
})),
"sv-SE": () => loadJsonAsset(_Module2509).then((result) => ({
default: result
})),
th: () => loadJsonAsset(_Module2510).then((result) => ({
default: result
})),
tr: () => loadJsonAsset(_Module2511).then((result) => ({
default: result
})),
uk: () => loadJsonAsset(_Module2512).then((result) => ({
default: result
})),
vi: () => loadJsonAsset(_Module2513).then((result) => ({
default: result
})),
"zh-CN": () => loadJsonAsset(_Module2514).then((result) => ({
default: result
})),
"zh-TW": () => loadJsonAsset(_Module2515).then((result) => ({
default: result
})),
"en-US": () => loadJsonAsset(_Module2516).then((result) => ({
default: result
}))
}, "en-US");
const r51 = makeMessagesProxy(loader);
export default r51;
export { loader as messagesLoader };
@@ -0,0 +1,67 @@
// Metro module 16705 (f16706).
import { Endpoints } from "../../Constants";
import TrackedHTTPUtils from "../../utils/TrackedHTTPUtils";
import { NetworkActionNames } from "../../_bundle/Module503";
import APIError from "../../errors/APIError";
export async function getCurrentTask() {
let c31102_0 = await TrackedHTTPUtils.get({
url: Endpoints.SAFETY_FLOWS_TASK,
trackedActionData: {
event: NetworkActionNames.USER_VERIFY
},
rejectWithError: true
});
return c31102_0.status !== 204 ? c31102_0.body : null;
}
export async function completeTask(body) {
return (await TrackedHTTPUtils.post({
url: Endpoints.SAFETY_FLOWS_TASK,
body,
trackedActionData: {
event: NetworkActionNames.USER_VERIFY
},
rejectWithError: true
})).body;
}
export async function resendVerificationCode(flow_id) {
let r47;
let c28500_3;
let c28500_4 = 0;
let c31103_0;
try {
c28500_4 = 1;
r47 = await TrackedHTTPUtils.post({
url: Endpoints.SAFETY_FLOWS_RESEND_VERIFICATION_CODE,
body: {
flow_id
},
trackedActionData: {
event: NetworkActionNames.USER_VERIFY
},
rejectWithError: true
});
c28500_4 = 0;
} catch ($e) {
const r26 = $e;
let r8 = r26;
c28500_3 = r26;
if (c28500_4 !== 0) {
while (true) {
try {
const r65 = c28500_3;
c28500_4 = 0;
c31103_0 = r65;
throw new APIError(c31103_0);
} catch (r61) {
r8 = r61;
c28500_3 = r61;
if (c28500_4 === 0) {
break;
}
}
}
}
throw r8;
}
return r47;
}
@@ -0,0 +1,28 @@
// Metro module 16339 (f16340).
import ApexExperiment from "../experiments/apex/ApexExperiment";
let c11754_0 = ApexExperiment({
name: "2026-04-safety-flows",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
0: {
enabled: false
},
1: {
enabled: true
}
}
});
export default c11754_0;
export function isEligibleForSafetyFlowsExperiment(a0) {
return c11754_0.getConfig({
location: a0.location
}).enabled;
}
export function useIsEligibleForSafetyFlowsExperiment(a0) {
return c11754_0.useConfig({
location: a0.location
}).enabled;
}
@@ -0,0 +1,24 @@
// Metro module 16701 (f16702).
import { openSafetyFlow } from "./openSafetyFlow.native";
import AutomaticLifecycleManager from "../../lib/AutomaticLifecycleManager";
let handleSafetyFlowsModalOpen, handleUserRequiredActionUpdate;
const handleConnectionOpenSupplemental = function handleConnectionOpenSupplemental() {
openSafetyFlow();
};
handleSafetyFlowsModalOpen = function handleSafetyFlowsModalOpen() {
openSafetyFlow();
};
handleUserRequiredActionUpdate = function handleUserRequiredActionUpdate(a0) {
openSafetyFlow({
requiredAction: a0.requiredAction
});
};
class SafetyFlowsManager extends AutomaticLifecycleManager {
actions = {
CONNECTION_OPEN_SUPPLEMENTAL: handleConnectionOpenSupplemental,
SAFETY_FLOWS_MODAL_OPEN: handleSafetyFlowsModalOpen,
USER_REQUIRED_ACTION_UPDATE: handleUserRequiredActionUpdate
};
}
const safetyFlowsManager = new SafetyFlowsManager();
export default safetyFlowsManager;
@@ -0,0 +1,11 @@
// Metro module 16708 (f16709).
import { createContext, useContext } from "react";
const context = createContext(null);
export { context as SafetyFlowTaskContext };
export function useSafetyFlowTask() {
const context2 = useContext(context);
if (context2 == null) {
throw new Error("useSafetyFlowTask must be used within a SafetyFlowTaskContext Provider");
}
return context2;
}
+2
View File
@@ -0,0 +1,2 @@
// Metro module 16704 (f16705).
export const SAFETY_FLOWS_MODAL_KEY = "SAFETY_FLOWS_MODAL_KEY";
@@ -0,0 +1,86 @@
// Metro module 16723 (f16724).
import { useState } from "react";
import { View } from "react-native";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { useNavigation } from "../../../design/components/Navigator/native/useNavigation.native";
import { getCurrentTask } from "../SafetyFlowsActionCreators";
import { navigateToScreenForTask } from "./SafetyFlowsUtils";
import { Text } from "../../../design/components/Text/native/Text";
import { intl, t } from "../../../intl/index.native";
import { Stack } from "../../../design/components/Stack/native/Stack.native";
import { Button } from "../../../design/components/Button/native/Button.native";
import AuthenticationActionCreators from "../../../actions/AuthenticationActionCreators";
const useStyles = createStyles({
container: {
flexDirection: "column",
justifyContent: "center",
gap: Module712.space.PX_8,
padding: Module712.space.PX_16,
alignItems: "center"
},
buttonContainer: {
marginTop: Module712.space.PX_8
}
});
export default function ErrorScreen() {
let navigation;
let _handleRetry2 = function _handleRetry() {
const r9 = async () => {
let c31106_2;
let c31106_3 = 0;
let c31839_0;
try {
c31839_0 = void 0;
c31106_3 = 1;
setState(true);
c31839_0 = await getCurrentTask();
if (c31839_0 != null) {
navigateToScreenForTask(navigation, c31839_0);
}
c31106_3 = 0;
(0, setState)(false);
} catch ($e) {
const r27 = $e;
let r7 = r27;
c31106_2 = r27;
if (c31106_3 !== 0) {
while (true) {
try {
const r77 = c31106_2;
c31106_3 = 0;
(0, setState)(false);
throw r77;
} catch (r74) {
r7 = r74;
c31106_2 = r74;
if (c31106_3 === 0) {
break;
}
}
}
}
throw r7;
}
};
_handleRetry2 = r9;
return r9.apply(this, arguments);
};
const [loading, setState] = useState(false);
navigation = useNavigation();
const styles = useStyles();
return <View style={styles.container}>
<Text variant="heading-lg/semibold">
{intl.string(t.c6kn6F)}
</Text>
<Text variant="text-md/normal" color="text-muted">
{intl.string(t.ZUEGFn)}
</Text>
<Stack style={styles.buttonContainer} spacing={8}>
<Button onPress={() => AuthenticationActionCreators.logout("safety_flows_error_screen")} text={intl.string(t["2jxGer"])} variant="secondary" size="md" />
<Button onPress={function handleRetry() {
return _handleRetry2.apply(this, arguments);
}} text={intl.string(t["7NqTJn"])} variant="primary" size="md" loading={loading} />
</Stack>
</View>;
};
@@ -0,0 +1,17 @@
// Metro module 16710 (f16711).
import { ModalDisclaimer } from "../../../design/components/Modal/native/ModalDisclaimer.native";
import { Text } from "../../../design/components/Text/native/Text";
import { intl } from "../../../intl/index.native";
import SafetyFlows_messages from "../SafetyFlows.messages";
import AuthenticationActionCreators from "../../../actions/AuthenticationActionCreators";
export default function LogOutDisclaimer() {
return <ModalDisclaimer>
<Text variant="text-xs/medium">
{intl.format(SafetyFlows_messages["0DHxym"], {
handleLogOut: () => {
AuthenticationActionCreators.logout("safety_flows_enter_email_screen");
}
})}
</Text>
</ModalDisclaimer>;
};
@@ -0,0 +1,71 @@
// Metro module 16707 (f16708).
import { useCallback } from "react";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import { useSafetyFlowTask } from "../SafetyFlowsTaskContext";
import { useNavigation } from "../../../design/components/Navigator/native/useNavigation.native";
import { getScreensForTaskType } from "./SafetyFlowsUtils";
import { ModalScreen } from "../../../design/components/Modal/native/ModalScreen.native";
import { ModalContent } from "../../../design/components/Modal/native/ModalContent.native";
import { Stack } from "../../../design/components/Stack/native/Stack.native";
import Module712 from "../../../_bundle/Module712";
import { Text } from "../../../design/components/Text/native/Text";
import { intl } from "../../../intl/index.native";
import SafetyFlows_messages from "../SafetyFlows.messages";
import { TableRowGroup } from "../../../design/components/TableRow/native/TableRowGroup.native";
import SafetyTipsRow from "../../self_mod/shared/native/SafetyTipsRow";
import { TASK_TYPE_TO_TITLE } from "../types";
import { ModalFooter } from "../../../design/components/Modal/native/ModalFooter.native";
import LogOutDisclaimer from "./LogOutDisclaimer";
import { ModalActionButton } from "../../../design/components/Modal/native/ModalActionButton.native";
const useStyles = createStyles({
content: {
margin: "auto",
overflow: "visible",
justifyContent: "center",
textAlign: "center",
alignItems: "center"
},
title: {
textAlign: "center",
textTransform: "uppercase",
lineHeight: 50
}
});
export default function OverviewScreen() {
const styles = useStyles();
const task = useSafetyFlowTask().task;
const navigation = useNavigation();
const callback = useCallback(() => {
const screensForTaskType = getScreensForTaskType(task.task_type);
if (screensForTaskType != null && screensForTaskType.length > 0 && screensForTaskType[0] != null) {
navigation.push(screensForTaskType[0]);
}
}, [task, navigation]);
const r59 = [<Text variant="display-lg" style={styles.title}>
{intl.string(SafetyFlows_messages.RRamMH)}
</Text>, <Text variant="text-md/medium" color="text-strong">
{intl.string(SafetyFlows_messages.I2Ctk1)}
</Text>, ,];
const flow_context = task.flow_context;
const r2 = flow_context == null;
let r84 = void 0;
if (!r2) {
const tasks = flow_context.tasks;
r84 = tasks == null ? void 0 : tasks.map((task, a1) => <SafetyTipsRow key={task.task_type} tip={TASK_TYPE_TO_TITLE[task.task_type]} index={a1 + 1} />);
}
r59[2] = <Stack spacing={Module712.space.PX_8}>
<TableRowGroup hasIcons>{r84}</TableRowGroup>
<Text variant="text-xs/medium" color="text-muted">
{intl.string(SafetyFlows_messages["0TnUrG"])}
</Text>
</Stack>;
return <ModalScreen>
<ModalContent>
<Stack spacing={Module712.space.PX_16} style={styles.content}>{r59}</Stack>
</ModalContent>
<ModalFooter>
<LogOutDisclaimer />
<ModalActionButton variant="primary" text={intl.string(SafetyFlows_messages.Ks6opt)} onPress={callback} />
</ModalFooter>
</ModalScreen>;
};
@@ -0,0 +1,43 @@
// Metro module 16712 (f16713).
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import { ModalScreen } from "../../../design/components/Modal/native/ModalScreen.native";
import { ModalContent } from "../../../design/components/Modal/native/ModalContent.native";
import { Stack } from "../../../design/components/Stack/native/Stack.native";
import { Text } from "../../../design/components/Text/native/Text";
import { ModalFooter } from "../../../design/components/Modal/native/ModalFooter.native";
import LogOutDisclaimer from "./LogOutDisclaimer";
import { ModalActionButton } from "../../../design/components/Modal/native/ModalActionButton.native";
const useStyles = createStyles({
header: {
textAlign: "center"
}
});
export default function SafetyFlowTaskScreen(props) {
const { ImageComponent, title, subtitle, subtitleColor = "text-strong", action = null, onAction } = props;
let footer = props.footer;
const { children, submitting } = props;
let withLogout = props.withLogout;
if (withLogout === void 0) {
withLogout = true;
}
const styles = useStyles();
const r48 = [<ModalContent>
<Stack align="center" justify="center" spacing={8}>
{ImageComponent != null && ImageComponent}
<Text accessibilityRole="header" variant="heading-xl/bold" color="mobile-text-heading-primary" style={styles.header}>{title}</Text>
{subtitle != null && <Text variant="text-md/medium" color={subtitleColor} style={styles.header}>{subtitle}</Text>}
</Stack>
{children}
</ModalContent>, ,];
if (footer === void 0) {
if (withLogout) {
withLogout = <LogOutDisclaimer />;
}
footer = <ModalFooter>
{withLogout}
{action != null && <ModalActionButton variant="primary" text={action} onPress={onAction} loading={submitting} />}
</ModalFooter>;
}
r48[1] = footer;
return <ModalScreen>{r48}</ModalScreen>;
};
@@ -0,0 +1,72 @@
// Metro module 16706 (f16707).
import { useState, useMemo } from "react";
import { useNavigatorScreens } from "../../../design/components/Navigator/native/Navigator.native";
import { SafetyFlowScreens, TaskType } from "../types";
import OverviewScreen from "./OverviewScreen";
import EnterEmailScreen from "./tasks/EnterEmailScreen";
import { getHeaderBackButton } from "../../../design/components/Navigator/native/NavigatorHeader.native";
import VerifyEmailScreen from "./tasks/VerifyEmailScreen";
import UpdateAppScreen from "./UpdateAppScreen";
import AgeVerificationScreen from "./tasks/AgeVerificationScreen";
import { ParentalConsentConnectionNavbar } from "./tasks/ParentalConsentConnectionHeader";
import ParentalConsentConnectionScreen from "./tasks/ParentalConsentConnectionScreen";
import ErrorScreen from "./ErrorScreen";
import { getScreensForTaskType } from "./SafetyFlowsUtils";
import { SafetyFlowTaskContext } from "../SafetyFlowsTaskContext";
import { StepModal } from "../../../design/components/Modal/native/StepModal.native";
export default function SafetyFlowsModal(props) {
const { task, initialScreen } = props;
const [state, setState] = useState(task);
const navigatorScreens = useNavigatorScreens(() => {
const r1 = {};
r1[SafetyFlowScreens.OVERVIEW] = {
headerLeft: () => null,
headerShown: false,
render: () => <OverviewScreen />
};
r1[SafetyFlowScreens.ENTER_EMAIL] = {
headerLeft: () => null,
headerTitle: () => null,
render: () => <EnterEmailScreen />
};
r1[SafetyFlowScreens.VERIFY_EMAIL] = {
headerLeft: getHeaderBackButton(),
headerTitle: () => null,
render: () => <VerifyEmailScreen />
};
r1[SafetyFlowScreens.UPDATE_APP] = {
headerLeft: () => null,
headerTitle: () => null,
render: () => <UpdateAppScreen />
};
r1[SafetyFlowScreens.AGE_VERIFICATION] = {
headerLeft: () => null,
headerTitle: () => null,
render: () => <AgeVerificationScreen />
};
r1[SafetyFlowScreens.PARENTAL_CONSENT_CONNECTION] = {
headerShown: false,
customNavbar: () => <ParentalConsentConnectionNavbar />,
render: () => <ParentalConsentConnectionScreen />
};
r1[SafetyFlowScreens.ERROR] = {
headerLeft: () => null,
headerTitle: () => null,
render: () => <ErrorScreen />
};
return r1;
}, []);
const memo = useMemo(() => {
if (state?.flow_context == null) {
return [];
}
const tasks = state.flow_context.tasks;
return tasks.length === 1 && tasks[0].task_type === TaskType.PARENTAL_CONSENT_CONNECTION ? [] : state.flow_context.tasks.map((task) => getScreensForTaskType(task.task_type)).filter((item) => item != null).flat();
}, [state]);
return <SafetyFlowTaskContext.Provider value={useMemo(() => ({
task: state,
setTask: setState
}), [state])}>
<StepModal initialRouteName={initialScreen} screens={navigatorScreens} steps={memo} />
</SafetyFlowTaskContext.Provider>;
};
@@ -0,0 +1,74 @@
// Metro module 16709 (f16710).
import { useCallback } from "react";
import UserStore from "../../../stores/UserStore";
import { TASK_TYPE_TO_SCREENS, TaskType, SafetyFlowScreens } from "../types";
import { getCurrentTask, completeTask } from "../SafetyFlowsActionCreators";
import ModalActionCreators from "../../../actions/ModalActionCreators";
import { SAFETY_FLOWS_MODAL_KEY } from "../constants";
import ToastActionCreators from "../../toast/native/ToastActionCreators";
import Module10356 from "../../../_bundle/Module10356";
import { intl } from "../../../intl/index.native";
import SafetyFlows_messages from "../SafetyFlows.messages";
import { useNavigation } from "../../../design/components/Navigator/native/useNavigation.native";
import { useSafetyFlowTask } from "../SafetyFlowsTaskContext";
let navigateToScreenForTask;
let env12038 = {};
export async function fetchAndUpdateTask(c28501_0) {
let c31104_0 = c28501_0;
let c31104_1 = await getCurrentTask();
if (c31104_1 != null) {
(0, c31104_0)(c31104_1);
}
return c31104_1;
}
navigateToScreenForTask = function navigateToScreenForTask(a0, a1) {
if (a1 == null) {
ModalActionCreators.popWithKey(SAFETY_FLOWS_MODAL_KEY);
ToastActionCreators.open({
key: "SAFETY_FLOWS_VERIFY_EMAIL_SUCCESS",
icon: Module10356,
content: intl.string(SafetyFlows_messages["/fHz9S"])
});
return void 0;
}
const task_type = a1.task_type;
const r9 = TASK_TYPE_TO_SCREENS[task_type];
const r14 = r9 == null ? null : task_type === TaskType.EMAIL_VERIFICATION ? UserStore.getCurrentUser()?.email != null ? [SafetyFlowScreens.VERIFY_EMAIL] : r9 : r9;
if (r14 != null) {
a0.push(r14[0]);
} else {
a0.push(SafetyFlowScreens.UPDATE_APP);
}
};
export function getScreensForTaskType(a0) {
const r8 = TASK_TYPE_TO_SCREENS[a0];
return r8 == null ? null : a0 === TaskType.EMAIL_VERIFICATION ? UserStore.getCurrentUser()?.email != null ? [SafetyFlowScreens.VERIFY_EMAIL] : r8 : r8;
}
export { navigateToScreenForTask };
export function useOnTaskComplete() {
let env23381 = {
$parent: env12038
};
const navigation = useNavigation();
env23381[0] = navigation;
const safetyFlowTask = useSafetyFlowTask();
const task = safetyFlowTask.task;
env23381[1] = task;
const setTask = safetyFlowTask.setTask;
env23381[2] = setTask;
let c23382_0 = async (data) => {
let c31105_2;
c31105_2 = void 0;
const r33 = env23381[1];
await completeTask({
task_id: r33.task_id,
flow_id: r33.flow_context.flow_id,
data
});
let c31838_0 = await (0, fetchAndUpdateTask)(env23381[2]);
(0, navigateToScreenForTask)(env23381[0], c31838_0);
};
return useCallback(function() {
return c23382_0.apply(this, arguments);
}, [navigation, task, setTask]);
}
@@ -0,0 +1,34 @@
// Metro module 16715 (f16716).
import { NativeModules, View } from "react-native";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { Text } from "../../../design/components/Text/native/Text";
import { intl } from "../../../intl/index.native";
import SafetyFlows_messages from "../SafetyFlows.messages";
import { Button } from "../../../design/components/Button/native/Button.native";
const useStyles = createStyles({
container: {
flexDirection: "column",
justifyContent: "center",
gap: Module712.space.PX_8
},
buttonContainer: {
marginTop: Module712.space.PX_8
}
});
export default function UpdateAppScreen() {
const styles = useStyles();
return <View style={styles.container}>
<Text variant="heading-lg/semibold">
{intl.string(SafetyFlows_messages.yxqMCD)}
</Text>
<Text variant="text-md/normal" color="text-muted">
{intl.string(SafetyFlows_messages.VBZJJg)}
</Text>
<View style={styles.buttonContainer}>
<Button onPress={function onPress() {
NativeModules.BundleUpdaterManager.reload();
}} text={intl.string(SafetyFlows_messages.o4D6fm)} variant="primary" size="md" />
</View>
</View>;
};
@@ -0,0 +1,67 @@
// Metro module 16716 (f16717).
import { useMemo, useEffect } from "react";
import { Pressable } from "react-native";
import UserStore from "../../../../stores/UserStore";
import { HelpdeskArticles } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { v4 } from "../../../../_bundle/Module514";
import { useOnTaskComplete } from "../SafetyFlowsUtils";
import { useStateFromStores } from "../../../../_bundle/Module589";
import useAgeVerificationMethods from "../../../age_assurance/hooks/useAgeVerificationMethods";
import { TaskInputType } from "../../types";
import { AgeVerificationStatusUkAndAusOnly } from "../../../../flow/Server";
import { trackAgeVerificationModalViewed, AgeVerificationModalVersion, AgeVerificationModalEntryPoint } from "../../../age_assurance/AgeVerificationAnalyticsUtils";
import SafetyFlowTaskScreen from "../SafetyFlowTaskScreen";
import { ShieldSpotIllustration } from "../../../../design/assets/native";
import { intl, t } from "../../../../intl/index.native";
import SafetyFlows_messages from "../../SafetyFlows.messages";
import AgeAssurance_messages from "../../../age_assurance/AgeAssurance.messages";
import AgeVerificationActionCreators_native from "../../../age_assurance/AgeVerificationActionCreators.native";
import HelpdeskUtils from "../../../../utils/HelpdeskUtils";
import { ModalDisclaimer } from "../../../../design/components/Modal/native/ModalDisclaimer.native";
import AuthenticationActionCreators from "../../../../actions/AuthenticationActionCreators";
import { Text } from "../../../../design/components/Text/native/Text";
import { AgeVerificationMethodsContainer } from "../../../age_assurance/native/AgeVerificationMethodsContainer";
const useStyles = createStyles({
helpLink: {
textAlign: "center"
}
});
export default function AgeVerificationScreen() {
let onTaskComplete, stateFromStores;
const memo = useMemo(() => v4(), []);
const styles = useStyles();
onTaskComplete = useOnTaskComplete();
stateFromStores = useStateFromStores([UserStore], () => UserStore.getCurrentUser());
const ageVerificationMethods = useAgeVerificationMethods({
onClose: () => onTaskComplete({
type: TaskInputType.Empty
})
});
const { loading, ageVerificationMethods: ageVerificationMethods2 } = ageVerificationMethods;
useEffect(() => {
if (stateFromStores?.ageVerificationStatus !== AgeVerificationStatusUkAndAusOnly.UNVERIFIED) {
onTaskComplete({
type: TaskInputType.Empty
});
}
}, [onTaskComplete, stateFromStores]);
useEffect(() => {
trackAgeVerificationModalViewed(memo, AgeVerificationModalVersion.EXPRESSIVE_PRIMARY, AgeVerificationModalEntryPoint.SAFETY_FLOWS);
}, [memo]);
return <SafetyFlowTaskScreen ImageComponent={<ShieldSpotIllustration />} title={intl.string(SafetyFlows_messages["dSkE/A"])} subtitle={intl.format(AgeAssurance_messages.RpMIT0, {
handleOnHelpUrlHook: () => {
AgeVerificationActionCreators_native.openUrl(HelpdeskUtils.getArticleURL(HelpdeskArticles.TIGGER_PAWTECT_LEARN_MORE));
}
})} footer={<ModalDisclaimer>
<Pressable accessibilityRole="button" onPress={() => {
AuthenticationActionCreators.logout("age_verification_screen");
}}>
<Text variant="text-sm/medium" color="text-link" style={styles.helpLink}>
{intl.string(t["2jxGer"])}
</Text>
</Pressable>
</ModalDisclaimer>} submitting={loading}>
<AgeVerificationMethodsContainer ageVerificationMethods={ageVerificationMethods2} modalSessionId={memo} />
</SafetyFlowTaskScreen>;
};
@@ -0,0 +1,20 @@
// Metro module 16711 (f16712).
import { useState } from "react";
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import SafetyFlowTaskScreen from "../SafetyFlowTaskScreen";
import { intl } from "../../../../intl/index.native";
import SafetyFlows_messages from "../../SafetyFlows.messages";
import { SafetyFlowScreens } from "../../types";
import { Stack } from "../../../../design/components/Stack/native/Stack.native";
import { TextInput } from "../../../../design/components/TextInput/native/TextInput.native";
export default function EnterEmailScreen() {
const navigation = useNavigation();
const [value, onChange] = useState("");
return <SafetyFlowTaskScreen title={intl.string(SafetyFlows_messages.bFbsV6)} action={intl.string(SafetyFlows_messages.RRBNpv)} onAction={() => {
navigation.push(SafetyFlowScreens.VERIFY_EMAIL);
}}>
<Stack>
<TextInput label="Email" value={value} onChange={onChange} />
</Stack>
</SafetyFlowTaskScreen>;
};
@@ -0,0 +1,40 @@
// Metro module 16717 (f16718).
import { View } from "react-native";
import UserStore from "../../../../stores/UserStore";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { NAV_BAR_HEIGHT } from "../../../../design/components/Navigator/native/NavigatorConstants.native";
import Module712 from "../../../../_bundle/Module712";
import useSafeAreaInsets_native from "../../../safe_area/useSafeAreaInsets.native";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { Text } from "../../../../design/components/Text/native/Text";
import AuthenticationActionCreators from "../../../../actions/AuthenticationActionCreators";
import { intl } from "../../../../intl/index.native";
import SafetyFlows_messages from "../../SafetyFlows.messages";
const useStyles = createStyles({
row: {
height: NAV_BAR_HEIGHT,
flexDirection: "row",
alignItems: "center",
justifyContent: "center",
paddingHorizontal: Module712.space.PX_16
},
logOut: {
position: "absolute",
left: Module712.space.PX_16
}
});
export function ParentalConsentConnectionNavbar() {
const styles = useStyles();
const top = useSafeAreaInsets_native().top;
const stateFromStores = useStateFromStores([UserStore], () => UserStore.getCurrentUser()?.username);
return <View style={{
paddingTop: top
}}>
<View style={styles.row}>
<Text accessibilityRole="button" variant="text-md/medium" color="text-link" style={styles.logOut} onPress={() => AuthenticationActionCreators.logout("safety_flows_parental_consent_connection")}>
{intl.string(SafetyFlows_messages["3HuGuY"])}
</Text>
{stateFromStores != null && <Text accessibilityRole="header" variant="text-md/semibold" color="mobile-text-heading-primary">{stateFromStores}</Text>}
</View>
</View>;
}
@@ -0,0 +1,199 @@
// Metro module 16718 (f16719).
import { useState, useCallback } from "react";
import { View } from "react-native";
import FamilyCenterStore from "../../../parent_tools/FamilyCenterStore";
import UserStore from "../../../../stores/UserStore";
import { CONNECT_GUARDIAN_BOTTOM_SHEET_KEY } from "../../../parent_tools/FamilyCenterConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useOnTaskComplete } from "../SafetyFlowsUtils";
import { useSafetyFlowTask } from "../../SafetyFlowsTaskContext";
import { useFamilyCenterActions } from "../../../parent_tools/hooks/useFamilyCenterActions";
import useMountEffect from "../../../../hooks/useMountEffect";
import { clearWarning } from "../../../parent_tools/ParentalConsentWarningActionCreators";
import useOnNewPendingRequest from "../../../parent_tools/hooks/useOnNewPendingRequest";
import { usePendingRequestCount, useHasActiveParentLinks } from "../../../parent_tools/hooks/useUserLinks";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { shareGuardianConnectLink } from "../../../parent_tools/native/shareGuardianConnectLink";
import { useDerivedPendingRequests } from "../../usePendingParentRequests";
import { TaskInputType } from "../../types";
import ToastActionCreators from "../../../toast/native/ToastActionCreators";
import { intl } from "../../../../intl/index.native";
import SafetyFlows_messages from "../../SafetyFlows.messages";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import SafetyFlowTaskScreen from "../SafetyFlowTaskScreen";
import { ModalFooter } from "../../../../design/components/Modal/native/ModalFooter.native";
import { Stack } from "../../../../design/components/Stack/native/Stack.native";
import AgeUpdateFooter from "../../../parental_consent/native/AgeUpdateFooter";
import { ModalActionButton } from "../../../../design/components/Modal/native/ModalActionButton.native";
import PendingRequestList from "./PendingRequestList";
import { Text } from "../../../../design/components/Text/native/Text";
import FamilyCenter_messages from "../../../parent_tools/FamilyCenter.messages";
import { ConnectGuardianCard } from "../../../parent_tools/native/ConnectGuardianCard";
const link = "https://support.discord.com/hc/articles/14155060633623";
const useStyles = createStyles({
body: {
marginTop: Module712.space.PX_24
},
cardSection: {
alignItems: "center"
},
cardTitle: {
marginTop: Module712.space.PX_12,
marginBottom: Module712.space.PX_24,
textAlign: "center"
}
});
export default function ParentalConsentConnectionScreen() {
let link_code, expiresAt, stateFromStores;
const styles = useStyles();
const onTaskComplete = useOnTaskComplete();
const task = useSafetyFlowTask().task;
const getLinkCode = useFamilyCenterActions().getLinkCode;
useMountEffect(() => {
clearWarning();
});
useOnNewPendingRequest(getLinkCode);
let component = task.ui_component.component;
if (component == null) {
component = {};
}
const link_code2 = component.link_code;
let r13 = "";
const r15 = typeof link_code2 === "string" ? component.link_code : "";
if (typeof component.link_code_expires_at === "string") {
r13 = component.link_code_expires_at;
}
const r17 = Array.isArray(component.pending_requests) ? component.pending_requests : [];
const pendingRequestCount = usePendingRequestCount();
const hasActiveParentLinks = useHasActiveParentLinks();
const stateFromStores2 = useStateFromStores([FamilyCenterStore], () => FamilyCenterStore.getLinkedUsers());
const stateFromStores3 = useStateFromStores([FamilyCenterStore], () => FamilyCenterStore.getAreLinkedUsersProcessed());
let r76 = stateFromStores3 ? Object.values(stateFromStores2).some((item) => item != null) : r17.length > 0;
const pendingCount = stateFromStores3 ? pendingRequestCount : r17.length;
const [state, setState2] = useState(r76);
if (r76) {
r76 = !state;
}
if (r76) {
setState2(true);
}
const stateFromStores4 = useStateFromStores([FamilyCenterStore], () => FamilyCenterStore.getLinkCode());
const stateFromStores5 = useStateFromStores([FamilyCenterStore], () => FamilyCenterStore.getLinkCodeExpiresAt());
let r101 = stateFromStores4;
if (r101 == null) {
r101 = r15;
}
link_code = r101;
let r102 = stateFromStores5;
if (r102 == null) {
r102 = Date.parse(r13);
}
expiresAt = r102;
stateFromStores = useStateFromStores([UserStore], () => UserStore.getCurrentUser());
const callback2 = useCallback(() => {
if (stateFromStores != null && link_code !== "") {
shareGuardianConnectLink(stateFromStores, link_code);
}
}, [stateFromStores, link_code]);
const derivedPendingRequests = useDerivedPendingRequests(r17, stateFromStores3);
const [submitting, setState] = useState(false);
const callback = useCallback(async () => {
let c28505_2;
let c28505_3 = 0;
L10: {
try {
setState(true);
c28505_3 = 2;
await onTaskComplete({
type: TaskInputType.Empty
});
c28505_3 = 1;
c28505_3 = 0;
(0, setState)(false);
} catch ($e) {
const r28 = $e;
let r7 = r28;
c28505_2 = r28;
let r29 = c28505_3;
if (r29 !== 0) {
while (true) {
if (r29 === 1) {
try {
const r90 = c28505_2;
c28505_3 = 0;
(0, setState)(false);
throw r90;
} catch (r88) {
r7 = r88;
c28505_2 = r88;
r29 = c28505_3;
if (r29 === 0) {
break;
}
}
} else {
try {
c28505_3 = 1;
ToastActionCreators.open({
key: "SAFETY_FLOWS_PARENTAL_CONSENT_CONNECTION_ERROR",
content: intl.string(SafetyFlows_messages["+QRSxc"])
});
c28505_3 = 0;
(0, setState)(false);
break L10;
} catch (r63) {
r7 = r63;
c28505_2 = r63;
r29 = c28505_3;
if (r29 === 0) {
break;
}
}
}
}
}
throw r7;
}
}
}, [onTaskComplete]);
const callback3 = useCallback(() => {
ActionSheetActionCreators.openLazy(import("../../../parent_tools/native/ConnectGuardianBottomSheet"), CONNECT_GUARDIAN_BOTTOM_SHEET_KEY, {
linkCode: link_code,
expiresAt,
onRefresh: getLinkCode,
title: intl.string(SafetyFlows_messages.dMMSA0),
body: intl.format(SafetyFlows_messages["6GaRTu"], {
link
})
});
}, [link_code, expiresAt, getLinkCode]);
const props = {
title: intl.string(SafetyFlows_messages.dMMSA0),
subtitle: state ? intl.format(SafetyFlows_messages["Ke+kz5"], {
pendingCount,
link
}) : intl.format(SafetyFlows_messages["6GaRTu"], {
link
}),
subtitleColor: "text-muted",
submitting,
footer: null,
children: null
};
props.footer = <ModalFooter>
<Stack spacing={Module712.space.PX_16}>
<AgeUpdateFooter />
{state && <ModalActionButton variant="primary" text={intl.string(SafetyFlows_messages.OaHZUf)} disabled={hasActiveParentLinks ? submitting : !hasActiveParentLinks} loading={submitting} onPress={callback} />}
</Stack>
</ModalFooter>;
props.children = <Stack spacing={Module712.space.PX_16} style={styles.body}>
{state ? <PendingRequestList pendingRequests={derivedPendingRequests} linkedUsersProcessed={stateFromStores3} expiresAt={expiresAt} onRefreshLinkCode={getLinkCode} onShare={callback2} onInviteAnotherGuardian={callback3} /> : <View style={styles.cardSection}>
<Text style={styles.cardTitle} variant="text-md/semibold" color="mobile-text-heading-primary">
{intl.string(FamilyCenter_messages.pojgfk)}
</Text>
<ConnectGuardianCard shareActions="full" linkCode={link_code} expiresAt={expiresAt} onRefresh={getLinkCode} />
</View>}
</Stack>;
return <SafetyFlowTaskScreen {...props} />;
};
@@ -0,0 +1,231 @@
// Metro module 16721 (f16722).
import { Fragment } from "react";
import { ActivityIndicator, View } from "react-native";
import UserStore from "../../../../stores/UserStore";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { Avatar, Icon, AVATAR_SIZE_MAP, AvatarSizes } from "../../../../design/void/native";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { usePendingRequestResolution, usePendingRequestListController } from "../../usePendingParentRequests";
import { formatPendingRequestSentText } from "../../pendingRequestTimestamp";
import AvatarUtils from "../../../../utils/AvatarUtils";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import SafetyFlows_messages from "../../SafetyFlows.messages";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
import FamilyCenter_messages from "../../../parent_tools/FamilyCenter.messages";
import { CheckmarkLargeBoldIcon } from "../../../../design/components/Icon/native/redesign/generated/CheckmarkLargeBoldIcon";
import Module13954 from "../../../../_bundle/Module13954";
import useRefreshLinkCodeOnExpiry from "../../../parent_tools/hooks/useRefreshLinkCodeOnExpiry";
import ToastActionCreators from "../../../toast/native/ToastActionCreators";
import { Stack } from "../../../../design/components/Stack/native/Stack.native";
import { PlaneIllocon } from "../../../../design/assets/native";
import { ShareIcon } from "../../../../design/components/Icon/native/redesign/generated/ShareIcon";
import { QrCodeIcon } from "../../../../design/components/Icon/native/redesign/generated/QrCodeIcon";
let useStyles;
const PendingRequestRow = function PendingRequestRow(props) {
const { request, hasMaxConnections: hasMaxConnections2, isAcceptLoading: isAcceptLoading2, isDeclineLoading: isDeclineLoading2, actionsDisabled: actionsDisabled2, onAccept, onDecline } = props;
const styles2 = useStyles();
const stateFromStores = useStateFromStores([UserStore], () => UserStore.getUser(request.parent_id));
let r22 = stateFromStores?.globalName;
if (r22 == null) {
r22 = stateFromStores?.username;
}
if (r22 == null) {
r22 = request.parent_username;
}
let r27 = stateFromStores?.username;
if (r27 == null) {
r27 = request.parent_username;
}
let avatar = stateFromStores?.avatar;
if (avatar == null) {
avatar = request.parent_avatar;
}
const pendingRequestResolution = usePendingRequestResolution(request.parent_id);
const { isConnected, isResolved } = pendingRequestResolution;
const r24 = formatPendingRequestSentText(request.created_at);
const r61 = [<Avatar avatarStyle={styles2.avatar} source={AvatarUtils.getUserAvatarSource({
id: request.parent_id,
avatar
})} disablePlaceholder />, <View style={styles2.details}>
<Text variant="text-md/semibold" color="mobile-text-heading-primary" lineClamp={1}>{r22}</Text>
{r27 !== r22 && <Text variant="text-sm/medium" color="text-default" lineClamp={1}>{r27}</Text>}
<Text variant="text-xs/medium" color="text-muted">{r24}</Text>
</View>, isResolved ? <Text variant="text-sm/normal" color="text-muted">
{intl.string(isConnected ? SafetyFlows_messages.YQP5dE : SafetyFlows_messages["2HvOvh"])}
</Text> : <View style={styles2.actions}>
{hasMaxConnections2 ? !hasMaxConnections2 : <PressableOpacity accessibilityRole="button" accessibilityLabel={intl.formatToPlainString(FamilyCenter_messages.jc1Ip7, {
name: request.parent_username
})} disabled={actionsDisabled2} onPress={() => onAccept(request.parent_id)} style={[styles2.actionButton, styles2.acceptButton]}>
{isAcceptLoading2 ? <ActivityIndicator size="small" color={styles2.acceptIcon.color} /> : <CheckmarkLargeBoldIcon size="sm" color={Module712.colors.WHITE} />}
</PressableOpacity>}
<PressableOpacity accessibilityRole="button" accessibilityLabel={intl.formatToPlainString(FamilyCenter_messages["4GtllP"], {
name: request.parent_username
})} disabled={actionsDisabled2} onPress={() => onDecline(request.parent_id)} style={[styles2.actionButton, styles2.declineButton]}>
{isDeclineLoading2 ? <ActivityIndicator size="small" color={styles2.declineIcon.color} /> : <Icon size={Icon.Sizes.SMALL} color={styles2.declineIcon.color} source={Module13954} />}
</PressableOpacity>
</View>];
return <View style={styles2.row}>{r61}</View>;
};
useStyles = createStyles({
card: {
borderRadius: Module712.radii.lg,
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
overflow: "hidden"
},
row: {
flexDirection: "row",
alignItems: "center",
paddingVertical: Module712.space.PX_12,
paddingHorizontal: Module712.space.PX_16
},
divider: {
height: 1,
backgroundColor: Module712.colors.BORDER_SUBTLE,
marginLeft: Module712.space.PX_16 + AVATAR_SIZE_MAP[AvatarSizes.NORMAL] + Module712.space.PX_12
},
avatar: {
borderRadius: AVATAR_SIZE_MAP[AvatarSizes.NORMAL] / 2,
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGHEST
},
details: {
flexGrow: 1,
flexShrink: 1,
paddingLeft: Module712.space.PX_12,
paddingRight: Module712.space.PX_4
},
actions: {
flexDirection: "row",
alignItems: "center"
},
actionButton: {
height: 36,
width: 36,
borderRadius: Module712.radii.round,
alignItems: "center",
justifyContent: "center"
},
acceptButton: {
backgroundColor: Module712.colors.STATUS_POSITIVE,
marginRight: Module712.space.PX_8
},
declineButton: {
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGHEST,
borderWidth: 1,
borderColor: Module712.colors.BORDER_STRONG
},
acceptIcon: {
color: Module712.colors.WHITE
},
declineIcon: {
color: Module712.colors.INTERACTIVE_TEXT_DEFAULT
},
inviteIconContainer: {
width: AVATAR_SIZE_MAP[AvatarSizes.NORMAL],
height: AVATAR_SIZE_MAP[AvatarSizes.NORMAL],
alignItems: "center",
justifyContent: "center"
},
inviteQrButton: {
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGHEST,
borderWidth: 1,
borderColor: Module712.colors.BORDER_STRONG
},
inviteShareButton: {
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGHEST,
borderWidth: 1,
borderColor: Module712.colors.BORDER_STRONG,
marginRight: Module712.space.PX_8
},
dividerRow: {
flexDirection: "row",
alignItems: "center"
},
dividerLine: {
flexGrow: 1,
flexShrink: 1,
height: 1,
backgroundColor: Module712.colors.BORDER_SUBTLE
},
dividerLabel: {
marginHorizontal: Module712.space.PX_12
}
});
export default function PendingRequestList(props) {
let hasMaxConnections, actioningUserId, isAcceptLoading, isDeclineLoading, actionsDisabled, handleAccept, handleDecline;
const { pendingRequests, linkedUsersProcessed, expiresAt, onRefreshLinkCode, onInviteAnotherGuardian, onShare } = props;
hasMaxConnections = void 0;
actioningUserId = void 0;
isAcceptLoading = void 0;
isDeclineLoading = void 0;
actionsDisabled = void 0;
handleAccept = void 0;
handleDecline = void 0;
const styles = useStyles();
useRefreshLinkCodeOnExpiry(expiresAt, onRefreshLinkCode);
const pendingRequestListController = usePendingRequestListController({
pendingRequests,
linkedUsersProcessed,
onActionError: () => {
ToastActionCreators.open({
key: "SAFETY_FLOWS_PARENTAL_CONSENT_LINK_UPDATE_ERROR",
content: intl.string(FamilyCenter_messages.Wu8BK2)
});
}
});
const seenRequests = pendingRequestListController.seenRequests;
hasMaxConnections = pendingRequestListController.hasMaxConnections;
actioningUserId = pendingRequestListController.actioningUserId;
isAcceptLoading = pendingRequestListController.isAcceptLoading;
isDeclineLoading = pendingRequestListController.isDeclineLoading;
actionsDisabled = pendingRequestListController.actionsDisabled;
handleAccept = pendingRequestListController.handleAccept;
handleDecline = pendingRequestListController.handleDecline;
return <Stack spacing={Module712.space.PX_16}>
{seenRequests.length > 0 && <View style={styles.card}>
{seenRequests.map((seenRequest, index) => {
const r17 = [index > 0 && <View style={styles.divider} />, ,];
let isAcceptLoading2 = isAcceptLoading;
if (isAcceptLoading) {
isAcceptLoading2 = actioningUserId === seenRequest.parent_id;
}
let isDeclineLoading2 = isDeclineLoading;
if (isDeclineLoading) {
isDeclineLoading2 = actioningUserId === seenRequest.parent_id;
}
r17[1] = <PendingRequestRow request={seenRequest} hasMaxConnections={hasMaxConnections} isAcceptLoading={isAcceptLoading2} isDeclineLoading={isDeclineLoading2} actionsDisabled={actionsDisabled} onAccept={handleAccept} onDecline={handleDecline} />;
return <Fragment key={seenRequest.parent_id}>{r17}</Fragment>;
})}
</View>}
<View style={styles.dividerRow}>
<View style={styles.dividerLine} />
<Text style={styles.dividerLabel} variant="text-sm/medium" color="text-muted">
{intl.string(SafetyFlows_messages["/SbB94"])}
</Text>
<View style={styles.dividerLine} />
</View>
<View style={[styles.card, styles.row]}>
<View style={styles.inviteIconContainer}>
<PlaneIllocon size={32} />
</View>
<View style={styles.details}>
<Text variant="text-md/semibold" color="mobile-text-heading-primary">
{intl.string(SafetyFlows_messages.z9gkwZ)}
</Text>
<Text variant="text-xs/medium" color="text-default">
{intl.string(SafetyFlows_messages["9t4+vC"])}
</Text>
</View>
<View style={styles.actions}>
<PressableOpacity accessibilityRole="button" accessibilityLabel={intl.string(t.Ej3B3Y)} onPress={onShare} style={[styles.actionButton, styles.inviteShareButton]}>
<ShareIcon size="sm" color={styles.declineIcon.color} />
</PressableOpacity>
<PressableOpacity accessibilityRole="button" accessibilityLabel={intl.string(SafetyFlows_messages.z9gkwZ)} onPress={onInviteAnotherGuardian} style={[styles.actionButton, styles.inviteQrButton]}>
<QrCodeIcon size="sm" color={styles.declineIcon.color} />
</PressableOpacity>
</View>
</View>
</Stack>;
};
export { PendingRequestRow };
@@ -0,0 +1,97 @@
// Metro module 16714 (f16715).
import { useState, useEffect, useCallback } from "react";
import { Pressable } from "react-native";
import { resendVerificationCode } from "../../SafetyFlowsActionCreators";
import { showVerificationSent } from "../../../toast/native/ToastUtils";
import ToastActionCreators from "../../../toast/native/ToastActionCreators";
import { intl } from "../../../../intl/index.native";
import SafetyFlows_messages from "../../SafetyFlows.messages";
import Module13954 from "../../../../_bundle/Module13954";
import { XLargeIcon } from "../../../../design/components/Icon/native/redesign/generated/XLargeIcon";
import { Text } from "../../../../design/components/Text/native/Text";
export default function ResendVerificationCodeButton(props) {
const { flowId, setLoading } = props;
const [state, setState] = useState(0);
useEffect(() => {
if (state > 0) {
let c28503_0 = setInterval(() => {
setState((prevState) => prevState - 1);
}, 1000);
return () => clearInterval(c28503_0);
}
}, [state]);
return <Pressable onPress={useCallback(async () => {
let c28504_2;
let c28504_3 = 0;
L14: {
L13: {
try {
if (state > 0) {
break L14;
}
setLoading(true);
c28504_3 = 2;
await resendVerificationCode(flowId);
showVerificationSent();
(0, setState)(30);
c28504_3 = 1;
c28504_3 = 0;
(0, setLoading)(false);
} catch ($e) {
const r29 = $e;
let r7 = r29;
c28504_2 = r29;
let r30 = c28504_3;
if (r30 !== 0) {
while (true) {
if (r30 === 1) {
try {
const r109 = c28504_2;
c28504_3 = 0;
(0, setLoading)(false);
throw r109;
} catch (r107) {
r7 = r107;
c28504_2 = r107;
r30 = c28504_3;
if (r30 === 0) {
break;
}
}
} else {
try {
c28504_3 = 1;
ToastActionCreators.open({
key: "SAFETY_FLOWS_VERIFY_EMAIL_ERROR",
content: intl.string(SafetyFlows_messages["3AXMYu"]),
icon: Module13954,
IconComponent: XLargeIcon,
iconColor: "icon-feedback-critical"
});
c28504_3 = 0;
(0, setLoading)(false);
break L13;
} catch (r76) {
r7 = r76;
c28504_2 = r76;
r30 = c28504_3;
if (r30 === 0) {
break;
}
}
}
}
}
throw r7;
}
}
return void 0;
}
}, [setLoading, state, flowId])} disabled={state > 0} accessibilityRole="button" accessibilityLabel={intl.string(SafetyFlows_messages.ah0EUu)}>
<Text variant="text-sm/medium" color="text-link" accessibilityLabel={intl.string(SafetyFlows_messages.ah0EUu)} importantForAccessibility="no">
{state > 0 ? intl.format(SafetyFlows_messages["2+Lyn0"], {
countdown: state
}) : intl.string(SafetyFlows_messages.ah0EUu)}
</Text>
</Pressable>;
};
@@ -0,0 +1,94 @@
// Metro module 16713 (f16714).
import { useRef, useState, useCallback, useEffect } from "react";
import { useSafetyFlowTask } from "../../SafetyFlowsTaskContext";
import { useOnTaskComplete } from "../SafetyFlowsUtils";
import { TaskInputType } from "../../types";
import ToastActionCreators from "../../../toast/native/ToastActionCreators";
import { intl } from "../../../../intl/index.native";
import SafetyFlows_messages from "../../SafetyFlows.messages";
import SafetyFlowTaskScreen from "../SafetyFlowTaskScreen";
import { Stack } from "../../../../design/components/Stack/native/Stack.native";
import Module712 from "../../../../_bundle/Module712";
import { Text } from "../../../../design/components/Text/native/Text";
import { TextInput } from "../../../../design/components/TextInput/native/TextInput.native";
import ResendVerificationCodeButton from "./ResendVerificationCodeButton";
export default () => {
const task = useSafetyFlowTask().task;
const onTaskComplete = useOnTaskComplete();
const ref = useRef("");
const [state, onChange] = useState("");
const [submitting, setState] = useState(false);
const [state2, setState2] = useState(false);
const callback = useCallback(async () => {
let c28502_3 = 0;
L14: {
L13: {
try {
const current = ref.current;
if (current == null) {
break L14;
}
if (current !== "") {
c28502_3 = 1;
setState(true);
setState2(true);
await onTaskComplete({
verification_code: current,
type: TaskInputType.VerificationCode
});
(0, setState)(false);
c28502_3 = 0;
break L13;
}
break L14;
} catch ($e) {
let r7 = $e;
if (c28502_3 !== 0) {
while (true) {
try {
c28502_3 = 0;
(0, setState)(false);
(0, setState2)(false);
ToastActionCreators.open({
key: "SAFETY_FLOWS_VERIFY_EMAIL_ERROR",
content: intl.string(SafetyFlows_messages.PfbG6H)
});
break L13;
} catch ($e) {
r7 = $e;
if (c28502_3 === 0) {
break;
}
}
}
}
throw r7;
}
}
return void 0;
}
}, [onTaskComplete]);
useEffect(() => {
ref.current = state;
}, [state]);
useEffect(() => {
if (!(state.length !== 6 || state2)) {
callback();
}
}, [state, state2, callback]);
const props = {
title: intl.string(SafetyFlows_messages["Qm6K/s"]),
action: intl.string(SafetyFlows_messages.wq2RDq),
onAction: callback,
submitting,
children: null
};
const r95 = [<Text variant="text-sm/medium" color="text-subtle">
{intl.string(SafetyFlows_messages.aveKoG)}
</Text>, <Stack spacing={Module712.space.PX_8}>
<TextInput placeholder={intl.string(SafetyFlows_messages.d9Ykjr)} maxLength={6} returnKeyType="done" value={state} onChange={onChange} />
<ResendVerificationCodeButton setLoading={setState} flowId={task.flow_context?.flow_id} />
</Stack>];
props.children = <Stack spacing={Module712.space.PX_16}>{r95}</Stack>;
return <SafetyFlowTaskScreen {...props} />;
};
@@ -0,0 +1,85 @@
// Metro module 16702 (f16703).
import UserRequiredActionStore from "../../stores/UserRequiredActionStore";
import { UserRequiredActions } from "../../Constants";
import { TaskType, SafetyFlowScreens, TASK_TYPE_TO_SCREENS } from "./types";
import ModalActionCreators from "../../actions/ModalActionCreators";
import { SAFETY_FLOWS_MODAL_KEY } from "./constants";
import { getCurrentTask } from "./SafetyFlowsActionCreators";
import "../../_bundle/asyncRequire";
function $mk117440($env) {
return function getInitialScreenForTask(a0) {
return a0.task_type === TaskType.AGE_VERIFICATION ? SafetyFlowScreens.AGE_VERIFICATION : a0.task_type === TaskType.PARENTAL_CONSENT_CONNECTION ? SafetyFlowScreens.PARENTAL_CONSENT_CONNECTION : TASK_TYPE_TO_SCREENS[a0.task_type] != null ? SafetyFlowScreens.OVERVIEW : SafetyFlowScreens.UPDATE_APP;
};
}
let env12033 = {};
export async function openSafetyFlow(c28497_0) {
let action, c28497_2, c28497_3, c28497_4;
let c28497_5 = 0;
const r11 = env12033;
L21: {
L16: {
try {
let env31101;
c28497_3 = r11;
const r33 = env31101 = {
$parent: r11
};
c28497_2 = r33;
env31101[0] = void 0;
let r15 = c28497_0;
if (r15 === void 0) {
r15 = {};
}
env31101[0] = r15.requiredAction;
env31101[1] = void 0;
env31101[2] = void 0;
await void 0;
action = env31101[0];
if (action == null) {
action = UserRequiredActionStore.getAction();
}
if (action === UserRequiredActions.REQUIRE_SAFETY_FLOWS) {
c28497_5 = 1;
env31101[1] = await getCurrentTask();
if (env31101[1] == null) {
c28497_5 = 0;
break L21;
}
const r99 = env31101[1];
env31101[2] = $mk117440(env12033)(r99);
ModalActionCreators.pushLazy(import("./native/SafetyFlowsModal"), {
task: env31101[1],
initialScreen: env31101[2]
}, SAFETY_FLOWS_MODAL_KEY);
c28497_5 = 0;
} else {
ModalActionCreators.popWithKey(SAFETY_FLOWS_MODAL_KEY);
}
} catch ($e) {
const r31 = $e;
let r8 = r31;
c28497_4 = r31;
if (c28497_5 !== 0) {
while (true) {
try {
c28497_5 = 0;
ModalActionCreators.pushLazy(import("./native/SafetyFlowsModal"), {
task: null,
initialScreen: SafetyFlowScreens.ERROR
}, SAFETY_FLOWS_MODAL_KEY);
break L16;
} catch (r127) {
r8 = r127;
c28497_4 = r127;
if (c28497_5 === 0) {
break;
}
}
}
}
throw r8;
}
}
return void 0;
}
}
@@ -0,0 +1,15 @@
// Metro module 16722 (f16723).
import { intl } from "../../intl/index.native";
import SafetyFlows_messages from "./SafetyFlows.messages";
import { formatLinkTimestamp } from "../parent_tools/FamilyCenterUtils";
const SENT_TIMESTAMP_FORMATTER = () => ({
seconds: intl.string(SafetyFlows_messages.M4NOO3),
minutes: SafetyFlows_messages["9nem85"],
hours: SafetyFlows_messages.sJjWRY,
yesterday: intl.string(SafetyFlows_messages["7SxW32"]),
days: SafetyFlows_messages.tVHevX,
date: SafetyFlows_messages.q6jzya
});
export function formatPendingRequestSentText(a0) {
return formatLinkTimestamp(Date.parse(a0), SENT_TIMESTAMP_FORMATTER);
}
+52
View File
@@ -0,0 +1,52 @@
// Metro module 16703 (f16704).
import { intl } from "../../intl/index.native";
import SafetyFlows_messages from "./SafetyFlows.messages";
const r12 = {
REFRESH_APP: -1
};
r12[-1] = "REFRESH_APP";
r12.EMAIL_VERIFICATION = 3;
r12[3] = "EMAIL_VERIFICATION";
r12.AGE_VERIFICATION = 9;
r12[9] = "AGE_VERIFICATION";
r12.PARENTAL_CONSENT_CONNECTION = 10;
r12[10] = "PARENTAL_CONSENT_CONNECTION";
const r11 = {
EMAIL_VERIFICATION: "email_verification",
PHONE_VERIFICATION: "phone_verification",
GENERIC_CALL_TO_ACTION: "generic_call_to_action",
REFRESH_APP: "refresh_app",
AGE_VERIFICATION: "age_verification",
PARENTAL_CONSENT_CONNECTION: "parental_consent_connection"
};
const set = new Set(Object.values(r11));
const set2 = new Set([r12.PARENTAL_CONSENT_CONNECTION]);
const r40 = {
OVERVIEW: "OVERVIEW",
ENTER_EMAIL: "ENTER_EMAIL",
VERIFY_EMAIL: "VERIFY_EMAIL",
UPDATE_APP: "UPDATE_APP",
AGE_VERIFICATION: "AGE_VERIFICATION",
PARENTAL_CONSENT_CONNECTION: "PARENTAL_CONSENT_CONNECTION",
ERROR: "ERROR"
};
const r46 = {};
r46[r12.EMAIL_VERIFICATION] = [r40.ENTER_EMAIL, r40.VERIFY_EMAIL];
r46[r12.AGE_VERIFICATION] = [r40.AGE_VERIFICATION];
r46[r12.PARENTAL_CONSENT_CONNECTION] = [r40.PARENTAL_CONSENT_CONNECTION];
const r56 = {};
r56[r12.EMAIL_VERIFICATION] = intl.string(SafetyFlows_messages["Qm6K/s"]);
r56[r12.AGE_VERIFICATION] = intl.string(SafetyFlows_messages["dSkE/A"]);
r56[r12.PARENTAL_CONSENT_CONNECTION] = intl.string(SafetyFlows_messages.dMMSA0);
const r82 = {
Empty: "empty",
VerificationCode: "verification_code"
};
export { r12 as TaskType };
export { r11 as SafetyFlowComponentType };
export { set as SUPPORTED_SAFETY_FLOW_COMPONENT_TYPES };
export { set2 as OWN_MODAL_TASK_TYPES };
export { r40 as SafetyFlowScreens };
export { r46 as TASK_TYPE_TO_SCREENS };
export { r56 as TASK_TYPE_TO_TITLE };
export { r82 as TaskInputType };
@@ -0,0 +1,160 @@
// Metro module 16719 (f16720).
import { useMemo, useState, useCallback } from "react";
import FamilyCenterStore from "../parent_tools/FamilyCenterStore";
import UserStore from "../../stores/UserStore";
import { UserLinkStatus } from "../parent_tools/FamilyCenterConstants";
import { useStateFromStores } from "../../_bundle/Module589";
import { useHasMaxConnections } from "../parent_tools/hooks/useUserLinks";
import { useFamilyCenterActions } from "../parent_tools/hooks/useFamilyCenterActions";
export function useDerivedPendingRequests(a0, a1) {
let stateFromStores2;
const stateFromStores = useStateFromStores([FamilyCenterStore], () => FamilyCenterStore.getLinkedUsers());
stateFromStores2 = useStateFromStores([UserStore], () => UserStore.getCurrentUser()?.id);
return useMemo(() => {
if (!a1) {
return a0;
}
const map = new Map(a0.map((item) => [item.parent_id, item]));
const r32 = [];
for (const item of Object.values(stateFromStores)) {
if (item != null && item.link_status === UserLinkStatus.PENDING && item.requestor_id !== stateFromStores2) {
const user = UserStore.getUser(item.user_id);
const r57 = map.get(item.user_id);
let parent_username = user?.username;
if (parent_username == null) {
parent_username = r57?.parent_username;
}
if (parent_username == null) {
parent_username = item.user_id;
}
let parent_avatar = user?.avatar;
if (parent_avatar == null) {
parent_avatar = r57?.parent_avatar;
}
if (parent_avatar == null) {
parent_avatar = null;
}
r32.push({
parent_id: item.user_id,
parent_username,
parent_avatar,
created_at: item.created_at
});
}
}
return r32;
}, [a1, stateFromStores, stateFromStores2, a0]);
}
export function usePendingRequestListController({ pendingRequests, linkedUsersProcessed, onActionError }) {
let acceptLinkRequest, declineLinkRequest, isDeclineLoading, state, setState2, callback;
acceptLinkRequest = void 0;
declineLinkRequest = void 0;
isDeclineLoading = void 0;
state = void 0;
setState2 = void 0;
callback = void 0;
const hasMaxConnections = useHasMaxConnections();
const [actioningUserId, setState] = useState(null);
const familyCenterActions = useFamilyCenterActions({
onSuccess: () => setState(null),
onError: () => {
setState(null);
onActionError();
}
});
acceptLinkRequest = familyCenterActions.acceptLinkRequest;
declineLinkRequest = familyCenterActions.declineLinkRequest;
const { isAcceptLoading, isDeclineLoading: isDeclineLoading2 } = familyCenterActions;
isDeclineLoading = isAcceptLoading || isDeclineLoading2;
[state, setState2] = useState(() => new Set());
callback = useCallback((c28506_0) => {
setState2((prevState2) => {
const has = prevState2.has;
if (has.call(prevState2, c28506_0)) {
return prevState2;
}
const set = new Set(prevState2);
set.add(c28506_0);
return set;
});
}, []);
const callback2 = useCallback((a0) => {
if (!isDeclineLoading) {
callback(a0);
setState(a0);
acceptLinkRequest(a0);
}
}, [isDeclineLoading, callback, acceptLinkRequest]);
const callback3 = useCallback((a0) => {
if (!isDeclineLoading) {
callback(a0);
setState(a0);
declineLinkRequest(a0);
}
}, [isDeclineLoading, callback, declineLinkRequest]);
const [seenRequests, setState3] = useState(pendingRequests);
const [state2, setState4] = useState(pendingRequests);
const [state3, setState5] = useState(linkedUsersProcessed);
if (linkedUsersProcessed && !state3) {
setState5(true);
setState4(pendingRequests);
setState3((prevState3) => {
const map = new Map();
for (const item of prevState3) {
if (state.has(item.parent_id)) {
map.set(item.parent_id, item);
}
}
for (const pendingRequest of pendingRequests) {
map.set(pendingRequest.parent_id, pendingRequest);
}
return Array.from(map.values());
});
} else if (pendingRequests !== state2) {
setState4(pendingRequests);
setState3((prevState3) => {
const map = new Map(prevState3.map((item) => [item.parent_id, item]));
for (const pendingRequest of pendingRequests) {
map.set(pendingRequest.parent_id, pendingRequest);
}
return Array.from(map.values());
});
}
return {
seenRequests,
hasMaxConnections,
actioningUserId,
isAcceptLoading,
isDeclineLoading: isDeclineLoading2,
actionsDisabled: isDeclineLoading,
handleAccept: callback2,
handleDecline: callback3
};
}
export function usePendingRequestResolution(c23390_0) {
const stateFromStores3 = useStateFromStores([FamilyCenterStore], () => FamilyCenterStore.getLinkedUsers()[c23390_0]?.link_status);
const [state, setState] = useState(() => stateFromStores3 !== UserLinkStatus.ACTIVE ? stateFromStores3 != null ? stateFromStores3 === UserLinkStatus.PENDING ? null : "declined" : null : "connected");
const [state2, setState2] = useState(stateFromStores3);
if (stateFromStores3 !== state2) {
setState2(stateFromStores3);
if (stateFromStores3 === UserLinkStatus.ACTIVE) {
setState("connected");
} else if (stateFromStores3 === UserLinkStatus.PENDING) {
setState(null);
} else if (stateFromStores3 != null || state2 != null && state2 !== UserLinkStatus.ACTIVE) {
setState("declined");
}
}
let isConnected = state === "connected";
const isDeclined = state === "declined";
const r46 = {
isConnected,
isDeclined,
isResolved: null
};
if (!isConnected) {
isConnected = isDeclined;
}
r46.isResolved = isConnected;
return r46;
}