2026-08-08 06:10:11 +00:00
// Module ID: 7459
// Function ID: 7460
2026-07-29 08:29:29 +00:00
// Name: spanTimeInputToSeconds
2026-08-08 06:10:11 +00:00
// Dependencies: [7460, 7464, 7466, 7468, 7469, 7470, 7471, 7472, 7473, 7476, 7481, 7454]
2026-07-29 08:29:29 +00:00
2026-08-08 06:10:11 +00:00
// Module 7459 (spanTimeInputToSeconds)
2026-07-29 08:29:29 +00:00
const require = arg1 ;
const dependencyMap = arg6 ;
2026-08-04 21:03:28 +00:00
function spanTimeInputToSeconds ( num ) {
if ( typeof num === "number" ) {
let result = num ;
if ( num > 9999999999 ) {
result = num / 1000 ;
2026-07-29 08:29:29 +00:00
}
let sum = result ;
} else {
const _Array = Array ;
2026-08-04 21:03:28 +00:00
if ( Array . isArray ( num ) ) {
sum = num [ 0 ] + num [ 1 ] / 1000000000 ;
2026-07-29 08:29:29 +00:00
} else {
const _Date = Date ;
2026-08-04 21:03:28 +00:00
if ( num instanceof Date ) {
const time = num . getTime ( ) ;
2026-07-29 08:29:29 +00:00
let result1 = time ;
if ( time > 9999999999 ) {
result1 = time / 1000 ;
}
sum = result1 ;
} else {
2026-08-08 06:10:11 +00:00
sum = require ( 7468 ) /* dateTimestampInSeconds */ . timestampInSeconds ( ) ;
const obj = require ( 7468 ) /* dateTimestampInSeconds */ ;
2026-07-29 08:29:29 +00:00
}
}
}
return sum ;
}
function spanToJSON ( getSpanJSON ) {
let endTime ;
let name ;
let parentSpanId ;
let spanId ;
let startTime ;
let status ;
let traceId ;
if ( ( function spanIsSentrySpan ( getSpanJSON ) {
2026-08-04 21:03:28 +00:00
return typeof getSpanJSON . getSpanJSON === "function" ;
2026-07-29 08:29:29 +00:00
} ) ( getSpanJSON ) ) {
return getSpanJSON . getSpanJSON ( ) ;
} else {
try {
( { spanId , traceId } = getSpanJSON . spanContext ( ) ) ;
if ( ( function spanIsOpenTelemetrySdkTraceBaseSpan ( attributes ) {
return attributes . attributes && attributes . startTime && attributes . name && attributes . endTime && attributes . status ;
} ) ( getSpanJSON ) ) {
const attributes = getSpanJSON . attributes ;
( { startTime , name , endTime , parentSpanId , status } = getSpanJSON ) ;
let obj = { span _id : null , trace _id : null , data : null , description : null , parent _span _id : null , start _timestamp : null , timestamp : null , status : null , op : null , origin : null , _metrics _summary : null } ;
obj [ 0 ] = spanId ;
obj [ 1 ] = traceId ;
obj [ 2 ] = attributes ;
obj [ 3 ] = name ;
obj [ 4 ] = parentSpanId ;
obj [ 5 ] = spanTimeInputToSeconds ( startTime ) ;
const tmp8 = spanTimeInputToSeconds ( endTime ) ;
obj [ 6 ] = tmp8 ;
obj [ 7 ] = getStatusMessage ( status ) ;
2026-08-08 06:10:11 +00:00
obj [ 8 ] = attributes [ require ( undefined , 7469 ) . SEMANTIC _ATTRIBUTE _SENTRY _OP ] ;
obj [ 9 ] = attributes [ require ( undefined , 7469 ) . SEMANTIC _ATTRIBUTE _SENTRY _ORIGIN ] ;
const obj2 = require ( 7460 ) /* addNonEnumerableProperty */ ;
obj [ 10 ] = require ( 7470 ) /* getMetricSummaryJsonForSpan */ . getMetricSummaryJsonForSpan ( getSpanJSON ) ;
2026-07-29 08:29:29 +00:00
return obj2 . dropUndefinedKeys ( obj ) ;
} else {
obj = { span _id : null , trace _id : null } ;
obj [ 0 ] = spanId ;
obj [ 1 ] = traceId ;
return obj ;
}
const spanContextResult = getSpanJSON . spanContext ( ) ;
} catch ( err ) {
return { } ;
}
}
}
function spanIsSampled ( spanContext ) {
return 1 === spanContext . spanContext ( ) . traceFlags ;
}
function getStatusMessage ( code ) {
if ( code ) {
2026-08-08 06:10:11 +00:00
if ( code . code !== require ( 7471 ) /* getSpanStatusFromHttpCode */ . SPAN _STATUS _UNSET ) {
2026-07-29 08:29:29 +00:00
let str = "ok" ;
2026-08-08 06:10:11 +00:00
if ( code . code !== tmp ( 7471 ) . SPAN _STATUS _OK ) {
2026-07-29 08:29:29 +00:00
str = code . message || "unknown_error" ;
const tmp3 = code . message || "unknown_error" ;
}
return str ;
}
tmp = require ;
}
}
let c2 = false ;
const _sentryChildSpans = "_sentryChildSpans" ;
const _sentryRootSpan = "_sentryRootSpan" ;
arg5 . TRACE _FLAG _NONE = 0 ;
arg5 . TRACE _FLAG _SAMPLED = 1 ;
arg5 . addChildSpanToSpan = function addChildSpanToSpan ( arg0 , arg1 ) {
let tmp2 = arg0 [ _sentryRootSpan ] ;
if ( ! tmp2 ) {
tmp2 = arg0 ;
}
2026-08-08 06:10:11 +00:00
const result = require ( 7460 ) /* addNonEnumerableProperty */ . addNonEnumerableProperty ( arg1 , _sentryRootSpan , tmp2 ) ;
2026-07-29 08:29:29 +00:00
if ( arg0 [ _sentryChildSpans ] ) {
arg0 [ tmp6 ] . add ( arg1 ) ;
const obj3 = arg0 [ tmp6 ] ;
} else {
const _Set = Set ;
const items = [ arg1 ] ;
const set = new Set ( items ) ;
2026-08-08 06:10:11 +00:00
const result1 = require ( 7460 ) /* addNonEnumerableProperty */ . addNonEnumerableProperty ( arg0 , tmp6 , set ) ;
const tmp3Result = require ( 7460 ) /* addNonEnumerableProperty */ ;
2026-07-29 08:29:29 +00:00
}
} ;
arg5 . getActiveSpan = function getActiveSpan ( ) {
2026-08-08 06:10:11 +00:00
const mainCarrier = require ( 7472 ) /* getMainCarrier */ . getMainCarrier ( ) ;
const obj = require ( 7472 ) /* getMainCarrier */ ;
const asyncContextStrategy = require ( 7473 ) /* getAsyncContextStrategy */ . getAsyncContextStrategy ( mainCarrier ) ;
2026-07-29 08:29:29 +00:00
if ( asyncContextStrategy . getActiveSpan ) {
let activeSpan = asyncContextStrategy . getActiveSpan ( ) ;
} else {
2026-08-08 06:10:11 +00:00
let tmpResult = tmp ( 7476 ) ;
tmpResult = tmp ( 7481 ) ;
2026-07-29 08:29:29 +00:00
activeSpan = tmpResult . _getSpanForScope ( tmpResult . getCurrentScope ( ) ) ;
}
return activeSpan ;
} ;
arg5 . getRootSpan = function getRootSpan ( arg0 ) {
return arg0 [ _sentryRootSpan ] || arg0 ;
} ;
arg5 . getSpanDescendants = function getSpanDescendants ( arg0 ) {
const set = new Set ( ) ;
function addSpanChildren ( arg0 ) {
if ( ! set . has ( arg0 ) ) {
if ( outer1 _5 ( arg0 ) ) {
set . add ( arg0 ) ;
let tmp3 = outer1 _7 ;
if ( arg0 [ outer1 _7 ] ) {
const _Array = Array ;
let items = Array . from ( arg0 [ tmp3 ] ) ;
} else {
items = [ ] ;
}
tmp3 = items ;
items [ Symbol . iterator ] ( ) ;
}
}
}
addSpanChildren ( arg0 ) ;
return Array . from ( set ) ;
} ;
arg5 . getStatusMessage = getStatusMessage ;
arg5 . removeChildSpanFromSpan = function removeChildSpanFromSpan ( arg0 , arg1 ) {
if ( arg0 [ _sentryChildSpans ] ) {
arg0 [ tmp ] . delete ( arg1 ) ;
const obj = arg0 [ tmp ] ;
}
} ;
arg5 . showSpanDropWarning = function showSpanDropWarning ( ) {
if ( ! c2 ) {
2026-08-08 06:10:11 +00:00
require ( 7454 ) /* consoleSandbox */ . consoleSandbox ( ( ) => {
2026-07-29 08:29:29 +00:00
console . warn ( "[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly." ) ;
} ) ;
c2 = true ;
2026-08-08 06:10:11 +00:00
const obj = require ( 7454 ) /* consoleSandbox */ ;
2026-07-29 08:29:29 +00:00
}
} ;
arg5 . spanIsSampled = spanIsSampled ;
arg5 . spanTimeInputToSeconds = spanTimeInputToSeconds ;
arg5 . spanToJSON = spanToJSON ;
arg5 . spanToTraceContext = function spanToTraceContext ( spanContext ) {
let isRemote ;
let spanId ;
const trace _id = spanContext . spanContext ( ) ;
( { spanId , isRemote } = trace _id ) ;
let parent _span _id = span _id ;
if ( ! isRemote ) {
parent _span _id = spanToJSON ( spanContext ) . parent _span _id ;
}
if ( isRemote ) {
2026-08-08 06:10:11 +00:00
span _id = require ( 7464 ) /* generatePropagationContext */ . generateSpanId ( ) ;
const obj = require ( 7464 ) /* generatePropagationContext */ ;
2026-07-29 08:29:29 +00:00
}
2026-08-08 06:10:11 +00:00
return require ( 7460 ) /* addNonEnumerableProperty */ . dropUndefinedKeys ( { parent _span _id , span _id , trace _id : trace _id . traceId } ) ;
2026-07-29 08:29:29 +00:00
} ;
arg5 . spanToTraceHeader = function spanToTraceHeader ( spanContext ) {
let spanId ;
let traceId ;
( { traceId , spanId } = spanContext . spanContext ( ) ) ;
const spanContextResult = spanContext . spanContext ( ) ;
2026-08-08 06:10:11 +00:00
return require ( 7466 ) /* regExp */ . generateSentryTraceHeader ( traceId , spanId , 1 === spanContext . spanContext ( ) . traceFlags ) ;
2026-07-29 08:29:29 +00:00
} ;
arg5 . spanToTransactionTraceContext = function spanToTransactionTraceContext ( spanContext ) {
let data ;
let op ;
let origin ;
let parent _span _id ;
let spanId ;
let status ;
let traceId ;
( { spanId , traceId } = spanContext . spanContext ( ) ) ;
const spanContextResult = spanContext . spanContext ( ) ;
( { data , op , parent _span _id , status , origin } = spanToJSON ( spanContext ) ) ;
const tmp2 = spanToJSON ( spanContext ) ;
2026-08-08 06:10:11 +00:00
return require ( 7460 ) /* addNonEnumerableProperty */ . dropUndefinedKeys ( { parent _span _id , span _id , trace _id , data , op , status , origin } ) ;
2026-07-29 08:29:29 +00:00
} ;
arg5 . updateMetricSummaryOnActiveSpan = function updateMetricSummaryOnActiveSpan ( arg0 , sanitizeMetricKeyResult , diff , sanitizeUnitResult , arg4 , bucketKey ) {
2026-08-08 06:10:11 +00:00
const mainCarrier = require ( 7472 ) /* getMainCarrier */ . getMainCarrier ( ) ;
const obj = require ( 7472 ) /* getMainCarrier */ ;
const asyncContextStrategy = require ( 7473 ) /* getAsyncContextStrategy */ . getAsyncContextStrategy ( mainCarrier ) ;
2026-07-29 08:29:29 +00:00
if ( asyncContextStrategy . getActiveSpan ) {
let activeSpan = asyncContextStrategy . getActiveSpan ( ) ;
} else {
2026-08-08 06:10:11 +00:00
let tmpResult = tmp ( 7476 ) ;
tmpResult = tmp ( 7481 ) ;
2026-07-29 08:29:29 +00:00
activeSpan = tmpResult . _getSpanForScope ( tmpResult . getCurrentScope ( ) ) ;
}
if ( activeSpan ) {
2026-08-08 06:10:11 +00:00
const tmpResult1 = tmp ( 7470 ) ;
2026-07-29 08:29:29 +00:00
const result = tmpResult1 . updateMetricSummaryOnSpan ( activeSpan , arg0 , sanitizeMetricKeyResult , diff , sanitizeUnitResult , arg4 , bucketKey ) ;
}
} ;
arg5 . updateSpanName = function updateSpanName ( updateName ) {
updateName . updateName ( arg1 ) ;
updateName . setAttributes ( { [ closure _0 ( closure _1 [ 4 ] ) . SEMANTIC _ATTRIBUTE _SENTRY _SOURCE ] : "custom" , [ closure _0 ( closure _1 [ 4 ] ) . SEMANTIC _ATTRIBUTE _SENTRY _CUSTOM _SPAN _NAME ] : arg1 } ) ;
} ;