2026-07-30 10:14:41 +00:00
// Module ID: 9257
// Function ID: 9258
2026-07-20 16:05:17 +00:00
// Name: SingleCodeInput
2026-07-30 10:14:41 +00:00
// Dependencies: [32, 19, 17, 21, 4189, 712, 1297, 6724, 1236, 4600, 4185, 5638, 2]
2026-07-20 16:05:17 +00:00
// Exports: CodeBlocks, default
2026-07-30 10:14:41 +00:00
// Module 9257 (SingleCodeInput)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray" ;
2026-07-29 08:29:29 +00:00
import noop from "noop" ;
2026-07-23 10:11:24 +00:00
import get_ActivityIndicator from "get ActivityIndicator" ;
import jsxProd from "jsxProd" ;
2026-07-29 08:29:29 +00:00
import createCacheKey from "createCacheKey" ;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c5 ;
2026-07-23 10:11:24 +00:00
let closure_6 ;
2026-07-29 08:29:29 +00:00
let error ;
let metroImportAll ;
2026-07-23 10:11:24 +00:00
const require = arg1 ;
2026-07-20 16:05:17 +00:00
function SingleCodeInput ( loading ) {
let code ;
let count ;
let disabled ;
let error ;
2026-07-23 10:11:24 +00:00
let importDefault ;
2026-07-20 16:05:17 +00:00
let flag = loading . loading ;
if ( flag === undefined ) {
flag = false ;
}
( { count , error } = loading ) ;
if ( count === undefined ) {
count = 6 ;
}
let NUMERIC = loading . codeType ;
if ( NUMERIC === undefined ) {
NUMERIC = obj . NUMERIC ;
}
2026-07-23 10:11:24 +00:00
( { onCodeEntered : importDefault , disabled , code } = loading ) ;
2026-07-20 16:05:17 +00:00
const setCode = loading . setCode ;
const tmp2 = callback4 ( ) ;
2026-07-29 08:29:29 +00:00
obj = { style : tmp2.singleInputWrapper , children : null } ;
obj = { errorMessage : error , value : code , autoCapitalize : "characters" , maxLength : count , accessibilityLabel : null , textContentType : "oneTimeCode" , keyboardType : null , onChange : null , isDisabled : null , isClearable : true , autoFocus : true } ;
2026-07-23 10:11:24 +00:00
const intl = NUMERIC ( code [ 8 ] ) . intl ;
2026-07-29 08:29:29 +00:00
obj [ 4 ] = intl . string ( NUMERIC ( code [ 8 ] ) . t [ "ysthA+" ] ) ;
2026-07-20 16:05:17 +00:00
let str = "default" ;
if ( NUMERIC === obj . NUMERIC ) {
str = "number-pad" ;
}
2026-07-29 08:29:29 +00:00
obj [ 6 ] = str ;
obj [ 7 ] = function handleChange ( str ) {
2026-07-23 10:11:24 +00:00
setCode ( str . replace ( NUMERIC === outer1_9 . NUMERIC ? /\D/g : /[^A-Z0-9]/g , "" ) ) ;
2026-07-20 16:05:17 +00:00
} ;
2026-07-29 08:29:29 +00:00
obj [ 8 ] = disabled ;
2026-07-23 10:11:24 +00:00
const items = [ closure_7 ( NUMERIC ( code [ 7 ] ) . TextInput , obj ) , ] ;
2026-07-29 08:29:29 +00:00
obj = { style : tmp2.singleInputButton , children : null } ;
const obj1 = { loading : flag , variant : "primary" , size : "lg" , text : null , onPress : null , disabled : null } ;
const intl2 = tmp6 ( tmp7 [ 8 ] ) . intl ;
obj1 [ 3 ] = intl2 . string ( NUMERIC ( code [ 8 ] ) . t [ "13ofGu" ] ) ;
obj1 [ 4 ] = function handlePressSubmit() {
2026-07-20 16:05:17 +00:00
return callback ( code ) ;
} ;
2026-07-29 08:29:29 +00:00
obj1 [ 5 ] = code . length !== count || disabled ;
obj [ 1 ] = closure_7 ( NUMERIC ( code [ 9 ] ) . Button , obj1 ) ;
2026-07-20 16:05:17 +00:00
items [ 1 ] = closure_7 ( closure_5 , obj ) ;
2026-07-29 08:29:29 +00:00
obj [ 1 ] = items ;
2026-07-20 16:05:17 +00:00
return closure_8 ( closure_5 , obj ) ;
}
function CodeFieldInner ( loading ) {
let actions ;
let backgroundStyle ;
let description ;
let disabled ;
let error ;
let footer ;
let onCodeEntered ;
let title ;
let tmp4 ;
let tmp5 ;
let flag = loading . loading ;
( { title , description , error , onCodeEntered } = loading ) ;
if ( flag === undefined ) {
flag = false ;
}
let num = loading . count ;
if ( num === undefined ) {
num = 6 ;
}
let NUMERIC = loading . codeType ;
if ( NUMERIC === undefined ) {
NUMERIC = obj . NUMERIC ;
}
( { actions , footer , backgroundStyle , disabled } = loading ) ;
const tmp2 = callback4 ( ) ;
2026-07-29 08:29:29 +00:00
obj = { style : items , contentContainerStyle : tmp2.backgroundFlex , keyboardShouldPersistTaps : "handled" , alwaysBounceVertical : false , children : null } ;
2026-07-23 10:11:24 +00:00
items = [ tmp2 . background , backgroundStyle ] ;
2026-07-29 08:29:29 +00:00
obj = { style : tmp2.container , children : null } ;
2026-07-20 16:05:17 +00:00
[ tmp4 , tmp5 ] = callback ( React . useState ( "" ) , 2 ) ;
2026-07-23 10:11:24 +00:00
obj = { style : tmp2.title , accessibilityRole : "header" , variant : "heading-xl/extrabold" , color : "mobile-text-heading-primary" , children : title } ;
2026-07-29 08:29:29 +00:00
const items1 = [ callback2 ( require ( 4185 ) /* Text */ . Text , obj ) , callback2 ( require ( 4185 ) /* Text */ . Text , { style : tmp2.subtitle , variant : "text-sm/medium" , color : "text-default" , children : description } ) , , ] ;
2026-07-23 10:11:24 +00:00
const obj1 = { style : tmp2.subtitle , variant : "text-sm/medium" , color : "text-default" , children : description } ;
2026-07-20 16:05:17 +00:00
const tmp3 = callback ( React . useState ( "" ) , 2 ) ;
2026-07-29 08:29:29 +00:00
items1 [ 2 ] = callback2 ( closure_5 , { style : tmp2.inputContainer , children : callback2 ( SingleCodeInput , { loading : flag , error , count : num , onCodeEntered , codeType : NUMERIC , disabled , code : tmp4 , setCode : tmp5 } ) } ) ;
2026-07-20 16:05:17 +00:00
items1 [ 3 ] = actions ;
2026-07-29 08:29:29 +00:00
obj [ 1 ] = items1 ;
const items2 = [ callback3 ( closure_5 , obj ) , callback2 ( importDefault ( 5638 ) , { children : footer } ) ] ;
obj [ 4 ] = items2 ;
2026-07-20 16:05:17 +00:00
return callback3 ( closure_6 , obj ) ;
}
2026-07-29 08:29:29 +00:00
( { View : c5 , ScrollView : closure_6 } = get_ActivityIndicator ) ;
( { jsx : error , jsxs : metroImportAll } = jsxProd ) ;
2026-07-20 16:05:17 +00:00
let obj = { NUMERIC : "numeric" , ALPHANUMERIC : "alphanumeric" } ;
2026-07-29 08:29:29 +00:00
obj = { viewWrapper : { flex : 1 } , background : null , backgroundFlex : null , container : null , title : null , subtitle : null , inputContainer : null , codeContainer : null , spacer : null , inputWrapper : null , inputWrapperError : null , input : null , singleInputWrapper : null , singleInputButton : null } ;
obj = { backgroundColor : require ( "Themes" ) . colors . BACKGROUND_BASE_LOW , flex : 1 } ;
obj [ 1 ] = obj ;
obj [ 2 ] = { flex : 1 , justifyContent : "space-between" } ;
obj [ 3 ] = { padding : 16 } ;
obj [ 4 ] = { textAlign : "center" } ;
obj [ 5 ] = { marginTop : 8 , lineHeight : 18 , textAlign : "center" } ;
obj [ 6 ] = { marginTop : 20 , width : "100%" , alignItems : "center" } ;
obj [ 7 ] = { maxWidth : 336 , width : "100%" , flexDirection : "row" , justifyContent : "space-around" } ;
obj [ 8 ] = { width : 4 } ;
createCacheKey = { borderWidth : 1 , borderRadius : 5 , alignItems : "center" , backgroundColor : require ( "Themes" ) . colors . BACKGROUND_BASE_LOWEST , borderColor : require ( "Themes" ) . colors . BACKGROUND_BASE_LOWEST } ;
obj [ 9 ] = createCacheKey ;
obj [ 10 ] = { borderColor : require ( "Themes" ) . unsafe_rawColors . RED_400 } ;
obj [ 11 ] = { textAlign : "center" } ;
obj [ 12 ] = { width : "100%" } ;
obj [ 13 ] = { marginTop : 8 , justifyContent : "flex-end" } ;
let closure_10 = createCacheKey . createStyles ( obj ) ;
let obj2 = { borderColor : require ( "Themes" ) . unsafe_rawColors . RED_400 } ;
2026-07-23 10:11:24 +00:00
const result = require ( "get ActivityIndicator" ) . fileFinishedImporting ( "modules/phone/native/CodeField.tsx" ) ;
2026-07-20 16:05:17 +00:00
export default function CodeField ( disableKeyboardAvoidingView ) {
if ( disableKeyboardAvoidingView . disableKeyboardAvoidingView ) {
let obj = { } ;
const merged = Object . assign ( disableKeyboardAvoidingView ) ;
let tmp2Result = tmp2 ( CodeFieldInner , obj ) ;
} else {
2026-07-29 08:29:29 +00:00
obj = { style : null , children : null } ;
obj [ 0 ] = tmp . viewWrapper ;
2026-07-20 16:05:17 +00:00
obj = { } ;
const merged1 = Object . assign ( disableKeyboardAvoidingView ) ;
2026-07-29 08:29:29 +00:00
obj [ 1 ] = tmp2 ( CodeFieldInner , obj ) ;
tmp2Result = tmp2 ( importDefault ( 5638 ) , obj ) ;
const tmp5 = importDefault ( 5638 ) ;
2026-07-20 16:05:17 +00:00
}
return tmp2Result ;
} ;
export const CodeType = obj ;
2026-07-29 08:29:29 +00:00
export const CodeBlocks = function CodeBlocks ( onCodeEntered ) {
let obj ;
onCodeEntered = onCodeEntered . onCodeEntered ;
const num2 = onCodeEntered ;
let num = onCodeEntered . count ;
2026-07-20 16:05:17 +00:00
if ( num === undefined ) {
num = 6 ;
}
2026-07-29 08:29:29 +00:00
let NUMERIC = onCodeEntered . codeType ;
2026-07-20 16:05:17 +00:00
if ( NUMERIC === undefined ) {
2026-07-29 08:29:29 +00:00
NUMERIC = obj . NUMERIC ;
2026-07-20 16:05:17 +00:00
}
let first ;
2026-07-29 08:29:29 +00:00
let callback ;
let React ;
let closure_5 ;
const tmp3 = callback4 ( ) ;
const tmp4 = callback ( React . useState ( Array ( num ) . fill ( "" ) ) , 2 ) ;
first = tmp4 [ 0 ] ;
callback = tmp4 [ 1 ] ;
2026-07-20 16:05:17 +00:00
const ArrayResult = Array ( num ) ;
2026-07-29 08:29:29 +00:00
React = React . useRef ( Array ( num ) . fill ( null ) ) ;
closure_5 = React . useRef ( onCodeEntered ) ;
2026-07-20 16:05:17 +00:00
const effect = React . useEffect ( ( ) = > {
2026-07-29 08:29:29 +00:00
closure_5 . current = num2 ;
2026-07-20 16:05:17 +00:00
} ) ;
2026-07-23 10:11:24 +00:00
let items = [ first ] ;
2026-07-20 16:05:17 +00:00
const effect1 = React . useEffect ( ( ) = > {
2026-07-29 08:29:29 +00:00
if ( first . every ( ( str ) = > "" !== str . trim ( ) ) ) {
ref2 . current ( first . join ( "" ) ) ;
2026-07-20 16:05:17 +00:00
}
} , items ) ;
2026-07-29 08:29:29 +00:00
let items1 = [ ] ;
for ( let num2 = 0 ; num2 < num ; num2 = num2 + 1 ) {
let tmp8 = num2 ;
if ( num2 === num / 2 ) {
let tmp9 = callback2 ;
let tmp10 = closure_5 ;
obj = { style : null } ;
obj [ 0 ] = tmp3 . spacer ;
let arr = items1 . push ( callback2 ( closure_5 , obj , "spacer" ) ) ;
}
let tmp12 = callback2 ;
let items2 = [ tmp3 . inputWrapper , ] ;
let inputWrapperError = null ;
let tmp13 = closure_5 ;
if ( tmp ) {
inputWrapperError = tmp3 . inputWrapperError ;
}
obj = { style : null , children : null } ;
items2 [ 1 ] = inputWrapperError ;
obj [ 0 ] = items2 ;
let tmp15 = num2 ;
let tmp16 = first ;
let obj1 = { ref : null , style : null , keyboardType : null , autoFocus : null , value : null , onKeyPress : null , onChangeText : null , selection : null , autoCapitalize : "characters" , autoCorrect : false } ;
obj1 [ 0 ] = function ref ( arg0 ) {
ref . current [ num2 ] = arg0 ;
} ;
let obj2 = { height : 42 , width : null } ;
obj2 [ 1 ] = 252 / num ;
let items3 = [ obj2 , tmp3 . input ] ;
obj1 [ 1 ] = items3 ;
let tmp17 = obj ;
let str = "default" ;
if ( NUMERIC === obj . NUMERIC ) {
str = "phone-pad" ;
}
obj1 [ 2 ] = str ;
obj1 [ 3 ] = 0 === num2 ;
obj1 [ 4 ] = first [ num2 ] ;
obj1 [ 5 ] = function onKeyPress ( nativeEvent ) {
if ( "Backspace" !== nativeEvent . nativeEvent . key ) {
if ( ref . current [ tmp + 1 ] != null ) {
obj2 . focus ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} else if ( "" === first [ tmp ] ) {
const diff = tmp - 1 ;
const items = [ ] ;
HermesBuiltin . arraySpread ( tmp2 , 0 ) ;
items [ diff ] = "" ;
callback ( items ) ;
if ( ref . current [ diff ] != null ) {
obj . focus ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
} ;
obj1 [ 6 ] = function onChangeText ( arr ) {
let str = arr ;
if ( arr [ 0 ] === first [ num2 ] ) {
str = arr . slice ( 1 ) ;
}
const str2 = str . replace ( "-" , "" ) ;
const tmp = num2 ;
const tmp2 = first ;
const str4 = str . replace ( "-" , "" ) . trim ( ) . toUpperCase ( ) ;
let parts = str4 . split ( "" ) ;
if ( "" === str4 ) {
parts = [ "" ] ;
}
const items = [ . . . tmp2 ] ;
const items1 = [ tmp , 1 , . . . parts ] ;
items . splice . apply ( items1 ) ;
callback ( items . slice ( 0 , num ) ) ;
} ;
let obj3 = { start : null , end : null } ;
obj3 [ 0 ] = first [ num2 ] . length ;
obj3 [ 1 ] = first [ num2 ] . length ;
obj1 [ 7 ] = obj3 ;
obj [ 1 ] = tmp12 ( num2 ( first [ 6 ] ) . TextInput , obj1 ) ;
arr = items1 . push ( tmp12 ( tmp13 , obj , num2 ) ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return callback2 ( closure_5 , { style : tmp3.codeContainer , children : items1 } ) ;
2026-07-20 16:05:17 +00:00
} ;