Files
discord-decomp/_bundle/Module1145.js
T
2026-11-01 12:12:55 +02:00

117 lines
4.3 KiB
JavaScript

// Metro module 1145 (f1146).
import { browserTracingIntegration, WINDOW, startBrowserTracingPageLoadSpan, startBrowserTracingNavigationSpan } from "./Module1024";
import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from "./Module817";
import { HermesBuiltin } from "../_hermes/prelude";
function $mk68205($env) {
return (a0) => {
const [r7, r23] = a0;
const r27 = $env[0];
r27[`url.path.params.${r7}`] = r23;
r27[`url.path.parameter.${r7}`] = r23;
r27[`params.${r7}`] = r23;
};
}
Object.defineProperty(exports, Symbol.toStringTag, {
value: "Module"
});
export function tanstackRouterBrowserTracingIntegration(a0, r2 = {}) {
let c12835_0 = a0;
const r15 = browserTracingIntegration({
...r2,
instrumentNavigation: false,
instrumentPageLoad: false
});
let c12835_1 = r15;
const { instrumentPageLoad = true, instrumentNavigation = true } = r2;
return {
...r15,
afterAllSetup: (a0) => {
let r57;
let c24238_0 = a0;
c12835_1.afterAllSetup(a0);
const location2 = WINDOW.location;
if (instrumentPageLoad && location2) {
const r29 = c12835_0.matchRoutes(location2.pathname, c12835_0.options.parseSearch(location2.search), {
preload: false,
throwOnError: false
});
const r32 = r29[r29.length - 1];
const r36 = r32?.routeId !== "__root__" ? r32 : void 0;
const name = r36 ? r36.routeId : location2.pathname;
const attributes = {};
attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] = "pageload";
attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = "auto.pageload.react.tanstack_router";
const r54 = r36 ? "route" : "url";
let env24239;
attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = r54;
const r55 = env24239 = {};
env24239[0] = void 0;
const r56 = {};
if (r36) {
env24239[0] = r56;
Object.entries(r36.params).forEach($mk68205(r55));
r57 = r56;
} else {
r57 = r56;
}
HermesBuiltin.copyDataProperties(attributes, r57);
startBrowserTracingPageLoadSpan(a0, {
name,
attributes
});
}
if (instrumentNavigation) {
c12835_0.subscribe("onBeforeNavigate", (a0) => {
if (a0.fromLocation && a0.toLocation.state !== a0.fromLocation.state) {
const r23 = c12835_0.matchRoutes(a0.toLocation.pathname, a0.toLocation.search, {
preload: false,
throwOnError: false
});
const r26 = r23[r23.length - 1];
const r12 = r26?.routeId !== "__root__" ? r26 : void 0;
const location2 = WINDOW.location;
const name = r12 ? r12.routeId : location2.pathname;
const attributes = {};
attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] = "navigation";
attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = "auto.navigation.react.tanstack_router";
const r51 = r12 ? "route" : "url";
attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = r51;
let c28834_0 = startBrowserTracingNavigationSpan(c24238_0, {
name,
attributes
});
let c28834_1 = c12835_0.subscribe("onResolved", (a0) => {
let r41;
c28834_1();
if (c28834_0) {
const r18 = c12835_0.matchRoutes(a0.toLocation.pathname, a0.toLocation.search, {
preload: false,
throwOnError: false
});
const r21 = r18[r18.length - 1];
const r25 = r21?.routeId !== "__root__" ? r21 : void 0;
if (r25) {
let env31218;
c28834_0.updateName(r25.routeId);
c28834_0.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, "route");
const r39 = env31218 = {};
env31218[0] = void 0;
const r40 = {};
if (r25) {
env31218[0] = r40;
Object.entries(r25.params).forEach($mk68205(r39));
r41 = r40;
} else {
r41 = r40;
}
c28834_0.setAttributes(r41);
}
}
});
}
});
}
}
};
}