149 lines
8.1 KiB
TypeScript
149 lines
8.1 KiB
TypeScript
/* Metro module 12642; source: components_native/QRScannerModal.tsx; dependencies: [57, 31, 27, 661, 5117, 33, 477, 12643, 697, 5459, 1585, 1471, 4245, 5080, 12637, 1962, 7007, 12620, 3853, 4496, 1244, 8792, 8196, 1305, 2] */
|
|
function _fun96953(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#96953, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12832:6, offset: 0x0216d7f8, size: 483 bytes, params: 8, frame: 20
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const requireNativeComponent = value.requireNativeComponent;
|
|
const env0_5 = value.View;
|
|
const env0_6 = (require(661) /* metro dependency 661: Constants */).UserSettingsSections;
|
|
const env0_7 = (require(5117) /* metro dependency 5117: FamilyCenterConstants */).FAMILY_CENTER_LINK_REQUEST_REGEX;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_8 = value.jsx;
|
|
const env0_9 = value.jsxs;
|
|
if (Reflect.apply((require(477) /* metro dependency 477: PlatformUtils */).isAndroid, value, [])) {
|
|
value = importDefault(12643) /* metro dependency 12643: QRScannerNativeComponent */;
|
|
} else {
|
|
value = requireNativeComponent('DCDQRScanner');
|
|
}
|
|
object2 = {scanner: {'position': 'absolute', 'height': '100%', 'width': '100%'}};
|
|
object2.closeButton = {marginLeft: 8};
|
|
const BLACK = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.BLACK;
|
|
object2.emptyView = {backgroundColor: BLACK};
|
|
const BRAND_500 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.BRAND_500;
|
|
object2.showHelp = {'marginLeft': 16, 'marginRight': 16, 'marginTop': 'auto', 'borderRadius': 16,
|
|
'backgroundColor': null, 'paddingTop': 4, 'paddingBottom': 4, 'paddingLeft': 16, 'paddingRight': 16,
|
|
backgroundColor: BRAND_500};
|
|
const WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
|
|
object2.text = {color: WHITE, textAlign: 'center'};
|
|
object2 = {SUCCEEDED: 'SUCCEEDED', FAILED: 'FAILED'};
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/QRScannerModal.tsx');
|
|
exports.default = QRScannerModal;
|
|
}
|
|
|
|
function DCDQRScanner(a0) { // fn#96954, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12832:313, offset: 0x0216d9db, size: 33 bytes, params: 2, frame: 13
|
|
return ((Component) => <Component {...a0} />)(env0_10);
|
|
}
|
|
|
|
function QRScannerModal({showHelp, onScanSuccess}) { // fn#96955, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12832:910, offset: 0x0216d9fc, size: 631 bytes, params: 2, frame: 29
|
|
const r8 = showHelp !== undefined && showHelp;
|
|
const binding = env0_4;
|
|
const [property, env0_1] = env0_3(binding.useState(true), 2);
|
|
binding.useEffect(_fun96956, []);
|
|
const {bottom, top} = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)();
|
|
const items2 = [property ? <View style={[env0_11.scanner,
|
|
env0_11.emptyView]} /> : <DCDQRScanner style={env0_11.scanner} pointerEvents="none" onQRCodeFound={onQRCodeFound} />];
|
|
const TouchableHitBox = importDefault(8792) /* metro dependency 8792: TouchableHitBox */;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
items2[1] = <TouchableHitBox accessibilityRole="button" accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq)} source={importDefault(8196) /* metro dependency 8196 */} style={[env0_11.closeButton,
|
|
{marginTop: top}]} onPress={(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop} />;
|
|
items2[2] = r8 ? property ? null : <View style={[env0_11.showHelp,
|
|
{marginBottom: bottom + 8}]}>{((LegacyText) => <LegacyText style={env0_11.text}>{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.dklV0G)}</LegacyText>)((require(1305) /* metro dependency 1305: native */).LegacyText)}</View> : null;
|
|
return (
|
|
<View style={{flex: 1}}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun96956() { // fn#96956, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12832:1041, offset: 0x0216dc73, size: 58 bytes, params: 1, frame: 12
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
const env0_0 = (require(5459) /* metro dependency 5459: RunAfterInteractionsUtils */).runAfterInteractions(_fun96957);
|
|
return _fun96958;
|
|
}
|
|
|
|
function onQRCodeFound(a0) { // fn#96959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12832:1304, owner: QRScannerModal.onQRCodeFound, offset: 0x0216dcc2, size: 651 bytes, params: 2, frame: 22
|
|
var r5;
|
|
var object2;
|
|
var onScanSuccessBinding;
|
|
var value3;
|
|
var defaultImport2;
|
|
var toURLSafe;
|
|
var result;
|
|
var hostname;
|
|
var pathname;
|
|
var remoteAuthFingerprint;
|
|
var defaultImport3;
|
|
var openURL;
|
|
var defaultImport6;
|
|
var pushLazy;
|
|
let nativeEvent = a0.nativeEvent;
|
|
const status = nativeEvent.status;
|
|
let value = environment.__proto__;
|
|
const SUCCEEDED = env1_12.SUCCEEDED;
|
|
if (SUCCEEDED === status) {
|
|
onScanSuccessBinding = onScanSuccess;
|
|
value3 = undefined;
|
|
if (value3 !== onScanSuccessBinding) {
|
|
onScanSuccess(a0.nativeEvent.result);
|
|
return value3;
|
|
}
|
|
defaultImport2 = importDefault(dependencyMap[11]);
|
|
toURLSafe = defaultImport2.toURLSafe;
|
|
nativeEvent = a0.nativeEvent;
|
|
result = nativeEvent.result;
|
|
r5 = Reflect.apply(toURLSafe, defaultImport2, [result]) ?? ({});
|
|
hostname = r5.hostname;
|
|
pathname = r5.pathname;
|
|
remoteAuthFingerprint = require(dependencyMap[12]).findRemoteAuthFingerprint(hostname, pathname);
|
|
if (remoteAuthFingerprint != null) {
|
|
importDefault(dependencyMap[13]).pop();
|
|
defaultImport6 = importDefault(dependencyMap[13]);
|
|
pushLazy = defaultImport6.pushLazy;
|
|
value = require(dependencyMap[15]);
|
|
value = value(dependencyMap[14], dependencyMap.paths);
|
|
Reflect.apply(pushLazy, defaultImport6, [value, {remoteAuthFingerprint: remoteAuthFingerprint}]);
|
|
return value3;
|
|
}
|
|
r5 = pathname == null ? value3 : pathname.match(FAMILY_CENTER_LINK_REQUEST_REGEX);
|
|
if (r5 == null) {
|
|
defaultImport3 = importDefault(dependencyMap[18]);
|
|
defaultImport3.openURL(a0.nativeEvent.result, value3, false);
|
|
importDefault(dependencyMap[13]).pop();
|
|
return undefined;
|
|
}
|
|
if (pathname != null) {
|
|
importDefault(dependencyMap[13]).pop();
|
|
require(dependencyMap[16]).openUserSettings({screen: UserSettingsSections.FAMILY_CENTER});
|
|
require(dependencyMap[17]).handleFamilyCenterQRCodeScan(pathname, 'UserSettingsQRCodeScan');
|
|
return value3;
|
|
}
|
|
defaultImport3 = importDefault(dependencyMap[18]);
|
|
openURL = defaultImport3.openURL;
|
|
nativeEvent = a0.nativeEvent;
|
|
result = nativeEvent.result;
|
|
Reflect.apply(openURL, defaultImport3, [result, value3, false]);
|
|
} else {
|
|
env1_12.FAILED;
|
|
var defaultImport = importDefault(dependencyMap[19]);
|
|
var show = defaultImport.show;
|
|
object2 = {};
|
|
var intl = require(dependencyMap[20]).intl;
|
|
var string = intl.string;
|
|
var t = require(dependencyMap[20]).t;
|
|
var QOQlWa = t.QOQlWa;
|
|
object2.body = Reflect.apply(string, intl, [QOQlWa]);
|
|
intl = require(dependencyMap[20]).intl;
|
|
string = intl.string;
|
|
t = require(dependencyMap[20]).t;
|
|
object2.title = Reflect.apply(string, intl, [t['6S318H']]);
|
|
Reflect.apply(show, defaultImport, [object2]);
|
|
}
|
|
importDefault(dependencyMap[13]).pop();
|
|
}
|
|
|