const t = globalThis;
function e(t) {
	let e, n, r, o = !1;
	return function(i) {
		void 0 === e ? (e = i, n = 0, r = -1) : e = function(t, e) {
			const n = new Uint8Array(t.length + e.length);
			return n.set(t), n.set(e, t.length), n;
		}(e, i);
		const s = e.length;
		let a = 0;
		for (; n < s;) {
			o && (10 === e[n] && (a = ++n), o = !1);
			let i = -1;
			for (; n < s && -1 === i; ++n) switch (e[n]) {
				case 58:
					-1 === r && (r = n - a);
					break;
				case 13: o = !0;
				case 10: i = n;
			}
			if (-1 === i) break;
			t(e.subarray(a, i), r), a = n, r = -1;
		}
		a === s ? e = void 0 : 0 !== a && (e = e.subarray(a), n -= a);
	};
}
void 0 === t.window && (t.window = globalThis), void 0 === t.document && (t.document = {
	hidden: !1,
	addEventListener: () => {},
	removeEventListener: () => {}
});
var n = function(t, e) {
	var n = {};
	for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
	if (null != t && "function" == typeof Object.getOwnPropertySymbols) {
		var o = 0;
		for (r = Object.getOwnPropertySymbols(t); o < r.length; o++) e.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[o]) && (n[r[o]] = t[r[o]]);
	}
	return n;
};
const r = "text/event-stream", o = "last-event-id";
function i(t, i) {
	var { signal: a, headers: c, onopen: u, onmessage: l, onclose: d, onerror: f, openWhenHidden: p, fetch: h } = i, m = n(i, [
		"signal",
		"headers",
		"onopen",
		"onmessage",
		"onclose",
		"onerror",
		"openWhenHidden",
		"fetch"
	]);
	return new Promise((n, i) => {
		const g = Object.assign({}, c);
		let v;
		function y() {
			v.abort(), document.hidden || k();
		}
		g.accept || (g.accept = r), p || document.addEventListener("visibilitychange", y);
		let _ = 1e3, b = 0;
		function w() {
			document.removeEventListener("visibilitychange", y), window.clearTimeout(b), v.abort();
		}
		null == a || a.addEventListener("abort", () => {
			w(), n();
		});
		const S = null != h ? h : window.fetch, E = null != u ? u : s;
		async function k() {
			var r;
			v = new AbortController();
			try {
				const r = await S(t, Object.assign(Object.assign({}, m), {
					headers: g,
					signal: v.signal
				}));
				await E(r), await async function(t, e) {
					const n = t.getReader();
					let r;
					for (; !(r = await n.read()).done;) e(r.value);
				}(r.body, e(function(t, e, n) {
					let r = {
						data: "",
						event: "",
						id: "",
						retry: void 0
					};
					const o = new TextDecoder();
					return function(i, s) {
						if (0 === i.length) null == n || n(r), r = {
							data: "",
							event: "",
							id: "",
							retry: void 0
						};
						else if (s > 0) {
							const n = o.decode(i.subarray(0, s)), a = s + (32 === i[s + 1] ? 2 : 1), c = o.decode(i.subarray(a));
							switch (n) {
								case "data":
									r.data = r.data ? r.data + "\n" + c : c;
									break;
								case "event":
									r.event = c;
									break;
								case "id":
									t(r.id = c);
									break;
								case "retry":
									const n = parseInt(c, 10);
									isNaN(n) || e(r.retry = n);
							}
						}
					};
				}((t) => {
					t ? g[o] = t : delete g[o];
				}, (t) => {
					_ = t;
				}, l))), null == d || d(), w(), n();
			} catch (s) {
				if (!v.signal.aborted) try {
					const t = null !== (r = null == f ? void 0 : f(s)) && void 0 !== r ? r : _;
					window.clearTimeout(b), b = window.setTimeout(k, t);
				} catch (a) {
					w(), i(a);
				}
			}
		}
		k();
	});
}
function s(t) {
	const e = t.headers.get("content-type");
	if (!(null == e ? void 0 : e.startsWith("text/event-stream"))) throw new Error(`Expected content-type to be ${r}, Actual: ${e}`);
}
let a = function(t) {
	return t.LOCAL_DEV = "[LOCAL_DEV]", t.QUICK_ENTRY = "[QUICK_ENTRY]", t.DESKTOP_AUTH = "[DESKTOP_AUTH]", t.CHAT_COMPLETION = "[COMPLETION]", t.EVALS = "[EVALS]", t.TEST_ONLY = "[TEST_ONLY]", t.O11Y_INTERNALS = "[O11Y]", t.AGE_VERIFICATION_SERVER = "[Age Verification Server]", t.BOOTSTRAP = "[BOOTSTRAP]", t.USER_CONTENT_RENDERER = "[USER_CONTENT_RENDERER]", t.MCP = "[MCP]", t.ARTIFACTS = "[ARTIFACTS]", t.BILLING = "[BILLING]", t.WORKBENCH = "[WORKBENCH]", t.METAPROMPT = "[METAPROMPT]", t.LOCAL_STORAGE = "[LOCAL_STORAGE]", t.SERVICE_WORKER = "[SERVICE_WORKER]", t.FILE_UPLOAD = "[FILE_UPLOAD]", t.CLIPBOARD = "[CLIPBOARD]", t.SEGMENT_EVENT = "[SEGMENT_EVENT]", t.I18N = "[I18N]", t.DESKTOP_API = "[DESKTOP_API]", t.DOCS = "[DOCS]", t.EXPERIENCE_FRAMEWORK = "[EXPERIENCE_FRAMEWORK]", t.PRIVATE_API = "[PRIVATE_API]", t.LOCAL_SESSION = "[LOCAL_SESSION]", t.NEST_UPDATE_PROXY = "[NEST_UPDATE_PROXY]", t.CC_NATIVE_INTERNAL_PROXY = "[CC_NATIVE_INTERNAL_PROXY]", t.LTI = "[LTI]", t.REACT_QUERY_CLIENT = "[REACT_QUERY_CLIENT]", t.CODE_ONBOARDING = "[CODE_ONBOARDING]", t.FEATURE_FLAGS = "[FEATURE_FLAGS]", t.SESSION_RECOVERY = "[SESSION_RECOVERY]", t.CCR_GITHUB = "[CCR_GITHUB]", t.VOICE_MODE = "[VOICE_MODE]", t.TUTOR = "[TUTOR]", t.PLAYGROUND = "[PLAYGROUND]", t;
}({}), c = "undefined" != typeof navigator && navigator.userAgent.includes("Electron/");
function u(t) {
	if (null === t || "object" != typeof t) return t;
	try {
		return JSON.stringify(t, (t, e) => e instanceof Error ? {
			...e,
			name: e.name,
			message: e.message,
			stack: e.stack
		} : e);
	} catch {
		return String(t);
	}
}
const l = (t) => c ? t.map(u) : t, d = (t, ...e) => {
	console.error(t, ...l(e));
};
const f = {
	log: "log",
	debug: "debug",
	info: "info",
	warn: "warn",
	error: "error"
}, p = console, h = {};
Object.keys(f).forEach((t) => {
	h[t] = p[t];
});
const m = "Datadog Browser SDK:", g = {
	debug: h.debug.bind(p, m),
	log: h.log.bind(p, m),
	info: h.info.bind(p, m),
	warn: h.warn.bind(p, m),
	error: h.error.bind(p, m)
}, v = "https://docs.datadoghq.com", y = `${v}/real_user_monitoring/browser/troubleshooting`, _ = "More details:";
function b(t, e) {
	return (...n) => {
		try {
			return t(...n);
		} catch (r) {
			g.error(e, r);
		}
	};
}
function w(t) {
	return 0 !== t && 100 * Math.random() <= t;
}
function S(t, e) {
	return +t.toFixed(e);
}
function E(t) {
	return "number" == typeof t;
}
function k(t) {
	try {
		return JSON.parse(t);
	} catch (e) {}
}
function T(t) {
	return { ...t };
}
function A(t, e) {
	return Object.keys(t).some((n) => t[n] === e);
}
function C(t) {
	return 0 === Object.keys(t).length;
}
function R(t, e) {
	const n = {};
	for (const r of Object.keys(t)) n[r] = e(t[r]);
	return n;
}
function x() {
	if ("object" == typeof globalThis) return globalThis;
	Object.defineProperty(Object.prototype, "_dd_temp_", {
		get() {
			return this;
		},
		configurable: !0
	});
	let t = _dd_temp_;
	return delete Object.prototype._dd_temp_, "object" != typeof t && (t = "object" == typeof self ? self : "object" == typeof window ? window : {}), t;
}
const I = x(), O = "WorkerGlobalScope" in I;
function N(t, e) {
	const n = x();
	let r;
	return n.Zone && "function" == typeof n.Zone.__symbol__ && (r = t[n.Zone.__symbol__(e)]), r || (r = t[e]), r;
}
let L, P = !1;
function M(t) {
	P = t;
}
function U(t) {
	return function(...e) {
		return D(t, this, e);
	};
}
function D(t, e, n) {
	try {
		return t.apply(e, n);
	} catch (r) {
		$(r);
	}
}
function $(t) {
	if (V(t), L) try {
		L(t);
	} catch (t) {
		V(t);
	}
}
function V(...t) {
	P && g.error("[MONITOR]", ...t);
}
function z(t, e) {
	return N(x(), "setTimeout")(U(t), e);
}
function q(t) {
	N(x(), "clearTimeout")(t);
}
function F(t, e) {
	return N(x(), "setInterval")(U(t), e);
}
function B(t) {
	N(x(), "clearInterval")(t);
}
function j(t) {
	const e = I.queueMicrotask;
	"function" == typeof e ? e(U(t)) : Promise.resolve().then(U(t));
}
var G = class {
	constructor(t) {
		this.onFirstSubscribe = t, this.observers = [];
	}
	subscribe(t) {
		return this.addObserver(t), { unsubscribe: () => this.removeObserver(t) };
	}
	notify(t) {
		this.observers.forEach((e) => e(t));
	}
	addObserver(t) {
		this.observers.push(t), 1 === this.observers.length && this.onFirstSubscribe && (this.onLastUnsubscribe = this.onFirstSubscribe(this) || void 0);
	}
	removeObserver(t) {
		this.observers = this.observers.filter((e) => t !== e), !this.observers.length && this.onLastUnsubscribe && this.onLastUnsubscribe();
	}
};
function K(...t) {
	return new G((e) => {
		const n = t.map((t) => t.subscribe((t) => e.notify(t)));
		return () => n.forEach((t) => t.unsubscribe());
	});
}
var H = class extends G {
	constructor(t) {
		super(), this.maxBufferSize = t, this.buffer = [];
	}
	notify(t) {
		this.buffer.push(t), this.buffer.length > this.maxBufferSize && this.buffer.shift(), super.notify(t);
	}
	subscribe(t) {
		let e = !1;
		return j(() => {
			for (const n of this.buffer) {
				if (e) return;
				t(n);
			}
			e || this.addObserver(t);
		}), { unsubscribe: () => {
			e = !0, this.removeObserver(t);
		} };
	}
	unbuffer() {
		j(() => {
			this.maxBufferSize = this.buffer.length = 0;
		});
	}
};
const W = 1e3, Y = 6e4, J = 31536e6;
function Z(t) {
	return {
		relative: t,
		timeStamp: Q(t)
	};
}
function X(t) {
	return {
		relative: ut(t),
		timeStamp: t
	};
}
function Q(t) {
	const e = nt() - performance.now();
	return e > dt() ? Math.round(ct(e, t)) : function(t) {
		return Math.round(ct(dt(), t));
	}(t);
}
function tt() {
	return Math.round(nt() - ct(dt(), performance.now()));
}
function et(t) {
	return E(t) ? S(1e6 * t, 0) : t;
}
function nt() {
	return (/* @__PURE__ */ new Date()).getTime();
}
function rt() {
	return nt();
}
function ot() {
	return performance.now();
}
function it() {
	return {
		relative: ot(),
		timeStamp: rt()
	};
}
function st() {
	return {
		relative: 0,
		timeStamp: dt()
	};
}
function at(t, e) {
	return e - t;
}
function ct(t, e) {
	return t + e;
}
function ut(t) {
	return t - dt();
}
let lt;
function dt() {
	var t, e;
	return void 0 === lt && (lt = null !== (e = null === (t = performance.timing) || void 0 === t ? void 0 : t.navigationStart) && void 0 !== e ? e : performance.timeOrigin), lt;
}
function ft(t, e, n) {
	const r = !n || void 0 === n.leading || n.leading, o = !n || void 0 === n.trailing || n.trailing;
	let i, s, a = !1;
	return {
		throttled: (...n) => {
			a ? i = n : (r ? t(...n) : i = n, a = !0, s = z(() => {
				o && i && t(...i), a = !1, i = void 0;
			}, e));
		},
		cancel: () => {
			q(s), a = !1, i = void 0;
		}
	};
}
function pt() {}
function ht(t) {
	return t ? (parseInt(t, 10) ^ 16 * Math.random() >> parseInt(t, 10) / 4).toString(16) : "10000000-1000-4000-8000-100000000000".replace(/[018]/g, ht);
}
const mt = /(\S+?)\s*=\s*(.+?)(?:;|$)/g;
function gt(t, e) {
	for (mt.lastIndex = 0;;) {
		const n = mt.exec(t);
		if (!n) break;
		if (n[1] === e) return n[2];
	}
}
function vt(t, e, n = "") {
	const r = t.charCodeAt(e - 1), o = r >= 55296 && r <= 56319 ? e + 1 : e;
	return t.length <= o ? t : `${t.slice(0, o)}${n}`;
}
function yt() {
	return 1 === Et();
}
let _t, bt, wt, St;
function Et() {
	return null != _t ? _t : _t = function(t = window) {
		var e;
		const n = t.navigator.userAgent;
		return t.chrome || /HeadlessChrome/.test(n) ? 0 : 0 === (null === (e = t.navigator.vendor) || void 0 === e ? void 0 : e.indexOf("Apple")) || /safari/i.test(n) && !/chrome|android/i.test(n) ? 1 : 2;
	}();
}
function kt(t) {
	return Tt(t, location.href).href;
}
function Tt(t, e) {
	const { URL: n } = function() {
		if (!bt) {
			let e, n;
			try {
				e = document.createElement("iframe"), e.style.display = "none", document.body.appendChild(e), n = e.contentWindow;
			} catch (t) {
				n = I;
			}
			bt = { URL: n.URL }, null == e || e.remove();
		}
		return bt;
	}();
	try {
		return void 0 !== e ? new n(t, e) : new n(t);
	} catch (r) {
		throw new Error(`Failed to construct URL: ${String(r)}`);
	}
}
function At(t, e, n = 0, r) {
	const o = /* @__PURE__ */ new Date();
	o.setTime(o.getTime() + n);
	const i = `expires=${o.toUTCString()}`, s = r && r.crossSite ? "none" : "strict", a = r && r.domain ? `;domain=${r.domain}` : "", c = r && r.secure ? ";secure" : "", u = r && r.partitioned ? ";partitioned" : "";
	document.cookie = `${t}=${e};${i};path=/;samesite=${s}${a}${c}${u}`;
}
function Ct(t) {
	return gt(document.cookie, t);
}
function Rt(t) {
	return function(t) {
		const e = /* @__PURE__ */ new Map();
		for (mt.lastIndex = 0;;) {
			const n = mt.exec(t);
			if (!n) break;
			{
				const t = n[1], r = n[2];
				e.has(t) ? e.get(t).push(r) : e.set(t, [r]);
			}
		}
		return e;
	}(document.cookie).get(t) || [];
}
function xt(t) {
	return wt || (wt = function(t) {
		const e = /* @__PURE__ */ new Map();
		for (mt.lastIndex = 0;;) {
			const n = mt.exec(t);
			if (!n) break;
			e.set(n[1], n[2]);
		}
		return e;
	}(document.cookie)), wt.get(t);
}
function It(t, e) {
	At(t, "", 0, e);
}
function Ot(t = location.hostname, e = document.referrer) {
	if (void 0 === St) {
		const n = function(t, e) {
			try {
				return t || Tt(e).hostname;
			} catch (n) {}
		}(t, e);
		if (n) {
			const t = `dd_site_test_${ht()}`, e = "test", r = n.split(".");
			let o = r.pop();
			for (; r.length && !Ct(t);) o = `${r.pop()}.${o}`, At(t, e, W, { domain: o });
			It(t, { domain: o }), St = o;
		}
	}
	return St;
}
const Nt = "_dd_s";
function Lt(t, e) {
	for (let n = t.length - 1; n >= 0; n -= 1) {
		const r = t[n];
		if (e(r, n, t)) return r;
	}
}
function Pt(t) {
	return Object.values(t);
}
function Mt(t) {
	return Object.entries(t);
}
const Ut = 144e5, Dt = 9e5, $t = J, Vt = "cookie", zt = "memory", qt = "local-storage", Ft = /^([a-zA-Z]+)=([a-z0-9-]+)$/;
function Bt(t, e) {
	const n = { isExpired: "1" };
	return e.trackAnonymousUser && null != t && t.anonymousId && (n.anonymousId = null == t ? void 0 : t.anonymousId), n;
}
function jt(t) {
	return C(t);
}
function Gt(t) {
	return !jt(t);
}
function Kt(t) {
	return void 0 !== t.isExpired || !((void 0 === (e = t).created || nt() - Number(e.created) < Ut) && (void 0 === e.expire || nt() < Number(e.expire)));
	var e;
}
function Ht(t) {
	t.expire = String(nt() + Dt);
}
function Wt(t) {
	return Mt(t).map(([t, e]) => "anonymousId" === t ? `aid=${e}` : `${t}=${e}`).join("&");
}
function Yt(t) {
	const e = {};
	return function(t) {
		return !!t && (-1 !== t.indexOf("&") || Ft.test(t));
	}(t) && t.split("&").forEach((t) => {
		const n = Ft.exec(t);
		if (null !== n) {
			const [, t, r] = n;
			"aid" === t ? e.anonymousId = r : e[t] = r;
		}
	}), e;
}
function Jt(t) {
	const e = function(t) {
		const e = {};
		if (e.secure = !!t.useSecureSessionCookie || !!t.usePartitionedCrossSiteSessionCookie, e.crossSite = !!t.usePartitionedCrossSiteSessionCookie, e.partitioned = !!t.usePartitionedCrossSiteSessionCookie, t.trackSessionAcrossSubdomains) {
			const t = Ot();
			if (!t) return;
			e.domain = t;
		}
		return e;
	}(t);
	return e && function(t) {
		if (void 0 === document.cookie || null === document.cookie) return !1;
		try {
			const e = `dd_cookie_test_${ht()}`, n = "test";
			At(e, n, Y, t);
			const r = Ct(e) === n;
			return It(e, t), r;
		} catch (e) {
			return g.error(e), !1;
		}
	}(e) ? {
		type: Vt,
		cookieOptions: e
	} : void 0;
}
function Zt(t, e) {
	const n = {
		isLockEnabled: 0 === Et(),
		persistSession: (n) => Xt(e, t, n, Dt),
		retrieveSession: () => Qt(e, t),
		expireSession: (n) => Xt(e, t, Bt(n, t), Ut)
	};
	return function(t) {
		if (!xt("_dd_s")) {
			const e = xt("_dd"), n = xt("_dd_r"), r = xt("_dd_l"), o = {};
			e && (o.id = e), r && /^[01]$/.test(r) && (o.logs = r), n && /^[012]$/.test(n) && (o.rum = n), Gt(o) && (Ht(o), t.persistSession(o));
		}
	}(n), n;
}
function Xt(t, e, n, r) {
	let o = Wt(n);
	e.betaEncodeCookieOptions && (o = Wt({
		...n,
		...C(n) ? {} : { c: te(t) }
	})), At(Nt, o, e.trackAnonymousUser ? $t : r, t);
}
function Qt(t, e) {
	return e.betaEncodeCookieOptions ? function(t) {
		const e = Rt(Nt), n = te(t);
		let r;
		for (const o of e.reverse()) if (r = Yt(o), r.c === n) break;
		return null == r || delete r.c, null != r ? r : {};
	}(t) : Yt(Ct(Nt));
}
function te(t) {
	let e = 0;
	return e |= 0, e |= (t.domain ? t.domain.split(".").length - 1 : 0) << 1, e |= t.crossSite ? 1 : 0, e.toString(16);
}
function ee(t) {
	return {
		isLockEnabled: !1,
		persistSession: ne,
		retrieveSession: re,
		expireSession: (e) => function(t, e) {
			ne(Bt(t, e));
		}(e, t)
	};
}
function ne(t) {
	localStorage.setItem(Nt, Wt(t));
}
function re() {
	return Yt(localStorage.getItem(Nt));
}
const oe = "--", ie = [];
let se;
function ae(t, e, n = 0) {
	var r;
	const { isLockEnabled: o, persistSession: i, expireSession: s } = e, a = (t) => i({
		...t,
		lock: u
	}), c = () => {
		const { lock: t, ...n } = e.retrieveSession();
		return {
			session: n,
			lock: t && !le(t) ? t : void 0
		};
	};
	if (se || (se = t), t !== se) return void ie.push(t);
	if (o && n >= 100) return void ue(e);
	let u, l = c();
	if (o) {
		if (l.lock) return void ce(t, e, n);
		if (u = ht() + oe + rt(), a(l.session), l = c(), l.lock !== u) return void ce(t, e, n);
	}
	let d = t.process(l.session);
	if (o && (l = c(), l.lock !== u)) ce(t, e, n);
	else {
		if (d && (Kt(d) ? s(d) : (Ht(d), o ? a(d) : i(d))), o && (!d || !Kt(d))) {
			if (l = c(), l.lock !== u) return void ce(t, e, n);
			i(l.session), d = l.session;
		}
		null === (r = t.after) || void 0 === r || r.call(t, d || l.session), ue(e);
	}
}
function ce(t, e, n) {
	z(() => {
		ae(t, e, n + 1);
	}, 10);
}
function ue(t) {
	se = void 0;
	const e = ie.shift();
	e && ae(e, t);
}
function le(t) {
	const [, e] = t.split(oe);
	return !e || at(Number(e), rt()) > 1e3;
}
const de = "_DD_SESSION";
function fe(t) {
	return {
		expireSession: (e) => function(t, e) {
			he(Bt(t, e));
		}(e, t),
		isLockEnabled: !1,
		persistSession: he,
		retrieveSession: pe
	};
}
function pe() {
	const t = x();
	return t._DD_SESSION || (t[de] = {}), T(t[de]);
}
function he(t) {
	x()[de] = T(t);
}
const me = W;
function ge(t) {
	const { sessionPersistence: e } = t, n = function(t, e) {
		return Array.isArray(t) ? t : void 0 !== t ? [t] : e.allowFallbackToLocalStorage ? [Vt, qt] : [Vt];
	}(e, t);
	for (const r of n) {
		const e = ve(r, t);
		if (void 0 !== e) return e;
	}
}
function ve(t, e) {
	switch (t) {
		case Vt: return Jt(e);
		case qt: return function() {
			try {
				const t = ht(), e = `_dd_test_${t}`;
				localStorage.setItem(e, t);
				const n = localStorage.getItem(e);
				return localStorage.removeItem(e), t === n ? { type: qt } : void 0;
			} catch (t) {
				return;
			}
		}();
		case zt: return { type: zt };
		default:
			g.error(`Invalid session persistence '${String(t)}'`);
			return;
	}
}
function ye(t, e, n, r, o = function(t, e) {
	return t.type === Vt ? Zt(e, t.cookieOptions) : t.type === qt ? ee(e) : fe(e);
}(t, e)) {
	const i = new G(), s = new G(), a = new G(), c = F(function() {
		const t = o.retrieveSession();
		Kt(t) ? ae({
			process: (t) => Kt(t) ? Bt(t, e) : void 0,
			after: f
		}, o) : f(t);
	}, me);
	let u;
	p();
	const { throttled: l, cancel: d } = ft(() => {
		ae({
			process: (t) => {
				if (jt(t)) return;
				const o = f(t);
				return function(t) {
					if (jt(t)) return !1;
					const o = r(t[n]);
					t[n] = o, delete t.isExpired, "0" === o || t.id || (t.id = ht(), t.created = String(nt()));
					e.trackAnonymousUser && !t.anonymousId && (t.anonymousId = ht());
				}(o), o;
			},
			after: (t) => {
				Gt(t) && !h() && function(t) {
					u = t, i.notify();
				}(t), u = t;
			}
		}, o);
	}, me);
	function f(t) {
		return Kt(t) && (t = Bt(t, e)), h() && (!function(t) {
			return u.id !== t.id || u[n] !== t[n];
		}(t) ? (a.notify({
			previousState: u,
			newState: t
		}), u = t) : (u = Bt(u, e), s.notify())), t;
	}
	function p() {
		ae({
			process: (t) => {
				if (jt(t)) return t.anonymousId = ht(), Bt(t, e);
			},
			after: (t) => {
				u = t;
			}
		}, o);
	}
	function h() {
		return void 0 !== (null == u ? void 0 : u[n]);
	}
	return {
		expandOrRenewSession: l,
		expandSession: function() {
			ae({ process: (t) => h() ? f(t) : void 0 }, o);
		},
		getSession: () => u,
		renewObservable: i,
		expireObservable: s,
		sessionStateUpdateObservable: a,
		restartSession: p,
		expire: (t) => {
			d(), !1 === t && u && delete u.anonymousId, o.expireSession(u), f(Bt(u, e));
		},
		stop: () => {
			B(c);
		},
		updateSessionState: function(t) {
			ae({
				process: (e) => ({
					...e,
					...t
				}),
				after: f
			}, o);
		}
	};
}
const _e = {
	GRANTED: "granted",
	NOT_GRANTED: "not-granted"
};
function be(t) {
	return null === t ? "null" : Array.isArray(t) ? "array" : typeof t;
}
function we(t) {
	return "object" === be(t);
}
function Se(t) {
	const e = be(t);
	return "string" === e || "function" === e || t instanceof RegExp;
}
function Ee(t, e, n = !1) {
	return t.some((t) => {
		try {
			if ("function" == typeof t) return t(e);
			if (t instanceof RegExp) return t.test(e);
			if ("string" == typeof t) return n ? e.startsWith(t) : t === e;
		} catch (r) {
			g.error(r);
		}
		return !1;
	});
}
function ke(t) {
	return t;
}
const Te = ["chrome-extension://", "moz-extension://"];
function Ae(t) {
	return Te.some((e) => t.includes(e));
}
function Ce(t, e) {
	const n = x().location, r = n ? n.origin : "", o = t.allowedTrackingOrigins;
	if (!o) return !function(t, e = "") {
		return !Ae(t) && Ae(e.split("\n").filter((t) => {
			const e = t.trim();
			return e.length && /^at\s+|@/.test(e);
		})[1] || "");
	}(r, e) || (g.error("Running the Browser SDK in a Web extension content script is forbidden unless the `allowedTrackingOrigins` option is provided."), !1);
	const i = Ee(o, r);
	return i || g.error("SDK initialized on a non-allowed domain."), i;
}
const Re = "datad0g.com", xe = "datadoghq.com", Ie = "datadoghq.eu", Oe = [
	"ddsource",
	"dd-api-key",
	"dd-request-id"
];
function Ne(t, e, n) {
	const r = function(t, e) {
		const n = `/api/v2/${e}`, r = t.proxy;
		if ("string" == typeof r) {
			const t = kt(r);
			return (e) => `${t}?ddforward=${encodeURIComponent(`${n}?${e}`)}`;
		}
		if ("function" == typeof r) return (t) => r({
			path: n,
			parameters: t
		});
		const o = Le(e, t);
		return (t) => `https://${o}${n}?${t}`;
	}(t, e);
	return {
		build(o, i) {
			const s = function({ clientToken: t, internalAnalyticsSubdomain: e, source: n = "browser" }, r, o, { retry: i, encoding: s }, a = []) {
				const c = [
					`ddsource=${n}`,
					`dd-api-key=${t}`,
					`dd-evp-origin-version=${encodeURIComponent("6.31.0")}`,
					"dd-evp-origin=browser",
					`dd-request-id=${ht()}`
				].concat(a);
				s && c.push(`dd-evp-encoding=${s}`);
				"rum" === r && (c.push(`batch_time=${rt()}`, `_dd.api=${o}`), i && c.push(`_dd.retry_count=${i.count}`, `_dd.retry_after=${i.lastFailureStatus}`));
				e && c.reverse();
				return c.join("&");
			}(t, e, o, i, n);
			return r(s);
		},
		trackType: e
	};
}
function Le(t, e) {
	const { site: n = xe, internalAnalyticsSubdomain: r } = e;
	if ("logs" === t && e.usePciIntake && "datadoghq.com" === n) return "pci.browser-intake-datadoghq.com";
	if (r && "datadoghq.com" === n) return `${r}.${xe}`;
	if ("dd0g-gov.com" === n) return `http-intake.logs.${n}`;
	const o = n.split("."), i = o.pop();
	return `browser-intake-${o.join("-")}.${i}`;
}
function Pe(t) {
	const e = t.site || "datadoghq.com", n = function(t) {
		return "flutter" === t || "unity" === t ? t : "browser";
	}(t.source), r = function(t) {
		return {
			logsEndpointBuilder: Ne(t, "logs"),
			rumEndpointBuilder: Ne(t, "rum"),
			profilingEndpointBuilder: Ne(t, "profile"),
			sessionReplayEndpointBuilder: Ne(t, "replay"),
			exposuresEndpointBuilder: Ne(t, "exposures"),
			flagEvaluationEndpointBuilder: Ne(t, "flagevaluation")
		};
	}({
		...t,
		site: e,
		source: n
	});
	return {
		replica: Me({
			...t,
			site: e,
			source: n
		}),
		site: e,
		source: n,
		...r
	};
}
function Me(t) {
	if (!t.replica) return;
	const e = {
		...t,
		site: xe,
		clientToken: t.replica.clientToken
	};
	return {
		logsEndpointBuilder: Ne(e, "logs"),
		rumEndpointBuilder: Ne(e, "rum", [`application.id=${t.replica.applicationId}`])
	};
}
const Ue = {
	ALLOW: "allow",
	MASK: "mask",
	MASK_USER_INPUT: "mask-user-input",
	MASK_UNLESS_ALLOWLISTED: "mask-unless-allowlisted"
}, De = {
	ALL: "all",
	SAMPLED: "sampled"
};
function $e(t, e) {
	return null == t || "string" == typeof t || (g.error(`${e} must be defined as a string`), !1);
}
function Ve(t, e) {
	return !!(void 0 === t || (n = t, E(n) && n >= 0 && n <= 100)) || (g.error(`${e} Sample Rate should be a number between 0 and 100`), !1);
	var n;
}
function ze(t, e) {
	var n, r, o, i, s, a, c, u, l, d;
	if (t && t.clientToken) if (void 0 === t.allowedTrackingOrigins || Array.isArray(t.allowedTrackingOrigins)) {
		if ((!(f = t.site) || "string" != typeof f || /(datadog|ddog|datad0g|dd0g)/.test(f) || (g.error(`Site should be a valid Datadog site. ${_} ${v}/getting_started/site/.`), 0)) && Ve(t.sessionSampleRate, "Session") && Ve(t.telemetrySampleRate, "Telemetry") && Ve(t.telemetryConfigurationSampleRate, "Telemetry Configuration") && Ve(t.telemetryUsageSampleRate, "Telemetry Usage") && $e(t.version, "Version") && $e(t.env, "Env") && $e(t.service, "Service") && Ce(t, null != e ? e : "")) {
			var f;
			if (void 0 === t.trackingConsent || A(_e, t.trackingConsent)) return {
				beforeSend: t.beforeSend && b(t.beforeSend, "beforeSend threw an error:"),
				sessionStoreStrategyType: O ? void 0 : ge(t),
				sessionSampleRate: null !== (n = t.sessionSampleRate) && void 0 !== n ? n : 100,
				telemetrySampleRate: null !== (r = t.telemetrySampleRate) && void 0 !== r ? r : 20,
				telemetryConfigurationSampleRate: null !== (o = t.telemetryConfigurationSampleRate) && void 0 !== o ? o : 5,
				telemetryUsageSampleRate: null !== (i = t.telemetryUsageSampleRate) && void 0 !== i ? i : 5,
				service: null !== (s = t.service) && void 0 !== s ? s : void 0,
				env: null !== (a = t.env) && void 0 !== a ? a : void 0,
				version: null !== (c = t.version) && void 0 !== c ? c : void 0,
				datacenter: null !== (u = t.datacenter) && void 0 !== u ? u : void 0,
				silentMultipleInit: !!t.silentMultipleInit,
				allowUntrustedEvents: !!t.allowUntrustedEvents,
				trackingConsent: null !== (l = t.trackingConsent) && void 0 !== l ? l : _e.GRANTED,
				trackAnonymousUser: null === (d = t.trackAnonymousUser) || void 0 === d || d,
				storeContextsAcrossPages: !!t.storeContextsAcrossPages,
				betaEncodeCookieOptions: !!t.betaEncodeCookieOptions,
				variant: t.variant,
				sdkVersion: t.sdkVersion,
				...Pe(t)
			};
			g.error("Tracking Consent should be either \"granted\" or \"not-granted\"");
		}
	} else g.error("Allowed Tracking Origins must be an array");
	else g.error("Client Token is not configured, we will not send any data.");
}
var qe;
(function(t) {
	t.TRACK_INTAKE_REQUESTS = "track_intake_requests", t.USE_TREE_WALKER_FOR_ACTION_NAME = "use_tree_walker_for_action_name", t.FEATURE_OPERATION_VITAL = "feature_operation_vital", t.SHORT_SESSION_INVESTIGATION = "short_session_investigation", t.START_STOP_ACTION = "start_stop_action", t.START_STOP_RESOURCE = "start_stop_resource", t.USE_CHANGE_RECORDS = "use_change_records", t.USE_INCREMENTAL_CHANGE_RECORDS = "use_incremental_change_records", t.LCP_SUBPARTS = "lcp_subparts", t.INP_SUBPARTS = "inp_subparts", t.TOO_MANY_REQUESTS_INVESTIGATION = "too_many_requests_investigation";
})(qe || (qe = {}));
const Fe = /* @__PURE__ */ new Set();
function Be(t) {
	Array.isArray(t) && t.filter((t) => A(qe, t)).forEach((t) => {
		Fe.add(t);
	});
}
function je(t) {
	return Fe.has(t);
}
function Ge() {
	return Fe;
}
const Ke = "?";
function He(t) {
	var e, n;
	const r = [];
	let o = nn(t, "stack");
	const i = String(t);
	if (o && o.startsWith(i) && (o = o.slice(i.length)), o && o.split("\n").forEach((t) => {
		const e = function(t) {
			const e = Je.exec(t);
			if (!e) return;
			const n = e[2] && 0 === e[2].indexOf("native"), r = e[2] && 0 === e[2].indexOf("eval"), o = Ze.exec(e[2]);
			r && o && (e[2] = o[1], e[3] = o[2], e[4] = o[3]);
			return {
				args: n ? [e[2]] : [],
				column: e[4] ? +e[4] : void 0,
				func: e[1] || Ke,
				line: e[3] ? +e[3] : void 0,
				url: n ? void 0 : e[2]
			};
		}(t) || function(t) {
			const e = Xe.exec(t);
			if (!e) return;
			return {
				args: [],
				column: e[4] ? +e[4] : void 0,
				func: e[1] || Ke,
				line: e[3] ? +e[3] : void 0,
				url: e[2]
			};
		}(t) || function(t) {
			const e = Qe.exec(t);
			if (!e) return;
			return {
				args: [],
				column: e[4] ? +e[4] : void 0,
				func: e[1] || Ke,
				line: +e[3],
				url: e[2]
			};
		}(t) || function(t) {
			const e = tn.exec(t);
			if (!e) return;
			const n = e[3] && e[3].indexOf(" > eval") > -1, r = en.exec(e[3]);
			n && r && (e[3] = r[1], e[4] = r[2], e[5] = void 0);
			return {
				args: e[2] ? e[2].split(",") : [],
				column: e[5] ? +e[5] : void 0,
				func: e[1] || Ke,
				line: e[4] ? +e[4] : void 0,
				url: e[3]
			};
		}(t);
		e && (!e.func && e.line && (e.func = Ke), r.push(e));
	}), r.length > 0 && function() {
		if (void 0 !== an) return an;
		class t extends Error {
			constructor() {
				super(), this.name = "Error";
			}
		}
		const [e, n] = [t, Error].map((t) => new t());
		return an = sn(Object.getPrototypeOf(e)) && n.stack !== e.stack, an;
	}() && t instanceof Error) {
		const o = [];
		let i = t;
		for (; (i = Object.getPrototypeOf(i)) && sn(i);) {
			const t = (null === (e = i.constructor) || void 0 === e ? void 0 : e.name) || Ke;
			o.push(t);
		}
		for (let t = o.length - 1; t >= 0 && (null === (n = r[0]) || void 0 === n ? void 0 : n.func) === o[t]; t--) r.shift();
	}
	return {
		message: nn(t, "message"),
		name: nn(t, "name"),
		stack: r
	};
}
const We = "((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)", Ye = "(?::(\\d+))", Je = new RegExp(`^\\s*at (.*?) ?\\(${We}${Ye}?${Ye}?\\)?\\s*$`, "i"), Ze = new RegExp(`\\((\\S*)${Ye}${Ye}\\)`);
const Xe = new RegExp(`^\\s*at\\s*(?:(.*)?(?: @))?\\s*${We}${Ye}?${Ye}??\\s*$`, "i");
const Qe = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
const tn = /^\s*(.*?)(?:\((.*?)\))?(?:(?:(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?)|@)\s*$/i, en = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
function nn(t, e) {
	return we(t) && "string" == typeof t[e] ? t[e] : void 0;
}
function rn(t, e, n, r) {
	if (void 0 === e) return;
	const { name: o, message: i } = function(t) {
		let e, n;
		"[object String]" === {}.toString.call(t) && ([, e, n] = on.exec(t));
		return {
			name: e,
			message: n
		};
	}(t);
	return {
		name: o,
		message: i,
		stack: [{
			url: e,
			column: r,
			line: n
		}]
	};
}
const on = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;
function sn(t) {
	return String(t.constructor).startsWith("class ");
}
let an;
function cn(t) {
	const e = new Error(t);
	let n;
	return e.name = "HandlingStack", D(() => {
		const t = He(e);
		t.stack = t.stack.slice(2), n = un(t);
	}), n;
}
function un(t) {
	let e = ln(t);
	return t.stack.forEach((t) => {
		const n = "?" === t.func ? "<anonymous>" : t.func, r = t.args && t.args.length > 0 ? `(${t.args.join(", ")})` : "", o = t.line ? `:${t.line}` : "", i = t.line && t.column ? `:${t.column}` : "";
		e += `\n  at ${n}${r} @ ${t.url}${o}${i}`;
	}), e;
}
function ln(t) {
	return `${t.name || "Error"}: ${t.message}`;
}
function dn(t, e, n, { computeHandlingStack: r } = {}) {
	let o = t[e];
	if ("function" != typeof o) {
		if (!(e in t) || "string" != typeof e || !e.startsWith("on")) return { stop: pt };
		o = pt;
	}
	let i = !1;
	const s = function() {
		if (i) return o.apply(this, arguments);
		const t = Array.from(arguments);
		let e;
		D(n, null, [{
			target: this,
			parameters: t,
			onPostCall: (t) => {
				e = t;
			},
			handlingStack: r ? cn("instrumented method") : void 0
		}]);
		const s = o.apply(this, t);
		return e && D(e, null, [s]), s;
	};
	return t[e] = s, { stop: () => {
		i = !0, t[e] === s && (t[e] = o);
	} };
}
function fn(t, e, n) {
	const r = Object.getOwnPropertyDescriptor(t, e);
	if (!r || !r.set || !r.configurable) return { stop: pt };
	const o = pt;
	let i = (t, e) => {
		z(() => {
			i !== o && n(t, e);
		}, 0);
	};
	const s = function(t) {
		r.set.call(this, t), i(this, t);
	};
	return Object.defineProperty(t, e, { set: s }), { stop: () => {
		var n;
		(null === (n = Object.getOwnPropertyDescriptor(t, e)) || void 0 === n ? void 0 : n.set) === s && Object.defineProperty(t, e, r), i = o;
	} };
}
const pn = /[^\u0000-\u007F]/;
function hn(t) {
	return pn.test(t) ? void 0 !== window.TextEncoder ? new TextEncoder().encode(t).length : new Blob([t]).size : t.length;
}
function mn(t) {
	if (1 === t.length) return t[0];
	const e = t.reduce((t, e) => t + e.length, 0), n = new Uint8Array(e);
	let r = 0;
	for (const o of t) n.set(o, r), r += o.length;
	return n;
}
function gn(t, e, n) {
	if ("object" != typeof t || null === t) return JSON.stringify(t);
	const r = vn(Object.prototype), o = vn(Array.prototype), i = vn(Object.getPrototypeOf(t)), s = vn(t);
	try {
		return JSON.stringify(t, e, n);
	} catch (a) {
		return "<error: unable to serialize object>";
	} finally {
		r(), o(), i(), s();
	}
}
function vn(t) {
	const e = t, n = e.toJSON;
	return n ? (delete e.toJSON, () => {
		e.toJSON = n;
	}) : pt;
}
function yn(t, e = 225280) {
	const n = vn(Object.prototype), r = vn(Array.prototype), o = [], i = /* @__PURE__ */ new WeakMap(), s = _n(t, "$", void 0, o, i), a = JSON.stringify(s);
	let c = a ? a.length : 0;
	if (!(c > e)) {
		for (; o.length > 0 && c < e;) {
			const n = o.shift();
			let r = 0;
			if (Array.isArray(n.source)) for (let s = 0; s < n.source.length; s++) {
				const a = _n(n.source[s], n.path, s, o, i);
				if (c += void 0 !== a ? JSON.stringify(a).length : 4, c += r, r = 1, c > e) {
					wn(e, "truncated", t);
					break;
				}
				n.target[s] = a;
			}
			else for (const s in n.source) if (Object.prototype.hasOwnProperty.call(n.source, s)) {
				const a = _n(n.source[s], n.path, s, o, i);
				if (void 0 !== a && (c += JSON.stringify(a).length + r + s.length + 3, r = 1), c > e) {
					wn(e, "truncated", t);
					break;
				}
				n.target[s] = a;
			}
		}
		return n(), r(), s;
	}
	wn(e, "discarded", t);
}
function _n(t, e, n, r, o) {
	const i = function(t) {
		const e = t;
		if (e && "function" == typeof e.toJSON) try {
			return e.toJSON();
		} catch (n) {}
		return t;
	}(t);
	if (!i || "object" != typeof i) return "bigint" == typeof (s = i) ? `[BigInt] ${s.toString()}` : "function" == typeof s ? `[Function] ${s.name || "unknown"}` : "symbol" == typeof s ? `[Symbol] ${s.description || s.toString()}` : s;
	var s;
	const a = bn(i);
	if ("[Object]" !== a && "[Array]" !== a && "[Error]" !== a) return a;
	const c = t;
	if (o.has(c)) return `[Reference seen at ${o.get(c)}]`;
	const u = void 0 !== n ? `${e}.${n}` : e, l = Array.isArray(i) ? [] : {};
	return o.set(c, u), r.push({
		source: i,
		target: l,
		path: u
	}), l;
}
function bn(t) {
	try {
		if (t instanceof Event) return {
			type: (e = t).type,
			isTrusted: e.isTrusted,
			currentTarget: e.currentTarget ? bn(e.currentTarget) : null,
			target: e.target ? bn(e.target) : null
		};
		if (t instanceof RegExp) return `[RegExp] ${t.toString()}`;
		const n = Object.prototype.toString.call(t).match(/\[object (.*)\]/);
		if (n && n[1]) return `[${n[1]}]`;
	} catch (n) {}
	var e;
	return "[Unserializable]";
}
function wn(t, e, n) {
	g.warn(`The data provided has been ${e} as it is over the limit of ${t} characters:`, n);
}
const Sn = "No stack, consider using an instance of Error";
function En({ originalError: t, stackTrace: e, source: n, useFallbackStack: r = !0, nonErrorPrefix: o }) {
	const i = Rn(t);
	return !e && i && (e = He(t)), {
		source: n,
		type: e ? e.name : void 0,
		message: Tn(e, i, o, t),
		stack: e ? un(e) : r ? Sn : void 0
	};
}
function kn({ stackTrace: t, originalError: e, handlingStack: n, componentStack: r, startClocks: o, nonErrorPrefix: i, useFallbackStack: s = !0, source: a, handling: c }) {
	return {
		startClocks: o,
		handling: c,
		handlingStack: n,
		componentStack: r,
		originalError: e,
		...En({
			originalError: e,
			stackTrace: t,
			source: a,
			useFallbackStack: s,
			nonErrorPrefix: i
		}),
		causes: Rn(e) ? xn(e, a) : void 0,
		fingerprint: An(e),
		context: Cn(e)
	};
}
function Tn(t, e, n, r) {
	return (null == t ? void 0 : t.message) && (null == t ? void 0 : t.name) ? t.message : e ? "Empty message" : n ? `${n} ${gn(yn(r))}` : gn(yn(r));
}
function An(t) {
	return Rn(t) && "dd_fingerprint" in t ? String(t.dd_fingerprint) : void 0;
}
function Cn(t) {
	if (we(t)) return t.dd_context;
}
function Rn(t) {
	return t instanceof Error || "[object Error]" === Object.prototype.toString.call(t);
}
function xn(t, e) {
	const n = [];
	let r = t.cause;
	for (; null != r && n.length < 10;) {
		const t = En({
			originalError: r,
			source: e,
			useFallbackStack: !1
		});
		n.push(t), r = Rn(r) ? r.cause : void 0;
	}
	return n.length ? n : void 0;
}
const In = "agent", On = "console", Nn = "custom", Ln = "source", Pn = "report";
function Mn() {
	return new G((t) => {
		const e = (e, n) => {
			const r = kn({
				stackTrace: n,
				originalError: e,
				startClocks: it(),
				nonErrorPrefix: "Uncaught",
				source: Ln,
				handling: "unhandled"
			});
			t.notify(r);
		}, { stop: n } = (r = e, dn(x(), "onerror", ({ parameters: [t, e, n, o, i] }) => {
			let s;
			Rn(i) || (s = rn(t, e, n, o)), r(null != i ? i : t, s);
		}));
		var r;
		const { stop: o } = function(t) {
			return dn(x(), "onunhandledrejection", ({ parameters: [e] }) => {
				t(e.reason || "Empty reason");
			});
		}(e);
		return () => {
			n(), o();
		};
	});
}
function Un(t, e) {
	e.silentMultipleInit || g.error(`${t} is already initialized.`);
}
function Dn(t, e, n, r, o) {
	return $n(t, e, [n], r, o);
}
function $n(t, e, n, r, { once: o, capture: i, passive: s } = {}) {
	const a = U((e) => {
		(e.isTrusted || e.__ddIsTrusted || t.allowUntrustedEvents) && (o && d(), r(e));
	}), c = s ? {
		capture: i,
		passive: s
	} : i, u = window.EventTarget && e instanceof EventTarget ? window.EventTarget.prototype : e, l = N(u, "addEventListener");
	function d() {
		const t = N(u, "removeEventListener");
		n.forEach((n) => t.call(e, n, a, c));
	}
	return n.forEach((t) => l.call(e, t, a, c)), { stop: d };
}
const Vn = "intervention", zn = "csp_violation";
function qn(t, e) {
	const n = [];
	e.includes(zn) && n.push(function(t) {
		return new G((e) => {
			const { stop: n } = Dn(t, document, "securitypolicyviolation", (t) => {
				e.notify(function(t) {
					const e = `'${t.blockedURI}' blocked by '${t.effectiveDirective}' directive`;
					return Fn({
						type: t.effectiveDirective,
						message: `${zn}: ${e}`,
						originalError: t,
						csp: { disposition: t.disposition },
						stack: Bn(t.effectiveDirective, t.originalPolicy ? `${e} of the policy "${vt(t.originalPolicy, 100, "...")}"` : "no policy", t.sourceFile, t.lineNumber, t.columnNumber)
					});
				}(t));
			});
			return n;
		});
	}(t));
	const r = e.filter((t) => t !== zn);
	return r.length && n.push(function(t) {
		return new G((e) => {
			if (!window.ReportingObserver) return;
			const n = U((t, n) => t.forEach((t) => e.notify(function(t) {
				const { type: e, body: n } = t;
				return Fn({
					type: n.id,
					message: `${e}: ${n.message}`,
					originalError: t,
					stack: Bn(n.id, n.message, n.sourceFile, n.lineNumber, n.columnNumber)
				});
			}(t)))), r = new window.ReportingObserver(n, {
				types: t,
				buffered: !0
			});
			return r.observe(), () => {
				r.disconnect();
			};
		});
	}(r)), K(...n);
}
function Fn(t) {
	return {
		startClocks: it(),
		source: Pn,
		handling: "unhandled",
		...t
	};
}
function Bn(t, e, n, r, o) {
	return n ? un({
		name: t,
		message: e,
		stack: [{
			func: "?",
			url: n,
			line: null != r ? r : void 0,
			column: null != o ? o : void 0
		}]
	}) : void 0;
}
var jn = { __regExpProbe0: "[\\p{Ll}]" };
function Gn(t) {
	const { env: e, service: n, version: r, datacenter: o, sdkVersion: i, variant: s } = t, a = [Kn("sdk_version", null != i ? i : "6.31.0")];
	return e && a.push(Kn("env", e)), n && a.push(Kn("service", n)), r && a.push(Kn("version", r)), o && a.push(Kn("datacenter", o)), s && a.push(Kn("variant", s)), a;
}
function Kn(t, e) {
	const n = e ? `${t}:${e}` : t;
	return (n.length > 200 || function(t) {
		return !!function() {
			try {
				return new RegExp(jn.__regExpProbe0, "u"), !0;
			} catch (t) {
				return !1;
			}
		}() && (/* @__PURE__ */ new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]", "u")).test(t);
	}(n)) && g.warn(`Tag ${n} doesn't meet tag requirements and will be sanitized. ${_} ${v}/getting_started/tagging/#defining-tags`), function(t) {
		return t.replace(/,/g, "_");
	}(n);
}
function Hn(t, e) {
	const n = I.__ddBrowserSdkExtensionCallback;
	n && n({
		type: t,
		payload: e
	});
}
function Wn(t, e, n = function() {
	if ("undefined" != typeof WeakSet) {
		const t = /* @__PURE__ */ new WeakSet();
		return { hasAlreadyBeenSeen(e) {
			const n = t.has(e);
			return n || t.add(e), n;
		} };
	}
	const t = [];
	return { hasAlreadyBeenSeen(e) {
		const n = t.indexOf(e) >= 0;
		return n || t.push(e), n;
	} };
}()) {
	if (void 0 === e) return t;
	if ("object" != typeof e || null === e) return e;
	if (e instanceof Date) return new Date(e.getTime());
	if (e instanceof RegExp) {
		const t = e.flags || [
			e.global ? "g" : "",
			e.ignoreCase ? "i" : "",
			e.multiline ? "m" : "",
			e.sticky ? "y" : "",
			e.unicode ? "u" : ""
		].join("");
		return new RegExp(e.source, t);
	}
	if (n.hasAlreadyBeenSeen(e)) return;
	if (Array.isArray(e)) {
		const r = Array.isArray(t) ? t : [];
		for (let t = 0; t < e.length; ++t) r[t] = Wn(r[t], e[t], n);
		return r;
	}
	const r = "object" === be(t) ? t : {};
	for (const o in e) Object.prototype.hasOwnProperty.call(e, o) && (r[o] = Wn(r[o], e[o], n));
	return r;
}
function Yn(t) {
	return Wn(void 0, t);
}
function Jn(...t) {
	let e;
	for (const n of t) null != n && (e = Wn(e, n));
	return e;
}
function Zn() {
	var t;
	const e = I.navigator;
	return {
		status: e.onLine ? "connected" : "not_connected",
		interfaces: e.connection && e.connection.type ? [e.connection.type] : void 0,
		effective_type: null === (t = e.connection) || void 0 === t ? void 0 : t.effectiveType
	};
}
function Xn(t, e) {
	return N(x(), "fetch")(t, e);
}
const Qn = 20971520, tr = W;
function er(t, e, n, r, o, i) {
	0 === e.transportStatus && 0 === e.queuedPayloads.size() && e.bandwidthMonitor.canHandle(t) ? rr(t, e, n, i, {
		onSuccess: () => or(0, e, n, r, o, i),
		onFailure: () => {
			e.queuedPayloads.enqueue(t) || i.notify({
				type: "queue-full",
				bandwidth: e.bandwidthMonitor.stats(),
				payload: t
			}), nr(e, n, r, o, i);
		}
	}) : e.queuedPayloads.enqueue(t) || i.notify({
		type: "queue-full",
		bandwidth: e.bandwidthMonitor.stats(),
		payload: t
	});
}
function nr(t, e, n, r, o) {
	2 === t.transportStatus && z(() => {
		rr(t.queuedPayloads.first(), t, e, o, {
			onSuccess: () => {
				t.queuedPayloads.dequeue(), t.currentBackoffTime = tr, or(1, t, e, n, r, o);
			},
			onFailure: () => {
				t.currentBackoffTime = Math.min(6e4, 2 * t.currentBackoffTime), nr(t, e, n, r, o);
			}
		});
	}, t.currentBackoffTime);
}
function rr(t, e, n, r, { onSuccess: o, onFailure: i }) {
	e.bandwidthMonitor.add(t), n(t, (n) => {
		e.bandwidthMonitor.remove(t), !function(t) {
			return "opaque" !== t.type && (0 === t.status && !navigator.onLine || 408 === t.status || 429 === t.status || (e = t.status, e >= 500));
			var e;
		}(n) ? (e.transportStatus = 0, r.notify({
			type: "success",
			bandwidth: e.bandwidthMonitor.stats(),
			payload: t
		}), o()) : (e.transportStatus = e.bandwidthMonitor.ongoingRequestCount > 0 ? 1 : 2, t.retry = {
			count: t.retry ? t.retry.count + 1 : 1,
			lastFailureStatus: n.status
		}, r.notify({
			type: "failure",
			bandwidth: e.bandwidthMonitor.stats(),
			payload: t
		}), i());
	});
}
function or(t, e, n, r, o, i) {
	0 === t && e.queuedPayloads.isFull() && !e.queueFullReported && (o({
		message: `Reached max ${r} events size queued for upload: 20MiB`,
		source: In,
		startClocks: it()
	}), e.queueFullReported = !0);
	const s = e.queuedPayloads;
	for (e.queuedPayloads = ir(); s.size() > 0;) er(s.dequeue(), e, n, r, o, i);
}
function ir() {
	const t = [];
	return {
		bytesCount: 0,
		enqueue(e) {
			return !this.isFull() && (t.push(e), this.bytesCount += e.bytesCount, !0);
		},
		first: () => t[0],
		dequeue() {
			const e = t.shift();
			return e && (this.bytesCount -= e.bytesCount), e;
		},
		size: () => t.length,
		isFull() {
			return this.bytesCount >= Qn;
		}
	};
}
const sr = 16384;
function ar(t, e, n = 16384) {
	const r = new G(), o = {
		transportStatus: 0,
		currentBackoffTime: tr,
		bandwidthMonitor: {
			ongoingRequestCount: 0,
			ongoingByteCount: 0,
			canHandle(t) {
				return 0 === this.ongoingRequestCount || this.ongoingByteCount + t.bytesCount <= 81920 && this.ongoingRequestCount < 32;
			},
			add(t) {
				this.ongoingRequestCount += 1, this.ongoingByteCount += t.bytesCount;
			},
			remove(t) {
				this.ongoingRequestCount -= 1, this.ongoingByteCount -= t.bytesCount;
			},
			stats() {
				return {
					ongoingByteCount: this.ongoingByteCount,
					ongoingRequestCount: this.ongoingRequestCount
				};
			}
		},
		queuedPayloads: ir(),
		queueFullReported: !1
	};
	return {
		observable: r,
		send: (n) => {
			for (const i of t) er(n, o, (t, e) => {
				lr(i, t, e);
			}, i.trackType, e, r);
		},
		sendOnExit: (e) => {
			for (const r of t) cr(r, n, e);
		}
	};
}
function cr(t, e, n) {
	if (navigator.sendBeacon && n.bytesCount < e) try {
		const e = t.build("beacon", n);
		if (navigator.sendBeacon(e, n.data)) return;
	} catch (r) {
		(function(t) {
			ur || (ur = !0, $(t));
		})(r);
	}
	lr(t, n);
}
let ur = !1;
function lr(t, e, n) {
	Xn(t.build("fetch", e), {
		method: "POST",
		body: e.data,
		mode: "cors"
	}).then(U((t) => null == n ? void 0 : n({
		status: t.status,
		type: t.type
	}))).catch(U(() => null == n ? void 0 : n({ status: 0 })));
}
function dr() {
	const t = x().DatadogEventBridge;
	if (t) return {
		getCapabilities() {
			var e;
			return JSON.parse((null === (e = t.getCapabilities) || void 0 === e ? void 0 : e.call(t)) || "[]");
		},
		getPrivacyLevel() {
			var e;
			return null === (e = t.getPrivacyLevel) || void 0 === e ? void 0 : e.call(t);
		},
		getAllowedWebViewHosts: () => JSON.parse(t.getAllowedWebViewHosts()),
		send(e, n, r) {
			const o = r ? { id: r } : void 0;
			t.send(JSON.stringify({
				eventType: e,
				event: n,
				view: o
			}));
		}
	};
}
function fr(t) {
	const e = dr();
	return !!e && e.getCapabilities().includes(t);
}
function pr(t) {
	var e;
	void 0 === t && (t = null === (e = x().location) || void 0 === e ? void 0 : e.hostname);
	const n = dr();
	return !!n && n.getAllowedWebViewHosts().some((e) => t === e || t.endsWith(`.${e}`));
}
const hr = {
	HIDDEN: "visibility_hidden",
	UNLOADING: "before_unload",
	PAGEHIDE: "page_hide",
	FROZEN: "page_frozen"
};
function mr(t) {
	return new G((e) => {
		if (O) return;
		const { stop: n } = $n(t, window, ["visibilitychange", "freeze"], (t) => {
			"visibilitychange" === t.type && "hidden" === document.visibilityState ? e.notify({ reason: hr.HIDDEN }) : "freeze" === t.type && e.notify({ reason: hr.FROZEN });
		}, { capture: !0 }), r = Dn(t, window, "beforeunload", () => {
			e.notify({ reason: hr.UNLOADING });
		}).stop;
		return () => {
			n(), r();
		};
	});
}
function gr(t) {
	return Pt(hr).includes(t);
}
const vr = 262144;
function yr({ encoder: t, request: e, flushController: n }) {
	let r = {};
	const o = n.flushObservable.subscribe((n) => function(n) {
		const o = Pt(r).join("\n");
		r = {};
		const i = gr(n.reason), s = i ? e.sendOnExit : e.send;
		if (i && t.isAsync) {
			const e = t.finishSync();
			e.outputBytesCount && s(_r(e));
			const n = [e.pendingData, o].filter(Boolean).join("\n");
			n && s({
				data: n,
				bytesCount: hn(n)
			});
		} else o && t.write(t.isEmpty ? o : `\n${o}`), t.finish((t) => {
			s(_r(t));
		});
	}(n));
	function i(e, o) {
		const i = gn(e), s = t.estimateEncodedBytesCount(i);
		s >= vr ? g.warn(`Discarded a message whose size was bigger than the maximum allowed size 256KiB. ${_} ${y}/#technical-limitations`) : (function(t) {
			return void 0 !== t && void 0 !== r[t];
		}(o) && function(e) {
			const o = r[e];
			delete r[e];
			const i = t.estimateEncodedBytesCount(o);
			n.notifyAfterRemoveMessage(i);
		}(o), function(e, o, i) {
			n.notifyBeforeAddMessage(o), void 0 !== i ? (r[i] = e, n.notifyAfterAddMessage()) : t.write(t.isEmpty ? e : `\n${e}`, (t) => {
				n.notifyAfterAddMessage(t - o);
			});
		}(i, s, o));
	}
	return {
		flushController: n,
		add: i,
		upsert: i,
		stop: o.unsubscribe
	};
}
function _r(t) {
	let e;
	return e = "string" == typeof t.output ? t.output : new Blob([t.output], { type: "text/plain" }), {
		data: e,
		bytesCount: t.outputBytesCount,
		encoding: t.encoding
	};
}
const br = O ? 1 : 50;
function wr({ pageMayExitObservable: t, sessionExpireObservable: e }) {
	const n = t.subscribe((t) => c(t.reason)), r = e.subscribe(() => c("session_expire")), o = new G(() => () => {
		n.unsubscribe(), r.unsubscribe();
	});
	let i, s = 0, a = 0;
	function c(t) {
		if (0 === a) return;
		const e = a, n = s;
		a = 0, s = 0, u(), o.notify({
			reason: t,
			messagesCount: e,
			bytesCount: n
		});
	}
	function u() {
		q(i), i = void 0;
	}
	return {
		flushObservable: o,
		get messagesCount() {
			return a;
		},
		notifyBeforeAddMessage(t) {
			s + t >= sr && c("bytes_limit"), a += 1, s += t, void 0 === i && (i = z(() => {
				c("duration_limit");
			}, 3e4));
		},
		notifyAfterAddMessage(t = 0) {
			s += t, a >= br ? c("messages_limit") : s >= sr && c("bytes_limit");
		},
		notifyAfterRemoveMessage(t) {
			s -= t, a -= 1, 0 === a && u();
		}
	};
}
function Sr() {
	let t = "", e = 0;
	return {
		isAsync: !1,
		get isEmpty() {
			return !t;
		},
		write(n, r) {
			const o = hn(n);
			e += o, t += n, r && r(o);
		},
		finish(t) {
			t(this.finishSync());
		},
		finishSync() {
			const n = {
				output: t,
				outputBytesCount: e,
				rawBytesCount: e,
				pendingData: ""
			};
			return t = "", e = 0, n;
		},
		estimateEncodedBytesCount: (t) => t.length
	};
}
const Er = "DISCARDED", kr = "SKIPPED";
const Tr = "log", Ar = "configuration", Cr = "usage", Rr = [
	"https://www.datadoghq-browser-agent.com",
	"https://www.datad0g-browser-agent.com",
	"https://d3uc069fcn7uxw.cloudfront.net",
	"https://d20xtzwzcl0ceb.cloudfront.net",
	"http://localhost",
	"<anonymous>"
], xr = ["ddog-gov.com"];
let Ir;
function Or() {
	return Ir || (Ir = new H(100)), Ir;
}
function Nr(t, e, n) {
	const r = new G(), { enabled: o, metricsEnabled: i } = function(t, e, n, r, o = 1, i = 15) {
		const s = {}, a = !xr.includes(e.site) && w(e.telemetrySampleRate), c = {
			[Tr]: a,
			[Ar]: a && w(e.telemetryConfigurationSampleRate),
			[Cr]: a && w(e.telemetryUsageSampleRate),
			metric: a && w(o)
		}, u = {
			is_local_file: "file:" === (null === (d = I.location) || void 0 === d ? void 0 : d.protocol),
			is_worker: O
		}, l = Or();
		var d;
		return l.subscribe(({ rawEvent: e, metricName: o }) => {
			if (o && !c.metric || !c[e.type]) return;
			const a = o || e.status || e.type;
			let l = s[a];
			if (l || (l = s[a] = /* @__PURE__ */ new Set()), l.size >= i) return;
			const d = gn(e);
			if (l.has(d)) return;
			const p = n.triggerHook(1, { startTime: it().relative });
			if ("DISCARDED" === p) return;
			const h = f(p, t, e, u);
			r.notify(h), Hn("telemetry", h), l.add(d);
		}), l.unbuffer(), function(t) {
			L = t;
		}(Pr), {
			enabled: a,
			metricsEnabled: c.metric
		};
		function f(t, n, r, o) {
			return Jn({
				type: "telemetry",
				date: it().timeStamp,
				service: n,
				version: "6.31.0",
				source: "browser",
				_dd: { format_version: 2 },
				telemetry: Jn(r, {
					runtime_env: o,
					connectivity: Zn(),
					sdk_setup: "npm"
				}),
				ddtags: Gn(e).join(","),
				experimental_features: Array.from(Ge())
			}, t);
		}
	}(t, e, n, r), { stop: s } = function(t, e) {
		const n = [];
		if (pr()) {
			const t = dr(), r = e.subscribe((e) => t.send("internal_telemetry", e));
			n.push(r.unsubscribe);
		} else {
			const r = [t.rumEndpointBuilder];
			t.replica && function(t) {
				return t.site === Re;
			}(t) && r.push(t.replica.rumEndpointBuilder);
			const o = yr({
				encoder: Sr(),
				request: ar(r, pt),
				flushController: wr({
					pageMayExitObservable: mr(t),
					sessionExpireObservable: new G()
				})
			});
			n.push(o.stop);
			const i = e.subscribe(o.add);
			n.push(i.unsubscribe);
		}
		return { stop: () => n.forEach((t) => t()) };
	}(e, r);
	return {
		stop: s,
		enabled: o,
		metricsEnabled: i
	};
}
function Lr(t, e) {
	V(f.debug, t, e), Or().notify({ rawEvent: {
		type: Tr,
		message: t,
		status: "debug",
		...e
	} });
}
function Pr(t, e) {
	Or().notify({ rawEvent: {
		type: Tr,
		status: "error",
		...Dr(t),
		...e
	} });
}
function Mr(t, e) {
	Or().notify({
		rawEvent: {
			type: Tr,
			message: t,
			status: "debug",
			...e
		},
		metricName: t
	});
}
function Ur(t) {
	Or().notify({ rawEvent: {
		type: Cr,
		usage: t
	} });
}
function Dr(t) {
	if (Rn(t)) {
		const e = He(t);
		return {
			error: {
				kind: e.name,
				stack: un($r(e))
			},
			message: e.message
		};
	}
	return {
		error: { stack: Sn },
		message: `Uncaught ${gn(t)}`
	};
}
function $r(t) {
	return t.stack = t.stack.filter((t) => !t.url || Rr.some((e) => t.url.startsWith(e))), t;
}
function Vr(t, e) {
	const n = t.indexOf(e);
	n >= 0 && t.splice(n, 1);
}
function zr(t) {
	return Array.isArray(t) && t.length > 0;
}
const qr = Infinity;
let Fr;
const Br = /* @__PURE__ */ new Set();
function jr({ expireDelay: t, maxEntries: e }) {
	let n = [];
	Fr || (Fr = F(() => {
		Br.forEach((t) => t());
	}, 6e4));
	const r = () => {
		const e = ot() - t;
		for (; n.length > 0 && n[n.length - 1].endTime < e;) n.pop();
	};
	return Br.add(r), {
		add: function(t, r) {
			const o = {
				value: t,
				startTime: r,
				endTime: qr,
				remove: () => {
					Vr(n, o);
				},
				close: (t) => {
					o.endTime = t;
				}
			};
			return e && n.length >= e && n.pop(), n.unshift(o), o;
		},
		find: function(t = Infinity, e = { returnInactive: !1 }) {
			for (const r of n) if (r.startTime <= t) {
				if (e.returnInactive || t <= r.endTime) return r.value;
				break;
			}
		},
		closeActive: function(t) {
			const e = n[0];
			e && e.endTime === qr && e.close(t);
		},
		findAll: function(t = Infinity, e = 0) {
			const r = ct(t, e);
			return n.filter((e) => e.startTime <= r && t <= e.endTime).map((t) => t.value);
		},
		getEntries: function(t) {
			return n.filter((e) => e.startTime === t);
		},
		reset: function() {
			n = [];
		},
		stop: function() {
			Br.delete(r), 0 === Br.size && Fr && (B(Fr), Fr = void 0);
		}
	};
}
const Gr = "datadog-synthetics-", Kr = `${Gr}public-id`, Hr = `${Gr}result-id`, Wr = `${Gr}injects-rum`, Yr = `${Gr}rum-context`;
function Jr() {
	return !O && Boolean(I._DATADOG_SYNTHETICS_INJECTS_RUM || xt(Wr));
}
function Zr() {
	const t = function() {
		const t = I._DATADOG_SYNTHETICS_RUM_CONTEXT;
		if (t) return t;
		const e = xt(Yr);
		return e ? k(decodeURIComponent(e)) : {
			test_id: window._DATADOG_SYNTHETICS_PUBLIC_ID || xt(Kr),
			result_id: window._DATADOG_SYNTHETICS_RESULT_ID || xt(Hr)
		};
	}();
	return "object" == typeof (e = t) && null !== e && "string" == typeof e.test_id && "string" == typeof e.result_id ? t : void 0;
	var e;
}
function Xr() {
	return Boolean(Zr());
}
const Qr = Y, to = Ut;
let eo = [];
function no(t, e, n, r) {
	const o = new G(), i = new G(), s = ye(t.sessionStoreStrategyType, t, e, n);
	eo.push(() => s.stop());
	const a = jr({ expireDelay: to });
	if (eo.push(() => a.stop()), s.renewObservable.subscribe(() => {
		a.add(c(), ot()), o.notify();
	}), s.expireObservable.subscribe(() => {
		i.notify(), a.closeActive(ot());
	}), s.expandOrRenewSession(), a.add(c(), st().relative), je(qe.SHORT_SESSION_INVESTIGATION)) {
		const e = s.getSession();
		e && function(t, e) {
			if (!window.cookieStore || !e.created) return;
			const n = Number(e.created), r = nt(), { stop: o } = Dn(t, cookieStore, "change", i);
			function i(t) {
				const i = Lt(t.changed, (t) => t.name === Nt);
				if (!i) return;
				const s = nt() - n;
				if (s > 84e4) o();
				else {
					const t = Yt(i.value);
					if (t.id && t.id !== e.id) {
						o();
						const n = nt() - r;
						ro().then((r) => {
							Lr("Session cookie changed", {
								time: n,
								session_age: s,
								old: e,
								new: t,
								cookie: r
							});
						}).catch($);
					}
				}
			}
			eo.push(o);
		}(t, e);
	}
	function c() {
		const n = s.getSession();
		return n ? {
			id: n.id,
			trackingType: n[e],
			isReplayForced: !!n.forcedReplay,
			anonymousId: n.anonymousId
		} : (async function(t) {
			const e = t.sessionStoreStrategyType;
			if (!e) return;
			let n, r;
			e.type === Vt ? (n = Qt(e.cookieOptions, t), r = {
				cookie: await ro(),
				currentDomain: `${window.location.protocol}//${window.location.hostname}`
			}) : n = re();
			Lr("Unexpected session state", {
				sessionStoreStrategyType: e.type,
				session: n,
				isSyntheticsTest: Xr(),
				createdTimestamp: null == n ? void 0 : n.created,
				expireTimestamp: null == n ? void 0 : n.expire,
				...r
			});
		}(t).catch(() => {}), {
			id: "invalid",
			trackingType: "0",
			isReplayForced: !1,
			anonymousId: void 0
		});
	}
	return r.observable.subscribe(() => {
		r.isGranted() ? s.expandOrRenewSession() : s.expire(!1);
	}), function(t, e) {
		const { stop: n } = $n(t, window, [
			"click",
			"touchstart",
			"keydown",
			"scroll"
		], e, {
			capture: !0,
			passive: !0
		});
		eo.push(n);
	}(t, () => {
		r.isGranted() && s.expandOrRenewSession();
	}), function(t, e) {
		const n = () => {
			"visible" === document.visibilityState && e();
		}, { stop: r } = Dn(t, document, "visibilitychange", n);
		eo.push(r);
		const o = F(n, Qr);
		eo.push(() => {
			B(o);
		});
	}(t, () => s.expandSession()), function(t, e) {
		const { stop: n } = Dn(t, window, "resume", e, { capture: !0 });
		eo.push(n);
	}(t, () => s.restartSession()), {
		findSession: (t, e) => a.find(t, e),
		renewObservable: o,
		expireObservable: i,
		sessionStateUpdateObservable: s.sessionStateUpdateObservable,
		expire: s.expire,
		updateSessionState: s.updateSessionState
	};
}
async function ro() {
	let t;
	return t = "cookieStore" in window ? await window.cookieStore.getAll(Nt) : document.cookie.split(/\s*;\s*/).filter((t) => t.startsWith(Nt)), {
		count: t.length,
		domain: Ot() || "undefined",
		...t
	};
}
function oo(t, e, n = 3e3) {
	let r = 0, o = !1;
	return { isLimitReached() {
		if (0 === r && z(() => {
			r = 0;
		}, Y), r += 1, r <= n || o) return o = !1, !1;
		if (r === n + 1) {
			o = !0;
			try {
				e({
					message: `Reached max number of ${t}s by minute: ${n}`,
					source: In,
					startClocks: it()
				});
			} finally {
				o = !1;
			}
		}
		return !0;
	} };
}
function io(t, e, n) {
	return document.readyState === e || "complete" === document.readyState ? (n(), { stop: pt }) : Dn(t, window, "complete" === e ? "load" : "DOMContentLoaded", n, { once: !0 });
}
function so(t, e) {
	return new Promise((n) => {
		io(t, e, n);
	});
}
let ao;
const co = /* @__PURE__ */ new WeakMap();
function uo(t) {
	return ao || (ao = function(t) {
		return new G((e) => {
			const { stop: n } = dn(XMLHttpRequest.prototype, "open", lo), { stop: r } = dn(XMLHttpRequest.prototype, "send", (n) => {
				(function({ target: t, parameters: [e], handlingStack: n }, r, o) {
					const i = co.get(t);
					if (!i) return;
					const s = i;
					s.state = "start", s.startClocks = it(), s.isAborted = !1, s.xhr = t, s.handlingStack = n, s.requestBody = e;
					let a = !1;
					const { stop: c } = dn(t, "onreadystatechange", () => {
						t.readyState === XMLHttpRequest.DONE && u();
					}), u = () => {
						if (l(), c(), a) return;
						a = !0;
						const e = i;
						e.state = "complete", e.duration = at(s.startClocks.timeStamp, rt()), e.status = t.status, "string" == typeof t.response && (e.responseBody = t.response), o.notify(T(e));
					}, { stop: l } = Dn(r, t, "loadend", u);
					o.notify(s);
				})(n, t, e);
			}, { computeHandlingStack: !0 }), { stop: o } = dn(XMLHttpRequest.prototype, "abort", fo);
			return () => {
				n(), r(), o();
			};
		});
	}(t)), ao;
}
function lo({ target: t, parameters: [e, n] }) {
	co.set(t, {
		state: "open",
		method: String(e).toUpperCase(),
		url: kt(String(n))
	});
}
function fo({ target: t }) {
	const e = co.get(t);
	e && (e.isAborted = !0);
}
let po;
const ho = [];
function mo({ responseBodyAction: t } = {}) {
	return t && ho.push(t), po || (po = new G((t) => {
		if (!I.fetch) return;
		const { stop: e } = dn(I, "fetch", (e) => function({ parameters: t, onPostCall: e, handlingStack: n }, r) {
			var o, i;
			const [s, a] = t;
			let c = a && a.method;
			void 0 === c && s instanceof Request && (c = s.method);
			const u = void 0 !== c ? String(c).toUpperCase() : "GET", l = s instanceof Request ? s.url : kt(String(s)), d = {
				state: "start",
				init: a,
				input: s,
				method: u,
				startClocks: it(),
				url: l,
				handlingStack: n,
				isAbortedOnStart: s instanceof Request && (null === (o = s.signal) || void 0 === o ? void 0 : o.aborted) || (null === (i = null == a ? void 0 : a.signal) || void 0 === i ? void 0 : i.aborted) || !1
			};
			r.notify(d), t[0] = d.input, t[1] = d.init, e((t) => {
				(async function(t, e, n) {
					var r, o;
					const i = n;
					let s;
					i.state = "resolve";
					try {
						s = await e;
					} catch (c) {
						i.status = 0, i.isAborted = (null === (o = null === (r = i.init) || void 0 === r ? void 0 : r.signal) || void 0 === o ? void 0 : o.aborted) || c instanceof DOMException && c.code === DOMException.ABORT_ERR, i.error = c, t.notify(i);
						return;
					}
					i.response = s, i.status = s.status, i.responseType = s.type, i.isAborted = !1;
					const a = ho.reduce((t, e) => Math.max(t, e(i)), 0);
					if (0 !== a) {
						const t = function(t) {
							try {
								return t.clone();
							} catch (r) {
								return;
							}
						}(s);
						if (t && t.body) try {
							const e = await async function(t, e) {
								const n = t.getReader(), r = [];
								for (;;) {
									const t = await n.read();
									if (t.done) break;
									e.collectStreamBody && r.push(t.value);
								}
								return n.cancel().catch(pt), e.collectStreamBody ? mn(r) : void 0;
							}(t.body, { collectStreamBody: 2 === a });
							i.responseBody = e && new TextDecoder().decode(e);
						} catch (u) {}
					}
					t.notify(i);
				})(r, t, d).catch($);
			});
		}(e, t), { computeHandlingStack: !0 });
		return e;
	})), po;
}
function go(t, e) {
	if (window.requestIdleCallback && window.cancelIdleCallback) {
		const n = window.requestIdleCallback(U(t), e);
		return () => window.cancelIdleCallback(n);
	}
	return function(t) {
		const e = nt(), n = z(() => {
			t({
				didTimeout: !1,
				timeRemaining: () => Math.max(0, 50 - (nt() - e))
			});
		}, 0);
		return () => q(n);
	}(t);
}
function vo() {
	const t = [];
	function e(e) {
		let r;
		if (e.didTimeout) {
			const t = performance.now();
			r = () => 30 - (performance.now() - t);
		} else r = e.timeRemaining.bind(e);
		for (; r() > 0 && t.length;) t.shift()();
		t.length && n();
	}
	function n() {
		go(e, { timeout: 1e3 });
	}
	return {
		push(e) {
			1 === t.push(e) && n();
		},
		stop() {
			t.length = 0;
		}
	};
}
let yo = {};
function _o(t) {
	return K(...t.map((t) => (yo[t] || (yo[t] = function(t) {
		return new G((e) => {
			const n = p[t];
			return p[t] = (...r) => {
				n.apply(console, r);
				const o = cn("console error");
				D(() => {
					e.notify(function(t, e, n) {
						const r = t.map((t) => function(t) {
							return "string" == typeof t ? yn(t) : Rn(t) ? ln(He(t)) : gn(yn(t), void 0, 2);
						}(t)).join(" ");
						if (e === f.error) {
							const o = kn({
								originalError: t.find(Rn),
								handlingStack: n,
								startClocks: it(),
								source: On,
								handling: "handled",
								nonErrorPrefix: "Provided",
								useFallbackStack: !1
							});
							return o.message = r, {
								api: e,
								message: r,
								handlingStack: n,
								error: o
							};
						}
						return {
							api: e,
							message: r,
							error: void 0,
							handlingStack: n
						};
					}(r, t, o));
				});
			}, () => {
				p[t] = n;
			};
		});
	}(t)), yo[t])));
}
function bo(t, e, n) {
	const r = { ...t };
	for (const [o, { required: i, type: s }] of Object.entries(e)) "string" !== s || wo(r[o]) || (r[o] = String(r[o])), i && wo(r[o]) && g.warn(`The property ${o} of ${n} is required; context will not be sent to the intake.`);
	return r;
}
function wo(t) {
	return null == t || "" === t;
}
function So(t = "", { propertiesConfig: e = {} } = {}) {
	let n = {};
	const r = new G(), o = {
		getContext: () => Yn(n),
		setContext: (i) => {
			!function(t) {
				const e = "object" === be(t);
				return e || g.error("Unsupported context:", t), e;
			}(i) ? o.clearContext() : n = yn(bo(i, e, t)), r.notify();
		},
		setContextProperty: (o, i) => {
			n = yn(bo({
				...n,
				[o]: i
			}, e, t)), r.notify();
		},
		removeContextProperty: (o) => {
			delete n[o], bo(n, e, t), r.notify();
		},
		clearContext: () => {
			n = {}, r.notify();
		},
		changeObservable: r
	};
	return o;
}
function Eo(t, e, n, r) {
	return U((...o) => (r && Ur({ feature: r }), t()[e][n](...o)));
}
const ko = "_dd_c", To = [];
function Ao(t, e, n, r) {
	const o = function(t, e) {
		return `${ko}_${t}_${e}`;
	}(n, r);
	To.push(Dn(t, window, "storage", ({ key: t }) => {
		o === t && e.setContext(s());
	})), e.changeObservable.subscribe(function() {
		localStorage.setItem(o, JSON.stringify(e.getContext()));
	});
	const i = Jn(s(), e.getContext());
	function s() {
		const t = localStorage.getItem(o);
		return t ? JSON.parse(t) : {};
	}
	C(i) || e.setContext(i);
}
function Co() {
	return So("account", { propertiesConfig: {
		id: {
			type: "string",
			required: !0
		},
		name: { type: "string" }
	} });
}
function Ro() {
	return So("global context");
}
function xo() {
	return So("user", { propertiesConfig: {
		id: { type: "string" },
		name: { type: "string" },
		email: { type: "string" }
	} });
}
const Io = "userContext", Oo = "globalContext", No = "accountContext", Lo = "getContext", Po = "setContext", Mo = "setContextProperty", Uo = "removeContextProperty", Do = "clearContext", $o = "document", Vo = "xhr", zo = "beacon", qo = "fetch", Fo = "css", Bo = "js", jo = "image", Go = "font", Ko = "media", Ho = "other", Wo = {
	FETCH: qo,
	XHR: Vo
};
function Yo() {
	try {
		return new Intl.DateTimeFormat().resolvedOptions().timeZone;
	} catch (t) {
		return;
	}
}
const Jo = {
	ACTION: "action",
	ERROR: "error",
	LONG_TASK: "long_task",
	VIEW: "view",
	RESOURCE: "resource",
	VITAL: "vital"
}, Zo = {
	LONG_TASK: "long-task",
	LONG_ANIMATION_FRAME: "long-animation-frame"
}, Xo = "initial_load", Qo = "route_change", ti = "bf_cache", ei = {
	CLICK: "click",
	CUSTOM: "custom",
	TAP: "tap",
	SCROLL: "scroll",
	SWIPE: "swipe",
	APPLICATION_START: "application_start",
	BACK: "back"
}, ni = "rage_click", ri = "error_click", oi = "dead_click", ii = "duration", si = "operation_step";
function ai(t, e, n) {
	function r(n) {
		(function(t) {
			return !e.wasInPageStateDuringPeriod("frozen", t.startClocks.relative, t.duration);
		})(n) && t.notify(12, li(n));
	}
	return {
		addOperationStepVital: function(e, n, r, o) {
			if (!je(qe.FEATURE_OPERATION_VITAL)) return;
			const { operationKey: i, context: s, description: a, handlingStack: c } = r || {}, u = {
				name: e,
				type: si,
				operationKey: i,
				failureReason: o,
				stepType: n,
				startClocks: it(),
				context: yn(s),
				description: a,
				handlingStack: c
			};
			t.notify(12, li(u));
		},
		addDurationVital: r,
		startDurationVital: (e, r = {}) => {
			const o = ci(n, e, r), i = n.vitalsByReference.get(o);
			return i && t.notify(16, i), o;
		},
		stopDurationVital: (t, e = {}) => {
			ui(r, n, t, e);
		}
	};
}
function ci({ vitalsByName: t, vitalsByReference: e }, n, r = {}) {
	const o = {
		id: ht(),
		name: n,
		startClocks: it(),
		...r
	}, i = { __dd_vital_reference: !0 };
	return t.set(n, o), e.set(i, o), i;
}
function ui(t, { vitalsByName: e, vitalsByReference: n }, r, o = {}) {
	const i = "string" == typeof r ? e.get(r) : n.get(r);
	i && (t(function(t, e, n, r) {
		var o;
		return {
			id: t.id,
			name: t.name,
			type: ii,
			startClocks: e,
			duration: at(e.timeStamp, r.timeStamp),
			context: Jn(t.context, n.context),
			description: null !== (o = n.description) && void 0 !== o ? o : t.description,
			handlingStack: t.handlingStack
		};
	}(i, i.startClocks, o, it())), "string" == typeof r ? e.delete(r) : n.delete(r));
}
function li(t) {
	const { startClocks: e, type: n, name: r, description: o, context: i, handlingStack: s } = t, a = t.type === ii ? t.id : void 0, c = {
		id: null != a ? a : ht(),
		type: n,
		name: r,
		description: o,
		...n === ii ? { duration: et(t.duration) } : {
			step_type: t.stepType,
			operation_key: t.operationKey,
			failure_reason: t.failureReason
		}
	};
	return {
		rawRumEvent: {
			date: e.timeStamp,
			vital: c,
			type: Jo.VITAL,
			context: i
		},
		startClocks: e,
		duration: n === ii ? t.duration : void 0,
		domainContext: s ? { handlingStack: s } : {}
	};
}
function di(t, e, n) {
	if (t) for (const r of t) {
		const t = r[e];
		t && t(n);
	}
}
const fi = function() {
	const t = {};
	return {
		register: (e, n) => (t[e] || (t[e] = []), t[e].push(n), { unregister: () => {
			t[e] = t[e].filter((t) => t !== n);
		} }),
		triggerHook(e, n) {
			const r = t[e] || [], o = [];
			for (const t of r) {
				const e = t(n);
				if ("DISCARDED" === e) return Er;
				"SKIPPED" !== e && o.push(e);
			}
			return Jn(...o);
		}
	};
}, pi = ["tracecontext", "datadog"];
function hi(t, e) {
	var n, r, o, i, s, a, c;
	if (void 0 === t.trackFeatureFlagsForEvents || Array.isArray(t.trackFeatureFlagsForEvents) || g.warn("trackFeatureFlagsForEvents should be an array"), !t.applicationId) return void g.error("Application ID is not configured, no RUM data will be collected.");
	if (!Ve(t.sessionReplaySampleRate, "Session Replay") || !Ve(t.traceSampleRate, "Trace")) return;
	if (void 0 !== t.excludedActivityUrls && !Array.isArray(t.excludedActivityUrls)) return void g.error("Excluded Activity Urls should be an array");
	const u = function(t) {
		if (void 0 === t.allowedTracingUrls) return [];
		if (!Array.isArray(t.allowedTracingUrls)) return void g.error("Allowed Tracing URLs should be an array");
		if (0 !== t.allowedTracingUrls.length && void 0 === t.service) return void g.error("Service needs to be configured when tracing is enabled");
		const e = [];
		return t.allowedTracingUrls.forEach((t) => {
			const n = gi(t);
			n ? e.push(n) : g.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter", t);
		}), e;
	}(t);
	if (!u) return;
	const l = ze(t, e), d = function(t) {
		if (!t.allowedGraphQlUrls) return [];
		if (!Array.isArray(t.allowedGraphQlUrls)) return g.warn("allowedGraphQlUrls should be an array"), [];
		const e = [];
		return t.allowedGraphQlUrls.forEach((t) => {
			Se(t) ? e.push({
				match: t,
				trackPayload: !1,
				trackResponseErrors: !1
			}) : we(t) && Se(t.match) && e.push({
				match: t.match,
				trackPayload: !!t.trackPayload,
				trackResponseErrors: !!t.trackResponseErrors
			});
		}), e;
	}(t);
	if (!l) return;
	const f = null !== (n = t.sessionReplaySampleRate) && void 0 !== n ? n : 0;
	return {
		applicationId: t.applicationId,
		actionNameAttribute: t.actionNameAttribute,
		betaTrackActionsInShadowDom: !!t.betaTrackActionsInShadowDom,
		sessionReplaySampleRate: f,
		startSessionReplayRecordingManually: void 0 !== t.startSessionReplayRecordingManually ? !!t.startSessionReplayRecordingManually : 0 === f,
		traceSampleRate: null !== (r = t.traceSampleRate) && void 0 !== r ? r : 100,
		rulePsr: E(t.traceSampleRate) ? t.traceSampleRate / 100 : void 0,
		allowedTracingUrls: u,
		excludedActivityUrls: null !== (o = t.excludedActivityUrls) && void 0 !== o ? o : [],
		workerUrl: t.workerUrl,
		compressIntakeRequests: !!t.compressIntakeRequests,
		trackUserInteractions: !(null !== (i = t.trackUserInteractions) && void 0 !== i && !i),
		trackViewsManually: !!t.trackViewsManually,
		trackResources: !(null !== (s = t.trackResources) && void 0 !== s && !s),
		trackLongTasks: !(null !== (a = t.trackLongTasks) && void 0 !== a && !a),
		trackBfcacheViews: !!t.trackBfcacheViews,
		trackEarlyRequests: !!t.trackEarlyRequests,
		subdomain: t.subdomain,
		defaultPrivacyLevel: A(Ue, t.defaultPrivacyLevel) ? t.defaultPrivacyLevel : Ue.MASK,
		enablePrivacyForActionName: !!t.enablePrivacyForActionName,
		traceContextInjection: A(De, t.traceContextInjection) ? t.traceContextInjection : De.SAMPLED,
		plugins: t.plugins || [],
		trackFeatureFlagsForEvents: t.trackFeatureFlagsForEvents || [],
		profilingSampleRate: null !== (c = t.profilingSampleRate) && void 0 !== c ? c : 0,
		propagateTraceBaggage: !!t.propagateTraceBaggage,
		allowedGraphQlUrls: d,
		...l
	};
}
function mi(t) {
	const e = /* @__PURE__ */ new Set();
	return zr(t.allowedTracingUrls) && t.allowedTracingUrls.forEach((t) => {
		var n;
		null === (n = gi(t)) || void 0 === n || n.propagatorTypes.forEach((t) => e.add(t));
	}), Array.from(e);
}
function gi(t) {
	return Se(t) ? {
		match: t,
		propagatorTypes: pi
	} : we(t) && Se(t.match) && (null === t.propagatorTypes || void 0 === t.propagatorTypes || Array.isArray(t.propagatorTypes)) ? {
		match: t.match,
		propagatorTypes: t.propagatorTypes || pi
	} : void 0;
}
function vi(t) {
	return zr(t) && t.some((t) => we(t) && t.trackResponseErrors);
}
function yi(t) {
	var e;
	const n = {
		session_sample_rate: (r = t).sessionSampleRate,
		telemetry_sample_rate: r.telemetrySampleRate,
		telemetry_configuration_sample_rate: r.telemetryConfigurationSampleRate,
		telemetry_usage_sample_rate: r.telemetryUsageSampleRate,
		use_before_send: !!r.beforeSend,
		use_partitioned_cross_site_session_cookie: r.usePartitionedCrossSiteSessionCookie,
		use_secure_session_cookie: r.useSecureSessionCookie,
		use_proxy: !!r.proxy,
		silent_multiple_init: r.silentMultipleInit,
		track_session_across_subdomains: r.trackSessionAcrossSubdomains,
		track_anonymous_user: r.trackAnonymousUser,
		session_persistence: Array.isArray(r.sessionPersistence) ? r.sessionPersistence[0] : r.sessionPersistence,
		allow_fallback_to_local_storage: !!r.allowFallbackToLocalStorage,
		store_contexts_across_pages: !!r.storeContextsAcrossPages,
		allow_untrusted_events: !!r.allowUntrustedEvents,
		tracking_consent: r.trackingConsent,
		use_allowed_tracking_origins: Array.isArray(r.allowedTrackingOrigins),
		beta_encode_cookie_options: r.betaEncodeCookieOptions,
		source: r.source,
		sdk_version: r.sdkVersion,
		variant: r.variant
	};
	var r, o;
	return {
		session_replay_sample_rate: t.sessionReplaySampleRate,
		start_session_replay_recording_manually: t.startSessionReplayRecordingManually,
		trace_sample_rate: t.traceSampleRate,
		trace_context_injection: t.traceContextInjection,
		propagate_trace_baggage: t.propagateTraceBaggage,
		action_name_attribute: t.actionNameAttribute,
		use_allowed_tracing_urls: zr(t.allowedTracingUrls),
		use_allowed_graph_ql_urls: zr(t.allowedGraphQlUrls),
		use_track_graph_ql_payload: (o = t.allowedGraphQlUrls, zr(o) && o.some((t) => we(t) && t.trackPayload)),
		use_track_graph_ql_response_errors: vi(t.allowedGraphQlUrls),
		selected_tracing_propagators: mi(t),
		default_privacy_level: t.defaultPrivacyLevel,
		enable_privacy_for_action_name: t.enablePrivacyForActionName,
		use_excluded_activity_urls: zr(t.excludedActivityUrls),
		use_worker_url: !!t.workerUrl,
		compress_intake_requests: t.compressIntakeRequests,
		track_views_manually: t.trackViewsManually,
		track_user_interactions: t.trackUserInteractions,
		track_resources: t.trackResources,
		track_long_task: t.trackLongTasks,
		track_bfcache_views: t.trackBfcacheViews,
		track_early_requests: t.trackEarlyRequests,
		plugins: null === (e = t.plugins) || void 0 === e ? void 0 : e.map((t) => {
			var e;
			return {
				name: t.name,
				...null === (e = t.getConfigurationTelemetry) || void 0 === e ? void 0 : e.call(t)
			};
		}),
		track_feature_flags_for_events: t.trackFeatureFlagsForEvents,
		remote_configuration_id: t.remoteConfigurationId,
		profiling_sample_rate: t.profilingSampleRate,
		use_remote_configuration_proxy: !!t.remoteConfigurationProxy,
		...n
	};
}
const _i = /[a-zA-Z_$]/, bi = /[a-zA-Z0-9_$]/, wi = /[0-9]/, Si = /[a-fA-F0-9]/, Ei = {
	0: () => !1,
	1: () => !1,
	2: (t) => _i.test(t),
	3: (t) => bi.test(t),
	4: (t) => "." === t,
	5: (t) => "[" === t,
	6: (t) => "]" === t,
	7: (t) => wi.test(t),
	8: (t) => "'\"".includes(t),
	9: (t, e) => t === e.quote,
	10: () => !0,
	11: (t) => "\\" === t,
	12: (t, e) => void 0 === e.escapeSequence ? `${e.quote}/\\bfnrtu`.includes(t) : !!(e.escapeSequence.startsWith("u") && e.escapeSequence.length < 5) && Si.test(t)
}, ki = {
	0: [2, 5],
	1: [],
	2: [
		3,
		4,
		5,
		1
	],
	3: [
		3,
		4,
		5,
		1
	],
	4: [2],
	5: [8, 7],
	6: [
		4,
		5,
		1
	],
	7: [7, 6],
	8: [
		11,
		9,
		10
	],
	9: [6],
	10: [
		11,
		9,
		10
	],
	11: [12],
	12: [
		12,
		11,
		9,
		10
	]
}, Ti = [
	2,
	3,
	7,
	10
], Ai = [
	4,
	5,
	6
];
function Ci(t) {
	return "\"'/\\bfnrt".includes(t) || t.startsWith("u") && 5 === t.length;
}
const Ri = {
	"\"": "\"",
	"'": "'",
	"/": "/",
	"\\": "\\",
	b: "\b",
	f: "\f",
	n: "\n",
	r: "\r",
	t: "	"
};
function xi(t) {
	return t.startsWith("u") ? String.fromCharCode(parseInt(t.slice(1), 16)) : Ri[t];
}
const Ii = [
	"applicationId",
	"service",
	"env",
	"version",
	"sessionSampleRate",
	"sessionReplaySampleRate",
	"defaultPrivacyLevel",
	"enablePrivacyForActionName",
	"traceSampleRate",
	"trackSessionAcrossSubdomains",
	"allowedTracingUrls",
	"allowedTrackingOrigins"
];
async function Oi(t, e) {
	let n;
	const r = function() {
		const t = { fetch: {} };
		return {
			get: () => t,
			increment: (e, n) => {
				t[e] || (t[e] = {}), t[e][n] || (t[e][n] = 0), t[e][n] = t[e][n] + 1;
			}
		};
	}(), o = await async function(t) {
		let e;
		try {
			e = await Xn(function(t) {
				return t.remoteConfigurationProxy ? t.remoteConfigurationProxy : `https://sdk-configuration.${Le("rum", t)}/v1/${encodeURIComponent(t.remoteConfigurationId)}.json`;
			}(t));
		} catch (r) {
			e = void 0;
		}
		if (!e || !e.ok) return {
			ok: !1,
			error: /* @__PURE__ */ new Error("Error fetching the remote configuration.")
		};
		const n = await e.json();
		return n.rum ? {
			ok: !0,
			value: n.rum
		} : {
			ok: !1,
			error: /* @__PURE__ */ new Error("No remote configuration for RUM.")
		};
	}(t);
	return o.ok ? (r.increment("fetch", "success"), n = function(t, e, n, r) {
		const o = { ...t };
		return Ii.forEach((t) => {
			t in e && (o[t] = i(e[t]));
		}), Object.keys(n).forEach((t) => {
			void 0 !== e[t] && s(n[t], e[t]);
		}), o;
		function i(t) {
			if (Array.isArray(t)) return t.map(i);
			if (we(t)) {
				if ("rcSerializedType" in t) {
					const e = t.rcSerializedType;
					switch (e) {
						case "string": return t.value;
						case "regex": return Ni(t.value);
						case "dynamic": return a(t);
						default:
							g.error(`Unsupported remote configuration: "rcSerializedType": "${e}"`);
							return;
					}
				}
				return R(t, i);
			}
			return t;
		}
		function s(t, e) {
			e.forEach(({ key: e, value: n }) => {
				t.setContextProperty(e, i(n));
			});
		}
		function a(t) {
			const e = t.strategy;
			let n;
			switch (e) {
				case "cookie":
					n = c(t);
					break;
				case "dom":
					n = l(t);
					break;
				case "js":
					n = f(t);
					break;
				case "localStorage":
					n = u(t);
					break;
				default:
					g.error(`Unsupported remote configuration: "strategy": "${e}"`);
					return;
			}
			const r = t.extractor;
			return void 0 !== r && "string" == typeof n ? function(t, e) {
				const n = Ni(t.value);
				if (void 0 === n) return;
				const r = n.exec(e);
				if (null === r) return;
				const [o, i] = r;
				return i || o;
			}(r, n) : n;
		}
		function c({ name: t }) {
			const e = Ct(t);
			return r.increment("cookie", void 0 !== e ? "success" : "missing"), e;
		}
		function u({ key: t }) {
			let e;
			try {
				e = localStorage.getItem(t);
			} catch (n) {
				r.increment("localStorage", "failure");
				return;
			}
			return r.increment("localStorage", null !== e ? "success" : "missing"), null != e ? e : void 0;
		}
		function l({ selector: t, attribute: e }) {
			let n;
			try {
				n = document.querySelector(t);
			} catch (i) {
				g.error(`Invalid selector in the remote configuration: '${t}'`), r.increment("dom", "failure");
				return;
			}
			if (!n) return void r.increment("dom", "missing");
			if (d(n, e)) return g.error(`Forbidden element selected by the remote configuration: '${t}'`), void r.increment("dom", "failure");
			const o = void 0 !== e ? n.getAttribute(e) : n.textContent;
			if (null !== o) return r.increment("dom", "success"), o;
			r.increment("dom", "missing");
		}
		function d(t, e) {
			return "password" === t.getAttribute("type") && "value" === e;
		}
		function f({ path: t }) {
			let e = window;
			const n = function(t) {
				const e = [];
				let n, r = 0;
				const o = {
					quote: void 0,
					escapeSequence: void 0
				};
				let i = "";
				for (const s of t) {
					if (n = ki[r].find((t) => Ei[t](s, o)), !n) return [];
					if (void 0 !== o.escapeSequence && 12 !== n) {
						if (!Ci(o.escapeSequence)) return [];
						i += xi(o.escapeSequence), o.escapeSequence = void 0;
					}
					Ti.includes(n) ? i += s : Ai.includes(n) && "" !== i ? (e.push(i), i = "") : 12 === n ? o.escapeSequence = o.escapeSequence ? `${o.escapeSequence}${s}` : s : 8 === n ? o.quote = s : 9 === n && (o.quote = void 0), r = n;
				}
				return ki[r].includes(1) ? ("" !== i && e.push(i), e) : [];
			}(t);
			if (0 === n.length) return g.error(`Invalid JSON path in the remote configuration: '${t}'`), void r.increment("js", "failure");
			for (const i of n) {
				if (!(i in e)) return void r.increment("js", "missing");
				try {
					e = e[i];
				} catch (o) {
					g.error(`Error accessing: '${t}'`, o), r.increment("js", "failure");
					return;
				}
			}
			return r.increment("js", "success"), e;
		}
	}(t, o.value, e, r)) : (r.increment("fetch", "failure"), g.error(o.error)), Mr("remote configuration metrics", { metrics: r.get() }), n;
}
function Ni(t) {
	try {
		return new RegExp(t);
	} catch (e) {
		g.error(`Invalid regex in the remote configuration: '${t}'`);
	}
}
function Li({ ignoreInitIfSyntheticsWillInjectRum: t = !0, startDeflateWorker: e }, n, r, o) {
	const i = function() {
		const t = [];
		return {
			add: (e) => {
				t.push(e) > 500 && t.splice(0, 1);
			},
			remove: (e) => {
				Vr(t, e);
			},
			drain: (e) => {
				t.forEach((t) => t(e)), t.length = 0;
			}
		};
	}(), s = Ro();
	Pi(s, Oo, i);
	const a = xo();
	Pi(a, Io, i);
	const c = Co();
	let u, l, d, f, p;
	Pi(c, No, i);
	const h = fi(), m = n.observable.subscribe(y), v = {};
	function y() {
		if (!d || !f || !n.isGranted()) return;
		let t;
		if (p || (p = Nr("browser-rum-sdk", f, h)), m.unsubscribe(), f.trackViewsManually) {
			if (!u) return;
			i.remove(u.callback), t = u.options;
		}
		const e = o(f, l, t, p, h);
		i.drain(e);
	}
	function _(t, r) {
		const o = pr();
		if (o && (t = function(t) {
			var e, n;
			return {
				...t,
				applicationId: "00000000-aaaa-0000-aaaa-000000000000",
				clientToken: "empty",
				sessionSampleRate: 100,
				defaultPrivacyLevel: null !== (e = t.defaultPrivacyLevel) && void 0 !== e ? e : null === (n = dr()) || void 0 === n ? void 0 : n.getPrivacyLevel()
			};
		}(t)), d = t, function(t) {
			Or().notify({ rawEvent: {
				type: Ar,
				configuration: t
			} });
		}(yi(t)), f) return void Un("DD_RUM", t);
		const i = hi(t, r);
		i && (o || i.sessionStoreStrategyType ? i.compressIntakeRequests && !o && e && (l = e(i, "Datadog RUM", pt), !l) || (f = i, mo().subscribe(pt), n.tryToInit(i.trackingConsent), y()) : g.warn("No storage available for session. We will not send any data."));
	}
	const b = (t) => {
		i.add((e) => e.addDurationVital(t));
	};
	return {
		init(e, n, r) {
			e ? (Be(e.enableExperimentalFeatures), d = e, t && Jr() || (di(e.plugins, "onInit", {
				initConfiguration: e,
				publicApi: n
			}), e.remoteConfigurationId ? Oi(e, {
				user: a,
				context: s
			}).then((t) => {
				t && _(t, r);
			}).catch($) : _(e, r))) : g.error("Missing configuration");
		},
		get initConfiguration() {
			return d;
		},
		getInternalContext: pt,
		stopSession: pt,
		addTiming(t, e = rt()) {
			i.add((n) => n.addTiming(t, e));
		},
		setLoadingTime: (t) => {
			i.add((e) => e.setLoadingTime(t));
		},
		startView(t, e = it()) {
			const n = (n) => {
				n.startView(t, e);
			};
			i.add(n), u || (u = {
				options: t,
				callback: n
			}, y());
		},
		setViewName(t) {
			i.add((e) => e.setViewName(t));
		},
		setViewContext(t) {
			i.add((e) => e.setViewContext(t));
		},
		setViewContextProperty(t, e) {
			i.add((n) => n.setViewContextProperty(t, e));
		},
		getViewContext: () => v,
		globalContext: s,
		userContext: a,
		accountContext: c,
		addAction(t) {
			i.add((e) => e.addAction(t));
		},
		startAction(t, e) {
			const n = it();
			i.add((r) => r.startAction(t, e, n));
		},
		stopAction(t, e) {
			const n = it();
			i.add((r) => r.stopAction(t, e, n));
		},
		startResource(t, e) {
			const n = it();
			i.add((r) => r.startResource(t, e, n));
		},
		stopResource(t, e) {
			const n = it();
			i.add((r) => r.stopResource(t, e, n));
		},
		addError(t) {
			i.add((e) => e.addError(t));
		},
		addFeatureFlagEvaluation(t, e) {
			i.add((n) => n.addFeatureFlagEvaluation(t, e));
		},
		startDurationVital: (t, e) => ci(r, t, e),
		stopDurationVital(t, e) {
			ui(b, r, t, e);
		},
		addDurationVital: b,
		addOperationStepVital: (t, e, n, r) => {
			i.add((o) => o.addOperationStepVital(yn(t), e, yn(n), yn(r)));
		}
	};
}
function Pi(t, e, n) {
	t.changeObservable.subscribe(() => {
		const r = t.getContext();
		n.add((t) => t[e].setContext(r));
	});
}
function Mi() {
	let t;
	const e = window;
	if (e.Zone && (t = N(e, "MutationObserver"), e.MutationObserver && t === e.MutationObserver)) {
		const n = N(new e.MutationObserver(pt), "originalInstance");
		t = n && n.constructor;
	}
	return t || (t = e.MutationObserver), t;
}
const Ui = class {
	constructor() {
		this.callbacks = {};
	}
	notify(t, e) {
		const n = this.callbacks[t];
		n && n.forEach((t) => t(e));
	}
	subscribe(t, e) {
		return this.callbacks[t] || (this.callbacks[t] = []), this.callbacks[t].push(e), { unsubscribe: () => {
			this.callbacks[t] = this.callbacks[t].filter((t) => e !== t);
		} };
	}
}, Di = Ut;
const $i = "initial_document", Vi = [
	[$o, (t) => $i === t],
	[Vo, (t) => "xmlhttprequest" === t],
	[qo, (t) => "fetch" === t],
	[zo, (t) => "beacon" === t],
	[Fo, (t, e) => /\.css$/i.test(e)],
	[Bo, (t, e) => /\.js$/i.test(e)],
	[jo, (t, e) => [
		"image",
		"img",
		"icon"
	].includes(t) || null !== /\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(e)],
	[Go, (t, e) => null !== /\.(woff|eot|woff2|ttf)$/i.exec(e)],
	[Ko, (t, e) => ["audio", "video"].includes(t) || null !== /\.(mp3|mp4)$/i.exec(e)]
];
function zi(t) {
	const e = t.name;
	if (!function(t) {
		try {
			return !!Tt(t);
		} catch (e) {
			return !1;
		}
	}(e)) return Ho;
	const n = function(t) {
		const e = Tt(t).pathname;
		return "/" === e[0] ? e : `/${e}`;
	}(e);
	for (const [r, o] of Vi) if (o(t.initiatorType, n)) return r;
	return Ho;
}
function qi(...t) {
	for (let e = 1; e < t.length; e += 1) if (t[e - 1] > t[e]) return !1;
	return !0;
}
function Fi(t) {
	return "xmlhttprequest" === t.initiatorType || "fetch" === t.initiatorType;
}
function Bi(t) {
	if (!Gi(t)) return;
	const { startTime: e, fetchStart: n, workerStart: r, redirectStart: o, redirectEnd: i, domainLookupStart: s, domainLookupEnd: a, connectStart: c, secureConnectionStart: u, connectEnd: l, requestStart: d, responseStart: f, responseEnd: p } = t, h = {
		download: Ki(e, f, p),
		first_byte: Ki(e, d, f)
	};
	return 0 < r && r < n && (h.worker = Ki(e, r, n)), n < l && (h.connect = Ki(e, c, l), c <= u && u <= l && (h.ssl = Ki(e, u, l))), n < a && (h.dns = Ki(e, s, a)), e < i && (h.redirect = Ki(e, o, i)), h;
}
function ji(t) {
	return t.duration >= 0;
}
function Gi(t) {
	const e = qi(t.startTime, t.fetchStart, t.domainLookupStart, t.domainLookupEnd, t.connectStart, t.connectEnd, t.requestStart, t.responseStart, t.responseEnd), n = !function(t) {
		return t.redirectEnd > t.startTime;
	}(t) || qi(t.startTime, t.redirectStart, t.redirectEnd, t.fetchStart);
	return e && n;
}
function Ki(t, e, n) {
	if (t <= e && e <= n) return {
		duration: et(at(e, n)),
		start: et(at(t, e))
	};
}
function Hi(t) {
	return "" === t.nextHopProtocol ? void 0 : t.nextHopProtocol;
}
function Wi(t) {
	return "" === t.deliveryType ? "other" : t.deliveryType;
}
function Yi(t) {
	if (t.startTime < t.responseStart) {
		const { encodedBodySize: e, decodedBodySize: n, transferSize: r } = t;
		return {
			size: n,
			encoded_body_size: e,
			decoded_body_size: n,
			transfer_size: r
		};
	}
	return {
		size: void 0,
		encoded_body_size: void 0,
		decoded_body_size: void 0,
		transfer_size: void 0
	};
}
function Ji(t) {
	return t && (!function(t) {
		return Oe.every((e) => t.includes(e));
	}(t) || je(qe.TRACK_INTAKE_REQUESTS));
}
const Zi = /data:(.+)?(;base64)?,/g;
function Xi(t, e = 24e3) {
	if (t.length <= e || !t.startsWith("data:")) return t;
	const n = t.substring(0, 100).match(Zi);
	return n ? `${n[0]}[...]` : t;
}
const Qi = /* @__PURE__ */ new Map();
function ts(t, e) {
	if (100 === e) return !0;
	if (0 === e) return !1;
	const n = Qi.get(e);
	if (n && t === n.sessionId) return n.decision;
	let r;
	return r = window.BigInt ? function(t, e) {
		const n = BigInt("1111111111111111111"), r = BigInt("0x10000000000000000");
		return Number(t * n % r) <= e / 100 * Number(r);
	}(BigInt(`0x${t.split("-")[4]}`), e) : w(e), Qi.set(e, {
		sessionId: t,
		decision: r
	}), r;
}
function es() {
	return ns(63);
}
function ns(t) {
	const e = crypto.getRandomValues(/* @__PURE__ */ new Uint32Array(2));
	return 63 === t && (e[e.length - 1] >>>= 1), { toString(t = 10) {
		let n = e[1], r = e[0], o = "";
		do {
			const e = n % t * 4294967296 + r;
			n = Math.floor(n / t), r = Math.floor(e / t), o = (e % t).toString(t) + o;
		} while (n || r);
		return o;
	} };
}
function rs(t) {
	return t.toString(16).padStart(16, "0");
}
function os(t) {
	0 !== t.status || t.isAborted || (t.traceId = void 0, t.spanId = void 0, t.traceSampled = void 0);
}
function is(t, e, n, r, o, i) {
	const s = n.findTrackedSession();
	if (!s) return;
	const a = t.allowedTracingUrls.find((t) => Ee([t.match], e.url, !0));
	if (!a) return;
	const c = ts(s.id, t.traceSampleRate);
	(c || t.traceContextInjection === De.ALL) && (e.traceSampled = c, e.traceId = ns(64), e.spanId = es(), i(function(t, e, n, r, o, i, s, a) {
		const c = {};
		if (o.forEach((r) => {
			switch (r) {
				case "datadog":
					Object.assign(c, {
						"x-datadog-origin": "rum",
						"x-datadog-parent-id": e.toString(),
						"x-datadog-sampling-priority": n ? "1" : "0",
						"x-datadog-trace-id": t.toString()
					});
					break;
				case "tracecontext":
					Object.assign(c, {
						traceparent: `00-0000000000000000${rs(t)}-${rs(e)}-0${n ? "1" : "0"}`,
						tracestate: `dd=s:${n ? "1" : "0"};o:rum`
					});
					break;
				case "b3":
					Object.assign(c, { b3: `${rs(t)}-${rs(e)}-${n ? "1" : "0"}` });
					break;
				case "b3multi": Object.assign(c, {
					"X-B3-TraceId": rs(t),
					"X-B3-SpanId": rs(e),
					"X-B3-Sampled": n ? "1" : "0"
				});
			}
		}), a.propagateTraceBaggage) {
			const t = { "session.id": r }, e = i.getContext().id;
			"string" == typeof e && (t["user.id"] = e);
			const n = s.getContext().id;
			"string" == typeof n && (t["account.id"] = n);
			const o = Object.entries(t).map(([t, e]) => `${t}=${encodeURIComponent(e)}`).join(",");
			o && (c.baggage = o);
		}
		return c;
	}(e.traceId, e.spanId, e.traceSampled, s.id, a.propagatorTypes, r, o, t)));
}
function ss(t, e) {
	const n = function(t, e = !1) {
		let n;
		"POST" === t.method ? n = function(t) {
			if (!t || "string" != typeof t) return;
			const e = k(t);
			if (!e) return;
			return {
				query: e.query,
				operationName: e.operationName,
				variables: e.variables ? JSON.stringify(e.variables) : void 0
			};
		}(t.requestBody) : "GET" === t.method && (n = function(t) {
			const e = Tt(t).searchParams, n = e.get("variables"), r = n && void 0 !== k(n) ? n : void 0;
			return {
				query: e.get("query") || void 0,
				operationName: e.get("operationName") || void 0,
				variables: r
			};
		}(t.url));
		if (!n) return;
		return function(t, e) {
			let n, r, o;
			if (t.query) {
				const o = t.query.trim();
				n = null === (i = o.match(/^\s*(query|mutation|subscription)\b/i)) || void 0 === i ? void 0 : i[1], e && (r = vt(o, 32768, "..."));
			}
			var i;
			t.variables && (o = t.variables);
			return {
				operationType: n,
				operationName: t.operationName,
				variables: o,
				payload: r
			};
		}(n, e);
	}(t, e.trackPayload);
	if (n) {
		if (e.trackResponseErrors && t.responseBody) {
			const e = function(t) {
				const e = k(t);
				if (!e || "object" != typeof e) return;
				const n = e;
				if (!zr(n.errors)) return;
				return n.errors.map((t) => {
					var e;
					return {
						message: t.message,
						path: t.path,
						locations: t.locations,
						code: null === (e = t.extensions) || void 0 === e ? void 0 : e.code
					};
				});
			}(t.responseBody);
			e && (n.error_count = e.length, n.errors = e);
		}
		return n;
	}
}
function as(t, e) {
	return e.allowedGraphQlUrls.find((e) => Ee([e.match], t));
}
let cs = 1;
function us(t, e, n, r, o) {
	const i = function(t, e, n, r) {
		return {
			clearTracingIfNeeded: os,
			traceFetch: (o) => is(t, o, e, n, r, (t) => {
				var e;
				if (o.input instanceof Request && !(null === (e = o.init) || void 0 === e ? void 0 : e.headers)) o.input = new Request(o.input), Object.keys(t).forEach((e) => {
					o.input.headers.append(e, t[e]);
				});
				else {
					o.init = T(o.init);
					const e = [];
					o.init.headers instanceof Headers ? o.init.headers.forEach((t, n) => {
						e.push([n, t]);
					}) : Array.isArray(o.init.headers) ? o.init.headers.forEach((t) => {
						e.push(t);
					}) : o.init.headers && Object.keys(o.init.headers).forEach((t) => {
						e.push([t, o.init.headers[t]]);
					}), o.init.headers = e.concat(Mt(t));
				}
			}),
			traceXhr: (o, i) => is(t, o, e, n, r, (t) => {
				Object.keys(t).forEach((e) => {
					i.setRequestHeader(e, t[e]);
				});
			})
		};
	}(e, n, r, o);
	(function(t, e, n) {
		uo(e).subscribe((e) => {
			const r = e;
			if (Ji(r.url)) switch (r.state) {
				case "start":
					n.traceXhr(r, r.xhr), r.requestIndex = ls(), t.notify(7, {
						requestIndex: r.requestIndex,
						url: r.url
					});
					break;
				case "complete": n.clearTracingIfNeeded(r), t.notify(8, {
					...r,
					type: Wo.XHR,
					isAbortedOnStart: !1
				});
			}
		});
	})(t, e, i), function(t, e, n) {
		mo({ responseBodyAction: (t) => {
			var n;
			return (null === (n = as(t.url, e)) || void 0 === n ? void 0 : n.trackResponseErrors) ? 2 : 1;
		} }).subscribe((e) => {
			var r;
			const o = e;
			if (Ji(o.url)) switch (o.state) {
				case "start":
					n.traceFetch(o), o.requestIndex = ls(), t.notify(7, {
						requestIndex: o.requestIndex,
						url: o.url
					});
					break;
				case "resolve": n.clearTracingIfNeeded(o), t.notify(8, {
					...o,
					duration: at(o.startClocks.timeStamp, rt()),
					type: Wo.FETCH,
					requestBody: null === (r = o.init) || void 0 === r ? void 0 : r.body
				});
			}
		});
	}(t, e, i);
}
function ls() {
	const t = cs;
	return cs += 1, t;
}
function ds(t) {
	return E(t) && t < 0 ? void 0 : t;
}
function fs(t) {
	return t.nodeType === Node.TEXT_NODE;
}
function ps(t) {
	return t.nodeType === Node.ELEMENT_NODE;
}
function hs(t) {
	return ps(t) && Boolean(t.shadowRoot);
}
function ms(t) {
	const e = t;
	return !!e.host && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE && ps(e.host);
}
function gs(t) {
	return t.childNodes.length > 0 || hs(t);
}
function vs(t, e) {
	let n = t.firstChild;
	for (; n;) e(n), n = n.nextSibling;
	hs(t) && e(t.shadowRoot);
}
function ys(t) {
	return ms(t) ? t.host : t.parentNode;
}
function _s(t) {
	if (t.parentElement) return t.parentElement;
	const e = t.parentNode;
	return e && ms(e) ? e.host : null;
}
function bs(t, e) {
	const n = nt();
	let r = !1;
	const { stop: o } = $n(t, window, [
		"click",
		"mousedown",
		"keydown",
		"touchstart",
		"pointerdown"
	], (e) => {
		if (!e.cancelable) return;
		const n = {
			entryType: "first-input",
			processingStart: ot(),
			processingEnd: ot(),
			startTime: e.timeStamp,
			duration: 0,
			name: "",
			cancelable: !1,
			target: null,
			toJSON: () => ({})
		};
		"pointerdown" === e.type ? function(t, e) {
			$n(t, window, ["pointerup", "pointercancel"], (t) => {
				"pointerup" === t.type && i(e);
			}, { once: !0 });
		}(t, n) : i(n);
	}, {
		passive: !0,
		capture: !0
	});
	return { stop: o };
	function i(t) {
		if (!r) {
			r = !0, o();
			const i = t.processingStart - t.startTime;
			i >= 0 && i < nt() - n && e(t);
		}
	}
}
var ws;
function Ss(t, e) {
	return new G((n) => {
		if (!window.PerformanceObserver) return;
		const r = (t) => {
			const e = function(t) {
				return t.filter((t) => !function(t) {
					return !(t.entryType !== ws.RESOURCE || Ji(t.name) && ji(t));
				}(t));
			}(t);
			e.length > 0 && n.notify(e);
		};
		let o, i = !0;
		const s = new PerformanceObserver(U((t) => {
			i ? o = z(() => r(t.getEntries())) : r(t.getEntries());
		}));
		try {
			s.observe(e);
		} catch (c) {
			if ([
				ws.RESOURCE,
				ws.NAVIGATION,
				ws.LONG_TASK,
				ws.PAINT
			].includes(e.type)) {
				e.buffered && (o = z(() => r(performance.getEntriesByType(e.type))));
				try {
					s.observe({ entryTypes: [e.type] });
				} catch (u) {
					return;
				}
			}
		}
		let a;
		return i = !1, function(t) {
			!Es && void 0 !== window.performance && "getEntries" in performance && "addEventListener" in performance && (Es = Dn(t, performance, "resourcetimingbufferfull", () => {
				performance.clearResourceTimings();
			}));
		}(t), ks(ws.FIRST_INPUT) || e.type !== ws.FIRST_INPUT || ({stop: a} = bs(t, (t) => {
			r([t]);
		})), () => {
			s.disconnect(), a && a(), q(o);
		};
	});
}
let Es;
function ks(t) {
	return window.PerformanceObserver && void 0 !== PerformanceObserver.supportedEntryTypes && PerformanceObserver.supportedEntryTypes.includes(t);
}
(function(t) {
	t.EVENT = "event", t.FIRST_INPUT = "first-input", t.LARGEST_CONTENTFUL_PAINT = "largest-contentful-paint", t.LAYOUT_SHIFT = "layout-shift", t.LONG_TASK = "longtask", t.LONG_ANIMATION_FRAME = "long-animation-frame", t.NAVIGATION = "navigation", t.PAINT = "paint", t.RESOURCE = "resource", t.VISIBILITY_STATE = "visibility-state";
})(ws || (ws = {}));
function Ts(t, e, n, r, o, i) {
	const s = As(t, e, n, r);
	let a, c = !1;
	const u = z(U(() => p({ hadActivity: !1 })), 100), l = void 0 !== i ? z(U(() => p({
		hadActivity: !0,
		end: rt()
	})), i) : void 0, d = s.subscribe(({ isBusy: t }) => {
		q(u), q(a);
		const e = rt();
		t || (a = z(U(() => p({
			hadActivity: !0,
			end: e
		})), 100));
	}), f = () => {
		c = !0, q(u), q(a), q(l), d.unsubscribe();
	};
	function p(t) {
		c || (f(), o(t));
	}
	return { stop: f };
}
function As(t, e, n, r) {
	return new G((o) => {
		const i = [];
		let s, a = 0;
		return i.push(e.subscribe((t) => {
			t.every(Rs) || c();
		}), n.subscribe(c), Ss(r, { type: ws.RESOURCE }).subscribe((t) => {
			t.some((t) => !Cs(r, t.name)) && c();
		}), t.subscribe(7, (t) => {
			Cs(r, t.url) || (void 0 === s && (s = t.requestIndex), a += 1, c());
		}), t.subscribe(8, (t) => {
			Cs(r, t.url) || void 0 === s || t.requestIndex < s || (a -= 1, c());
		})), () => {
			i.forEach((t) => t.unsubscribe());
		};
		function c() {
			o.notify({ isBusy: a > 0 });
		}
	});
}
function Cs(t, e) {
	return Ee(t.excludedActivityUrls, e);
}
function Rs(t) {
	const e = "characterData" === t.type ? t.target.parentElement : t.target;
	return Boolean(e && ps(e) && e.matches("[data-dd-excluded-activity-mutations], [data-dd-excluded-activity-mutations] *"));
}
const xs = "data-dd-action-name", Is = "Masked Element", Os = [
	xs,
	"data-testid",
	"data-test",
	"data-qa",
	"data-cy",
	"data-test-id",
	"data-qa-id",
	"data-testing",
	"data-component",
	"data-element",
	"data-source-file"
], Ns = [Ds, function(t) {
	if (t.id && !Us(t.id)) return `#${CSS.escape(t.id)}`;
}], Ls = [
	Ds,
	function(t) {
		if ("BODY" === t.tagName) return;
		const e = t.classList;
		for (let n = 0; n < e.length; n += 1) {
			const r = e[n];
			if (!Us(r)) return `${CSS.escape(t.tagName)}.${CSS.escape(r)}`;
		}
	},
	function(t) {
		return CSS.escape(t.tagName);
	}
];
function Ps(t, e) {
	if (!t.isConnected) return;
	const n = function(t) {
		const e = [];
		let n = t;
		for (; n;) {
			const t = n.getRootNode();
			if (e.push({
				rootNode: t,
				target: n
			}), !ms(t)) break;
			n = t.host;
		}
		return e.reverse();
	}(t), r = [];
	for (const { rootNode: o, target: i } of n) {
		const t = Ms(i, o, e);
		if (!t) return;
		r.push(t);
	}
	return r.join("::shadow ");
}
function Ms(t, e, n) {
	let r, o = t;
	for (; o && "HTML" !== o.nodeName;) {
		const t = Vs(o, e, Ns, zs, n, r);
		if (t) return Fs(t, r);
		r = Fs(Vs(o, e, Ls, qs, n, r) || $s(o), r), o = o.parentElement;
	}
	return r;
}
function Us(t) {
	return /[0-9]/.test(t);
}
function Ds(t, e) {
	if (e) {
		const t = n(e);
		if (t) return t;
	}
	for (const r of Os) {
		const t = n(r);
		if (t) return t;
	}
	function n(e) {
		if (t.hasAttribute(e)) return `${CSS.escape(t.tagName)}[${e}="${CSS.escape(t.getAttribute(e))}"]`;
	}
}
function $s(t) {
	let e = t.parentNode.firstElementChild, n = 1;
	for (; e && e !== t;) e.tagName === t.tagName && (n += 1), e = e.nextElementSibling;
	return `${CSS.escape(t.tagName)}:nth-of-type(${n})`;
}
function Vs(t, e, n, r, o, i) {
	for (const s of n) {
		const n = s(t, o);
		if (n && r(t, e, n, i)) return n;
	}
}
function zs(t, e, n, r) {
	return 1 === e.querySelectorAll(Fs(n, r)).length;
}
function qs(t, e, n, r) {
	let o;
	if (void 0 === r) o = (t) => t.matches(n);
	else {
		const t = Fs(`${n}:scope`, r);
		o = (e) => null !== e.querySelector(t);
	}
	let i = t.previousElementSibling;
	for (; i;) {
		if (o(i)) return !1;
		i = i.previousElementSibling;
	}
	for (i = t.nextElementSibling; i;) {
		if (o(i)) return !1;
		i = i.nextElementSibling;
	}
	return !0;
}
function Fs(t, e) {
	return e ? `${t}>${e}` : t;
}
const Bs = {
	IGNORE: "ignore",
	HIDDEN: "hidden",
	ALLOW: Ue.ALLOW,
	MASK: Ue.MASK,
	MASK_USER_INPUT: Ue.MASK_USER_INPUT,
	MASK_UNLESS_ALLOWLISTED: Ue.MASK_UNLESS_ALLOWLISTED
}, js = "data-dd-privacy", Gs = "hidden", Ks = "data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==", Hs = {
	INPUT: !0,
	OUTPUT: !0,
	TEXTAREA: !0,
	SELECT: !0,
	OPTION: !0,
	DATALIST: !0,
	OPTGROUP: !0
};
function Ws(t) {
	return `[${js}="${t}"], .dd-privacy-${t}`;
}
function Ys(t, e, n) {
	if (n && n.has(t)) return n.get(t);
	const r = ys(t), o = r ? Ys(r, e, n) : e, i = Js(Zs(t), o);
	return n && n.set(t, i), i;
}
function Js(t, e) {
	switch (e) {
		case Bs.HIDDEN:
		case Bs.IGNORE: return e;
	}
	switch (t) {
		case Bs.ALLOW:
		case Bs.MASK:
		case Bs.MASK_USER_INPUT:
		case Bs.MASK_UNLESS_ALLOWLISTED:
		case Bs.HIDDEN:
		case Bs.IGNORE: return t;
		default: return e;
	}
}
function Zs(t) {
	if (ps(t)) {
		if ("BASE" === t.tagName) return Bs.ALLOW;
		if ("INPUT" === t.tagName) {
			const e = t;
			if ("password" === e.type || "email" === e.type || "tel" === e.type) return Bs.MASK;
			if ("hidden" === e.type) return Bs.MASK;
			const n = e.getAttribute("autocomplete");
			if (n && (n.startsWith("cc-") || n.endsWith("-password"))) return Bs.MASK;
		}
		return t.matches(Ws(Bs.HIDDEN)) ? Bs.HIDDEN : t.matches(Ws(Bs.MASK)) ? Bs.MASK : t.matches(Ws(Bs.MASK_UNLESS_ALLOWLISTED)) ? Bs.MASK_UNLESS_ALLOWLISTED : t.matches(Ws(Bs.MASK_USER_INPUT)) ? Bs.MASK_USER_INPUT : t.matches(Ws(Bs.ALLOW)) ? Bs.ALLOW : function(t) {
			if ("SCRIPT" === t.nodeName) return !0;
			if ("LINK" === t.nodeName) {
				const t = e("rel");
				return /preload|prefetch/i.test(t) && "script" === e("as") || "shortcut icon" === t || "icon" === t;
			}
			if ("META" === t.nodeName) {
				const n = e("name"), r = e("rel"), o = e("property");
				return /^msapplication-tile(image|color)$/.test(n) || "application-name" === n || "icon" === r || "apple-touch-icon" === r || "shortcut icon" === r || "keywords" === n || "description" === n || /^(og|twitter|fb):/.test(o) || /^(og|twitter):/.test(n) || "pinterest" === n || "robots" === n || "googlebot" === n || "bingbot" === n || t.hasAttribute("http-equiv") || "author" === n || "generator" === n || "framework" === n || "publisher" === n || "progid" === n || /^article:/.test(o) || /^product:/.test(o) || "google-site-verification" === n || "yandex-verification" === n || "csrf-token" === n || "p:domain_verify" === n || "verify-v1" === n || "verification" === n || "shopify-checkout-api-token" === n;
			}
			function e(e) {
				return (t.getAttribute(e) || "").toLowerCase();
			}
			return !1;
		}(t) ? Bs.IGNORE : void 0;
	}
}
function Xs(t, e) {
	switch (e) {
		case Bs.MASK:
		case Bs.HIDDEN:
		case Bs.IGNORE: return !0;
		case Bs.MASK_UNLESS_ALLOWLISTED: return fs(t) ? !!ta(t.parentNode) || !ra(t.textContent || "") : ta(t);
		case Bs.MASK_USER_INPUT: return fs(t) ? ta(t.parentNode) : ta(t);
		default: return !1;
	}
}
function Qs(t, e, n, r, o) {
	if (r !== Bs.MASK && r !== Bs.MASK_UNLESS_ALLOWLISTED) return !1;
	if ("data-dd-privacy" === e || Os.includes(e) || e === o.actionNameAttribute) return !1;
	switch (e) {
		case "title":
		case "alt":
		case "placeholder":
		case "aria-label":
		case "name": return !0;
	}
	return "A" === t && "href" === e || "IFRAME" === t && "srcdoc" === e || !(!n || !e.startsWith("data-")) || !("IMG" !== t && "SOURCE" !== t || "src" !== e && "srcset" !== e);
}
function ta(t) {
	if (!t || t.nodeType !== t.ELEMENT_NODE) return !1;
	const e = t;
	if ("INPUT" === e.tagName) switch (e.type) {
		case "button":
		case "color":
		case "reset":
		case "submit": return !1;
	}
	return !!Hs[e.tagName];
}
const ea = (t) => t.replace(/\S/g, "x");
function na(t, e) {
	var n;
	const r = null === (n = t.parentElement) || void 0 === n ? void 0 : n.tagName;
	let o = t.textContent || "";
	if ("HEAD" === r && !o.trim()) return;
	const i = e;
	if ("SCRIPT" === r) o = "***";
	else if (i === Bs.HIDDEN) o = "***";
	else if (Xs(t, i)) if ("DATALIST" === r || "SELECT" === r || "OPTGROUP" === r) {
		if (!o.trim()) return;
	} else o = "OPTION" === r ? "***" : i === Bs.MASK_UNLESS_ALLOWLISTED ? oa(o) : ea(o);
	return o;
}
function ra(t) {
	var e;
	return !t || !t.trim() || (null === (e = window.$DD_ALLOW) || void 0 === e ? void 0 : e.has(t.toLocaleLowerCase())) || !1;
}
function oa(t, e) {
	return ra(t) ? t : e || ea(t);
}
function ia({ lifeCycle: t, isChildEvent: e, onChange: n = pt }) {
	const r = {
		errorCount: 0,
		longTaskCount: 0,
		resourceCount: 0,
		actionCount: 0,
		frustrationCount: 0
	}, o = t.subscribe(13, (t) => {
		var o;
		if ("view" !== t.type && "vital" !== t.type && e(t)) switch (t.type) {
			case Jo.ERROR:
				r.errorCount += 1, n();
				break;
			case Jo.ACTION:
				r.actionCount += 1, t.action.frustration && (r.frustrationCount += t.action.frustration.type.length), n();
				break;
			case Jo.LONG_TASK:
				r.longTaskCount += 1, n();
				break;
			case Jo.RESOURCE: !(null === (o = t._dd) || void 0 === o) && o.discarded || (r.resourceCount += 1, n());
		}
	});
	return {
		stop: () => {
			o.unsubscribe();
		},
		eventCounts: r
	};
}
function sa(t) {
	const e = jr({ expireDelay: 3e5 }), n = /* @__PURE__ */ new Map();
	function r(t) {
		var e;
		n.delete(t.key), null === (e = t.eventCounts) || void 0 === e || e.stop();
	}
	function o() {
		n.forEach((t) => {
			r(t);
		}), e.reset();
	}
	const i = t.subscribe(10, o);
	return {
		start: function(o, i, s, a) {
			const c = ht(), u = e.add(c, i.relative), l = n.get(o);
			l && r(l);
			const d = {
				id: c,
				key: o,
				startClocks: i,
				data: s,
				historyEntry: u,
				eventCounts: (null == a ? void 0 : a.isChildEvent) ? ia({
					lifeCycle: t,
					isChildEvent: a.isChildEvent(c)
				}) : void 0
			};
			return n.set(o, d), d;
		},
		stop: function(t, e, o) {
			var i;
			const s = n.get(t);
			if (!s) return;
			const a = o ? Jn(s.data, o) : s.data;
			s.historyEntry.close(e.relative);
			const c = at(s.startClocks.timeStamp, e.timeStamp), u = null === (i = s.eventCounts) || void 0 === i ? void 0 : i.eventCounts;
			return r(s), {
				...a,
				id: s.id,
				startClocks: s.startClocks,
				duration: c,
				counts: u
			};
		},
		discard: function(t) {
			var e;
			const o = n.get(t);
			if (!o) return;
			const i = null === (e = o.eventCounts) || void 0 === e ? void 0 : e.eventCounts;
			return r(o), o.historyEntry.remove(), {
				...o.data,
				id: o.id,
				startClocks: o.startClocks,
				counts: i
			};
		},
		getCounts: function(t) {
			var e, r;
			return null === (r = null === (e = n.get(t)) || void 0 === e ? void 0 : e.eventCounts) || void 0 === r ? void 0 : r.eventCounts;
		},
		findId: function(t) {
			return e.findAll(t);
		},
		stopAll: function() {
			i.unsubscribe(), o(), e.stop();
		}
	};
}
const aa = W;
function ca(t, e) {
	const n = [];
	let r, o = 0;
	function i(t) {
		t.stopObservable.subscribe(s), n.push(t), q(r), r = z(a, aa);
	}
	function s() {
		1 === o && n.every((t) => t.isStopped()) && (o = 2, e(n));
	}
	function a() {
		q(r), 0 === o && (o = 1, s());
	}
	return i(t), {
		tryAppend: (t) => {
			return 0 === o && (n.length > 0 && (e = n[n.length - 1].event, r = t.event, !(e.target === r.target && (s = e, c = r, Math.sqrt(Math.pow(s.clientX - c.clientX, 2) + Math.pow(s.clientY - c.clientY, 2)) <= 100) && e.timeStamp - r.timeStamp <= aa)) ? (a(), !1) : (i(t), !0));
			var e, r, s, c;
		},
		stop: () => {
			a();
		}
	};
}
function ua(t, e) {
	const n = function(t, e) {
		let n = t;
		for (; n;) {
			if (n.matches(e)) return n;
			n = _s(n);
		}
		return null;
	}(t, `[${e}]`);
	if (n) return ma(ha(n.getAttribute(e).trim()));
}
const la = [
	(t, e, n) => {
		if ("labels" in t && t.labels && t.labels.length > 0) return va(t.labels[0], e, n);
	},
	(t) => {
		if ("INPUT" === t.nodeName) {
			const e = t, n = e.getAttribute("type");
			if ("button" === n || "submit" === n || "reset" === n) return {
				name: e.value,
				nameSource: "text_content"
			};
		}
	},
	(t, e, n) => {
		if ("BUTTON" === t.nodeName || "LABEL" === t.nodeName || "button" === t.getAttribute("role")) return va(t, e, n);
	},
	(t, e, n) => ga(t, "aria-label", e, n),
	(t, e, n) => {
		const r = t.getAttribute("aria-labelledby");
		if (r) return {
			name: r.split(/\s+/).map((e) => function(t, e) {
				const n = t.getRootNode();
				if (n instanceof ShadowRoot) {
					const t = n.getElementById(e);
					if (t) return t;
				}
				return t.ownerDocument ? t.ownerDocument.getElementById(e) : null;
			}(t, e)).filter((t) => Boolean(t)).map((t) => ya(t, e, n)).join(" "),
			nameSource: "text_content"
		};
	},
	(t, e, n) => ga(t, "alt", e, n),
	(t, e, n) => ga(t, "name", e, n),
	(t, e, n) => ga(t, "title", e, n),
	(t, e, n) => ga(t, "placeholder", e, n),
	(t, e, n) => {
		if ("options" in t && t.options.length > 0) return va(t.options[0], e, n);
	}
], da = [(t, e, n) => va(t, e, n)], fa = 10;
function pa(t, e, n, r) {
	let o = t, i = 0;
	for (; i <= fa && o && "BODY" !== o.nodeName && "HTML" !== o.nodeName && "HEAD" !== o.nodeName;) {
		for (const t of e) {
			const e = t(o, n, r);
			if (e) {
				const { name: t, nameSource: n } = e, r = t && t.trim();
				if (r) return {
					name: ma(ha(r)),
					nameSource: n
				};
			}
		}
		if ("FORM" === o.nodeName) break;
		o = _s(o), i += 1;
	}
}
function ha(t) {
	return t.replace(/\s+/g, " ");
}
function ma(t) {
	return t.length > 100 ? `${vt(t, 100)} [...]` : t;
}
function ga(t, e, n, r) {
	const { enablePrivacyForActionName: o, defaultPrivacyLevel: i } = n;
	let s = t.getAttribute(e);
	if (s && o) {
		const o = Ys(t, i, r);
		Qs(t.tagName, e, s, o, n) && (s = oa(s, Is));
	} else s || (s = "");
	return {
		name: s,
		nameSource: "standard_attribute"
	};
}
function va(t, e, n) {
	return {
		name: ya(t, e, n) || "",
		nameSource: "text_content"
	};
}
function ya(t, e, n) {
	if (t.isContentEditable) return;
	const { enablePrivacyForActionName: r, actionNameAttribute: o, defaultPrivacyLevel: i } = e;
	if (je(qe.USE_TREE_WALKER_FOR_ACTION_NAME)) return function(t, e, n, r, o) {
		const i = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, a);
		let s = "";
		for (; i.nextNode();) {
			const t = i.currentNode;
			ps(t) ? ("BR" === t.nodeName || "P" === t.nodeName || [
				"block",
				"flex",
				"grid",
				"list-item",
				"table",
				"table-caption"
			].includes(getComputedStyle(t).display)) && (s += " ") : s += t.textContent || "";
		}
		return s.replace(/\s+/g, " ").trim();
		function a(t) {
			const i = Ys(t, r, o);
			if (n && i && Xs(t, i)) return NodeFilter.FILTER_REJECT;
			if (ps(t)) {
				if (t.hasAttribute("data-dd-action-name") || e && t.hasAttribute(e)) return NodeFilter.FILTER_REJECT;
				const n = getComputedStyle(t);
				if ("visible" !== n.visibility || "none" === n.display || n.contentVisibility && "visible" !== n.contentVisibility) return NodeFilter.FILTER_REJECT;
			}
			return NodeFilter.FILTER_ACCEPT;
		}
	}(t, o, r, i, n);
	if ("innerText" in t) {
		let e = t.innerText;
		const n = (n) => {
			const r = t.querySelectorAll(n);
			for (let t = 0; t < r.length; t += 1) {
				const n = r[t];
				if ("innerText" in n) {
					const t = n.innerText;
					t && t.trim().length > 0 && (e = e.replace(t, ""));
				}
			}
		};
		return n(`[${xs}]`), o && n(`[${o}]`), r && n(`${Ws(Bs.HIDDEN)}, ${Ws(Bs.MASK)}`), e;
	}
	return t.textContent;
}
function _a() {
	const t = window.getSelection();
	return !t || t.isCollapsed;
}
function ba(t) {
	return t.target instanceof Element && !1 !== t.isPrimary;
}
function wa(t, e) {
	if (function(t) {
		if (t.some((t) => t.getUserActivity().selection || t.getUserActivity().scroll)) return !1;
		for (let e = 0; e < t.length - 2; e += 1) if (t[e + 3 - 1].event.timeStamp - t[e].event.timeStamp <= 1e3) return !0;
		return !1;
	}(t)) return e.addFrustration(ni), t.some(Ea) && e.addFrustration(oi), e.hasError && e.addFrustration(ri), { isRage: !0 };
	const n = t.some((t) => t.getUserActivity().selection);
	return t.forEach((t) => {
		t.hasError && t.addFrustration(ri), Ea(t) && !n && t.addFrustration(oi);
	}), { isRage: !1 };
}
const Sa = "input:not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"button\"]):not([type=\"submit\"]):not([type=\"reset\"]):not([type=\"range\"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *";
function Ea(t) {
	if (t.hasPageActivity || t.getUserActivity().input || t.getUserActivity().scroll) return !1;
	let e = t.event.target;
	return "LABEL" === e.tagName && e.hasAttribute("for") && (e = document.getElementById(e.getAttribute("for"))), !e || !e.matches(Sa);
}
const ka = 1e4, Ta = /* @__PURE__ */ new Map();
function Aa(t, e) {
	Ta.set(t, e), Ta.forEach((t, e) => {
		at(e, ot()) > 1e4 && Ta.delete(e);
	});
}
function Ca(t) {
	return (e) => void 0 !== e.action && void 0 !== e.action.id && e.action.id.includes(t);
}
function Ra(t, e, n, r) {
	const o = sa(t), i = new G();
	let s;
	t.subscribe(5, u), t.subscribe(11, u);
	const { stop: a } = function(t, { onPointerDown: e, onPointerUp: n }) {
		let r, o, i = {
			selection: !1,
			input: !1,
			scroll: !1
		};
		const s = [
			Dn(t, window, "pointerdown", (t) => {
				ba(t) && (r = _a(), i = {
					selection: !1,
					input: !1,
					scroll: !1
				}, o = e(t));
			}, { capture: !0 }),
			Dn(t, window, "selectionchange", () => {
				r && _a() || (i.selection = !0);
			}, { capture: !0 }),
			Dn(t, window, "scroll", () => {
				i.scroll = !0;
			}, {
				capture: !0,
				passive: !0
			}),
			Dn(t, window, "pointerup", (t) => {
				if (ba(t) && o) {
					const e = i;
					n(o, t, () => e), o = void 0;
				}
			}, { capture: !0 }),
			Dn(t, window, "input", () => {
				i.input = !0;
			}, { capture: !0 })
		];
		return { stop: () => {
			s.forEach((t) => t.stop());
		} };
	}(r, {
		onPointerDown: (o) => function(t, e, n, r, o) {
			const i = t.betaTrackActionsInShadowDom ? xa(r) : r.target;
			let s;
			s = t.enablePrivacyForActionName ? Ys(i, t.defaultPrivacyLevel) : Bs.ALLOW;
			if (s === Bs.HIDDEN) return;
			const a = function(t, e, n) {
				const r = n.betaTrackActionsInShadowDom ? xa(t) : t.target, o = r.getBoundingClientRect(), i = Ps(r, n.actionNameAttribute);
				i && Aa(t.timeStamp, i);
				const { name: s, nameSource: a } = function(t, e, n = Bs.ALLOW) {
					const r = /* @__PURE__ */ new Map(), { actionNameAttribute: o } = e, i = ua(t, "data-dd-action-name") || o && ua(t, o);
					return i ? {
						name: i,
						nameSource: "custom_attribute"
					} : n === Bs.MASK ? {
						name: Is,
						nameSource: "mask_placeholder"
					} : pa(t, la, e, r) || pa(t, da, e, r) || {
						name: "",
						nameSource: "blank"
					};
				}(r, n, e);
				return {
					type: ei.CLICK,
					target: {
						width: Math.round(o.width),
						height: Math.round(o.height),
						selector: i
					},
					position: {
						x: Math.round(t.clientX - o.left),
						y: Math.round(t.clientY - o.top)
					},
					name: s,
					nameSource: a
				};
			}(r, s, t);
			let c = !1;
			return Ts(e, n, o, t, (t) => {
				c = t.hadActivity;
			}, 100), {
				clickActionBase: a,
				hadActivityOnPointerDown: () => c
			};
		}(r, t, e, o, n),
		onPointerUp: ({ clickActionBase: s, hadActivityOnPointerDown: a }, u, l) => {
			(function(t, e, n, r, o, i, s, a, c, u, l) {
				var d;
				const f = Ia(e, o, u, a, c);
				s(f);
				const p = null === (d = null == a ? void 0 : a.target) || void 0 === d ? void 0 : d.selector;
				p && Aa(c.timeStamp, p);
				const { stop: h } = Ts(e, n, r, t, (t) => {
					t.hadActivity && t.end < f.startClocks.timeStamp ? f.discard() : t.hadActivity ? f.stop(t.end) : l() ? f.stop(f.startClocks.timeStamp) : f.stop();
				}, ka), m = e.subscribe(5, ({ endClocks: t }) => {
					f.stop(t.timeStamp);
				}), g = e.subscribe(11, () => {
					f.stop(rt());
				}), v = i.subscribe(() => {
					f.stop();
				});
				f.stopObservable.subscribe(() => {
					g.unsubscribe(), m.unsubscribe(), h(), v.unsubscribe();
				});
			})(r, t, e, n, o, i, c, s, u, l, a);
		}
	});
	return {
		stop: () => {
			u(), i.notify(), a(), o.stopAll();
		},
		findActionId: o.findId
	};
	function c(t) {
		if (!s || !s.tryAppend(t)) {
			const e = t.clone();
			s = ca(t, (t) => {
				(function(t, e) {
					const { isRage: n } = wa(t, e);
					n ? (t.forEach((t) => t.discard()), e.stop(rt()), e.validate(t.map((t) => t.event))) : (e.discard(), t.forEach((t) => t.validate()));
				})(t, e), s = void 0;
			});
		}
	}
	function u() {
		s && s.stop();
	}
}
function xa(t) {
	if (t.composed && hs(t.target) && "function" == typeof t.composedPath) {
		const e = t.composedPath();
		if (e.length > 0 && e[0] instanceof Element) return e[0];
	}
	return t.target;
}
function Ia(t, e, n, r, o) {
	const i = ht(), s = Z(o.timeStamp), a = e.start(i, s, r, { isChildEvent: Ca });
	t.notify(15, a);
	let c, u = 0;
	const l = [], d = new G();
	function f(t) {
		0 === u && (u = 1, c = t ? e.stop(i, X(t)) : e.discard(i), d.notify());
	}
	return {
		event: o,
		stop: f,
		stopObservable: d,
		get hasError() {
			var t;
			const n = null !== (t = null == c ? void 0 : c.counts) && void 0 !== t ? t : e.getCounts(i);
			return !!n && n.errorCount > 0;
		},
		get hasPageActivity() {
			return c && "duration" in c;
		},
		getUserActivity: n,
		addFrustration: (t) => {
			l.push(t);
		},
		get startClocks() {
			return s;
		},
		isStopped: () => 1 === u || 2 === u,
		clone: () => Ia(t, e, n, r, o),
		validate: (e) => {
			if (f(), 1 !== u) return;
			if (!c) return;
			const n = {
				frustrationTypes: l,
				events: null != e ? e : [o],
				event: o,
				...c,
				counts: c.counts
			};
			t.notify(0, n), u = 2;
		},
		discard: () => {
			f(), u = 2;
		}
	};
}
function Oa(t, e, n, r, o) {
	const { unsubscribe: i } = t.subscribe(0, (e) => {
		t.notify(12, Na(e));
	}), s = pt;
	let a;
	o.trackUserInteractions && (a = Ra(t, n, r, o));
	const c = function(t, e) {
		const n = sa(t);
		return {
			addAction: function(t) {
				e({
					id: ht(),
					frustrationTypes: [],
					...t
				});
			},
			startAction: function(e, r = {}, o = it()) {
				var i;
				const s = null !== (i = r.actionKey) && void 0 !== i ? i : e, a = n.start(s, o, {
					name: e,
					...r
				}, { isChildEvent: Ca });
				t.notify(15, a);
			},
			stopAction: function(t, r = {}, o = it()) {
				var i;
				const s = null !== (i = r.actionKey) && void 0 !== i ? i : t, a = n.stop(s, o, r);
				if (!a) return;
				const c = [];
				a.counts && a.counts.errorCount > 0 && c.push(ri), e({
					...a,
					type: a.type || ei.CUSTOM,
					frustrationTypes: c
				});
			},
			findActionId: n.findId,
			stop: n.stopAll
		};
	}(t, (e) => {
		t.notify(12, Na(e));
	}), u = { findActionId: (t) => {
		var e;
		const n = c.findActionId(t), r = null !== (e = null == a ? void 0 : a.findActionId(t)) && void 0 !== e ? e : [];
		return n.concat(r);
	} };
	return e.register(0, ({ startTime: t, eventType: e }) => {
		if (e !== Jo.ERROR && e !== Jo.RESOURCE && e !== Jo.LONG_TASK) return kr;
		const n = e === Jo.LONG_TASK ? ct(t, 1) : t, r = u.findActionId(n);
		return r.length ? {
			type: e,
			action: { id: r }
		} : kr;
	}), e.register(1, ({ startTime: t }) => ({ action: { id: u.findActionId(t) } })), {
		addAction: c.addAction,
		startAction: c.startAction,
		stopAction: c.stopAction,
		actionContexts: u,
		stop: () => {
			i(), s(), c.stop(), null == a || a.stop();
		}
	};
}
function Na(t) {
	const e = function(t) {
		return "events" in t;
	}(t), n = ds(et(t.duration));
	return {
		rawRumEvent: {
			type: Jo.ACTION,
			date: t.startClocks.timeStamp,
			action: {
				id: t.id,
				target: { name: t.name },
				type: t.type,
				...void 0 !== n && { loading_time: n },
				...t.counts && {
					error: { count: t.counts.errorCount },
					long_task: { count: t.counts.longTaskCount },
					resource: { count: t.counts.resourceCount }
				},
				frustration: { type: t.frustrationTypes }
			},
			...e ? { _dd: { action: {
				target: t.target,
				position: t.position,
				name_source: t.nameSource
			} } } : { context: t.context }
		},
		duration: t.duration,
		startClocks: t.startClocks,
		domainContext: e ? { events: t.events } : { handlingStack: t.handlingStack }
	};
}
function La(t, e, n) {
	const r = new G();
	return n.subscribe((t) => {
		0 === t.type && r.notify(t.error);
	}), function(t) {
		_o([f.error]).subscribe((e) => t.notify(e.error));
	}(r), function(t, e) {
		qn(t, [zn, Vn]).subscribe((t) => e.notify(t));
	}(e, r), r.subscribe((e) => t.notify(14, { error: e })), function(t) {
		return t.subscribe(14, ({ error: e }) => {
			t.notify(12, function(t) {
				const e = {
					date: t.startClocks.timeStamp,
					error: {
						id: ht(),
						message: t.message,
						source: t.source,
						stack: t.stack,
						handling_stack: t.handlingStack,
						component_stack: t.componentStack,
						type: t.type,
						handling: t.handling,
						causes: t.causes,
						source_type: "browser",
						fingerprint: t.fingerprint,
						csp: t.csp
					},
					type: Jo.ERROR,
					context: t.context
				}, n = {
					error: t.originalError,
					handlingStack: t.handlingStack
				};
				return {
					rawRumEvent: e,
					startClocks: t.startClocks,
					domainContext: n
				};
			}(e));
		}), { addError: ({ error: e, handlingStack: n, componentStack: r, startClocks: o, context: i }) => {
			const s = kn({
				originalError: e,
				handlingStack: n,
				componentStack: r,
				startClocks: o,
				nonErrorPrefix: "Provided",
				source: Nn,
				handling: "handled"
			});
			s.context = Jn(s.context, i), t.notify(14, { error: s });
		} };
	}(t);
}
const Pa = /* @__PURE__ */ new WeakSet();
function Ma(t) {
	if (!performance || !("getEntriesByName" in performance)) return;
	const e = performance.getEntriesByName(t.url, "resource");
	if (!e.length || !("toJSON" in e[0])) return;
	const n = e.filter((t) => !Pa.has(t)).filter((t) => ji(t) && Gi(t)).filter((e) => function(t, e, n) {
		const r = 1;
		return t.startTime >= e - r && Ua(t) <= ct(n, r);
	}(e, t.startClocks.relative, Ua({
		startTime: t.startClocks.relative,
		duration: t.duration
	})));
	return 1 === n.length ? (Pa.add(n[0]), n[0].toJSON()) : void 0;
}
function Ua(t) {
	return ct(t.startTime, t.duration);
}
function Da(t) {
	const e = function(t) {
		const e = t.querySelector("meta[name=dd-trace-id]"), n = t.querySelector("meta[name=dd-trace-time]");
		return $a(e && e.content, n && n.content);
	}(t) || function(t) {
		const e = function(t) {
			for (let e = 0; e < t.childNodes.length; e += 1) {
				const n = Va(t.childNodes[e]);
				if (n) return n;
			}
			if (t.body) for (let e = t.body.childNodes.length - 1; e >= 0; e -= 1) {
				const n = t.body.childNodes[e], r = Va(n);
				if (r) return r;
				if (!fs(n)) break;
			}
		}(t);
		if (!e) return;
		return $a(gt(e, "trace-id"), gt(e, "trace-time"));
	}(t);
	if (e && !(e.traceTime <= nt() - 12e4)) return e.traceId;
}
function $a(t, e) {
	const n = e && Number(e);
	if (t && n) return {
		traceId: t,
		traceTime: n
	};
}
function Va(t) {
	if (t && function(t) {
		return t.nodeType === Node.COMMENT_NODE;
	}(t)) {
		const e = /^\s*DATADOG;(.*?)\s*$/.exec(t.data);
		if (e) return e[1];
	}
}
function za() {
	if (ks(ws.NAVIGATION)) {
		const t = performance.getEntriesByType(ws.NAVIGATION)[0];
		if (t) return t;
	}
	const t = function() {
		const t = {}, e = performance.timing;
		for (const n in e) if (E(e[n])) {
			const r = n, o = e[r];
			t[r] = 0 === o ? 0 : ut(o);
		}
		return t;
	}(), e = {
		entryType: ws.NAVIGATION,
		initiatorType: "navigation",
		name: window.location.href,
		startTime: 0,
		duration: t.loadEventEnd,
		decodedBodySize: 0,
		encodedBodySize: 0,
		transferSize: 0,
		workerStart: 0,
		toJSON: () => ({
			...e,
			toJSON: void 0
		}),
		...t
	};
	return e;
}
function qa(t) {
	return t.responseStart >= 0 && t.responseStart <= ot() ? t.responseStart : void 0;
}
function Fa(t, e) {
	const n = function() {
		if (ks(ws.RESOURCE)) return performance.getEntriesByType(ws.RESOURCE);
	}();
	if (n) return Lt(n, (n) => n.name === t && n.startTime <= e);
}
function Ba(t, e) {
	io(t, "interactive", () => {
		const t = za(), n = Object.assign(t.toJSON(), {
			entryType: ws.RESOURCE,
			initiatorType: $i,
			duration: t.responseEnd,
			traceId: Da(document),
			toJSON: () => ({
				...n,
				toJSON: void 0
			})
		});
		e(n);
	});
}
function ja(t, e, n) {
	const r = vo();
	let o;
	const i = e.trackEarlyRequests;
	i ? o = function(t) {
		const e = /* @__PURE__ */ new Set();
		let n = !1;
		const r = t.subscribe(8, (t) => {
			if (e.add(t), e.size > 1e3) {
				const t = e.values().next().value;
				if (!n) {
					let r;
					if (n = !0, je(qe.TOO_MANY_REQUESTS_INVESTIGATION)) {
						let n = 0, o = 0, i = 0, s = 0;
						for (const t of e) t.isAborted && n++, t.isAbortedOnStart && o++, t.type === Wo.XHR && i++, performance.getEntriesByName(t.url, "resource").some((e) => e.startTime >= t.startClocks.relative) || s++;
						const a = rt() - t.startClocks.timeStamp;
						r = {
							abortedCount: n,
							abortedOnStartCount: o,
							xhrCount: i,
							fetchCount: e.size - i,
							oldestRequestAge: a,
							oldestRequestEndAge: a - t.duration,
							withoutMatchingEntryCount: s
						};
					}
					Lr("Too many requests", r);
				}
				e.delete(t);
			}
		});
		return {
			getMatchingRequest(t) {
				let n, r = Infinity;
				for (const o of e) {
					const e = t.startTime - o.startClocks.relative;
					0 <= e && e < r && o.url === t.name && (r = Math.abs(e), n = o);
				}
				return n && e.delete(n), n;
			},
			stop() {
				r.unsubscribe();
			}
		};
	}(t) : t.subscribe(8, (t) => {
		a(() => function(t, e, n) {
			return Ka(Ma(t), t, n, e);
		}(t, e, n));
	});
	const s = Ss(e, {
		type: ws.RESOURCE,
		buffered: !0
	}).subscribe((t) => {
		for (const r of t) !i && Fi(r) || a(() => Ga(r, e, n, o));
	});
	function a(e) {
		r.push(() => {
			const n = e();
			n && t.notify(12, n);
		});
	}
	Ba(e, (t) => {
		a(() => Ga(t, e, n, o));
	});
	const c = sa(t), u = function(t, e) {
		return {
			startResource: function(t, n = {}, r = it()) {
				var o;
				const i = null !== (o = n.resourceKey) && void 0 !== o ? o : t;
				e.start(i, r, {
					url: t,
					...n
				});
			},
			stopResource: function(n, r = {}, o = it()) {
				var i;
				const s = null !== (i = r.resourceKey) && void 0 !== i ? i : n, a = e.stop(s, o, {
					context: r.context,
					type: r.type
				});
				if (!a) return;
				const c = at(a.startClocks.relative, o.relative), u = {
					date: a.startClocks.timeStamp,
					type: Jo.RESOURCE,
					resource: {
						id: a.id,
						type: a.type || Ho,
						url: Xi(a.url),
						duration: et(c),
						method: a.method,
						status_code: r.statusCode,
						size: r.size
					},
					_dd: {},
					context: a.context
				};
				t.notify(12, {
					rawRumEvent: u,
					startClocks: a.startClocks,
					duration: c,
					domainContext: { isManual: !0 }
				});
			}
		};
	}(t, c);
	return {
		startResource: u.startResource,
		stopResource: u.stopResource,
		stop: () => {
			r.stop(), s.unsubscribe(), c.stopAll();
		}
	};
}
function Ga(t, e, n, r) {
	return Ka(t, Fi(t) && r ? r.getMatchingRequest(t) : void 0, n, e);
}
function Ka(t, e, n, r) {
	if (!t && !e) return;
	const o = e ? function(t, e) {
		if (!(t.traceSampled && t.traceId && t.spanId)) return;
		return { _dd: {
			span_id: t.spanId.toString(),
			trace_id: t.traceId.toString(),
			rule_psr: e.rulePsr
		} };
	}(e, r) : function(t, e) {
		if (!t.traceId) return;
		return { _dd: {
			trace_id: t.traceId,
			span_id: es().toString(),
			rule_psr: e.rulePsr
		} };
	}(t, r);
	if (!r.trackResources && !o) return;
	const i = t ? Z(t.startTime) : e.startClocks, s = t ? function(t) {
		const { duration: e, startTime: n, responseEnd: r } = t;
		return 0 === e && n < r ? at(n, r) : e;
	}(t) : function(t, e, n) {
		return t.wasInPageStateDuringPeriod("frozen", e.relative, n) ? void 0 : n;
	}(n, i, e.duration), a = e && function(t, e) {
		const n = as(t.url, e);
		if (!n) return;
		return ss(t, n);
	}(e, r), c = t && function(t) {
		const e = t.contentType;
		if (e) return { headers: { "content-type": e } };
	}(t);
	return {
		startClocks: i,
		duration: s,
		rawRumEvent: Jn({
			date: i.timeStamp,
			resource: {
				id: ht(),
				duration: et(s),
				type: e ? e.type === Wo.XHR ? Vo : qo : zi(t),
				method: e ? e.method : void 0,
				status_code: e ? e.status : (u = t.responseStatus, 0 === u ? void 0 : u),
				url: e ? Xi(e.url) : t.name,
				protocol: t && Hi(t),
				delivery_type: t && Wi(t),
				graphql: a,
				response: c
			},
			type: Jo.RESOURCE,
			_dd: { discarded: !r.trackResources }
		}, o, t && Wa(t)),
		domainContext: Ha(t, e)
	};
	var u;
}
function Ha(t, e) {
	if (e) {
		const n = {
			performanceEntry: t,
			isAborted: e.isAborted,
			handlingStack: e.handlingStack
		};
		return e.type === Wo.XHR ? {
			xhr: e.xhr,
			...n
		} : {
			requestInput: e.input,
			requestInit: e.init,
			response: e.response,
			error: e.error,
			...n
		};
	}
	return { performanceEntry: t };
}
function Wa(t) {
	const { renderBlockingStatus: e } = t;
	return { resource: {
		render_blocking_status: e,
		...Yi(t),
		...Bi(t)
	} };
}
function Ya(t, e) {
	return function(t, e) {
		let n;
		const { stop: r } = io(t, "complete", () => {
			n = z(() => e());
		});
		return { stop: () => {
			r(), q(n);
		} };
	}(t, () => {
		const t = za();
		(function(t) {
			return t.loadEventEnd <= 0;
		})(t) || e(function(t) {
			return {
				domComplete: t.domComplete,
				domContentLoaded: t.domContentLoadedEventEnd,
				domInteractive: t.domInteractive,
				loadEvent: t.loadEventEnd,
				firstByte: qa(t)
			};
		}(t));
	});
}
function Ja(t, e, n, r) {
	let o = Infinity;
	const { stop: i } = $n(t, n, ["pointerdown", "keydown"], (t) => {
		o = t.timeStamp;
	}, {
		capture: !0,
		once: !0
	});
	let s = 0;
	const a = Ss(t, {
		type: ws.LARGEST_CONTENTFUL_PAINT,
		buffered: !0
	}).subscribe((n) => {
		const i = Lt(n, (t) => t.entryType === ws.LARGEST_CONTENTFUL_PAINT && t.startTime < o && t.startTime < e.timeStamp && t.startTime < 6e5 && t.size > s);
		if (i) {
			let e;
			i.element && (e = Ps(i.element, t.actionNameAttribute));
			const n = "" === (a = i).url ? void 0 : a.url, o = i.startTime, c = je(qe.LCP_SUBPARTS) ? function(t, e) {
				const n = qa(za());
				if (void 0 === n) return;
				const r = t ? Fa(t, e) : void 0, o = r ? Math.max(n, r.requestStart || r.startTime) : n, i = Math.min(e, Math.max(o, (null == r ? void 0 : r.responseEnd) || 0));
				return {
					loadDelay: o - n,
					loadTime: i - o,
					renderDelay: e - i
				};
			}(n, o) : void 0;
			r({
				value: o,
				targetSelector: e,
				resourceUrl: n,
				subParts: c
			}), s = i.size;
		}
		var a;
	});
	return { stop: () => {
		i(), a.unsubscribe();
	} };
}
function Za(t, e, n = window) {
	if ("hidden" === document.visibilityState) return {
		timeStamp: 0,
		stop: pt
	};
	if (ks(ws.VISIBILITY_STATE)) {
		const t = performance.getEntriesByType(ws.VISIBILITY_STATE).filter((t) => "hidden" === t.name).find((t) => t.startTime >= e.relative);
		if (t) return {
			timeStamp: t.startTime,
			stop: pt
		};
	}
	let r = Infinity;
	const { stop: o } = $n(t, n, ["pagehide", "visibilitychange"], (t) => {
		"pagehide" !== t.type && "hidden" !== document.visibilityState || (r = t.timeStamp, o());
	}, { capture: !0 });
	return {
		get timeStamp() {
			return r;
		},
		stop: o
	};
}
function Xa(t, e, n, r) {
	const o = {}, { stop: i } = Ya(t, (t) => {
		n(t.loadEvent), o.navigationTimings = t, r();
	}), s = Za(t, e), { stop: a } = function(t, e, n) {
		return { stop: Ss(t, {
			type: ws.PAINT,
			buffered: !0
		}).subscribe((t) => {
			const r = t.find((t) => "first-contentful-paint" === t.name && t.startTime < e.timeStamp && t.startTime < 6e5);
			r && n(r.startTime);
		}).unsubscribe };
	}(t, s, (t) => {
		o.firstContentfulPaint = t, r();
	}), { stop: c } = Ja(t, s, window, (t) => {
		o.largestContentfulPaint = t, r();
	}), { stop: u } = function(t, e, n) {
		const r = Ss(t, {
			type: ws.FIRST_INPUT,
			buffered: !0
		}).subscribe((r) => {
			const o = r.find((t) => t.startTime < e.timeStamp);
			if (o) {
				const e = at(o.startTime, o.processingStart);
				let r;
				o.target && ps(o.target) && (r = Ps(o.target, t.actionNameAttribute)), n({
					delay: e >= 0 ? e : 0,
					time: o.startTime,
					targetSelector: r
				});
			}
		});
		return { stop: () => {
			r.unsubscribe();
		} };
	}(t, s, (t) => {
		o.firstInput = t, r();
	});
	return {
		stop: function() {
			i(), a(), c(), u(), s.stop();
		},
		initialViewMetrics: o
	};
}
const Qa = (t, e) => t * e, tc = (t) => Qa(t.previousRect.width, t.previousRect.height) + Qa(t.currentRect.width, t.currentRect.height) - ((t, e) => {
	const n = Math.max(t.left, e.left), r = Math.max(t.top, e.top), o = Math.min(t.right, e.right), i = Math.min(t.bottom, e.bottom);
	return n >= o || r >= i ? 0 : Qa(o - n, i - r);
})(t.previousRect, t.currentRect);
function ec(t, e, n) {
	if (!ks(ws.LAYOUT_SHIFT) || !("WeakRef" in window)) return { stop: pt };
	let r, o = 0;
	n({ value: 0 });
	const i = function() {
		let t, e, n = 0, r = 0;
		return { update: (o) => {
			let i;
			return void 0 === t || o.startTime - e >= ic || o.startTime - t >= oc ? (t = e = o.startTime, r = n = o.value, i = !0) : (n += o.value, e = o.startTime, i = o.value > r, i && (r = o.value)), {
				cumulatedValue: n,
				isMaxValue: i
			};
		} };
	}(), s = Ss(t, {
		type: ws.LAYOUT_SHIFT,
		buffered: !0
	}).subscribe((s) => {
		var a;
		for (const c of s) {
			if (c.hadRecentInput || c.startTime < e) continue;
			const { cumulatedValue: s, isMaxValue: u } = i.update(c);
			if (u) {
				const t = nc(c.sources);
				r = {
					target: (null == t ? void 0 : t.node) ? new WeakRef(t.node) : void 0,
					time: at(e, c.startTime),
					previousRect: null == t ? void 0 : t.previousRect,
					currentRect: null == t ? void 0 : t.currentRect,
					devicePixelRatio: window.devicePixelRatio
				};
			}
			if (s > o) {
				o = s;
				const e = null === (a = null == r ? void 0 : r.target) || void 0 === a ? void 0 : a.deref();
				n({
					value: S(o, 4),
					targetSelector: e && Ps(e, t.actionNameAttribute),
					time: null == r ? void 0 : r.time,
					previousRect: (null == r ? void 0 : r.previousRect) ? rc(r.previousRect) : void 0,
					currentRect: (null == r ? void 0 : r.currentRect) ? rc(r.currentRect) : void 0,
					devicePixelRatio: null == r ? void 0 : r.devicePixelRatio
				});
			}
		}
	});
	return { stop: () => {
		s.unsubscribe();
	} };
}
function nc(t) {
	let e;
	for (const n of t) if (n.node && ps(n.node)) {
		const t = tc(n);
		(!e || tc(e) < t) && (e = n);
	}
	return e;
}
function rc({ x: t, y: e, width: n, height: r }) {
	return {
		x: t,
		y: e,
		width: n,
		height: r
	};
}
const oc = 5e3, ic = W;
let sc, ac = 0, cc = Infinity, uc = 0;
const lc = () => sc ? ac : window.performance.interactionCount || 0;
function dc(t, e, n) {
	if (!(ks(ws.EVENT) && window.PerformanceEventTiming && "interactionId" in PerformanceEventTiming.prototype)) return {
		getInteractionToNextPaint: () => {},
		setViewEnd: pt,
		stop: pt
	};
	let r, o = Infinity;
	const { getViewInteractionCount: i, stopViewInteractionCount: s } = function(t) {
		"interactionCount" in performance || sc || (sc = new window.PerformanceObserver(U((t) => {
			t.getEntries().forEach((t) => {
				const e = t;
				e.interactionId && (cc = Math.min(cc, e.interactionId), uc = Math.max(uc, e.interactionId), ac = (uc - cc) / 7 + 1);
			});
		})), sc.observe({
			type: "event",
			buffered: !0,
			durationThreshold: 0
		}));
		const e = t === Xo ? 0 : lc();
		let n = { stopped: !1 };
		function r() {
			return lc() - e;
		}
		return {
			getViewInteractionCount: () => n.stopped ? n.interactionCount : r(),
			stopViewInteractionCount: () => {
				n = {
					stopped: !0,
					interactionCount: r()
				};
			}
		};
	}(n), a = function(t) {
		const e = [];
		function n() {
			e.sort((t, e) => e.duration - t.duration).splice(10);
		}
		return {
			process(t) {
				const r = e.findIndex((e) => t.interactionId === e.interactionId), o = e[e.length - 1];
				-1 !== r ? t.duration > e[r].duration && (e[r] = t, n()) : (e.length < 10 || t.duration > o.duration) && (e.push(t), n());
			},
			estimateP98Interaction() {
				const n = Math.min(e.length - 1, Math.floor(t() / 50));
				return e[n];
			},
			isTracked: (t) => e.some((e) => e.interactionId === t)
		};
	}(i), c = je(qe.INP_SUBPARTS) ? function(t) {
		const e = /* @__PURE__ */ new Map();
		function n(t, e) {
			t.startTime = Math.min(e.startTime, t.startTime), t.processingStart = Math.min(e.processingStart, t.processingStart), t.processingEnd = Math.max(e.processingEnd, t.processingEnd);
		}
		return {
			process(t) {
				if (void 0 === t.interactionId || !t.processingStart || !t.processingEnd) return;
				const r = t.startTime + t.duration, o = e.get(t.interactionId);
				if (o) n(o, t);
				else {
					for (const [, o] of e.entries()) if (Math.abs(r - o.referenceRenderTime) <= 8) return n(o, t), void e.set(t.interactionId, o);
					e.set(t.interactionId, {
						startTime: t.startTime,
						processingStart: t.processingStart,
						processingEnd: t.processingEnd,
						referenceRenderTime: r
					});
				}
			},
			pruneUntracked() {
				for (const [n] of e) t.isTracked(n) || e.delete(n);
			},
			computeSubParts(t, n) {
				if (!t.processingStart || !t.processingEnd || void 0 === t.interactionId) return;
				const r = e.get(t.interactionId);
				if (!r) return;
				const o = Math.max(r.startTime + n, r.processingStart), i = Math.min(r.processingEnd, o);
				return {
					inputDelay: at(r.startTime, r.processingStart),
					processingDuration: at(r.processingStart, i),
					presentationDelay: at(i, o)
				};
			},
			stop() {
				e.clear();
			}
		};
	}(a) : null, u = Ss(t, {
		type: ws.FIRST_INPUT,
		buffered: !0
	}).subscribe(d), l = Ss(t, {
		type: ws.EVENT,
		durationThreshold: 40,
		buffered: !0
	}).subscribe(d);
	function d(n) {
		for (const t of n) t.interactionId && t.startTime >= e && t.startTime <= o && (a.process(t), null == c || c.process(t));
		null == c || c.pruneUntracked();
		const i = a.estimateP98Interaction();
		i && function(n) {
			const o = at(e, n.startTime);
			if (!r || n.duration !== r.duration || o !== r.startTime) {
				let e = function(t) {
					const e = Ta.get(t);
					return Ta.delete(t), e;
				}(n.startTime);
				!e && n.target && ps(n.target) && (e = Ps(n.target, t.actionNameAttribute)), r = {
					duration: n.duration,
					startTime: o,
					targetSelector: e
				};
			}
			c && (r.subParts = c.computeSubParts(n, fc(r.duration)));
		}(i);
	}
	return {
		getInteractionToNextPaint: () => r ? {
			value: fc(r.duration),
			targetSelector: r.targetSelector,
			time: r.startTime,
			subParts: r.subParts
		} : i() ? { value: 0 } : void 0,
		setViewEnd: (t) => {
			o = t, s();
		},
		stop: () => {
			l.unsubscribe(), u.unsubscribe(), null == c || c.stop();
		}
	};
}
function fc(t) {
	return Math.min(t, 6e4);
}
function pc() {
	let t;
	const e = window.visualViewport;
	return t = e ? e.pageLeft - e.offsetLeft : void 0 !== window.scrollX ? window.scrollX : window.pageXOffset || 0, Math.round(t);
}
function hc() {
	let t;
	const e = window.visualViewport;
	return t = e ? e.pageTop - e.offsetTop : void 0 !== window.scrollY ? window.scrollY : window.pageYOffset || 0, Math.round(t);
}
let mc;
function gc(t) {
	return mc || (mc = function(t) {
		return new G((e) => {
			const { throttled: n } = ft(() => {
				e.notify(vc());
			}, 200);
			return Dn(t, window, "resize", n, {
				capture: !0,
				passive: !0
			}).stop;
		});
	}(t)), mc;
}
function vc() {
	const t = window.visualViewport;
	return t ? {
		width: Number(t.width * t.scale),
		height: Number(t.height * t.scale)
	} : {
		width: Number(window.innerWidth || 0),
		height: Number(window.innerHeight || 0)
	};
}
function yc(t, e, n, r = function(t, e = 1e3) {
	return new G((n) => {
		function r() {
			n.notify(function() {
				const t = hc(), { height: e } = vc();
				return {
					scrollHeight: Math.round((document.scrollingElement || document.documentElement).scrollHeight),
					scrollDepth: Math.round(e + t),
					scrollTop: t
				};
			}());
		}
		if (window.ResizeObserver) {
			const n = ft(r, e, {
				leading: !1,
				trailing: !0
			}), o = document.scrollingElement || document.documentElement, i = new ResizeObserver(U(n.throttled));
			o && i.observe(o);
			const s = Dn(t, window, "scroll", n.throttled, { passive: !0 });
			return () => {
				n.cancel(), i.disconnect(), s.stop();
			};
		}
	});
}(t)) {
	let o = 0, i = 0, s = 0;
	const a = r.subscribe(({ scrollDepth: t, scrollTop: r, scrollHeight: a }) => {
		let c = !1;
		if (t > o && (o = t, c = !0), a > i) {
			i = a;
			const t = ot();
			s = at(e.relative, t), c = !0;
		}
		c && n({
			maxDepth: Math.min(o, i),
			maxDepthScrollTop: r,
			maxScrollHeight: i,
			maxScrollHeightTime: s
		});
	});
	return { stop: () => a.unsubscribe() };
}
function _c(t, e, n, r, o, i, s) {
	const a = {};
	let c = !1, u = !1;
	const { stop: l, setLoadEvent: d } = function(t, e, n, r, o, i, s) {
		let a = o === Xo, c = !0;
		const u = [], l = Za(r, i);
		function d() {
			if (!c && !a && u.length > 0) {
				const t = Math.max(...u);
				t < l.timeStamp - i.relative && s(t);
			}
		}
		const { stop: f } = Ts(t, e, n, r, (t) => {
			c && (c = !1, t.hadActivity && u.push(at(i.timeStamp, t.end)), d());
		});
		return {
			stop: () => {
				f(), l.stop();
			},
			setLoadEvent: (t) => {
				a && (a = !1, u.push(t), d());
			}
		};
	}(t, e, n, r, i, s, (t) => {
		c || (a.loadingTime = t, o());
	}), { stop: f } = yc(r, s, (t) => {
		a.scroll = t;
	}), { stop: p } = ec(r, s.relative, (t) => {
		a.cumulativeLayoutShift = t, o();
	}), { stop: h, getInteractionToNextPaint: m, setViewEnd: g } = dc(r, s.relative, i);
	return {
		stop: () => {
			l(), p(), f();
		},
		stopINPTracking: h,
		setLoadEvent: d,
		setViewEnd: (t) => {
			u = !0, g(t);
		},
		getCommonViewMetrics: () => (a.interactionToNextPaint = m(), a),
		setLoadingTime: (t) => {
			if (u) return;
			const e = at(s.timeStamp, null != t ? t : rt());
			c || l(), c = !0, a.loadingTime = e, o();
		}
	};
}
function bc(t, e, n) {
	var r = t.relative, o = (t) => {
		e.firstContentfulPaint = t, e.largestContentfulPaint = { value: t }, n();
	};
	requestAnimationFrame(() => {
		requestAnimationFrame(() => {
			o(at(r, ot()));
		});
	});
}
const wc = 3e5, Sc = 3e5;
function Ec(t, e, n, r, o, i, s) {
	const a = /* @__PURE__ */ new Set();
	let c, u, l = d(Xo, st(), s);
	function d(o, i, s) {
		const c = function(t, e, n, r, o, i = it(), s) {
			const a = ht(), c = new G(), u = {};
			let l, d = 0;
			const f = T(window.location), p = So();
			let h = !0, m = null == s ? void 0 : s.name;
			const v = (null == s ? void 0 : s.service) || r.service, y = (null == s ? void 0 : s.version) || r.version, _ = null == s ? void 0 : s.context, b = null == s ? void 0 : s.handlingStack;
			_ && p.setContext(_);
			const w = {
				id: a,
				name: m,
				startClocks: i,
				service: v,
				version: y,
				context: _,
				url: null == s ? void 0 : s.url
			};
			t.notify(1, w), t.notify(2, w);
			const { throttled: S, cancel: E } = ft(V, 3e3, { leading: !1 }), { setLoadEvent: k, setViewEnd: A, stop: C, stopINPTracking: R, getCommonViewMetrics: x, setLoadingTime: I } = _c(t, e, n, r, $, o, i), { stop: O, initialViewMetrics: N } = o === Xo ? Xa(r, i, k, $) : {
				stop: pt,
				initialViewMetrics: {}
			};
			o === ti && bc(i, N, $);
			const { stop: L, eventCounts: P } = function(t, e, n) {
				const { stop: r, eventCounts: o } = ia({
					lifeCycle: t,
					isChildEvent: (t) => t.view.id === e,
					onChange: n
				});
				return {
					stop: r,
					eventCounts: o
				};
			}(t, a, $), M = F(V, wc), U = t.subscribe(11, (t) => {
				t.reason === hr.UNLOADING && V();
			});
			function D() {
				t.notify(3, {
					id: a,
					name: m,
					context: p.getContext(),
					startClocks: i,
					sessionIsActive: h
				});
			}
			function $() {
				D(), S();
			}
			function V() {
				E(), D(), d += 1;
				const e = void 0 === l ? rt() : l.timeStamp;
				t.notify(4, {
					customTimings: u,
					documentVersion: d,
					id: a,
					name: m,
					service: v,
					version: y,
					context: p.getContext(),
					loadingType: o,
					location: f,
					handlingStack: b,
					startClocks: i,
					commonViewMetrics: x(),
					initialViewMetrics: N,
					duration: at(i.timeStamp, e),
					isActive: void 0 === l,
					sessionIsActive: h,
					eventCounts: P
				});
			}
			return V(), p.changeObservable.subscribe($), {
				get name() {
					return m;
				},
				service: v,
				version: y,
				contextManager: p,
				stopObservable: c,
				end(e = {}) {
					var n, r;
					l || (l = null !== (n = e.endClocks) && void 0 !== n ? n : it(), h = null === (r = e.sessionIsActive) || void 0 === r || r, t.notify(5, { endClocks: l }), t.notify(6, { endClocks: l }), B(M), A(l.relative), C(), U.unsubscribe(), V(), z(() => {
						this.stop();
					}, Sc));
				},
				stop() {
					O(), L(), R(), c.notify();
				},
				addTiming(t, e) {
					if (l) return;
					const n = function(t) {
						return t < J;
					}(e) ? e : at(i.timeStamp, e);
					u[function(t) {
						const e = t.replace(/[^a-zA-Z0-9-_.@$]/g, "_");
						e !== t && g.warn(`Invalid timing name: ${t}, sanitized to: ${e}`);
						return e;
					}(t)] = n, $();
				},
				setLoadingTime: I,
				setViewName(t) {
					m = t, V();
				}
			};
		}(t, e, n, r, o, i, s);
		return a.add(c), c.stopObservable.subscribe(() => {
			a.delete(c);
		}), c;
	}
	return t.subscribe(10, () => {
		l = d(Qo, void 0, {
			name: l.name,
			service: l.service,
			version: l.version,
			context: l.contextManager.getContext()
		});
	}), t.subscribe(9, () => {
		l.end({ sessionIsActive: !1 });
	}), i && (u = function(t) {
		return t.subscribe(({ oldLocation: t, newLocation: e }) => {
			var n, r = e;
			((n = t).pathname !== r.pathname || !function(t) {
				const e = t.substring(1);
				return "" !== e && !!document.getElementById(e);
			}(r.hash) && kc(r.hash) !== kc(n.hash)) && (l.end(), l = d(Qo));
		});
	}(o), r.trackBfcacheViews && (c = function(t, e) {
		const { stop: n } = Dn(t, window, "pageshow", (t) => {
			t.persisted && e(t);
		}, { capture: !0 });
		return n;
	}(r, (t) => {
		l.end();
		const e = Z(t.timeStamp);
		l = d(ti, e, void 0);
	}))), {
		addTiming: (t, e = rt()) => {
			l.addTiming(t, e);
		},
		setLoadingTime: (t) => l.setLoadingTime(t),
		startView: (t, e) => {
			l.end({ endClocks: e }), l = d(Qo, e, t);
		},
		setViewContext: (t) => {
			l.contextManager.setContext(t);
		},
		setViewContextProperty: (t, e) => {
			l.contextManager.setContextProperty(t, e);
		},
		setViewName: (t) => {
			l.setViewName(t);
		},
		getViewContext: () => l.contextManager.getContext(),
		stop: () => {
			u && u.unsubscribe(), c && c(), l.end(), a.forEach((t) => t.stop());
		}
	};
}
function kc(t) {
	const e = t.indexOf("?");
	return e < 0 ? t : t.slice(0, e);
}
function Tc(t, e, n, r, o, i, s, a, c) {
	return t.subscribe(4, (e) => t.notify(12, function(t, e, n) {
		var r, o, i, s, a, c, u, l, d, f, p, h, m, g, v, y, _, b;
		const w = n.getReplayStats(t.id), S = null === (o = null === (r = t.commonViewMetrics) || void 0 === r ? void 0 : r.cumulativeLayoutShift) || void 0 === o ? void 0 : o.devicePixelRatio, E = {
			_dd: {
				document_version: t.documentVersion,
				replay_stats: w,
				cls: S ? { device_pixel_ratio: S } : void 0,
				configuration: { start_session_replay_recording_manually: e.startSessionReplayRecordingManually }
			},
			date: t.startClocks.timeStamp,
			type: Jo.VIEW,
			view: {
				action: { count: t.eventCounts.actionCount },
				frustration: { count: t.eventCounts.frustrationCount },
				cumulative_layout_shift: null === (i = t.commonViewMetrics.cumulativeLayoutShift) || void 0 === i ? void 0 : i.value,
				cumulative_layout_shift_time: et(null === (s = t.commonViewMetrics.cumulativeLayoutShift) || void 0 === s ? void 0 : s.time),
				cumulative_layout_shift_target_selector: null === (a = t.commonViewMetrics.cumulativeLayoutShift) || void 0 === a ? void 0 : a.targetSelector,
				first_byte: et(null === (c = t.initialViewMetrics.navigationTimings) || void 0 === c ? void 0 : c.firstByte),
				dom_complete: et(null === (u = t.initialViewMetrics.navigationTimings) || void 0 === u ? void 0 : u.domComplete),
				dom_content_loaded: et(null === (l = t.initialViewMetrics.navigationTimings) || void 0 === l ? void 0 : l.domContentLoaded),
				dom_interactive: et(null === (d = t.initialViewMetrics.navigationTimings) || void 0 === d ? void 0 : d.domInteractive),
				error: { count: t.eventCounts.errorCount },
				first_contentful_paint: et(t.initialViewMetrics.firstContentfulPaint),
				first_input_delay: et(null === (f = t.initialViewMetrics.firstInput) || void 0 === f ? void 0 : f.delay),
				first_input_time: et(null === (p = t.initialViewMetrics.firstInput) || void 0 === p ? void 0 : p.time),
				first_input_target_selector: null === (h = t.initialViewMetrics.firstInput) || void 0 === h ? void 0 : h.targetSelector,
				interaction_to_next_paint: et(null === (m = t.commonViewMetrics.interactionToNextPaint) || void 0 === m ? void 0 : m.value),
				interaction_to_next_paint_time: et(null === (g = t.commonViewMetrics.interactionToNextPaint) || void 0 === g ? void 0 : g.time),
				interaction_to_next_paint_target_selector: null === (v = t.commonViewMetrics.interactionToNextPaint) || void 0 === v ? void 0 : v.targetSelector,
				is_active: t.isActive,
				name: t.name,
				largest_contentful_paint: et(null === (y = t.initialViewMetrics.largestContentfulPaint) || void 0 === y ? void 0 : y.value),
				largest_contentful_paint_target_selector: null === (_ = t.initialViewMetrics.largestContentfulPaint) || void 0 === _ ? void 0 : _.targetSelector,
				load_event: et(null === (b = t.initialViewMetrics.navigationTimings) || void 0 === b ? void 0 : b.loadEvent),
				loading_time: ds(et(t.commonViewMetrics.loadingTime)),
				loading_type: t.loadingType,
				long_task: { count: t.eventCounts.longTaskCount },
				performance: Ac(t.commonViewMetrics, t.initialViewMetrics),
				resource: { count: t.eventCounts.resourceCount },
				time_spent: et(t.duration)
			},
			display: t.commonViewMetrics.scroll ? { scroll: {
				max_depth: t.commonViewMetrics.scroll.maxDepth,
				max_depth_scroll_top: t.commonViewMetrics.scroll.maxDepthScrollTop,
				max_scroll_height: t.commonViewMetrics.scroll.maxScrollHeight,
				max_scroll_height_time: et(t.commonViewMetrics.scroll.maxScrollHeightTime)
			} } : void 0,
			privacy: { replay_level: e.defaultPrivacyLevel },
			device: {
				locale: navigator.language,
				locales: navigator.languages,
				time_zone: Yo()
			}
		};
		C(t.customTimings) || (E.view.custom_timings = R(t.customTimings, et));
		return {
			rawRumEvent: E,
			startClocks: t.startClocks,
			duration: t.duration,
			domainContext: {
				location: t.location,
				handlingStack: t.handlingStack
			}
		};
	}(e, n, s))), e.register(0, ({ startTime: t, eventType: e }) => {
		const n = a.findView(t);
		return n ? {
			type: e,
			service: n.service,
			version: n.version,
			context: n.context,
			view: {
				id: n.id,
				name: n.name
			}
		} : Er;
	}), e.register(1, ({ startTime: t }) => {
		var e;
		return { view: { id: null === (e = a.findView(t)) || void 0 === e ? void 0 : e.id } };
	}), Ec(t, r, o, n, i, !n.trackViewsManually, c);
}
function Ac({ cumulativeLayoutShift: t, interactionToNextPaint: e }, { firstContentfulPaint: n, firstInput: r, largestContentfulPaint: o }) {
	return {
		cls: t && {
			score: t.value,
			timestamp: et(t.time),
			target_selector: t.targetSelector,
			previous_rect: t.previousRect,
			current_rect: t.currentRect
		},
		fcp: n && { timestamp: et(n) },
		fid: r && {
			duration: et(r.delay),
			timestamp: et(r.time),
			target_selector: r.targetSelector
		},
		inp: e && {
			duration: et(e.value),
			timestamp: et(e.time),
			target_selector: e.targetSelector,
			sub_parts: e.subParts ? {
				input_delay: et(e.subParts.inputDelay),
				processing_duration: et(e.subParts.processingDuration),
				presentation_delay: et(e.subParts.presentationDelay)
			} : void 0
		},
		lcp: o && {
			timestamp: et(o.value),
			target_selector: o.targetSelector,
			resource_url: o.resourceUrl,
			sub_parts: o.subParts ? {
				load_delay: et(o.subParts.loadDelay),
				load_time: et(o.subParts.loadTime),
				render_delay: et(o.subParts.renderDelay)
			} : void 0
		}
	};
}
function Cc(t, e, n) {
	const r = no(t, "rum", (e) => function(t, e) {
		return function(t) {
			return "0" === t || "1" === t || "2" === t;
		}(e) ? e : w(t.sessionSampleRate) ? w(t.sessionReplaySampleRate) ? "1" : "2" : "0";
	}(t, e), n);
	return r.expireObservable.subscribe(() => {
		e.notify(9);
	}), r.renewObservable.subscribe(() => {
		e.notify(10);
	}), r.sessionStateUpdateObservable.subscribe(({ previousState: t, newState: e }) => {
		if (!t.forcedReplay && e.forcedReplay) {
			const t = r.findSession();
			t && (t.isReplayForced = !0);
		}
	}), {
		findTrackedSession: (t) => {
			const e = r.findSession(t);
			if (e && "0" !== e.trackingType) return {
				id: e.id,
				sessionReplay: "1" === e.trackingType ? 1 : e.isReplayForced ? 2 : 0,
				anonymousId: e.anonymousId
			};
		},
		expire: r.expire,
		expireObservable: r.expireObservable,
		setForcedReplay: () => r.updateSessionState({ forcedReplay: "1" })
	};
}
const Rc = Ut;
function xc(t) {
	let e = T(location);
	return new G((n) => {
		const { stop: r } = function(t, e) {
			const { stop: n } = dn(Ic("pushState"), "pushState", ({ onPostCall: t }) => {
				t(e);
			}), { stop: r } = dn(Ic("replaceState"), "replaceState", ({ onPostCall: t }) => {
				t(e);
			}), { stop: o } = Dn(t, window, "popstate", e);
			return { stop: () => {
				n(), r(), o();
			} };
		}(t, i), { stop: o } = function(t, e) {
			return Dn(t, window, "hashchange", e);
		}(t, i);
		function i() {
			if (e.href === location.href) return;
			const t = T(location);
			n.notify({
				newLocation: t,
				oldLocation: e
			}), e = t;
		}
		return () => {
			r(), o();
		};
	});
}
function Ic(t) {
	return Object.prototype.hasOwnProperty.call(history, t) ? history : History.prototype;
}
const Oc = Ut;
let Nc, Lc;
function Pc() {
	0 !== Nc.batchCount && (Mr("Customer data measures", Nc), Uc());
}
function Mc(t, e) {
	t.sum += e, t.min = Math.min(t.min, e), t.max = Math.max(t.max, e);
}
function Uc() {
	Nc = {
		batchCount: 0,
		batchBytesCount: {
			min: Infinity,
			max: 0,
			sum: 0
		},
		batchMessagesCount: {
			min: Infinity,
			max: 0,
			sum: 0
		}
	};
}
const Dc = Ut;
function $c(t, e, n = 500) {
	const r = jr({
		expireDelay: Dc,
		maxEntries: 4e3
	});
	let o;
	ks(ws.VISIBILITY_STATE) && performance.getEntriesByType(ws.VISIBILITY_STATE).forEach((t) => {
		s("hidden" === t.name ? "hidden" : "active", t.startTime);
	}), s(zc(), ot());
	const { stop: i } = $n(e, window, [
		"pageshow",
		"focus",
		"blur",
		"visibilitychange",
		"resume",
		"freeze",
		"pagehide"
	], (t) => {
		s(function(t) {
			if ("freeze" === t.type) return "frozen";
			if ("pagehide" === t.type) return t.persisted ? "frozen" : "terminated";
			return zc();
		}(t), t.timeStamp);
	}, { capture: !0 });
	function s(t, e = ot()) {
		t !== o && (o = t, r.closeActive(e), r.add({
			state: o,
			startTime: e
		}, e));
	}
	function a(t, e, n) {
		return r.findAll(e, n).some((e) => e.state === t);
	}
	return t.register(0, ({ startTime: t, duration: e = 0, eventType: o }) => o === Jo.VIEW ? {
		type: o,
		_dd: { page_states: Vc(r.findAll(t, e), t, n) }
	} : o === Jo.ACTION || o === Jo.ERROR ? {
		type: o,
		view: { in_foreground: a("active", t, 0) }
	} : kr), {
		wasInPageStateDuringPeriod: a,
		addPageState: s,
		stop: () => {
			i(), r.stop();
		}
	};
}
function Vc(t, e, n) {
	if (0 !== t.length) return t.slice(-n).reverse().map(({ state: t, startTime: n }) => ({
		state: t,
		start: et(at(e, n))
	}));
}
function zc() {
	return "hidden" === document.visibilityState ? "hidden" : document.hasFocus() ? "active" : "passive";
}
function qc(t, e) {
	const n = window.cookieStore ? function(t) {
		return (e, n) => Dn(t, window.cookieStore, "change", (t) => {
			const r = t.changed.find((t) => t.name === e) || t.deleted.find((t) => t.name === e);
			r && n(r.value);
		}).stop;
	}(t) : Bc;
	return new G((t) => n(e, (e) => t.notify(e)));
}
const Fc = W;
function Bc(t, e) {
	let n = gt(document.cookie, t);
	const r = F(() => {
		const r = gt(document.cookie, t);
		r !== n && (n = r, e(r));
	}, Fc);
	return () => {
		B(r);
	};
}
function jc(t, e) {
	const n = ht(), r = et(t.duration), o = {
		date: e.timeStamp,
		type: Jo.LONG_TASK,
		_dd: { discarded: !1 }
	};
	return t.entryType === ws.LONG_TASK ? {
		...o,
		long_task: {
			id: n,
			entry_type: Zo.LONG_TASK,
			duration: r
		}
	} : {
		...o,
		long_task: {
			id: n,
			entry_type: Zo.LONG_ANIMATION_FRAME,
			duration: r,
			blocking_duration: et(t.blockingDuration),
			first_ui_event_timestamp: et(t.firstUIEventTimestamp),
			render_start: et(t.renderStart),
			style_and_layout_start: et(t.styleAndLayoutStart),
			start_time: et(t.startTime),
			scripts: t.scripts.map((t) => ({
				duration: et(t.duration),
				pause_duration: et(t.pauseDuration),
				forced_style_and_layout_duration: et(t.forcedStyleAndLayoutDuration),
				start_time: et(t.startTime),
				execution_start: et(t.executionStart),
				source_url: t.sourceURL,
				source_function_name: t.sourceFunctionName,
				source_char_position: t.sourceCharPosition,
				invoker: t.invoker,
				invoker_type: t.invokerType,
				window_attribution: t.windowAttribution
			}))
		}
	};
}
function Gc(t, e, n) {
	const r = Yn(t), o = n(r);
	return Mt(e).forEach(([e, n]) => Kc(t, r, e.split(/\.|(?=\[\])/), n)), o;
}
function Kc(t, e, n, r) {
	const [o, ...i] = n;
	if ("[]" !== o) {
		if (Hc(t) && Hc(e)) return i.length > 0 ? Kc(t[o], e[o], i, r) : void function(t, e, n, r) {
			if (t[e] === n) return;
			const o = be(n);
			o === r ? t[e] = yn(n) : "object" !== r || "undefined" !== o && "null" !== o || (t[e] = {});
		}(t, o, e[o], r);
	} else Array.isArray(t) && Array.isArray(e) && t.forEach((t, n) => Kc(t, e[n], i, r));
}
function Hc(t) {
	return "object" === be(t);
}
const Wc = {
	"view.name": "string",
	"view.url": "string",
	"view.referrer": "string"
}, Yc = { context: "object" }, Jc = {
	service: "string",
	version: "string"
};
let Zc;
function Xc(t, e, n, r, o) {
	Zc = {
		[Jo.VIEW]: {
			"view.performance.lcp.resource_url": "string",
			...Yc,
			...Wc,
			...Jc
		},
		[Jo.ERROR]: {
			"error.message": "string",
			"error.stack": "string",
			"error.resource.url": "string",
			"error.fingerprint": "string",
			...Yc,
			...Wc,
			...Jc
		},
		[Jo.RESOURCE]: {
			"resource.url": "string",
			"resource.graphql.variables": "string",
			...Yc,
			...Wc,
			...Jc
		},
		[Jo.ACTION]: {
			"action.target.name": "string",
			...Yc,
			...Wc,
			...Jc
		},
		[Jo.LONG_TASK]: {
			"long_task.scripts[].source_url": "string",
			"long_task.scripts[].invoker": "string",
			...Yc,
			...Wc,
			...Jc
		},
		[Jo.VITAL]: {
			...Yc,
			...Wc,
			...Jc
		}
	};
	const i = {
		[Jo.ERROR]: oo(Jo.ERROR, r, o),
		[Jo.ACTION]: oo(Jo.ACTION, r, o),
		[Jo.VITAL]: oo(Jo.VITAL, r, o)
	};
	e.subscribe(12, ({ startClocks: r, duration: o, rawRumEvent: s, domainContext: a }) => {
		const c = n.triggerHook(0, {
			eventType: s.type,
			rawRumEvent: s,
			domainContext: a,
			startTime: r.relative,
			duration: o
		});
		if ("DISCARDED" === c) return;
		const u = Jn(c, s, { ddtags: Gn(t).join(",") });
		(function(t, e, n, r) {
			var o;
			if (e) {
				const r = Gc(t, Zc[t.type], (t) => e(t, n));
				if (!1 === r && t.type !== Jo.VIEW) return !1;
				!1 === r && g.warn("Can't dismiss view events using beforeSend!");
			}
			return !(null === (o = r[t.type]) || void 0 === o ? void 0 : o.isLimitReached());
		})(u, t.beforeSend, a, i) && (C(u.context) && delete u.context, e.notify(13, u));
	});
}
const Qc = [
	Jo.ACTION,
	Jo.ERROR,
	Jo.LONG_TASK,
	Jo.RESOURCE,
	Jo.VITAL
];
function tu(t) {
	const e = window, n = /* @__PURE__ */ new Map();
	function r() {
		e.DD_SOURCE_CODE_CONTEXT && (Mt(e.DD_SOURCE_CODE_CONTEXT).forEach(([t, e]) => {
			const r = He({ stack: t }).stack[0];
			r.url ? n.has(r.url) || n.set(r.url, e) : Pr("Source code context: missing frame url", { stack: t });
		}), e.DD_SOURCE_CODE_CONTEXT = {});
	}
	r(), t.register(0, ({ domainContext: t, rawRumEvent: e }) => {
		if (r(), 0 === n.size) return kr;
		const o = function(t, e) {
			var n, r;
			if ("long_task" === e.type && "long-animation-frame" === e.long_task.entry_type) return null === (n = e.long_task.scripts[0]) || void 0 === n ? void 0 : n.source_url;
			let o;
			"handlingStack" in t && (o = t.handlingStack);
			"error" === e.type && e.error.stack && (o = e.error.stack);
			return null === (r = He({ stack: o }).stack[0]) || void 0 === r ? void 0 : r.url;
		}(t, e), i = o && n.get(o);
		return i ? {
			type: e.type,
			service: i.service,
			version: i.version
		} : kr;
	});
}
function eu(t, e, n, r, o, i, s, a, c, u, l) {
	const d = [], f = new Ui();
	f.subscribe(13, (t) => Hn("rum", t));
	const p = (t) => {
		f.notify(14, { error: t }), Lr("Error reported to customer", { "error.message": t.message });
	}, h = mr(t), m = h.subscribe((t) => {
		f.notify(11, t);
	});
	d.push(() => m.unsubscribe());
	const g = pr() ? function() {
		const t = {
			id: "00000000-aaaa-0000-aaaa-000000000000",
			sessionReplay: fr("records") ? 1 : 0
		};
		return {
			findTrackedSession: () => t,
			expire: pt,
			expireObservable: new G(),
			setForcedReplay: pt
		};
	}() : Cc(t, f, i);
	if (pr()) (function(t) {
		const e = dr();
		t.subscribe(13, (t) => {
			e.send("rum", t);
		});
	})(f);
	else {
		const e = function(t, e, n, r, o, i) {
			const s = [t.rumEndpointBuilder];
			t.replica && s.push(t.replica.rumEndpointBuilder);
			const a = yr({
				encoder: i(2),
				request: ar(s, n),
				flushController: wr({
					pageMayExitObservable: r,
					sessionExpireObservable: o
				})
			});
			return e.subscribe(13, (t) => {
				t.type === Jo.VIEW ? a.upsert(t, t.view.id) : a.add(t);
			}), a;
		}(t, f, p, h, g.expireObservable, o);
		d.push(() => e.stop()), function(t, e, n) {
			t.metricsEnabled && (Uc(), Lc = !1, e.subscribe(13, () => {
				Lc = !0;
			}), n.subscribe(({ bytesCount: t, messagesCount: e }) => {
				Lc && (Lc = !1, Nc.batchCount += 1, Mc(Nc.batchBytesCount, t), Mc(Nc.batchMessagesCount, e));
			}), F(Pc, 1e4));
		}(c, f, e.flushController.flushObservable);
	}
	(function(t, e) {
		t.register(1, () => e.isGranted() ? kr : Er);
	})(u, i);
	const { stop: v } = function(t, e) {
		if (!e.metricsEnabled) return { stop: pt };
		const { unsubscribe: n } = t.subscribe(4, ({ initialViewMetrics: t }) => {
			var e, r;
			t.largestContentfulPaint && t.navigationTimings && (Mr("Initial view metrics", { metrics: (e = t.largestContentfulPaint, r = t.navigationTimings, {
				lcp: { value: e.value },
				navigation: {
					domComplete: r.domComplete,
					domContentLoaded: r.domContentLoaded,
					domInteractive: r.domInteractive,
					firstByte: r.firstByte,
					loadEvent: r.loadEvent
				}
			}) }), n());
		});
		return { stop: n };
	}(f, c);
	d.push(v);
	const { stop: y, ..._ } = function(t, e, n, r, o, i, s, a, c, u) {
		const l = [], d = function() {
			const t = Mi();
			return new G((e) => {
				if (!t) return;
				const n = new t(U((t) => e.notify(t)));
				return n.observe(document, {
					attributes: !0,
					characterData: !0,
					childList: !0,
					subtree: !0
				}), () => n.disconnect();
			});
		}(), f = xc(n), { observable: p, stop: h } = function() {
			const t = new G(), { stop: e } = dn(window, "open", () => t.notify());
			return {
				observable: t,
				stop: e
			};
		}();
		l.push(h), function(t, e, n) {
			t.register(0, ({ eventType: t }) => {
				const r = e.source;
				return {
					type: t,
					_dd: {
						format_version: 2,
						drift: tt(),
						configuration: {
							session_sample_rate: S(e.sessionSampleRate, 3),
							session_replay_sample_rate: S(e.sessionReplaySampleRate, 3),
							profiling_sample_rate: S(e.profilingSampleRate, 3),
							trace_sample_rate: S(e.traceSampleRate, 3),
							beta_encode_cookie_options: e.betaEncodeCookieOptions
						},
						browser_sdk_version: pr() ? "6.31.0" : void 0,
						sdk_name: n
					},
					application: { id: e.applicationId },
					date: rt(),
					source: r
				};
			}), t.register(1, () => ({ application: { id: e.applicationId } }));
		}(e, n, c);
		const m = $c(e, n);
		l.push(() => m.stop());
		const g = function(t) {
			const e = jr({ expireDelay: Di });
			return t.subscribe(1, (t) => {
				e.add(function(t) {
					return {
						service: t.service,
						version: t.version,
						context: t.context,
						id: t.id,
						name: t.name,
						startClocks: t.startClocks
					};
				}(t), t.startClocks.relative);
			}), t.subscribe(6, ({ endClocks: t }) => {
				e.closeActive(t.relative);
			}), t.subscribe(3, (t) => {
				const n = e.find(t.startClocks.relative);
				n && (t.name && (n.name = t.name), t.context && (n.context = t.context), n.sessionIsActive = t.sessionIsActive);
			}), t.subscribe(10, () => {
				e.reset();
			}), {
				findView: (t) => e.find(t),
				stop: () => {
					e.stop();
				}
			};
		}(t);
		l.push(() => g.stop());
		const v = function(t, e, n) {
			const r = jr({ expireDelay: Rc });
			let o;
			t.subscribe(1, ({ startClocks: t, url: e }) => {
				const n = location.href, i = void 0 !== e ? Tt(e, n).href : n;
				r.add(s({
					url: i,
					referrer: o || document.referrer
				}), t.relative), o = i;
			}), t.subscribe(6, ({ endClocks: t }) => {
				r.closeActive(t.relative);
			});
			const i = n.subscribe(({ newLocation: t }) => {
				const e = r.find();
				if (e) {
					const n = ot();
					r.closeActive(n), r.add(s({
						url: t.href,
						referrer: e.referrer
					}), n);
				}
			});
			function s({ url: t, referrer: e }) {
				return {
					url: t,
					referrer: e
				};
			}
			return e.register(0, ({ startTime: t, eventType: e }) => {
				const n = r.find(t);
				return n ? {
					type: e,
					view: {
						url: n.url,
						referrer: n.referrer
					}
				} : Er;
			}), {
				findUrl: (t) => r.find(t),
				stop: () => {
					i.unsubscribe(), r.stop();
				}
			};
		}(t, e, f);
		l.push(() => v.stop());
		const y = function(t, e, n) {
			const r = jr({ expireDelay: Oc });
			return t.subscribe(1, ({ startClocks: t }) => {
				r.add({}, t.relative);
			}), t.subscribe(6, ({ endClocks: t }) => {
				r.closeActive(t.relative);
			}), e.register(0, ({ startTime: t, eventType: e }) => {
				if (!n.trackFeatureFlagsForEvents.concat([Jo.VIEW, Jo.ERROR]).includes(e)) return kr;
				const o = r.find(t);
				return !o || C(o) ? kr : {
					type: e,
					feature_flags: o
				};
			}), { addFeatureFlagEvaluation: (t, e) => {
				const n = r.find();
				n && (n[t] = e);
			} };
		}(t, e, n);
		(function(t, e, n, r) {
			t.register(0, ({ eventType: t, startTime: o }) => {
				const i = e.findTrackedSession(o), s = r.findView(o);
				if (!i || !s) return Er;
				let a, c, u;
				return t === Jo.VIEW ? (a = !!n.getReplayStats(s.id) || void 0, c = 1 === i.sessionReplay, u = !!s.sessionIsActive && void 0) : a = !!n.isRecording() || void 0, {
					type: t,
					session: {
						id: i.id,
						type: "user",
						has_replay: a,
						sampled_for_replay: c,
						is_active: u
					}
				};
			}), t.register(1, ({ startTime: t }) => {
				const n = e.findTrackedSession(t);
				return n ? { session: { id: n.id } } : kr;
			});
		})(e, r, o, g), function(t) {
			t.register(0, ({ eventType: t }) => ({
				type: t,
				connectivity: Zn()
			}));
		}(e);
		const _ = function(t, e, n, r) {
			const o = Ro();
			return e.storeContextsAcrossPages && Ao(e, o, n, 2), t.register(0, () => {
				const t = o.getContext();
				return r ? { context: t } : t;
			}), o;
		}(e, n, "rum", !0), b = function(t, e, n, r) {
			const o = xo();
			return e.storeContextsAcrossPages && Ao(e, o, r, 1), t.register(0, ({ eventType: t, startTime: r }) => {
				const i = o.getContext(), s = n.findTrackedSession(r);
				return s && s.anonymousId && !i.anonymous_id && e.trackAnonymousUser && (i.anonymous_id = s.anonymousId), C(i) ? kr : {
					type: t,
					usr: i
				};
			}), t.register(1, ({ startTime: t }) => {
				var e;
				return { anonymous_id: null === (e = n.findTrackedSession(t)) || void 0 === e ? void 0 : e.anonymousId };
			}), o;
		}(e, n, r, "rum"), w = function(t, e, n) {
			const r = Co();
			return e.storeContextsAcrossPages && Ao(e, r, n, 4), t.register(0, () => {
				const t = r.getContext();
				return C(t) || !t.id ? kr : { account: t };
			}), r;
		}(e, n, "rum"), E = Oa(t, e, d, p, n);
		l.push(E.stop);
		const k = function(t) {
			return { addEvent: (e, n, r, o) => {
				Qc.includes(n.type) && t.notify(12, {
					startClocks: Z(e),
					rawRumEvent: n,
					domainContext: r,
					duration: o
				});
			} };
		}(t), T = function(t, e) {
			let n;
			const r = requestAnimationFrame(U(() => {
				n = vc();
			})), o = gc(e).subscribe((t) => {
				n = t;
			}).unsubscribe;
			return t.register(0, ({ eventType: t }) => ({
				type: t,
				display: n ? { viewport: n } : void 0
			})), { stop: () => {
				o(), r && cancelAnimationFrame(r);
			} };
		}(e, n);
		l.push(T.stop);
		const A = function(t, e, n = qc(t, "datadog-ci-visibility-test-execution-id")) {
			var r;
			let o = xt("datadog-ci-visibility-test-execution-id") || (null === (r = window.Cypress) || void 0 === r ? void 0 : r.env("traceId"));
			const i = n.subscribe((t) => {
				o = t;
			});
			return e.register(0, ({ eventType: t }) => "string" != typeof o ? kr : {
				type: t,
				session: { type: "ci_test" },
				ci_test: { test_execution_id: o }
			}), { stop: () => {
				i.unsubscribe();
			} };
		}(n, e);
		l.push(A.stop), function(t) {
			t.register(0, ({ eventType: t }) => Xr() ? {
				type: t,
				session: { type: "synthetics" },
				synthetics: {
					...Zr(),
					injected: Jr()
				}
			} : kr);
		}(e), Xc(n, t, e, u);
		const { addTiming: R, setLoadingTime: x, startView: I, setViewName: O, setViewContext: N, setViewContextProperty: L, getViewContext: P, stop: M } = Tc(t, e, n, d, p, f, o, g, i);
		tu(e), l.push(M);
		const D = ja(t, n, m);
		l.push(D.stop);
		const { stop: $ } = function(t, e) {
			const n = Ss(e, {
				type: ks(ws.LONG_ANIMATION_FRAME) ? ws.LONG_ANIMATION_FRAME : ws.LONG_TASK,
				buffered: !0
			}).subscribe((n) => {
				for (const r of n) {
					if (!e.trackLongTasks) break;
					const n = Z(r.startTime), o = jc(r, n);
					t.notify(12, {
						rawRumEvent: o,
						startClocks: n,
						duration: r.duration,
						domainContext: { performanceEntry: r }
					});
				}
			});
			return { stop: () => n.unsubscribe() };
		}(t, n);
		l.push($);
		const { addError: V } = La(t, n, a);
		us(t, n, r, b, w);
		const z = ai(t, m, s), q = function(t, e, n, r, o) {
			return { get: (i) => {
				const s = n.findView(i), a = o.findUrl(i), c = e.findTrackedSession(i);
				if (c && s && a) {
					const e = r.findActionId(i);
					return {
						application_id: t,
						session_id: c.id,
						user_action: e ? { id: e } : void 0,
						view: {
							id: s.id,
							name: s.name,
							referrer: a.referrer,
							url: a.url
						}
					};
				}
			} };
		}(n.applicationId, r, g, E.actionContexts, v);
		return {
			addAction: E.addAction,
			startAction: E.startAction,
			stopAction: E.stopAction,
			startResource: D.startResource,
			stopResource: D.stopResource,
			addEvent: k.addEvent,
			addError: V,
			addTiming: R,
			setLoadingTime: x,
			addFeatureFlagEvaluation: y.addFeatureFlagEvaluation,
			startView: I,
			setViewContext: N,
			setViewContextProperty: L,
			getViewContext: P,
			setViewName: O,
			viewHistory: g,
			getInternalContext: q.get,
			startDurationVital: z.startDurationVital,
			stopDurationVital: z.stopDurationVital,
			addDurationVital: z.addDurationVital,
			addOperationStepVital: z.addOperationStepVital,
			globalContext: _,
			userContext: b,
			accountContext: w,
			stop: () => l.forEach((t) => t())
		};
	}(f, u, t, g, e, r, s, a, l, p);
	return d.push(y), a.unbuffer(), d.push(() => n.stop()), {
		..._,
		lifeCycle: f,
		session: g,
		stopSession: () => g.expire(),
		telemetry: c,
		stop: () => {
			d.forEach((t) => t());
		},
		hooks: u
	};
}
function nu(t, { session: e, viewContext: n, errorType: r }) {
	const o = e ? e.id : "no-session-id", i = [];
	return void 0 !== r && i.push(`error-type=${r}`), n && (i.push(`seed=${n.id}`), i.push(`from=${n.startClocks.timeStamp}`)), `${function(t) {
		const e = t.site, n = t.subdomain || function(t) {
			switch (t.site) {
				case xe:
				case Ie: return "app";
				case Re: return "dd";
				default: return;
			}
		}(t);
		return `https://${n ? `${n}.` : ""}${e}`;
	}(t)}/rum/replay/sessions/${o}?${i.join("&")}`;
}
function ru(t, e, n, r) {
	const o = ar([t.profilingEndpointBuilder], (t) => {
		e.notify(14, { error: t }), Lr("Error reported to customer", { "error.message": t.message });
	}), i = n(r);
	return { async send({ event: t, ...e }) {
		const n = new FormData(), r = gn(t);
		if (!r) throw new Error("Failed to serialize event");
		n.append("event", new Blob([r], { type: "application/json" }), "event.json");
		let s = r.length;
		for (const [o, a] of Mt(e)) {
			const t = gn(a);
			if (!t) throw new Error("Failed to serialize attachment");
			const e = await ou(i, t);
			s += e.outputBytesCount, n.append(o, new Blob([e.output]), o);
		}
		o.send({
			data: n,
			bytesCount: s
		});
	} };
}
function ou(t, e) {
	return new Promise((n) => {
		t.write(e), t.finish((t) => {
			n(t);
		});
	});
}
let iu;
function su(t) {
	return lu(t).segments_count;
}
function au(t) {
	lu(t).segments_count += 1;
}
function cu(t) {
	lu(t).records_count += 1;
}
function uu(t, e) {
	lu(t).segments_total_raw_size += e;
}
function lu(t) {
	let e;
	return iu || (iu = /* @__PURE__ */ new Map()), iu.has(t) ? e = iu.get(t) : (e = {
		records_count: 0,
		segments_count: 0,
		segments_total_raw_size: 0
	}, iu.set(t, e), iu.size > 1e3 && function() {
		if (!iu) return;
		const t = iu.keys().next().value;
		t && iu.delete(t);
	}()), e;
}
function du(t, e, n) {
	let r, o = 0, i = [], s = !0, a = 0;
	const c = [], { stop: u } = Dn(t, e, "message", ({ data: t }) => {
		if ("wrote" !== t.type || t.streamId !== n) return;
		const e = c[0];
		e && (e.id === t.id ? (c.shift(), o += t.additionalBytesCount, i.push(t.result), r = t.trailer, e.writeCallback ? e.writeCallback(t.result.byteLength) : e.finishCallback && e.finishCallback()) : e.id < t.id && u());
	});
	function l() {
		const t = 0 === i.length ? /* @__PURE__ */ new Uint8Array(0) : mn(i.concat(r)), e = {
			rawBytesCount: o,
			output: t,
			outputBytesCount: t.byteLength,
			encoding: "deflate"
		};
		return o = 0, i = [], e;
	}
	function d() {
		s || (e.postMessage({
			action: "reset",
			streamId: n
		}), s = !0);
	}
	return {
		isAsync: !0,
		get isEmpty() {
			return s;
		},
		write(t, r) {
			e.postMessage({
				action: "write",
				id: a,
				data: t,
				streamId: n
			}), c.push({
				id: a,
				writeCallback: r,
				data: t
			}), s = !1, a += 1;
		},
		finish(t) {
			d(), c.length ? (c.forEach((t) => {
				delete t.writeCallback;
			}), c[c.length - 1].finishCallback = () => t(l())) : t(l());
		},
		finishSync() {
			d();
			const t = c.map((t) => t.data).join("");
			return c.length = 0, {
				...l(),
				pendingData: t
			};
		},
		estimateEncodedBytesCount: (t) => t.length / 8,
		stop() {
			u();
		}
	};
}
function fu({ configuredUrl: t, error: e, source: n, scriptType: r }) {
	if (g.error(`${n} failed to start: an error occurred while initializing the ${r}:`, e), e instanceof Event || e instanceof Error && ((o = e.message).includes("Content Security Policy") || o.includes("requires 'TrustedScriptURL'"))) {
		let e;
		e = t ? `Please make sure the ${r} URL ${t} is correct and CSP is correctly configured.` : "Please make sure CSP is correctly configured.", g.error(`${e} See documentation at ${v}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`);
	} else "worker" === r && Pr(e);
	var o;
}
function pu(t) {
	return new Worker(t.workerUrl || URL.createObjectURL(new Blob(["(()=>{function t(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r=\"[object ArrayBuffer]\"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:\"errored\",error:e,streamId:a})}catch(n){t.postMessage({type:\"errored\",error:e+\"\",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,\"[object ArrayBuffer]\"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener(\"message\",n=>{try{const r=function(e,a){switch(a.action){case\"init\":return{type:\"initialized\",version:\"6.31.0\"};case\"write\":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if(\"function\"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:\"wrote\",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case\"reset\":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&\"streamId\"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();"])));
}
let hu = { status: 0 };
function mu(t, e, n) {
	switch (0 === hu.status && function(t, e) {
		try {
			const n = pu(t), { stop: r } = Dn(t, n, "error", (n) => {
				vu(t, e, n);
			}), { stop: o } = Dn(t, n, "message", ({ data: n }) => {
				var r;
				"errored" === n.type ? vu(t, e, n.error, n.streamId) : "initialized" === n.type && (r = n.version, 1 === hu.status && (hu = {
					status: 3,
					worker: hu.worker,
					stop: hu.stop,
					version: r
				}));
			});
			n.postMessage({ action: "init" }), z(() => function(t) {
				1 === hu.status && (g.error(`${t} failed to start: a timeout occurred while initializing the Worker`), hu.initializationFailureCallbacks.forEach((t) => t()), hu = { status: 2 });
			}(e), 3e4);
			hu = {
				status: 1,
				worker: n,
				stop: () => {
					r(), o();
				},
				initializationFailureCallbacks: []
			};
		} catch (n) {
			vu(t, e, n);
		}
	}(t, e), hu.status) {
		case 1: return hu.initializationFailureCallbacks.push(n), hu.worker;
		case 3: return hu.worker;
	}
}
function gu() {
	return hu.status;
}
function vu(t, e, n, r) {
	1 === hu.status || 0 === hu.status ? (fu({
		configuredUrl: t.workerUrl,
		error: n,
		source: e,
		scriptType: "worker"
	}), 1 === hu.status && hu.initializationFailureCallbacks.forEach((t) => t()), hu = { status: 2 }) : Pr(n, {
		worker_version: 3 === hu.status && hu.version,
		stream_id: r
	});
}
function yu() {
	return "function" == typeof Array.from && "function" == typeof CSSSupportsRule && "function" == typeof URL.createObjectURL && "forEach" in NodeList.prototype;
}
function _u(t, e, n, r) {
	const o = e.findTrackedSession(), i = function(t, e) {
		if (!yu()) return "browser-not-supported";
		if (!t) return "rum-not-tracked";
		if (0 === t.sessionReplay) return "incorrect-session-plan";
		if (!e) return "replay-not-started";
	}(o, r);
	return nu(t, {
		viewContext: n.findView(),
		errorType: i,
		session: o
	});
}
function bu(t, e, n, r, o, i, s) {
	let a, c = 0;
	e.subscribe(9, () => {
		2 !== c && 3 !== c || (f(), c = 1);
	}), e.subscribe(10, () => {
		1 === c && d();
	});
	const u = new G();
	(function(t, e) {
		if (!t.metricsEnabled) return { stop: pt };
		let n, r, o;
		const { unsubscribe: i } = e.subscribe((t) => {
			switch (t.type) {
				case "start":
					n = {
						forced: t.forced,
						timestamp: rt()
					}, r = void 0, o = void 0;
					break;
				case "document-ready":
					n && (r = at(n.timestamp, rt()));
					break;
				case "recorder-settled":
					n && (o = at(n.timestamp, rt()));
					break;
				case "aborted":
				case "deflate-encoder-load-failed":
				case "recorder-load-failed":
				case "succeeded": i(), n && Mr("Recorder init metrics", { metrics: (e = n.forced, s = o, a = at(n.timestamp, rt()), c = t.type, u = r, {
					forced: e,
					loadRecorderModuleDuration: s,
					recorderInitDuration: a,
					result: c,
					waitForDocReadyDuration: u
				}) });
			}
			var e, s, a, c, u;
		});
	})(s, u);
	const l = async (l) => {
		u.notify({
			type: "start",
			forced: l
		});
		const [d] = await Promise.all([wu(u, { type: "recorder-settled" }, o()), wu(u, { type: "document-ready" }, so(t, "interactive"))]);
		if (2 !== c) return void u.notify({ type: "aborted" });
		if (!d) return c = 0, void u.notify({ type: "recorder-load-failed" });
		const f = i();
		if (!f) return c = 0, void u.notify({ type: "deflate-encoder-load-failed" });
		({stop: a} = d(e, t, n, r, f, s)), c = 3, u.notify({ type: "succeeded" });
	};
	function d(t) {
		const e = n.findTrackedSession();
		if (function(t, e) {
			return !t || 0 === t.sessionReplay && (!e || !e.force);
		}(e, t)) return void (c = 1);
		if (function(t) {
			return 2 === t || 3 === t;
		}(c)) return;
		c = 2;
		const r = function(t, e) {
			return e && e.force && 0 === t.sessionReplay;
		}(e, t) || !1;
		l(r).catch($), r && n.setForcedReplay();
	}
	function f() {
		3 === c && (null == a || a()), c = 0;
	}
	return {
		start: d,
		stop: f,
		getSessionReplayLink: () => _u(t, n, r, 0 !== c),
		isRecording: () => 3 === c
	};
}
async function wu(t, e, n) {
	try {
		return await n;
	} finally {
		t.notify(e);
	}
}
async function Su() {
	return (await import("./startRecording-zKVWxyWc.js")).startRecording;
}
async function Eu() {
	return (await import("./profiler-zmYrKw4d.js")).createRumProfiler;
}
const ku = function(t, e, n = {}) {
	const r = function(t) {
		const e = new G();
		return {
			tryToInit(e) {
				t || (t = e);
			},
			update(n) {
				t = n, e.notify();
			},
			isGranted: () => t === _e.GRANTED,
			observable: e
		};
	}(), o = {
		vitalsByName: /* @__PURE__ */ new Map(),
		vitalsByReference: /* @__PURE__ */ new WeakMap()
	}, i = function() {
		const t = new H(500), e = Mn().subscribe((e) => {
			t.notify({
				type: 0,
				error: e
			});
		});
		return {
			observable: t,
			stop: () => {
				e.unsubscribe();
			}
		};
	}().observable;
	let s = Li(n, r, o, (a, c, u, l, d) => {
		const f = c && n.createDeflateEncoder ? (t) => n.createDeflateEncoder(a, c, t) : Sr, p = eu(a, t, e, u, f, r, o, i, l, d, n.sdkName);
		return t.onRumStart(p.lifeCycle, a, p.session, p.viewHistory, c, p.telemetry), e.onRumStart(p.lifeCycle, p.hooks, a, p.session, p.viewHistory, f), s = function(t, e) {
			return {
				init: (t) => {
					Un("DD_RUM", t);
				},
				initConfiguration: t.initConfiguration,
				...e
			};
		}(s, p), di(a.plugins, "onRumStart", {
			strategy: s,
			addEvent: p.addEvent
		}), p;
	});
	const a = () => s, c = function(t) {
		const e = {
			version: "6.31.0",
			onReady(t) {
				t();
			},
			...t
		};
		return Object.defineProperty(e, "_setDebug", {
			get: () => M,
			enumerable: !1
		}), e;
	}({
		init: (t) => {
			const e = (/* @__PURE__ */ new Error()).stack;
			D(() => s.init(t, c, e));
		},
		setTrackingConsent: U((t) => {
			r.update(t), Ur({
				feature: "set-tracking-consent",
				tracking_consent: t
			});
		}),
		setViewName: U((t) => {
			s.setViewName(t), Ur({ feature: "set-view-name" });
		}),
		setViewContext: U((t) => {
			s.setViewContext(t), Ur({ feature: "set-view-context" });
		}),
		setViewContextProperty: U((t, e) => {
			s.setViewContextProperty(t, e), Ur({ feature: "set-view-context-property" });
		}),
		getViewContext: U(() => (Ur({ feature: "set-view-context-property" }), s.getViewContext())),
		getInternalContext: U((t) => s.getInternalContext(t)),
		getInitConfiguration: U(() => Yn(s.initConfiguration)),
		addAction: (t, e) => {
			const n = cn("action");
			D(() => {
				s.addAction({
					name: yn(t),
					context: yn(e),
					startClocks: it(),
					type: ei.CUSTOM,
					handlingStack: n
				}), Ur({ feature: "add-action" });
			});
		},
		startAction: U((t, e) => {
			s.initConfiguration && !je(qe.START_STOP_ACTION) || s.startAction(yn(t), {
				type: yn(e && e.type),
				context: yn(e && e.context),
				actionKey: e && e.actionKey
			});
		}),
		stopAction: U((t, e) => {
			s.initConfiguration && !je(qe.START_STOP_ACTION) || s.stopAction(yn(t), {
				type: yn(e && e.type),
				context: yn(e && e.context),
				actionKey: e && e.actionKey
			});
		}),
		startResource: U((t, e) => {
			s.initConfiguration && !je(qe.START_STOP_RESOURCE) || s.startResource(yn(t), {
				type: yn(e && e.type),
				method: yn(e && e.method),
				context: yn(e && e.context),
				resourceKey: e && e.resourceKey
			});
		}),
		stopResource: U((t, e) => {
			s.initConfiguration && !je(qe.START_STOP_RESOURCE) || s.stopResource(yn(t), {
				type: yn(e && e.type),
				statusCode: e && e.statusCode,
				size: e && e.size,
				context: yn(e && e.context),
				resourceKey: e && e.resourceKey
			});
		}),
		addError: (t, e) => {
			const n = cn("error");
			D(() => {
				s.addError({
					error: t,
					handlingStack: n,
					context: yn(e),
					startClocks: it()
				}), Ur({ feature: "add-error" });
			});
		},
		addTiming: U((t, e) => {
			s.addTiming(yn(t), e);
		}),
		setViewLoadingTime: U(() => {
			const t = rt();
			s.setLoadingTime(t), Ur({ feature: "addViewLoadingTime" });
		}),
		setGlobalContext: Eo(a, Oo, Po, "set-global-context"),
		getGlobalContext: Eo(a, Oo, Lo, "get-global-context"),
		setGlobalContextProperty: Eo(a, Oo, Mo, "set-global-context-property"),
		removeGlobalContextProperty: Eo(a, Oo, Uo, "remove-global-context-property"),
		clearGlobalContext: Eo(a, Oo, Do, "clear-global-context"),
		setUser: Eo(a, Io, Po, "set-user"),
		getUser: Eo(a, Io, Lo, "get-user"),
		setUserProperty: Eo(a, Io, Mo, "set-user-property"),
		removeUserProperty: Eo(a, Io, Uo, "remove-user-property"),
		clearUser: Eo(a, Io, Do, "clear-user"),
		setAccount: Eo(a, No, Po, "set-account"),
		getAccount: Eo(a, No, Lo, "get-account"),
		setAccountProperty: Eo(a, No, Mo, "set-account-property"),
		removeAccountProperty: Eo(a, No, Uo, "remove-account-property"),
		clearAccount: Eo(a, No, Do, "clear-account"),
		startView: (t) => {
			const e = cn("view");
			D(() => {
				const n = "object" == typeof t ? t : { name: t };
				s.startView({
					...n,
					handlingStack: e
				}), Ur({ feature: "start-view" });
			});
		},
		stopSession: U(() => {
			s.stopSession(), Ur({ feature: "stop-session" });
		}),
		addFeatureFlagEvaluation: U((t, e) => {
			s.addFeatureFlagEvaluation(yn(t), yn(e)), Ur({ feature: "add-feature-flag-evaluation" });
		}),
		getSessionReplayLink: U(() => t.getSessionReplayLink()),
		startSessionReplayRecording: U((e) => {
			t.start(e), Ur({
				feature: "start-session-replay-recording",
				force: e && e.force
			});
		}),
		stopSessionReplayRecording: U(() => t.stop()),
		addDurationVital: (t, e) => {
			const n = cn("vital");
			D(() => {
				Ur({ feature: "add-duration-vital" }), s.addDurationVital({
					id: ht(),
					name: yn(t),
					type: ii,
					startClocks: X(e.startTime),
					duration: e.duration,
					context: yn(e && e.context),
					description: yn(e && e.description),
					handlingStack: n
				});
			});
		},
		startDurationVital: (t, e) => {
			const n = cn("vital");
			return D(() => (Ur({ feature: "start-duration-vital" }), s.startDurationVital(yn(t), {
				context: yn(e && e.context),
				description: yn(e && e.description),
				handlingStack: n
			})));
		},
		stopDurationVital: U((t, e) => {
			Ur({ feature: "stop-duration-vital" }), s.stopDurationVital("string" == typeof t ? yn(t) : t, {
				context: yn(e && e.context),
				description: yn(e && e.description)
			});
		}),
		startFeatureOperation: (t, e) => {
			const n = cn("vital");
			D(() => {
				Ur({
					feature: "add-operation-step-vital",
					action_type: "start"
				}), s.addOperationStepVital(t, "start", {
					...e,
					handlingStack: n
				});
			});
		},
		succeedFeatureOperation: U((t, e) => {
			Ur({
				feature: "add-operation-step-vital",
				action_type: "succeed"
			}), s.addOperationStepVital(t, "end", e);
		}),
		failFeatureOperation: U((t, e, n) => {
			Ur({
				feature: "add-operation-step-vital",
				action_type: "fail"
			}), s.addOperationStepVital(t, "end", n, e);
		})
	});
	return c;
}(function(t) {
	if (pr() && !fr("records") || !yu()) return {
		start: pt,
		stop: pt,
		getReplayStats: () => {},
		onRumStart: pt,
		isRecording: () => !1,
		getSessionReplayLink: () => {}
	};
	let { strategy: e, shouldStartImmediately: n } = function() {
		let t = 0;
		return {
			strategy: {
				start() {
					t = 1;
				},
				stop() {
					t = 2;
				},
				isRecording: () => !1,
				getSessionReplayLink: pt
			},
			shouldStartImmediately: (e) => 1 === t || 0 === t && !e.startSessionReplayRecordingManually
		};
	}();
	return {
		start: (t) => e.start(t),
		stop: () => e.stop(),
		getSessionReplayLink: () => e.getSessionReplayLink(),
		onRumStart: function(r, o, i, s, a, c) {
			let u;
			e = bu(o, r, i, s, t, function() {
				u || (null != a || (a = mu(o, "Datadog Session Replay", () => e.stop())), a && (u = du(o, a, 1)));
				return u;
			}, c), n(o) && e.start();
		},
		isRecording: () => 3 === gu() && e.isRecording(),
		getReplayStats: (t) => 3 === gu() ? function(t) {
			return null == iu ? void 0 : iu.get(t);
		}(t) : void 0
	};
}(async function() {
	try {
		return await Su();
	} catch (t) {
		fu({
			error: t,
			source: "Recorder",
			scriptType: "module"
		});
	}
}), function() {
	let t;
	return {
		onRumStart: function(e, n, r, o, i, s) {
			const a = o.findTrackedSession();
			if (!a) return;
			if (!ts(a.id, r.profilingSampleRate)) return;
			const c = function(t) {
				let e = { status: "starting" };
				return t.register(0, ({ eventType: t }) => t !== Jo.VIEW && t !== Jo.LONG_TASK && t !== Jo.ACTION && t !== Jo.VITAL ? kr : {
					type: t,
					_dd: { profiling: e }
				}), {
					get: () => e,
					set: (t) => {
						e = t;
					}
				};
			}(n);
			void 0 !== x().Profiler ? async function() {
				try {
					return await Eu();
				} catch (t) {
					fu({
						error: t,
						source: "Profiler",
						scriptType: "module"
					});
				}
			}().then((n) => {
				n ? (t = n(r, e, o, c, s, i, void 0), t.start()) : c.set({
					status: "error",
					error_reason: "failed-to-lazy-load"
				});
			}).catch($) : c.set({
				status: "error",
				error_reason: "not-supported-by-browser"
			});
		},
		stop: () => {
			null == t || t.stop();
		}
	};
}(), {
	startDeflateWorker: mu,
	createDeflateEncoder: du,
	sdkName: "rum"
});
(function(t, e, n) {
	const r = t[e];
	r && !r.q && r.version && g.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."), t[e] = n, r && r.q && r.q.forEach((t) => b(t, "onReady callback threw an error:")());
})(x(), "DD_RUM", ku);
const Tu = (Au = function(t, e) {
	ku.addError(t instanceof Error ? t : new Error(String(t)), e);
}, Cu = a.O11Y_INTERNALS, (...t) => {
	try {
		return Au(...t);
	} catch (e) {
		((t, e) => {
			d(t, "Error suppressed in wrapped function", e);
		})(Cu, e);
		return;
	}
});
var Au, Cu;
async function Ru(t, e) {
	if (t.status >= 500) return {};
	try {
		const n = await t.json(), r = n?.error?.sub_reason, o = "string" == typeof r && "" !== r ? r : void 0, i = n?.error?.details?.error_code || n?.error?.resource || void 0;
		if (void 0 !== i) return {
			reason: i,
			subReason: o
		};
		const s = n?.error?.message ?? "";
		if (403 === t.status && /bind[ _]attestation/i.test(s)) {
			if (/freshness/i.test(s)) return {
				reason: "bind_attestation_stale",
				subReason: o
			};
			!1 !== e?.reportDrift && Tu(/* @__PURE__ */ new Error("ccr_attestation_403_unclassified"), { source: "ccr_attestation_403_unclassified" });
		}
		return { subReason: o };
	} catch {
		return {};
	}
}
const xu = /[/\\]|%2f|%5c/i, Iu = /* @__PURE__ */ new Set([
	".",
	"%2e",
	"..",
	".%2e",
	"%2e.",
	"%2e%2e"
]);
function Ou(t) {
	return null == t || "" === t || function(t) {
		const e = t.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g, "");
		for (const n of e.split(xu)) if (Iu.has(n.toLowerCase())) return !0;
		return !1;
	}(t);
}
function Nu(t) {
	return Ou(t) ? "invalid-session-id" : encodeURIComponent(t);
}
function Lu(t) {
	return {
		"anthropic-version": "2023-06-01",
		"anthropic-beta": "ccr-byoc-2025-07-29",
		"anthropic-client-feature": "ccr",
		"x-organization-uuid": t
	};
}
const Pu = 1e3, Mu = 3e4, Uu = 250;
var Du = class extends Error {
	constructor(t, e, n, r, o) {
		super(`streamCcrV2ClientEvents open: ${t}`), this.status = t, this.fatal = e, this.retryAfterMs = n, this.serverReason = r, this.serverSubReason = o, this.name = "CcrStreamOpenError";
	}
};
function $u(t, e) {
	if (void 0 === t?.headers) return void 0 === e ? t : {
		...t,
		headers: { "last-event-id": String(e) }
	};
	const n = t.headers instanceof Headers ? [...t.headers.entries()] : Array.isArray(t.headers) ? t.headers : Object.entries(t.headers), r = {};
	for (const [o, i] of n) "last-event-id" !== o.toLowerCase() && (r[o] = i);
	return void 0 !== e && (r["last-event-id"] = String(e)), {
		...t,
		headers: r
	};
}
function Vu(t) {
	if (!t) return;
	const e = Number(t);
	if (Number.isFinite(e)) return Math.max(0, 1e3 * e);
	const n = Date.parse(t);
	return Number.isFinite(n) ? Math.max(0, n - Date.now()) : void 0;
}
const zu = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/, qu = /^[0-9a-f]{64}$/;
function Fu(t) {
	const e = t.payload;
	if (!e) return null;
	const n = Number(t.sequence_num ?? NaN), r = Number.isFinite(n) && n > 0 ? n : void 0, o = void 0 !== r ? {
		kind: "seq_only",
		seq: r
	} : null;
	if ("control_request" === e.type) {
		const n = e.request;
		return "rewind_conversation" === n?.subtype && e.request_id && "string" == typeof n.target_message_uuid && "client" === t.source ? {
			kind: "rewind_requested",
			dedupKey: e.uuid ?? e.request_id,
			seq: r,
			requestId: e.request_id,
			targetMessageUuid: n.target_message_uuid
		} : "mcp_message" === n?.subtype && "worker" === t.source && "string" == typeof n.server_name && e.request_id ? {
			kind: "sdk_mcp_message",
			seq: r,
			requestId: e.request_id,
			serverName: n.server_name,
			message: n.message
		} : "can_use_tool" === n?.subtype && e.request_id ? {
			kind: "permission_request",
			dedupKey: e.uuid ?? e.request_id,
			seq: r,
			request: {
				requestId: e.request_id,
				toolName: n.tool_name ?? "",
				toolUseId: n.tool_use_id,
				input: n.input ?? {},
				suggestions: n.permission_suggestions
			}
		} : o;
	}
	if ("mcp_auth_required" === e.type) {
		const n = e;
		return "worker" === t.source && "string" == typeof n.toolbox_mcp_server_id && zu.test(n.toolbox_mcp_server_id) ? {
			kind: "mcp_auth_required",
			dedupKey: n.uuid,
			seq: r,
			serverUuid: n.toolbox_mcp_server_id,
			errorCode: "string" == typeof n.error_code ? n.error_code : "mcp_auth_required",
			toolUseId: "string" == typeof n.tool_use_id && n.tool_use_id ? n.tool_use_id : void 0
		} : o;
	}
	if ("synced_file_changed" === e.type) {
		const t = e;
		return "string" != typeof t.path || 0 === t.path.length || t.path.length > 400 || "string" != typeof t.hash || !qu.test(t.hash) ? o : {
			kind: "synced_file_changed",
			dedupKey: t.uuid,
			seq: r,
			path: t.path.startsWith("/") ? t.path : `/${t.path}`,
			hash: t.hash
		};
	}
	if ("control_response" === e.type) {
		const n = e.response, s = n?.request_id;
		if (!0 === n?.response?.rewound && s?.startsWith("rewind-") && "string" == typeof n.response.targetMessageUuid && "worker" === t.source) return {
			kind: "conversation_rewound",
			dedupKey: e.uuid ?? s,
			seq: r,
			targetMessageUuid: n.response.targetMessageUuid,
			requestId: s
		};
		if (!s) return o;
		if (s.startsWith("ptc-") && "worker" === t.source) {
			const t = n?.response?.staging, o = "object" == typeof t && null !== t && "boolean" == typeof t.ok && (t.ok ? (i = t.outputs, Array.isArray(i) && i.every((t) => "object" == typeof t && null !== t && "string" == typeof t.lane_path && "string" == typeof t.etag)) : function(t) {
				const e = t;
				return "string" == typeof e.error_code && (void 0 === e.detail || null === e.detail || "string" == typeof e.detail);
			}(t));
			return {
				kind: "plugin_tool_response",
				dedupKey: e.uuid ?? s,
				seq: r,
				requestId: s,
				outcome: "error" === n?.subtype ? {
					kind: "dispatch_error",
					error: "string" == typeof n.error ? n.error : "unknown"
				} : o ? {
					kind: "body",
					body: t
				} : {
					kind: "dispatch_error",
					error: "malformed-body"
				}
			};
		}
		return {
			kind: "permission_resolved",
			dedupKey: e.uuid,
			seq: r,
			requestId: s
		};
	}
	var i;
	const s = e;
	return s.timestamp || s.created_at || !t.created_at || (s.created_at = t.created_at), {
		kind: "message",
		dedupKey: e.uuid ?? e.request_id,
		seq: r,
		payload: s,
		..."client" === t.source && { clientOrigin: !0 }
	};
}
function Bu(t, e, n, r, o, s) {
	return function(t, e, n, r, o) {
		let s, a, c, u, l = !1, d = o?.fromSequenceNum, f = !1, p = 0, h = !1, m = !0;
		const g = () => void 0 === u ? void 0 : Date.now() - u;
		let v, y = 0, _ = 0, b = !1;
		const w = () => {
			const t = Math.min(Mu, Pu * 2 ** Math.min(p, 5));
			return Math.max(Uu, Math.random() * t);
		}, S = () => {
			void 0 !== a && (clearTimeout(a), a = void 0);
		}, E = (t = 0) => {
			void 0 !== a && clearTimeout(a), a = setTimeout(() => {
				o?.onStreamError?.({
					kind: "idle_restart",
					sinceLastDeliveryMs: g()
				}), s?.abort();
			}, 35e3 + t);
		}, k = (t) => {
			try {
				o?.onFrameError?.(t);
			} catch {}
		}, T = (t, e) => {
			const n = e instanceof Error ? e.name : typeof e;
			if (void 0 === t) return void k({
				strikes: 0,
				disposition: "dropped_no_id",
				errorName: n
			});
			const r = t === v ? y + 1 : 1;
			if (v = t, y = r, r >= 3) return v = void 0, y = 0, d = void 0 === d ? t : Math.max(d, t), void k({
				seq: t,
				strikes: r,
				disposition: "skipped_poison",
				errorName: n
			});
			b = !0, _++, s?.abort(), k({
				seq: t,
				strikes: r,
				disposition: "redial_replay",
				errorName: n
			});
		};
		return (async () => {
			for (; !l && !f;) {
				const a = c;
				c = void 0, s = new AbortController(), m = !0, b = !1, E();
				const k = void 0 !== d ? `?from_sequence_num=${encodeURIComponent(String(d))}` : "", A = Date.now(), C = await o?.makeDeviceAttestationHeader?.().catch(() => {});
				if (l) break;
				if (s.signal.aborted) continue;
				if (void 0 !== a && void 0 === C) {
					S(), f = !0, o?.onStreamError?.({
						kind: "fatal",
						status: a.status,
						serverReason: a.serverReason,
						serverSubReason: a.serverSubReason
					});
					break;
				}
				if (await i(`/v1/code/sessions/${Nu(n)}/events/stream${k}`, {
					signal: s.signal,
					credentials: "include",
					openWhenHidden: !0,
					fetch: (e, n) => t(e, $u(n, d)),
					headers: {
						...Lu(e),
						Accept: "text/event-stream",
						...C ? { "X-Device-Attestation": C } : {}
					},
					async onopen(t) {
						m = !0;
						const e = t.headers.get("content-type") ?? "";
						if (t.ok && e.includes("text/event-stream")) return Promise.resolve();
						const n = t.ok || t.status >= 400 && t.status < 500 && 429 !== t.status, r = 429 === t.status ? Vu(t.headers.get("retry-after")) : void 0, { reason: o, subReason: i } = n ? await Ru(t) : {};
						return Promise.reject(new Du(t.status, n, r, o, i));
					},
					onmessage(t) {
						if (b) return;
						let e;
						if (E(), m ? t.event && (m = !1) : (p = 0, h = !1, u = Date.now()), t.id) {
							const n = Number(t.id);
							Number.isFinite(n) && (e = n);
						}
						if ("client_event" !== t.event && void 0 !== e && (d = e), "catch_up_truncated" !== t.event) {
							if ("session_update" === t.event && t.data) try {
								o?.onSessionUpdate?.(JSON.parse(t.data));
							} catch {}
							else if ("ephemeral_event" === t.event && t.data) try {
								o?.onEphemeralEvent?.(JSON.parse(t.data));
							} catch {}
							else if ("client_event" === t.event) if (t.data) {
								try {
									r(JSON.parse(t.data));
								} catch (n) {
									T(e, n);
									return;
								}
								void 0 !== e && (v = void 0, y = 0, _ = 0, d = e);
							} else void 0 !== e && (d = e);
						} else o?.onCatchUpTruncated?.();
					},
					onclose() {
						throw new Error("streamCcrV2ClientEvents: server closed");
					},
					onerror(t) {
						const e = t instanceof Du ? t : void 0;
						if (e?.fatal) throw 410 === e.status ? (p++, d = void 0, o?.onStreamError?.({
							kind: "cursor_reset",
							status: e.status,
							sinceLastDeliveryMs: g()
						})) : 403 !== e.status || void 0 === C || h ? 403 !== e.status || void 0 !== C || void 0 === o?.makeDeviceAttestationHeader || h ? (f = !0, o?.onStreamError?.({
							kind: "fatal",
							status: e.status,
							serverReason: e.serverReason,
							serverSubReason: e.serverSubReason
						})) : (h = !0, c = e, p++, o?.onStreamError?.({
							kind: "retry",
							status: e.status,
							sinceLastDeliveryMs: g()
						})) : (h = !0, p++, o?.onStreamError?.({
							kind: "retry",
							status: e.status,
							sinceLastDeliveryMs: g()
						})), t;
						if (void 0 === e?.retryAfterMs && void 0 !== C && Date.now() - A > 24e4) throw p++, o?.onStreamError?.({
							kind: "retry",
							status: e?.status,
							sinceLastDeliveryMs: g()
						}), t;
						const n = void 0 !== e?.retryAfterMs ? Math.min(Mu, Math.max(Uu, e.retryAfterMs)) : w();
						return p++, E(n), o?.onStreamError?.({
							kind: "retry",
							status: e?.status,
							retryAfterMs: e?.retryAfterMs,
							sinceLastDeliveryMs: g()
						}), n;
					}
				}).catch(() => {}), S(), l || f) break;
				const R = b ? Math.max(Uu, Math.random() * Math.min(Mu, Pu * 2 ** Math.min(Math.max(_ - 1, 0), 5))) : m ? void 0 !== c ? Math.max(w(), 1500) : w() : Math.max(Uu, Math.random() * Pu);
				await new Promise((t) => setTimeout(t, R));
			}
		})(), () => {
			l = !0, S(), s?.abort();
		};
	}(async (t, e = {}) => fetch(t, {
		...e,
		credentials: "include"
	}), t, e, (t) => {
		const e = Fu(t);
		e && n(e);
	}, {
		fromSequenceNum: r,
		onFrameError: o,
		onCatchUpTruncated: () => s("catch_up_truncated"),
		onStreamError: ({ kind: t, status: e, serverReason: n, serverSubReason: r }) => {
			"fatal" === t ? s(403 === e ? "auth_rejected" : "fatal", {
				serverReason: n,
				serverSubReason: r
			}) : "cursor_reset" === t && s("cursor_reset");
		}
	});
}
const ju = new class {
	#t = /* @__PURE__ */ new Map();
	#e = /* @__PURE__ */ new Map();
	#n;
	#r;
	#o;
	constructor(t) {
		this.#r = t?.openStream ?? Bu, this.#o = t?.now ?? (() => Date.now());
	}
	attachPort(t) {
		this.#e.set(t, this.#o()), t.onmessage = (e) => this.#i(t, e.data), t.start?.(), this.#s(t, {
			t: "hello",
			protocolVersion: 2
		}), this.#a();
	}
	#a() {
		void 0 === this.#n && (this.#n = setInterval(() => this.#c(), 16));
	}
	#i(t, e) {
		switch (this.#e.set(t, this.#o()), e.t) {
			case "ping":
				for (const e of this.#t.values()) e.ports.has(t) && (e.lastTouch = this.#o());
				this.#s(t, {
					t: "pong",
					n: e.n
				});
				return;
			case "sub":
				"string" != typeof e.accountUuid ? this.#s(t, {
					t: "truncated",
					sessionId: e.sessionId,
					cause: "identity_mismatch"
				}) : this.#u(t, e.sessionId, e.orgUuid, e.accountUuid, e.fromSequenceNum);
				return;
			case "unsub":
				this.#l(t, e.sessionId);
				return;
		}
	}
	#u(t, e, n, r, o) {
		let i = this.#t.get(e);
		if (void 0 === i || i.orgUuid === n && i.accountUuid === r) {
			if (!i) {
				const t = o ?? 0, s = {
					sessionId: e,
					orgUuid: n,
					accountUuid: r,
					ports: /* @__PURE__ */ new Set(),
					pending: [],
					lastTouch: this.#o(),
					anchorSeq: t,
					unsubscribe: () => {}
				};
				s.unsubscribe = this.#r(n, e, (t) => {
					s.pending.push(t);
				}, o, (t) => {
					for (const n of s.ports) this.#s(n, {
						t: "frameError",
						sessionId: e,
						...t
					});
				}, (t, n) => {
					for (const r of s.ports) this.#s(r, {
						t: "truncated",
						sessionId: e,
						cause: t,
						...n
					});
					s.unsubscribe(), this.#t.get(e) === s && (this.#t.delete(e), this.#d());
				}), this.#t.set(e, s), i = s, this.#a(), this.#f(e);
			}
			i.ports.add(t), i.lastTouch = this.#o(), this.#s(t, {
				t: "subAck",
				sessionId: e,
				anchorSeq: i.anchorSeq
			});
		} else this.#s(t, {
			t: "truncated",
			sessionId: e,
			cause: "identity_mismatch"
		});
	}
	#l(t, e) {
		const n = this.#t.get(e);
		n && (n.ports.delete(t), 0 === n.ports.size && (n.unsubscribe(), this.#t.delete(e), this.#d()));
	}
	#d() {
		0 === this.#t.size && 0 === this.#e.size && void 0 !== this.#n && (clearInterval(this.#n), this.#n = void 0);
	}
	#f(t) {
		for (; this.#t.size > 2;) {
			let e;
			for (const n of this.#t.values()) n.sessionId !== t && (!e || n.lastTouch < e.lastTouch) && (e = n);
			if (!e) return;
			e.unsubscribe();
			for (const t of e.ports) this.#s(t, {
				t: "evicted",
				sessionId: e.sessionId
			});
			this.#t.delete(e.sessionId);
		}
	}
	#c() {
		this.#p();
		for (const t of this.#t.values()) {
			if (0 === t.pending.length) continue;
			const e = t.pending;
			t.pending = [], t.lastTouch = this.#o();
			const n = {
				t: "batch",
				sessionId: t.sessionId,
				events: e
			};
			for (const r of t.ports) this.#s(r, n);
		}
	}
	#p() {
		const t = this.#o() - 15e4;
		for (const [e, n] of this.#e) n < t && this.#h(e);
	}
	#h(t) {
		this.#e.delete(t);
		try {
			t.close();
		} catch {}
		for (const [e, n] of this.#t) n.ports.delete(t), 0 === n.ports.size && (n.unsubscribe(), this.#t.delete(e));
		this.#d();
	}
	#s(t, e) {
		try {
			t.postMessage(e);
		} catch {
			this.#h(t);
		}
	}
	_sessions() {
		return this.#t;
	}
}();
self.addEventListener("connect", (t) => {
	const e = t.ports[0];
	e && ju.attachPort(e);
});
export { ft as $, Jo as A, Hn as B, gs as C, Xi as D, ms as E, Mr as F, fn as G, Dn as H, gr as I, ke as J, qe as K, pr as L, go as M, jr as N, Mi as O, Lr as P, pt as Q, dr as R, ys as S, hs as T, $n as U, Gn as V, dn as W, Tt as X, Ut as Y, yt as Z, Bs as _, ru as a, at, ws as b, pc as c, q as ct, Zs as d, $ as dt, W as et, na as f, x as ft, Ks as g, Xs as h, su as i, tt as it, Zo as j, ei as k, hc as l, z as lt, Qs as m, au as n, it as nt, vc as o, rt as ot, Js as p, g as pt, je as q, uu as r, st as rt, gc as s, G as st, cu as t, ct as tt, Ys as u, U as ut, js as v, ps as w, vs as x, Gs as y, ar as z };
