Files
2026-07-28 01:06:53 +03:00

284 lines
17 KiB
TypeScript

/* Metro module 13394; source: modules/parent_tools/native/FamilyCenterModalQRCode.tsx; dependencies: [57, 31, 27, 5117, 661, 33, 4501, 697, 8171, 8170, 3856, 1244, 5080, 12624, 44, 4594, 683, 6258, 6259, 1305, 11785, 4573, 2224, 6766, 5278, 9181, 10120, 6261, 4578, 5282, 10121, 2] */
import Module00044 from '../../../by-id/module-00044.js'; /* Metro dependency 44 */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import AnalyticsUtils from '../../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
import ModalActionCreators from '../../../actions/ModalActionCreators.tsx'; /* Metro dependency 5080 */
import UseIsInAdultAgeGroup from '../hooks/useIsInAdultAgeGroup.tsx'; /* Metro dependency 8171 */
import Module11785 from '../../../by-id/module-11785.js'; /* Metro dependency 11785 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as ToastUtilsModule from '../../toast/native/ToastUtils.tsx'; /* Metro dependency 3856 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as FamilyCenterConstantsModule from '../FamilyCenterConstants.tsx'; /* Metro dependency 5117 */
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
import * as ModalScreenNativeModule from '../../../design/components/Modal/native/ModalScreen.native.tsx'; /* Metro dependency 6258 */
import * as ModalContentNativeModule from '../../../design/components/Modal/native/ModalContent.native.tsx'; /* Metro dependency 6259 */
import * as ButtonGroupNativeModule from '../../../design/components/ButtonGroup/native/ButtonGroup.native.tsx'; /* Metro dependency 6261 */
import * as TextWithIOSLinkWorkaroundModule from '../../a11y/native/TextWithIOSLinkWorkaround.tsx'; /* Metro dependency 6766 */
import * as UseUserLinksModule from '../hooks/useUserLinks.tsx'; /* Metro dependency 8170 */
import * as QRCodeModule from '../../../components_native/QRCode.tsx'; /* Metro dependency 9181 */
import * as ModalFooterNativeModule from '../../../design/components/Modal/native/ModalFooter.native.tsx'; /* Metro dependency 10120 */
import * as ModalNativeModule from '../../../design/components/Modal/native/Modal.native.tsx'; /* Metro dependency 10121 */
import * as UseFamilyCenterActionsModule from '../hooks/useFamilyCenterActions.tsx'; /* Metro dependency 12624 */
function _fun101968(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#101968, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:6, offset: 0x02225af1, size: 563 bytes, params: 8, frame: 24
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = FamilyCenterConstantsModule;
const env0_6 = value.FamilyCenterAction;
const env0_7 = value.PLACEHOLDER_QR_CODE_URL;
const env0_8 = value.QR_CODE_AUTO_HIDE_TIMEOUT;
value = require(33) /* metro dependency 33 */;
const env0_10 = value.jsx;
const env0_11 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {};
const MESSAGE_MENTIONED_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.MESSAGE_MENTIONED_BACKGROUND_DEFAULT;
object.noticeContainer = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center',
'justifyContent': 'center', 'backgroundColor': null, 'padding': 12, 'marginBottom': 24, 'marginHorizontal': -16,
backgroundColor: MESSAGE_MENTIONED_BACKGROUND_DEFAULT};
const object3 = {'display': 'flex', 'alignItems': 'center', 'justifyContent': 'center', 'backgroundColor': null,
'marginRight': 8, 'width': 18, 'height': 18};
let STATUS_WARNING = (importDefault(697) /* metro dependency 697: native */).colors.STATUS_WARNING;
object3.backgroundColor = STATUS_WARNING;
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object.noticeIconCircle = object3;
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object.noticeIcon = {'width': 11, 'height': 11, tintColor: BACKGROUND_BASE_LOW};
STATUS_WARNING = (importDefault(697) /* metro dependency 697: native */).colors.STATUS_WARNING;
object.noticeText = {color: STATUS_WARNING};
object.header = {'display': 'flex', 'alignItems': 'center', 'justifyContent': 'center', 'textAlign': 'center',
'marginBottom': 16};
object.headerText = {marginBottom: 4};
object.description = {textAlign: 'center'};
object.reminder = {'marginTop': 16, 'textAlign': 'center'};
object.qrCode = {'display': 'flex', 'flexDirection': 'row', 'justifyContent': 'center', 'alignItems': 'center'};
const env0_12 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/parent_tools/native/FamilyCenterModalQRCode.tsx');
exports.default = FamilyCenterModalQRCode;
function FamilyCenterModalQRCodeScreen() { // fn#101969, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:1124, offset: 0x02225d24, size: 1502 bytes, params: 1, frame: 40
const styles = useStyles();
const value2 = (UseIsInAdultAgeGroup)();
const [property, env0_1] = Module00057(getLinkCode.useState(false), 2);
const value5 = (UseUserLinksModule).usePendingRequestCount();
const value6 = getLinkCode.useRef(value5);
const value8 = (UseFamilyCenterActionsModule).useFamilyCenterActions({onError: getLinkCode.useCallback(_fun101970,
[])});
var getLinkCode = value8.getLinkCode;
const isGetLinkCodeLoading = value8.isGetLinkCodeLoading;
const value9 = (UseUserLinksModule).useUserQRLinkUrl();
(Module00044)(!value2, 'FamilyCenterQRCodeModal should only be rendered for teens.');
(importDefault(4594) /* metro dependency 4594: useMountEffect */)(function() {
getLinkCode();
});
getLinkCode.useEffect(_fun101972, [value6, value5]);
const value10 = getLinkCode.useCallback(_fun101973, [property]);
const ModalScreen = (ModalScreenNativeModule).ModalScreen;
const ModalContent = (ModalContentNativeModule).ModalContent;
const Icon = (NativeModule).Icon;
const view = (
<View style={styles.noticeIconCircle}>
<Icon style={styles.noticeIcon} source={Module11785} />
</View>
);
const Text = (TextModule).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const items2 = [
<View style={styles.noticeContainer}>
{view}
<Text style={styles.noticeText} variant="text-sm/semibold">
{Reflect.apply(string, intl,
[(importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).iHYMAz])}
</Text>
</View>,
];
string = intl.string;
const AVTZaN = (importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).AVTZaN;
const text = (
<Text
style={styles.headerText}
variant="text-lg/bold"
color="mobile-text-heading-primary"
>
{Reflect.apply(string, intl, [AVTZaN])}
</Text>
);
const TextWithIOSLinkWorkaround = (TextWithIOSLinkWorkaroundModule).TextWithIOSLinkWorkaround;
const format = intl.format;
const LyyCsE = (importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).LyyCsE;
items2[1] = (
<View style={styles.header}>
{text}
<TextWithIOSLinkWorkaround
style={styles.description}
variant="text-sm/normal"
color="text-default"
>
{Reflect.apply(format, intl, [LyyCsE,
{link: 'https://support.discord.com/hc/articles/14155060633623'}])}
</TextWithIOSLinkWorkaround>
</View>
);
const PressableOpacity = (PressablesModule).PressableOpacity;
const QRCodeWithOverlay = (QRCodeModule).QRCodeWithOverlay;
const r11 = property ? isGetLinkCodeLoading ? PLACEHOLDER_QR_CODE_URL : value9 ?? PLACEHOLDER_QR_CODE_URL : PLACEHOLDER_QR_CODE_URL;
const QRCodeOverlaySizes = (QRCodeModule).QRCodeOverlaySizes;
const SIZE_60 = QRCodeOverlaySizes.SIZE_60;
items2[2] = (
<PressableOpacity
style={styles.qrCode}
onPress={value10}
activeOpacity={0.6}
>
<QRCodeWithOverlay
size={237}
text={r11}
overlaySize={SIZE_60}
blur={!property}
/>
</PressableOpacity>
);
items2[3] = (
<Text
style={styles.reminder}
variant="text-xs/semibold"
color="text-default"
>
{intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).goDyoe)}
</Text>
);
const modalContent = (
<ModalContent>
{items2}
</ModalContent>
);
const ModalFooter = (ModalFooterNativeModule).ModalFooter;
const ButtonGroup = (ButtonGroupNativeModule).ButtonGroup;
const Button = (ButtonNativeModule).Button;
string = intl.string;
const defaultImport3 = importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */;
return (
<ModalScreen>
{modalContent}
<ModalFooter>
<ButtonGroup>
<Button
variant="primary"
disabled={isGetLinkCodeLoading}
loading={isGetLinkCodeLoading}
text={property ? Reflect.apply(string, intl, [defaultImport3.wg2xwQ]) : Reflect.apply(string,
intl, [defaultImport3['10dX6U']])}
onPress={value10}
/>
<Button
variant="tertiary"
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq)}
onPress={(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop}
/>
</ButtonGroup>
</ModalFooter>
</ModalScreen>
);
function _fun101970() { // fn#101970, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:1293, offset: 0x02226302, size: 111 bytes, params: 1, frame: 17
const value = environment.__proto__;
const presentFailedToast = ToastUtilsModule.presentFailedToast;
const intl = (IndexNativeModule).intl;
const string = intl.string;
const R0RpRX = (IndexNativeModule).t.R0RpRX;
Reflect.apply(presentFailedToast, ToastUtilsModule, [Reflect.apply(string, intl, [R0RpRX])]);
(ModalActionCreators).pop();
}
function _fun101972() { // fn#101972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:1614, offset: 0x02226371, size: 59 bytes, params: 1, frame: 11
var value;
if (env0_2 > Module00057.current) {
value = environment.__proto__;
value = importDefault(5080) /* metro dependency 5080: ModalActionCreators */;
value.pop();
}
}
function _fun101973() { // fn#101973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:1677, offset: 0x022263ac, size: 60 bytes, params: 1, frame: 14
var environment;
var setTimeout;
env0_1(_fun101974);
if (!env0_0) {
setTimeout = global.setTimeout;
value = environment.__proto__;
setTimeout(_fun101975, QR_CODE_AUTO_HIDE_TIMEOUT);
}
function _fun101974(a0) { // fn#101974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:1685, offset: 0x022263e8, size: 88 bytes, params: 2, frame: 16
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const FAMILY_CENTER_ACTION = AnalyticEvents.FAMILY_CENTER_ACTION;
Reflect.apply(track, defaultImport, [FAMILY_CENTER_ACTION,
{action: env1_0 ? FamilyCenterAction.HideQRCode : FamilyCenterAction.RevealQRCode}]);
return !a0;
}
function _fun101975() { // fn#101975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:1788, offset: 0x02226440, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__.__proto__;
(ModalActionCreators).pop();
}
}
}
function FamilyCenterModalQRCode() { // fn#101976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:3313, offset: 0x02226465, size: 139 bytes, params: 1, frame: 18
const value2 = ReactModule.useMemo(function() {
return _fun101978();
}, []);
const Modal = (ModalNativeModule).Modal;
const intl = (IndexNativeModule).intl;
return (
<Modal
initialRouteName="QR_CODE"
screens={value2}
headerBackTitle={intl.string((IndexNativeModule).t['13/7kX'])}
/>
);
function _fun101977() { // fn#101977, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:3365, offset: 0x022264f0, size: 17 bytes, params: 1, frame: 9
return (() => {
var object2 = {headerShown: true};
object2.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton((importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop);
object2.headerTitle = _fun101979;
object2.render = _fun101980;
return {QR_CODE: object2};
})();
function getScreens_101978() { // fn#101978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:3369, offset: 0x02226501, size: 107 bytes, params: 1, frame: 17
const object2 = {headerShown: true};
object2.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton((importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop);
object2.headerTitle = function() {
return null;
};
object2.render = render_101980;
return {QR_CODE: object2};
function getScreens_101978Render() { // fn#101980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:3505, owner: getScreens_101978.render, offset: 0x0222656c, size: 23 bytes, params: 1, frame: 13
return <FamilyCenterModalQRCodeScreen />;
}
}
}
}
}
function getScreens_101978HeaderTitle() { // fn#101979, owner: getScreens_101978.headerTitle, offset: 0x00c58c16, size: 4 bytes, params: 1, frame: 1
return null;
}
global.__d(_fun101968, 13394, [57, 31, 27, 5117, 661, 33, 4501, 697, 8171, 8170, 3856, 1244, 5080, 12624, 44, 4594,
683, 6258, 6259, 1305, 11785, 4573, 2224, 6766, 5278, 9181, 10120, 6261, 4578, 5282, 10121,
2]) /* metro module 13394, dependencies: [57, 31, 27, 5117, 661, 33, 4501, 697, 8171, 8170, 3856, 1244, 5080, 12624, 44, 4594, 683, 6258, 6259, 1305, 11785, 4573, 2224, 6766, 5278, 9181, 10120, 6261, 4578, 5282, 10121, 2] */;