155 lines
9.2 KiB
TypeScript
155 lines
9.2 KiB
TypeScript
/* Metro module 12649; source: modules/activate_device/native/ActivateDevice.tsx; dependencies: [57, 31, 27, 33, 4501, 697, 12650, 12652, 8870, 9363, 12653, 4121, 12654, 5475, 12655, 12659, 12660, 1423, 12661, 6618, 2] */
|
|
function _fun96982(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#96982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12839:6, offset: 0x0216ebb0, size: 467 bytes, params: 8, frame: 23
|
|
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 env0_5 = value.View;
|
|
const env0_6 = value.ImageBackground;
|
|
const env0_7 = value.ActivityIndicator;
|
|
const env0_8 = value.ScrollView;
|
|
const env0_9 = (require(33) /* metro dependency 33 */).jsx;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {};
|
|
object2.background = {flex: 1};
|
|
const TEXT_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_BRAND;
|
|
object2.imageStyle = {'marginVertical': 0, 'resizeMode': 'cover', backgroundColor: TEXT_BRAND};
|
|
object2.safeArea = {'flex': 1, 'justifyContent': 'center', 'alignItems': 'center'};
|
|
const object3 = {'maxWidth': 480, 'backgroundColor': null, 'alignItems': 'center', 'justifyContent': 'center',
|
|
'borderRadius': null, 'padding': 24, 'marginHorizontal': 24, 'marginVertical': 36, 'shadowColor': null,
|
|
'shadowOpacity': 0.2};
|
|
const PANEL_BG = (importDefault(697) /* metro dependency 697: native */).colors.PANEL_BG;
|
|
object3.backgroundColor = PANEL_BG;
|
|
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
const BLACK = (importDefault(697) /* metro dependency 697: native */).colors.BLACK;
|
|
object3.shadowColor = BLACK;
|
|
object3.shadowOffset = {'width': 0, 'height': 4};
|
|
object3.shadowRadius = 4;
|
|
object2.content = object3;
|
|
object2.scroller = {'alignSelf': 'stretch', 'flexGrow': 0};
|
|
object2.scrollerContent = {'flexDirection': 'column', 'gap': 16};
|
|
const env0_10 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/activate_device/native/ActivateDevice.tsx');
|
|
exports.ActivateDevice = ActivateDevice;
|
|
}
|
|
|
|
function ActivateDevice({onClose, prefilledUserCode}) { // fn#96983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12839:879, offset: 0x0216ed83, size: 815 bytes, params: 2, frame: 29
|
|
var object2;
|
|
const styles = useStyles();
|
|
const binding = env0_4;
|
|
let useState = binding.useState;
|
|
const value3 = Reflect.apply(useState, binding, [{'type': 'user-code-input', 'usePrefilledCode': true}]);
|
|
const binding2 = env0_3;
|
|
const value4 = binding2(value3, 2);
|
|
const property = value4[0];
|
|
const property2 = value4[1];
|
|
useState = binding.useState;
|
|
const value6 = binding2(Reflect.apply(useState, binding, [null]), 2);
|
|
const property3 = value6[0];
|
|
var env0_3 = value6[1];
|
|
(require(12650) /* metro dependency 12650: useActivateDeviceStepTracking */).useActivateDeviceStepTracking(property);
|
|
let useCallback = binding.useCallback;
|
|
const value7 = Reflect.apply(useCallback, binding, [_fun96984, [property2]]);
|
|
const value8 = binding.useCallback(_fun96985, [property2]);
|
|
useCallback = binding.useCallback;
|
|
const value11 = binding.useCallback(_fun96987,
|
|
[(require(12652) /* metro dependency 12652: useDeviceCodeAuthorizeCallback */).useDeviceCodeAuthorizeCallback(value7,
|
|
Reflect.apply(useCallback, binding, [_fun96986, [property2]]), value8)]);
|
|
binding.useEffect(_fun96989, [property]);
|
|
binding.useEffect(_fun96991, [property3]);
|
|
const type = property.type;
|
|
const r10 = type === 'user-code-input' ? ((UserCodeInput) => <UserCodeInput prefilledUserCode={property.usePrefilledCode ? prefilledUserCode : undefined} onUserCodeAccepted={value11} onClose={onClose} />)((require(12655) /* metro dependency 12655: UserCodeInput */).UserCodeInput) : type === 'authorization' ? <ActivityIndicator animating /> : type === 'success' ? ((ActivateDeviceSuccess) => <ActivateDeviceSuccess onComplete={onClose} data={property.userCodeData} successImage={property3} />)((require(12659) /* metro dependency 12659: ActivateDeviceSuccess */).ActivateDeviceSuccess) : type !== 'error' ? null : ((ActivateDeviceError) => <ActivateDeviceError onRetry={value7} />)((require(12660) /* metro dependency 12660: ActivateDeviceError */).ActivateDeviceError);
|
|
object2 = {};
|
|
const avatarUtilsModule = require(1423) /* metro dependency 1423: AvatarUtils */;
|
|
object2.source = avatarUtilsModule.makeSource(importDefault(12661) /* metro dependency 12661: mobile_backgroundJpg */);
|
|
object2.imageStyle = styles.imageStyle;
|
|
object2.style = [styles.background];
|
|
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
|
|
return (
|
|
<ImageBackground {...object2}>
|
|
<SafeAreaPaddingView
|
|
bottom
|
|
top
|
|
style={styles.safeArea}
|
|
>
|
|
<View style={styles.content}>
|
|
<ScrollView
|
|
bounces={false}
|
|
style={styles.scroller}
|
|
contentContainerStyle={styles.scrollerContent}
|
|
>
|
|
{r10}
|
|
</ScrollView>
|
|
</View>
|
|
</SafeAreaPaddingView>
|
|
</ImageBackground>
|
|
);
|
|
}
|
|
|
|
function _fun96984() { // fn#96984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12839:1113, offset: 0x0216f0b2, size: 28 bytes, params: 1, frame: 11
|
|
env0_1({type: 'user-code-input'});
|
|
}
|
|
|
|
function _fun96985(a0) { // fn#96985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12839:1170, offset: 0x0216f0ce, size: 34 bytes, params: 2, frame: 11
|
|
env0_1({type: 'success', userCodeData: a0});
|
|
}
|
|
|
|
function _fun96986(a0) { // fn#96986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12839:1233, offset: 0x0216f0f0, size: 34 bytes, params: 2, frame: 11
|
|
env0_1({type: 'error', userCodeData: a0});
|
|
}
|
|
|
|
function _fun96987(a0) { // fn#96987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12839:1342, offset: 0x0216f112, size: 124 bytes, params: 2, frame: 15
|
|
var environment;
|
|
const env0_0 = a0;
|
|
env0_1({type: 'authorization', userCodeData: a0});
|
|
const value = environment.__proto__;
|
|
(require(8870) /* metro dependency 8870: ApplicationUtils */).openOAuth2Modal({'clientId': null, 'scopes': null,
|
|
'responseType': 'code', 'isTrustedName': true, 'isEmbeddedFlow': true, 'withBackPressHandler': false,
|
|
clientId: a0.clientId, scopes: a0.scopes, callbackWithoutPost: callbackWithoutPost});
|
|
}
|
|
|
|
function _fun96989() { // fn#96989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12839:1586, offset: 0x0216f1a9, size: 213 bytes, params: 1, frame: 17
|
|
var environment;
|
|
var userCodeData;
|
|
var value2;
|
|
const ConsoleOAuthApplications = (require(9363) /* metro dependency 9363: ConsoleOAuthApplications */).ConsoleOAuthApplications;
|
|
var items2;
|
|
var scopes;
|
|
if ('userCodeData' in env0_0) {
|
|
userCodeData = env0_0.userCodeData;
|
|
value2 = environment.__proto__;
|
|
items2 = [ConsoleOAuthApplications.PLAYSTATION_APPLICATION_ID];
|
|
items2[1] = ConsoleOAuthApplications.PLAYSTATION_STAGING_APPLICATION_ID;
|
|
if (items2.includes(userCodeData.clientId)) {
|
|
env0_3(importDefault(12653) /* metro dependency 12653: ps_link_success_illustration2xPng */);
|
|
} else {
|
|
scopes = userCodeData.scopes;
|
|
if (scopes.some(_fun96990)) {
|
|
env0_3(importDefault(12654) /* metro dependency 12654: social_layer_link_success_illustration2xPng */);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun96991() { // fn#96991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12839:1891, offset: 0x0216f2a7, size: 57 bytes, params: 1, frame: 12
|
|
var value2;
|
|
if (env0_2 != null) {
|
|
value2 = environment.__proto__;
|
|
(importDefault(5475) /* metro dependency 5475: FastImage */).preload(env0_2);
|
|
}
|
|
}
|
|
|
|
function callbackWithoutPost(a0) { // fn#96988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12839:1547, offset: 0x0216f18e, size: 27 bytes, params: 2, frame: 13
|
|
return env1_4(env0_0, a0);
|
|
}
|
|
|
|
function _fun96990(a0) { // fn#96990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12839:1813, offset: 0x0216f27e, size: 41 bytes, params: 2, frame: 11
|
|
const value = environment.__proto__.__proto__;
|
|
return (require(4121) /* metro dependency 4121: scopes */).isSocialLayerUmbrellaScope(a0);
|
|
}
|
|
|