2026-08-08 06:10:11 +00:00
// Module ID: 11543
// Function ID: 11544
2026-07-29 08:29:29 +00:00
// Name: validateNumericOptionRange
2026-08-08 06:10:11 +00:00
// Dependencies: [1975, 4639, 1935, 9997, 38, 1236, 9995, 6980, 9998, 2]
2026-07-20 16:05:17 +00:00
2026-08-08 06:10:11 +00:00
// Module 11543 (validateNumericOptionRange)
2026-07-29 08:29:29 +00:00
import _getSystemLocale from "_getSystemLocale" ;
import map from "map" ;
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1 ;
function validateNumericOptionRange ( NumberResult , minValue , _8Y5zsp , CyRLmH , VD3Q_S ) {
2026-07-20 16:05:17 +00:00
if ( null == minValue . minValue ) {
2026-07-29 08:29:29 +00:00
return { success : true } ;
2026-07-20 16:05:17 +00:00
}
if ( null != minValue . maxValue ) {
if ( null != minValue . minValue ) {
2026-07-29 08:29:29 +00:00
let obj = { success : false , error : null } ;
const intl3 = require ( 1236 ) /* getSystemLocale */ . intl ;
obj = { minimum : null , maximum : null } ;
const minValue2 = minValue . minValue ;
obj [ 0 ] = minValue2 . toLocaleString ( require ( 1236 ) /* getSystemLocale */ . intl . currentLocale , { useGrouping : false } ) ;
const maxValue2 = minValue . maxValue ;
obj [ 1 ] = maxValue2 . toLocaleString ( require ( 1236 ) /* getSystemLocale */ . intl . currentLocale , { useGrouping : false } ) ;
obj [ 1 ] = intl3 . formatToPlainString ( _8Y5zsp , obj ) ;
2026-07-20 16:05:17 +00:00
return obj ;
}
}
if ( null != minValue . minValue ) {
2026-07-29 08:29:29 +00:00
const obj1 = { success : false , error : null } ;
const intl2 = require ( 1236 ) /* getSystemLocale */ . intl ;
const obj2 = { minimum : null } ;
minValue = minValue . minValue ;
obj2 [ 0 ] = minValue . toLocaleString ( require ( 1236 ) /* getSystemLocale */ . intl . currentLocale , { useGrouping : false } ) ;
obj1 [ 1 ] = intl2 . formatToPlainString ( CyRLmH , obj2 ) ;
2026-07-20 16:05:17 +00:00
return obj1 ;
} else if ( null != minValue . maxValue ) {
2026-07-29 08:29:29 +00:00
obj = { success : false , error : null } ;
const intl = require ( 1236 ) /* getSystemLocale */ . intl ;
const obj3 = { maximum : null } ;
const maxValue = minValue . maxValue ;
obj3 [ 0 ] = maxValue . toLocaleString ( require ( 1236 ) /* getSystemLocale */ . intl . currentLocale , { useGrouping : false } ) ;
obj [ 1 ] = intl . formatToPlainString ( VD3Q_S , obj3 ) ;
return obj ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
let obj = {
2026-08-06 08:05:19 +00:00
[ arg1 ( 1935 ) . ApplicationCommandOptionType . SUB_COMMAND ] : ( ) = > ( { success : false } ) ,
[ arg1 ( 1935 ) . ApplicationCommandOptionType . SUB_COMMAND_GROUP ] : ( ) = > ( { success : false } ) ,
[ arg1 ( 1935 ) . ApplicationCommandOptionType . BOOLEAN ] : ( type ) = > {
2026-07-20 16:05:17 +00:00
if ( "text" !== type . type ) {
2026-07-29 08:29:29 +00:00
return { success : false } ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj = { success : null } ;
2026-07-20 16:05:17 +00:00
const trimmed = type . text . trim ( ) ;
2026-08-08 06:10:11 +00:00
obj [ 0 ] = null != require ( 9997 ) /* toChoiceBooleanValue */ . toChoiceBooleanValue ( trimmed ) ;
2026-07-20 16:05:17 +00:00
return obj ;
}
} ,
2026-08-06 08:05:19 +00:00
[ arg1 ( 1935 ) . ApplicationCommandOptionType . STRING ] : ( type , type2 , id ) = > {
importDefault ( 38 ) ( type2 . type === require ( 1935 ) /* PermissionOverwriteType */ . ApplicationCommandOptionType . STRING , "option type must match validator type" ) ;
2026-07-20 16:05:17 +00:00
type = type . type ;
if ( "emoji" === type ) {
let surrogate = type . surrogate ;
} else if ( "text" === type ) {
surrogate = type . text . trim ( ) ;
const str2 = type . text ;
} else {
2026-07-29 08:29:29 +00:00
return { success : false } ;
2026-07-20 16:05:17 +00:00
}
if ( null != type2 . choices ) {
2026-07-29 08:29:29 +00:00
let obj = { success : null } ;
2026-08-08 06:10:11 +00:00
let tmp3Result = tmp3 ( 9997 ) ;
2026-07-29 08:29:29 +00:00
obj [ 0 ] = null != tmp3Result . findChoiceStringValue ( type2 . choices , surrogate ) ;
2026-07-20 16:05:17 +00:00
return obj ;
} else {
if ( type2 . autocomplete ) {
2026-08-08 06:10:11 +00:00
tmp3Result = tmp3 ( 9997 ) ;
2026-07-29 08:29:29 +00:00
if ( null != tmp3Result . findAutocompleteChoiceStringValue ( id , type2 . name , surrogate ) ) {
return { success : true } ;
2026-07-20 16:05:17 +00:00
}
}
if ( undefined !== type2 . minLength ) {
if ( null == surrogate ) {
2026-07-29 08:29:29 +00:00
return { success : false } ;
2026-07-20 16:05:17 +00:00
} else {
if ( undefined === type2 . minLength ) {
if ( undefined !== type2 . maxLength ) {
2026-07-29 08:29:29 +00:00
if ( ! obj . success ) {
return obj ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj = { success : true } ;
2026-07-20 16:05:17 +00:00
}
if ( undefined !== type2 . maxLength ) {
if ( undefined !== type2 . minLength ) {
if ( type2 . minLength === type2 . maxLength ) {
2026-07-29 08:29:29 +00:00
const obj1 = { success : false , error : null } ;
const intl4 = tmp3 ( 1236 ) . intl ;
const obj2 = { value : null } ;
const minLength3 = type2 . minLength ;
obj2 [ 0 ] = minLength3 . toLocaleString ( tmp3 ( 1236 ) . intl . currentLocale , { useGrouping : false } ) ;
obj1 [ 1 ] = intl4 . formatToPlainString ( tmp3 ( 1236 ) . t [ "e+9/SY" ] , obj2 ) ;
obj = obj1 ;
2026-07-20 16:05:17 +00:00
}
}
}
if ( undefined !== type2 . maxLength ) {
if ( undefined !== type2 . minLength ) {
2026-07-29 08:29:29 +00:00
const obj3 = { success : false , error : null } ;
const intl3 = tmp3 ( 1236 ) . intl ;
const obj4 = { minimum : null , maximum : null } ;
const minLength2 = type2 . minLength ;
obj4 [ 0 ] = minLength2 . toLocaleString ( tmp3 ( 1236 ) . intl . currentLocale , { useGrouping : false } ) ;
const maxLength2 = type2 . maxLength ;
obj4 [ 1 ] = maxLength2 . toLocaleString ( tmp3 ( 1236 ) . intl . currentLocale , { useGrouping : false } ) ;
obj3 [ 1 ] = intl3 . formatToPlainString ( tmp3 ( 1236 ) . t . IE1sTh , obj4 ) ;
obj = obj3 ;
2026-07-20 16:05:17 +00:00
}
}
if ( undefined !== type2 . minLength ) {
2026-07-29 08:29:29 +00:00
const obj5 = { success : false , error : null } ;
const intl2 = tmp3 ( 1236 ) . intl ;
const obj6 = { minimum : null } ;
const minLength = type2 . minLength ;
obj6 [ 0 ] = minLength . toLocaleString ( tmp3 ( 1236 ) . intl . currentLocale , { useGrouping : false } ) ;
obj5 [ 1 ] = intl2 . formatToPlainString ( tmp3 ( 1236 ) . t . rXAFQD , obj6 ) ;
obj = obj5 ;
2026-07-20 16:05:17 +00:00
} else if ( undefined !== type2 . maxLength ) {
2026-07-29 08:29:29 +00:00
const obj7 = { success : false , error : null } ;
const intl = tmp3 ( 1236 ) . intl ;
const obj8 = { maximum : null } ;
const maxLength = type2 . maxLength ;
obj8 [ 0 ] = maxLength . toLocaleString ( tmp3 ( 1236 ) . intl . currentLocale , { useGrouping : false } ) ;
obj7 [ 1 ] = intl . formatToPlainString ( tmp3 ( 1236 ) . t [ "ycEPx/" ] , obj8 ) ;
obj = obj7 ;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
return { success : true } ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const tmp2 = importDefault ( 38 ) ;
2026-07-20 16:05:17 +00:00
} ,
2026-08-06 08:05:19 +00:00
[ arg1 ( 1935 ) . ApplicationCommandOptionType . INTEGER ] : ( type , type2 , id ) = > {
importDefault ( 38 ) ( type2 . type === require ( 1935 ) /* PermissionOverwriteType */ . ApplicationCommandOptionType . INTEGER , "option type must match validator type" ) ;
2026-07-20 16:05:17 +00:00
let trimmed = null ;
if ( "text" === type . type ) {
trimmed = type . text . trim ( ) ;
const str = type . text ;
}
if ( null != trimmed ) {
if ( 0 !== trimmed . length ) {
if ( null != type2 . choices ) {
2026-07-29 08:29:29 +00:00
let obj = { success : null } ;
2026-08-08 06:10:11 +00:00
let tmp3Result = tmp3 ( 9997 ) ;
2026-07-29 08:29:29 +00:00
obj [ 0 ] = null != tmp3Result . findChoiceNumberValue ( type2 . choices , trimmed ) ;
2026-07-20 16:05:17 +00:00
return obj ;
} else {
if ( type2 . autocomplete ) {
2026-08-08 06:10:11 +00:00
tmp3Result = tmp3 ( 9997 ) ;
2026-07-29 08:29:29 +00:00
if ( null != tmp3Result . findAutocompleteChoiceNumberValue ( id , type2 . name , trimmed ) ) {
return { success : true } ;
2026-07-20 16:05:17 +00:00
}
}
const _Number = Number ;
2026-08-08 06:10:11 +00:00
const NumberResult = Number ( importAll ( 9995 ) . normalizeNumericString ( _getSystemLocale . locale , trimmed ) ) ;
2026-07-20 16:05:17 +00:00
if ( null != NumberResult ) {
const _isNaN = isNaN ;
if ( ! isNaN ( NumberResult ) ) {
const _Number2 = Number ;
if ( Number . isInteger ( NumberResult ) ) {
const _Number3 = Number ;
if ( Number . isSafeInteger ( NumberResult ) ) {
2026-07-29 08:29:29 +00:00
obj = validateNumericOptionRange ( NumberResult , type2 , tmp3 ( 1236 ) . t [ "8Y5zsp" ] , tmp3 ( 1236 ) . t . CyRLmH , tmp3 ( 1236 ) . t [ "VD3Q+S" ] ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return obj ;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
obj = { success : false } ;
2026-08-08 06:10:11 +00:00
const obj2 = importAll ( 9995 ) ;
2026-07-20 16:05:17 +00:00
}
}
}
return { success : false } ;
} ,
2026-08-06 08:05:19 +00:00
[ arg1 ( 1935 ) . ApplicationCommandOptionType . NUMBER ] : ( type , type2 , id ) = > {
importDefault ( 38 ) ( type2 . type === require ( 1935 ) /* PermissionOverwriteType */ . ApplicationCommandOptionType . NUMBER , "option type must match validator type" ) ;
2026-07-20 16:05:17 +00:00
let trimmed = null ;
if ( "text" === type . type ) {
trimmed = type . text . trim ( ) ;
const str = type . text ;
}
if ( null != trimmed ) {
if ( 0 !== trimmed . length ) {
if ( null != type2 . choices ) {
2026-07-29 08:29:29 +00:00
let obj = { success : null } ;
2026-08-08 06:10:11 +00:00
let tmp3Result = tmp3 ( 9997 ) ;
2026-07-29 08:29:29 +00:00
obj [ 0 ] = null != tmp3Result . findChoiceNumberValue ( type2 . choices , trimmed ) ;
2026-07-20 16:05:17 +00:00
return obj ;
} else {
if ( type2 . autocomplete ) {
2026-08-08 06:10:11 +00:00
tmp3Result = tmp3 ( 9997 ) ;
2026-07-29 08:29:29 +00:00
if ( null != tmp3Result . findAutocompleteChoiceNumberValue ( id , type2 . name , trimmed ) ) {
return { success : true } ;
2026-07-20 16:05:17 +00:00
}
}
const _Number = Number ;
2026-08-08 06:10:11 +00:00
const NumberResult = Number ( importAll ( 9995 ) . normalizeNumericString ( _getSystemLocale . locale , trimmed ) ) ;
2026-07-20 16:05:17 +00:00
const _isNaN = isNaN ;
if ( ! isNaN ( NumberResult ) ) {
const _Number2 = Number ;
if ( NumberResult <= Number . MAX_SAFE_INTEGER ) {
const _Number3 = Number ;
if ( NumberResult >= Number . MIN_SAFE_INTEGER ) {
2026-07-29 08:29:29 +00:00
obj = validateNumericOptionRange ( NumberResult , type2 , tmp3 ( 1236 ) . t [ "8Y5zsp" ] , tmp3 ( 1236 ) . t . CyRLmH , tmp3 ( 1236 ) . t [ "VD3Q+S" ] ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return obj ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj = { success : false } ;
2026-08-08 06:10:11 +00:00
const obj2 = importAll ( 9995 ) ;
2026-07-20 16:05:17 +00:00
}
}
}
return { success : false } ;
} ,
2026-08-06 08:05:19 +00:00
[ arg1 ( 1935 ) . ApplicationCommandOptionType . USER ] : ( type , arg1 , id , throwTypeErrorResult ) = > {
2026-07-20 16:05:17 +00:00
if ( "text" === type . type ) {
2026-07-29 08:29:29 +00:00
if ( obj2 . isSnowflake ( type . text ) ) {
return { success : true } ;
2026-07-20 16:05:17 +00:00
} else {
2026-08-08 06:10:11 +00:00
const tmpResult = tmp ( 9998 ) ;
2026-07-29 08:29:29 +00:00
const applicationCommandOption = tmpResult . resolveApplicationCommandOption ( type . text , throwTypeErrorResult , id , { allowRoles : false } ) ;
2026-07-20 16:05:17 +00:00
type = undefined ;
2026-07-29 08:29:29 +00:00
if ( applicationCommandOption != null ) {
2026-07-20 16:05:17 +00:00
type = applicationCommandOption . type ;
}
2026-07-29 08:29:29 +00:00
let obj = { success : null } ;
obj [ 0 ] = "userMention" === type ;
return obj ;
2026-07-20 16:05:17 +00:00
}
2026-08-08 06:10:11 +00:00
obj2 = require ( 6980 ) /* buildCommand */ ;
2026-07-29 08:29:29 +00:00
tmp = require ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { success : null } ;
obj [ 0 ] = "userMention" === type . type ;
2026-07-20 16:05:17 +00:00
return obj ;
}
} ,
2026-08-06 08:05:19 +00:00
[ arg1 ( 1935 ) . ApplicationCommandOptionType . CHANNEL ] : ( type , arg1 , id , throwTypeErrorResult ) = > {
2026-07-20 16:05:17 +00:00
if ( "text" === type . type ) {
if ( obj2 . isSnowflake ( type . text ) ) {
2026-07-29 08:29:29 +00:00
return { success : true } ;
2026-07-20 16:05:17 +00:00
} else {
2026-08-08 06:10:11 +00:00
const applicationCommandOption = tmp ( 9998 ) . resolveApplicationCommandOption ( type . text , throwTypeErrorResult , id ) ;
2026-07-20 16:05:17 +00:00
type = undefined ;
2026-07-29 08:29:29 +00:00
if ( applicationCommandOption != null ) {
2026-07-20 16:05:17 +00:00
type = applicationCommandOption . type ;
}
2026-07-29 08:29:29 +00:00
let obj = { success : null } ;
obj [ 0 ] = "channelMention" === type ;
2026-07-20 16:05:17 +00:00
return obj ;
}
2026-08-08 06:10:11 +00:00
obj2 = require ( 6980 ) /* buildCommand */ ;
2026-07-29 08:29:29 +00:00
tmp = require ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { success : null } ;
obj [ 0 ] = "channelMention" === type . type ;
2026-07-20 16:05:17 +00:00
return obj ;
}
} ,
2026-08-06 08:05:19 +00:00
[ arg1 ( 1935 ) . ApplicationCommandOptionType . ROLE ] : ( type , arg1 , id , throwTypeErrorResult ) = > {
2026-07-20 16:05:17 +00:00
if ( "text" === type . type ) {
2026-07-29 08:29:29 +00:00
if ( obj2 . isSnowflake ( type . text ) ) {
return { success : true } ;
2026-07-20 16:05:17 +00:00
} else {
2026-08-08 06:10:11 +00:00
const tmp3Result = tmp3 ( 9998 ) ;
2026-07-29 08:29:29 +00:00
const applicationCommandOption = tmp3Result . resolveApplicationCommandOption ( type . text , throwTypeErrorResult , id , { allowUsers : false } ) ;
2026-07-20 16:05:17 +00:00
type = undefined ;
2026-07-29 08:29:29 +00:00
if ( applicationCommandOption != null ) {
2026-07-20 16:05:17 +00:00
type = applicationCommandOption . type ;
}
2026-07-29 08:29:29 +00:00
let obj = { success : null } ;
obj [ 0 ] = "roleMention" === type ;
return obj ;
2026-07-20 16:05:17 +00:00
}
2026-08-08 06:10:11 +00:00
obj2 = require ( 6980 ) /* buildCommand */ ;
2026-07-29 08:29:29 +00:00
tmp3 = require ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
let tmp = "roleMention" === type . type ;
if ( ! tmp ) {
let tmp2 = "textMention" === type . type ;
if ( tmp2 ) {
tmp2 = "@everyone" === type . text ;
}
tmp = tmp2 ;
}
obj = { success : null } ;
obj [ 0 ] = tmp ;
2026-07-20 16:05:17 +00:00
return obj ;
}
} ,
2026-08-06 08:05:19 +00:00
[ arg1 ( 1935 ) . ApplicationCommandOptionType . MENTIONABLE ] : ( type , arg1 , id , throwTypeErrorResult ) = > {
2026-07-20 16:05:17 +00:00
if ( "text" === type . type ) {
if ( obj2 . isSnowflake ( type . text ) ) {
2026-07-29 08:29:29 +00:00
return { success : true } ;
2026-07-20 16:05:17 +00:00
} else {
2026-08-08 06:10:11 +00:00
const applicationCommandOption = tmp4 ( 9998 ) . resolveApplicationCommandOption ( type . text , throwTypeErrorResult , id ) ;
2026-07-29 08:29:29 +00:00
let tmp10 = null != applicationCommandOption ;
if ( tmp10 ) {
let tmp11 = "userMention" === applicationCommandOption . type ;
if ( ! tmp11 ) {
let tmp12 = "roleMention" === applicationCommandOption . type ;
if ( ! tmp12 ) {
let tmp13 = "textMention" === applicationCommandOption . type ;
if ( tmp13 ) {
tmp13 = "@everyone" === applicationCommandOption . text ;
}
tmp12 = tmp13 ;
}
tmp11 = tmp12 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp10 = tmp11 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj = { success : null } ;
obj [ 0 ] = tmp10 ;
2026-07-20 16:05:17 +00:00
return obj ;
}
2026-08-08 06:10:11 +00:00
obj2 = require ( 6980 ) /* buildCommand */ ;
2026-07-29 08:29:29 +00:00
tmp4 = require ;
2026-07-20 16:05:17 +00:00
} else {
let tmp = "userMention" === type . type ;
if ( ! tmp ) {
2026-07-29 08:29:29 +00:00
let tmp2 = "roleMention" === type . type ;
if ( ! tmp2 ) {
let tmp3 = "textMention" === type . type ;
if ( tmp3 ) {
tmp3 = "@everyone" === type . text ;
}
tmp2 = tmp3 ;
}
tmp = tmp2 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { success : null } ;
obj [ 0 ] = tmp ;
2026-07-20 16:05:17 +00:00
return obj ;
}
} ,
2026-08-06 08:05:19 +00:00
[ arg1 ( 1935 ) . ApplicationCommandOptionType . ATTACHMENT ] : ( type , name , channelId , arg3 , closure_10 ) = > {
2026-07-20 16:05:17 +00:00
if ( "text" !== type . type ) {
2026-07-29 08:29:29 +00:00
return { success : false } ;
2026-07-20 16:05:17 +00:00
} else {
2026-08-08 06:10:11 +00:00
let obj = require ( 6980 ) /* buildCommand */ ;
2026-07-29 08:29:29 +00:00
upload = upload . getUpload ( channelId , name . name , obj . getCommandAttachmentDraftType ( closure_10 ) ) ;
obj = { success : null } ;
obj [ 0 ] = null != upload && upload . filename === type . text ;
2026-07-20 16:05:17 +00:00
return obj ;
}
}
} ;
2026-07-23 10:11:24 +00:00
const result = require ( "PermissionOverwriteType" ) . fileFinishedImporting ( "modules/application_commands/ApplicationCommandValidators.tsx" ) ;
2026-07-22 07:54:56 +00:00
export default obj ;