Your Name 1912bcd25b
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
chore: sync all remaining local workspace changes
2026-05-08 11:26:57 +08:00

213 lines
5.7 KiB
JavaScript

/*
* Extracted from browser-delivered Turbopack chunk: 8c0c55f3765ce630.21409b70bd.js
* Module id: 704030
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e) => {
"use strict";
var t = e.i(505e3);
e.i(135623);
var a = e.i(168823);
function r(e) {
let t = (0, a.getCookie)(e);
return "string" == typeof t ? t : "";
}
function n(e) {
var a;
let n, o;
return {
...{
usertoken: r(t.USER_TOKEN_COOKIE_KEY),
useruuid: r(t.USER_UUID_COOKIE_KEY),
webid: r(t.WEBID_COOKIE_KEY),
projectId: (function () {
let e = new URLSearchParams(window.location.search).get(
"projectId",
);
if (e) return e;
let t = window.location.hash.split("?")[1] || "";
if (t) {
let e = new URLSearchParams(t).get("projectId");
if (e) return e;
}
return "";
})(),
href: window.location.href,
pathname: window.location.pathname,
search: window.location.search,
hash: window.location.hash,
userAgent: navigator.userAgent,
},
...((a = e || {}),
(n = new WeakSet()),
(o = (e, t) => {
if (null == e) return e;
if (t > 4) return "[Truncated]";
let a = typeof e;
if ("string" === a || "number" === a || "boolean" === a) return e;
if (e instanceof Date) return e.toISOString();
if (e instanceof Error)
return { name: e.name, message: e.message, stack: e.stack };
if (Array.isArray(e)) return e.slice(0, 50).map((e) => o(e, t + 1));
if ("function" === a) return "[Function]";
if ("symbol" === a) return e.toString();
if ("object" === a) {
if (n.has(e)) return "[Circular]";
n.add(e);
let a = {};
return (
Object.keys(e)
.slice(0, 80)
.forEach((r) => {
a[r] = o(e[r], t + 1);
}),
a
);
}
return Object.prototype.toString.call(e);
})(a, 0)),
};
}
function o() {
let e = window;
return (
[e.RumSDK?.default, e.RumSDK, e.__rum?.default, e.__rum].find(
(e) => !!e,
) ?? null
);
}
let i = ({
type: e,
name: t,
group: a = "",
value: r = "",
properties: s = {},
file: c = "",
stack: l = "",
_retry: d = 0,
}) => {
try {
if (!e || !t) return;
let u = o();
if (!u) {
d < 1 &&
window.setTimeout(() => {
i({
type: e,
name: t,
group: a,
value: r,
properties: s,
file: c,
stack: l,
_retry: d + 1,
});
}, 1200);
return;
}
let p = n(s);
if (u.sendCustom)
return void u.sendCustom({
type: e,
name: t,
group: a,
value: r,
properties: p,
file: c,
stack: l,
});
if (u.sum) {
let e = Number(r);
u.sum(t, Number.isFinite(e) && e > 0 ? e : 1);
return;
}
d < 1 &&
window.setTimeout(() => {
i({
type: e,
name: t,
group: a,
value: r,
properties: s,
file: c,
stack: l,
_retry: d + 1,
});
}, 1200);
} catch (e) {
console.error(e);
}
},
s = ({
name: e,
message: t = "",
prefix: a = "",
stack: r = "",
file: i = "",
properties: c = {},
_retry: l = 0,
}) => {
try {
if (!e || !t) return;
let d = o();
if (!d) {
l < 1 &&
window.setTimeout(() => {
s({
name: e,
message: t,
prefix: a,
stack: r,
file: i,
properties: c,
_retry: l + 1,
});
}, 1200);
return;
}
let u = (function (e) {
if ("string" == typeof e) return e;
if (e instanceof Error) return e.message || String(e);
try {
return JSON.stringify(e);
} catch {
return String(e);
}
})(t),
p = a ? `${a} ${u}` : u,
f = n(c);
if (d.sendException)
return void d.sendException({
name: e,
message: p,
file: i,
stack: r,
properties: f,
});
if (d.error) {
let e = Error(p);
r && (e.stack = r), d.error(e, { filename: i, ...f });
return;
}
l < 1 &&
window.setTimeout(() => {
s({
name: e,
message: t,
prefix: a,
stack: r,
file: i,
properties: c,
_retry: l + 1,
});
}, 1200);
} catch (e) {
console.error(e);
}
};
e.s(["rumCustomReport", 0, i, "rumErrorReport", 0, s]);
};
export default moduleFactory;