190 lines
10 KiB
TypeScript
190 lines
10 KiB
TypeScript
/* Metro module 13313; source: modules/auth/native/components/MFACodeInput.tsx; dependencies: [57, 31, 27, 1226, 661, 33, 4501, 697, 4002, 6797, 4594, 5076, 8967, 1244, 4573, 2] */
|
|
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import AuthenticationStore from '../../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
|
|
import UseMountEffect from '../../../../hooks/useMountEffect.tsx'; /* Metro dependency 4594 */
|
|
import FreeFormInputGroup from '../../../../design/void/Form/native/FreeFormInputGroup.tsx'; /* Metro dependency 8967 */
|
|
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 JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as SharedModule from '../../../../design/shared.tsx'; /* Metro dependency 4002 */
|
|
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
|
|
function _fun101432(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#101432, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13503:6, offset: 0x02214733, size: 389 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
const RED_400 = (Native).unsafe_rawColors.RED_400;
|
|
const env0_12 = Reflect.apply(createStyles, CreateStylesModule, [{inputContainer: {'marginTop': 20,
|
|
'flexDirection': 'row', 'justifyContent': 'center', 'alignSelf': 'stretch'}, input: {'flex': 1, 'maxWidth': 336,
|
|
'flexDirection': 'row', 'alignSelf': 'stretch'}, status: {'flex': 1, 'maxHeight': 20, 'alignItems': 'center',
|
|
'marginTop': 8}, error: {color: RED_400}, minHeightGuard: {minHeight: 20}}]);
|
|
value = value.forwardRef(_fun101433);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/auth/native/components/MFACodeInput.tsx');
|
|
exports.default = value;
|
|
function _fun101433({appState, handleSubmit, style, error, showActivityIndicator, resetLoginOnClose}, a1) { // fn#101433, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13503:569, offset: 0x022148b8, size: 750 bytes, params: 3, frame: 32
|
|
var r8;
|
|
var isThemeDark2;
|
|
var unsafe_rawColors;
|
|
if (resetLoginOnClose !== undefined) {
|
|
}
|
|
const styles = useStyles();
|
|
const useThemeContext = SharedModule.useThemeContext;
|
|
const theme = Reflect.apply(useThemeContext, SharedModule, []).theme;
|
|
const binding = undefined;
|
|
let useState = binding.useState;
|
|
const value2 = Reflect.apply(useState, binding, ['']);
|
|
const binding2 = undefined;
|
|
const value3 = binding2(value2, 2);
|
|
const property = value3[0];
|
|
const property2 = value3[1];
|
|
useState = binding.useState;
|
|
const value5 = binding2(Reflect.apply(useState, binding, [null]), 2);
|
|
const property3 = value5[0];
|
|
const env0_6 = value5[1];
|
|
const value6 = binding.useCallback(_fun101434, [property3]);
|
|
(UseMountEffect)(_fun101436);
|
|
binding.useEffect(_fun101439, [appState, value6]);
|
|
binding.useEffect(_fun101440, [property, handleSubmit]);
|
|
binding.useImperativeHandle(a1, function() {
|
|
return {clear: _fun101442};
|
|
}, []);
|
|
const jsxRuntimeEnv0_10Binding = jsxRuntimeEnv0_10;
|
|
const items2 = [styles.inputContainer, style];
|
|
const intl = (IndexNativeModule).intl;
|
|
const freeFormInputGroup = (
|
|
<FreeFormInputGroup
|
|
autoFocus
|
|
style={items2}
|
|
textStyle={styles.input}
|
|
value={property}
|
|
autoCapitalize="none"
|
|
maxLength={8}
|
|
textContentType="oneTimeCode"
|
|
onChangeText={property2}
|
|
accessibilityLabel={intl.string((IndexNativeModule).t.yO4lAM)}
|
|
/>
|
|
);
|
|
const items3 = [styles.status];
|
|
const Boolean = global.Boolean;
|
|
items3[1] = Boolean(error) && styles.minHeightGuard;
|
|
if (showActivityIndicator) {
|
|
isThemeDark2 = SharedModule.isThemeDark(theme);
|
|
unsafe_rawColors = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors;
|
|
r8 = <ActivityIndicator color={isThemeDark2 ? unsafe_rawColors.WHITE : unsafe_rawColors.PRIMARY_500} />;
|
|
} else if (error != null) {
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
r8 = (
|
|
<Text style={styles.error} variant="text-md/medium">
|
|
{error}
|
|
</Text>
|
|
);
|
|
} else {
|
|
r8 = null;
|
|
}
|
|
return (
|
|
<>
|
|
{freeFormInputGroup}
|
|
<View style={items3}>
|
|
{r8}
|
|
</View>
|
|
</>
|
|
);
|
|
function _fun101434() { // fn#101434, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13503:815, offset: 0x02214ba6, size: 56 bytes, params: 1, frame: 12
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
value = require(6797) /* metro dependency 6797: ClipboardUtilsNative */;
|
|
value = value.getString();
|
|
value.then(_fun101435);
|
|
function _fun101435(a0) { // fn#101435, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13503:846, offset: 0x02214bde, size: 141 bytes, params: 2, frame: 15
|
|
var r3;
|
|
var r1;
|
|
const value = a0.trim();
|
|
const value3 = value !== env1_5;
|
|
if (value3) {
|
|
r3 = value.length === 6 && RegExp('^\\d+$', '').test(value);
|
|
r3 = !r3 ? value.length === 8 && RegExp('^[a-z0-9]+$', 'i').test(value) : r3;
|
|
r1 = r3;
|
|
} else {
|
|
r1 = value3;
|
|
}
|
|
if (r1) {
|
|
env1_4(value);
|
|
env1_6(value);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun101436() { // fn#101436, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13503:982, offset: 0x02214c6b, size: 24 bytes, params: 1, frame: 9
|
|
env0_7();
|
|
return _fun101437;
|
|
function _fun101437() { // fn#101437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13503:991, offset: 0x02214c83, size: 131 bytes, params: 1, frame: 13
|
|
var environment;
|
|
var value2;
|
|
var resetLoginOnCloseBinding;
|
|
let value = environment.__proto__.__proto__;
|
|
const authenticationStoreBinding = AuthenticationStore;
|
|
if (authenticationStoreBinding.isAuthenticated()) {
|
|
value = require(6797) /* metro dependency 6797: ClipboardUtilsNative */;
|
|
value = value.getString();
|
|
value.then(_fun101438);
|
|
} else {
|
|
value2 = environment.__proto__;
|
|
resetLoginOnCloseBinding = resetLoginOnClose;
|
|
value = importDefault(5076) /* metro dependency 5076: AuthenticationActionCreators */;
|
|
if (resetLoginOnCloseBinding) {
|
|
value.loginReset();
|
|
} else {
|
|
value.loginStatusReset();
|
|
}
|
|
}
|
|
function _fun101438(a0) { // fn#101438, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13503:1042, offset: 0x02214d06, size: 72 bytes, params: 2, frame: 12
|
|
let value = environment.__proto__.__proto__;
|
|
if (env2_3 !== '' && env2_3 === a0) {
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
value = require(6797) /* metro dependency 6797: ClipboardUtilsNative */;
|
|
value.copy('');
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun101439() { // fn#101439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13503:1150, offset: 0x02214d4e, size: 38 bytes, params: 1, frame: 10
|
|
const appStateBinding = appState;
|
|
const ACTIVE = AppStates.ACTIVE;
|
|
if (appStateBinding === ACTIVE) {
|
|
env0_7();
|
|
}
|
|
}
|
|
|
|
function _fun101440() { // fn#101440, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13503:1195, offset: 0x02214d74, size: 91 bytes, params: 1, frame: 13
|
|
let r1 = Module00057.length === 6 && RegExp('^\\d+$', '').test(Module00057);
|
|
r1 = !r1 ? Module00057.length === 8 : r1;
|
|
if (r1) {
|
|
handleSubmit(Module00057);
|
|
}
|
|
}
|
|
|
|
function _fun101441() { // fn#101441, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13503:1286, offset: 0x02214dcf, size: 18 bytes, params: 1, frame: 2
|
|
return {clear: clear_101442};
|
|
function clear_101442() { // fn#101442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13503:1292, offset: 0x02214de1, size: 20 bytes, params: 1, frame: 11
|
|
env1_4('');
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun101432, 13313, [57, 31, 27, 1226, 661, 33, 4501, 697, 4002, 6797, 4594, 5076, 8967, 1244, 4573,
|
|
2]) /* metro module 13313, dependencies: [57, 31, 27, 1226, 661, 33, 4501, 697, 4002, 6797, 4594, 5076, 8967, 1244, 4573, 2] */;
|