2026-09-05 10:56:28 +00:00
// Module ID: 1233
// Function ID: 1234
2026-09-10 05:38:07 +00:00
// Name: SentryInitUtils
2026-09-10 19:12:31 +00:00
// Dependencies: [5, 17, 1074, 1085, 675, 3, 1234, 1100, 1242, 14157, 7653, 7658, 1358, 1232, 1364, 7654, 1115, 4584, 1608, 1359, 1345, 2]
2026-07-20 16:05:17 +00:00
// Exports: initSentry
2026-09-10 05:38:07 +00:00
// Module 1233 (SentryInitUtils)
import LoggerDefault from "Logger" /* 3 */ ;
import router_utils from "router_utils" /* 1100 */ ;
import SentryUtilsDefault from "SentryUtils" /* 1232 */ ;
import TelemetryRingLifecycle from "TelemetryRingLifecycle" /* 1234 */ ;
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1242 */ ;
import ClientInfoUtilsAll from "ClientInfoUtils" /* 1364 */ ;
2026-09-10 19:12:31 +00:00
import MetricEvents from "MetricEvents" /* 7658 */ ;
2026-09-10 05:38:07 +00:00
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */ ;
2026-07-23 10:11:24 +00:00
2026-09-10 05:38:07 +00:00
const require = globalThis . __r ;
require = fn ;
let closure_15 = async function _maybeBackfillMissingBreadcrumbsFromTelemetryRing ( arg0 ) {
let breadcrumbs = arg0 ;
c2 = 0 ;
c3 = 0 ;
return ( async ( arg0 , value ) = > {
if ( c3 === 2 ) {
c3 = 3 ;
throw new TypeError ( "Generator functions may not be called on executing generators" ) ;
} else if ( tmp4 === 3 ) {
if ( arg0 === 1 ) {
throw value ;
} else if ( arg0 === 2 ) {
const obj2 = { value , done : true } ;
return obj2 ;
2026-07-29 08:29:29 +00:00
} else {
2026-09-10 05:38:07 +00:00
return { value : "HermesInternal" , done : null } ;
}
} else {
try {
c3 = 2 ;
if ( 0 === c2 ) {
if ( arg0 === 1 ) {
c3 = 3 ;
throw value ;
} else if ( arg0 === 2 ) {
c3 = 3 ;
const obj3 = { value , done : true } ;
return obj3 ;
} else {
closure_1 = tmp2 ;
closure_129_0 = breadcrumbs ;
closure_129_1 = undefined ;
breadcrumbs = breadcrumbs . breadcrumbs ;
const _Array2 = Array ;
if ( Array . isArray ( breadcrumbs ) ) {
if ( breadcrumbs . length > 0 ) {
c3 = 3 ;
2026-07-29 08:29:29 +00:00
}
}
2026-09-10 05:38:07 +00:00
const SentryTelemetry = TelemetryRingLifecycle . SentryTelemetry ;
items = [ SentryTelemetry . snapshotForBreadcrumbs ( ) , ] ;
const promise = new Promise ( ( arg0 , arg1 ) = > {
closure_0 = arg1 ;
return setTimeout ( ( ) = > {
const error = new Error ( "TelemetryRing breadcrumb timeout" ) ;
return closure_0 ( error ) ;
} , 200 ) ;
} ) ;
items [ 1 ] = promise ;
c2 = 1 ;
c3 = 1 ;
const obj4 = { value : Promise.race ( items ) . catch ( ( ) = > null ) , done : false } ;
return obj4 ;
}
} else if ( arg0 === 1 ) {
c3 = 3 ;
throw value ;
} else if ( arg0 !== 2 ) {
closure_129_1 = value ;
let isArray = null != closure_129_1 ;
if ( isArray ) {
const _Array = Array ;
isArray = Array . isArray ( closure_129_1 . entries ) ;
}
if ( isArray ) {
isArray = 0 !== closure_129_1 . entries . length ;
}
if ( isArray ) {
const entries = closure_129_1 . entries ;
closure_129_0 . breadcrumbs = entries . map ( ( data ) = > {
let key = data . message ;
if ( key == null ) {
key = data . key ;
}
return { message : key , category : "telemetry_ring" , timestamp : data.timestamp / 1000 , data : data.data } ;
} ) ;
2026-07-29 08:29:29 +00:00
}
}
2026-09-10 05:38:07 +00:00
c3 = 3 ;
const obj = { value , done : true } ;
return obj ;
} catch ( tmp21 ) {
c3 = tmp ;
throw tmp21 ;
2026-07-29 08:29:29 +00:00
}
2026-09-10 05:38:07 +00:00
}
} ) ( ) ;
} ;
2026-07-20 16:05:17 +00:00
function filterError ( event_id , originalException ) {
2026-09-05 10:56:28 +00:00
let message = event_id ;
2026-08-24 06:08:38 +00:00
importDefault = originalException ;
2026-07-20 16:05:17 +00:00
originalException = undefined ;
2026-07-29 08:29:29 +00:00
if ( originalException != null ) {
2026-07-20 16:05:17 +00:00
originalException = originalException . originalException ;
}
let status ;
2026-07-29 08:29:29 +00:00
if ( originalException != null ) {
2026-07-20 16:05:17 +00:00
status = originalException . status ;
}
if ( ! status ) {
let captchaFields ;
2026-07-29 08:29:29 +00:00
if ( originalException != null ) {
2026-07-20 16:05:17 +00:00
captchaFields = originalException . captchaFields ;
}
let tmp4 = null ;
if ( null != captchaFields ) {
let code ;
2026-07-29 08:29:29 +00:00
if ( originalException != null ) {
2026-07-20 16:05:17 +00:00
code = originalException . code ;
}
tmp4 = code ;
}
let flag = false ;
if ( tmp4 ) {
flag = false ;
if ( tmp4 < 0 ) {
flag = true ;
}
}
} else {
flag = true ;
}
if ( ! flag ) {
let originalException1 ;
2026-07-29 08:29:29 +00:00
if ( originalException != null ) {
2026-07-20 16:05:17 +00:00
originalException1 = originalException . originalException ;
}
let code1 ;
2026-07-29 08:29:29 +00:00
if ( originalException1 != null ) {
if ( originalException1 . err != null ) {
2026-07-20 16:05:17 +00:00
code1 = err . code ;
}
}
let flag2 = false ;
if ( "ABORTED" === code1 ) {
flag2 = true ;
}
flag = flag2 ;
}
2026-09-05 10:56:28 +00:00
if ( ! flag ) {
let originalException2 ;
if ( originalException != null ) {
originalException2 = originalException . originalException ;
}
message = undefined ;
if ( originalException2 != null ) {
message = originalException2 . message ;
}
let someResult = typeof message === "string" ;
if ( typeof message === "string" ) {
2026-09-10 05:38:07 +00:00
someResult = closure_11 . some ( ( item ) = > message . includes ( item ) ) ;
2026-09-05 10:56:28 +00:00
}
flag = someResult ;
}
2026-07-20 16:05:17 +00:00
if ( flag ) {
2026-07-29 08:29:29 +00:00
event_id = event_id . event_id ;
2026-09-05 10:56:28 +00:00
let tmp20 = typeof event_id === "string" ;
2026-08-04 21:03:28 +00:00
if ( typeof event_id === "string" ) {
2026-09-05 10:56:28 +00:00
tmp20 = 0 !== event_id . length ;
2026-07-29 08:29:29 +00:00
}
2026-09-05 10:56:28 +00:00
if ( tmp20 ) {
2026-09-10 05:38:07 +00:00
SentryUtilsDefault . markCrashHandled ( event_id ) ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
} else {
2026-09-05 10:56:28 +00:00
let originalException3 ;
2026-07-29 08:29:29 +00:00
if ( originalException != null ) {
2026-09-05 10:56:28 +00:00
originalException3 = originalException . originalException ;
2026-07-20 16:05:17 +00:00
}
let status1 ;
2026-09-05 10:56:28 +00:00
if ( originalException3 != null ) {
status1 = originalException3 . status ;
2026-07-20 16:05:17 +00:00
}
if ( null != status1 ) {
if ( null == event_id . tags ) {
event_id . tags = { } ;
}
event_id . tags . httpStatusCode = status1 ;
}
2026-07-23 10:11:24 +00:00
if ( ! c14 ) {
2026-09-10 05:38:07 +00:00
if ( closure_20 ( ) ) {
2026-07-29 08:29:29 +00:00
const _Math = Math ;
}
2026-07-20 16:05:17 +00:00
trackCrash ( event_id , originalException , false ) ;
}
2026-09-10 05:38:07 +00:00
return ( async ( arg0 , value ) = > {
2026-08-24 06:08:38 +00:00
closure_1 = tmp3 ;
2026-09-10 05:38:07 +00:00
const ZoomedInTelemetry = tmp3 ( c3 [ 6 ] ) . ZoomedInTelemetry ;
2026-08-24 06:08:38 +00:00
items = [ ZoomedInTelemetry . flushNow ( ) , ] ;
2026-09-10 05:38:07 +00:00
items [ 1 ] = new Promise ( ( arg0 ) = > setTimeout ( arg0 , 200 ) ) ;
await Promise . race ( items ) ;
2026-08-04 21:03:28 +00:00
if ( 1 === tmp7 ) {
c2 = 0 ;
2026-09-10 05:38:07 +00:00
trackCrash ( closure_129_0 , closure_129_1 ) ;
2026-08-24 06:08:38 +00:00
c4 = 3 ;
2026-08-04 21:03:28 +00:00
} else if ( 2 === tmp7 ) {
2026-07-29 08:29:29 +00:00
if ( arg0 === 1 ) {
2026-08-04 21:03:28 +00:00
c4 = 3 ;
2026-09-10 05:38:07 +00:00
throw value ;
2026-07-29 08:29:29 +00:00
} else if ( arg0 === 2 ) {
2026-08-04 21:03:28 +00:00
c2 = 0 ;
c4 = 3 ;
2026-09-10 05:38:07 +00:00
return { value , done : true } ;
2026-07-29 08:29:29 +00:00
} else {
2026-09-10 05:38:07 +00:00
c3 = 3 ;
2026-08-04 21:03:28 +00:00
c4 = 1 ;
2026-09-10 05:38:07 +00:00
return {
value : ( function maybeBackfillMissingBreadcrumbsFromTelemetryRing() {
const self = this ;
const apply = closure_1_15 . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
} ) ( closure_129_0 ) ,
done : false
} ;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
} else if ( arg0 === 1 ) {
c4 = 3 ;
2026-09-10 05:38:07 +00:00
throw value ;
2026-08-04 21:03:28 +00:00
} else if ( arg0 !== 2 ) {
c2 = 0 ;
2026-07-29 08:29:29 +00:00
}
2026-09-10 05:38:07 +00:00
return value ;
2026-07-20 16:05:17 +00:00
} ) ( ) ;
}
return null ;
}
function getCrashErrorMessage ( exception ) {
exception = exception . exception ;
let first ;
2026-07-29 08:29:29 +00:00
if ( exception != null ) {
2026-07-20 16:05:17 +00:00
const values = exception . values ;
2026-07-29 08:29:29 +00:00
if ( values != null ) {
2026-07-20 16:05:17 +00:00
first = values [ 0 ] ;
}
}
if ( null == first ) {
const extra2 = exception . extra ;
let prop ;
2026-07-29 08:29:29 +00:00
if ( extra2 != null ) {
2026-07-20 16:05:17 +00:00
prop = extra2 . persisted_error_message ;
}
2026-09-10 05:38:07 +00:00
let message1 ;
2026-08-04 21:03:28 +00:00
if ( typeof prop === "string" ) {
2026-07-20 16:05:17 +00:00
if ( prop . length > 0 ) {
2026-09-10 05:38:07 +00:00
message1 = prop ;
2026-07-20 16:05:17 +00:00
}
}
2026-09-10 05:38:07 +00:00
if ( message1 == null ) {
message1 = exception . message ;
2026-07-20 16:05:17 +00:00
}
2026-09-10 05:38:07 +00:00
return message1 ;
2026-07-20 16:05:17 +00:00
} else {
( { type , value } = first ) ;
if ( null != type ) {
if ( null != value ) {
const _HermesInternal = HermesInternal ;
return "" + type + ": " + value ;
}
}
const extra = exception . extra ;
2026-07-29 08:29:29 +00:00
if ( extra != null ) {
2026-07-20 16:05:17 +00:00
const prop1 = extra . persisted_error_message ;
}
2026-09-10 05:38:07 +00:00
let message = type ;
2026-07-29 08:29:29 +00:00
if ( type == null ) {
message = value ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( message == null ) {
2026-07-20 16:05:17 +00:00
message = exception . message ;
}
2026-07-29 08:29:29 +00:00
if ( message == null ) {
2026-07-20 16:05:17 +00:00
let tmp2 ;
2026-08-04 21:03:28 +00:00
if ( typeof prop1 === "string" ) {
2026-07-20 16:05:17 +00:00
if ( prop1 . length > 0 ) {
tmp2 = prop1 ;
}
}
message = tmp2 ;
}
return message ;
}
}
function getErrorStackTrace ( exception ) {
exception = exception . exception ;
let first ;
2026-07-29 08:29:29 +00:00
if ( exception != null ) {
2026-07-20 16:05:17 +00:00
const values = exception . values ;
2026-07-29 08:29:29 +00:00
if ( values != null ) {
2026-07-20 16:05:17 +00:00
first = values [ 0 ] ;
}
}
if ( null == first ) {
const extra2 = exception . extra ;
let prop ;
2026-07-29 08:29:29 +00:00
if ( extra2 != null ) {
2026-07-20 16:05:17 +00:00
prop = extra2 . persisted_error_stack ;
}
let tmp6 ;
2026-08-04 21:03:28 +00:00
if ( typeof prop === "string" ) {
2026-07-20 16:05:17 +00:00
if ( prop . length > 0 ) {
tmp6 = prop ;
}
}
return tmp6 ;
} else {
const stacktrace = first . stacktrace ;
let joined ;
2026-07-29 08:29:29 +00:00
if ( stacktrace != null ) {
2026-07-20 16:05:17 +00:00
const frames = stacktrace . frames ;
2026-07-29 08:29:29 +00:00
if ( frames != null ) {
2026-07-20 16:05:17 +00:00
const mapped = frames . map ( ( filename ) = > "" + filename . filename + ":" + filename . lineno + ":" + filename . colno ) ;
joined = mapped . join ( "\n" ) ;
}
}
if ( null != joined ) {
if ( joined . length > 0 ) {
return joined ;
}
}
const extra = exception . extra ;
let prop1 ;
2026-07-29 08:29:29 +00:00
if ( extra != null ) {
2026-07-20 16:05:17 +00:00
prop1 = extra . persisted_error_stack ;
}
let tmp4 ;
2026-08-04 21:03:28 +00:00
if ( typeof prop1 === "string" ) {
2026-07-20 16:05:17 +00:00
if ( prop1 . length > 0 ) {
tmp4 = prop1 ;
}
}
return tmp4 ;
}
}
2026-07-29 08:29:29 +00:00
function trackCrash ( event , hint , arg2 ) {
2026-07-20 16:05:17 +00:00
let flag = arg2 ;
if ( arg2 === undefined ) {
flag = true ;
}
2026-09-10 05:38:07 +00:00
logger . info ( "Crash" , { event , hint } ) ;
2026-07-20 16:05:17 +00:00
( { level , extra } = event ) ;
let native_is_native ;
2026-07-29 08:29:29 +00:00
if ( extra != null ) {
2026-07-20 16:05:17 +00:00
native_is_native = extra . native_is_native ;
}
if ( null != native_is_native ) {
let tmp4 = "true" === event . extra . native_is_native ;
} else {
const tags = event . tags ;
let prop ;
2026-07-29 08:29:29 +00:00
if ( tags != null ) {
2026-07-23 10:11:24 +00:00
prop = tags [ "event.origin" ] ;
2026-07-20 16:05:17 +00:00
}
tmp4 = "javascript" !== prop ;
}
if ( "fatal" !== level ) {
return event ;
}
let tmp5 = tmp4 ;
if ( ! tmp4 ) {
tmp5 = "error" !== level ;
}
let num = 1 ;
if ( ! tmp5 ) {
num = 0.01 ;
}
2026-07-23 10:11:24 +00:00
if ( ! c14 ) {
2026-07-29 08:29:29 +00:00
const _Math = Math ;
if ( Math . random ( ) > num ) {
const event_id = event . event_id ;
2026-08-24 06:08:38 +00:00
let tmp7 = typeof event_id === "string" ;
2026-08-04 21:03:28 +00:00
if ( typeof event_id === "string" ) {
2026-07-29 08:29:29 +00:00
tmp7 = 0 !== event_id . length ;
}
if ( tmp7 ) {
2026-09-10 05:38:07 +00:00
SentryUtilsDefault . markCrashHandled ( event_id ) ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
let tmp13 = null ;
2026-07-20 16:05:17 +00:00
if ( flag ) {
2026-07-29 08:29:29 +00:00
let event_id1 = event . event_id ;
if ( event_id1 == null ) {
event_id1 = null ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp13 = event_id1 ;
2026-07-20 16:05:17 +00:00
}
const timestamp = event . timestamp ;
let result ;
if ( null != timestamp ) {
2026-08-04 21:03:28 +00:00
if ( typeof timestamp === "number" ) {
2026-07-20 16:05:17 +00:00
const _isNaN = isNaN ;
if ( ! isNaN ( timestamp ) ) {
result = 1000 * timestamp ;
}
}
const _Date = Date ;
if ( timestamp instanceof Date ) {
result = timestamp . getTime ( ) ;
2026-08-04 21:03:28 +00:00
} else if ( typeof timestamp === "string" ) {
2026-07-29 08:29:29 +00:00
const _Date3 = Date ;
2026-07-20 16:05:17 +00:00
const parsed = Date . parse ( timestamp ) ;
const _Number = Number ;
if ( ! Number . isNaN ( parsed ) ) {
result = parsed ;
}
}
}
2026-07-29 08:29:29 +00:00
if ( result == null ) {
const _Date2 = Date ;
2026-07-20 16:05:17 +00:00
result = Date . now ( ) ;
}
2026-09-10 05:38:07 +00:00
const obj = { event , hint } ;
const obj3 = router_utils ;
const track = AnalyticsUtilsDefault . track ;
2026-07-20 16:05:17 +00:00
if ( tmp4 ) {
2026-09-10 05:38:07 +00:00
let extra1 = event . extra ;
if ( extra1 == null ) {
extra1 = { } ;
}
const obj4 = { did_crash : true , sentry_issue_id : tmp13 , client_track_timestamp : result , exit_reason : null , exit_description : null , tombstone_hash : null , tombstone_cause : null , tombstone : null , call_stack_tree : null , binary_name : null , exception_message : null , exception_stacktrace : null , js_error_message : null , js_error_stacktrace : null } ;
const native_exit_reason = extra1 . native_exit_reason ;
2026-07-29 08:29:29 +00:00
let tmp27 = null ;
2026-08-04 21:03:28 +00:00
if ( typeof native_exit_reason === "string" ) {
2026-07-29 08:29:29 +00:00
tmp27 = null ;
if ( native_exit_reason . length > 0 ) {
tmp27 = native_exit_reason ;
}
}
2026-09-10 05:38:07 +00:00
obj4 . exit_reason = tmp27 ;
const prop1 = extra1 . native_exit_description ;
2026-07-29 08:29:29 +00:00
let tmp28 = null ;
2026-08-04 21:03:28 +00:00
if ( typeof prop1 === "string" ) {
2026-07-29 08:29:29 +00:00
tmp28 = null ;
if ( prop1 . length > 0 ) {
tmp28 = prop1 ;
}
}
2026-09-10 05:38:07 +00:00
obj4 . exit_description = tmp28 ;
const prop2 = extra1 . native_tombstone_hash ;
2026-07-29 08:29:29 +00:00
let tmp29 = null ;
2026-08-04 21:03:28 +00:00
if ( typeof prop2 === "string" ) {
2026-07-29 08:29:29 +00:00
tmp29 = null ;
if ( prop2 . length > 0 ) {
tmp29 = prop2 ;
}
}
2026-09-10 05:38:07 +00:00
obj4 . tombstone_hash = tmp29 ;
const prop3 = extra1 . native_tombstone_cause ;
2026-07-29 08:29:29 +00:00
let tmp30 = null ;
2026-08-04 21:03:28 +00:00
if ( typeof prop3 === "string" ) {
2026-07-29 08:29:29 +00:00
tmp30 = null ;
if ( prop3 . length > 0 ) {
tmp30 = prop3 ;
}
}
2026-09-10 05:38:07 +00:00
obj4 . tombstone_cause = tmp30 ;
const native_tombstone = extra1 . native_tombstone ;
2026-07-29 08:29:29 +00:00
let tmp31 = null ;
2026-08-04 21:03:28 +00:00
if ( typeof native_tombstone === "string" ) {
2026-07-29 08:29:29 +00:00
tmp31 = null ;
if ( native_tombstone . length > 0 ) {
tmp31 = native_tombstone ;
}
}
2026-09-10 05:38:07 +00:00
obj4 . tombstone = tmp31 ;
const prop4 = extra1 . native_tombstone_group_by ;
2026-07-29 08:29:29 +00:00
let tmp32 = null ;
2026-08-04 21:03:28 +00:00
if ( typeof prop4 === "string" ) {
2026-07-29 08:29:29 +00:00
tmp32 = null ;
if ( prop4 . length > 0 ) {
tmp32 = prop4 ;
}
}
2026-09-10 05:38:07 +00:00
obj4 . call_stack_tree = tmp32 ;
const prop5 = extra1 . native_tombstone_origin ;
2026-07-29 08:29:29 +00:00
let tmp33 = null ;
2026-08-04 21:03:28 +00:00
if ( typeof prop5 === "string" ) {
2026-07-29 08:29:29 +00:00
tmp33 = null ;
if ( prop5 . length > 0 ) {
tmp33 = prop5 ;
}
}
2026-09-10 05:38:07 +00:00
obj4 . binary_name = tmp33 ;
obj4 . exception_message = getCrashErrorMessage ( event ) ;
obj4 . exception_stacktrace = getErrorStackTrace ( event ) ;
const prop6 = extra1 . persisted_error_message ;
2026-07-29 08:29:29 +00:00
let tmp36 = null ;
2026-08-04 21:03:28 +00:00
if ( typeof prop6 === "string" ) {
2026-07-29 08:29:29 +00:00
tmp36 = null ;
if ( prop6 . length > 0 ) {
tmp36 = prop6 ;
}
}
2026-09-10 05:38:07 +00:00
obj4 . js_error_message = tmp36 ;
const prop7 = extra1 . persisted_error_stack ;
2026-07-29 08:29:29 +00:00
let tmp37 = null ;
2026-08-04 21:03:28 +00:00
if ( typeof prop7 === "string" ) {
2026-07-29 08:29:29 +00:00
tmp37 = null ;
if ( prop7 . length > 0 ) {
tmp37 = prop7 ;
}
}
2026-09-10 05:38:07 +00:00
obj4 . js_error_stacktrace = tmp37 ;
track ( tmp20 . APP_NATIVE_CRASH , obj4 ) ;
2026-07-29 08:29:29 +00:00
let tmp25 = tmp18 ;
let tmp26 = tmp18 ;
2026-07-20 16:05:17 +00:00
} else {
2026-09-10 05:38:07 +00:00
const obj5 = { path : obj3.getHistory ( ) . location . pathname , client_track_timestamp : result , sentry_issue_id : tmp13 , extra : hint , error_message : getCrashErrorMessage ( event ) , error_level : level , error_stack : getErrorStackTrace ( event ) } ;
track ( tmp20 . APP_CRASHED , obj5 ) ;
2026-07-29 08:29:29 +00:00
tmp25 = tmp18 ;
tmp26 = tmp18 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const event_id2 = event . event_id ;
2026-08-04 21:03:28 +00:00
let tmp39 = typeof event_id2 === "string" ;
if ( typeof event_id2 === "string" ) {
2026-07-29 08:29:29 +00:00
tmp39 = 0 !== event_id2 . length ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( tmp39 ) {
2026-09-05 10:56:28 +00:00
tmp25 ( 1232 ) . markCrashHandled ( event_id2 ) ;
const tmp25Result = tmp25 ( 1232 ) ;
2026-07-20 16:05:17 +00:00
}
2026-09-10 19:12:31 +00:00
const AppCrashedReasons = tmp11 ( 14157 ) . AppCrashedReasons ;
2026-07-29 08:29:29 +00:00
const tmp41 = tmp4 ? AppCrashedReasons.UNHANDLED_NATIVE_ERROR : AppCrashedReasons.UNHANDLED_JS_ERROR ;
2026-09-10 05:38:07 +00:00
const obj6 = { name : MetricEvents.MetricEvents.APP_CRASHED , tags : null } ;
2026-08-24 06:08:38 +00:00
items = [ "reason:" + tmp41 , ] ;
2026-07-29 08:29:29 +00:00
if ( level == null ) {
level = "unknown" ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items [ 1 ] = "level:" + level ;
2026-09-10 05:38:07 +00:00
obj6 . tags = items ;
2026-09-10 19:12:31 +00:00
tmp26 ( 7653 ) . increment ( obj6 , true ) ;
2026-07-20 16:05:17 +00:00
}
2026-09-10 05:38:07 +00:00
const NativeModules = fn ( 17 ) . NativeModules ;
const Constants = fn ( 1074 ) ;
( { AnalyticEvents : metroRequire , Endpoints } = Constants ) ;
const PRIMARY_DOMAIN = fn ( 1085 ) . PRIMARY_DOMAIN ;
let registerSpanErrorInstrumentation = fn ( 675 ) ;
registerSpanErrorInstrumentation = registerSpanErrorInstrumentation . reactNavigationIntegration ( ) ;
2026-07-20 16:05:17 +00:00
const regExp = new RegExp ( "/v" + window . GLOBAL_ENV . API_VERSION + Endpoints . METRICS , "g" ) ;
2026-07-23 10:11:24 +00:00
let items = [ regExp , , ] ;
2026-07-20 16:05:17 +00:00
const regExp1 = new RegExp ( "/v" + window . GLOBAL_ENV . API_VERSION + Endpoints . METRICS_V2 , "g" ) ;
items [ 1 ] = regExp1 ;
const regExp2 = new RegExp ( "/v" + window . GLOBAL_ENV . API_VERSION + Endpoints . TRACK , "g" ) ;
items [ 2 ] = regExp2 ;
2026-09-10 05:38:07 +00:00
const logger = new LoggerDefault ( "Sentry" ) ;
2026-07-23 10:11:24 +00:00
let closure_11 = [ "The operation couldn\u2019t be completed. (com.apple.CallKit.error.requesttransaction" , "Request has been terminated" , "couldn't execute statement: database is disabled" , "couldn't delete database: database is currently open" , "database is no longer open" ] ;
let c12 = 0.05 ;
let c13 = 0.005 ;
let c14 = false ;
2026-09-10 05:38:07 +00:00
const CommonSentryInitUtils = fn ( 1358 ) ;
let closure_20 = CommonSentryInitUtils . filterThrottle ( { maxBudgetMinute : 1 , maxBudgetHour : 15 } ) ;
const size = fn ( 2 ) ;
const result1 = size . fileFinishedImporting ( "modules/errors/native/SentryInitUtils.tsx" ) ;
2026-07-20 16:05:17 +00:00
2026-09-10 05:38:07 +00:00
export const routingInstrumentation = registerSpanErrorInstrumentation ;
2026-07-20 16:05:17 +00:00
export const initSentry = function initSentry() {
const CrashReportingManager = NativeModules . CrashReportingManager ;
2026-07-29 08:29:29 +00:00
if ( CrashReportingManager != null ) {
2026-07-20 16:05:17 +00:00
const isUserStaffForCrashReporting = CrashReportingManager . getIsUserStaffForCrashReporting ( ( arg0 ) = > {
2026-08-24 06:08:38 +00:00
closure_14 = arg0 ;
2026-09-10 05:38:07 +00:00
constants = ClientInfoUtilsAll . getConstants ( ) ;
2026-07-20 16:05:17 +00:00
const ReleaseChannel = constants . ReleaseChannel ;
if ( - 1 === ReleaseChannel . indexOf ( "debug" ) ) {
if ( - 1 === ReleaseChannel . indexOf ( "developer" ) ) {
2026-09-10 05:38:07 +00:00
const isStable = require ( "ReleaseChannelUtils" ) . isStable ;
const obj2 = { releaseChannel : ReleaseChannel , isProductionChannel : isStable } ;
logger . verbose ( "Initialize" , obj2 ) ;
2026-08-13 07:00:46 +00:00
if ( obj15 . isAndroid ( ) ) {
2026-07-20 16:05:17 +00:00
if ( isStable ) {
2026-09-10 05:38:07 +00:00
const device = tmp14 ( tmp [ 17 ] ) . getDevice ( ) ;
const tmp14Result = tmp14 ( tmp [ 17 ] ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-08-24 06:08:38 +00:00
c12 = 0.05 ;
2026-07-20 16:05:17 +00:00
const SentryDsn = constants . SentryDsn ;
if ( isStable ) {
let SentryStaffDsn = SentryDsn ;
2026-09-10 05:38:07 +00:00
if ( tmp14Result9 . isMetaQuest ( ) ) {
2026-07-29 08:29:29 +00:00
c12 = 1 ;
2026-08-24 06:08:38 +00:00
c13 = 1 ;
2026-07-20 16:05:17 +00:00
SentryStaffDsn = SentryDsn ;
}
2026-09-10 05:38:07 +00:00
tmp14Result9 = tmp14 ( tmp [ 18 ] ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
c12 = 1 ;
2026-07-20 16:05:17 +00:00
SentryStaffDsn = constants . SentryAlphaBetaDsn ;
}
if ( arg0 ) {
SentryStaffDsn = constants . SentryStaffDsn ;
2026-07-29 08:29:29 +00:00
c12 = 1 ;
2026-07-20 16:05:17 +00:00
}
2026-09-10 05:38:07 +00:00
obj15 = require ( "PlatformUtils" ) ;
const lastCrashReport = require ( "SentryUtils" ) . getLastCrashReport ( ) ;
const obj4 = require ( "SentryUtils" ) ;
lastCrashReport . then ( ( result ) = > {
if ( null != result ) {
closure_1_19 ( result , { crash_event_source : "startup_reconcile" } ) ;
2026-07-29 08:29:29 +00:00
}
2026-09-10 05:38:07 +00:00
} ) . catch ( ( error ) = > {
logger . warn ( "Failed to replay pending crash report" , error ) ;
2026-07-29 08:29:29 +00:00
} ) ;
2026-09-10 05:38:07 +00:00
const nextPromise = lastCrashReport . then ( ( result ) = > {
if ( null != result ) {
closure_1_19 ( result , { crash_event_source : "startup_reconcile" } ) ;
2026-07-29 08:29:29 +00:00
}
} ) ;
2026-09-10 05:38:07 +00:00
const tmp14Result10 = require ( "module_675" ) ;
2026-07-20 16:05:17 +00:00
let str2 = "ios" ;
2026-09-10 05:38:07 +00:00
if ( tmp14Result11 . isAndroid ( ) ) {
2026-07-20 16:05:17 +00:00
str2 = "android" ;
}
2026-09-10 19:12:31 +00:00
const obj3 = { tunnel : ` /error-reporting-proxy/ ${ str2 } ` , autoInitializeNativeSdk : false , beforeSend , dist : "6393" , dsn : SentryStaffDsn , environment : ReleaseChannel , tracesSampleRate : 0 , sampleRate : 1 , ignoreErrors , release : "discord_android@346.3.0-2+346203" , tracePropagationTargets : null , integrations : null , beforeBreadcrumb : null } ;
2026-09-10 05:38:07 +00:00
items = [ PRIMARY_DOMAIN ] ;
obj3 . tracePropagationTargets = items ;
const items1 = [ registerSpanErrorInstrumentation , , ] ;
tmp14Result11 = require ( "PlatformUtils" ) ;
items1 [ 1 ] = require ( "module_675" ) . featureFlagsIntegration ( ) ;
const tmp14Result12 = require ( "module_675" ) ;
const obj5 = {
shouldCreateSpanForRequest ( arg0 ) {
closure_0 = arg0 ;
return ! closure_1_9 . some ( ( item ) = > null != closure_0 . match ( item ) ) ;
}
2026-07-20 16:05:17 +00:00
} ;
2026-09-10 05:38:07 +00:00
items1 [ 2 ] = require ( "module_675" ) . reactNativeTracingIntegration ( obj5 ) ;
obj3 . integrations = items1 ;
obj3 . beforeBreadcrumb = function beforeBreadcrumb ( data ) {
2026-07-20 16:05:17 +00:00
if ( null == data . data ) {
data . data = { } ;
}
2026-09-10 05:38:07 +00:00
const currentMemoryUsageKB = closure_1_1 ( dependencyMap [ 19 ] ) . getCurrentMemoryUsageKB ( ) ;
2026-07-20 16:05:17 +00:00
if ( null != currentMemoryUsageKB ) {
data . data . client_performance_memory = currentMemoryUsageKB ;
}
2026-09-10 05:38:07 +00:00
const obj = closure_1_1 ( dependencyMap [ 19 ] ) ;
const currentCPUUsagePercent = closure_1_1 ( dependencyMap [ 19 ] ) . getCurrentCPUUsagePercent ( ) ;
2026-07-20 16:05:17 +00:00
if ( null != currentCPUUsagePercent ) {
data . data . client_performance_cpu = currentCPUUsagePercent ;
}
return data ;
} ;
2026-09-10 05:38:07 +00:00
tmp14Result10 . init ( obj3 ) ;
const tmp14Result13 = require ( "module_675" ) ;
2026-09-10 19:12:31 +00:00
require ( "module_675" ) . setTag ( "buildNumber" , "6393" ) ;
2026-09-10 05:38:07 +00:00
const tmp14Result14 = require ( "module_675" ) ;
require ( "module_675" ) . setTag ( "appVersion" , constants . Version ) ;
const tmp14Result15 = require ( "module_675" ) ;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal ;
2026-09-10 05:38:07 +00:00
require ( "module_675" ) . setTag ( "design_id" , "" + require ( "DesignIds" ) . DesignIds . DESIGN_TABS_IA ) ;
const tmp14Result16 = require ( "module_675" ) ;
2026-07-20 16:05:17 +00:00
}
}
} ) ;
}
} ;